JezK
Edit File: wc-payments-settings-spotlight.js
/*! For license information please see wc-payments-settings-spotlight.js.LICENSE.txt */ (()=>{var e={4392(e){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(e,o,r){return n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,n,o){var r=[null];r.push.apply(r,n);var i=new(Function.bind.apply(e,r));return o&&t(i,o.prototype),i},n.apply(null,arguments)}function o(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var i=Object.hasOwnProperty,a=Object.setPrototypeOf,c=Object.isFrozen,s=Object.getPrototypeOf,l=Object.getOwnPropertyDescriptor,m=Object.freeze,p=Object.seal,u=Object.create,d="undefined"!=typeof Reflect&&Reflect,f=d.apply,h=d.construct;f||(f=function(e,t,n){return e.apply(t,n)}),m||(m=function(e){return e}),p||(p=function(e){return e}),h||(h=function(e,t){return n(e,o(t))});var y,g=A(Array.prototype.forEach),w=A(Array.prototype.pop),_=A(Array.prototype.push),v=A(String.prototype.toLowerCase),b=A(String.prototype.toString),E=A(String.prototype.match),T=A(String.prototype.replace),N=A(String.prototype.indexOf),x=A(String.prototype.trim),S=A(RegExp.prototype.test),R=(y=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h(y,t)});function A(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return f(e,t,o)}}function O(e,t,n){var o;n=null!==(o=n)&&void 0!==o?o:v,a&&a(e,null);for(var r=t.length;r--;){var i=t[r];if("string"==typeof i){var s=n(i);s!==i&&(c(t)||(t[r]=s),i=s)}e[i]=!0}return e}function k(e){var t,n=u(null);for(t in e)!0===f(i,e,[t])&&(n[t]=e[t]);return n}function P(e,t){for(;null!==e;){var n=l(e,t);if(n){if(n.get)return A(n.get);if("function"==typeof n.value)return A(n.value)}e=s(e)}return function(e){return console.warn("fallback value for",e),null}}var L=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),M=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),D=m(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),I=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),j=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),F=m(["#text"]),H=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),z=m(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),B=m(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),W=p(/\{\{[\w\W]*|[\w\W]*\}\}/gm),G=p(/<%[\w\W]*|[\w\W]*%>/gm),$=p(/\${[\w\W]*}/gm),q=p(/^data-[\-\w.\u00B7-\uFFFF]/),V=p(/^aria-[\-\w]+$/),K=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Y=p(/^(?:\w+script|data):/i),X=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=p(/^html$/i),Z=p(/^[a-z][.\w]*(-[.\w]+)+$/i),Q=function(){return"undefined"==typeof window?null:window};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q(),r=function(e){return t(e)};if(r.version="2.5.6",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;var i=n.document,a=n.document,c=n.DocumentFragment,s=n.HTMLTemplateElement,l=n.Node,p=n.Element,u=n.NodeFilter,d=n.NamedNodeMap,f=void 0===d?n.NamedNodeMap||n.MozNamedAttrMap:d,h=n.HTMLFormElement,y=n.DOMParser,A=n.trustedTypes,ee=p.prototype,te=P(ee,"cloneNode"),ne=P(ee,"nextSibling"),oe=P(ee,"childNodes"),re=P(ee,"parentNode");if("function"==typeof s){var ie=a.createElement("template");ie.content&&ie.content.ownerDocument&&(a=ie.content.ownerDocument)}var ae=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var o=null,r="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(r)&&(o=n.currentScript.getAttribute(r));var i="dompurify"+(o?"#"+o:"");try{return t.createPolicy(i,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(A,i),ce=ae?ae.createHTML(""):"",se=a,le=se.implementation,me=se.createNodeIterator,pe=se.createDocumentFragment,ue=se.getElementsByTagName,de=i.importNode,fe={};try{fe=k(a).documentMode?a.documentMode:{}}catch(e){}var he={};r.isSupported="function"==typeof re&&le&&void 0!==le.createHTMLDocument&&9!==fe;var ye,ge,we=W,_e=G,ve=$,be=q,Ee=V,Te=Y,Ne=X,xe=Z,Se=K,Re=null,Ae=O({},[].concat(o(L),o(C),o(M),o(I),o(F))),Oe=null,ke=O({},[].concat(o(H),o(z),o(B),o(U))),Pe=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Le=null,Ce=null,Me=!0,De=!0,Ie=!1,je=!0,Fe=!1,He=!0,ze=!1,Be=!1,Ue=!1,We=!1,Ge=!1,$e=!1,qe=!0,Ve=!1,Ke=!0,Ye=!1,Xe={},Je=null,Ze=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Qe=null,et=O({},["audio","video","img","source","image","track"]),tt=null,nt=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",rt="http://www.w3.org/2000/svg",it="http://www.w3.org/1999/xhtml",at=it,ct=!1,st=null,lt=O({},[ot,rt,it],b),mt=["application/xhtml+xml","text/html"],pt=null,ut=a.createElement("form"),dt=function(e){return e instanceof RegExp||e instanceof Function},ft=function(t){pt&&pt===t||(t&&"object"===e(t)||(t={}),t=k(t),ye=ye=-1===mt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,ge="application/xhtml+xml"===ye?b:v,Re="ALLOWED_TAGS"in t?O({},t.ALLOWED_TAGS,ge):Ae,Oe="ALLOWED_ATTR"in t?O({},t.ALLOWED_ATTR,ge):ke,st="ALLOWED_NAMESPACES"in t?O({},t.ALLOWED_NAMESPACES,b):lt,tt="ADD_URI_SAFE_ATTR"in t?O(k(nt),t.ADD_URI_SAFE_ATTR,ge):nt,Qe="ADD_DATA_URI_TAGS"in t?O(k(et),t.ADD_DATA_URI_TAGS,ge):et,Je="FORBID_CONTENTS"in t?O({},t.FORBID_CONTENTS,ge):Ze,Le="FORBID_TAGS"in t?O({},t.FORBID_TAGS,ge):{},Ce="FORBID_ATTR"in t?O({},t.FORBID_ATTR,ge):{},Xe="USE_PROFILES"in t&&t.USE_PROFILES,Me=!1!==t.ALLOW_ARIA_ATTR,De=!1!==t.ALLOW_DATA_ATTR,Ie=t.ALLOW_UNKNOWN_PROTOCOLS||!1,je=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Fe=t.SAFE_FOR_TEMPLATES||!1,He=!1!==t.SAFE_FOR_XML,ze=t.WHOLE_DOCUMENT||!1,We=t.RETURN_DOM||!1,Ge=t.RETURN_DOM_FRAGMENT||!1,$e=t.RETURN_TRUSTED_TYPE||!1,Ue=t.FORCE_BODY||!1,qe=!1!==t.SANITIZE_DOM,Ve=t.SANITIZE_NAMED_PROPS||!1,Ke=!1!==t.KEEP_CONTENT,Ye=t.IN_PLACE||!1,Se=t.ALLOWED_URI_REGEXP||Se,at=t.NAMESPACE||it,Pe=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&dt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Pe.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&dt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Pe.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Pe.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Fe&&(De=!1),Ge&&(We=!0),Xe&&(Re=O({},o(F)),Oe=[],!0===Xe.html&&(O(Re,L),O(Oe,H)),!0===Xe.svg&&(O(Re,C),O(Oe,z),O(Oe,U)),!0===Xe.svgFilters&&(O(Re,M),O(Oe,z),O(Oe,U)),!0===Xe.mathMl&&(O(Re,I),O(Oe,B),O(Oe,U))),t.ADD_TAGS&&(Re===Ae&&(Re=k(Re)),O(Re,t.ADD_TAGS,ge)),t.ADD_ATTR&&(Oe===ke&&(Oe=k(Oe)),O(Oe,t.ADD_ATTR,ge)),t.ADD_URI_SAFE_ATTR&&O(tt,t.ADD_URI_SAFE_ATTR,ge),t.FORBID_CONTENTS&&(Je===Ze&&(Je=k(Je)),O(Je,t.FORBID_CONTENTS,ge)),Ke&&(Re["#text"]=!0),ze&&O(Re,["html","head","body"]),Re.table&&(O(Re,["tbody"]),delete Le.tbody),m&&m(t),pt=t)},ht=O({},["mi","mo","mn","ms","mtext"]),yt=O({},["foreignobject","annotation-xml"]),gt=O({},["title","style","font","a","script"]),wt=O({},C);O(wt,M),O(wt,D);var _t=O({},I);O(_t,j);var vt=function(e){_(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ce}catch(t){e.remove()}}},bt=function(e,t){try{_(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){_(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Oe[e])if(We||Ge)try{vt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Et=function(e){var t,n;if(Ue)e="<remove></remove>"+e;else{var o=E(e,/^[\r\n\t ]+/);n=o&&o[0]}"application/xhtml+xml"===ye&&at===it&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var r=ae?ae.createHTML(e):e;if(at===it)try{t=(new y).parseFromString(r,ye)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(at,"template",null);try{t.documentElement.innerHTML=ct?ce:r}catch(e){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(a.createTextNode(n),i.childNodes[0]||null),at===it?ue.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},Tt=function(e){return me.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null,!1)},Nt=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof f)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},xt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},St=function(e,t,n){he[e]&&g(he[e],function(e){e.call(r,t,n,pt)})},Rt=function(e){var t;if(St("beforeSanitizeElements",e,null),Nt(e))return vt(e),!0;if(S(/[\u0080-\uFFFF]/,e.nodeName))return vt(e),!0;var n=ge(e.nodeName);if(St("uponSanitizeElement",e,{tagName:n,allowedTags:Re}),e.hasChildNodes()&&!xt(e.firstElementChild)&&(!xt(e.content)||!xt(e.content.firstElementChild))&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return vt(e),!0;if("select"===n&&S(/<template/i,e.innerHTML))return vt(e),!0;if(7===e.nodeType)return vt(e),!0;if(He&&8===e.nodeType&&S(/<[/\w]/g,e.data))return vt(e),!0;if(!Re[n]||Le[n]){if(!Le[n]&&Ot(n)){if(Pe.tagNameCheck instanceof RegExp&&S(Pe.tagNameCheck,n))return!1;if(Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(n))return!1}if(Ke&&!Je[n]){var o=re(e)||e.parentNode,i=oe(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a){var c=te(i[a],!0);c.__removalCount=(e.__removalCount||0)+1,o.insertBefore(c,ne(e))}}return vt(e),!0}return e instanceof p&&!function(e){var t=re(e);t&&t.tagName||(t={namespaceURI:at,tagName:"template"});var n=v(e.tagName),o=v(t.tagName);return!!st[e.namespaceURI]&&(e.namespaceURI===rt?t.namespaceURI===it?"svg"===n:t.namespaceURI===ot?"svg"===n&&("annotation-xml"===o||ht[o]):Boolean(wt[n]):e.namespaceURI===ot?t.namespaceURI===it?"math"===n:t.namespaceURI===rt?"math"===n&&yt[o]:Boolean(_t[n]):e.namespaceURI===it?!(t.namespaceURI===rt&&!yt[o])&&!(t.namespaceURI===ot&&!ht[o])&&!_t[n]&&(gt[n]||!wt[n]):!("application/xhtml+xml"!==ye||!st[e.namespaceURI]))}(e)?(vt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(Fe&&3===e.nodeType&&(t=e.textContent,t=T(t,we," "),t=T(t,_e," "),t=T(t,ve," "),e.textContent!==t&&(_(r.removed,{element:e.cloneNode()}),e.textContent=t)),St("afterSanitizeElements",e,null),!1):(vt(e),!0)},At=function(e,t,n){if(qe&&("id"===t||"name"===t)&&(n in a||n in ut))return!1;if(De&&!Ce[t]&&S(be,t));else if(Me&&S(Ee,t));else if(!Oe[t]||Ce[t]){if(!(Ot(e)&&(Pe.tagNameCheck instanceof RegExp&&S(Pe.tagNameCheck,e)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(e))&&(Pe.attributeNameCheck instanceof RegExp&&S(Pe.attributeNameCheck,t)||Pe.attributeNameCheck instanceof Function&&Pe.attributeNameCheck(t))||"is"===t&&Pe.allowCustomizedBuiltInElements&&(Pe.tagNameCheck instanceof RegExp&&S(Pe.tagNameCheck,n)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(n))))return!1}else if(tt[t]);else if(S(Se,T(n,Ne,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==N(n,"data:")||!Qe[e])if(Ie&&!S(Te,T(n,Ne,"")));else if(n)return!1;return!0},Ot=function(e){return"annotation-xml"!==e&&E(e,xe)},kt=function(t){var n,o,i,a;St("beforeSanitizeAttributes",t,null);var c=t.attributes;if(c){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe};for(a=c.length;a--;){var l=n=c[a],m=l.name,p=l.namespaceURI;if(o="value"===m?n.value:x(n.value),i=ge(m),s.attrName=i,s.attrValue=o,s.keepAttr=!0,s.forceKeepAttr=void 0,St("uponSanitizeAttribute",t,s),o=s.attrValue,He&&S(/((--!?|])>)|<\/(style|title)/i,o))bt(m,t);else if(!s.forceKeepAttr&&(bt(m,t),s.keepAttr))if(je||!S(/\/>/i,o)){Fe&&(o=T(o,we," "),o=T(o,_e," "),o=T(o,ve," "));var u=ge(t.nodeName);if(At(u,i,o)){if(!Ve||"id"!==i&&"name"!==i||(bt(m,t),o="user-content-"+o),ae&&"object"===e(A)&&"function"==typeof A.getAttributeType)if(p);else switch(A.getAttributeType(u,i)){case"TrustedHTML":o=ae.createHTML(o);break;case"TrustedScriptURL":o=ae.createScriptURL(o)}try{p?t.setAttributeNS(p,m,o):t.setAttribute(m,o),Nt(t)?vt(t):w(r.removed)}catch(e){}}}else bt(m,t)}St("afterSanitizeAttributes",t,null)}},Pt=function e(t){var n,o=Tt(t);for(St("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)St("uponSanitizeShadowNode",n,null),Rt(n)||(n.content instanceof c&&e(n.content),kt(n));St("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(t){var o,a,s,m,p,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((ct=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!xt(t)){if("function"!=typeof t.toString)throw R("toString is not a function");if("string"!=typeof(t=t.toString()))throw R("dirty is not a string, aborting")}if(!r.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(xt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Be||ft(u),r.removed=[],"string"==typeof t&&(Ye=!1),Ye){if(t.nodeName){var d=ge(t.nodeName);if(!Re[d]||Le[d])throw R("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof l)1===(a=(o=Et("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!We&&!Fe&&!ze&&-1===t.indexOf("<"))return ae&&$e?ae.createHTML(t):t;if(!(o=Et(t)))return We?null:$e?ce:""}o&&Ue&&vt(o.firstChild);for(var f=Tt(Ye?t:o);s=f.nextNode();)3===s.nodeType&&s===m||Rt(s)||(s.content instanceof c&&Pt(s.content),kt(s),m=s);if(m=null,Ye)return t;if(We){if(Ge)for(p=pe.call(o.ownerDocument);o.firstChild;)p.appendChild(o.firstChild);else p=o;return(Oe.shadowroot||Oe.shadowrootmod)&&(p=de.call(i,p,!0)),p}var h=ze?o.outerHTML:o.innerHTML;return ze&&Re["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&S(J,o.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+h),Fe&&(h=T(h,we," "),h=T(h,_e," "),h=T(h,ve," ")),ae&&$e?ae.createHTML(h):h},r.setConfig=function(e){ft(e),Be=!0},r.clearConfig=function(){pt=null,Be=!1},r.isValidAttribute=function(e,t,n){pt||ft({});var o=ge(e),r=ge(t);return At(o,r,n)},r.addHook=function(e,t){"function"==typeof t&&(he[e]=he[e]||[],_(he[e],t))},r.removeHook=function(e){if(he[e])return w(he[e])},r.removeHooks=function(e){he[e]&&(he[e]=[])},r.removeAllHooks=function(){he={}},r}()}()}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var r=o.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=o[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.p=window.wcpayAssets.url,(()=>{"use strict";var e={};n.r(e),n.d(e,{activatePmPromotion:()=>j,dismissPmPromotion:()=>F,updateErrorForPmPromotions:()=>I,updatePmPromotions:()=>D});var t={};n.r(t),n.d(t,{getPmPromotions:()=>z});var o={};n.r(o),n.d(o,{getPmPromotions:()=>B,getPmPromotionsError:()=>U});const r=window.React,i=window.ReactDOM,a=window.wp.components,c=window.wp.primitives,s=window.ReactJSXRuntime,l=(0,s.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(c.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})}),m=window.wp.i18n,p=window.wp.a11y,u=window.wp.element,d=(0,u.forwardRef)(function({icon:e,size:t=24,...n},o){return(0,u.cloneElement)(e,{width:t,height:t,...n,ref:o})});function f(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=f(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}const h=function(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=f(e))&&(o&&(o+=" "),o+=t);return o},y=window.lodash,g=document.getElementById("wpbody-content")||document.body,w=(e,t)=>!(!t||t!==e.target&&!(e.target instanceof Node&&t.contains(e.target))),_=(0,r.memo)(({children:e,parentElement:t})=>{const n=(0,r.useRef)(null);return n.current||(n.current=document.createElement("div"),t.appendChild(n.current)),(0,r.useEffect)(()=>()=>{n.current&&(t.removeChild(n.current),n.current=null)},[t]),(0,i.createPortal)(e,n.current)}),v=({className:e,children:t,content:n,parentElement:o=g,hideDelayMs:i=600,isVisible:a,onHide:c,maxWidth:l="250px"})=>{const m=(0,r.useRef)(null),p=(0,r.useRef)(null),u=((e,{hideDelayMs:t=600,triggerRef:n,tooltipRef:o,parentElement:i,onHide:a=y.noop})=>{const[c,s]=(0,r.useState)(e),l=(0,r.useRef)(!1),m=(0,r.useRef)(a),p=(0,r.useRef)(e);return p.current!==e&&(p.current=e,e&&!c&&s(!0)),(0,r.useEffect)(()=>{m.current=a},[a]),(0,r.useEffect)(()=>{l.current?e&&i.dispatchEvent(new Event("wcpay-tooltip-open")):l.current=!0},[e,i]),(0,r.useEffect)(()=>{if(e||!c)return;const n=setTimeout(()=>{s(!1),m.current()},t);return()=>{clearTimeout(n)}},[e,c,t]),(0,r.useEffect)(()=>{if(!c)return;const e=()=>{s(!1),m.current()},t=e=>{w(e,n.current?.firstChild)||w(e,o.current)||(s(!1),m.current())};return document.addEventListener("click",t),i.addEventListener("wcpay-tooltip-open",e),()=>{document.removeEventListener("click",t),i.removeEventListener("wcpay-tooltip-open",e)}},[c,n,o,i]),c})(!!a,{hideDelayMs:i,triggerRef:m,tooltipRef:p,parentElement:o,onHide:c});return(0,r.useEffect)(()=>{const e=()=>{if(!u)return;const e=p.current,t=m.current?.firstChild;if(!e||!t)return;if(!(t instanceof HTMLElement))return;e.style.maxWidth=l;const n=window.innerWidth-16;e.offsetWidth>n&&(e.style.maxWidth=`${n}px`);const o=t.getBoundingClientRect(),r=e.getBoundingClientRect().height;e.style.top=o.top-r-8+"px";const i=t.offsetWidth/2+o.left,a=e.offsetWidth,c=window.innerWidth-a-8,s=Math.max(8,Math.min(i-a/2,c));e.style.left=`${s}px`,e.style.visibility="visible",e.style.opacity="1"};e();const t=(0,y.debounce)(e,150);return window.addEventListener("resize",t),document.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),document.removeEventListener("scroll",t)}},[u,l]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"wcpay-tooltip__content-wrapper",ref:m,children:t}),u&&(0,s.jsx)(_,{parentElement:o,children:(0,s.jsx)("div",{ref:p,className:h("wcpay-tooltip__tooltip-wrapper",{"is-hiding":!a}),role:"tooltip",children:(0,s.jsx)("div",{className:h("wcpay-tooltip__tooltip",e),children:n})})})]})},b=({isVisible:e,onHide:t=y.noop,children:n,buttonIcon:o,buttonLabel:i,buttonSize:c=16,...l})=>{const[m,p]=(0,r.useState)(!1),[u,d]=(0,r.useState)(!1),f=()=>{p(!0)},h=()=>{p(!1),t()};return(0,s.jsx)("button",{className:"wcpay-tooltip__content-wrapper",onMouseEnter:f,onMouseLeave:h,onFocus:f,onBlur:h,onClick:()=>{d(e=>!e),u&&t()},type:"button",children:(0,s.jsx)(v,{...l,onHide:()=>{p(!1),d(!1),t()},isVisible:e||m||u,children:o?(0,s.jsx)(a.Icon,{icon:o,size:c,"aria-label":i}):n})})},E=({message:e,type:t="primary",className:n,tooltip:o,icon:r})=>{const i=h("chip",`chip-${t}`,r&&"chip-has-icon",n),a=(0,s.jsxs)(s.Fragment,{children:[r&&(0,s.jsx)(d,{icon:r,size:16}),e]});return o?(0,s.jsx)(b,{content:o,children:(0,s.jsx)("span",{className:i,children:a})}):(0,s.jsx)("span",{className:i,children:a})};var T=n(4392),N=n.n(T);const x=e=>({__html:N().sanitize(e,{ALLOWED_TAGS:["a","b","em","i","strong","p","br"],ALLOWED_ATTR:["target","href","rel","name","download"]})}),S=["primary","success","light","warning","alert"],R=({badge:e,badgeType:t,heading:n,description:o,footnote:i,image:c,icon:u,primaryButtonLabel:d,onPrimaryClick:f,secondaryButtonLabel:h,onSecondaryClick:y,onDismiss:g,onView:w,showImmediately:_=!1,showDelayMs:v=4e3,reverseButtons:b=!1})=>{const T=(N=t)&&S.includes(N)?N:"success";var N;const[R,A]=(0,r.useState)(_),[O,k]=(0,r.useState)(_),P=(0,r.useRef)(null),L=(0,r.useRef)(null),C=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(_)return;const e=setTimeout(()=>{A(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{k(!0)})})},v);return()=>clearTimeout(e)},[_,v]),(0,r.useEffect)(()=>()=>{P.current&&clearTimeout(P.current)},[]),(0,r.useEffect)(()=>{O&&((0,p.speak)((0,m.sprintf)((0,m.__)("Dialog opened: %s","woocommerce-payments"),n),"polite"),w&&w())},[O]);const M=(0,r.useCallback)((e=!0)=>{k(!1),P.current=setTimeout(()=>{A(!1),e&&g()},300)},[g]);if((0,r.useEffect)(()=>{if(!R||!L.current)return;const e=L.current,t=e.ownerDocument;C.current=t.activeElement,e.focus();const n=n=>{if("Escape"===n.key)return n.preventDefault(),void M();if("Tab"===n.key){const o=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),r=o[0],i=o[o.length-1],a=t.activeElement;n.shiftKey&&a===r?(n.preventDefault(),i?.focus()):n.shiftKey||a!==i||(n.preventDefault(),r?.focus())}};return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n),C.current?.focus()}},[R,M]),!R)return null;const D=(0,s.jsx)(a.Button,{className:"wcpay-spotlight__primary-btn",variant:"primary",onClick:()=>{f(),M(!1)},size:"compact",children:d}),I=h&&(0,s.jsx)(a.Button,{className:"wcpay-spotlight__secondary-btn",variant:"tertiary",onClick:y,size:"compact",children:h});return(0,s.jsx)("div",{className:"wcpay-spotlight "+(O?"wcpay-spotlight--visible":""),children:(0,s.jsx)("div",{ref:L,role:"dialog","aria-modal":"true","aria-labelledby":"spotlight-heading",tabIndex:-1,className:"wcpay-spotlight__container",children:(0,s.jsxs)(a.Card,{className:`wcpay-spotlight__card ${c?"has-image":""} ${u?"has-icon":""}`,elevation:2,children:[c&&(0,s.jsx)(a.CardMedia,{className:"wcpay-spotlight__image",children:"string"==typeof c?(0,s.jsx)("img",{src:c,alt:"","aria-hidden":"true",role:"presentation"}):c}),(0,s.jsx)(a.CardHeader,{isBorderless:!0,size:"small",className:"wcpay-spotlight__header",children:(0,s.jsxs)(a.Flex,{className:"wcpay-spotlight__controls",justify:"space-between",align:"center",children:[!c&&!u&&e&&(0,s.jsx)("div",{className:"wcpay-spotlight__badge",children:(0,s.jsx)(E,{message:e,type:T})}),!c&&!u&&!e&&(0,s.jsx)("h2",{id:"spotlight-heading",className:"wcpay-spotlight__heading",children:n}),(c||u)&&(0,s.jsx)("span",{}),(0,s.jsx)(a.Button,{className:"wcpay-spotlight__close-btn",label:(0,m.__)("Close","woocommerce-payments"),icon:(0,s.jsx)(a.Icon,{icon:l,viewBox:"6 4 12 14"}),iconSize:16,onClick:()=>M()})]})}),(0,s.jsxs)(a.CardBody,{className:"wcpay-spotlight__body",size:"small",children:[u&&(0,s.jsx)("div",{className:"wcpay-spotlight__icon",children:u}),c&&e&&(0,s.jsx)("div",{className:"wcpay-spotlight__badge",children:(0,s.jsx)(E,{message:e,type:T})}),(c||u||e)&&(0,s.jsx)("h2",{id:"spotlight-heading",className:"wcpay-spotlight__heading",children:n}),"string"==typeof o?(0,s.jsx)("div",{className:"wcpay-spotlight__description",dangerouslySetInnerHTML:x(o)}):(0,s.jsx)("div",{className:"wcpay-spotlight__description",children:o}),i&&("string"==typeof i?(0,s.jsx)("div",{className:"wcpay-spotlight__footnote",dangerouslySetInnerHTML:x(i)}):(0,s.jsx)("div",{className:"wcpay-spotlight__footnote",children:i}))]}),(0,s.jsx)(a.CardFooter,{isBorderless:!0,size:"small",className:"wcpay-spotlight__footer",children:(0,s.jsx)(a.Flex,{justify:"flex-start",gap:3,children:b?(0,s.jsxs)(s.Fragment,{children:[D,I]}):(0,s.jsxs)(s.Fragment,{children:[I,D]})})})]})})})};let A=function(e){return e.SET_PM_PROMOTIONS="SET_PM_PROMOTIONS",e.SET_ERROR_FOR_PM_PROMOTIONS="SET_ERROR_FOR_PM_PROMOTIONS",e}({});const O={pmPromotions:void 0,pmPromotionsError:void 0},k=window.wp.dataControls,P=window.wp.data,L="/wc/v3/payments",C="wc/payments/pmPromotions";function M(e){return function(e){return"object"==typeof e&&null!==e&&"code"in e&&"string"==typeof e.code}(e)?e:{code:"unknown_error"}}function D(e){return{type:A.SET_PM_PROMOTIONS,data:e}}function I(e){return{type:A.SET_ERROR_FOR_PM_PROMOTIONS,error:e}}function*j(e){const t=`${L}/pm-promotions/${e}/activate`;try{yield(0,k.apiFetch)({path:t,method:"POST"}),yield P.controls.dispatch("core/notices","createSuccessNotice",(0,m.__)("Promotion activated successfully!","woocommerce-payments")),yield P.controls.dispatch(C,"invalidateResolution","getPmPromotions",[])}catch(e){yield P.controls.dispatch("core/notices","createErrorNotice",(0,m.__)("Error activating promotion. Please try again.","woocommerce-payments")),yield P.controls.dispatch(C,"updateErrorForPmPromotions",M(e))}}function*F(e){const t=`${L}/pm-promotions/${e}/dismiss`;try{yield(0,k.apiFetch)({path:t,method:"POST"}),yield P.controls.dispatch("core/notices","createSuccessNotice",(0,m.__)("Promotion dismissed.","woocommerce-payments")),yield P.controls.dispatch(C,"invalidateResolution","getPmPromotions",[])}catch(e){yield P.controls.dispatch("core/notices","createErrorNotice",(0,m.__)("Error dismissing promotion. Please try again.","woocommerce-payments")),yield P.controls.dispatch(C,"updateErrorForPmPromotions",M(e))}}function H(e){if("object"!=typeof e||null===e)return!1;const t=e;return"string"==typeof t.id&&"string"==typeof t.promo_id&&"string"==typeof t.payment_method&&"string"==typeof t.payment_method_title&&"string"==typeof t.type&&("spotlight"===t.type||"badge"===t.type)&&"string"==typeof t.title&&"string"==typeof t.description&&"string"==typeof t.cta_label&&"string"==typeof t.tc_url&&"string"==typeof t.tc_label}function*z(){const e=`${L}/pm-promotions`;try{const t=yield(0,k.apiFetch)({path:e});if(n=t,!Array.isArray(n)||!n.every(H))throw new Error("Invalid promotions data received from API");yield P.controls.dispatch(C,"updatePmPromotions",t)}catch(e){yield P.controls.dispatch("core/notices","createErrorNotice",(0,m.__)("Error retrieving promotions. Please try again later.","woocommerce-payments")),yield P.controls.dispatch(C,"updateErrorForPmPromotions",(t=e,function(e){return"object"==typeof e&&null!==e&&"code"in e}(t)?t:{code:"unknown_error"}))}var t,n}const B=e=>e.pmPromotions?.pmPromotions??[],U=e=>e.pmPromotions?.pmPromotionsError,W=C,G=(0,P.createReduxStore)(W,{reducer:(0,P.combineReducers)({pmPromotions:(e=O,t)=>{switch(t.type){case A.SET_PM_PROMOTIONS:return{...e,pmPromotions:t.data,pmPromotionsError:void 0};case A.SET_ERROR_FOR_PM_PROMOTIONS:return{...e,pmPromotions:void 0,pmPromotionsError:t.error}}return e}}),actions:e,selectors:o,resolvers:t,controls:k.controls});(0,P.register)(G);const $=window.wp.domReady;var q=n.n($);const V=(e,t={})=>{if(window.wcpaySettings){Object.assign(t,{is_test_mode:wcpaySettings.testMode,jetpack_connected:wcpaySettings.isJetpackConnected,wcpay_version:wcpaySettings.version,woo_country_code:wcpaySettings.connect.country,hosting_provider:wcpaySettings.trackingInfo?.hosting_provider});for(const e in t)void 0===t[e]&&delete t[e]}q()(()=>{(wc?.tracks?.recordEvent??wcTracks.recordEvent)(e,t)})},K=()=>{const e=window.location.pathname+window.location.search;return e.includes("path=%2Fpayments%2Foverview")?"wcpay-overview":e.includes("path=%2Fpayments%2Fsettings")?"wcpay-settings":e.includes("page=wc-settings")&&e.includes("tab=checkout")?"wc-settings-payments":"unknown"},Y=()=>{const{pmPromotions:e,isLoading:t}=(0,P.useSelect)(e=>{const{getPmPromotions:t,getPmPromotionsError:n,isResolving:o}=e(W);return{pmPromotions:t(),pmPromotionsError:n(),isLoading:o("getPmPromotions")}}),{activatePmPromotion:n,dismissPmPromotion:o}=(()=>{const{activatePmPromotion:e,dismissPmPromotion:t}=(0,P.useDispatch)(W);return{activatePmPromotion:e,dismissPmPromotion:t}})(),i=(0,r.useMemo)(()=>e?.find(e=>"spotlight"===e.type),[e]),a=(0,r.useCallback)(()=>({promo_id:i?.promo_id,payment_method:i?.payment_method,display_context:"spotlight",source:K(),path:window.location.pathname+window.location.search}),[i?.promo_id,i?.payment_method]),c=(0,r.useCallback)(()=>{V("wcpay_payment_method_promotion_view",a())},[a]),l=(0,r.useCallback)(()=>{i&&(V("wcpay_payment_method_promotion_activate_click",a()),n(i.id))},[a,n,i]),m=(0,r.useCallback)(()=>{if(i&&(V("wcpay_payment_method_promotion_link_click",{...a(),link_type:"terms"}),i.tc_url))try{const e=new URL(i.tc_url);"https:"!==e.protocol&&"http:"!==e.protocol||window.open(i.tc_url,"_blank","noopener,noreferrer")}catch{}},[a,i]),p=(0,r.useCallback)(()=>{i&&(V("wcpay_payment_method_promotion_dismiss_click",a()),o(i.id))},[a,o,i]);return t?null:e&&0!==e.length&&i?(0,s.jsx)(R,{badge:i.badge_text,badgeType:i.badge_type,heading:i.title,description:i.description,footnote:i.footnote,image:i.image,primaryButtonLabel:i.cta_label,onPrimaryClick:l,secondaryButtonLabel:i.tc_label,onSecondaryClick:m,onDismiss:p,onView:c}):null},X=()=>{const e=document.getElementById("wcpay-payments-settings-spotlight");e&&(0,i.createRoot)(e).render((0,s.jsx)(Y,{}))};"interactive"===document.readyState||"complete"===document.readyState?X():window.addEventListener("DOMContentLoaded",X)})()})();