Current File : /home/kelaby89/abl.academy/wp-content/plugins/woocommerce-payments/dist/express-checkout.js
(()=>{var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var t;e.g.importScripts&&(t=e.g.location+"");var o=e.g.document;if(!t&&o&&(o.currentScript&&(t=o.currentScript.src),!t)){var r=o.getElementsByTagName("script");if(r.length)for(var a=r.length-1;a>-1&&(!t||!/^http(s?):/.test(t));)t=r[a--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t})(),e.p=window.wcpayAssets.url,(()=>{"use strict";const t=window.wp.i18n,o=window.wp.hooks,r=e=>"undefined"!=typeof wcpayConfig?wcpayConfig[e]:a(e),a=e=>{let t=null;if("undefined"!=typeof wcpay_upe_config)t=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;t=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return t[e]||null},n=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,i=(e,t,o="wcpay_")=>e.toString().replace("%%endpoint%%",o+t),s=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],c=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],l=["backgroundColor","border","borderTop","borderRight","borderBottom","borderLeft","borderRadius","borderWidth","borderColor","borderStyle","borderTopWidth","borderTopColor","borderTopStyle","borderRightWidth","borderRightColor","borderRightStyle","borderBottomWidth","borderBottomColor","borderBottomStyle","borderLeftWidth","borderLeftColor","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","outline","outlineOffset","boxShadow"],u={".Label":[...s,...c],".Text":[...s,...c],".Input":[...s,...c,...l],".Error":[...s,...c,...l],".Tab":[...s,...c,...l],".TabIcon":[...s],".TabLabel":[...s,...c],".Block":[...s.slice(1),...l.slice(1)],".Container":[...l],".Header":[...s,...l,...c],".Footer":[...s,...l,...c]},d={".Label":u[".Label"],".Label--floating":[...u[".Label"],"transform"],".Input":[...u[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":u[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",l],".TabIcon":u[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":u[".TabLabel"],".Block":u[".Block"],".Container":u[".Container"],".Header":u[".Header"],".Footer":u[".Footer"],".Footer--link":u[".Text"],".Text":u[".Text"],".Text--redirect":u[".Text"]};function p(e){return p="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},p(e)}var h=/^\s+/,m=/\s+$/;function f(e,t){if(t=t||{},(e=e||"")instanceof f)return e;if(!(this instanceof f))return new f(e,t);var o=function(e){var t,o,r,a={r:0,g:0,b:0},n=1,i=null,s=null,c=null,l=!1,u=!1;return"string"==typeof e&&(e=function(e){e=e.replace(h,"").replace(m,"").toLowerCase();var t,o=!1;if(R[e])e=R[e],o=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=U.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=U.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=U.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=U.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=U.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=U.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=U.hex8.exec(e))?{r:B(t[1]),g:B(t[2]),b:B(t[3]),a:$(t[4]),format:o?"name":"hex8"}:(t=U.hex6.exec(e))?{r:B(t[1]),g:B(t[2]),b:B(t[3]),format:o?"name":"hex"}:(t=U.hex4.exec(e))?{r:B(t[1]+""+t[1]),g:B(t[2]+""+t[2]),b:B(t[3]+""+t[3]),a:$(t[4]+""+t[4]),format:o?"name":"hex8"}:!!(t=U.hex3.exec(e))&&{r:B(t[1]+""+t[1]),g:B(t[2]+""+t[2]),b:B(t[3]+""+t[3]),format:o?"name":"hex"}}(e)),"object"==p(e)&&(D(e.r)&&D(e.g)&&D(e.b)?(t=e.r,o=e.g,r=e.b,a={r:255*j(t,255),g:255*j(o,255),b:255*j(r,255)},l=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):D(e.h)&&D(e.s)&&D(e.v)?(i=N(e.s),s=N(e.v),a=function(e,t,o){e=6*j(e,360),t=j(t,100),o=j(o,100);var r=Math.floor(e),a=e-r,n=o*(1-t),i=o*(1-a*t),s=o*(1-(1-a)*t),c=r%6;return{r:255*[o,i,n,n,s,o][c],g:255*[s,o,o,i,n,n][c],b:255*[n,n,s,o,o,i][c]}}(e.h,i,s),l=!0,u="hsv"):D(e.h)&&D(e.s)&&D(e.l)&&(i=N(e.s),c=N(e.l),a=function(e,t,o){var r,a,n;function i(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e}if(e=j(e,360),t=j(t,100),o=j(o,100),0===t)r=a=n=o;else{var s=o<.5?o*(1+t):o+t-o*t,c=2*o-s;r=i(c,s,e+1/3),a=i(c,s,e),n=i(c,s,e-1/3)}return{r:255*r,g:255*a,b:255*n}}(e.h,i,c),l=!0,u="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=L(n),{ok:l,format:e.format||u,r:Math.min(255,Math.max(a.r,0)),g:Math.min(255,Math.max(a.g,0)),b:Math.min(255,Math.max(a.b,0)),a:n}}(e);this._originalInput=e,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||o.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function b(e,t,o){e=j(e,255),t=j(t,255),o=j(o,255);var r,a,n=Math.max(e,t,o),i=Math.min(e,t,o),s=(n+i)/2;if(n==i)r=a=0;else{var c=n-i;switch(a=s>.5?c/(2-n-i):c/(n+i),n){case e:r=(t-o)/c+(t<o?6:0);break;case t:r=(o-e)/c+2;break;case o:r=(e-t)/c+4}r/=6}return{h:r,s:a,l:s}}function g(e,t,o){e=j(e,255),t=j(t,255),o=j(o,255);var r,a,n=Math.max(e,t,o),i=Math.min(e,t,o),s=n,c=n-i;if(a=0===n?0:c/n,n==i)r=0;else{switch(n){case e:r=(t-o)/c+(t<o?6:0);break;case t:r=(o-e)/c+2;break;case o:r=(e-t)/c+4}r/=6}return{h:r,s:a,v:s}}function y(e,t,o,r){var a=[H(Math.round(e).toString(16)),H(Math.round(t).toString(16)),H(Math.round(o).toString(16))];return r&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function _(e,t,o,r){return[H(z(r)),H(Math.round(e).toString(16)),H(Math.round(t).toString(16)),H(Math.round(o).toString(16))].join("")}function w(e,t){t=0===t?0:t||10;var o=f(e).toHsl();return o.s-=t/100,o.s=F(o.s),f(o)}function v(e,t){t=0===t?0:t||10;var o=f(e).toHsl();return o.s+=t/100,o.s=F(o.s),f(o)}function k(e){return f(e).desaturate(100)}function S(e,t){t=0===t?0:t||10;var o=f(e).toHsl();return o.l+=t/100,o.l=F(o.l),f(o)}function x(e,t){t=0===t?0:t||10;var o=f(e).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(-t/100*255))),o.g=Math.max(0,Math.min(255,o.g-Math.round(-t/100*255))),o.b=Math.max(0,Math.min(255,o.b-Math.round(-t/100*255))),f(o)}function C(e,t){t=0===t?0:t||10;var o=f(e).toHsl();return o.l-=t/100,o.l=F(o.l),f(o)}function T(e,t){var o=f(e).toHsl(),r=(o.h+t)%360;return o.h=r<0?360+r:r,f(o)}function I(e){var t=f(e).toHsl();return t.h=(t.h+180)%360,f(t)}function P(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var o=f(e).toHsl(),r=[f(e)],a=360/t,n=1;n<t;n++)r.push(f({h:(o.h+n*a)%360,s:o.s,l:o.l}));return r}function A(e){var t=f(e).toHsl(),o=t.h;return[f(e),f({h:(o+72)%360,s:t.s,l:t.l}),f({h:(o+216)%360,s:t.s,l:t.l})]}function M(e,t,o){t=t||6,o=o||30;var r=f(e).toHsl(),a=360/o,n=[f(e)];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,n.push(f(r));return n}function q(e,t){t=t||6;for(var o=f(e).toHsv(),r=o.h,a=o.s,n=o.v,i=[],s=1/t;t--;)i.push(f({h:r,s:a,v:n})),n=(n+s)%1;return i}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,o,r=this.toRgb();return e=r.r/255,t=r.g/255,o=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))},setAlpha:function(e){return this._a=L(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=g(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=g(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+o+"%, "+r+"%)":"hsva("+t+", "+o+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=b(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=b(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+o+"%, "+r+"%)":"hsla("+t+", "+o+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return y(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,o,r,a){var n=[H(Math.round(e).toString(16)),H(Math.round(t).toString(16)),H(Math.round(o).toString(16)),H(z(r))];return a&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)&&n[3].charAt(0)==n[3].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)+n[3].charAt(0):n.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*j(this._r,255))+"%",g:Math.round(100*j(this._g,255))+"%",b:Math.round(100*j(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*j(this._r,255))+"%, "+Math.round(100*j(this._g,255))+"%, "+Math.round(100*j(this._b,255))+"%)":"rgba("+Math.round(100*j(this._r,255))+"%, "+Math.round(100*j(this._g,255))+"%, "+Math.round(100*j(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[y(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+_(this._r,this._g,this._b,this._a),o=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var a=f(e);o="#"+_(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+o+")"},toString:function(e){var t=!!e;e=e||this._format;var o=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(o=this.toRgbString()),"prgb"===e&&(o=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(o=this.toHexString()),"hex3"===e&&(o=this.toHexString(!0)),"hex4"===e&&(o=this.toHex8String(!0)),"hex8"===e&&(o=this.toHex8String()),"name"===e&&(o=this.toName()),"hsl"===e&&(o=this.toHslString()),"hsv"===e&&(o=this.toHsvString()),o||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(e,t){var o=e.apply(null,[this].concat([].slice.call(t)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(x,arguments)},darken:function(){return this._applyModification(C,arguments)},desaturate:function(){return this._applyModification(w,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(k,arguments)},spin:function(){return this._applyModification(T,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(I,arguments)},monochromatic:function(){return this._applyCombination(q,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(P,[3])},tetrad:function(){return this._applyCombination(P,[4])}},f.fromRatio=function(e,t){if("object"==p(e)){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]="a"===r?e[r]:N(e[r]));e=o}return f(e,t)},f.equals=function(e,t){return!(!e||!t)&&f(e).toRgbString()==f(t).toRgbString()},f.random=function(){return f.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},f.mix=function(e,t,o){o=0===o?0:o||50;var r=f(e).toRgb(),a=f(t).toRgb(),n=o/100;return f({r:(a.r-r.r)*n+r.r,g:(a.g-r.g)*n+r.g,b:(a.b-r.b)*n+r.b,a:(a.a-r.a)*n+r.a})},f.readability=function(e,t){var o=f(e),r=f(t);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},f.isReadable=function(e,t,o){var r,a,n,i,s,c=f.readability(e,t);switch(a=!1,(n=o,"AA"!==(i=((n=n||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(s=(n.size||"small").toLowerCase())&&"large"!==s&&(s="small"),r={level:i,size:s}).level+r.size){case"AAsmall":case"AAAlarge":a=c>=4.5;break;case"AAlarge":a=c>=3;break;case"AAAsmall":a=c>=7}return a},f.mostReadable=function(e,t,o){var r,a,n,i,s=null,c=0;a=(o=o||{}).includeFallbackColors,n=o.level,i=o.size;for(var l=0;l<t.length;l++)(r=f.readability(e,t[l]))>c&&(c=r,s=f(t[l]));return f.isReadable(e,s,{level:n,size:i})||!a?s:(o.includeFallbackColors=!1,f.mostReadable(e,["#fff","#000"],o))};var R=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=f.hexNames=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}(R);function L(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function j(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var o=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),o&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function F(e){return Math.min(1,Math.max(0,e))}function B(e){return parseInt(e,16)}function H(e){return 1==e.length?"0"+e:""+e}function N(e){return e<=1&&(e=100*e+"%"),e}function z(e){return Math.round(255*parseFloat(e)).toString(16)}function $(e){return B(e)/255}var O,W,Q,U=(W="[\\s|\\(]+("+(O="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+O+")[,|\\s]+("+O+")\\s*\\)?",Q="[\\s|\\(]+("+O+")[,|\\s]+("+O+")[,|\\s]+("+O+")[,|\\s]+("+O+")\\s*\\)?",{CSS_UNIT:new RegExp(O),rgb:new RegExp("rgb"+W),rgba:new RegExp("rgba"+Q),hsl:new RegExp("hsl"+W),hsla:new RegExp("hsla"+Q),hsv:new RegExp("hsv"+W),hsva:new RegExp("hsva"+Q),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function D(e){return!!U.CSS_UNIT.exec(e)}const V=e=>{const t=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0?(\.\d+)?|1?(\.0+)?)\s*\)$/);if(t){const o=t[4]||1;e=`rgb(${t.slice(1,4).map((e=>Math.round(e*o+255*(1-o)))).join(", ")})`}return e},X={default:{hiddenContainer:"#wcpay-hidden-div",hiddenInput:"#wcpay-hidden-input",hiddenInvalidInput:"#wcpay-hidden-invalid-input",hiddenValidActiveLabel:"#wcpay-hidden-valid-active-label"},classicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:["#payment .payment_methods li .payment_box fieldset",".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],backgroundSelectors:["li.wc_payment_method .wc-payment-form","li.wc_payment_method .payment_box","#payment","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["a"],pmmeRelativeTextSizeSelector:".wc_payment_method > label"},blocksCheckout:{appendTarget:".wc-block-checkout__contact-fields",upeThemeInputSelector:".wc-block-components-text-input #email",upeThemeLabelSelector:".wc-block-components-text-input label",upeThemeTextSelectors:[".wc-block-components-checkout-step__description",".wc-block-components-text-input"],rowElement:"div",validClasses:["wc-block-components-text-input","is-active"],invalidClasses:["wc-block-components-text-input","has-error"],alternateSelectors:{appendTarget:"#billing.wc-block-components-address-form",upeThemeInputSelector:"#billing-first_name",upeThemeLabelSelector:".wc-block-components-checkout-step__description"},backgroundSelectors:["#payment-method .wc-block-components-radio-control-accordion-option","#payment-method","form.wc-block-checkout__form",".wc-block-checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-components-checkout-place-order-button"],linkSelectors:["a"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"],pmmeRelativeTextSizeSelector:".wc-block-components-radio-control__label-group"},bnplProductPage:{appendTarget:".product .cart .quantity",upeThemeInputSelector:".product .cart .quantity .qty",upeThemeLabelSelector:".product .cart .quantity label",upeThemeTextSelectors:[".product .cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main > .product > div.summary.entry-summary","#main > .product","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".single_add_to_cart_button"],linkSelectors:["a"]},bnplClassicCart:{appendTarget:".cart .quantity",upeThemeInputSelector:".cart .quantity .qty",upeThemeLabelSelector:".cart .quantity label",upeThemeTextSelectors:[".cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main .entry-content .cart_totals","#main .entry-content","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".checkout-button"],linkSelectors:["a"],containerSelectors:[".shop_table"]},bnplCartBlock:{appendTarget:".wc-block-cart .wc-block-components-quantity-selector",upeThemeInputSelector:".wc-block-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input",upeThemeLabelSelector:".wc-block-components-text-input",upeThemeTextSelectors:[".wc-block-components-text-input"],rowElement:"div",validClasses:["wc-block-components-text-input"],invalidClasses:["wc-block-components-text-input","has-error"],backgroundSelectors:[".wc-block-components-bnpl-wrapper",".wc-block-components-order-meta",".wc-block-components-totals-wrapper",".wp-block-woocommerce-cart-order-summary-block",".wp-block-woocommerce-cart-totals-block",".wp-block-woocommerce-cart .wc-block-cart",".wp-block-woocommerce-cart","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-cart__submit-button"],linkSelectors:["a"],containerSelectors:[".wp-block-woocommerce-cart-line-items-block"]},wooPayClassicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:[".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],backgroundSelectors:["#customer_details","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["a"],containerSelectors:[".woocommerce-checkout-review-order-table"],headerSelectors:[".site-header","header > div"],footerSelectors:[".site-footer","footer > div"],footerLink:[".site-footer a","footer a"]},updateSelectors:function(e,t){return e.hasOwnProperty("alternateSelectors")&&(Object.entries(e.alternateSelectors).forEach((o=>{const[r,a]=o;t.querySelector(e[r])||(e[r]=a)})),delete e.alternateSelectors),e},getSelectors:function(e,t){let o=this.blocksCheckout;switch(e){case"blocks_checkout":o=this.blocksCheckout;break;case"shortcode_checkout":o=this.classicCheckout;break;case"bnpl_product_page":o=this.bnplProductPage;break;case"bnpl_classic_cart":o=this.bnplClassicCart;break;case"bnpl_cart_block":o=this.bnplCartBlock;break;case"woopay_shortcode_checkout":o=this.wooPayClassicCheckout}return{...this.default,...this.updateSelectors(o,t)}}},G={getHiddenContainer:function(e,t){const o=t.createElement("div");return o.setAttribute("id",this.getIDFromSelector(e)),o.style.border=0,o.style.clip="rect(0 0 0 0)",o.style.height="1px",o.style.margin="-1px",o.style.overflow="hidden",o.style.padding="0",o.style.position="absolute",o.style.width="1px",o},createRow:function(e,t=[],o){const r=o.createElement(e);return t.length&&r.classList.add(...t),r},appendClone:function(e,t,o,r){const a=r.querySelector(t);if(a){const t=a.cloneNode(!0);t.id=this.getIDFromSelector(o),t.value="",e.appendChild(t)}},getIDFromSelector:function(e){return e.startsWith("#")||e.startsWith(".")?e.slice(1):e},init:function(e,t){const o=X.getSelectors(e),r=t.querySelector(o.appendTarget),a=t.querySelector(o.upeThemeInputSelector);if(!r||!a)return;t.querySelector(o.hiddenContainer)&&this.cleanup(t);const n=this.getHiddenContainer(o.hiddenContainer,t);r.appendChild(n);const i=this.createRow(o.rowElement,o.validClasses,t);n.appendChild(i);const s=this.createRow(o.rowElement,o.invalidClasses,t);n.appendChild(s),this.appendClone(i,o.upeThemeInputSelector,o.hiddenInput,t),this.appendClone(i,o.upeThemeLabelSelector,o.hiddenValidActiveLabel,t),this.appendClone(s,o.upeThemeInputSelector,o.hiddenInvalidInput,t),this.appendClone(s,o.upeThemeLabelSelector,o.hiddenInvalidInput,t),t.querySelector(o.hiddenInput).style.transition="none"},cleanup:function(e){const t=e.querySelector(X.default.hiddenContainer);t&&t.remove()}},J=(e,t,o=null,r)=>{if(!r.querySelector(e))return{};const a=r.defaultView||window,n=d[t],i=r.querySelector(e),s=a.getComputedStyle(i),c={};for(let e=0;e<s.length;e++){const t=s[e].replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}));if(n.includes(t)){let o=s.getPropertyValue(s[e]);"color"===t&&(o=V(o)),c[t]=o}}if(".Input"===t||".Tab--selected"===t){const e=((e,t="solid",o)=>e&&o?[e,t,o].join(" "):"")(c.outlineWidth,c.outlineStyle,c.outlineColor);""!==e&&(c.outline=e),delete c.outlineWidth,delete c.outlineColor,delete c.outlineStyle}const l=s.getPropertyValue("text-indent");return"0px"!==l&&"0px"===c.paddingLeft&&"0px"===c.paddingRight&&(c.paddingLeft=l,c.paddingRight=l),".Block"===t&&(c.backgroundColor=o),c},K=(e,t=!1,o=document)=>{const r=X.getSelectors(e,o);G.init(e,o);const a=J(r.hiddenInput,".Input",null,o),n=J(r.hiddenInvalidInput,".Input",null,o),i=J(r.upeThemeLabelSelector,".Label",null,o),s={fontSize:i.fontSize},c=J(r.upeThemeTextSelectors,".Text",null,o),l=J(r.upeThemeInputSelector,".Tab",null,o),u=J(r.hiddenInput,".Tab--selected",null,o),d=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const o=((e,t)=>{const o={backgroundColor:e,color:t},r=f(e),a=f(t);if(!r.isValid()||!a.isValid())return{backgroundColor:"",color:""};const n=r.getBrightness()>50?f(r).darken(7):f(r).lighten(7),i=f.mostReadable(n,[a],{includeFallbackColors:!0});return o.backgroundColor=n.toRgbString(),o.color=i.toRgbString(),o})(e.backgroundColor,e.color);return t.backgroundColor=o.backgroundColor,t.color=o.color,t})(l),p={color:d.color},h={color:u.color},m=((e,t=document)=>{let o=null,r=0;for(;!o&&r<e.length;){const a=t.querySelector(e[r]);if(!a){r++;continue}const n=(t.defaultView||window).getComputedStyle(a).backgroundColor;n&&f(n).getAlpha()>0&&(o=n),r++}return o||"#ffffff"})(r.backgroundSelectors,o),b=J(r.headingSelectors,".Label",null,o),g=J(r.upeThemeLabelSelector,".Block",m,o),y=J(r.buttonSelectors,".Input",null,o),_=J(r.linkSelectors,".Label",null,o),w=J(r.containerSelectors,".Container",null,o),v=J(r.headerSelectors,".Header",null,o),k=J(r.footerSelectors,".Footer",null,o),S=J(r.footerLink,".Footer--link",null,o),x={colorBackground:m,colorText:c.color,fontFamily:c.fontFamily,fontSizeBase:c.fontSize};r.pmmeRelativeTextSizeSelector&&x.fontSizeBase&&(x.fontSizeBase=function(e,t,o=.875,r){const a=parseFloat(t);if(isNaN(a))return t;const n=r.querySelector(e);if(!n)return a*o+"px";const i=window.getComputedStyle(n).getPropertyValue("font-size"),s=parseFloat(i)*o;return isNaN(s)?t:a>s?`${s}px`:`${a}px`}(r.pmmeRelativeTextSizeSelector,c.fontSize,.875,o));const C="blocks_checkout"===e;let T={variables:x,theme:(I=m,f(I).getBrightness()>125?"stripe":"night"),labels:C?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":a,".Input--invalid":n,".Label":i,".Label--resting":s,".Block":g,".Tab":l,".Tab:hover":d,".Tab--selected":u,".TabIcon:hover":p,".TabIcon--selected":h,".Text":c,".Text--redirect":c}))};var I;return C&&(T=((e,t)=>{if(e.rules[".Label--floating"]=t,e.rules[".Label--floating"].transform&&"none"!==e.rules[".Label--floating"].transform){const t=e.rules[".Label--floating"].transform.match(/matrix\((.+)\)/);if(t&&t[1]){const o=t[1].split(", "),r=(parseFloat(o[0])+parseFloat(o[3]))/2,a=parseFloat(e.rules[".Label--floating"].lineHeight),n=Math.floor(a*r);e.rules[".Label--floating"].lineHeight=`${n}px`,e.rules[".Label--floating"].fontSize=`${n}px`}delete e.rules[".Label--floating"].transform}if(e.rules[".Input"].paddingTop&&(e.rules[".Input"].paddingTop=`calc(${e.rules[".Input"].paddingTop} - ${e.rules[".Label--floating"].lineHeight} - 4px - 1px)`),e.rules[".Input"].paddingBottom){var o;const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const r=null!==(o=e.rules[".Label"].marginTop)&&void 0!==o?o:"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=r}return e})(T,J(r.hiddenValidActiveLabel,".Label--floating",null,o))),t&&(T.rules={...T.rules,".Heading":b,".Header":v,".Footer":k,".Footer-link":S,".Button":y,".Link":_,".Container":w}),G.cleanup(o),T};class Y{constructor(e,t){this.options=e,this.stripe=null,this.stripePlatform=null,this.request=t,this.isWooPayRequesting=!1}createStripe(e,t,o="",r=[]){const a={locale:t};return o&&(a.stripeAccount=o),r&&(a.betas=r),new Stripe(e,a)}async getStripeForUPE(e){return this.options.forceNetworkSavedCards=a("paymentMethodsConfig")[e].forceNetworkSavedCards,this.getStripe()}async getStripe(e=!1){let t=0;for(;!window.Stripe;)if(await new Promise((e=>setTimeout(e,100))),t+=100,t>6e5)throw new Error("Stripe object not found");return this.__getStripe(e)}__getStripe(e=!1){const{publishableKey:t,accountId:o,forceNetworkSavedCards:r,locale:a,isStripeLinkEnabled:n}=this.options;if(r&&!e)return this.stripePlatform||(this.stripePlatform=this.createStripe(t,a)),this.stripePlatform;if(!this.stripe){let e=["card_country_event_beta_1"];n&&(e=e.concat(["link_autofill_modal_beta_1"])),this.stripe=this.createStripe(t,a,o,e)}return this.stripe}async loadStripeForExpressCheckout(){try{return this.getStripe(!0)}catch(e){return{error:e}}}confirmIntent(e,t=!1){const o=e.match(/#wcpay-confirm-(pi|si):(.+):(.+):(.+)$/);if(!o)return!0;const a="si"===o[1];let i=o[2];const s=o[3],c=o[4],l=e.indexOf("order-pay"),u=l>-1&&e.substring(l).match(/\d+/);return u&&(i=u[0]),(async()=>{const{locale:e,publishableKey:t}=this.options,o=r("accountIdForIntentConfirmation"),n=await this.getStripe();return a?n.handleNextAction({clientSecret:s}):o?this.createStripe(t,e,o).confirmCardPayment(s):(await this.getStripe(!0)).handleNextAction({clientSecret:s})})().then((e=>{var o;let a=null;e.paymentIntent?.last_payment_error&&(a={message:e.paymentIntent.last_payment_error.message}),"requires_action"===e.paymentIntent?.status&&(a={message:"Payment requires additional action."});const s=e.paymentIntent&&e.paymentIntent.id||e.setupIntent&&e.setupIntent.id||e.error&&e.error.payment_intent&&e.error.payment_intent.id||e.error.setup_intent&&e.error.setup_intent.id,l=null!==(o=n("ajax_url"))&&void 0!==o?o:r("ajaxUrl"),u=r("isChangingPayment");return[this.request(l,{action:"update_order_status",order_id:i,_ajax_nonce:c,intent_id:s,should_save_payment_method:t?"true":"false",is_changing_payment:u?"true":"false"}),a,e.error]})).then((([e,t,o])=>{if(o)throw o;return e.then((e=>{const o="string"==typeof e?JSON.parse(e):e;if(o.error)throw o.error;if(t)throw t;return o.return_url}))}))}async setupIntent(e){const t=await this.request(r("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:r("createSetupIntentNonce")});if(!t.success)throw t.data.error;if("succeeded"===t.data.status)return t.data;const o=await this.getStripe(),a=await o.confirmCardSetup(t.data.client_secret),{setupIntent:n,error:i}=a;if(i)throw i;return n}saveUPEAppearance(e,t){return this.request(r("ajaxUrl"),{elements_location:t,appearance:JSON.stringify(e),action:"save_upe_appearance",_ajax_nonce:r("saveUPEAppearanceNonce")}).then((e=>e.data)).catch((e=>{throw e.message?e:new Error(e.statusText)}))}initWooPay(e,t){if(!this.isWooPayRequesting){this.isWooPayRequesting=!0;const o=r("wcAjaxUrl"),a=r("initWooPayNonce"),n=document.querySelector(".wp-block-woocommerce-checkout")?"blocks_checkout":document.querySelector(".woocommerce-billing-fields")?"woopay_shortcode_checkout":document.querySelector(".wp-block-woocommerce-cart")?"bnpl_cart_block":document.querySelector(".woocommerce-cart-form")?"bnpl_classic_cart":document.querySelector(".single-product")?"bnpl_product_page":void 0;return this.request(i(o,"init_woopay"),{_wpnonce:a,appearance:r("isWooPayGlobalThemeSupportEnabled")?K(n,!0):null,email:e,user_session:t,order_id:r("order_id"),key:r("key"),billing_email:r("billing_email")}).finally((()=>{this.isWooPayRequesting=!1}))}}expressCheckoutAddToCart(e){const t=r("wcAjaxUrl"),o=r("addToCartNonce");return this.request(i(t,"add_to_cart"),{security:o,...e})}}jQuery((e=>{e("input[name=wc_deposit_option],input[name=wc_deposit_payment_plan]").on("change",(()=>{(0,o.doAction)("wcpay.express-checkout.update-button-data")}))})),(0,o.addFilter)("wcpay.express-checkout.cart-add-item","automattic/wcpay/express-checkout",(e=>{const t={};return jQuery("input[name=wc_deposit_option]").length&&(t.wc_deposit_option=jQuery("input[name=wc_deposit_option]:checked").val()),jQuery("input[name=wc_deposit_payment_plan]").length&&(t.wc_deposit_payment_plan=jQuery("input[name=wc_deposit_payment_plan]:checked").val()),{...e,...t}})),(0,o.addFilter)("wcpay.express-checkout.cart-place-order-extension-data","automattic/wcpay/express-checkout",(e=>{const t=jQuery("#wcpay-express-checkout__order-attribution-inputs input");if(!t.length)return e;const o={};return t.each((function(){const e=jQuery(this).attr("name").replace("wc_order_attribution_",""),t=jQuery(this).val();e&&t&&(o[e]=t)})),{...e,"woocommerce/order-attribution":o}}));let Z=null,ee=null;const te=()=>jQuery(ee),oe={init:({elementId:e,$separator:t})=>{ee=e,Z=t},getButtonSeparator:()=>Z,blockButton:()=>{te().data("blockUI.isBlocked")||te().block({message:null})},unblockButton:()=>{oe.showContainer(),te().unblock()},renderButton:e=>{te()?.length&&e.mount(ee)},hideContainer:()=>{te().removeClass("is-ready").hide()},showContainer:()=>{te().addClass("is-ready").show()}},re=oe,ae=(e,t,o=!1)=>{let r;return function(){const a=this,n=arguments,i=o&&!r;clearTimeout(r),r=setTimeout((()=>{r=null,o||t.apply(a,n)}),e),i&&t.apply(a,n)}},ne=e=>{var t,o,r,a;return void 0!==window.wcpayExpressCheckoutParams?null!==(t=window.wcpayExpressCheckoutParams[e])&&void 0!==t?t:null:void 0!==(null===(o=window.wc)||void 0===o?void 0:o.wcSettings)&&null!==(a=null===(r=window.wc.wcSettings.getSetting("ece_data"))||void 0===r?void 0:r[e])&&void 0!==a?a:null},ie=e=>{if(!e)return"";const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild?t.firstChild.textContent:""},se=e=>{var t,o;let r="undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10);const a=ne("button");return r=null!==(t=null==a?void 0:a.radius)&&void 0!==t?t:r,void 0!==e&&(r=null!==(o=Number(null==e?void 0:e.borderRadius))&&void 0!==o?o:r),{variables:{borderRadius:`${r}px`,spacingUnit:"6px"}}};jQuery((e=>{e(document.body).on("woocommerce_variation_has_changed",(async()=>{(0,o.doAction)("wcpay.express-checkout.update-button-data")}))})),jQuery((e=>{if("product"!==ne("button_context"))return;const t=e(".quantity");t.on("input",".qty",(()=>{re.blockButton()})),t.on("input",".qty",ae(250,(async()=>{(0,o.doAction)("wcpay.express-checkout.update-button-data")})))})),(0,o.addFilter)("wcpay.express-checkout.cart-add-item","automattic/wcpay/express-checkout",(e=>{const t=document.querySelector(".single_variation_wrap");if(!t)return e;const o=t.querySelector('input[name="product_id"]').value;return{...e,id:parseInt(o,10)}})),(0,o.addFilter)("wcpay.express-checkout.cart-add-item","automattic/wcpay/express-checkout",(e=>{const t=document.querySelector(".variations_form");if(!t)return e;const o=[],r=t.querySelectorAll(".variations select");return Array.from(r).forEach((function(e){const t=e.dataset.attribute_name||e.dataset.name;o.push({attribute:Array.from(document.querySelector(`label[for="${t.replace("attribute_","")}"]`).childNodes)[0].textContent,value:e.value||""}),o.push({attribute:t,value:e.value||""})})),{...e,variation:[...e.variation,...o]}})),(0,o.addFilter)("wcpay.express-checkout.map-line-items","automattic/wcpay/express-checkout",(e=>({...e,items:e.items.filter((e=>!e.extensions?.bundles?.bundled_by))})));const ce=(e,t,o)=>{const r=document.querySelector(`${e} [name="${t}"]`);if(r)if("SELECT"===r.tagName&&/country|state/.test(t)){const e=Array.from(r.options).find((e=>e.value===o||e.textContent.trim().toLowerCase()===o.toLowerCase()));e&&(r.value=e.value,jQuery(r).trigger("change").trigger("close"))}else r.value=o,jQuery(r).trigger("change")},le=window.lodash;window.wp.domReady;const ue=(e,t={})=>{var o,a,i;const s=null!==(o=r("platformTrackerNonce"))&&void 0!==o?o:null===(a=n("nonce"))||void 0===a?void 0:a.platform_tracker,c=null!==(i=r("ajaxUrl"))&&void 0!==i?i:n("ajax_url"),l=new FormData;l.append("tracksNonce",s),l.append("action","platform_tracks"),l.append("tracksEventName",e),l.append("tracksEventProp",JSON.stringify(t)),fetch(c,{method:"post",body:l}).then((e=>e.json()))},de=(0,le.debounce)((({source:e})=>{ue("applepay_button_load",{source:e})}),1e3),pe=(0,le.debounce)((({source:e})=>{ue("gpay_button_load",{source:e})}),1e3),he=window.wp.apiFetch;var me=e.n(he);const fe=window.wp.url;class be{cartRequestHeaders={};async _request(e){const t=await me()({...e,parse:!1,path:(0,fe.addQueryArgs)(e.path,{currency:ne("checkout").currency_code.toUpperCase()}),headers:{Nonce:ne("nonce").store_api_nonce,"X-WooPayments-Tokenized-Cart-Nonce":ne("nonce").tokenized_cart_nonce||void 0,"X-WooPayments-Tokenized-Cart-Session-Nonce":"product"===ne("button_context")?ne("nonce").tokenized_cart_session_nonce:void 0,...this.cartRequestHeaders,...e.headers}});return this.cartRequestHeaders={Nonce:t.headers.get("Nonce"),"X-WooPayments-Tokenized-Cart-Session":t.headers.get("X-WooPayments-Tokenized-Cart-Session")},t.json()}async placeOrder(e){return await this._request({method:"POST",path:"/wc/store/v1/checkout",headers:{"X-WooPayments-Tokenized-Cart":!0,...this.cartRequestHeaders},data:e})}async getCart(){return await this._request({method:"GET",path:"/wc/store/v1/cart"})}useSeparateCart(){this.cartRequestHeaders={"X-WooPayments-Tokenized-Cart-Session":""}}deleteAfterRequest(){this.cartRequestHeaders={"X-WooPayments-Tokenized-Cart-Is-Ephemeral-Cart":"1"}}async updateCustomer(e){return await this._request({method:"POST",path:"/wc/store/v1/cart/update-customer",headers:{"X-WooPayments-Tokenized-Cart":!0,...this.cartRequestHeaders},data:e})}async selectShippingRate(e){return await this._request({method:"POST",path:"/wc/store/v1/cart/select-shipping-rate",data:e})}async addProductToCart(){const e={id:jQuery(".single_add_to_cart_button").val(),quantity:parseInt(jQuery(".quantity .qty").val(),10)||1,variation:[]};return await this._request({method:"POST",path:"/wc/store/v1/cart/add-item",data:(0,o.applyFilters)("wcpay.express-checkout.cart-add-item",e)})}async emptyCart(){try{let e=await this._request({method:"GET",path:"/wc/store/v1/cart"});for(;e.items.length>0;)e=await this._request({method:"POST",path:"/wc/store/v1/cart/remove-item",data:{key:e.items[0].key}})}catch(e){}}}const ge=(e,t)=>{var o,r,a,n,i,s,c,l,u;return{first_name:null!==(o=e?.split(" ")?.slice(0,1)?.join(" "))&&void 0!==o?o:"",last_name:null!==(r=e?.split(" ")?.slice(1)?.join(" "))&&void 0!==r?r:"",company:null!==(a=t.organization)&&void 0!==a?a:"",address_1:null!==(n=t.line1)&&void 0!==n?n:"",address_2:null!==(i=t.line2)&&void 0!==i?i:"",city:null!==(s=t.city)&&void 0!==s?s:"",state:null!==(c=t.state)&&void 0!==c?c:"",postcode:null!==(l=t.postal_code?.replace(" ",""))&&void 0!==l?l:"",country:null!==(u=t.country)&&void 0!==u?u:""}},ye=(e,t)=>{var o,r,a,n,i,s,c,l,u,d,p,h,m;const f=e.billingDetails?.name||"",b=null!==(o=e.billingDetails?.address)&&void 0!==o?o:{},g=null!==(r=null!==(a=e.billingDetails?.phone?.replace(/[() -]/g,""))&&void 0!==a?a:e.payerPhone?.replace(/[() -]/g,""))&&void 0!==r?r:"";return{customer_note:e.order_comments,billing_address:{first_name:null!==(n=f.split(" ")?.slice(0,1)?.join(" "))&&void 0!==n?n:"",last_name:f.split(" ")?.slice(1)?.join(" ")||"-",company:null!==(i=b.organization)&&void 0!==i?i:"",address_1:null!==(s=b.line1)&&void 0!==s?s:"",address_2:null!==(c=b.line2)&&void 0!==c?c:"",city:null!==(l=b.city)&&void 0!==l?l:"",state:null!==(u=b.state)&&void 0!==u?u:"",postcode:null!==(d=b.postal_code)&&void 0!==d?d:"",country:null!==(p=b.country)&&void 0!==p?p:"",email:null!==(h=e.billingDetails?.email)&&void 0!==h?h:"",phone:g},shipping_address:e.shippingAddress?{...ge(e.shippingAddress.name||"",e.shippingAddress.address),phone:g}:void 0,payment_method:"woocommerce_payments",payment_data:[{key:"payment_method",value:"card"},{key:"payment_request_type",value:e.expressPaymentType},{key:"wcpay-fraud-prevention-token",value:null!==(m=window.wcpayFraudPreventionToken)&&void 0!==m?m:""},{key:"wcpay-payment-method",value:t},{key:"express_payment_type",value:e.expressPaymentType}]}},_e=window.wp.htmlEntities,we=(e,t)=>{var o;return e*10**((null!==(o=ne("checkout")?.currency_decimals)&&void 0!==o?o:2)-t.currency_minor_unit)},ve=e=>{const r=ne("checkout").display_prices_with_tax,a=(0,o.applyFilters)("wcpay.express-checkout.map-line-items",e),n=a.items.map((e=>({amount:we(r&&e.totals?parseInt(e.totals.line_subtotal,10)+parseInt(e.totals.line_subtotal_tax,10):parseInt(e.totals?.line_subtotal||e.prices.price,10),e.totals||e.prices),name:[e.name,e.quantity>1&&`(x${e.quantity})`,e.variation&&e.variation.length>0&&"-",e.variation&&e.variation.map((e=>`${e.attribute}: ${e.value}`)).join(", "),e.item_data&&e.item_data.length>0&&"-",e.item_data&&e.item_data.map((e=>`${e.name||e.key}: ${e.value}`)).join(", ")].filter(Boolean).map(_e.decodeEntities).join(" ")}))),i=parseInt(a.totals.total_shipping||"0",10);i&&n.push({amount:we(r?i+parseInt(a.totals.total_shipping_tax||"0",10):i,a.totals),name:(0,t.__)("Shipping","woocommerce-payments")});const s=parseInt(a.totals.total_discount||"0",10);s&&n.push({amount:-we(r?s+parseInt(a.totals.total_discount_tax||"0",10):s,a.totals),name:(0,t.__)("Discount","woocommerce-payments")});const c=parseInt(a.totals.total_fees||"0",10);c&&n.push({amount:we(r?c+parseInt(a.totals.total_fees_tax||"0",10):c,a.totals),name:(0,t.__)("Fees","woocommerce-payments")});const l=parseInt(a.totals.total_tax||"0",10);l&&!r&&n.push({amount:we(l,a.totals),name:(0,t.__)("Tax","woocommerce-payments")});const u=parseInt(a.totals.total_refund||"0",10);return u&&n.push({amount:-we(u,a.totals),name:(0,t.__)("Refund","woocommerce-payments")}),we(parseInt(a.totals.total_price,10)-parseInt(a.totals.total_refund||0,10),a.totals)<n.reduce(((e,{amount:t})=>e+t),0)?[]:n},ke=e=>{const t=ne("checkout").display_prices_with_tax;return e.shipping_rates?.[0]?.shipping_rates.sort(((e,t)=>e.selected===t.selected?0:e.selected?-1:1)).slice(0,9).map((e=>({id:e.rate_id,displayName:(0,_e.decodeEntities)(e.name),amount:we(t?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10),e),deliveryEstimate:[e.meta_data.find((e=>"pickup_address"===e.key))?.value,e.meta_data.find((e=>"pickup_details"===e.key))?.value].filter(Boolean).map(_e.decodeEntities).join(" - ")})))};let Se=null,xe=new be;const Ce=()=>xe,Te=()=>{jQuery.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},Ie=()=>{jQuery.unblockUI()};class Pe{orderId;key;billingEmail="";cachedCartData={};constructor({orderId:e,key:t,billingEmail:o=""}){this.orderId=e,this.key=t,this.billingEmail=o}async placeOrder(e){return await me()({method:"POST",path:`/wc/store/v1/checkout/${this.orderId}`,headers:{Nonce:ne("nonce").store_api_nonce},data:{...e,key:this.key,billing_email:this.billingEmail,billing_address:this.cachedCartData.billing_address,shipping_address:this.cachedCartData.shipping_address}})}async getCart(){return this.cachedCartData=await me()({method:"GET",path:(0,fe.addQueryArgs)(`/wc/store/v1/order/${this.orderId}`,{key:this.key,billing_email:this.billingEmail})})}}let Ae=null;const Me=async()=>{if("product"!==ne("button_context"))return await Ce().getCart();const e=new be;return e.useSeparateCart(),e.deleteAfterRequest(),await e.addProductToCart()},qe=()=>Ae?we(parseInt(Ae.totals.total_price,10)-parseInt(Ae.totals.total_refund||0,10),Ae.totals):"product"===ne("button_context")&&ne("product")?ne("product")?.total.amount:void 0;let Re;jQuery((e=>{if(ne("has_block")&&"pay_for_order"!==ne("button_context"))return;const a=ne("stripe").publishableKey;if(!a)return;const n=new Y({publishableKey:a,accountId:ne("stripe").accountId,locale:ne("stripe").locale},((e,t)=>new Promise(((o,r)=>{jQuery.post(e,t).then(o).fail(r)}))));var i;"pay_for_order"===ne("button_context")&&(i=new Pe({orderId:r("order_id"),key:r("key"),billingEmail:r("billing_email")}),xe=i),re.init({elementId:"#wcpay-express-checkout-element",$separator:jQuery("#wcpay-express-checkout-button-separator")});const s={abortPayment:t=>{Ie(),e(".woocommerce-error").remove();const o=e(".woocommerce-notices-wrapper").first();o.length&&(o.append(e('<div class="woocommerce-error" />').text(t)),e("html, body").animate({scrollTop:o.find(".woocommerce-error").offset().top},600))},completePayment:e=>{Te(),window.location=e},startExpressCheckoutElement:async r=>{var a;let i="",c=Promise.resolve();const l=await n.getStripe();Re=l.elements({mode:"payment",amount:r.total,currency:r.currency,paymentMethodCreation:"manual",appearance:se(),locale:null!==(a=ne("stripe")?.locale)&&void 0!==a?a:"en"});const u=Re.create("expressCheckout",(()=>{var e,t,o,r,a;const n=ne("button"),i=(e,t)=>{switch(t){case"dark":default:return"black";case"light":return"white";case"light-outline":return"googlePay"===e?"white":"white-outline"}},s="default"===(null==n?void 0:n.type)?"plain":null!==(e=null==n?void 0:n.type)&&void 0!==e?e:"buy",c="default"===(null==n?void 0:n.type)?"plain":null!==(t=null==n?void 0:n.type)&&void 0!==t?t:"plain";return{paymentMethods:{applePay:"always",googlePay:"always",amazonPay:"never",link:"never",paypal:"never",klarna:"never"},layout:{overflow:"never"},buttonTheme:{googlePay:i("googlePay",null!==(o=null==n?void 0:n.theme)&&void 0!==o?o:"black"),applePay:i("applePay",null!==(r=null==n?void 0:n.theme)&&void 0!==r?r:"black")},buttonType:{googlePay:s,applePay:c},buttonHeight:Math.min(Math.max(parseInt(null!==(a=null==n?void 0:n.height)&&void 0!==a?a:"48",10),40),55)}})());re.renderButton(u),u.on("loaderror",(()=>{document.getElementById("wcpay-woopay-button")||re.getButtonSeparator().hide()})),u.on("click",(function(o){if(i="",ne("login_confirmation"))return void(e=>{const t=ne("login_confirmation");if(!t)return;let o=t.message;o=o.replace(/\*\*.*?\*\*/,{apple_pay:"Apple Pay",google_pay:"Google Pay",amazon_pay:"Amazon Pay",paypal:"PayPal",link:"Link"}[e]),o=o.replace(/\*\*/g,""),confirm(o)&&(window.location.href=t.redirect_url)})(o.expressPaymentType);if("product"===ne("button_context")){const o=e(".single_add_to_cart_button");if(o.is(".disabled"))return void(o.is(".wc-variation-is-unavailable")?window.alert(window?.wc_add_to_cart_variation_params?.i18n_unavailable_text||(0,t.__)("Sorry, this product is unavailable. Please choose a different combination.","woocommerce-payments")):window.alert((0,t.__)("Please select your product options before proceeding.","woocommerce-payments")));Ce().useSeparateCart(),c=Ce().addProductToCart(),c.catch((()=>{i=(0,t.__)("There was an error processing the product with this payment method. Please add the product to the cart, instead.","woocommerce-payments"),Ce().emptyCart(),u.unmount(),Re=null,s.abortPayment(i),re.hideContainer(),re.getButtonSeparator().hide()})).finally((()=>{c=Promise.resolve()}))}const r=Ae?{shippingAddressRequired:"pay_for_order"!==ne("button_context")&&Ae.needs_shipping,shippingRates:ke(Ae),phoneNumberRequired:null!==(a=ne("checkout")?.needs_payer_phone)&&void 0!==a&&a,lineItems:ve(Ae)}:"product"===ne("button_context")&&ne("product")?{shippingAddressRequired:null!==(n=ne("product")?.needs_shipping)&&void 0!==n&&n,phoneNumberRequired:null!==(l=ne("checkout")?.needs_payer_phone)&&void 0!==l&&l,lineItems:(null!==(d=ne("product")?.displayItems)&&void 0!==d?d:[]).map((({label:e,amount:t})=>({name:e,amount:t})))}:void 0;var a,n,l,d;const p=r.shippingRates&&0!==r.shippingRates.length?r.shippingRates:[{id:"pending",displayName:(0,t.__)("Pending","woocommerce-payments"),amount:0}];(async function({expressPaymentType:e}){Te(),((e,t)=>{const o={google_pay:"gpay_button_click",apple_pay:"applepay_button_click"}[e];o&&ue(o,{source:t})})(e,ne("button_context"))})(o),o.resolve({business:{name:ne("store_name")},emailRequired:!0,...r,shippingRates:r.shippingAddressRequired?p:void 0,allowedShippingCountries:ne("checkout").allowed_shipping_countries})})),u.on("shippingaddresschange",(async e=>(await c,i?e.resolve():(async(e,t)=>{Se=e.address;try{const o=await xe.updateCustomer({shipping_address:ge(e.name,e.address)}),r=ke(o);if(0===r.length)return void e.reject();t.update({amount:we(parseInt(o.totals.total_price,10)-parseInt(o.totals.total_refund||0,10),o.totals)}),e.resolve({shippingRates:r,lineItems:ve(o)})}catch(t){e.reject()}})(e,Re)))),u.on("shippingratechange",(async e=>(async(e,t)=>{try{const o=await xe.selectShippingRate({package_id:0,rate_id:e.shippingRate.id});t.update({amount:we(parseInt(o.totals.total_price,10)-parseInt(o.totals.total_refund||0,10),o.totals)}),e.resolve({lineItems:ve(o)})}catch(t){e.reject()}})(e,Re))),u.on("confirm",(async e=>{if(!i)return(async(e,r,a,n,i,s)=>{const{error:c}=await a.submit();if(c)return i(c.message);const{paymentMethod:l,error:u}=await r.createPaymentMethod({elements:a});if(u)return i(u.message);try{const t=await xe.placeOrder({...ye(s,l.id),extensions:(0,o.applyFilters)("wcpay.express-checkout.cart-place-order-extension-data",{})});var d,p;if("success"!==t.payment_result.payment_status)return i(ie(null!==(d=null!==(p=t.message)&&void 0!==p?p:t.payment_result?.payment_details.find((e=>"errorMessage"===e.key))?.value)&&void 0!==d?d:""));const r=e.confirmIntent(t.payment_result.redirect_url);n(!0===r?t.payment_result.redirect_url:await r)}catch(e){return e.json&&(e=await Promise.resolve(e.json())),i(ie(e.message||e.payment_result?.payment_details.find((e=>"errorMessage"===e.key))?.value||(0,t.__)("There was a problem processing the order.","woocommerce-payments")))}})(n,l,Re,s.completePayment,s.abortPayment,e);s.abortPayment(i)})),u.on("cancel",(()=>{"product"===ne("button_context")&&c.finally((()=>{Ce().emptyCart()})),Se&&(e=>{const t=ne("button_context"),o=ne("has_block");var r;["cart","checkout"].includes(t)&&(o?wc?.blocksCheckout?.extensionCartUpdate({namespace:"woopayments/express-checkout/refresh-ui",data:{}}):(r=e.country,["CA","GB"].includes(r)||(e=>{const t=ne("button_context"),o=(r=e,{first_name:null!==(a=r?.recipient?.split(" ")?.slice(0,1)?.join(" "))&&void 0!==a?a:"",last_name:null!==(n=r?.recipient?.split(" ")?.slice(1)?.join(" "))&&void 0!==n?n:"",company:"",address_1:null!==(i=r?.addressLine?.[0])&&void 0!==i?i:"",address_2:null!==(s=r?.addressLine?.[1])&&void 0!==s?s:"",city:null!==(c=r?.city)&&void 0!==c?c:"",state:null!==(l=r?.state)&&void 0!==l?l:"",country:null!==(u=r?.country)&&void 0!==u?u:"",postcode:null!==(d=r?.postal_code)&&void 0!==d?d:""});var r,a,n,i,s,c,l,u,d;const p=["country","state","city","postcode"];"cart"===t?(p.forEach((e=>{o[e]&&ce("form.woocommerce-shipping-calculator",`calc_shipping_${e}`,o[e])})),document.querySelector('form.woocommerce-shipping-calculator [name="calc_shipping"]')?.click()):"checkout"===t&&p.forEach((e=>{o[e]&&ce("form.woocommerce-checkout",`billing_${e}`,o[e])}))})(e)))})(Se),Se=null,Ie()})),u.on("ready",(e=>{(async function({availablePaymentMethods:e}){e&&(({paymentMethods:e,source:t})=>{const o={googlePay:pe,applePay:de};for(const r of e){const e=o[r];e&&e({source:t})}})({paymentMethods:Object.entries(e).filter((([e,t])=>t)).map((([e,t])=>e)),source:ne("button_context")})})(e),e?.availablePaymentMethods&&Object.values(e.availablePaymentMethods).filter(Boolean).length&&(re.showContainer(),re.getButtonSeparator().show())}))},init:async()=>{if((0,o.removeAction)("wcpay.express-checkout.update-button-data","automattic/wcpay/express-checkout"),"product"===ne("button_context")&&"bundle"===ne("product")?.product_type&&(wcpayExpressCheckoutParams.product=void 0),!ne("product")&&!Ae)try{Ae=await Me()}catch(e){}Ae&&(wcpayExpressCheckoutParams.product=void 0);const t=qe();0===t?(re.hideContainer(),re.getButtonSeparator().hide()):Ae?await s.startExpressCheckoutElement({total:t,currency:Ae.totals.currency_code.toLowerCase()}):"product"===ne("button_context")&&ne("product")?await s.startExpressCheckoutElement({total:t,currency:ne("product")?.currency}):(re.hideContainer(),re.getButtonSeparator().hide()),(0,o.addAction)("wcpay.express-checkout.update-button-data","automattic/wcpay/express-checkout",(async()=>{if("product"!==ne("button_context")||!e(".single_add_to_cart_button").is(".disabled")){e(".woocommerce-error").remove();try{re.blockButton();const e=qe();Ae=await Me(),wcpayExpressCheckoutParams.product=null,re.unblockButton();const t=qe();Re?t!==e&&t>0&&Re.update({amount:t}):s.init(),0===t?(re.hideContainer(),re.getButtonSeparator().hide()):(re.showContainer(),re.getButtonSeparator().show())}catch(e){re.hideContainer()}}}))}};"checkout"===ne("button_context")&&"pay_for_order"!==ne("button_context")||s.init(),e(document.body).on("updated_cart_totals",(()=>{Ae=null,s.init()})),e(document.body).on("updated_checkout",(()=>{Ae=null,s.init()}))}))})()})();
Page not found – Hello World !