File: /home/deshuvsd/www/wp-content/plugins/woocommerce-payments/dist/wc-payments-settings-spotlight.js
/*! For license information please see wc-payments-settings-spotlight.js.LICENSE.txt */
(()=>{var e={2838:function(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,r){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,r)}function r(e,o,n){return r=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,r,o){var n=[null];n.push.apply(n,r);var a=new(Function.bind.apply(e,n));return o&&t(a,o.prototype),a},r.apply(null,arguments)}function o(e){return function(e){if(Array.isArray(e))return n(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 n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var a=Object.hasOwnProperty,i=Object.setPrototypeOf,s=Object.isFrozen,c=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,d=Object.freeze,l=Object.seal,m=Object.create,p="undefined"!=typeof Reflect&&Reflect,_=p.apply,y=p.construct;_||(_=function(e,t,r){return e.apply(t,r)}),d||(d=function(e){return e}),l||(l=function(e){return e}),y||(y=function(e,t){return r(e,o(t))});var h,f=I(Array.prototype.forEach),g=I(Array.prototype.pop),E=I(Array.prototype.push),S=I(String.prototype.toLowerCase),T=I(String.prototype.toString),w=I(String.prototype.match),R=I(String.prototype.replace),v=I(String.prototype.indexOf),O=I(String.prototype.trim),b=I(RegExp.prototype.test),A=(h=TypeError,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return y(h,t)});function I(e){return function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return _(e,t,o)}}function N(e,t,r){var o;r=null!==(o=r)&&void 0!==o?o:S,i&&i(e,null);for(var n=t.length;n--;){var a=t[n];if("string"==typeof a){var c=r(a);c!==a&&(s(t)||(t[n]=c),a=c)}e[a]=!0}return e}function D(e){var t,r=m(null);for(t in e)!0===_(a,e,[t])&&(r[t]=e[t]);return r}function M(e,t){for(;null!==e;){var r=u(e,t);if(r){if(r.get)return I(r.get);if("function"==typeof r.value)return I(r.value)}e=c(e)}return function(e){return console.warn("fallback value for",e),null}}var P=d(["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=d(["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"]),F=d(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),U=d(["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"]),L=d(["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"]),k=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),x=d(["#text"]),z=d(["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"]),j=d(["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"]),H=d(["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"]),q=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=l(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Y=l(/<%[\w\W]*|[\w\W]*%>/gm),$=l(/\${[\w\W]*}/gm),W=l(/^data-[\-\w.\u00B7-\uFFFF]/),G=l(/^aria-[\-\w]+$/),V=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=l(/^(?:\w+script|data):/i),Z=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=l(/^html$/i),X=l(/^[a-z][.\w]*(-[.\w]+)+$/i),J=function(){return"undefined"==typeof window?null:window};return function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J(),n=function(e){return t(e)};if(n.version="2.5.6",n.removed=[],!r||!r.document||9!==r.document.nodeType)return n.isSupported=!1,n;var a=r.document,i=r.document,s=r.DocumentFragment,c=r.HTMLTemplateElement,u=r.Node,l=r.Element,m=r.NodeFilter,p=r.NamedNodeMap,_=void 0===p?r.NamedNodeMap||r.MozNamedAttrMap:p,y=r.HTMLFormElement,h=r.DOMParser,I=r.trustedTypes,ee=l.prototype,te=M(ee,"cloneNode"),re=M(ee,"nextSibling"),oe=M(ee,"childNodes"),ne=M(ee,"parentNode");if("function"==typeof c){var ae=i.createElement("template");ae.content&&ae.content.ownerDocument&&(i=ae.content.ownerDocument)}var ie=function(t,r){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var o=null,n="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(n)&&(o=r.currentScript.getAttribute(n));var a="dompurify"+(o?"#"+o:"");try{return t.createPolicy(a,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+a+" could not be created."),null}}(I,a),se=ie?ie.createHTML(""):"",ce=i,ue=ce.implementation,de=ce.createNodeIterator,le=ce.createDocumentFragment,me=ce.getElementsByTagName,pe=a.importNode,_e={};try{_e=D(i).documentMode?i.documentMode:{}}catch(e){}var ye={};n.isSupported="function"==typeof ne&&ue&&void 0!==ue.createHTMLDocument&&9!==_e;var he,fe,ge=B,Ee=Y,Se=$,Te=W,we=G,Re=Q,ve=Z,Oe=X,be=V,Ae=null,Ie=N({},[].concat(o(P),o(C),o(F),o(L),o(x))),Ne=null,De=N({},[].concat(o(z),o(j),o(H),o(q))),Me=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}})),Pe=null,Ce=null,Fe=!0,Ue=!0,Le=!1,ke=!0,xe=!1,ze=!0,je=!1,He=!1,qe=!1,Be=!1,Ye=!1,$e=!1,We=!0,Ge=!1,Ve=!0,Qe=!1,Ze={},Ke=null,Xe=N({},["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"]),Je=null,et=N({},["audio","video","img","source","image","track"]),tt=null,rt=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",it=at,st=!1,ct=null,ut=N({},[ot,nt,at],T),dt=["application/xhtml+xml","text/html"],lt=null,mt=i.createElement("form"),pt=function(e){return e instanceof RegExp||e instanceof Function},_t=function(t){lt&<===t||(t&&"object"===e(t)||(t={}),t=D(t),he=he=-1===dt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,fe="application/xhtml+xml"===he?T:S,Ae="ALLOWED_TAGS"in t?N({},t.ALLOWED_TAGS,fe):Ie,Ne="ALLOWED_ATTR"in t?N({},t.ALLOWED_ATTR,fe):De,ct="ALLOWED_NAMESPACES"in t?N({},t.ALLOWED_NAMESPACES,T):ut,tt="ADD_URI_SAFE_ATTR"in t?N(D(rt),t.ADD_URI_SAFE_ATTR,fe):rt,Je="ADD_DATA_URI_TAGS"in t?N(D(et),t.ADD_DATA_URI_TAGS,fe):et,Ke="FORBID_CONTENTS"in t?N({},t.FORBID_CONTENTS,fe):Xe,Pe="FORBID_TAGS"in t?N({},t.FORBID_TAGS,fe):{},Ce="FORBID_ATTR"in t?N({},t.FORBID_ATTR,fe):{},Ze="USE_PROFILES"in t&&t.USE_PROFILES,Fe=!1!==t.ALLOW_ARIA_ATTR,Ue=!1!==t.ALLOW_DATA_ATTR,Le=t.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,xe=t.SAFE_FOR_TEMPLATES||!1,ze=!1!==t.SAFE_FOR_XML,je=t.WHOLE_DOCUMENT||!1,Be=t.RETURN_DOM||!1,Ye=t.RETURN_DOM_FRAGMENT||!1,$e=t.RETURN_TRUSTED_TYPE||!1,qe=t.FORCE_BODY||!1,We=!1!==t.SANITIZE_DOM,Ge=t.SANITIZE_NAMED_PROPS||!1,Ve=!1!==t.KEEP_CONTENT,Qe=t.IN_PLACE||!1,be=t.ALLOWED_URI_REGEXP||be,it=t.NAMESPACE||at,Me=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&pt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Me.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&pt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Me.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Me.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(Ue=!1),Ye&&(Be=!0),Ze&&(Ae=N({},o(x)),Ne=[],!0===Ze.html&&(N(Ae,P),N(Ne,z)),!0===Ze.svg&&(N(Ae,C),N(Ne,j),N(Ne,q)),!0===Ze.svgFilters&&(N(Ae,F),N(Ne,j),N(Ne,q)),!0===Ze.mathMl&&(N(Ae,L),N(Ne,H),N(Ne,q))),t.ADD_TAGS&&(Ae===Ie&&(Ae=D(Ae)),N(Ae,t.ADD_TAGS,fe)),t.ADD_ATTR&&(Ne===De&&(Ne=D(Ne)),N(Ne,t.ADD_ATTR,fe)),t.ADD_URI_SAFE_ATTR&&N(tt,t.ADD_URI_SAFE_ATTR,fe),t.FORBID_CONTENTS&&(Ke===Xe&&(Ke=D(Ke)),N(Ke,t.FORBID_CONTENTS,fe)),Ve&&(Ae["#text"]=!0),je&&N(Ae,["html","head","body"]),Ae.table&&(N(Ae,["tbody"]),delete Pe.tbody),d&&d(t),lt=t)},yt=N({},["mi","mo","mn","ms","mtext"]),ht=N({},["foreignobject","annotation-xml"]),ft=N({},["title","style","font","a","script"]),gt=N({},C);N(gt,F),N(gt,U);var Et=N({},L);N(Et,k);var St=function(e){E(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=se}catch(t){e.remove()}}},Tt=function(e,t){try{E(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){E(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ne[e])if(Be||Ye)try{St(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},wt=function(e){var t,r;if(qe)e="<remove></remove>"+e;else{var o=w(e,/^[\r\n\t ]+/);r=o&&o[0]}"application/xhtml+xml"===he&&it===at&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var n=ie?ie.createHTML(e):e;if(it===at)try{t=(new h).parseFromString(n,he)}catch(e){}if(!t||!t.documentElement){t=ue.createDocument(it,"template",null);try{t.documentElement.innerHTML=st?se:n}catch(e){}}var a=t.body||t.documentElement;return e&&r&&a.insertBefore(i.createTextNode(r),a.childNodes[0]||null),it===at?me.call(t,je?"html":"body")[0]:je?t.documentElement:a},Rt=function(e){return de.call(e.ownerDocument||e,e,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null,!1)},vt=function(e){return e instanceof y&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof _)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ot=function(t){return"object"===e(u)?t instanceof u:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},bt=function(e,t,r){ye[e]&&f(ye[e],(function(e){e.call(n,t,r,lt)}))},At=function(e){var t;if(bt("beforeSanitizeElements",e,null),vt(e))return St(e),!0;if(b(/[\u0080-\uFFFF]/,e.nodeName))return St(e),!0;var r=fe(e.nodeName);if(bt("uponSanitizeElement",e,{tagName:r,allowedTags:Ae}),e.hasChildNodes()&&!Ot(e.firstElementChild)&&(!Ot(e.content)||!Ot(e.content.firstElementChild))&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return St(e),!0;if("select"===r&&b(/<template/i,e.innerHTML))return St(e),!0;if(7===e.nodeType)return St(e),!0;if(ze&&8===e.nodeType&&b(/<[/\w]/g,e.data))return St(e),!0;if(!Ae[r]||Pe[r]){if(!Pe[r]&&Nt(r)){if(Me.tagNameCheck instanceof RegExp&&b(Me.tagNameCheck,r))return!1;if(Me.tagNameCheck instanceof Function&&Me.tagNameCheck(r))return!1}if(Ve&&!Ke[r]){var o=ne(e)||e.parentNode,a=oe(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i){var s=te(a[i],!0);s.__removalCount=(e.__removalCount||0)+1,o.insertBefore(s,re(e))}}return St(e),!0}return e instanceof l&&!function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:it,tagName:"template"});var r=S(e.tagName),o=S(t.tagName);return!!ct[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===at?"svg"===r:t.namespaceURI===ot?"svg"===r&&("annotation-xml"===o||yt[o]):Boolean(gt[r]):e.namespaceURI===ot?t.namespaceURI===at?"math"===r:t.namespaceURI===nt?"math"===r&&ht[o]:Boolean(Et[r]):e.namespaceURI===at?!(t.namespaceURI===nt&&!ht[o])&&!(t.namespaceURI===ot&&!yt[o])&&!Et[r]&&(ft[r]||!gt[r]):!("application/xhtml+xml"!==he||!ct[e.namespaceURI]))}(e)?(St(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(xe&&3===e.nodeType&&(t=e.textContent,t=R(t,ge," "),t=R(t,Ee," "),t=R(t,Se," "),e.textContent!==t&&(E(n.removed,{element:e.cloneNode()}),e.textContent=t)),bt("afterSanitizeElements",e,null),!1):(St(e),!0)},It=function(e,t,r){if(We&&("id"===t||"name"===t)&&(r in i||r in mt))return!1;if(Ue&&!Ce[t]&&b(Te,t));else if(Fe&&b(we,t));else if(!Ne[t]||Ce[t]){if(!(Nt(e)&&(Me.tagNameCheck instanceof RegExp&&b(Me.tagNameCheck,e)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(e))&&(Me.attributeNameCheck instanceof RegExp&&b(Me.attributeNameCheck,t)||Me.attributeNameCheck instanceof Function&&Me.attributeNameCheck(t))||"is"===t&&Me.allowCustomizedBuiltInElements&&(Me.tagNameCheck instanceof RegExp&&b(Me.tagNameCheck,r)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(r))))return!1}else if(tt[t]);else if(b(be,R(r,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(r,"data:")||!Je[e])if(Le&&!b(Re,R(r,ve,"")));else if(r)return!1;return!0},Nt=function(e){return"annotation-xml"!==e&&w(e,Oe)},Dt=function(t){var r,o,a,i;bt("beforeSanitizeAttributes",t,null);var s=t.attributes;if(s){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne};for(i=s.length;i--;){var u=r=s[i],d=u.name,l=u.namespaceURI;if(o="value"===d?r.value:O(r.value),a=fe(d),c.attrName=a,c.attrValue=o,c.keepAttr=!0,c.forceKeepAttr=void 0,bt("uponSanitizeAttribute",t,c),o=c.attrValue,ze&&b(/((--!?|])>)|<\/(style|title)/i,o))Tt(d,t);else if(!c.forceKeepAttr&&(Tt(d,t),c.keepAttr))if(ke||!b(/\/>/i,o)){xe&&(o=R(o,ge," "),o=R(o,Ee," "),o=R(o,Se," "));var m=fe(t.nodeName);if(It(m,a,o)){if(!Ge||"id"!==a&&"name"!==a||(Tt(d,t),o="user-content-"+o),ie&&"object"===e(I)&&"function"==typeof I.getAttributeType)if(l);else switch(I.getAttributeType(m,a)){case"TrustedHTML":o=ie.createHTML(o);break;case"TrustedScriptURL":o=ie.createScriptURL(o)}try{l?t.setAttributeNS(l,d,o):t.setAttribute(d,o),vt(t)?St(t):g(n.removed)}catch(e){}}}else Tt(d,t)}bt("afterSanitizeAttributes",t,null)}},Mt=function e(t){var r,o=Rt(t);for(bt("beforeSanitizeShadowDOM",t,null);r=o.nextNode();)bt("uponSanitizeShadowNode",r,null),At(r)||(r.content instanceof s&&e(r.content),Dt(r));bt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(t){var o,i,c,d,l,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((st=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Ot(t)){if("function"!=typeof t.toString)throw A("toString is not a function");if("string"!=typeof(t=t.toString()))throw A("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(r.toStaticHTML)||"function"==typeof r.toStaticHTML){if("string"==typeof t)return r.toStaticHTML(t);if(Ot(t))return r.toStaticHTML(t.outerHTML)}return t}if(He||_t(m),n.removed=[],"string"==typeof t&&(Qe=!1),Qe){if(t.nodeName){var p=fe(t.nodeName);if(!Ae[p]||Pe[p])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof u)1===(i=(o=wt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!Be&&!xe&&!je&&-1===t.indexOf("<"))return ie&&$e?ie.createHTML(t):t;if(!(o=wt(t)))return Be?null:$e?se:""}o&&qe&&St(o.firstChild);for(var _=Rt(Qe?t:o);c=_.nextNode();)3===c.nodeType&&c===d||At(c)||(c.content instanceof s&&Mt(c.content),Dt(c),d=c);if(d=null,Qe)return t;if(Be){if(Ye)for(l=le.call(o.ownerDocument);o.firstChild;)l.appendChild(o.firstChild);else l=o;return(Ne.shadowroot||Ne.shadowrootmod)&&(l=pe.call(a,l,!0)),l}var y=je?o.outerHTML:o.innerHTML;return je&&Ae["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&b(K,o.ownerDocument.doctype.name)&&(y="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+y),xe&&(y=R(y,ge," "),y=R(y,Ee," "),y=R(y,Se," ")),ie&&$e?ie.createHTML(y):y},n.setConfig=function(e){_t(e),He=!0},n.clearConfig=function(){lt=null,He=!1},n.isValidAttribute=function(e,t,r){lt||_t({});var o=fe(e),n=fe(t);return It(o,n,r)},n.addHook=function(e,t){"function"==typeof t&&(ye[e]=ye[e]||[],E(ye[e],t))},n.removeHook=function(e){if(ye[e])return g(ye[e])},n.removeHooks=function(e){ye[e]&&(ye[e]=[])},n.removeAllHooks=function(){ye={}},n}()}()},5338:(e,t,r)=>{"use strict";var o=r(5795);t.H=o.createRoot,o.hydrateRoot},1020:(e,t,r)=>{"use strict";var o=r(1609),n=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,c={},u=null,d=null;for(o in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,o)&&!s.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:n,type:e,key:u,ref:d,props:c,_owner:i.current}}},4848:(e,t,r)=>{"use strict";e.exports=r(1020)},1609:e=>{"use strict";e.exports=window.React},5795:e=>{"use strict";e.exports=window.ReactDOM}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.p=window.wcpayAssets.url,(()=>{"use strict";var e={};r.r(e),r.d(e,{getAllDepositsOverviews:()=>Se,getAllDepositsOverviewsError:()=>Te,getDeposit:()=>Ee,getDepositQueryError:()=>Oe,getDeposits:()=>Re,getDepositsCount:()=>ve,getDepositsSummary:()=>Ae,getDepositsSummaryError:()=>Ie,getInstantDeposit:()=>Ne});var t={};r.r(t),r.d(t,{submitInstantDeposit:()=>Je,updateAllDepositsOverviews:()=>$e,updateDeposit:()=>Ye,updateDeposits:()=>Ge,updateDepositsCount:()=>Ve,updateDepositsSummary:()=>Ze,updateErrorForAllDepositsOverviews:()=>We,updateErrorForDepositQuery:()=>Qe,updateErrorForDepositsSummary:()=>Ke,updateInstantDeposit:()=>Xe});var o={};r.r(o),r.d(o,{getAllDepositsOverviews:()=>tt,getDeposit:()=>et,getDeposits:()=>at,getDepositsSummary:()=>it,getPayoutsCSVRequestURL:()=>nt,payoutsDownloadEndpoint:()=>ot});var n={};r.r(n),r.d(n,{getFraudOutcomeTransactions:()=>ft,getFraudOutcomeTransactionsError:()=>gt,getFraudOutcomeTransactionsSummary:()=>St,getFraudOutcomeTransactionsSummaryError:()=>Tt,getTransactions:()=>lt,getTransactionsError:()=>mt,getTransactionsSummary:()=>_t,getTransactionsSummaryError:()=>yt});var a={};r.r(a),r.d(a,{updateErrorForFraudOutcomeTransactions:()=>At,updateErrorForFraudOutcomeTransactionsSummary:()=>Nt,updateErrorForTransactions:()=>Rt,updateErrorForTransactionsSummary:()=>Ot,updateFraudOutcomeTransactions:()=>bt,updateFraudOutcomeTransactionsSummary:()=>It,updateTransactions:()=>wt,updateTransactionsSummary:()=>vt});var i={};r.r(i),r.d(i,{formatQueryFilters:()=>Dt,getFraudOutcomeTransactions:()=>Ut,getFraudOutcomeTransactionsExport:()=>kt,getFraudOutcomeTransactionsSummary:()=>Lt,getTransactions:()=>Mt,getTransactionsCSVRequestURL:()=>Ct,getTransactionsSummary:()=>Ft,transactionsDownloadEndpoint:()=>Pt});var s={};r.r(s),r.d(s,{getCharge:()=>zt,getChargeError:()=>jt,getChargeFromOrder:()=>Ht,getChargeFromOrderError:()=>qt});var c={};r.r(c),r.d(c,{updateCharge:()=>Bt,updateErrorForCharge:()=>Yt});var u={};r.r(u),r.d(u,{getCharge:()=>$t,getChargeFromOrder:()=>Wt});var d={};r.r(d),r.d(d,{getTimeline:()=>Vt,getTimelineError:()=>Qt});var l={};r.r(l),r.d(l,{updateErrorForTimeline:()=>Kt,updateTimeline:()=>Zt});var m={};r.r(m),r.d(m,{getTimeline:()=>Xt});var p={};r.r(p),r.d(p,{getCachedDispute:()=>nr,getDispute:()=>rr,getDisputeError:()=>or,getDisputes:()=>ar,getDisputesSummary:()=>ir});var _={};r.r(_),r.d(_,{refundCharge:()=>lr,updateErrorForPaymentIntent:()=>dr,updatePaymentIntent:()=>ur});var y={};r.r(y),r.d(y,{getPaymentIntent:()=>mr});var h={};r.r(h),r.d(h,{acceptDispute:()=>fr,updateDispute:()=>pr,updateDisputes:()=>yr,updateDisputesSummary:()=>hr,updateErrorForDispute:()=>_r});var f={};r.r(f),r.d(f,{disputesDownloadEndpoint:()=>vr,getDispute:()=>br,getDisputes:()=>Ar,getDisputesCSVRequestURL:()=>Or,getDisputesSummary:()=>Ir});var g={};r.r(g),r.d(g,{getAccountBusinessSupportEmail:()=>$r,getAccountBusinessSupportPhone:()=>Wr,getAccountDomesticCurrency:()=>Gr,getAccountStatementDescriptor:()=>qr,getAccountStatementDescriptorKana:()=>Yr,getAccountStatementDescriptorKanji:()=>Br,getAdvancedFraudProtectionSettings:()=>Ao,getAvailablePaymentMethodIds:()=>xr,getCompletedWaitingPeriod:()=>Xr,getCurrentProtectionLevel:()=>bo,getDepositDelayDays:()=>Kr,getDepositRestrictions:()=>eo,getDepositScheduleInterval:()=>Vr,getDepositScheduleMonthlyAnchor:()=>Zr,getDepositScheduleWeeklyAnchor:()=>Qr,getDepositStatus:()=>Jr,getDuplicatedPaymentMethodIds:()=>Ur,getEnabledPaymentMethodIds:()=>kr,getIsAppleGooglePayInPaymentMethodsOptionsEnabled:()=>io,getIsCardPresentEligible:()=>fo,getIsDebugLogEnabled:()=>so,getIsDevModeEnabled:()=>no,getIsManualCaptureEnabled:()=>to,getIsMultiCurrencyEnabled:()=>co,getIsPaymentRequestEnabled:()=>ao,getIsSavedCardsEnabled:()=>yo,getIsStripeBillingEnabled:()=>No,getIsStripeBillingMigrationInProgress:()=>Do,getIsSubscriptionsPluginActive:()=>So,getIsTestModeEnabled:()=>ro,getIsTestModeOnboarding:()=>oo,getIsWCPayEnabled:()=>Lr,getIsWCPaySubscriptionsEligible:()=>Eo,getIsWCPaySubscriptionsEnabled:()=>go,getIsWooPayEnabled:()=>To,getIsWooPayGlobalThemeSupportEnabled:()=>wo,getPaymentMethodStatuses:()=>zr,getPaymentRequestButtonBorderRadius:()=>_o,getPaymentRequestButtonSize:()=>mo,getPaymentRequestButtonTheme:()=>po,getPaymentRequestButtonType:()=>lo,getPaymentRequestLocations:()=>uo,getSavingError:()=>ho,getSettings:()=>Fr,getShowWooPayIncompatibilityNotice:()=>Io,getStripeBillingMigratedCount:()=>Po,getStripeBillingSubscriptionCount:()=>Mo,getWooPayCustomMessage:()=>Ro,getWooPayLocations:()=>Oo,getWooPayStoreLogo:()=>vo,isDirty:()=>Hr,isSavingSettings:()=>jr});var E={};r.r(E),r.d(E,{saveOption:()=>Tn,saveSettings:()=>dn,submitStripeBillingSubscriptionMigration:()=>Sn,updateAccountBusinessSupportEmail:()=>nn,updateAccountBusinessSupportPhone:()=>an,updateAccountStatementDescriptor:()=>tn,updateAccountStatementDescriptorKana:()=>on,updateAccountStatementDescriptorKanji:()=>rn,updateAdvancedFraudProtectionSettings:()=>gn,updateDepositScheduleInterval:()=>sn,updateDepositScheduleMonthlyAnchor:()=>un,updateDepositScheduleWeeklyAnchor:()=>cn,updateEnabledPaymentMethodIds:()=>Wo,updateIsAppleGooglePayInPaymentMethodsOptionsEnabled:()=>$o,updateIsCardPresentEligible:()=>ko,updateIsDebugLogEnabled:()=>Xo,updateIsManualCaptureEnabled:()=>Zo,updateIsMultiCurrencyEnabled:()=>Jo,updateIsPaymentRequestEnabled:()=>Yo,updateIsSavedCardsEnabled:()=>Lo,updateIsSavingSettings:()=>Go,updateIsStripeBillingEnabled:()=>En,updateIsTestModeEnabled:()=>Ko,updateIsWCPayEnabled:()=>Bo,updateIsWCPaySubscriptionsEnabled:()=>en,updateIsWooPayEnabled:()=>mn,updateIsWooPayGlobalThemeSupportEnabled:()=>pn,updatePaymentRequestButtonBorderRadius:()=>Ho,updatePaymentRequestButtonSize:()=>zo,updatePaymentRequestButtonTheme:()=>jo,updatePaymentRequestButtonType:()=>xo,updatePaymentRequestLocations:()=>ln,updateProtectionLevel:()=>fn,updateSelectedPaymentMethod:()=>Vo,updateSettings:()=>qo,updateUnselectedPaymentMethod:()=>Qo,updateWooPayCustomMessage:()=>_n,updateWooPayLocations:()=>hn,updateWooPayStoreLogo:()=>yn});var S={};r.r(S),r.d(S,{getSettings:()=>wn});var T={};r.r(T),r.d(T,{getCardReaderStats:()=>vn,getCardReaderStatsError:()=>On,getCardReaders:()=>bn});var w={};r.r(w),r.d(w,{updateCardReaderStats:()=>An,updateCardReaders:()=>In,updateErrorForCardReaderStats:()=>Nn,updateErrorForCardReaders:()=>Dn});var R={};r.r(R),r.d(R,{getCardReaderStats:()=>Mn,getCardReaders:()=>Pn});var v={};r.r(v),r.d(v,{getActiveLoanSummary:()=>kn,getActiveLoanSummaryError:()=>xn,getLoans:()=>zn,getLoansError:()=>jn});var O={};r.r(O),r.d(O,{updateActiveLoanSummary:()=>Hn,updateErrorForActiveLoanSummary:()=>qn,updateErrorForLoans:()=>Yn,updateLoans:()=>Bn});var b={};r.r(b),r.d(b,{getActiveLoanSummary:()=>$n,getLoans:()=>Wn});var A={};r.r(A),r.d(A,{getDocuments:()=>Kn,getDocumentsError:()=>Xn,getDocumentsSummary:()=>ea,getDocumentsSummaryError:()=>ta});var I={};r.r(I),r.d(I,{updateDocuments:()=>ra,updateDocumentsSummary:()=>na,updateErrorForDocuments:()=>oa,updateErrorForDocumentsSummary:()=>aa});var N={};r.r(N),r.d(N,{formatQueryFilters:()=>ia,getDocuments:()=>sa,getDocumentsSummary:()=>ca});var D={};r.r(D),r.d(D,{getPaymentIntent:()=>da,getPaymentIntentError:()=>la});var M={};r.r(M),r.d(M,{getAuthorization:()=>fa,getAuthorizations:()=>ha,getAuthorizationsError:()=>ga,getAuthorizationsSummary:()=>Sa,getAuthorizationsSummaryError:()=>Ta,getIsRequesting:()=>wa});var P={};r.r(P),r.d(P,{setIsRequestingAuthorization:()=>Ia,submitCancelAuthorization:()=>Da,submitCaptureAuthorization:()=>Na,updateAuthorization:()=>ba,updateAuthorizations:()=>va,updateAuthorizationsSummary:()=>Aa,updateErrorForAuthorizations:()=>Oa,updateErrorForAuthorizationsSummary:()=>Ma});var C={};r.r(C),r.d(C,{getAuthorization:()=>Ca,getAuthorizations:()=>Pa,getAuthorizationsSummary:()=>Fa});var F={};r.r(F),r.d(F,{getFile:()=>xa,getFileError:()=>za});var U={};r.r(U),r.d(U,{updateErrorForFiles:()=>Ha,updateFiles:()=>ja});var L={};r.r(L),r.d(L,{getFile:()=>qa});var k={};r.r(k),r.d(k,{getPmPromotions:()=>$a,getPmPromotionsError:()=>Wa});var x={};r.r(x),r.d(x,{activatePmPromotion:()=>Za,dismissPmPromotion:()=>Ka,updateErrorForPmPromotions:()=>Qa,updatePmPromotions:()=>Va});var z={};r.r(z),r.d(z,{getPmPromotions:()=>Ja});var j=r(1609),H=r.n(j),q=r(5338);const B=window.wp.components,Y=window.wp.primitives;var $=r(4848);const W=(0,$.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$.jsx)(Y.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"})}),G=window.wp.i18n,V=window.wp.a11y,Q=window.wp.element,Z=(0,Q.forwardRef)((function({icon:e,size:t=24,...r},o){return(0,Q.cloneElement)(e,{width:t,height:t,...r,ref:o})}));function K(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=K(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const X=function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=K(e))&&(o&&(o+=" "),o+=t);return o},J=window.lodash;var ee=r(5795);const te=document.getElementById("wpbody-content")||document.body,re=(e,t)=>!(!t||t!==e.target&&!(e.target instanceof Node&&t.contains(e.target))),oe=(0,j.memo)((({children:e,parentElement:t})=>{const r=(0,j.useRef)(null);return r.current||(r.current=document.createElement("div"),t.appendChild(r.current)),(0,j.useEffect)((()=>()=>{r.current&&(t.removeChild(r.current),r.current=null)}),[t]),(0,ee.createPortal)(e,r.current)})),ne=({className:e,children:t,content:r,parentElement:o=te,hideDelayMs:n=600,isVisible:a,onHide:i,maxWidth:s="250px"})=>{const c=(0,j.useRef)(null),u=(0,j.useRef)(null),d=((e,{hideDelayMs:t=600,triggerRef:r,tooltipRef:o,parentElement:n,onHide:a=J.noop})=>{const[i,s]=(0,j.useState)(e),c=(0,j.useRef)(!1),u=(0,j.useRef)(a);return(0,j.useEffect)((()=>{u.current=a}),[a]),(0,j.useEffect)((()=>{let r=null;if(c.current){if(e)return n.dispatchEvent(new Event("wcpay-tooltip-open")),void s(!0);if(i)return r=setTimeout((()=>{s(!1),u.current()}),t),()=>{r&&clearTimeout(r)}}else c.current=!0}),[s,t,e,i,n]),(0,j.useEffect)((()=>{if(!i)return;const e=()=>{s(!1),u.current()},t=e=>{var t;re(e,null===(t=r.current)||void 0===t?void 0:t.firstChild)||re(e,o.current)||(s(!1),u.current())};return document.addEventListener("click",t),n.addEventListener("wcpay-tooltip-open",e),()=>{document.removeEventListener("click",t),n.removeEventListener("wcpay-tooltip-open",e)}}),[e,i,r,o,n]),i})(!!a,{hideDelayMs:n,triggerRef:c,tooltipRef:u,parentElement:o,onHide:i});return(0,j.useEffect)((()=>{const e=()=>{var e;if(!d)return;const t=u.current,r=null===(e=c.current)||void 0===e?void 0:e.firstChild;if(!t||!r)return;if(!(r instanceof HTMLElement))return;t.style.maxWidth=s;const o=r.getBoundingClientRect(),n=t.getBoundingClientRect().height;t.style.top=o.top-n-8+"px";let a=r.offsetWidth/2+o.left-t.offsetWidth/2;const i=window.innerWidth-(o.left+t.offsetWidth);a<0?a=45:i<0&&(a-=85),t.style.left=`${a}px`,t.style.visibility="visible",t.style.opacity="1"};e();const t=(0,J.debounce)(e,150);return window.addEventListener("resize",t),document.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),document.removeEventListener("scroll",t)}}),[d,s]),H().createElement(H().Fragment,null,H().createElement("div",{className:"wcpay-tooltip__content-wrapper",ref:c},t),d&&H().createElement(oe,{parentElement:o},H().createElement("div",{ref:u,className:X("wcpay-tooltip__tooltip-wrapper",{"is-hiding":!a}),role:"tooltip"},H().createElement("div",{className:X("wcpay-tooltip__tooltip",e)},r))))};const ae=e=>{var{isVisible:t,onHide:r=J.noop,children:o,buttonIcon:n,buttonLabel:a,buttonSize:i=16}=e,s=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(e,["isVisible","onHide","children","buttonIcon","buttonLabel","buttonSize"]);const[c,u]=(0,j.useState)(!1),[d,l]=(0,j.useState)(!1),m=()=>{u(!0)},p=()=>{u(!1),r()};return H().createElement("button",{className:"wcpay-tooltip__content-wrapper",onMouseEnter:m,onMouseLeave:p,onFocus:m,onBlur:p,onClick:()=>{l((e=>!e)),d&&r()},type:"button"},H().createElement(ne,Object.assign({},s,{onHide:()=>{u(!1),l(!1),r()},isVisible:t||c||d}),n?H().createElement(B.Icon,{icon:n,size:i,"aria-label":a}):o))},ie=({message:e,type:t="primary",className:r,tooltip:o,icon:n})=>{const a=X("chip",`chip-${t}`,n&&"chip-has-icon",r),i=H().createElement(H().Fragment,null,n&&H().createElement(Z,{icon:n,size:16}),e);return o?H().createElement(ae,{content:o},H().createElement("span",{className:a},i)):H().createElement("span",{className:a},i)};var se=r(2838);const ce=e=>({__html:(0,se.sanitize)(e,{ALLOWED_TAGS:["a","b","em","i","strong","p","br"],ALLOWED_ATTR:["target","href","rel","name","download"]})}),ue=["primary","success","light","warning","alert"],de=({badge:e,badgeType:t,heading:r,description:o,footnote:n,image:a,primaryButtonLabel:i,onPrimaryClick:s,secondaryButtonLabel:c,onSecondaryClick:u,onDismiss:d,onView:l,showImmediately:m=!1})=>{const p=(_=t)&&ue.includes(_)?_:"success";var _;const[y,h]=(0,j.useState)(!1),[f,g]=(0,j.useState)(!1),E=(0,j.useRef)(null),S=(0,j.useRef)(null),T=(0,j.useRef)(null);(0,j.useEffect)((()=>{if(m)return h(!0),void g(!0);const e=setTimeout((()=>{h(!0),requestAnimationFrame((()=>{requestAnimationFrame((()=>{g(!0)}))}))}),4e3);return()=>clearTimeout(e)}),[m]),(0,j.useEffect)((()=>()=>{E.current&&clearTimeout(E.current)}),[]),(0,j.useEffect)((()=>{f&&((0,V.speak)((0,G.sprintf)((0,G.__)("Dialog opened: %s","woocommerce-payments"),r),"polite"),l&&l())}),[f]);const w=(0,j.useCallback)(((e=!0)=>{g(!1),E.current=setTimeout((()=>{h(!1),e&&d()}),300)}),[d]);return(0,j.useEffect)((()=>{if(!y||!S.current)return;const e=S.current,t=e.ownerDocument;T.current=t.activeElement,e.focus();const r=r=>{if("Escape"===r.key)return r.preventDefault(),void w();if("Tab"===r.key){const o=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=o[0],a=o[o.length-1],i=t.activeElement;r.shiftKey&&i===n?(r.preventDefault(),null==a||a.focus()):r.shiftKey||i!==a||(r.preventDefault(),null==n||n.focus())}};return t.addEventListener("keydown",r),()=>{var e;t.removeEventListener("keydown",r),null===(e=T.current)||void 0===e||e.focus()}}),[y,w]),y?H().createElement("div",{className:"wcpay-spotlight "+(f?"wcpay-spotlight--visible":"")},H().createElement("div",{ref:S,role:"dialog","aria-modal":"true","aria-labelledby":"spotlight-heading",tabIndex:-1,className:"wcpay-spotlight__container"},H().createElement(B.Card,{className:"wcpay-spotlight__card "+(a?"has-image":""),elevation:2},a&&H().createElement(B.CardMedia,{className:"wcpay-spotlight__image"},"string"==typeof a?H().createElement("img",{src:a,alt:"","aria-hidden":"true",role:"presentation"}):a),H().createElement(B.CardHeader,{isBorderless:!0,size:"small",className:"wcpay-spotlight__header"},H().createElement(B.Flex,{className:"wcpay-spotlight__controls",justify:"space-between",align:"center"},!a&&e&&H().createElement("div",{className:"wcpay-spotlight__badge"},H().createElement(ie,{message:e,type:p})),!a&&!e&&H().createElement("h2",{id:"spotlight-heading",className:"wcpay-spotlight__heading"},r),a&&H().createElement("span",null),H().createElement(B.Button,{className:"wcpay-spotlight__close-btn",label:(0,G.__)("Close","woocommerce-payments"),icon:H().createElement(B.Icon,{icon:W,viewBox:"6 4 12 14"}),iconSize:24,onClick:()=>w()}))),H().createElement(B.CardBody,{className:"wcpay-spotlight__body",size:"small"},a&&e&&H().createElement("div",{className:"wcpay-spotlight__badge"},H().createElement(ie,{message:e,type:p})),(a||e)&&H().createElement("h2",{id:"spotlight-heading",className:"wcpay-spotlight__heading"},r),"string"==typeof o?H().createElement("div",{className:"wcpay-spotlight__description",dangerouslySetInnerHTML:ce(o)}):H().createElement("div",{className:"wcpay-spotlight__description"},o),n&&("string"==typeof n?H().createElement("div",{className:"wcpay-spotlight__footnote",dangerouslySetInnerHTML:ce(n)}):H().createElement("div",{className:"wcpay-spotlight__footnote"},n))),H().createElement(B.CardFooter,{isBorderless:!0,size:"small",className:"wcpay-spotlight__footer"},H().createElement(B.Flex,{justify:"flex-end",gap:3},c&&H().createElement(B.Button,{className:"wcpay-spotlight__secondary-btn",variant:"tertiary",onClick:u},c),H().createElement(B.Button,{className:"wcpay-spotlight__primary-btn",variant:"primary",onClick:()=>{s(),w(!1)}},i)))))):null},le=window.wp.data,me=window.wp.dataControls,pe="/wc/v3/payments",_e="wc/payments",ye={SET_DEPOSIT:"SET_DEPOSIT",SET_DEPOSITS:"SET_DEPOSITS",SET_DEPOSITS_COUNT:"SET_DEPOSITS_COUNT",SET_ERROR_FOR_DEPOSIT_QUERY:"SET_ERROR_FOR_DEPOSIT_QUERY",SET_DEPOSITS_SUMMARY:"SET_DEPOSITS_SUMMARY",SET_ERROR_FOR_DEPOSITS_SUMMARY:"SET_ERROR_FOR_DEPOSITS_SUMMARY",SET_INSTANT_DEPOSIT:"SET_INSTANT_DEPOSIT",SET_ALL_DEPOSITS_OVERVIEWS:"SET_ALL_DEPOSITS_OVERVIEWS",SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:"SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS"},he=e=>JSON.stringify(e,Object.keys(e).sort()),fe={byId:{},queries:{},count:0,instant:{}},ge=e=>e&&e.deposits||{},Ee=(e,t)=>(ge(e).byId||{})[t],Se=e=>{const t=ge(e).overviews||{};if(!t.data)return{account:null,currencies:[]};const{deposit:r,balance:o,account:n}=t.data,a={lastPaid:r.last_paid,pending:o.pending,available:o.available,instant:o.instant},i={};for(const[e,t]of Object.entries(a))t?.forEach((t=>{const{currency:r}=t;i[r]||(i[r]={currency:r,lastPaid:void 0,pending:void 0,available:void 0,instant:void 0}),i[r][e]=t}));const s=Object.values(i);return{account:n,currencies:[...s.filter((e=>n.default_currency===e.currency)),...s.filter((e=>n.default_currency!==e.currency))]}},Te=e=>(ge(e).overviews||{}).error,we=(e,t)=>{const r=he(t);return(ge(e).queries||{})[r]||{}},Re=(e,t)=>(we(e,t).data||[]).map(Ee.bind(void 0,e)),ve=e=>ge(e).count,Oe=(e,t)=>we(e,t).error||{},be=(e,t)=>{const r=he(t);return(ge(e).summary||{})[r]||{}},Ae=(e,t)=>be(e,t).data||{},Ie=(e,t)=>be(e,t).error||{},Ne=e=>(ge(e).instant||{}).data,De=window.wp.domReady;var Me=r.n(De);const Pe=(e,t={})=>{var r;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:null===(r=wcpaySettings.trackingInfo)||void 0===r?void 0:r.hosting_provider});for(const e in t)void 0===t[e]&&delete t[e]}Me()((()=>{var r,o;(null!==(o=null===(r=null===wc||void 0===wc?void 0:wc.tracks)||void 0===r?void 0:r.recordEvent)&&void 0!==o?o:wcTracks.recordEvent)(e,t)}))},Ce=((0,j.createContext)(window.wcpaySettings),(0,j.createContext)({isActive:!1,setActive:()=>null,isCompleted:!1,setCompleted:()=>null,taskId:""}),window.wc.currency);var Fe=r.n(Ce);(0,G.__)("Australian dollar","woocommerce-payments"),(0,G.__)("Canadian dollar","woocommerce-payments"),(0,G.__)("Swiss franc","woocommerce-payments"),(0,G.__)("Danish krone","woocommerce-payments"),(0,G.__)("Euro","woocommerce-payments"),(0,G.__)("Pound sterling","woocommerce-payments"),(0,G.__)("Norwegian krone","woocommerce-payments"),(0,G.__)("New Zealand dollar","woocommerce-payments"),(0,G.__)("Swedish krona","woocommerce-payments"),(0,G.__)("United States (US) dollar","woocommerce-payments");const Ue=(e,t="USD",r=null,o=!1)=>{const n=(e=>wcpaySettings.zeroDecimalCurrencies.includes(e.toLowerCase()))(t);n||(e/=100);const a=e<0,i=a?-1*e:e,s=a?"-":"",c=o?(e=>{const t=e.toUpperCase(),{currencyData:r,connect:{country:o="US"}}=wcpaySettings;if(r[o]?.code===t)return Fe()(r[o]);const n=(0,J.find)(r,{code:t});if(n){const{defaultLocale:e={}}=n;return e.hasOwnProperty("decimalSeparator")&&e.hasOwnProperty("thousandSeparator")&&e.hasOwnProperty("symbolPosition")&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition),Fe()(n)}return null})(t):((e,t=null)=>{const{currencyData:r,connect:{country:o="US"}}=wcpaySettings,n=(0,J.find)(r,{code:e.toUpperCase()});if(n){if(null!==t&&t.toUpperCase()!==e.toUpperCase()||r[o]){const e=t?(0,J.find)(r,{code:t.toUpperCase()}):r[o];e&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition)}return Fe()(n)}return null})(t,r);if(null===c)return s+Le(i,t,n);try{return s+("function"==typeof c.formatAmount?ke(c.formatAmount(i)):ke(c.formatCurrency(i)))}catch(e){return s+ke(Le(i,t,n))}};function Le(e,t,r){try{return e.toLocaleString(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",dummy:r})}catch(o){return(0,G.sprintf)(r?"%s %i":"%s %.2f",t.toUpperCase(),e)}}function ke(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}const xe=window.wp.url,ze=window.moment;var je=r.n(ze);const He=window.wp.date,qe=(window.wc.number,e=>(0,xe.addQueryArgs)("admin.php",e)),Be=(e,t=!1)=>{const r=t?je()(e).endOf("day").utc().toISOString():je()(e).startOf("day").utc().toISOString();return e&&(0,He.dateI18n)("Y-m-d H:i:s",r,!0)};function Ye(e){return{type:ye.SET_DEPOSIT,data:e}}function $e(e){return{type:ye.SET_ALL_DEPOSITS_OVERVIEWS,data:e}}function We(e,t){return{type:ye.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,error:t}}function Ge(e,t){return{type:ye.SET_DEPOSITS,query:e,data:t}}function Ve(e){return{type:ye.SET_DEPOSITS_COUNT,data:e}}function Qe(e,t,r){return{type:ye.SET_ERROR_FOR_DEPOSIT_QUERY,query:e,data:t,error:r}}function Ze(e,t){return{type:ye.SET_DEPOSITS_SUMMARY,query:e,data:t}}function Ke(e,t,r){return{type:ye.SET_ERROR_FOR_DEPOSITS_SUMMARY,query:e,data:t,error:r}}function Xe(e){return{type:ye.SET_INSTANT_DEPOSIT,data:e}}function*Je(e){try{yield(0,le.dispatch)(_e).startResolution("getInstantDeposit",[e]);const t=yield(0,me.apiFetch)({path:"/wc/v3/payments/deposits",method:"POST",data:{type:"instant",currency:e}});yield Xe(t),yield(0,le.dispatch)(_e).invalidateResolutionForStoreSelector("getDeposits"),yield(0,le.dispatch)(_e).invalidateResolutionForStoreSelector("getAllDepositsOverviews"),yield(0,le.dispatch)("core/notices").createSuccessNotice((0,G.sprintf)((0,G.__)("Instant payout for %s in transit.","woocommerce-payments"),Ue(t.amount)),{actions:[{label:(0,G.__)("View details","woocommerce-payments"),url:qe({page:"wc-admin",path:"/payments/payouts/details",id:t.id})}]})}catch{yield(0,le.dispatch)("core/notices").createErrorNotice((0,G.__)("Error creating instant payout.","woocommerce-payments"))}finally{yield(0,le.dispatch)(_e).finishResolution("getInstantDeposit",[e])}}function*et(e){if(/\W/.test(e))return;const t=(0,xe.addQueryArgs)(`${pe}/deposits/${e}`);try{const e=yield(0,me.apiFetch)({path:t});yield Ye(e)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving payout.","woocommerce-payments"))}}function*tt(){const e=(0,xe.addQueryArgs)(`${pe}/deposits/overview-all`);try{const t=yield(0,me.apiFetch)({path:e});yield $e(t)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving all payouts' overviews.","woocommerce-payments")),yield We()}}const rt=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Be(e.dateBefore,!0),date_after:Be(e.dateAfter),date_between:e.dateBetween&&[Be(e.dateBetween[0]),Be(e.dateBetween[1],!0)],status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),ot=`${pe}/deposits/download`;function nt(e){return(0,xe.addQueryArgs)(ot,rt(e))}function*at(e){const t=(0,xe.addQueryArgs)(`${pe}/deposits`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...rt(e)});try{const r=yield(0,me.apiFetch)({path:t})||{};yield Ge(e,r.data),yield Ve(r.total_count);for(const e in r.data)yield le.controls.dispatch(_e,"finishResolution","getDeposit",[r.data[e].id])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving payouts.","woocommerce-payments")),yield Qe(e,null,t)}}function*it(e){const t=(0,xe.addQueryArgs)(`${pe}/deposits/summary`,rt(e));try{const r=yield(0,me.apiFetch)({path:t});yield Ze(e,r)}catch(t){yield Ke(e,null,t)}}const st={SET_TRANSACTIONS:"SET_TRANSACTIONS",SET_ERROR_FOR_TRANSACTIONS:"SET_ERROR_FOR_TRANSACTIONS",SET_TRANSACTIONS_SUMMARY:"SET_TRANSACTIONS_SUMMARY",SET_ERROR_FOR_TRANSACTIONS_SUMMARY:"SET_ERROR_FOR_TRANSACTIONS_SUMMARY",SET_FRAUD_OUTCOME_TRANSACTIONS:"SET_FRAUD_OUTCOME_TRANSACTIONS",SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:"SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS",SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:"SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY",SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:"SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY"},ct={summary:{},fraudProtection:{review:{summary:{}},block:{summary:{}}}},ut=e=>e&&e.transactions||{},dt=(e,t)=>{const r=he(t);return ut(e)[r]||{}},lt=(e,t)=>dt(e,t).data||[],mt=(e,t)=>dt(e,t).error||{},pt=(e,t)=>{const r=he(t);return ut(e).summary[r]||{}},_t=(e,t)=>pt(e,t).data||{},yt=(e,t)=>pt(e,t).error||{},ht=(e,t,r)=>{const o=he(r);return ut(e).fraudProtection?.[t]?.[o]||{}},ft=(e,t,r)=>ht(e,t,r).data||[],gt=(e,t,r)=>ht(e,t,r).error||{},Et=(e,t,r)=>{const o=he(r);return ut(e).fraudProtection?.[t]?.summary[o]||{}},St=(e,t,r)=>Et(e,t,r).data||{},Tt=(e,t,r)=>Et(e,t,r).error||{};function wt(e,t){return{type:st.SET_TRANSACTIONS,query:e,data:t}}function Rt(e,t,r){return{type:st.SET_ERROR_FOR_TRANSACTIONS,query:e,data:t,error:r}}function vt(e,t){return{type:st.SET_TRANSACTIONS_SUMMARY,query:e,data:t}}function Ot(e,t,r){return{type:st.SET_ERROR_FOR_TRANSACTIONS_SUMMARY,query:e,data:t,error:r}}function bt(e,t,r){return{type:st.SET_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:r}}function At(e,t,r){return{type:st.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:null,error:r}}function It(e,t,r){return{type:st.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:r}}function Nt(e,t,r){return{type:st.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:null,error:r}}const Dt=e=>({user_email:e.userEmail,match:e.match,date_before:Be(e.dateBefore,!0),date_after:Be(e.dateAfter),date_between:e.dateBetween&&[Be(e.dateBetween[0]),Be(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot,type_is_in:e.typeIsIn,source_device_is:e.sourceDeviceIs,source_device_is_not:e.sourceDeviceIsNot,channel_is:e.channelIs,channel_is_not:e.channelIsNot,customer_country_is:e.customerCountryIs,customer_country_is_not:e.customerCountryIsNot,risk_level_is:e.riskLevelIs,risk_level_is_not:e.riskLevelIsNot,store_currency_is:e.storeCurrencyIs,loan_id_is:e.loanIdIs,deposit_id:e.depositId,customer_currency_is:e.customerCurrencyIs,customer_currency_is_not:e.customerCurrencyIsNot,source_is:e.sourceIs,source_is_not:e.sourceIsNot,search:e.search,user_timezone:je()(new Date).format("Z"),locale:e.locale});function*Mt(e){const t=(0,xe.addQueryArgs)(`${pe}/transactions`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Dt(e)});try{const r=yield(0,me.apiFetch)({path:t});yield wt(e,r.data||[])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving transactions.","woocommerce-payments")),yield Rt(e,null,t)}}const Pt=`${pe}/transactions/download`;function Ct(e){return(0,xe.addQueryArgs)(Pt,Dt(e))}function*Ft(e){const t=(0,xe.addQueryArgs)(`${pe}/transactions/summary`,Dt(e));try{const r=yield(0,me.apiFetch)({path:t});yield vt(e,r)}catch(t){yield Ot(e,null,t)}}function*Ut(e,t){const r=(0,xe.addQueryArgs)(`${pe}/transactions/fraud-outcomes`,{status:e,page:t.paged,sort:t.orderby,pagesize:t.perPage,direction:t.order,additional_status:t.additionalStatus,...Dt(t)});try{const o=yield(0,me.apiFetch)({path:r});yield bt(e,t,o.data||[])}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield bt(e,t,[]));yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving transactions.","woocommerce-payments")),yield At(e,t,r)}}function*Lt(e,t){const r=(0,xe.addQueryArgs)(`${pe}/transactions/fraud-outcomes/summary`,{status:e,additional_status:t.additionalStatus}),o={count:0,total:0};try{const n=yield(0,me.apiFetch)({path:r});yield It(e,t,n||o)}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield It(e,t,o));yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving on review transactions.","woocommerce-payments")),yield Nt(e,t,r)}}function kt(e,t){return(0,xe.addQueryArgs)(`${pe}/transactions/fraud-outcomes/download`,{status:e,sort:t.orderby,direction:t.order,additional_status:t.additionalStatus,...Dt(t)})}const xt={SET_CHARGE:"SET_CHARGE",SET_ERROR_FOR_CHARGE:"SET_ERROR_FOR_CHARGE"},zt=(e,t)=>e.charges[t]&&e.charges[t].data?e.charges[t].data:{},jt=(e,t)=>e.charges[t]&&e.charges[t].error?e.charges[t].error:{},Ht=(e,t)=>zt(e,t),qt=(e,t)=>jt(e,t);function Bt(e,t){return{type:xt.SET_CHARGE,id:e,data:t}}function Yt(e,t,r){return{type:xt.SET_ERROR_FOR_CHARGE,id:e,data:t,error:r}}function*$t(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/charges/${e}`});yield Bt(e,t)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving transaction.","woocommerce-payments")),yield Yt(e,null,t)}}function*Wt(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/charges/order/${e}`});yield Bt(e,t)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving transaction.","woocommerce-payments")),yield Yt(e,null,t)}}const Gt={SET_TIMELINE:"SET_TIMELINE",SET_ERROR_FOR_TIMELINE:"SET_ERROR_FOR_TIMELINE"},Vt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].data?e.timeline[t].data:{},Qt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].error?e.timeline[t].error:{};function Zt(e,t){return{id:e,type:Gt.SET_TIMELINE,data:t}}function Kt(e,t){return{id:e,type:Gt.SET_ERROR_FOR_TIMELINE,error:t}}function*Xt(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/timeline/${e}`});yield Zt(e,t.data)}catch(t){yield Kt(e,t)}}const Jt={SET_DISPUTE:"SET_DISPUTE",SET_ERROR_FOR_DISPUTE:"SET_ERROR_FOR_DISPUTE",SET_DISPUTES:"SET_DISPUTES",SET_DISPUTES_SUMMARY:"SET_DISPUTES_SUMMARY"},er={byId:{},queries:{},summary:{},cached:{}},tr=e=>e&&e.disputes||{},rr=(e,t)=>(tr(e).byId||{})[t],or=(e,t)=>{const r=tr(e).byId||{};return r[t]?.error},nr=(e,t)=>(tr(e).cached||{})[t],ar=(e,t)=>{const r=((e,t)=>{const r=he(t);return(tr(e).queries||{})[r]||{}})(e,t).data||[];return r.map(nr.bind(void 0,e))},ir=(e,t)=>((e,t)=>{const r=he(t);return(tr(e).summary||{})[r]||{}})(e,t).data||{};var sr;!function(e){e.SET_PAYMENT_INTENT="SET_PAYMENT_INTENT",e.SET_ERROR_FOR_PAYMENT_INTENT="SET_ERROR_FOR_PAYMENT_INTENT"}(sr||(sr={}));const cr=sr;function ur(e,t){return{type:cr.SET_PAYMENT_INTENT,id:e,data:t}}function dr(e,t){return{type:cr.SET_ERROR_FOR_PAYMENT_INTENT,id:e,error:t}}function*lr(e,t){var r;const o=e.payment_intent;try{yield(0,me.apiFetch)({path:"/wc/v3/payments/refund/",method:"post",data:{charge_id:e.id,amount:e.amount,reason:t,order_id:null===(r=null==e?void 0:e.order)||void 0===r?void 0:r.id}}),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getTimeline"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield le.controls.dispatch("core/notices","createSuccessNotice",(0,G.sprintf)((0,G.__)("Refunded payment #%s.","woocommerce-payments"),o))}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.sprintf)((0,G.__)("There has been an error refunding the payment #%s. Please try again later.","woocommerce-payments"),o))}}function*mr(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/payment_intents/${e}`});yield ur(e,t)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving transaction.","woocommerce-payments")),yield dr(e,t)}}function pr(e){return{type:Jt.SET_DISPUTE,data:e}}function _r(e,t,r){return{type:Jt.SET_ERROR_FOR_DISPUTE,id:e,data:t,error:r}}function yr(e,t){return{type:Jt.SET_DISPUTES,query:e,data:t}}function hr(e,t){return{type:Jt.SET_DISPUTES_SUMMARY,query:e,data:t}}function*fr(e){const{id:t,payment_intent:r}=e;try{yield le.controls.dispatch(_e,"startResolution","getDispute",[t]);const e=yield(0,me.apiFetch)({path:`${pe}/disputes/${t}/close`,method:"post"});yield pr(e),yield mr(r),yield le.controls.dispatch(_e,"finishResolution","getDispute",[t]);const o=e.order?(0,G.sprintf)((0,G.__)("You have accepted the dispute for order #%s.","woocommerce-payments"),e.order.number):(0,G.__)("You have accepted the dispute.","woocommerce-payments");yield le.controls.dispatch("core/notices","createSuccessNotice",o)}catch(e){const r=(0,G.__)("There has been an error accepting the dispute. Please try again later.","woocommerce-payments");yield le.controls.dispatch("core/notices","createErrorNotice",r),yield le.controls.dispatch(_e,"finishResolution","getDispute",[t])}}const gr=window.wc.wcSettings,Er=((0,G.__)("Bank cannot process","woocommerce-payments"),(0,G.__)("Check returned","woocommerce-payments"),(0,G.__)("Credit not processed","woocommerce-payments"),(0,G.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,G.__)("If your customer was not refunded appropriately, you will need to accept the dispute, or resolve the issue with your customer. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,G.__)("The customer claims that the purchased product was returned or the transaction was otherwise canceled, but you have not yet provided a refund or credit.","woocommerce-payments"),(0,G.__)("Demonstrate that you have refunded your customer through other means or that your customer is not entitled to a refund. You cannot issue a refund while a payment is being disputed. If you believe that your customer was entitled a refund that you did not provide, you can accept the dispute.","woocommerce-payments"),(0,G.__)("You should first get in touch with your customer. If you understand what their complaint is, there is a chance for you to explain the misunderstanding or to make it right. If you’re able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,G.__)("If the cardholder agrees to withdraw the dispute, you should still submit evidence for the dispute using the forms on the next screen. In addition to the following evidence, your submission should include correspondence with the cardholder saying they would withdraw the dispute and a written statement from their card issuer confirming that the dispute has been withdrawn.","woocommerce-payments"),(0,G.__)("The cardholder claims a credit was not processed.","woocommerce-payments"),(0,G.__)("Customer initiated","woocommerce-payments"),(0,G.__)("Debit not authorized","woocommerce-payments"),(0,G.__)("Duplicate","woocommerce-payments"),(0,G.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,G.__)("If there were duplicate payments, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,G.__)("The customer claims they were charged multiple times for the same product or service.","woocommerce-payments"),(0,G.__)("Demonstrate that each payment was for a separate product or service.","woocommerce-payments"),(0,G.__)("Determine if your customer was incorrectly charged multiple times.","woocommerce-payments"),(0,G.__)("If they were not, collect any and all information documenting that each payment was made separately, such as copies of receipts. If the receipts don’t include the items purchased, be sure to include an itemized list. Each receipt should clearly indicate that the payments are for separate purchases of items or services. If you’ve been able to get in touch with the customer you should be sure to address any concerns they had in your evidence.","woocommerce-payments"),(0,G.__)("If there have been two or more separate payments, you should get in touch with your customer. If you understand what their complaint is, there is a chance for you to explain the misunderstanding or to make it right. If you’re able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,G.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,G.__)("The cardholder claims this is a duplicate transaction.","woocommerce-payments"),(0,G.__)("Transaction unauthorized","woocommerce-payments"),(0,G.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,G.__)("If you believe the payment was actually made using a stolen credit card, you will need to accept the dispute. The credit card networks place liability for accepting unauthorized transactions with you, the business.","woocommerce-payments"),(0,G.__)("This is the most common reason for a dispute, and happens when a cardholder claims that they didn’t authorize the payment. This can happen if the card was lost or stolen and used to make an unauthorized transaction. It can also happen if the cardholder doesn’t recognize the payment as it appears on the billing statement from their card issuer.","woocommerce-payments"),(0,G.__)("Provide adequate payment and order details so that a legitimate customer recognizes it, or proves to the card issuer that their cardholder authorized the transaction.","woocommerce-payments"),(0,G.__)("Try to get in touch with your customer. Sometimes people forget about payments they make or don’t recognize the way they appear on their card statement. If this is the case, ask them to contact their card issuer and let them know they no longer dispute the transaction.","woocommerce-payments"),(0,G.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,G.__)("It may be more efficient—and provide a better customer experience—to accept an accidental dispute and charge the customer again, if appropriate. Even when a dispute is withdrawn, it usually takes approximately 75 days to be finalized. Remember, it doesn’t matter to the card networks whether you win or lose a dispute; what matters is how many disputes a business receives, regardless of how many disputes are won.","woocommerce-payments"),(0,G.__)("The cardholder claims this is an unauthorized transaction.","woocommerce-payments"),(0,G.__)("General","woocommerce-payments"),(0,G.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,G.__)("This is an uncategorized dispute, so you should contact the customer for additional details to find out why the payment was disputed.","woocommerce-payments"),(0,G.__)("Incorrect account details","woocommerce-payments"),(0,G.__)("Insufficient funds","woocommerce-payments"),(0,G.__)("Product not received","woocommerce-payments"),(0,G.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,G.__)("If you can not prove the customer received their product or service, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,G.__)("The customer claims they did not receive the products or services purchased.","woocommerce-payments"),(0,G.__)("Prove that the customer received a physical product or offline service, or made use of a digital product or online service. This must have occurred prior to the date the dispute was initiated.","woocommerce-payments"),(0,G.__)("First, get in touch with your customer. Understanding why they filed the dispute will be important for helping make sure your customer gets the product and will give you critical information to prevent this from happening to others.","woocommerce-payments"),(0,G.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,G.__)("The cardholder claims they did not receive the product.","woocommerce-payments"),(0,G.__)("Product unacceptable","woocommerce-payments"),(0,G.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,G.__)("If you can not prove the customer received their product or service as described, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,G.__)("The product or service was received but was defective, damaged, or not as described.","woocommerce-payments"),(0,G.__)("Demonstrate that the product or service was delivered as described at the time of purchase.","woocommerce-payments"),(0,G.__)("If the product or service is as described, provide specific information (invoice, contract, etc.) to refute the cardholder’s claims. Quality disputes are where the customer does not agree with the condition of merchandise or service received (e.g., a car repair situation or quality of a hotel room). There may be instances where you will need to obtain a neutral third-party opinion to help corroborate your claim against the cardholder. Provide as much specific information and documentation as possible to refute the cardholder’s claims. It is recommended that you address each point that the cardholder has made.","woocommerce-payments"),(0,G.__)("If the customer has not yet returned the product or canceled the service, provide specific information to that effect. You should double-check your incoming shipping records to verify that you have not received a return before you respond. If you have processed a credit or reversal for this transaction, provide evidence of this which includes the amount and date processed.","woocommerce-payments"),(0,G.__)("For products that have been repaired or replaced, provide evidence that the cardholder agreed to a repair or replacement, it has been received by the customer, and the repair or replacement has not since been disputed.","woocommerce-payments"),(0,G.__)("If your customer made no attempt to return the product or cancel the service, or if you provided a replacement product or service, make sure to note that as well.","woocommerce-payments"),(0,G.__)("If the customer withdraws their dispute you should still submit evidence using the forms on the next screen. Be sure to provide a letter or email from the cardholder stating that they are no longer in dispute.","woocommerce-payments"),(0,G.__)("The cardholder claims the product was unacceptable.","woocommerce-payments"),(0,G.__)("Subscription canceled","woocommerce-payments"),(0,G.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,G.__)("If you can not prove the customer’s subscription was canceled, and or they did not follow your cancellation policy, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,G.__)("The customer claims that you continued to charge them after a subscription was canceled.","woocommerce-payments"),(0,G.__)("Prove that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments"),(0,G.__)("First, get in touch with your customer. If you understand what they believe happened, there is a chance for you to explain the misunderstanding or to make it right. ","woocommerce-payments"),(0,G.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,G.__)("Otherwise, use the forms on the next screen to submit evidence that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments"),(0,G.__)("The cardholder claims a subscription was canceled.","woocommerce-payments"),(0,G.__)("Unrecognized","woocommerce-payments"),(0,G.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,G.__)("If you can not prove the customer’s subscription was canceled, and or they did not follow your cancellation policy, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,G.__)("The customer doesn’t recognize the payment appearing on their card statement.","woocommerce-payments"),(0,G.__)("Get your customer to withdraw the dispute by helping them identify the payment. Otherwise, challenge the dispute with appropriate evidence that proves the purchase was legitimate. ","woocommerce-payments"),(0,G.__)("First, try to get in touch with your customer. Sometimes people forget about payments they make or don’t recognize the way they appear on their card statement. If this is the case, ask them to contact their card issuer and let them know they no longer dispute the transaction. Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,G.__)("It may be more efficient—and provide a better customer experience—to accept an accidental dispute and charge the customer again, if appropriate. Even when a dispute is withdrawn, it usually takes approximately 75 days to be finalized. Remember, it doesn’t matter to the card networks whether you win or lose a dispute; what matters is how many disputes a business receives, regardless of how many disputes are won.","woocommerce-payments"),(0,G.__)("Non-compliant","woocommerce-payments"),(0,G.__)("Your customer’s bank claims this payment violates Visa’s rules.","woocommerce-payments"),(0,G.__)("The customer’s bank claims this transaction doesn’t conform to Visa’s network rules.","woocommerce-payments"),{warning_needs_response:(0,G.__)("Inquiry: Response needed","woocommerce-payments"),warning_under_review:(0,G.__)("Inquiry: Under review","woocommerce-payments"),warning_closed:(0,G.__)("Inquiry: Closed","woocommerce-payments"),needs_response:(0,G.__)("Response needed","woocommerce-payments"),under_review:(0,G.__)("Under review","woocommerce-payments"),charge_refunded:(0,G.__)("Charge refunded","woocommerce-payments"),won:(0,G.__)("Won","woocommerce-payments"),lost:(0,G.__)("Lost","woocommerce-payments")}),Sr=(Object.entries(Er).map((([e,t])=>({label:t,value:e}))).filter((function(e){return null!=e})),["needs_response","warning_needs_response"]),Tr=((0,G.__)("Dispute currency","woocommerce-payments"),(0,G.__)("All currencies","woocommerce-payments"),(0,G.__)("Show","woocommerce-payments"),(0,G.__)("Needs response","woocommerce-payments"),(0,G.__)("All disputes","woocommerce-payments"),(0,G.__)("Advanced filters","woocommerce-payments"),(0,gr.getSetting)("wcVersion")),wr=parseFloat(Tr),Rr=(wr<7.8?(0,G.__)("Disputes match {{select /}} filters","woocommerce-payments"):(0,G.__)("Disputes match <select /> filters","woocommerce-payments"),(0,G.__)("Disputed on date","woocommerce-payments"),(0,G.__)("Remove dispute date filter","woocommerce-payments"),(0,G.__)("Select a dispute date filter match","woocommerce-payments"),wr<7.8?(0,G.__)("{{title}}Date{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,G.__)("<title>Date</title> <rule /> <filter />","woocommerce-payments"),(0,G.__)("Select a dispute date","woocommerce-payments"),(0,G.__)("Before","woocommerce-payments"),(0,G.__)("After","woocommerce-payments"),(0,G.__)("Between","woocommerce-payments"),(0,G.__)("Status","woocommerce-payments"),(0,G.__)("Remove dispute status filter","woocommerce-payments"),(0,G.__)("Select a dispute status filter match","woocommerce-payments"),wr<7.8?(0,G.__)("{{title}}Status{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,G.__)("<title>Status</title> <rule /> <filter />","woocommerce-payments"),(0,G.__)("Select a dispute status","woocommerce-payments"),(0,G._x)("Is","dispute status","woocommerce-payments"),(0,G._x)("Is not","dispute status","woocommerce-payments"),e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Be(e.dateBefore,!0),date_after:Be(e.dateAfter),date_between:e.dateBetween&&[Be(e.dateBetween[0]),Be(e.dateBetween[1],!0)],search:"awaiting_response"===e.filter?Sr:e.search,status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale})),vr=`${pe}/disputes/download`;function Or(e){return(0,xe.addQueryArgs)(vr,Rr(e))}function*br(e){const t=(0,xe.addQueryArgs)(`${pe}/disputes/${e}`);try{const e=yield(0,me.apiFetch)({path:t});yield pr(e)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving dispute.","woocommerce-payments")),yield _r(e,void 0,t)}}function*Ar(e){const t=(0,xe.addQueryArgs)(`${pe}/disputes`,{page:e.paged,pagesize:e.perPage,sort:(0,J.snakeCase)(e.orderBy),direction:e.order,...Rr(e)});try{const r=yield(0,me.apiFetch)({path:t})||{};yield yr(e,r.data)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving disputes.","woocommerce-payments"))}}function*Ir(e){const t=(0,xe.addQueryArgs)(`${pe}/disputes/summary`,{page:e.paged,pagesize:e.perPage,...Rr(e)});try{const r=yield(0,me.apiFetch)({path:t});yield hr(e,r)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving the summary of disputes.","woocommerce-payments"))}}const Nr={SET_SETTINGS:"SET_SETTINGS",SET_SETTINGS_VALUES:"SET_SETTINGS_VALUES",SET_IS_SAVING_SETTINGS:"SET_IS_SAVING_SETTINGS",SET_SELECTED_PAYMENT_METHOD:"SET_SELECTED_PAYMENT_METHOD",SET_UNSELECTED_PAYMENT_METHOD:"SET_UNSELECTED_PAYMENT_METHOD"},Dr={isDirty:!1,isSaving:!1,savingError:null,data:{}},Mr={},Pr=[],Cr=e=>e&&e.settings||Mr,Fr=e=>Cr(e).data||Mr,Ur=e=>Fr(e).duplicated_payment_method_ids||Mr,Lr=e=>Fr(e).is_wcpay_enabled||!1,kr=e=>Fr(e).enabled_payment_method_ids||Pr,xr=e=>Fr(e).available_payment_method_ids||Pr,zr=e=>Fr(e).payment_method_statuses||Mr,jr=e=>Cr(e).isSaving||!1,Hr=e=>Cr(e).isDirty||!1,qr=e=>Fr(e).account_statement_descriptor||"",Br=e=>Fr(e).account_statement_descriptor_kanji||"",Yr=e=>Fr(e).account_statement_descriptor_kana||"",$r=e=>Fr(e).account_business_support_email||"",Wr=e=>Fr(e).account_business_support_phone||"",Gr=e=>Fr(e).account_domestic_currency||"",Vr=e=>Fr(e).deposit_schedule_interval||"",Qr=e=>Fr(e).deposit_schedule_weekly_anchor||"",Zr=e=>Fr(e).deposit_schedule_monthly_anchor||"",Kr=e=>Fr(e).deposit_delay_days||"7",Xr=e=>Fr(e).deposit_completed_waiting_period||!1,Jr=e=>Fr(e).deposit_status||"",eo=e=>Fr(e).deposit_restrictions||"",to=e=>Fr(e).is_manual_capture_enabled||!1,ro=e=>Fr(e).is_test_mode_enabled||!1,oo=e=>Fr(e).is_test_mode_onboarding||!1,no=e=>Fr(e).is_dev_mode_enabled||!1,ao=e=>Fr(e).is_payment_request_enabled||!1,io=e=>Fr(e).is_apple_google_pay_in_payment_methods_options_enabled||!1,so=e=>Fr(e).is_debug_log_enabled||!1,co=e=>Fr(e).is_multi_currency_enabled||!1,uo=e=>Fr(e).payment_request_enabled_locations||Pr,lo=e=>Fr(e).payment_request_button_type||"",mo=e=>Fr(e).payment_request_button_size||"",po=e=>Fr(e).payment_request_button_theme||"",_o=e=>{const t=Fr(e)?.payment_request_button_border_radius;return 0===t||"0"===t||t?t:"undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10)},yo=e=>Fr(e).is_saved_cards_enabled||!1,ho=e=>Cr(e).savingError,fo=e=>Fr(e).is_card_present_eligible||!1,go=e=>Fr(e).is_wcpay_subscriptions_enabled||!1,Eo=e=>Fr(e).is_wcpay_subscriptions_eligible||!1,So=e=>Fr(e).is_subscriptions_plugin_active||!1,To=e=>Fr(e).is_woopay_enabled||!1,wo=e=>Fr(e).is_woopay_global_theme_support_enabled||!1,Ro=e=>Fr(e).woopay_custom_message||"",vo=e=>Fr(e).woopay_store_logo||"",Oo=e=>Fr(e).woopay_enabled_locations||Pr,bo=e=>Fr(e).current_protection_level||"basic",Ao=e=>Fr(e).advanced_fraud_protection_settings||Pr,Io=e=>Fr(e).show_woopay_incompatibility_notice||!1,No=e=>Fr(e).is_stripe_billing_enabled||!1,Do=e=>Fr(e).is_migrating_stripe_billing||!1,Mo=e=>Fr(e).stripe_billing_subscription_count||0,Po=e=>Fr(e).stripe_billing_migrated_count||0,Co=window.wp.apiFetch;var Fo=r.n(Co);function Uo(e){return{type:Nr.SET_SETTINGS_VALUES,payload:e}}function Lo(e){return Uo({is_saved_cards_enabled:e})}function ko(e){return Uo({is_card_present_eligible:e})}function xo(e){return Uo({payment_request_button_type:e})}function zo(e){return Uo({payment_request_button_size:e})}function jo(e){return Uo({payment_request_button_theme:e})}function Ho(e){return Uo({payment_request_button_border_radius:e})}function qo(e){return{type:Nr.SET_SETTINGS,data:e}}function Bo(e){return Uo({is_wcpay_enabled:e})}function Yo(e){return Uo({is_payment_request_enabled:e})}function $o(e){return Uo({is_apple_google_pay_in_payment_methods_options_enabled:e})}function Wo(e){return Uo({enabled_payment_method_ids:[...e]})}function Go(e,t){return{type:Nr.SET_IS_SAVING_SETTINGS,isSaving:e,error:t}}function Vo(e){return{type:Nr.SET_SELECTED_PAYMENT_METHOD,id:e}}function Qo(e){return{type:Nr.SET_UNSELECTED_PAYMENT_METHOD,id:e}}function Zo(e){return Uo({is_manual_capture_enabled:e})}function Ko(e){return Uo({is_test_mode_enabled:e})}function Xo(e){return Uo({is_debug_log_enabled:e})}function Jo(e){return Uo({is_multi_currency_enabled:e})}function en(e){return Uo({is_wcpay_subscriptions_enabled:e})}function tn(e){return Uo({account_statement_descriptor:e})}function rn(e){return Uo({account_statement_descriptor_kanji:e})}function on(e){return Uo({account_statement_descriptor_kana:e})}function nn(e){return Uo({account_business_support_email:e})}function an(e){return Uo({account_business_support_phone:e})}function sn(e){return Uo({deposit_schedule_interval:e})}function cn(e){return Uo({deposit_schedule_weekly_anchor:e})}function un(e){return Uo({deposit_schedule_monthly_anchor:""===e?null:parseInt(e,10)})}function*dn(){let e=null;try{const e=(0,le.select)(_e).getSettings();yield Go(!0,null);const t=yield(0,me.apiFetch)({path:`${pe}/settings`,method:"post",data:e});yield Uo({payment_method_statuses:t.data.payment_method_statuses}),yield(0,le.dispatch)("core/notices").createSuccessNotice((0,G.__)("Settings saved.","woocommerce-payments"))}catch(t){e=t,yield(0,le.dispatch)("core/notices").createErrorNotice((0,G.__)("Error saving settings.","woocommerce-payments")),e.server_error&&(yield(0,le.dispatch)("core/notices").createErrorNotice(e.server_error))}finally{yield Go(!1,e)}return null===e}function ln(e){return Uo({payment_request_enabled_locations:[...e]})}function mn(e){return Uo({is_woopay_enabled:e})}function pn(e){return Uo({is_woopay_global_theme_support_enabled:e})}function _n(e){return Uo({woopay_custom_message:e})}function yn(e){return Uo({woopay_store_logo:e})}function hn(e){return Uo({woopay_enabled_locations:[...e]})}function fn(e){return Uo({current_protection_level:e})}function gn(e){return Uo({advanced_fraud_protection_settings:e})}function En(e){return Uo({is_stripe_billing_enabled:e})}function*Sn(){try{yield(0,le.dispatch)(_e).startResolution("scheduleStripeBillingMigration"),yield(0,me.apiFetch)({path:`${pe}/settings/schedule-stripe-billing-migration`,method:"post"})}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,G.__)("Error starting the Stripe Billing migration.","woocommerce-payments"))}yield(0,le.dispatch)(_e).finishResolution("scheduleStripeBillingMigration")}function Tn(e,t){Fo()({path:`${pe}/settings/${e}`,method:"post",data:{value:t}}).catch((()=>{(0,le.dispatch)("core/notices").createErrorNotice((0,G.__)("Error saving option","woocommerce-payments"))}))}function*wn(){const e=`${pe}/settings`;try{const t=yield(0,me.apiFetch)({path:e});yield qo(t)}catch(e){yield(0,le.dispatch)("core/notices").createErrorNotice((0,G.__)("Error retrieving settings.","woocommerce-payments"))}}const Rn={SET_CARD_READER_STATS:"SET_CARD_READER_STATS",SET_ERROR_FOR_CARD_READER_STATS:"SET_ERROR_FOR_CARD_READER_STATS",SET_READERS:"SET_READERS",SET_ERROR_FOR_CARD_READERS:"SET_ERROR_FOR_CARD_READERS"},vn=(e,t)=>e.readers[t]&&e.readers[t].data?e.readers[t].data:{},On=(e,t)=>e.readers[t]&&e.readers[t].error?e.readers[t].error:{},bn=e=>e.readers&&e.readers.list?e.readers.list:{};function An(e,t){return{type:Rn.SET_CARD_READER_STATS,id:e,data:t}}function In(e,t){return{type:Rn.SET_READERS,query:e,data:t}}function Nn(e,t,r){return{type:Rn.SET_CARD_ERROR_FOR_READER_STATS,id:e,data:t,error:r}}function Dn(e,t){return{type:Rn.SET_CARD_ERROR_FOR_READERS,data:e,error:t}}function*Mn(e,t){try{const r=yield(0,me.apiFetch)({path:`${pe}/readers/charges/${t}`});yield An(e,r)}catch(t){yield Nn(e,null,t)}}function*Pn(e){const t=(0,xe.addQueryArgs)(`${pe}/readers`,{limit:e.limit});try{const r=yield(0,me.apiFetch)({path:t})||{};yield In(e,r)}catch(e){yield Dn(null,e)}}var Cn;!function(e){e.SET_ACTIVE_LOAN_SUMMARY="SET_ACTIVE_LOAN_SUMMARY",e.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY="SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY",e.SET_LOANS="SET_LOANS",e.SET_ERROR_FOR_LOANS="SET_ERROR_FOR_LOANS"}(Cn||(Cn={}));const Fn=Cn,Un={},Ln=e=>e&&e.capital||{},kn=e=>Ln(e).summary,xn=e=>Ln(e).summaryError,zn=e=>Ln(e).loans||[],jn=e=>Ln(e).loansError;function Hn(e){return{type:Fn.SET_ACTIVE_LOAN_SUMMARY,data:e}}function qn(e){return{type:Fn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY,error:e}}function Bn(e){return{type:Fn.SET_LOANS,data:e.data}}function Yn(e){return{type:Fn.SET_ERROR_FOR_LOANS,error:e}}function*$n(){const e=`${pe}/capital/active_loan_summary`;try{const t=yield(0,me.apiFetch)({path:e});yield Hn(t)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield qn(e)}}function*Wn(){const e=`${pe}/capital/loans`;try{const t=yield(0,me.apiFetch)({path:e});yield Bn(t)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Yn(e)}}const Gn={SET_DOCUMENTS:"SET_DOCUMENTS",SET_ERROR_FOR_DOCUMENTS:"SET_ERROR_FOR_DOCUMENTS",SET_DOCUMENTS_SUMMARY:"SET_DOCUMENTS_SUMMARY",SET_ERROR_FOR_DOCUMENTS_SUMMARY:"SET_ERROR_FOR_DOCUMENTS_SUMMARY"},Vn={summary:{}},Qn=e=>e&&e.documents||{},Zn=(e,t)=>{const r=he(t);return Qn(e)[r]||{}},Kn=(e,t)=>Zn(e,t).data||[],Xn=(e,t)=>Zn(e,t).error||{},Jn=(e,t)=>{const r=he(t);return Qn(e).summary[r]||{}},ea=(e,t)=>Jn(e,t).data||{},ta=(e,t)=>Jn(e,t).error||{};function ra(e,t){return{type:Gn.SET_DOCUMENTS,query:e,data:t}}function oa(e,t,r){return{type:Gn.SET_ERROR_FOR_DOCUMENTS,query:e,data:t,error:r}}function na(e,t){return{type:Gn.SET_DOCUMENTS_SUMMARY,query:e,data:t}}function aa(e,t,r){return{type:Gn.SET_ERROR_FOR_DOCUMENTS_SUMMARY,query:e,data:t,error:r}}const ia=e=>({user_email:e.userEmail,match:e.match,date_before:Be(e.dateBefore,!0),date_after:Be(e.dateAfter),date_between:e.dateBetween&&[Be(e.dateBetween[0]),Be(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot});function*sa(e){const t=(0,xe.addQueryArgs)(`${pe}/documents`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...ia(e)});try{const r=yield(0,me.apiFetch)({path:t});yield ra(e,r.data||[])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving documents.","woocommerce-payments")),yield oa(e,null,t)}}function*ca(e){const t=(0,xe.addQueryArgs)(`${pe}/documents/summary`,ia(e));try{const r=yield(0,me.apiFetch)({path:t});yield na(e,r)}catch(t){yield aa(e,null,t)}}const ua={},da=({paymentIntents:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.data)||{}},la=({paymentIntents:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.error)||{}},ma={SET_AUTHORIZATIONS:"SET_AUTHORIZATIONS",SET_AUTHORIZATION:"SET_AUTHORIZATION",SET_ERROR_FOR_AUTHORIZATIONS:"SET_ERROR_FOR_AUTHORIZATIONS",SET_AUTHORIZATIONS_SUMMARY:"SET_AUTHORIZATIONS_SUMMARY",SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:"SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY",SET_IS_REQUESTING_AUTHORIZATION:"SET_IS_REQUESTING_AUTHORIZATION"},pa={summary:{},byId:{},isRequesting:!1},_a=e=>e&&e.authorizations||{},ya=(e,t)=>{const r=he(t);return _a(e)[r]||{}},ha=(e,t)=>ya(e,t).data||[],fa=(e,t)=>(_a(e).byId||{})[t],ga=(e,t)=>ya(e,t).error||{},Ea=(e,t)=>{const r=he(t);return _a(e).summary[r]||{}},Sa=(e,t)=>Ea(e,t).data||{},Ta=(e,t)=>Ea(e,t).error||{},wa=e=>_a(e).isRequesting,Ra=e=>{var t;const r={wcpay_missing_order:(0,G.__)("The order could not be found.","woocommerce-payments"),wcpay_refunded_order_uncapturable:(0,G.__)("Payment cannot be processed for partially or fully refunded orders.","woocommerce-payments"),wcpay_intent_order_mismatch:(0,G.__)("The payment cannot be processed due to a mismatch with order details.","woocommerce-payments"),wcpay_payment_uncapturable:(0,G.__)("This payment cannot be processed in its current state.","woocommerce-payments"),wcpay_capture_error:e=>{var t;return"amount_too_small"===(null===(t=e.data)||void 0===t?void 0:t.error_type)?(e=>{var t,r,o,n;if(!(null===(r=null===(t=e.data)||void 0===t?void 0:t.extra_details)||void 0===r?void 0:r.minimum_amount)||!(null===(n=null===(o=e.data)||void 0===o?void 0:o.extra_details)||void 0===n?void 0:n.minimum_amount_currency))return(0,G.__)("The payment amount is too small to be processed.","woocommerce-payments");const a=e.data.extra_details.minimum_amount_currency,i=Ue(e.data.extra_details.minimum_amount,a);return(0,G.sprintf)((0,G.__)("The minimum amount that can be processed is %1$s %2$s.","woocommerce-payments"),i,a.toUpperCase())})(e):(0,G.__)("The payment capture failed to complete.","woocommerce-payments")},wcpay_cancel_error:(0,G.__)("The payment cancellation failed to complete.","woocommerce-payments"),wcpay_server_error:(0,G.__)("An unexpected error occurred. Please try again later.","woocommerce-payments")},o=r[null!==(t=e.code)&&void 0!==t?t:""];return"function"==typeof o?o(e):null!=o?o:(0,G.__)("Unable to process the payment. Please try again later.","woocommerce-payments")};function va(e,t){return{type:ma.SET_AUTHORIZATIONS,data:t,query:e}}function Oa(e,t){return{type:ma.SET_ERROR_FOR_AUTHORIZATIONS,query:e,error:t}}function ba(e){return{type:ma.SET_AUTHORIZATION,data:e}}function Aa(e,t){return{type:ma.SET_AUTHORIZATIONS_SUMMARY,data:t,query:e}}function Ia(e){return{type:ma.SET_IS_REQUESTING_AUTHORIZATION,data:e}}function*Na(e,t){try{yield le.controls.dispatch(_e,"startResolution","getAuthorization",[e]),yield le.controls.dispatch(_e,"setIsRequestingAuthorization",!0);const r=yield(0,me.apiFetch)({path:`/wc/v3/payments/orders/${t}/capture_authorization`,method:"post",data:{payment_intent_id:e}}),o={payment_intent_id:r.id,captured:"succeeded"===r.status};yield ba(o),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getAuthorizations"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getTimeline"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getTransactions"),yield le.controls.dispatch("core/notices","createSuccessNotice",(0,G.sprintf)((0,G.__)("Payment for order #%s captured successfully.","woocommerce-payments"),t))}catch(e){const r=(0,G.sprintf)((0,G.__)("There has been an error capturing the payment for order #%s.","woocommerce-payments"),t),o=Ra(e);yield le.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield le.controls.dispatch(_e,"finishResolution","getAuthorization",[e]),yield le.controls.dispatch(_e,"setIsRequestingAuthorization",!1)}}function*Da(e,t){try{yield le.controls.dispatch(_e,"startResolution","getAuthorization",[e]),yield le.controls.dispatch(_e,"setIsRequestingAuthorization",!0);const r=yield(0,me.apiFetch)({path:`/wc/v3/payments/orders/${t}/cancel_authorization`,method:"post",data:{payment_intent_id:e}}),o={payment_intent_id:r.id,captured:"succeeded"===r.status};yield ba(o),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getAuthorizations"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getTimeline"),yield le.controls.dispatch(_e,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield le.controls.dispatch("core/notices","createSuccessNotice",(0,G.sprintf)((0,G.__)("Payment for order #%s canceled successfully.","woocommerce-payments"),t))}catch(e){const r=(0,G.sprintf)((0,G.__)("There has been an error canceling the payment for order #%s.","woocommerce-payments"),t),o=Ra(e);yield le.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield le.controls.dispatch(_e,"finishResolution","getAuthorization",[e]),yield le.controls.dispatch(_e,"setIsRequestingAuthorization",!1)}}function Ma(e,t){return{type:ma.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY,query:e,error:t}}function*Pa(e){var t;let{paged:r=1,per_page:o=25,orderby:n="created",order:a="asc"}=e;"capture_by"===n&&(n="created");const i=(0,xe.addQueryArgs)(`${pe}/authorizations`,{page:r,pagesize:o,sort:n,direction:a});try{const r=yield(0,me.apiFetch)({path:i});yield va(e,null!==(t=r.data)&&void 0!==t?t:[])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield Oa(e,t)}}function*Ca(e){try{if(e){const t=yield(0,me.apiFetch)({path:`${pe}/authorizations/${e}`}),{is_captured:r,payment_intent_id:o,created:n}=t;yield ba({payment_intent_id:o,captured:r,created:n})}}catch(e){"authorization_missing"!==e.code&&(yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving authorization.","woocommerce-payments")))}}function*Fa(e){const t=(0,xe.addQueryArgs)(`${pe}/authorizations/summary`,{pagesize:e.per_page,sort:e.orderby,direction:e.order,page:e.paged});try{const r=yield(0,me.apiFetch)({path:t});yield Aa(e,null!=r?r:[])}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield Ma(e,t)}}var Ua;!function(e){e.SET_FILE="SET_FILE",e.SET_ERROR_FOR_FILES="SET_ERROR_FOR_FILES"}(Ua||(Ua={}));const La=Ua,ka={},xa=({files:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.data)||{}},za=({files:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.error)||{}};function ja(e,t){return{type:La.SET_FILE,id:e,data:t}}function Ha(e,t){return{type:La.SET_ERROR_FOR_FILES,id:e,error:t}}function*qa(e){try{const t=yield(0,me.apiFetch)({path:`${pe}/file/${e}/details`});yield ja(e,t)}catch(t){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving file.","woocommerce-payments")),yield Ha(e,t)}}var Ba;!function(e){e.SET_PM_PROMOTIONS="SET_PM_PROMOTIONS",e.SET_ERROR_FOR_PM_PROMOTIONS="SET_ERROR_FOR_PM_PROMOTIONS"}(Ba||(Ba={}));const Ya={pmPromotions:void 0,pmPromotionsError:void 0},$a=e=>{var t,r;return null!==(r=null===(t=e.pmPromotions)||void 0===t?void 0:t.pmPromotions)&&void 0!==r?r:[]},Wa=e=>{var t;return null===(t=e.pmPromotions)||void 0===t?void 0:t.pmPromotionsError};function Ga(e){return function(e){return"object"==typeof e&&null!==e&&"code"in e&&"string"==typeof e.code}(e)?e:{code:"unknown_error"}}function Va(e){return{type:Ba.SET_PM_PROMOTIONS,data:e}}function Qa(e){return{type:Ba.SET_ERROR_FOR_PM_PROMOTIONS,error:e}}function*Za(e){const t=`${pe}/pm-promotions/${e}/activate`;try{yield(0,me.apiFetch)({path:t,method:"POST"}),yield le.controls.dispatch("core/notices","createSuccessNotice",(0,G.__)("Promotion activated successfully!","woocommerce-payments")),yield le.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error activating promotion. Please try again.","woocommerce-payments")),yield le.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ga(e))}}function*Ka(e){const t=`${pe}/pm-promotions/${e}/dismiss`;try{yield(0,me.apiFetch)({path:t,method:"POST"}),yield le.controls.dispatch("core/notices","createSuccessNotice",(0,G.__)("Promotion dismissed.","woocommerce-payments")),yield le.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error dismissing promotion. Please try again.","woocommerce-payments")),yield le.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ga(e))}}function Xa(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*Ja(){const e=`${pe}/pm-promotions`;try{const t=yield(0,me.apiFetch)({path:e});if(r=t,!Array.isArray(r)||!r.every(Xa))throw new Error("Invalid promotions data received from API");yield le.controls.dispatch("wc/payments","updatePmPromotions",t)}catch(e){yield le.controls.dispatch("core/notices","createErrorNotice",(0,G.__)("Error retrieving promotions. Please try again later.","woocommerce-payments")),yield le.controls.dispatch("wc/payments","updateErrorForPmPromotions",(t=e,function(e){return"object"==typeof e&&null!==e&&"code"in e}(t)?t:{code:"unknown_error"}))}var t,r}(0,le.registerStore)(_e,{reducer:(0,le.combineReducers)({deposits:(e=fe,{type:t,query:r={},data:o=[],error:n})=>{const a=he(r);switch(t){case ye.SET_DEPOSIT:return{...e,byId:{...e.byId,[o.id]:o}};case ye.SET_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,data:o}};case ye.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,error:n}};case ye.SET_DEPOSITS:return{...e,byId:{...e.byId,...(0,J.keyBy)(o,"id")},queries:{...e.queries,[a]:{data:(0,J.map)(o,"id")}}};case ye.SET_DEPOSITS_COUNT:return{...e,count:o};case ye.SET_ERROR_FOR_DEPOSIT_QUERY:return{...e,queries:{...e.queries,[a]:{error:n}}};case ye.SET_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case ye.SET_ERROR_FOR_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}};case ye.SET_INSTANT_DEPOSIT:return{...e,instant:{...e.instant,data:o}}}return e},transactions:(e=ct,{type:t,query:r={},data:o=[],error:n,status:a})=>{const i=he(r);switch(t){case st.SET_TRANSACTIONS:return{...e,[i]:{data:o}};case st.SET_ERROR_FOR_TRANSACTIONS:return{...e,[i]:{error:n}};case st.SET_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[i]:{data:o}}};case st.SET_ERROR_FOR_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[i]:{error:n}}};case st.SET_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[i]:{data:o}}}};case st.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[i]:{error:n}}}};case st.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[i]:{data:o}}}}};case st.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[i]:{error:n}}}}}}return e},charges:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case xt.SET_CHARGE:e={...e,[r]:{...e[r],data:o}};break;case xt.SET_ERROR_FOR_CHARGE:e={...e,[r]:{...e[r],error:n}}}return e},timeline:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case Gt.SET_TIMELINE:e={...e,[r]:{data:o}};break;case Gt.SET_ERROR_FOR_TIMELINE:e={...e,[r]:{...e[r],error:n}}}return e},disputes:(e=er,{type:t,query:r={},data:o=[],id:n,error:a})=>{const i=he(r);switch(t){case Jt.SET_DISPUTE:return{...e,byId:{...e.byId,[o.id]:o}};case Jt.SET_ERROR_FOR_DISPUTE:e={...e,byId:{...e.byId,[n]:{error:a}}};break;case Jt.SET_DISPUTES:return{...e,cached:{...e.cached,...(0,J.keyBy)(o,"dispute_id")},queries:{...e.queries,[i]:{data:(0,J.map)(o,"dispute_id")}}};case Jt.SET_DISPUTES_SUMMARY:return{...e,summary:{...e.summary,[i]:{data:o}}}}return e},settings:(e=Dr,{type:t,...r})=>{switch(t){case Nr.SET_SETTINGS:return{...e,data:r.data,isDirty:!1};case Nr.SET_SETTINGS_VALUES:return{...e,savingError:null,isDirty:!0,data:{...e.data,...r.payload}};case Nr.SET_IS_SAVING_SETTINGS:return{...e,isDirty:!(!r.isSaving&&!r.error)&&e.isDirty,isSaving:r.isSaving,savingError:r.error};case Nr.SET_SELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.concat(r.id)}};case Nr.SET_UNSELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.filter((e=>e!==r.id))}}}return e},readers:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case Rn.SET_CARD_READER_STATS:e={...e,[r]:{...e[r],data:o}};break;case Rn.SET_ERROR_FOR_CARD_READER_STATS:e={...e,[r]:{...e[r],error:n}};break;case Rn.SET_READERS:e={...e,list:o}}return e},capital:(e=Un,t)=>{switch(t.type){case Fn.SET_ACTIVE_LOAN_SUMMARY:return Object.assign(Object.assign({},e),{summary:t.data,summaryError:void 0});case Fn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY:return Object.assign(Object.assign({},e),{summary:void 0,summaryError:t.error});case Fn.SET_LOANS:return Object.assign(Object.assign({},e),{loans:t.data,loansError:void 0});case Fn.SET_ERROR_FOR_LOANS:return Object.assign(Object.assign({},e),{loans:void 0,loansError:t.error})}return e},documents:(e=Vn,{type:t,query:r={},data:o=[],error:n})=>{const a=he(r);switch(t){case Gn.SET_DOCUMENTS:return{...e,[a]:{data:o}};case Gn.SET_ERROR_FOR_DOCUMENTS:return{...e,[a]:{error:n}};case Gn.SET_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Gn.SET_ERROR_FOR_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}}}return e},paymentIntents:(e=ua,t)=>{const{type:r,id:o}=t;switch(r){case cr.SET_PAYMENT_INTENT:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{data:t.data})});case cr.SET_ERROR_FOR_PAYMENT_INTENT:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{error:t.error})});default:return e}},authorizations:(e=pa,t)=>{switch(t.type){case ma.SET_AUTHORIZATION:{const{data:r}=t;return Object.assign(Object.assign({},e),{byId:Object.assign(Object.assign({},e.byId),{[r.payment_intent_id]:Object.assign(Object.assign({},e.byId[r.payment_intent_id]),r)})})}case ma.SET_AUTHORIZATIONS:{const{data:r,query:o}=t;return Object.assign(Object.assign({},e),{[he(o)]:{data:r}})}case ma.SET_ERROR_FOR_AUTHORIZATIONS:{const{error:r,query:o}=t;return Object.assign(Object.assign({},e),{[he(o)]:{error:r}})}case ma.SET_AUTHORIZATIONS_SUMMARY:{const{data:r,query:o}=t;return Object.assign(Object.assign({},e),{summary:Object.assign(Object.assign({},e.summary),{[he(o)]:{data:r||{}}})})}case ma.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:{const{query:r,error:o}=t;return Object.assign(Object.assign({},e),{summary:Object.assign(Object.assign({},e.summary),{[he(r)]:{error:o||""}})})}case ma.SET_IS_REQUESTING_AUTHORIZATION:{const{data:r}=t;return Object.assign(Object.assign({},e),{isRequesting:r})}}return e},files:(e=ka,t)=>{const{type:r,id:o}=t;switch(r){case La.SET_FILE:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{data:t.data})});case La.SET_ERROR_FOR_FILES:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{error:t.error})});default:return e}},pmPromotions:(e=Ya,t)=>{switch(t.type){case Ba.SET_PM_PROMOTIONS:return Object.assign(Object.assign({},e),{pmPromotions:t.data,pmPromotionsError:void 0});case Ba.SET_ERROR_FOR_PM_PROMOTIONS:return Object.assign(Object.assign({},e),{pmPromotions:void 0,pmPromotionsError:t.error})}return e}}),actions:{...t,...a,...c,...l,...h,...E,...w,...O,...I,..._,...P,...U,...x},controls:me.controls,selectors:{...e,...n,...s,...d,...p,...g,...T,...v,...A,...D,...M,...F,...k},resolvers:{...o,...i,...u,...m,...f,...S,...R,...b,...N,...y,...C,...L,...z}});const ei=()=>{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"},ti=()=>{const{pmPromotions:e,isLoading:t}=(0,le.useSelect)((e=>{const{getPmPromotions:t,getPmPromotionsError:r,isResolving:o}=e(_e);return{pmPromotions:t(),pmPromotionsError:r(),isLoading:o("getPmPromotions")}})),{activatePmPromotion:r,dismissPmPromotion:o}=(()=>{const{activatePmPromotion:e,dismissPmPromotion:t}=(0,le.useDispatch)(_e);return{activatePmPromotion:e,dismissPmPromotion:t}})(),n=(0,j.useMemo)((()=>null==e?void 0:e.find((e=>"spotlight"===e.type))),[e]),a=(0,j.useCallback)((()=>({promo_id:null==n?void 0:n.promo_id,payment_method:null==n?void 0:n.payment_method,display_context:"spotlight",source:ei(),path:window.location.pathname+window.location.search})),[null==n?void 0:n.promo_id,null==n?void 0:n.payment_method]),i=(0,j.useCallback)((()=>{Pe("wcpay_payment_method_promotion_view",a())}),[a]),s=(0,j.useCallback)((()=>{n&&(Pe("wcpay_payment_method_promotion_activate_click",a()),r(n.id))}),[a,r,n]),c=(0,j.useCallback)((()=>{if(n&&(Pe("wcpay_payment_method_promotion_link_click",Object.assign(Object.assign({},a()),{link_type:"terms"})),n.tc_url))try{const e=new URL(n.tc_url);"https:"!==e.protocol&&"http:"!==e.protocol||window.open(n.tc_url,"_blank","noopener,noreferrer")}catch(e){}}),[a,n]),u=(0,j.useCallback)((()=>{n&&(Pe("wcpay_payment_method_promotion_dismiss_click",a()),o(n.id))}),[a,o,n]);return t?null:e&&0!==e.length&&n?H().createElement(de,{badge:n.badge_text,badgeType:n.badge_type,heading:n.title,description:n.description,footnote:n.footnote,image:n.image,primaryButtonLabel:n.cta_label,onPrimaryClick:s,secondaryButtonLabel:n.tc_label,onSecondaryClick:c,onDismiss:u,onView:i}):null},ri=()=>{const e=document.getElementById("wcpay-payments-settings-spotlight");e&&(0,q.H)(e).render((0,$.jsx)(ti,{}))};"interactive"===document.readyState||"complete"===document.readyState?ri():window.addEventListener("DOMContentLoaded",ri)})()})();