(()=>{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 n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].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&&void 0!==wcpayConfig[e]?wcpayConfig[e]:n(e),n=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},a=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,i=(e,t,o="wcpay_")=>e.toString().replace("%%endpoint%%",o+t);function s(e){return s="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},s(e)}var c=/^\s+/,l=/\s+$/;function u(e,t){if(t=t||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,t);var o=function(e){var t,o,r,n={r:0,g:0,b:0},a=1,i=null,u=null,d=null,p=!1,h=!1;return"string"==typeof e&&(e=function(e){e=e.replace(c,"").replace(l,"").toLowerCase();var t,o=!1;if(I[e])e=I[e],o=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=N.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=N.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=N.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=N.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=N.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=N.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=N.hex8.exec(e))?{r:R(t[1]),g:R(t[2]),b:R(t[3]),a:j(t[4]),format:o?"name":"hex8"}:(t=N.hex6.exec(e))?{r:R(t[1]),g:R(t[2]),b:R(t[3]),format:o?"name":"hex"}:(t=N.hex4.exec(e))?{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),a:j(t[4]+""+t[4]),format:o?"name":"hex8"}:!!(t=N.hex3.exec(e))&&{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),format:o?"name":"hex"}}(e)),"object"==s(e)&&(z(e.r)&&z(e.g)&&z(e.b)?(t=e.r,o=e.g,r=e.b,n={r:255*P(t,255),g:255*P(o,255),b:255*P(r,255)},p=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(i=L(e.s),u=L(e.v),n=function(e,t,o){e=6*P(e,360),t=P(t,100),o=P(o,100);var r=Math.floor(e),n=e-r,a=o*(1-t),i=o*(1-n*t),s=o*(1-(1-n)*t),c=r%6;return{r:255*[o,i,a,a,s,o][c],g:255*[s,o,o,i,a,a][c],b:255*[a,a,s,o,o,i][c]}}(e.h,i,u),p=!0,h="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(i=L(e.s),d=L(e.l),n=function(e,t,o){var r,n,a;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=P(e,360),t=P(t,100),o=P(o,100),0===t)r=n=a=o;else{var s=o<.5?o*(1+t):o+t-o*t,c=2*o-s;r=i(c,s,e+1/3),n=i(c,s,e),a=i(c,s,e-1/3)}return{r:255*r,g:255*n,b:255*a}}(e.h,i,d),p=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a)),a=M(a),{ok:p,format:e.format||h,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a}}(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 d(e,t,o){e=P(e,255),t=P(t,255),o=P(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),s=(a+i)/2;if(a==i)r=n=0;else{var c=a-i;switch(n=s>.5?c/(2-a-i):c/(a+i),a){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:n,l:s}}function p(e,t,o){e=P(e,255),t=P(t,255),o=P(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),s=a,c=a-i;if(n=0===a?0:c/a,a==i)r=0;else{switch(a){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:n,v:s}}function h(e,t,o,r){var n=[E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(o).toString(16))];return r&&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[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function m(e,t,o,r){return[E(F(r)),E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(o).toString(16))].join("")}function f(e,t){t=0===t?0:t||10;var o=u(e).toHsl();return o.s-=t/100,o.s=q(o.s),u(o)}function y(e,t){t=0===t?0:t||10;var o=u(e).toHsl();return o.s+=t/100,o.s=q(o.s),u(o)}function b(e){return u(e).desaturate(100)}function g(e,t){t=0===t?0:t||10;var o=u(e).toHsl();return o.l+=t/100,o.l=q(o.l),u(o)}function _(e,t){t=0===t?0:t||10;var o=u(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))),u(o)}function w(e,t){t=0===t?0:t||10;var o=u(e).toHsl();return o.l-=t/100,o.l=q(o.l),u(o)}function k(e,t){var o=u(e).toHsl(),r=(o.h+t)%360;return o.h=r<0?360+r:r,u(o)}function v(e){var t=u(e).toHsl();return t.h=(t.h+180)%360,u(t)}function S(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var o=u(e).toHsl(),r=[u(e)],n=360/t,a=1;a<t;a++)r.push(u({h:(o.h+a*n)%360,s:o.s,l:o.l}));return r}function x(e){var t=u(e).toHsl(),o=t.h;return[u(e),u({h:(o+72)%360,s:t.s,l:t.l}),u({h:(o+216)%360,s:t.s,l:t.l})]}function C(e,t,o){t=t||6,o=o||30;var r=u(e).toHsl(),n=360/o,a=[u(e)];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,a.push(u(r));return a}function T(e,t){t=t||6;for(var o=u(e).toHsv(),r=o.h,n=o.s,a=o.v,i=[],s=1/t;t--;)i.push(u({h:r,s:n,v:a})),a=(a+s)%1;return i}u.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=M(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=p(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=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=d(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 h(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,o,r,n){var a=[E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(o).toString(16)),E(F(r))];return n&&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[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.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*P(this._r,255))+"%",g:Math.round(100*P(this._g,255))+"%",b:Math.round(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*P(this._r,255))+"%, "+Math.round(100*P(this._g,255))+"%, "+Math.round(100*P(this._b,255))+"%)":"rgba("+Math.round(100*P(this._r,255))+"%, "+Math.round(100*P(this._g,255))+"%, "+Math.round(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(A[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+m(this._r,this._g,this._b,this._a),o=t,r=this._gradientType?"GradientType=1, ":"";if(e){var n=u(e);o="#"+m(n._r,n._g,n._b,n._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 u(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(g,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(k,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(C,arguments)},complement:function(){return this._applyCombination(v,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(x,arguments)},triad:function(){return this._applyCombination(S,[3])},tetrad:function(){return this._applyCombination(S,[4])}},u.fromRatio=function(e,t){if("object"==s(e)){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]="a"===r?e[r]:L(e[r]));e=o}return u(e,t)},u.equals=function(e,t){return!(!e||!t)&&u(e).toRgbString()==u(t).toRgbString()},u.random=function(){return u.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},u.mix=function(e,t,o){o=0===o?0:o||50;var r=u(e).toRgb(),n=u(t).toRgb(),a=o/100;return u({r:(n.r-r.r)*a+r.r,g:(n.g-r.g)*a+r.g,b:(n.b-r.b)*a+r.b,a:(n.a-r.a)*a+r.a})},u.readability=function(e,t){var o=u(e),r=u(t);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},u.isReadable=function(e,t,o){var r,n,a,i,s,c=u.readability(e,t);switch(n=!1,(a=o,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(s=(a.size||"small").toLowerCase())&&"large"!==s&&(s="small"),r={level:i,size:s}).level+r.size){case"AAsmall":case"AAAlarge":n=c>=4.5;break;case"AAlarge":n=c>=3;break;case"AAAsmall":n=c>=7}return n},u.mostReadable=function(e,t,o){var r,n,a,i,s=null,c=0;n=(o=o||{}).includeFallbackColors,a=o.level,i=o.size;for(var l=0;l<t.length;l++)(r=u.readability(e,t[l]))>c&&(c=r,s=u(t[l]));return u.isReadable(e,s,{level:a,size:i})||!n?s:(o.includeFallbackColors=!1,u.mostReadable(e,["#fff","#000"],o))};var I=u.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"},A=u.hexNames=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}(I);function M(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(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 q(e){return Math.min(1,Math.max(0,e))}function R(e){return parseInt(e,16)}function E(e){return 1==e.length?"0"+e:""+e}function L(e){return e<=1&&(e=100*e+"%"),e}function F(e){return Math.round(255*parseFloat(e)).toString(16)}function j(e){return R(e)/255}var B,H,$,N=(H="[\\s|\\(]+("+(B="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",$="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",{CSS_UNIT:new RegExp(B),rgb:new RegExp("rgb"+H),rgba:new RegExp("rgba"+$),hsl:new RegExp("hsl"+H),hsla:new RegExp("hsla"+$),hsv:new RegExp("hsv"+H),hsva:new RegExp("hsva"+$),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 z(e){return!!N.CSS_UNIT.exec(e)}const O=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],W=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],Q=["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":[...O,...W],".Text":[...O,...W],".Input":[...O,...W,...Q],".Error":[...O,...W,...Q],".Tab":[...O,...W,...Q],".TabIcon":[...O],".TabLabel":[...O,...W],".Block":[...O.slice(1),...Q.slice(1)],".Container":[...Q],".Header":[...O,...Q,...W],".Footer":[...O,...Q,...W]},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",...Q],".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"]},V=(e,t=document)=>{let o=null,r=0;for(;!o&&r<e.length;){let n;try{n=t.querySelector(e[r])}catch(e){r++;continue}if(!n){r++;continue}const a=(t.defaultView||window).getComputedStyle(n).backgroundColor;a&&u(a).getAlpha()>=.5&&(o=a),r++}return o||"#ffffff"},X=e=>{const t=u(e),o=t.getAlpha();if(o<1){const e=t.toRgb();return u({r:Math.round(e.r*o+255*(1-o)),g:Math.round(e.g*o+255*(1-o)),b:Math.round(e.b*o+255*(1-o))}).getBrightness()>125}return t.getBrightness()>125},G={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"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},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"],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",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],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"],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"]},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"],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"],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"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},backgroundSelectors:["#customer_details","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["form.checkout a",".woocommerce a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".woocommerce-checkout-review-order-table"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},wooPayBlocksCheckout:{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",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],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:[".wc-block-checkout a",".wc-block-components-main a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},updateSelectors:function(e,t){return e.hasOwnProperty("alternateSelectors")&&(Object.entries(e.alternateSelectors).forEach((o=>{const[r,n]=o,a=e[r];if(Array.isArray(a))a.some((e=>{try{return t.querySelector(e)}catch(e){return!1}}))||(e[r]=n);else try{t.querySelector(e[r])||(e[r]=n)}catch(t){e[r]=n}})),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;break;case"woopay_blocks_checkout":o=this.wooPayBlocksCheckout}return{...this.default,...this.updateSelectors(o,t)}}},J={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 n=r.querySelector(t);if(n){const t=n.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=G.getSelectors(e),r=t.querySelector(o.appendTarget),n=t.querySelector(o.upeThemeInputSelector);if(!r||!n)return;t.querySelector(o.hiddenContainer)&&this.cleanup(t);const a=this.getHiddenContainer(o.hiddenContainer,t);r.appendChild(a);const i=this.createRow(o.rowElement,o.validClasses,t);a.appendChild(i);const s=this.createRow(o.rowElement,o.invalidClasses,t);a.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(G.default.hiddenContainer);t&&t.remove()}},K=(e,t,o=null,r)=>{const n=(Array.isArray(e)?e:[e]).map((e=>{try{return r.querySelector(e)}catch(e){return null}})).filter(Boolean);if(!n.length)return{};const a=r.defaultView||window,i=D[t],s=n[0],c=a.getComputedStyle(s),l={};if(i.forEach((e=>{const t=e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)),o=c.getPropertyValue(t);if(o)if("color"!==e)if("lineHeight"!==e||"0"!==o&&"0px"!==o)l[e]=o;else for(let t=1;t<n.length;t++){const o=a.getComputedStyle(n[t]).getPropertyValue("line-height");if("0"!==o&&"0px"!==o){l[e]=o;break}}else l[e]=(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})(o)})),".Input"===t||".Tab--selected"===t){const e=((e,t="solid",o)=>e&&o?[e,t,o].join(" "):"")(l.outlineWidth,l.outlineStyle,l.outlineColor);""!==e&&(l.outline=e),delete l.outlineWidth,delete l.outlineColor,delete l.outlineStyle}const u=c.getPropertyValue("text-indent");return"0px"!==u&&"0px"===l.paddingLeft&&"0px"===l.paddingRight&&(l.paddingLeft=u,l.paddingRight=u),".Block"===t&&(l.backgroundColor=o),l},Z={blocks_checkout:"woopay_blocks_checkout",shortcode_checkout:"woopay_shortcode_checkout"},Y=(e,t=!1,o=document)=>{var r;const n=t&&null!==(r=Z[e])&&void 0!==r?r:e,a=G.getSelectors(n,o);J.init(n,o);const i=K(a.hiddenInput,".Input",null,o),s=K(a.hiddenInvalidInput,".Input",null,o),c=K(a.upeThemeLabelSelector,".Label",null,o),l={fontSize:c.fontSize},d=K(a.upeThemeTextSelectors,".Text",null,o),p=K(a.upeThemeInputSelector,".Tab",null,o),h=K(a.hiddenInput,".Tab--selected",null,o),m=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const o=((e,t)=>{const o={backgroundColor:e,color:t},r=u(e),n=u(t);if(!r.isValid()||!n.isValid())return{backgroundColor:"",color:""};const a=r.getBrightness()>50?u(r).darken(7):u(r).lighten(7),i=u.mostReadable(a,[n],{includeFallbackColors:!0});return o.backgroundColor=a.toRgbString(),o.color=i.toRgbString(),o})(e.backgroundColor,e.color);return t.backgroundColor=o.backgroundColor,t.color=o.color,t})(p),f={color:m.color},y={color:h.color},b=V(a.backgroundSelectors,o),g=K(a.upeThemeLabelSelector,".Block",b,o),_={colorBackground:b,colorText:d.color,fontFamily:d.fontFamily,fontSizeBase:d.fontSize};a.pmmeRelativeTextSizeSelector&&_.fontSizeBase&&(_.fontSizeBase=function(e,t,o=.875,r){const n=parseFloat(t);if(isNaN(n))return t;const a=r.querySelector(e);if(!a)return n*o+"px";const i=window.getComputedStyle(a).getPropertyValue("font-size"),s=parseFloat(i)*o;return isNaN(s)?t:n>s?`${s}px`:`${n}px`}(a.pmmeRelativeTextSizeSelector,d.fontSize,.875,o));const w="blocks_checkout"===e||"woopay_blocks_checkout"===n;let k={variables:_,theme:X(b)?"stripe":"night",labels:w?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":i,".Input--invalid":s,".Label":c,".Label--resting":l,".Block":g,".Tab":p,".Tab:hover":m,".Tab--selected":h,".TabIcon:hover":f,".TabIcon--selected":y,".Text":d,".Text--redirect":d}))};if(w&&(k=((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,n=parseFloat(e.rules[".Label--floating"].lineHeight),a=Math.floor(n*r);e.rules[".Label--floating"].lineHeight=`${a}px`,e.rules[".Label--floating"].fontSize=`${a}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})(k,K(a.hiddenValidActiveLabel,".Label--floating",null,o))),t){const e=K(a.headerSelectors,".Header",null,o),t=K(a.footerSelectors,".Footer",null,o);var v,S;(!e.backgroundColor||u(e.backgroundColor).getAlpha()<.5)&&(e.backgroundColor=V([...null!==(v=a.headerSelectors)&&void 0!==v?v:[],"body"],o)),(!t.backgroundColor||u(t.backgroundColor).getAlpha()<.5)&&(t.backgroundColor=V([...null!==(S=a.footerSelectors)&&void 0!==S?S:[],"body"],o)),k.rules={...k.rules,".Heading":K(a.headingSelectors,".Label",null,o),".Header":e,".Footer":t,".Footer-link":K(a.footerLink,".Footer--link",null,o),".Button":K(a.buttonSelectors,".Input",null,o),".Link":K(a.linkSelectors,".Label",null,o),".Container":K(a.containerSelectors,".Container",null,o)}}return J.cleanup(o),k};class ee{constructor(e,t){this.options=e,this.stripe=null,this.stripePlatform=null,this.request=t,this.isWooPayRequesting=!1}createStripe(e,t,o="",r=[]){const n={locale:t};return o&&(n.stripeAccount=o),r&&(n.betas=r),new Stripe(e,n)}async getStripeForUPE(e){return this.options.forceNetworkSavedCards=n("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:n,isStripeLinkEnabled:a}=this.options;if(r&&!e)return this.stripePlatform||(this.stripePlatform=this.createStripe(t,n)),this.stripePlatform;if(!this.stripe){let e=["card_country_event_beta_1"];a&&(e=e.concat(["link_autofill_modal_beta_1"])),this.stripe=this.createStripe(t,n,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 n="si"===o[1];let i=o[2];const s=o[3],c=o[4],l=o[5]||null,u=e.indexOf("order-pay"),d=u>-1&&e.substring(u).match(/\d+/);return d&&(i=d[0]),(async()=>{const{locale:e,publishableKey:t}=this.options,o=r("accountIdForIntentConfirmation");if(n){const e=await this.getStripe(!0);return l?e.confirmSetup({clientSecret:s,confirmParams:{confirmation_token:l},redirect:"if_required"}):e.handleNextAction({clientSecret:s})}return o?this.createStripe(t,e,o).confirmCardPayment(s):(await this.getStripe(!0)).handleNextAction({clientSecret:s})})().then((e=>{var o;let n=null;e.paymentIntent?.last_payment_error&&(n={message:e.paymentIntent.last_payment_error.message}),"requires_action"===e.paymentIntent?.status&&(n={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=a("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"}),n,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(),n=await o.confirmCardSetup(t.data.client_secret),{setupIntent:a,error:i}=n;if(i)throw i;return a}initWooPay(e,t){if(!this.isWooPayRequesting){this.isWooPayRequesting=!0;const o=r("wcAjaxUrl"),n=r("initWooPayNonce");let a=null,s=null;if(r("isWooPayGlobalThemeSupportEnabled"))if(r("isShortcodeCheckout")){const e=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;a=Y(e,!0),s=((e=document)=>{const t=[],o=e.styleSheets,r=["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","fonts.bunny.net","fonts.wp.com"];for(let e=0;e<o.length;e++){if(!o[e].href)continue;const n=new URL(o[e].href);-1!==r.indexOf(n.hostname)&&t.push({cssSrc:o[e].href})}return t})()}else a=r("woopayAppearance"),s=r("woopayFontRules");return this.request(i(o,"init_woopay"),{_wpnonce:n,appearance:a,font_rules:s,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}}));const te="wcpay-express-checkout__order-attribution-inputs",oe=()=>{(()=>{if(document.getElementById(te))return;const e=document.createElement("wc-order-attribution-inputs");e.id=te,document.body.appendChild(e)})(),window?.wc_order_attribution?.setOrderTracking(window?.wc_order_attribution?.params?.allowTracking)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",oe):oe(),(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 re=null,ne=null;const ae=()=>jQuery(ne),ie={init:({elementId:e,$separator:t})=>{ne=e,re=t},getButtonSeparator:()=>re,blockButton:()=>{ae().data("blockUI.isBlocked")||ae().block({message:null})},unblockButton:()=>{ie.showContainer(),ae().unblock()},renderButton:e=>{ae()?.length&&e.mount(ne)},hideContainer:()=>{ae().removeClass("is-ready").hide()},showContainer:()=>{ae().addClass("is-ready").show()}},se=ie,ce=(e,t,o=!1)=>{let r;return function(){const n=this,a=arguments,i=o&&!r;clearTimeout(r),r=setTimeout((()=>{r=null,o||t.apply(n,a)}),e),i&&t.apply(n,a)}},le=e=>{var t,o;return void 0!==window.wcpayExpressCheckoutParams?null!==(t=window.wcpayExpressCheckoutParams[e])&&void 0!==t?t:null:void 0!==window.wc?.wcSettings&&null!==(o=window.wc.wcSettings.getSetting("ece_data")?.[e])&&void 0!==o?o:null};jQuery((e=>{e(document.body).on("woocommerce_variation_has_changed",(async()=>{(0,o.doAction)("wcpay.express-checkout.update-button-data")}))})),jQuery((e=>{if("product"!==le("button_context"))return;const t=e(".quantity");t.on("input",".qty",(()=>{se.blockButton()})),t.on("input",".qty",ce(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 ue=window.wp.htmlEntities,de=(e,t)=>{var o;return e*10**((null!==(o=le("checkout")?.currency_decimals)&&void 0!==o?o:2)-t.currency_minor_unit)},pe=e=>{const r=le("checkout").display_prices_with_tax,n=(0,o.applyFilters)("wcpay.express-checkout.map-line-items",e),a=n.items.map((e=>({amount:de(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(ue.decodeEntities).join(" ")}))),i=parseInt(n.totals.total_shipping||"0",10);i&&a.push({amount:de(r?i+parseInt(n.totals.total_shipping_tax||"0",10):i,n.totals),name:(0,t.__)("Shipping","woocommerce-payments")});const s=parseInt(n.totals.total_discount||"0",10);s&&a.push({amount:-de(r?s+parseInt(n.totals.total_discount_tax||"0",10):s,n.totals),name:(0,t.__)("Discount","woocommerce-payments")});const c=parseInt(n.totals.total_fees||"0",10);c&&a.push({amount:de(r?c+parseInt(n.totals.total_fees_tax||"0",10):c,n.totals),name:(0,t.__)("Fees","woocommerce-payments")});const l=parseInt(n.totals.total_tax||"0",10);l&&!r&&a.push({amount:de(l,n.totals),name:(0,t.__)("Tax","woocommerce-payments")});const u=parseInt(n.totals.total_refund||"0",10);return u&&a.push({amount:-de(u,n.totals),name:(0,t.__)("Refund","woocommerce-payments")}),de(parseInt(n.totals.total_price,10)-parseInt(n.totals.total_refund||0,10),n.totals)<a.reduce(((e,{amount:t})=>e+t),0)?[]:a},he=e=>{const t=le("checkout").display_prices_with_tax,r=e.shipping_rates?.[0]?.shipping_rates||[],n=(0,o.applyFilters)("wcpay.express-checkout.shipping-rates",r,e);return n&&0!==n.length?n.sort(((e,t)=>e.selected===t.selected?0:e.selected?-1:1)).slice(0,9).map((e=>({id:e.rate_id,displayName:(0,ue.decodeEntities)(e.name),amount:de(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(ue.decodeEntities).join(" - ")}))):[]},me=e=>{const t=e?.extensions?.subscriptions;return!!t&&t.trial_length>0},fe=e=>{const t=e?.extensions?.subscriptions;if(!t||!Array.isArray(t))return null;for(const e of t){const t=e.shipping_rates?.[0]?.shipping_rates;if(t?.length>0)return t}return null},ye=e=>!(!e?.items||!e?.extensions?.subscriptions)&&(!!e.items.some(me)&&(!(e.shipping_rates?.[0]?.shipping_rates?.length>0)&&null!==fe(e))),be=e=>!(!e?.items||!e?.extensions?.subscriptions)&&e.items.some(me),ge=e=>!!be(e)&&0===parseInt(e.totals?.total_price||"0",10),_e=e=>{const t=e?.extensions?.subscriptions;if(!t||!Array.isArray(t))return null;let o=0,r=0,n=0,a=0,i=0,s=2;const c=[];if(t.forEach((e=>{var t;if(!e.totals?.total_price)return;o+=parseInt(e.totals.total_price,10),r+=parseInt(e.totals.total_items||"0",10),n+=parseInt(e.totals.total_tax||"0",10);const l=e.shipping_rates?.[0]?.shipping_rates?.find((e=>e.selected));l?(a+=parseInt(l.price||"0",10),i+=parseInt(l.taxes||"0",10)):(a+=parseInt(e.totals.total_shipping||"0",10),i+=parseInt(e.totals.total_shipping_tax||"0",10)),s=null!==(t=e.totals.currency_minor_unit)&&void 0!==t?t:s,e.totals.tax_lines&&c.push(...e.totals.tax_lines)})),0===o)return null;const l=t[0]?.totals||e.totals;return{amount:o,currencyMinorUnit:s,totals:{...l,total_price:String(o),total_items:String(r),total_tax:String(n),total_shipping:String(a),total_shipping_tax:String(i),tax_lines:c}}},we=e=>{var o,r,n,a,i,s;const c=e.totals,l=parseInt(c.total_price,10),u=null!==(o=c.currency_minor_unit)&&void 0!==o?o:2,d=null!==(r=c.currency_prefix)&&void 0!==r?r:"",p=null!==(n=c.currency_suffix)&&void 0!==n?n:"",h=null!==(a=c.currency_decimal_separator)&&void 0!==a?a:".",m=null!==(i=c.currency_thousand_separator)&&void 0!==i?i:",",f=(l/Math.pow(10,u)).toFixed(u).split("."),y=f[0].replace(/\B(?=(\d{3})+(?!\d))/g,m),b=`${d}${f[1]?`${y}${h}${f[1]}`:y}${p}`,g=(_=e.billing_period,(w=null!==(s=e.billing_interval)&&void 0!==s?s:1)>1?{day:(0,t.sprintf)((0,t._n)("%d day","%d days",w,"woocommerce-payments"),w),week:(0,t.sprintf)((0,t._n)("%d week","%d weeks",w,"woocommerce-payments"),w),month:(0,t.sprintf)((0,t._n)("%d month","%d months",w,"woocommerce-payments"),w),year:(0,t.sprintf)((0,t._n)("%d year","%d years",w,"woocommerce-payments"),w)}[_]||`${w} ${_}s`:{day:(0,t.__)("day","woocommerce-payments"),week:(0,t.__)("week","woocommerce-payments"),month:(0,t.__)("month","woocommerce-payments"),year:(0,t.__)("year","woocommerce-payments")}[_]||_);var _,w;return(0,t.sprintf)((0,t.__)("%1$s / %2$s","woocommerce-payments"),b,g)};(0,o.addFilter)("wcpay.express-checkout.total-amount","automattic/wcpay/express-checkout/wc-subscriptions",((e,t)=>{if(!ge(t))return e;const o=_e(t);return o?de(o.amount,o.totals):e})),(0,o.addFilter)("wcpay.express-checkout.is-cart-eligible","automattic/wcpay/express-checkout/wc-subscriptions",((e,t)=>{if(e)return!0;if(ge(t)){const e=_e(t);return null!==e&&e.amount>0}return e})),(0,o.addFilter)("wcpay.express-checkout.shipping-rates","automattic/wcpay/express-checkout/wc-subscriptions",((e,t)=>e&&e.length>0?e:ye(t)&&fe(t)||e)),(0,o.addFilter)("wcpay.express-checkout.shipping-package-id","automattic/wcpay/express-checkout/wc-subscriptions",((e,t,o)=>{if(!ye(t))return e;const r=t?.extensions?.subscriptions;if(!r||!Array.isArray(r))return e;for(const e of r){const t=e.shipping_rates;if(t&&Array.isArray(t))for(const e of t){const t=e?.shipping_rates?.some((e=>e.rate_id===o));if(t&&e.package_id)return e.package_id}}return e})),(0,o.addFilter)("wcpay.express-checkout.map-line-items","automattic/wcpay/express-checkout/wc-subscriptions",(e=>{if(!be(e))return e;const o=e?.extensions?.subscriptions;if(!o||!Array.isArray(o))return e;const r=0===parseInt(e.totals?.total_price||"0",10),n=[...e.items],a=(0,t.__)("Recurring total","woocommerce-payments");if(o.forEach((o=>{const i=e.items.filter((e=>e.extensions?.subscriptions?.billing_period===o.billing_period)).length;if(0===i)return;const s=Math.round(parseInt(o.totals?.total_items||"0",10)/i);n.forEach(((e,i)=>{const c=e.extensions?.subscriptions;c&&c.trial_length>0&&c.billing_period===o.billing_period&&((e.item_data||[]).some((e=>e.name===a))||(n[i]={...e,name:`${e.name} (${(0,t.__)("recurring","woocommerce-payments")})`,...r&&{totals:{...e.totals,line_subtotal:String(s),line_total:String(s)}},item_data:[...e.item_data||[],{name:(0,t.__)("Recurring total","woocommerce-payments"),value:(0,t.sprintf)((0,t.__)("%1$s on %2$s","woocommerce-payments"),we(o),o.next_payment_date)}]}))}))})),!r)return{...e,items:n};const i=_e(e);return i?{...e,items:n,totals:{...e.totals,total_price:String(i.amount),total_items:i.totals.total_items||"0",total_tax:i.totals.total_tax||"0",total_shipping:i.totals.total_shipping||"0",total_shipping_tax:i.totals.total_shipping_tax||"0",tax_lines:i.totals.tax_lines||[]}}:{...e,items:n}}));const ke=e=>{var t;let o="undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10);const r=le("button");var n;return o=null!==(t=r?.radius)&&void 0!==t?t:o,void 0!==e&&(o=null!==(n=Number(e?.borderRadius))&&void 0!==n?n:o),{variables:{borderRadius:`${o}px`,spacingUnit:"6px"}}},ve=e=>{if(!e)return"";const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild?t.firstChild.textContent:""},Se=(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")},xe=window.lodash,Ce=(window.wp.domReady,(e,t={})=>{var o,n,i;if(!1===(null!==(o=r("isShopperTrackingEnabled"))&&void 0!==o?o:a("is_shopper_tracking_enabled")))return;const s=null!==(n=r("platformTrackerNonce"))&&void 0!==n?n:a("nonce")?.platform_tracker,c=null!==(i=r("ajaxUrl"))&&void 0!==i?i:a("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()))}),Te=(0,xe.debounce)((({source:e})=>{Ce("applepay_button_load",{source:e})}),1e3),Ie=(0,xe.debounce)((({source:e})=>{Ce("gpay_button_load",{source:e})}),1e3),Ae=window.wp.apiFetch;var Me=e.n(Ae);const Pe=window.wp.url,qe=()=>document.querySelector(".single_add_to_cart_button")||document.querySelector('.wp-block-add-to-cart-with-options button[type="submit"]'),Re=()=>{const e=document.querySelector(".single_add_to_cart_button");if(e)return e.value;const t=document.querySelector('.wp-block-add-to-cart-with-options input[name="add-to-cart"]');return t?.value},Ee=()=>{const e=document.querySelector(".quantity .qty");return e&&parseInt(e.value,10)||1};class Le{cartRequestHeaders={};async _request(e){const t=await Me()({...e,parse:!1,path:(0,Pe.addQueryArgs)(e.path,{currency:le("checkout").currency_code.toUpperCase()}),headers:{Nonce:le("nonce").store_api_nonce,"X-WooPayments-Tokenized-Cart-Nonce":le("nonce").tokenized_cart_nonce||void 0,"X-WooPayments-Tokenized-Cart-Session-Nonce":"product"===le("button_context")?le("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:Re(),quantity:Ee(),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 Fe=(e,t)=>{var o,r,n,a,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!==(n=t.organization)&&void 0!==n?n:"",address_1:null!==(a=t.line1)&&void 0!==a?a:"",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:""}},je=(e,t,o=!0,r=[])=>{var n,a,i,s,c,l,u,d,p,h,m,f,y;const b=e.billingDetails?.name||"",g=null!==(n=e.billingDetails?.address)&&void 0!==n?n:{},_=null!==(a=null!==(i=e.billingDetails?.phone?.replace(/[() -]/g,""))&&void 0!==i?i:e.payerPhone?.replace(/[() -]/g,""))&&void 0!==a?a:"";return{customer_note:e.order_comments,billing_address:{first_name:null!==(s=b.split(" ")?.slice(0,1)?.join(" "))&&void 0!==s?s:"",last_name:b.split(" ")?.slice(1)?.join(" ")||"-",company:null!==(c=g.organization)&&void 0!==c?c:"",address_1:null!==(l=g.line1)&&void 0!==l?l:"",address_2:null!==(u=g.line2)&&void 0!==u?u:"",city:null!==(d=g.city)&&void 0!==d?d:"",state:null!==(p=g.state)&&void 0!==p?p:"",postcode:null!==(h=g.postal_code)&&void 0!==h?h:"",country:null!==(m=g.country)&&void 0!==m?m:"",email:null!==(f=e.billingDetails?.email)&&void 0!==f?f:"",phone:_},shipping_address:e.shippingAddress?{...Fe(e.shippingAddress.name||"",e.shippingAddress.address),phone:_}:void 0,payment_method:"woocommerce_payments",payment_data:[{key:"payment_method",value:"card"},{key:"wcpay-fraud-prevention-token",value:null!==(y=window.wcpayFraudPreventionToken)&&void 0!==y?y:""},{key:o?"wcpay-confirmation-token":"wcpay-payment-method",value:t},{key:"express_payment_type",value:e.expressPaymentType},{key:"wcpay-express-payment-method-types",value:JSON.stringify(r)}]}};let Be=null,He=null,$e=new Le;const Ne=()=>$e,ze=()=>{jQuery.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},Oe=()=>{jQuery.unblockUI()};class We{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:le("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,Pe.addQueryArgs)(`/wc/store/v1/order/${this.orderId}`,{key:this.key,billing_email:this.billingEmail})})}}let Qe=null;const Ue=async()=>{if("product"!==le("button_context"))return await Ne().getCart();const e=new Le;return e.useSeparateCart(),e.deleteAfterRequest(),await e.addProductToCart()},De=()=>Qe?(0,o.applyFilters)("wcpay.express-checkout.total-amount",de(parseInt(Qe.totals.total_price,10)-parseInt(Qe.totals.total_refund||0,10),Qe.totals),Qe):"product"===le("button_context")&&le("product")?le("product")?.total.amount:void 0;let Ve;jQuery((e=>{if(le("has_block")&&"pay_for_order"!==le("button_context"))return;const n=le("stripe").publishableKey;if(!n)return;const a=new ee({publishableKey:n,accountId:le("stripe").accountId,locale:le("stripe").locale},((e,t)=>new Promise(((o,r)=>{jQuery.post(e,t).then(o).fail(r)}))));var i;"pay_for_order"===le("button_context")&&(i=new We({orderId:r("order_id"),key:r("key"),billingEmail:r("billing_email")}),$e=i),se.init({elementId:"#wcpay-express-checkout-element",$separator:jQuery("#wcpay-express-checkout-button-separator")});const s={abortPayment:t=>{Oe(),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=>{ze(),window.location=e},startExpressCheckoutElement:async e=>{var r,n,i,c,l;let u="",d=Promise.resolve();const p=await a.getStripe(),h=null===(r=le("flags")?.isEceUsingConfirmationTokens)||void 0===r||r,m=null!==(n=le("is_manual_capture"))&&void 0!==n&&n,f=null!==(i=le("has_subscription"))&&void 0!==i&&i,y=null!==(c=le("enabled_methods"))&&void 0!==c?c:[],b=[y.includes("payment_request")&&"card",y.includes("amazon_pay")&&"amazon_pay"].filter(Boolean);Ve=p.elements({mode:"payment",amount:e.total,currency:e.currency,...h?{paymentMethodTypes:b}:{paymentMethodCreation:"manual"},...h&&m?{captureMethod:"manual"}:{},...h&&f?{setupFutureUsage:"off_session"}:{},appearance:ke(),locale:null!==(l=le("stripe")?.locale)&&void 0!==l?l:"en"});const g=Ve.create("expressCheckout",(()=>{var e,t,o,r,n,a;const i=le("button"),s=null!==(e=le("enabled_methods"))&&void 0!==e?e:[],c=(e,t)=>{switch(t){case"dark":default:return"black";case"light":return"white";case"light-outline":return"googlePay"===e?"white":"white-outline"}},l="default"===i?.type?"plain":null!==(t=i?.type)&&void 0!==t?t:"buy",u="default"===i?.type?"plain":null!==(o=i?.type)&&void 0!==o?o:"plain",d=s.includes("payment_request");return{paymentMethods:{applePay:d?"always":"never",googlePay:d?"always":"never",amazonPay:s.includes("amazon_pay")?"auto":"never",link:"never",paypal:"never",klarna:"never"},layout:{overflow:"never"},buttonTheme:{googlePay:c("googlePay",null!==(r=i?.theme)&&void 0!==r?r:"black"),applePay:c("applePay",null!==(n=i?.theme)&&void 0!==n?n:"black")},buttonType:{googlePay:l,applePay:u},buttonHeight:Math.min(Math.max(parseInt(null!==(a=i?.height)&&void 0!==a?a:"48",10),40),55)}})());se.renderButton(g),g.on("loaderror",(()=>{document.getElementById("wcpay-woopay-button")||se.getButtonSeparator().hide()})),g.on("click",(function(e){if(u="",le("login_confirmation"))return void(e=>{const t=le("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)})(e.expressPaymentType);if("product"===le("button_context")){const e=jQuery(qe());if(e.is(".disabled"))return void(e.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")));Ne().useSeparateCart(),d=Ne().addProductToCart(),d.catch((()=>{u=(0,t.__)("There was an error processing the product with this payment method. Please add the product to the cart, instead.","woocommerce-payments"),Ne().emptyCart(),g.unmount(),Ve=null,s.abortPayment(u),se.hideContainer(),se.getButtonSeparator().hide()})).finally((()=>{d=Promise.resolve()}))}const o=Qe?{shippingAddressRequired:"pay_for_order"!==le("button_context")&&Qe.needs_shipping,shippingRates:he(Qe),phoneNumberRequired:null!==(r=le("checkout")?.needs_payer_phone)&&void 0!==r&&r,lineItems:pe(Qe)}:"product"===le("button_context")&&le("product")?{shippingAddressRequired:null!==(n=le("product")?.needs_shipping)&&void 0!==n&&n,phoneNumberRequired:null!==(a=le("checkout")?.needs_payer_phone)&&void 0!==a&&a,lineItems:(null!==(i=le("product")?.displayItems)&&void 0!==i?i:[]).map((({label:e,amount:t})=>({name:e,amount:t})))}:void 0;var r,n,a,i;const c=o.shippingRates&&0!==o.shippingRates.length?o.shippingRates:[{id:"pending",displayName:(0,t.__)("Pending","woocommerce-payments"),amount:0}];(async function({expressPaymentType:e}){ze(),((e,t)=>{const o={google_pay:"gpay_button_click",apple_pay:"applepay_button_click"}[e];o&&Ce(o,{source:t})})(e,le("button_context"))})(e),e.resolve({business:{name:le("store_name")},emailRequired:!0,...o,shippingRates:o.shippingAddressRequired?c:void 0,allowedShippingCountries:le("checkout").allowed_shipping_countries})})),g.on("shippingaddresschange",(async e=>(await d,u?e.resolve():(async(e,t)=>{Be=e.address;try{const r=await $e.updateCustomer({shipping_address:Fe(e.name,e.address)}),n=he(r);if(0===n.length)return void e.reject();t.update({amount:(0,o.applyFilters)("wcpay.express-checkout.total-amount",de(parseInt(r.totals.total_price,10)-parseInt(r.totals.total_refund||0,10),r.totals),r)}),He=r,e.resolve({shippingRates:n,lineItems:pe(r)})}catch(t){e.reject()}})(e,Ve)))),g.on("shippingratechange",(async e=>(async(e,t,r=null)=>{const n=He||r;try{const r=await $e.selectShippingRate({package_id:(0,o.applyFilters)("wcpay.express-checkout.shipping-package-id",0,n,e.shippingRate.id),rate_id:e.shippingRate.id});He=r,t.update({amount:(0,o.applyFilters)("wcpay.express-checkout.total-amount",de(parseInt(r.totals.total_price,10)-parseInt(r.totals.total_refund||0,10),r.totals),r)}),e.resolve({lineItems:pe(r)})}catch(t){e.reject()}})(e,Ve,Qe))),g.on("confirm",(async e=>{if(!u)return(async(e,r,n,a,i,s,c=[])=>{const{error:l}=await n.submit();if(l)return i(l.message);const u=null===(d=le("flags")?.isEceUsingConfirmationTokens)||void 0===d||d;var d;let p;try{p=await async function(e,t,o){if(o){const{confirmationToken:o,error:r}=await e.createConfirmationToken({elements:t});if(r)throw r;return o.id}const{paymentMethod:r,error:n}=await e.createPaymentMethod({elements:t});if(n)throw n;return r.id}(r,n,u)}catch(e){return i(e.message)}try{const t=await $e.placeOrder({...je(s,p,u,c),extensions:(0,o.applyFilters)("wcpay.express-checkout.cart-place-order-extension-data",{})});var h,m;if("success"!==t.payment_result.payment_status)return i(ve(null!==(h=null!==(m=t.message)&&void 0!==m?m:t.payment_result?.payment_details.find((e=>"errorMessage"===e.key))?.value)&&void 0!==h?h:""));let r=t.payment_result.redirect_url;if(!r){const e=t.payment_result.payment_details?.find((e=>"redirect"===e.key));r=e?.value||""}const n=e.confirmIntent(r);a(!0===n?r:await n)}catch(e){return e.json&&(e=await Promise.resolve(e.json())),i(ve(e.message||e.payment_result?.payment_details.find((e=>"errorMessage"===e.key))?.value||(0,t.__)("There was a problem processing the order.","woocommerce-payments")))}})(a,p,Ve,s.completePayment,s.abortPayment,e,b);s.abortPayment(u)})),g.on("cancel",(()=>{"product"===le("button_context")&&d.finally((()=>{Ne().emptyCart()})),Be&&(e=>{const t=le("button_context"),o=le("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=le("button_context"),o=(r=e,{first_name:null!==(n=r?.recipient?.split(" ")?.slice(0,1)?.join(" "))&&void 0!==n?n:"",last_name:null!==(a=r?.recipient?.split(" ")?.slice(1)?.join(" "))&&void 0!==a?a:"",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,n,a,i,s,c,l,u,d;const p=["country","state","city","postcode"];"cart"===t?(p.forEach((e=>{o[e]&&Se("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]&&Se("form.woocommerce-checkout",`billing_${e}`,o[e])}))})(e)))})(Be),Be=null,Oe()})),g.on("ready",(e=>{(async function({availablePaymentMethods:e}){e&&(({paymentMethods:e,source:t})=>{const o={googlePay:Ie,applePay:Te};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:le("button_context")})})(e),e?.availablePaymentMethods&&Object.values(e.availablePaymentMethods).filter(Boolean).length&&(se.showContainer(),se.getButtonSeparator().show())}))},init:async()=>{if((0,o.removeAction)("wcpay.express-checkout.update-button-data","automattic/wcpay/express-checkout"),"product"===le("button_context")&&"bundle"===le("product")?.product_type&&(wcpayExpressCheckoutParams.product=void 0),!le("product")&&!Qe)try{Qe=await Ue()}catch(e){}Qe&&(wcpayExpressCheckoutParams.product=void 0);const t=De();(0,o.applyFilters)("wcpay.express-checkout.is-cart-eligible",t>0,Qe)?Qe?await s.startExpressCheckoutElement({total:t,currency:Qe.totals.currency_code.toLowerCase()}):"product"===le("button_context")&&le("product")?await s.startExpressCheckoutElement({total:t,currency:le("product")?.currency}):(se.hideContainer(),se.getButtonSeparator().hide()):(se.hideContainer(),se.getButtonSeparator().hide()),(0,o.addAction)("wcpay.express-checkout.update-button-data","automattic/wcpay/express-checkout",(async()=>{if("product"===le("button_context")&&jQuery(qe()).is(".disabled"))se.unblockButton();else{e(".woocommerce-error").remove();try{se.blockButton();const e=De();Qe=await Ue(),wcpayExpressCheckoutParams.product=null,se.unblockButton();const t=De();Ve?t!==e&&t>0&&Ve.update({amount:t}):s.init(),(0,o.applyFilters)("wcpay.express-checkout.is-cart-eligible",t>0,Qe)?(se.showContainer(),se.getButtonSeparator().show()):(se.hideContainer(),se.getButtonSeparator().hide())}catch(e){se.hideContainer()}}}))}};"checkout"===le("button_context")&&"pay_for_order"!==le("button_context")||s.init(),e(document.body).on("updated_cart_totals",(()=>{Qe=null,s.init()})),e(document.body).on("updated_checkout",(()=>{Qe=null,s.init()}))}))})()})();
window.WpStatisticsUserTracker||(window.WpStatisticsUserTracker={lastUrl:window.location.href,originalPushState:history.pushState,originalReplaceState:history.replaceState,isDndActive:parseInt(navigator.msDoNotTrack||window.doNotTrack||navigator.doNotTrack,10),hasTrackerInitializedOnce:!1,hasUrlChangeTrackerInitialized:!1,hitRequestSuccessful:!0,init:function(){this.hasTrackerInitializedOnce||(this.hasTrackerInitializedOnce=!0,WP_Statistics_Tracker_Object.option.isPreview)||(void 0===WP_Statistics_Tracker_Object?console.error("WP Statistics: Variable WP_Statistics_Tracker_Object not found. Ensure /wp-content/plugins/wp-statistics/assets/js/tracker.js is either excluded from cache settings or not dequeued by any plugin. Clear your cache if necessary."):this.checkHitRequestConditions(),this.trackUrlChange())},base64Encode:function(t){t=(new TextEncoder).encode(t);return btoa(String.fromCharCode.apply(null,t))},getPathAndQueryString:function(){var t=window.location.pathname,e=window.location.search;return this.base64Encode(t+e)},getReferred:function(){return this.base64Encode(document.referrer)},checkHitRequestConditions:function(){!WP_Statistics_Tracker_Object.option.dntEnabled||1!==this.isDndActive?this.sendHitRequest():console.log("WP Statistics: Do Not Track (DNT) is enabled. Hit request not sent.")},sendHitRequest:async function(){try{var t=this.getRequestUrl(),i=new URLSearchParams({...WP_Statistics_Tracker_Object.hitParams,referred:this.getReferred(),page_uri:this.getPathAndQueryString()}).toString();let e=new XMLHttpRequest;e.open("POST",t,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),e.send(i),e.onreadystatechange=function(){var t;4===e.readyState&&(200===e.status?(t=JSON.parse(e.responseText),this.hitRequestSuccessful=!1!==t.status):(this.hitRequestSuccessful=!1,console.warn("WP Statistics: Hit request failed with status "+e.status)))}.bind(this)}catch(t){this.hitRequestSuccessful=!1,console.error("WP Statistics: Error sending hit request:",t)}},getRequestUrl:function(){let t=WP_Statistics_Tracker_Object.requestUrl+"/";return WP_Statistics_Tracker_Object.option.bypassAdBlockers?t=WP_Statistics_Tracker_Object.ajaxUrl:t+=WP_Statistics_Tracker_Object.hitParams.endpoint,t},updateTrackerObject:function(s){function r(){var t=document.getElementById("wp-statistics-tracker-js-extra");if(t)try{var e,i=t.innerHTML.match(/var\s+WP_Statistics_Tracker_Object\s*=\s*(\{[\s\S]*?\});/);i&&i[1]&&(e=JSON.parse(i[1]),!WP_Statistics_Tracker_Object.hitParams||JSON.stringify(WP_Statistics_Tracker_Object.hitParams)!==JSON.stringify(e.hitParams))?(WP_Statistics_Tracker_Object=e,!a&&s&&(a=!0,s())):++n<20?setTimeout(r,100):!a&&s&&(a=!0,s())}catch(t){console.error("WP Statistics: Error parsing WP_Statistics_Tracker_Object",t),!a&&s&&(a=!0,s())}else++n<20?setTimeout(r,100):!a&&s&&(a=!0,s())}let a=!1,n=0;setTimeout(r,50)},trackUrlChange:function(){if(!this.hasUrlChangeTrackerInitialized){this.hasUrlChangeTrackerInitialized=!0;let t=this;window.removeEventListener("popstate",t.handleUrlChange),history.pushState=function(){t.originalPushState.apply(history,arguments),t.handleUrlChange()},history.replaceState=function(){t.originalReplaceState.apply(history,arguments),t.handleUrlChange()},window.addEventListener("popstate",function(){t.handleUrlChange()})}},handleUrlChange:function(){let t=this;window.location.href!==this.lastUrl&&(this.lastUrl=window.location.href,this.updateTrackerObject(function(){t.checkHitRequestConditions()}))}});
window.WpStatisticsEventTracker||(window.WpStatisticsEventTracker={hasEventsInitializedOnce:!1,downloadTracker:!1,linkTracker:!1,init:async function(){this.hasEventsInitializedOnce||WP_Statistics_Tracker_Object.isLegacyEventLoaded||(this.hasEventsInitializedOnce=!0,"undefined"!=typeof WP_Statistics_DataPlus_Event_Object&&(this.downloadTracker=WP_Statistics_DataPlus_Event_Object.options.downloadTracker,this.linkTracker=WP_Statistics_DataPlus_Event_Object.options.linkTracker,this.downloadTracker||this.linkTracker)&&this.captureEvent(),window.wp_statistics_event=this.handleCustomEvent.bind(this),"undefined"!=typeof WP_Statistics_Marketing_Event_Object&&this.captureCustomClickEvents())},handleCustomEvent:function(t,e={}){var n=WP_Statistics_Tracker_Object.customEventAjaxUrl,t=(e.timestamp=Date.now(),e.resource_id||(e.resource_id=WP_Statistics_Tracker_Object.hitParams.source_id),{event_name:t,event_data:JSON.stringify(e)});this.sendEventData(t,n)},captureCustomClickEvents:function(){WP_Statistics_Marketing_Event_Object.events.clicks.forEach(e=>{!e.selector||null!=e.scope&&e.scope!=WP_Statistics_Tracker_Object.hitParams.source_id||document.querySelectorAll(""+e.selector).forEach(t=>{t.addEventListener("click",t=>{t={text:t.target.textContent,id:t.currentTarget.id,class:t.currentTarget.className,target:t.currentTarget.href};this.handleCustomEvent(e.name,t)})})})},captureEvent:function(){document.querySelectorAll("a").forEach(t=>{t.addEventListener("click",async t=>this.handleEvent(t)),t.addEventListener("mouseup",async t=>this.handleEvent(t))})},handleEvent:async function(t){var e;"mouseup"==t.type&&1!=t.button||(t=this.prepareEventData(t))&&(e=WP_Statistics_DataPlus_Event_Object.eventAjaxUrl,await this.sendEventData(t,e))},prepareEventData:function(t){let e={en:t.type,et:Date.now(),eid:t.currentTarget.id,ec:t.currentTarget.className,ev:"",mb:t.button,fn:"",fx:"",m:"",tu:"",pid:""};return"A"===t.currentTarget.tagName&&(e=this.extractLinkData(t,e)),"undefined"!=typeof WP_Statistics_Tracker_Object&&(e.pid=WP_Statistics_Tracker_Object.hitParams.source_id),e},extractLinkData(t,e){var n=t.target.textContent,a=t.currentTarget.href,i=WP_Statistics_DataPlus_Event_Object.fileExtensions,i=new RegExp("\\.("+i.join("|")+")$","i"),n=(n&&(e.ev=n),a&&(e.tu=a),t.currentTarget.classList.contains("woocommerce-MyAccount-downloads-file")||a.includes("download_file="));if(e.wcdl=n,(i.test(a)||n)&&(t=new URL(a).pathname,e.df=n?a.substring(a.lastIndexOf("download_file=")+14).split("&").shift():"",e.dk=n?a.substring(a.lastIndexOf("key=")+4).split("&").shift():"",e.en="file_download",e.fn=n?e.df:t.substring(t.lastIndexOf("/")+1).split(".").shift(),e.fx=n?e.df:t.split(".").pop()),"click"===e.en){if(!this.linkTracker)return!1;try{if(new URL(a).host===window.location.host)return!1}catch(t){}}return!("file_download"===e.en&&!this.downloadTracker)&&e},sendEventData:async function(t,e){var n,a=new URLSearchParams;for(n in t)a.append(n,t[n]);if(!e)throw new Error("AJAX URL is not defined.");try{(await fetch(e,{method:"POST",keepalive:!0,body:a})).ok}catch(t){console.error("Error:",t)}}});
function handleWpConsentApiIntegration(){(wp_has_consent("statistics")||wp_has_consent("statistics-anonymous"))&&(WpStatisticsUserTracker.init(),WpStatisticsEventTracker.init()),document.addEventListener("wp_listen_for_consent_change",function(t){var n,i=t.detail;for(n in i)!i.hasOwnProperty(n)||"statistics"!==n&&"statistics-anonymous"!==n||"allow"!==i[n]||(WpStatisticsUserTracker.init(),WpStatisticsEventTracker.init())})}function handleRealCookieBannerIntegration(){(window.consentApi?.consent("wp-statistics")||Promise.resolve()).then(()=>{WpStatisticsUserTracker.init(),WpStatisticsEventTracker.init()}).catch(()=>{var t=window.consentApi?.consentSync("wp-statistics-with-data-processing");null!=t.cookie&&t.cookieOptIn?(WpStatisticsUserTracker.init(),WpStatisticsEventTracker.init()):console.log("WP Statistics: Real Cookie Banner consent is not given to track visitor information.")})}document.addEventListener("DOMContentLoaded",function t(){var n;document.prerendering?document.addEventListener("prerenderingchange",t,{once:!0}):((n=WP_Statistics_Tracker_Object.option.consentIntegration.name)&&"borlabs_cookie"!==n||(WpStatisticsUserTracker.init(),WpStatisticsEventTracker.init()),"wp_consent_api"===n&&handleWpConsentApiIntegration(),"real_cookie_banner"===n&&handleRealCookieBannerIntegration())});
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=142)}({0:function(e,t){e.exports=jQuery},142:function(e,t,n){"use strict";(function(e){et_modules_wrapper.builderCssContainerPrefix;var t=et_modules_wrapper.builderCssLayoutPrefix,n=e(".et_pb_module:not(".concat(t," .et_pb_module, .et_pb_section .et_pb_module), .et_pb_row:not(").concat(t," .et_pb_row, .et_pb_section .et_pb_row), .et_pb_section:not(").concat(t," .et_pb_section)"));n.length>0&&n.each((function(){var t=e(this);0===t.closest("#et-boc").length&&t.wrap('<div id="et-boc"></div>'),0===t.closest(".et-l").length&&t.wrap('<div class="et-l"></div>')}))}).call(this,n(0))}});
(function($){
$(function(){
var user_agent=navigator.userAgent;
var is_opera_edge;
var browser=user_agent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))/i)||[];
var browser_name='';
var browser_class='';
if(/trident/i.test(browser[0]) ){
browser_name='ie';
}else if(browser[0]==='Chrome'){
is_opera_edge=user_agent.match(/\b(OPR|Edge)/);
if(is_opera_edge!==null){
browser_name=is_opera_edge[0].replace('OPR', 'opera');
}}
if(''===browser_name){
if('standalone' in window.navigator&&!window.navigator.standalone){
browser_name='uiwebview';
}else{
browser_name=browser[0]&&''!==browser[0] ? browser[0]:navigator.appName;
}}
browser_name=browser_name.toLowerCase();
switch(browser_name){
case 'msie' :
browser_class='ie';
break;
case 'firefox' :
browser_class='gecko';
break;
default :
browser_class=browser_name;
break;
}
if(user_agent.match(/iPhone/)){
browser_class +=' iphone';
}
$('body').addClass(browser_class);
});
})(jQuery);
!function(n){var s="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(t,e,i){s.Backbone=n(s,i,t,e)});else if("undefined"!=typeof exports){var t,e=require("underscore");try{t=require("jquery")}catch(t){}n(s,exports,e,t)}else s.Backbone=n(s,{},s._,s.jQuery||s.Zepto||s.ender||s.$)}(function(t,h,b,e){function a(t,e,i,n,s){var r,o=0;if(i&&"object"==typeof i){void 0!==n&&"context"in s&&void 0===s.context&&(s.context=n);for(r=b.keys(i);o<r.length;o++)e=a(t,e,r[o],i[r[o]],s)}else if(i&&l.test(i))for(r=i.split(l);o<r.length;o++)e=t(e,r[o],n,s);else e=t(e,i,n,s);return e}function x(t,e,i){i=Math.min(Math.max(i,0),t.length);for(var n=Array(t.length-i),s=e.length,r=0;r<n.length;r++)n[r]=t[r+i];for(r=0;r<s;r++)t[r+i]=e[r];for(r=0;r<n.length;r++)t[r+s+i]=n[r]}function s(i,n,t,s){b.each(t,function(t,e){n[e]&&(i.prototype[e]=function(n,t,s,r){switch(t){case 1:return function(){return n[s](this[r])};case 2:return function(t){return n[s](this[r],t)};case 3:return function(t,e){return n[s](this[r],T(t,this),e)};case 4:return function(t,e,i){return n[s](this[r],T(t,this),e,i)};default:return function(){var t=u.call(arguments);return t.unshift(this[r]),n[s].apply(n,t)}}}(n,t,e,s))})}var o,i=t.Backbone,u=Array.prototype.slice,e=(h.VERSION="1.6.0",h.$=e,h.noConflict=function(){return t.Backbone=i,this},h.emulateHTTP=!1,h.emulateJSON=!1,h.Events={}),l=/\s+/,n=(e.on=function(t,e,i){return this._events=a(n,this._events||{},t,e,{context:i,ctx:this,listening:o}),o&&(((this._listeners||(this._listeners={}))[o.id]=o).interop=!1),this},e.listenTo=function(t,e,i){if(t){var n=t._listenId||(t._listenId=b.uniqueId("l")),s=this._listeningTo||(this._listeningTo={}),r=o=s[n],s=(r||(this._listenId||(this._listenId=b.uniqueId("l")),r=o=s[n]=new g(this,t)),c(t,e,i,this));if(o=void 0,s)throw s;r.interop&&r.on(e,i)}return this},function(t,e,i,n){var s,r;return i&&(e=t[e]||(t[e]=[]),s=n.context,r=n.ctx,(n=n.listening)&&n.count++,e.push({callback:i,context:s,ctx:s||r,listening:n})),t}),c=function(t,e,i,n){try{t.on(e,i,n)}catch(t){return t}},r=(e.off=function(t,e,i){return this._events&&(this._events=a(r,this._events,t,e,{context:i,listeners:this._listeners})),this},e.stopListening=function(t,e,i){var n=this._listeningTo;if(n){for(var s=t?[t._listenId]:b.keys(n),r=0;r<s.length;r++){var o=n[s[r]];if(!o)break;o.obj.off(e,i,this),o.interop&&o.off(e,i)}b.isEmpty(n)&&(this._listeningTo=void 0)}return this},function(t,e,i,n){if(t){var s,r=n.context,o=n.listeners,h=0;if(e||r||i){for(s=e?[e]:b.keys(t);h<s.length;h++){var a=t[e=s[h]];if(!a)break;for(var u=[],l=0;l<a.length;l++){var c=a[l];i&&i!==c.callback&&i!==c.callback._callback||r&&r!==c.context?u.push(c):(c=c.listening)&&c.off(e,i)}u.length?t[e]=u:delete t[e]}return t}for(s=b.keys(o);h<s.length;h++)o[s[h]].cleanup()}}),d=(e.once=function(t,e,i){var n=a(d,{},t,e,this.off.bind(this));return this.on(n,e="string"==typeof t&&null==i?void 0:e,i)},e.listenToOnce=function(t,e,i){e=a(d,{},e,i,this.stopListening.bind(this,t));return this.listenTo(t,e)},function(t,e,i,n){var s;return i&&((s=t[e]=b.once(function(){n(e,s),i.apply(this,arguments)}))._callback=i),t}),f=(e.trigger=function(t){if(this._events){for(var e=Math.max(0,arguments.length-1),i=Array(e),n=0;n<e;n++)i[n]=arguments[n+1];a(f,this._events,t,void 0,i)}return this},function(t,e,i,n){var s,r;return t&&(s=t[e],r=t.all,s&&(r=r&&r.slice()),s&&p(s,n),r)&&p(r,[e].concat(n)),t}),p=function(t,e){var i,n=-1,s=t.length,r=e[0],o=e[1],h=e[2];switch(e.length){case 0:for(;++n<s;)(i=t[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r);return;case 2:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,o);return;case 3:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,o,h);return;default:for(;++n<s;)(i=t[n]).callback.apply(i.ctx,e);return}},g=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0},v=(g.prototype.on=e.on,g.prototype.off=function(t,e){t=this.interop?(this._events=a(r,this._events,t,e,{context:void 0,listeners:void 0}),!this._events):(this.count--,0===this.count);t&&this.cleanup()},g.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},e.bind=e.on,e.unbind=e.off,b.extend(h,e),h.Model=function(t,e){var i=t||{},n=(e=e||{},this.preinitialize.apply(this,arguments),this.cid=b.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(i=this.parse(i,e)||{}),b.result(this,"defaults")),i=b.defaults(b.extend({},n,i),n);this.set(i,e),this.changed={},this.initialize.apply(this,arguments)}),m=(b.extend(v.prototype,e,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return b.clone(this.attributes)},sync:function(){return h.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return b.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!b.iteratee(t,this)(this.attributes)},set:function(t,e,i){if(null!=t){var n;if("object"==typeof t?(n=t,i=e):(n={})[t]=e,!this._validate(n,i=i||{}))return!1;var s,r,o=i.unset,t=i.silent,h=[],a=this._changing,u=(this._changing=!0,a||(this._previousAttributes=b.clone(this.attributes),this.changed={}),this.attributes),l=this.changed,c=this._previousAttributes;for(s in n)e=n[s],b.isEqual(u[s],e)||h.push(s),b.isEqual(c[s],e)?delete l[s]:l[s]=e,o?delete u[s]:u[s]=e;if(this.idAttribute in n&&(r=this.id,this.id=this.get(this.idAttribute),this.trigger("changeId",this,r,i)),!t){h.length&&(this._pending=i);for(var d=0;d<h.length;d++)this.trigger("change:"+h[d],this,u[h[d]],i)}if(!a){if(!t)for(;this._pending;)i=this._pending,this._pending=!1,this.trigger("change",this,i);this._pending=!1,this._changing=!1}}return this},unset:function(t,e){return this.set(t,void 0,b.extend({},e,{unset:!0}))},clear:function(t){var e,i={};for(e in this.attributes)i[e]=void 0;return this.set(i,b.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!b.isEmpty(this.changed):b.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&b.clone(this.changed);var e,i,n=this._changing?this._previousAttributes:this.attributes,s={};for(i in t){var r=t[i];b.isEqual(n[i],r)||(s[i]=r,e=!0)}return!!e&&s},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return b.clone(this._previousAttributes)},fetch:function(i){i=b.extend({parse:!0},i);var n=this,s=i.success;return i.success=function(t){var e=i.parse?n.parse(t,i):t;if(!n.set(e,i))return!1;s&&s.call(i.context,n,t,i),n.trigger("sync",n,t,i)},N(this,i),this.sync("read",this,i)},save:function(t,e,i){null==t||"object"==typeof t?(n=t,i=e):(n={})[t]=e;var n,s=(i=b.extend({validate:!0,parse:!0},i)).wait;if(n&&!s){if(!this.set(n,i))return!1}else if(!this._validate(n,i))return!1;var r=this,o=i.success,h=this.attributes,t=(i.success=function(t){r.attributes=h;var e=i.parse?r.parse(t,i):t;if((e=s?b.extend({},n,e):e)&&!r.set(e,i))return!1;o&&o.call(i.context,r,t,i),r.trigger("sync",r,t,i)},N(this,i),n&&s&&(this.attributes=b.extend({},h,n)),this.isNew()?"create":i.patch?"patch":"update"),e=("patch"!=t||i.attrs||(i.attrs=n),this.sync(t,this,i));return this.attributes=h,e},destroy:function(e){e=e?b.clone(e):{};function i(){n.stopListening(),n.trigger("destroy",n,n.collection,e)}var n=this,s=e.success,r=e.wait,t=!(e.success=function(t){r&&i(),s&&s.call(e.context,n,t,e),n.isNew()||n.trigger("sync",n,t,e)});return this.isNew()?b.defer(e.success):(N(this,e),t=this.sync("delete",this,e)),r||i(),t},url:function(){var t,e=b.result(this,"urlRoot")||b.result(this.collection,"url")||M();return this.isNew()?e:(t=this.get(this.idAttribute),e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t))},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},b.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=b.extend({},this.attributes,t);t=this.validationError=this.validate(t,e)||null;return!t||(this.trigger("invalid",this,t,b.extend(e,{validationError:t})),!1)}}),h.Collection=function(t,e){e=e||{},this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,b.extend({silent:!0},e))}),w={add:!0,remove:!0,merge:!0},_={add:!0,remove:!1},y=(b.extend(m.prototype,e,{model:v,preinitialize:function(){},initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return h.sync.apply(this,arguments)},add:function(t,e){return this.set(t,b.extend({merge:!1},e,_))},remove:function(t,e){e=b.extend({},e);var i=!b.isArray(t),t=(t=i?[t]:t.slice(),this._removeModels(t,e));return!e.silent&&t.length&&(e.changes={added:[],merged:[],removed:t},this.trigger("update",this,e)),i?t[0]:t},set:function(t,e){if(null!=t){(e=b.extend({},w,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);for(var i=!b.isArray(t),n=(t=i?[t]:t.slice(),e.at),s=((n=(n=null!=n?+n:n)>this.length?this.length:n)<0&&(n+=this.length+1),[]),r=[],o=[],h=[],a={},u=e.add,l=e.merge,c=e.remove,d=!1,f=this.comparator&&null==n&&!1!==e.sort,p=b.isString(this.comparator)?this.comparator:null,g=0;g<t.length;g++){var v,m=t[g],_=this.get(m);_?(l&&m!==_&&(v=this._isModel(m)?m.attributes:m,e.parse&&(v=_.parse(v,e)),_.set(v,e),o.push(_),f)&&!d&&(d=_.hasChanged(p)),a[_.cid]||(a[_.cid]=!0,s.push(_)),t[g]=_):u&&(m=t[g]=this._prepareModel(m,e))&&(r.push(m),this._addReference(m,e),a[m.cid]=!0,s.push(m))}if(c){for(g=0;g<this.length;g++)a[(m=this.models[g]).cid]||h.push(m);h.length&&this._removeModels(h,e)}var y=!1;if(s.length&&(!f&&u&&c)?(y=this.length!==s.length||b.some(this.models,function(t,e){return t!==s[e]}),this.models.length=0,x(this.models,s,0),this.length=this.models.length):r.length&&(f&&(d=!0),x(this.models,r,null==n?this.length:n),this.length=this.models.length),d&&this.sort({silent:!0}),!e.silent){for(g=0;g<r.length;g++)null!=n&&(e.index=n+g),(m=r[g]).trigger("add",m,this,e);(d||y)&&this.trigger("sort",this,e),(r.length||h.length||o.length)&&(e.changes={added:r,removed:h,merged:o},this.trigger("update",this,e))}return i?t[0]:t}},reset:function(t,e){e=e?b.clone(e):{};for(var i=0;i<this.models.length;i++)this._removeReference(this.models[i],e);return e.previousModels=this.models,this._reset(),t=this.add(t,b.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,b.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,b.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return u.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t,t.idAttribute)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t=t||{};var i=e.length;return b.isFunction(e)&&(e=e.bind(this)),1===i||b.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(i){var n=(i=b.extend({parse:!0},i)).success,s=this;return i.success=function(t){var e=i.reset?"reset":"set";s[e](t,i),n&&n.call(i.context,s,t,i),s.trigger("sync",s,t,i)},N(this,i),this.sync("read",this,i)},create:function(t,e){var n=(e=e?b.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);var s=this,r=e.success;return e.success=function(t,e,i){n&&(t.off("error",s._forwardPristineError,s),s.add(t,i)),r&&r.call(i.context,t,e,i)},n&&t.once("error",this._forwardPristineError,this),t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t,e){return t[e||this.model.prototype.idAttribute||"id"]},values:function(){return new E(this,S)},keys:function(){return new E(this,I)},entries:function(){return new E(this,k)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){return this._isModel(t)?(t.collection||(t.collection=this),t):(t=((e=e?b.clone(e):{}).collection=this).model.prototype?new this.model(t,e):this.model(t,e)).validationError?(this.trigger("invalid",this,t.validationError,e),!1):t},_removeModels:function(t,e){for(var i=[],n=0;n<t.length;n++){var s,r,o=this.get(t[n]);o&&(s=this.indexOf(o),this.models.splice(s,1),this.length--,delete this._byId[o.cid],null!=(r=this.modelId(o.attributes,o.idAttribute))&&delete this._byId[r],e.silent||(e.index=s,o.trigger("remove",o,this,e)),i.push(o),this._removeReference(o,e))}return 0<t.length&&!e.silent&&delete e.index,i},_isModel:function(t){return t instanceof v},_addReference:function(t,e){this._byId[t.cid]=t;var i=this.modelId(t.attributes,t.idAttribute);null!=i&&(this._byId[i]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var i=this.modelId(t.attributes,t.idAttribute);null!=i&&delete this._byId[i],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){if(e){if(("add"===t||"remove"===t)&&i!==this)return;var s,r;"destroy"===t&&this.remove(e,n),"changeId"===t&&(s=this.modelId(e.previousAttributes(),e.idAttribute),r=this.modelId(e.attributes,e.idAttribute),null!=s&&delete this._byId[s],null!=r)&&(this._byId[r]=e)}this.trigger.apply(this,arguments)},_forwardPristineError:function(t,e,i){this.has(t)||this._onModelEvent("error",t,e,i)}}),"function"==typeof Symbol&&Symbol.iterator),E=(y&&(m.prototype[y]=m.prototype.values),function(t,e){this._collection=t,this._kind=e,this._index=0}),S=1,I=2,k=3,y=(y&&(E.prototype[y]=function(){return this}),E.prototype.next=function(){if(this._collection){var t,e;if(this._index<this._collection.length)return t=this._collection.at(this._index),this._index++,{value:this._kind===S?t:(e=this._collection.modelId(t.attributes,t.idAttribute),this._kind===I?e:[e,t]),done:!1};this._collection=void 0}return{value:void 0,done:!0}},h.View=function(t){this.cid=b.uniqueId("view"),this.preinitialize.apply(this,arguments),b.extend(this,b.pick(t,P)),this._ensureElement(),this.initialize.apply(this,arguments)}),A=/^(\S+)\s*(.*)$/,P=["model","collection","el","id","attributes","className","tagName","events"],T=(b.extend(y.prototype,e,{tagName:"div",$:function(t){return this.$el.find(t)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof h.$?t:h.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t=t||b.result(this,"events"))for(var e in this.undelegateEvents(),t){var i=t[e];(i=b.isFunction(i)?i:this[i])&&(e=e.match(A),this.delegate(e[1],e[2],i.bind(this)))}return this},delegate:function(t,e,i){return this.$el.on(t+".delegateEvents"+this.cid,e,i),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,i){return this.$el.off(t+".delegateEvents"+this.cid,e,i),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){var t;this.el?this.setElement(b.result(this,"el")):(t=b.extend({},b.result(this,"attributes")),this.id&&(t.id=b.result(this,"id")),this.className&&(t.class=b.result(this,"className")),this.setElement(this._createElement(b.result(this,"tagName"))),this._setAttributes(t))},_setAttributes:function(t){this.$el.attr(t)}}),function(e,t){return b.isFunction(e)?e:b.isObject(e)&&!t._isModel(e)?H(e):b.isString(e)?function(t){return t.get(e)}:e}),H=function(t){var e=b.matches(t);return function(t){return e(t.attributes)}},$=(b.each([[m,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models"],[v,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes"]],function(t){var i=t[0],e=t[1],n=t[2];i.mixin=function(t){var e=b.reduce(b.functions(t),function(t,e){return t[e]=0,t},{});s(i,t,e,n)},s(i,b,e,n)}),h.sync=function(t,e,n){var i,s=$[t],r=(b.defaults(n=n||{},{emulateHTTP:h.emulateHTTP,emulateJSON:h.emulateJSON}),{type:s,dataType:"json"}),o=(n.url||(r.url=b.result(e,"url")||M()),null!=n.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(r.contentType="application/json",r.data=JSON.stringify(n.attrs||e.toJSON(n))),n.emulateJSON&&(r.contentType="application/x-www-form-urlencoded",r.data=r.data?{model:r.data}:{}),!n.emulateHTTP||"PUT"!==s&&"DELETE"!==s&&"PATCH"!==s||(r.type="POST",n.emulateJSON&&(r.data._method=s),i=n.beforeSend,n.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",s),i)return i.apply(this,arguments)}),"GET"===r.type||n.emulateJSON||(r.processData=!1),n.error),t=(n.error=function(t,e,i){n.textStatus=e,n.errorThrown=i,o&&o.call(n.context,t,e,i)},n.xhr=h.ajax(b.extend(r,n)));return e.trigger("request",e,t,n),t},{create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"}),C=(h.ajax=function(){return h.$.ajax.apply(h.$,arguments)},h.Router=function(t){t=t||{},this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)}),j=/\((.*?)\)/g,O=/(\(\?)?:\w+/g,U=/\*\w+/g,z=/[\-{}\[\]+?.,\\\^$|#\s]/g,R=(b.extend(C.prototype,e,{preinitialize:function(){},initialize:function(){},route:function(e,i,n){b.isRegExp(e)||(e=this._routeToRegExp(e)),b.isFunction(i)&&(n=i,i=""),n=n||this[i];var s=this;return h.history.route(e,function(t){t=s._extractParameters(e,t);!1!==s.execute(n,t,i)&&(s.trigger.apply(s,["route:"+i].concat(t)),s.trigger("route",i,t),h.history.trigger("route",s,i,t))}),this},execute:function(t,e,i){t&&t.apply(this,e)},navigate:function(t,e){return h.history.navigate(t,e),this},_bindRoutes:function(){if(this.routes){this.routes=b.result(this,"routes");for(var t,e=b.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(z,"\\$&").replace(j,"(?:$1)?").replace(O,function(t,e){return e?t:"([^/?]+)"}).replace(U,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return b.map(i,function(t,e){return e===i.length-1?t||null:t?decodeURIComponent(t):null})}}),h.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)}),q=/^[#\/]|\s+$/g,F=/^\/+|\/+$/g,B=/#.*$/,M=(R.started=!1,b.extend(R.prototype,e,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){t=(t||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return(t=null==t?this._usePushState||!this._wantsHashChange?this.getPath():this.getHash():t).replace(q,"")},start:function(t){if(R.started)throw new Error("Backbone.history has already been started");if(R.started=!0,this.options=b.extend({root:"/"},this.options,t),this.root=this.options.root,this._trailingSlash=this.options.trailingSlash,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||7<document.documentMode),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(F,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return t=this.root.slice(0,-1)||"/",this.location.replace(t+"#"+this.getPath()),!0;this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}this._hasHashChange||!this._wantsHashChange||this._usePushState||(this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1,(t=(t=document.body).insertBefore(this.iframe,t.firstChild).contentWindow).document.open(),t.document.close(),t.location.hash="#"+this.fragment);t=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?t("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),R.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if((e=e===this.fragment&&this.iframe?this.getHash(this.iframe.contentWindow):e)===this.fragment)return!this.matchRoot()&&this.notfound();this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(e){return this.matchRoot()&&(e=this.fragment=this.getFragment(e),b.some(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0}))||this.notfound()},notfound:function(){return this.trigger("notfound"),!1},navigate:function(t,e){if(!R.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var i=this.root,i=(i=this._trailingSlash||""!==t&&"?"!==t.charAt(0)?i:i.slice(0,-1)||"/")+t,n=(t=t.replace(B,""),this.decodeFragment(t));if(this.fragment!==n){if(this.fragment=n,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)&&(n=this.iframe.contentWindow,e.replace||(n.document.open(),n.document.close()),this._updateHash(n.location,t,e.replace))}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){i?(i=t.href.replace(/(javascript:|#).*$/,""),t.replace(i+"#"+e)):t.hash="#"+e}}),h.history=new R,v.extend=m.extend=C.extend=y.extend=R.extend=function(t,e){var i=this,n=t&&b.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)};return b.extend(n,i,e),n.prototype=b.create(i.prototype,t),(n.prototype.constructor=n).__super__=i.prototype,n},function(){throw new Error('A "url" property or function must be specified')}),N=function(e,i){var n=i.error;i.error=function(t){n&&n.call(i.context,e,t,i),e.trigger("error",e,t,i)}};return h._debug=function(){return{root:t,_:b}},h});
jQuery(function(t){function e(t){return"string"==typeof t&&("transparent"==t||"rgba"==t.substring(0,4))}if(Category=Backbone.Model.extend({defaults:{updating:!1},initialize:function(){this.set("id",this.get("cat_ID"))}}),Categories=Backbone.Collection.extend({parse:function(t){return this.url=t.products},model:Category,filterByIds:function(t){return this.reset(_.map(t,function(t){return this.get(t)},this))}}),CategoryView=Backbone.View.extend({tagName:"tbody",className:"otfw-products-tbody collapse ",isUpdating:!1,initialize:function(){1==otfw.show_cats_expand&&this.$el.addClass("in"),this.$el.attr("id","tbodycat_"+this.model.get("cat_ID")),this.template=_.template(t("#categoryTemplate").html())},render:function(){var t=_.extend(this.model.attributes,{});return this.$el.html(this.template(t)),this}}),CategoryView2=Backbone.View.extend({tagName:"tbody",isUpdating:!1,initialize:function(){this.$el.attr("id","tbodycat2_"+this.model.get("cat_ID")),this.template=_.template(t("#categoryTemplate2").html())},render:function(){var t=_.extend(this.model.attributes,{});return this.$el.html(this.template(t)),this}}),ProductModel=Backbone.Model.extend({defaults:{updating:!1}}),ProductModels=Backbone.Collection.extend({parse:function(t){return this.url=t.next_page,t.products},model:ProductModel}),table=Backbone.View.extend({el:jQuery(".otfw_footer_total"),initialize:function(){}}),table2=Backbone.View.extend({el:jQuery(".otfw_updating"),initialize:function(){}}),ProductModelView=Backbone.View.extend({tagName:"tr",className:"otfw-item",isUpdating:!1,events:{"focusout input[name='quantity']":"item_added"},initialize:function(){$this=this,window.first=!0,window.queue=[],this.table=new table({parent:this}),this.table2=new table2({parent:this}),this.model.get("on_sale_pre")&&this.$el.addClass("otfw_sale"),this.$el.attr("id","otfw_item_"+this.model.get("id")),this.model.get("in_stock_pre")||this.$el.addClass("otfw_no_stock"),this.template=_.template(t("#productTemplate").html())},item_added:function(e){var o=t(e.currentTarget),i=parseFloat(o.val());isNaN(i)&&(i=0);var r=o.closest("form");window.queue.push([this,i,r,o]),!0===window.first&&(this.table2.$el.show(),"yes"==otfw.stick_table&&jQuery(".sticky-hooters_sticky-footer").find(".otfw_updating").show(),window.first=!1,this.moveAlong())},moveAlong:function(){var t;window.queue.length?(t=queue.shift(),this.updateQuantity(t)):(window.first=!0,this.table2.$el.hide(),"yes"==otfw.stick_table&&jQuery(".sticky-hooters_sticky-footer").find(".otfw_updating").hide(),jQuery(document).trigger("otfw_queue_empty"))},render:function(){var t=_.extend(this.model.attributes,{});return this.$el.html(this.template(t)),this},updating:function(){},updateQuantity:function(e){var o=this,i=e[0],r=e[1],a=e[2],n=e[3],s=i.model.get("cart_item_hash_pre"),d=i.model.get("manage_stock_pre"),c=i.model.get("title_pre"),u=i.model.get("max_to_purchase_pre"),l=_.isEmpty(jQuery(n).attr("min"))?"":Number(jQuery(n).attr("min")),f=_.isEmpty(jQuery(n).attr("max"))?"":Number(jQuery(n).attr("max"));if(_.isNumber(l)&&!Number.isNaN(l)&&0!=r&&r<l)return jQuery("#stock_modal").on("show.bs.aromodal",function(){jQuery(this).trigger("focus"),jQuery(this).find(".aromodal-body").html(otfw.min_message_1+l+".")}),jQuery("#stock_modal").aromodal(),n.val(l).trigger("focusout"),void o.moveAlong();if(_.isNumber(f)&&!Number.isNaN(f)&&0!=r&&r>f)return jQuery("#stock_modal").on("show.bs.aromodal",function(){jQuery(this).trigger("focus"),jQuery(this).find(".aromodal-body").html(otfw.max_message_1+f+".")}),jQuery("#stock_modal").aromodal(),n.val(f).trigger("focusout"),void o.moveAlong();if(!0!==i.model.get("parent_manage_stock_pre"))if(!0===d&&r>u&&-1!=u&&"yes"==otfw.stock_warning&&(jQuery("#stock_modal").on("show.bs.aromodal",function(){jQuery(this).trigger("focus"),jQuery(this).find(".aromodal-body").html(otfw.stock_message_part_3+"<i>"+c+"</i>"+otfw.stock_message_part_2+u+".")}),jQuery("#stock_modal").aromodal()),!0===d&&r>u&&-1!=u){var h=s,m=u;n.val(m)}else if(r>u&&-1!=u){h=s,m=u;n.val(m)}else h=s,m=r;else h=s,m=r;if(isNaN(m)&&(m=0),h)data={cart_item_key:h,quantity:m,update_cart:!0,nonce:otfw.nonce},t.ajax({url:otfw.wc_ajax_url.replace("%%endpoint%%","otfw_update_cart"),method:"POST",data:data}).done(function(t){if(!0===t.status)"yes"==otfw.stock_warning&&(jQuery("#stock_modal").on("show.bs.aromodal",function(){jQuery(this).trigger("focus"),jQuery(this).find(".aromodal-body").html(otfw.stock_message_part_3+"<i>"+c+"</i>"+otfw.stock_message_part_2+t.product_quantity+".")}),jQuery("#stock_modal").aromodal()),n.val(t.product_quantity),r=t.product_quantity;else if(1==t.error)return jQuery("#stock_modal").on("show.bs.aromodal",function(){jQuery(this).trigger("focus"),jQuery(this).find(".aromodal-body").html(otfw.warning_message)}),jQuery("#stock_modal").aromodal(),void a[0].reset();i.cartUpdated(t),r<=0&&i.model.set("cart_item_hash_pre",""),i.q_out(t)}).done(function(){o.moveAlong()});else if(r>0){var w=a.serializeArray();w.push({name:"nonce",value:otfw.nonce}),t.ajax({url:otfw.wc_ajax_url.replace("%%endpoint%%","otfw_add_to_cart"),method:"POST",data:w}).done(function(t){if(!0===t.status)"yes"==otfw.stock_warning&&(jQuery("#stock_modal").on("show.bs.aromodal",function(){jQuery(this).trigger("focus"),jQuery(this).find(".aromodal-body").html(otfw.stock_message_part_3+"<i>"+c+"</i>"+otfw.stock_message_part_2+t.product_quantity+".")}),jQuery("#stock_modal").aromodal()),n.val(t.product_quantity),r=t.product_quantity;else if(1==t.error)return jQuery("#stock_modal").on("show.bs.aromodal",function(){jQuery(this).trigger("focus"),jQuery(this).find(".aromodal-body").html(otfw.warning_message)}),jQuery("#stock_modal").aromodal(),void a[0].reset();i.model.set("cart_item_hash_pre",t.cart_item_hash),i.cartUpdated(t),i.table.$el.find("#otfw_checkout_button").removeClass("disabled"),i.q_out(t)}).done(function(){o.moveAlong()})}else 0===r&&o.moveAlong()},cartUpdated:function(t){this.$el.find(".otfw-cart-action-2").css("visibility","visible").hide().fadeIn("slow"),this.$el.find(".otfw_item_amount").html(t.item_amount)},q_out:function(t){qq=t.quant_item,q=parseFloat(t.quant),0==q&&this.table.$el.find("#otfw_checkout_button").addClass("disabled"),this.table.$el.find(".otfw_test").html(q),this.table.$el.find(".otfw_test_2").html(qq),"yes"==otfw.stick_table&&(jQuery(".sticky-hooters_sticky-footer").find(".otfw_test").html(q),jQuery(".sticky-hooters_sticky-footer").find(".otfw_test_2").html(qq))},CartTotalQuantity:function(){var t=this.model.get("in_cart_quantity_pre");return parseFloat(t)}}),ProductModelListView=Backbone.View.extend({container:null,tbody:null,el:".otfw-products",initialize:function(){this.spinner=jQuery(".otfw_table_spinner"),this.isLoading=!1},render:function(){container=document.createDocumentFragment();var e="undefined"!=typeof otfw_short&&!!otfw_short,o=e?void 0===otfw_short.is_shortcode||"0"!==String(otfw_short.is_shortcode):1===Number(otfw.is_shortcode_page),i=e&&o&&-1!==["true","1","yes"].indexOf(String(otfw_short.show_cats).toLowerCase()),r=!o&&1===Number(otfw.is_actual_shop)&&1===Number(otfw.show_cats_shop);if(i||r)this.collection.categories.forEach(this.addOneCat,this),t(".otfw-products thead").after(container);else{tbody=document.createElement("tbody");var a=document.createAttribute("class");a.value="otfw-products-tbody",tbody.setAttributeNode(a),this.collection.products.forEach(this.addOne,this),container.appendChild(tbody),this.el.appendChild(container)}},reset:function(){this.$el.find("tr.otfw-item").remove(),this.render()},addOne:function(t){var e=this;if("variable"==t.get("type_pre"))_.each(t.get("variations_pre"),function(t){e.collection.add(t)});else{var o=new ProductModelView({model:t});tbody.appendChild(o.render().el)}},addOneCat:function(t){var e=new CategoryView({model:t}),o=new CategoryView2({model:t}),i=e.render().el;container.appendChild(o.render().el),this.collection.products.filter(function(e){return-1!==_.indexOf(e.get("cat_id_pre"),t.get("cat_ID"),!1)}).forEach(function(t){if("variable"==t.get("type_pre"))_.each(t.get("variations_pre"),function(t){this.collection.products.add(t)});else{var e=new ProductModelView({model:t});i.appendChild(e.render().el)}},i),container.appendChild(i)}}),ProductModelsFooterView=Backbone.View.extend(),"undefined"!=typeof OTFW_Items){var o=new ProductModels,i=new Categories;i.add(otfw.cats);var r=i.reject({category_count:0}),a=new Categories(r);"undefined"!=typeof otfw_short&&!!otfw_short&&(void 0===otfw_short.is_shortcode||"0"!==String(otfw_short.is_shortcode))&&-1!==["true","1","yes"].indexOf(String(otfw_short.show_cats).toLowerCase())&&0!==otfw_short.cats.length&&(r=a.filterByIds(otfw_short.cats),a=new Categories(r));var n=new ProductModelListView({collection:{products:o,categories:a}});o.url=OTFW_Items.next_page,o.add(OTFW_Items.products),n.render();var s=jQuery(".otfw");s.fadeTo(400,1).promise().then(function(){jQuery(document).trigger("otfwtable_shown")}),s.find(".otfw_table_spinner").detach()}var d,c,u;t(document).on("keyup","input.qty",function(t){13==t.keyCode&&jQuery(this).trigger("otfw-enter")}),"yes"==otfw.stick_table&&(u={top:0,bottom:-20},otfw.is_shop&&(t(".admin-bar").length&&(u.top+=t("#wpadminbar").outerHeight()),t(".storefront-handheld-footer-bar").is(":visible")&&(u.bottom+=t(".storefront-handheld-footer-bar").outerHeight()),t(".otfw-products").stickyHooters(u),textureEl=jQuery(".sticky-hooters_sticky-wrapper"),bgcolor=jQuery(textureEl).css("background-color"),e(bgcolor)&&jQuery(textureEl).parents().each(function(){if(!e(jQuery(this).css("background-color")))return bgcolor=jQuery(this).css("background-color"),!1}),jQuery(".sticky-hooters_sticky-wrapper").css({zIndex:1,"background-color":bgcolor}),jQuery(window).on("resize",function(){jQuery(".sticky-hooters_sticky-wrapper").css({width:jQuery(".otfw").width()})}))),c=navigator.userAgent,"Chrome"!=(d=c.indexOf("Firefox")>-1?"Firefox":c.indexOf("SamsungBrowser")>-1?"Samsung Internet":c.indexOf("Opera")>-1||c.indexOf("OPR")>-1?"Opera":c.indexOf("Trident")>-1?"Microsoft Internet Explorer":c.indexOf("Edge")>-1?"Microsoft Edge":c.indexOf("Chrome")>-1?"Chrome":c.indexOf("Safari")>-1?"Apple Safari":"unknown")&&"Firefox"!=d&&(t(".otfw-products-tbody").on("shown.bs.arocollapse",function(e){t(this).removeAttr("style")}),t(".otfw-products-tbody").on("hide.bs.arocollapse",function(e){t(this).hide()}))}),jQuery(document).ready(function(t){t(".out-of-stock").each(function(){t(this).parents("tr").height(t(".otfw-products").find(".quantity").parents("tr").height()),t(this).parents("tr").find(".otfw-cart-action-2").detach()}),t(document).on("click",".mini_cart_item a.remove",function(){location.reload()}),t(document).on("click","#otfw_checkout_button",function(e){!1===window.first&&(e.preventDefault(),t(document).on("otfw_queue_empty",function(){t("#otfw_checkout_button")[0].click()}))}),jQuery(document).on("input change",".qty",function(){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){jQuery(t).trigger("focusout")},2e3)}),"yes"==otfw.stick_table&&t(".otfw-products tbody.otfw-products-tbody tr:first td").each(function(e){var o=t(this).width();t(".sticky-hooters_wrapper .otfw-products thead tr th").eq(e).width(o+"px")})});
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
;(function($, window, document, undefined){
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
if(!(msie > 0||!!navigator.userAgent.match(/Trident.*rv\:11\./))){
'use strict';
var pluginName='stickyHooters',
defaults={
footerSelector: 'tfoot',
headerSelector: 'thead',
top: '0',
bottom: '0'
},
classNames={
outerWrapper: 'sticky-hooters_wrapper',
innerWrapper: 'sticky-hooters_sticky-wrapper',
innerWrapperHead: 'sticky-hooters_sticky-header',
innerWrapperFoot: 'sticky-hooters_sticky-footer',
};
function StickyHooters(element, options){
this.element=element;
this.settings=$.extend({}, defaults, options);
this.footerElement=$(this.settings.footerSelector, this.element)[0];
this.headerElement=$(this.settings.headerSelector, this.element)[0];
this.isTable=this.element.tagName.toLowerCase()==='table';
this._defaults=defaults;
this._name=pluginName;
this.isVisible=function(){
var viewportHeight=window.innerHeight;
return this.element.getBoundingClientRect().top < viewportHeight&&this.element.getBoundingClientRect().bottom > 0;
};
this.init();
}
jQuery.extend(StickyHooters.prototype, {
init: function(){
jQuery(this.element).wrap('<div class="' + classNames.outerWrapper + '"></div>');
if(this.footerElement||this.headerElement){
if(this.footerElement){
this.setupHooter(true);
}
if(this.headerElement){
this.setupHooter();
}
window.addEventListener('scroll', jQuery.throttle(60, this.watchHooters.bind(this)));
window.dispatchEvent(new Event('scroll'));
}},
setupHooter: function(isFooter){
var insertAction=isFooter ? 'insertAfter':'insertBefore',
element=isFooter ? 'footerElement':'headerElement',
wrapperClasses=[
classNames.innerWrapper,
isFooter ? classNames.innerWrapperFoot:classNames.innerWrapperHead
];
this[element].stickyClone=$(this[element]).clone(true)
.wrap($('<div></div>').css({
bottom: isFooter ? this.settings.bottom:'auto',
position: 'fixed',
top: !isFooter ? this.settings.top:'auto'
}).addClass(wrapperClasses.join(' '))
)
.wrap(function (){
var classNames=this.element.getAttribute('class');
if(this.isTable){
return $('<table></table>').addClass(classNames).css({
'table-layout': 'fixed'
});
}
return '';
}.bind(this)
).parents('.' + classNames.innerWrapper)
.css({
width: $(this.element).parent().width(),
display: 'none'
})
[insertAction](this.element)[0];
},
stick: function(elem){
elem.isStuck=true;
elem.style.visibility='hidden';
elem.stickyClone.style.display='block';
},
unstick: function(elem){
elem.isStuck=false;
elem.style.visibility='visible';
elem.stickyClone.style.display='none';
},
watchFooter: function(footer, header){
var footAdjust=parseInt(this.settings.bottom, 10),
footRect=footer.getBoundingClientRect(),
headRect=header.getBoundingClientRect(),
viewHeight=window.innerHeight;
if(footer.isStuck){
if(footRect.top <=viewHeight - footRect.height - footAdjust ||
headRect.bottom > viewHeight - footRect.height - footAdjust ||
!this.isVisible()){
this.unstick(footer);
}}else{
if(footRect.top > viewHeight - footRect.height - footAdjust &&
headRect.bottom <=viewHeight - footRect.height / 2 - footAdjust &&
this.isVisible()){
this.stick(footer);
}}
},
watchHeader: function(header, footer){
var headAdjust=parseInt(this.settings.top, 10),
footRect=footer ? footer.getBoundingClientRect():null,
headRect=header.getBoundingClientRect(),
footOffset=footRect ? footRect.top:this.element.getBoundingClientRect().bottom,
headHeight=footRect ? headRect.height / 2:headRect.height;
if(header.isStuck){
if(headRect.top > headAdjust||footOffset < headHeight + headAdjust){
this.unstick(header);
}}else{
if(headRect.top <=parseInt(this.settings.top, 10)&&footOffset > headHeight + headAdjust){
this.stick(header);
}}
},
watchHooters: function(){
if(!!this.footerElement){
this.watchFooter(this.footerElement, this.headerElement);
}
if(!!this.headerElement){
this.watchHeader(this.headerElement, this.footerElement);
}}
});
jQuery.fn[pluginName]=function(options){
return this.each(function(){
if(!$.data(this, 'plugin_' + pluginName)){
$.data(this, 'plugin_' + pluginName, new StickyHooters(this, options));
}});
};}})(jQuery, window, document);
(function(){var statifyReq;try{statifyReq=new XMLHttpRequest();statifyReq.open('POST',statify_ajax.url,!0);statifyReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');statifyReq.send('_ajax_nonce='+statify_ajax.nonce+'&action=statify_track'+'&statify_referrer='+encodeURIComponent(document.referrer)+'&statify_target='+encodeURIComponent(location.pathname+location.search))}catch(e){}}());
(()=>{var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{var t;e.g.importScripts&&(t=e.g.location+"");var r=e.g.document;if(!t&&r&&(r.currentScript&&(t=r.currentScript.src),!t)){var n=r.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].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";window.wp.domReady;const e=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:t(e),t=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},r=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,n=(t,n={})=>{var o,a,c;if(!1===(null!==(o=e("isShopperTrackingEnabled"))&&void 0!==o?o:r("is_shopper_tracking_enabled")))return;const i=null!==(a=e("platformTrackerNonce"))&&void 0!==a?a:r("nonce")?.platform_tracker,p=null!==(c=e("ajaxUrl"))&&void 0!==c?c:r("ajax_url"),s=new FormData;s.append("tracksNonce",i),s.append("action","platform_tracks"),s.append("tracksEventName",t),s.append("tracksEventProp",JSON.stringify(n)),fetch(p,{method:"post",body:s}).then((e=>e.json()))};if(window.wcPayFrontendTracks&&window.wcPayFrontendTracks.length){for(const e of window.wcPayFrontendTracks)n(e.event,e.properties);window.wcPayFrontendTracks=[]}})()})();