File "boot-block.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-applepay/assets/js/boot-block.js
File size: 209.7 KB
MIME-type: text/plain
Charset: utf-8
/*! For license information please see boot-block.js.LICENSE.txt */
(()=>{"use strict";var t={9457:t=>{var e=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===r}(t)}(t)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?c((r=t,Array.isArray(r)?[]:{}),t,e):t;var r}function o(t,e,r){return t.concat(e).map((function(t){return n(t,r)}))}function i(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return Object.propertyIsEnumerable.call(t,e)})):[]}(t))}function a(t,e){try{return e in t}catch(t){return!1}}function c(t,r,u){(u=u||{}).arrayMerge=u.arrayMerge||o,u.isMergeableObject=u.isMergeableObject||e,u.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(r);return s===Array.isArray(t)?s?u.arrayMerge(t,r,u):function(t,e,r){var o={};return r.isMergeableObject(t)&&i(t).forEach((function(e){o[e]=n(t[e],r)})),i(e).forEach((function(i){(function(t,e){return a(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(a(t,i)&&r.isMergeableObject(e[i])?o[i]=function(t,e){if(!e.customMerge)return c;var r=e.customMerge(t);return"function"==typeof r?r:c}(i,r)(t[i],e[i],r):o[i]=n(e[i],r))})),o}(t,r,u):n(r,u)}c.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,r){return c(t,r,e)}),{})};var u=c;t.exports=u},9306:(t,e,r)=>{var n=r(4901),o=r(6823),i=TypeError;t.exports=function(t){if(n(t))return t;throw new i(o(t)+" is not a function")}},5548:(t,e,r)=>{var n=r(3517),o=r(6823),i=TypeError;t.exports=function(t){if(n(t))return t;throw new i(o(t)+" is not a constructor")}},3506:(t,e,r)=>{var n=r(3925),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw new i("Can't set "+o(t)+" as a prototype")}},6469:(t,e,r)=>{var n=r(8227),o=r(2360),i=r(4913).f,a=n("unscopables"),c=Array.prototype;void 0===c[a]&&i(c,a,{configurable:!0,value:o(null)}),t.exports=function(t){c[a][t]=!0}},7829:(t,e,r)=>{var n=r(8183).charAt;t.exports=function(t,e,r){return e+(r?n(t,e).length:1)}},679:(t,e,r)=>{var n=r(1625),o=TypeError;t.exports=function(t,e){if(n(e,t))return t;throw new o("Incorrect invocation")}},8551:(t,e,r)=>{var n=r(34),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw new i(o(t)+" is not an object")}},5652:(t,e,r)=>{var n=r(9039);t.exports=n((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},235:(t,e,r)=>{var n=r(9213).forEach,o=r(4598)("forEach");t.exports=o?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},7916:(t,e,r)=>{var n=r(6080),o=r(9565),i=r(8981),a=r(6319),c=r(4209),u=r(3517),s=r(6198),l=r(2278),f=r(81),p=r(851),h=Array;t.exports=function(t){var e=i(t),r=u(this),d=arguments.length,y=d>1?arguments[1]:void 0,v=void 0!==y;v&&(y=n(y,d>2?arguments[2]:void 0));var g,m,b,w,x,S,_=p(e),E=0;if(!_||this===h&&c(_))for(g=s(e),m=r?new this(g):h(g);g>E;E++)S=v?y(e[E],E):e[E],l(m,E,S);else for(m=r?new this:[],x=(w=f(e,_)).next;!(b=o(x,w)).done;E++)S=v?a(w,y,[b.value,E],!0):b.value,l(m,E,S);return m.length=E,m}},9617:(t,e,r)=>{var n=r(5397),o=r(5610),i=r(6198),a=function(t){return function(e,r,a){var c=n(e),u=i(c);if(0===u)return!t&&-1;var s,l=o(a,u);if(t&&r!=r){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===r)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},9213:(t,e,r)=>{var n=r(6080),o=r(9504),i=r(7055),a=r(8981),c=r(6198),u=r(1469),s=o([].push),l=function(t){var e=1===t,r=2===t,o=3===t,l=4===t,f=6===t,p=7===t,h=5===t||f;return function(d,y,v,g){for(var m,b,w=a(d),x=i(w),S=c(x),_=n(y,v),E=0,j=g||u,O=e?j(d,S):r||p?j(d,0):void 0;S>E;E++)if((h||E in x)&&(b=_(m=x[E],E,w),t))if(e)O[E]=b;else if(b)switch(t){case 3:return!0;case 5:return m;case 6:return E;case 2:s(O,m)}else switch(t){case 4:return!1;case 7:s(O,m)}return f?-1:o||l?l:O}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},597:(t,e,r)=>{var n=r(9039),o=r(8227),i=r(9519),a=o("species");t.exports=function(t){return i>=51||!n((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},4598:(t,e,r)=>{var n=r(9039);t.exports=function(t,e){var r=[][t];return!!r&&n((function(){r.call(null,e||function(){return 1},1)}))}},4527:(t,e,r)=>{var n=r(3724),o=r(4376),i=TypeError,a=Object.getOwnPropertyDescriptor,c=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=c?function(t,e){if(o(t)&&!a(t,"length").writable)throw new i("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},7680:(t,e,r)=>{var n=r(9504);t.exports=n([].slice)},4488:(t,e,r)=>{var n=r(7680),o=Math.floor,i=function(t,e){var r=t.length;if(r<8)for(var a,c,u=1;u<r;){for(c=u,a=t[u];c&&e(t[c-1],a)>0;)t[c]=t[--c];c!==u++&&(t[c]=a)}else for(var s=o(r/2),l=i(n(t,0,s),e),f=i(n(t,s),e),p=l.length,h=f.length,d=0,y=0;d<p||y<h;)t[d+y]=d<p&&y<h?e(l[d],f[y])<=0?l[d++]:f[y++]:d<p?l[d++]:f[y++];return t};t.exports=i},7433:(t,e,r)=>{var n=r(4376),o=r(3517),i=r(34),a=r(8227)("species"),c=Array;t.exports=function(t){var e;return n(t)&&(e=t.constructor,(o(e)&&(e===c||n(e.prototype))||i(e)&&null===(e=e[a]))&&(e=void 0)),void 0===e?c:e}},1469:(t,e,r)=>{var n=r(7433);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},6319:(t,e,r)=>{var n=r(8551),o=r(9539);t.exports=function(t,e,r,i){try{return i?e(n(r)[0],r[1]):e(r)}catch(e){o(t,"throw",e)}}},4428:(t,e,r)=>{var n=r(8227)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){try{if(!e&&!o)return!1}catch(t){return!1}var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},t(i)}catch(t){}return r}},2195:(t,e,r)=>{var n=r(9504),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},6955:(t,e,r)=>{var n=r(2140),o=r(4901),i=r(2195),a=r(8227)("toStringTag"),c=Object,u="Arguments"===i(function(){return arguments}());t.exports=n?i:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=c(t),a))?r:u?i(e):"Object"===(n=i(e))&&o(e.callee)?"Arguments":n}},4006:(t,e,r)=>{var n=r(9504),o=r(6279),i=r(3451).getWeakData,a=r(679),c=r(8551),u=r(4117),s=r(34),l=r(2652),f=r(9213),p=r(9297),h=r(1181),d=h.set,y=h.getterFor,v=f.find,g=f.findIndex,m=n([].splice),b=0,w=function(t){return t.frozen||(t.frozen=new x)},x=function(){this.entries=[]},S=function(t,e){return v(t.entries,(function(t){return t[0]===e}))};x.prototype={get:function(t){var e=S(this,t);if(e)return e[1]},has:function(t){return!!S(this,t)},set:function(t,e){var r=S(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=g(this.entries,(function(e){return e[0]===t}));return~e&&m(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,r,n){var f=t((function(t,o){a(t,h),d(t,{type:e,id:b++,frozen:null}),u(o)||l(o,t[n],{that:t,AS_ENTRIES:r})})),h=f.prototype,v=y(e),g=function(t,e,r){var n=v(t),o=i(c(e),!0);return!0===o?w(n).set(e,r):o[n.id]=r,t};return o(h,{delete:function(t){var e=v(this);if(!s(t))return!1;var r=i(t);return!0===r?w(e).delete(t):r&&p(r,e.id)&&delete r[e.id]},has:function(t){var e=v(this);if(!s(t))return!1;var r=i(t);return!0===r?w(e).has(t):r&&p(r,e.id)}}),o(h,r?{get:function(t){var e=v(this);if(s(t)){var r=i(t);if(!0===r)return w(e).get(t);if(r)return r[e.id]}},set:function(t,e){return g(this,t,e)}}:{add:function(t){return g(this,t,!0)}}),f}}},6468:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(9504),a=r(2796),c=r(6840),u=r(3451),s=r(2652),l=r(679),f=r(4901),p=r(4117),h=r(34),d=r(9039),y=r(4428),v=r(687),g=r(3167);t.exports=function(t,e,r){var m=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),w=m?"set":"add",x=o[t],S=x&&x.prototype,_=x,E={},j=function(t){var e=i(S[t]);c(S,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(b&&!h(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return b&&!h(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(b&&!h(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(a(t,!f(x)||!(b||S.forEach&&!d((function(){(new x).entries().next()})))))_=r.getConstructor(e,t,m,w),u.enable();else if(a(t,!0)){var O=new _,P=O[w](b?{}:-0,1)!==O,k=d((function(){O.has(1)})),C=y((function(t){new x(t)})),A=!b&&d((function(){for(var t=new x,e=5;e--;)t[w](e,e);return!t.has(-0)}));C||((_=e((function(t,e){l(t,S);var r=g(new x,t,_);return p(e)||s(e,r[w],{that:r,AS_ENTRIES:m}),r}))).prototype=S,S.constructor=_),(k||A)&&(j("delete"),j("has"),m&&j("get")),(A||P)&&j(w),b&&S.clear&&delete S.clear}return E[t]=_,n({global:!0,constructor:!0,forced:_!==x},E),v(_,t),b||r.setStrong(_,t,m),_}},7740:(t,e,r)=>{var n=r(9297),o=r(5031),i=r(7347),a=r(4913);t.exports=function(t,e,r){for(var c=o(e),u=a.f,s=i.f,l=0;l<c.length;l++){var f=c[l];n(t,f)||r&&n(r,f)||u(t,f,s(e,f))}}},2211:(t,e,r)=>{var n=r(9039);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},2529:t=>{t.exports=function(t,e){return{value:t,done:e}}},6699:(t,e,r)=>{var n=r(3724),o=r(4913),i=r(6980);t.exports=n?function(t,e,r){return o.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},6980:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},2278:(t,e,r)=>{var n=r(3724),o=r(4913),i=r(6980);t.exports=function(t,e,r){n?o.f(t,e,i(0,r)):t[e]=r}},3640:(t,e,r)=>{var n=r(8551),o=r(4270),i=TypeError;t.exports=function(t){if(n(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new i("Incorrect hint");return o(this,t)}},2106:(t,e,r)=>{var n=r(283),o=r(4913);t.exports=function(t,e,r){return r.get&&n(r.get,e,{getter:!0}),r.set&&n(r.set,e,{setter:!0}),o.f(t,e,r)}},6840:(t,e,r)=>{var n=r(4901),o=r(4913),i=r(283),a=r(9433);t.exports=function(t,e,r,c){c||(c={});var u=c.enumerable,s=void 0!==c.name?c.name:e;if(n(r)&&i(r,s,c),c.global)u?t[e]=r:a(e,r);else{try{c.unsafe?t[e]&&(u=!0):delete t[e]}catch(t){}u?t[e]=r:o.f(t,e,{value:r,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return t}},6279:(t,e,r)=>{var n=r(6840);t.exports=function(t,e,r){for(var o in e)n(t,o,e[o],r);return t}},9433:(t,e,r)=>{var n=r(4576),o=Object.defineProperty;t.exports=function(t,e){try{o(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},4606:(t,e,r)=>{var n=r(6823),o=TypeError;t.exports=function(t,e){if(!delete t[e])throw new o("Cannot delete property "+n(e)+" of "+n(t))}},3724:(t,e,r)=>{var n=r(9039);t.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:(t,e,r)=>{var n=r(4576),o=r(34),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},6837:t=>{var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},7400:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},9296:(t,e,r)=>{var n=r(4055)("span").classList,o=n&&n.constructor&&n.constructor.prototype;t.exports=o===Object.prototype?void 0:o},8727:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3709:(t,e,r)=>{var n=r(2839).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},3763:(t,e,r)=>{var n=r(2839);t.exports=/MSIE|Trident/.test(n)},4265:(t,e,r)=>{var n=r(2839);t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},9544:(t,e,r)=>{var n=r(2839);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},8574:(t,e,r)=>{var n=r(4215);t.exports="NODE"===n},7860:(t,e,r)=>{var n=r(2839);t.exports=/web0s(?!.*chrome)/i.test(n)},2839:(t,e,r)=>{var n=r(4576).navigator,o=n&&n.userAgent;t.exports=o?String(o):""},9519:(t,e,r)=>{var n,o,i=r(4576),a=r(2839),c=i.process,u=i.Deno,s=c&&c.versions||u&&u.version,l=s&&s.v8;l&&(o=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},3607:(t,e,r)=>{var n=r(2839).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},4215:(t,e,r)=>{var n=r(4576),o=r(2839),i=r(2195),a=function(t){return o.slice(0,t.length)===t};t.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},6193:(t,e,r)=>{var n=r(9504),o=Error,i=n("".replace),a=String(new o("zxcasd").stack),c=/\n\s*at [^:]*:[^\n]*/,u=c.test(a);t.exports=function(t,e){if(u&&"string"==typeof t&&!o.prepareStackTrace)for(;e--;)t=i(t,c,"");return t}},747:(t,e,r)=>{var n=r(6699),o=r(6193),i=r(4659),a=Error.captureStackTrace;t.exports=function(t,e,r,c){i&&(a?a(t,e):n(t,"stack",o(r,c)))}},4659:(t,e,r)=>{var n=r(9039),o=r(6980);t.exports=!n((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)}))},6518:(t,e,r)=>{var n=r(4576),o=r(7347).f,i=r(6699),a=r(6840),c=r(9433),u=r(7740),s=r(2796);t.exports=function(t,e){var r,l,f,p,h,d=t.target,y=t.global,v=t.stat;if(r=y?n:v?n[d]||c(d,{}):n[d]&&n[d].prototype)for(l in e){if(p=e[l],f=t.dontCallGetSet?(h=o(r,l))&&h.value:r[l],!s(y?l:d+(v?".":"#")+l,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),a(r,l,p,t)}}},9039:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},9228:(t,e,r)=>{r(7495);var n=r(9565),o=r(6840),i=r(7323),a=r(9039),c=r(8227),u=r(6699),s=c("species"),l=RegExp.prototype;t.exports=function(t,e,r,f){var p=c(t),h=!a((function(){var e={};return e[p]=function(){return 7},7!==""[t](e)})),d=h&&!a((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[s]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return e=!0,null},r[p](""),!e}));if(!h||!d||r){var y=/./[p],v=e(p,""[t],(function(t,e,r,o,a){var c=e.exec;return c===i||c===l.exec?h&&!a?{done:!0,value:n(y,e,r,o)}:{done:!0,value:n(t,r,e,o)}:{done:!1}}));o(String.prototype,t,v[0]),o(l,p,v[1])}f&&u(l[p],"sham",!0)}},2744:(t,e,r)=>{var n=r(9039);t.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},8745:(t,e,r)=>{var n=r(616),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},6080:(t,e,r)=>{var n=r(7476),o=r(9306),i=r(616),a=n(n.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?a(t,e):function(){return t.apply(e,arguments)}}},616:(t,e,r)=>{var n=r(9039);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},566:(t,e,r)=>{var n=r(9504),o=r(9306),i=r(34),a=r(9297),c=r(7680),u=r(616),s=Function,l=n([].concat),f=n([].join),p={};t.exports=u?s.bind:function(t){var e=o(this),r=e.prototype,n=c(arguments,1),u=function(){var r=l(n,c(arguments));return this instanceof u?function(t,e,r){if(!a(p,e)){for(var n=[],o=0;o<e;o++)n[o]="a["+o+"]";p[e]=s("C,a","return new C("+f(n,",")+")")}return p[e](t,r)}(e,r.length,r):e.apply(t,r)};return i(r)&&(u.prototype=r),u}},9565:(t,e,r)=>{var n=r(616),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},350:(t,e,r)=>{var n=r(3724),o=r(9297),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,c=o(i,"name"),u=c&&"something"===function(){}.name,s=c&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:c,PROPER:u,CONFIGURABLE:s}},6706:(t,e,r)=>{var n=r(9504),o=r(9306);t.exports=function(t,e,r){try{return n(o(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},7476:(t,e,r)=>{var n=r(2195),o=r(9504);t.exports=function(t){if("Function"===n(t))return o(t)}},9504:(t,e,r)=>{var n=r(616),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);t.exports=n?a:function(t){return function(){return i.apply(t,arguments)}}},7751:(t,e,r)=>{var n=r(4576),o=r(4901);t.exports=function(t,e){return arguments.length<2?(r=n[t],o(r)?r:void 0):n[t]&&n[t][e];var r}},1767:t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},851:(t,e,r)=>{var n=r(6955),o=r(5966),i=r(4117),a=r(6269),c=r(8227)("iterator");t.exports=function(t){if(!i(t))return o(t,c)||o(t,"@@iterator")||a[n(t)]}},81:(t,e,r)=>{var n=r(9565),o=r(9306),i=r(8551),a=r(6823),c=r(851),u=TypeError;t.exports=function(t,e){var r=arguments.length<2?c(t):e;if(o(r))return i(n(r,t));throw new u(a(t)+" is not iterable")}},6933:(t,e,r)=>{var n=r(9504),o=r(4376),i=r(4901),a=r(2195),c=r(655),u=n([].push);t.exports=function(t){if(i(t))return t;if(o(t)){for(var e=t.length,r=[],n=0;n<e;n++){var s=t[n];"string"==typeof s?u(r,s):"number"!=typeof s&&"Number"!==a(s)&&"String"!==a(s)||u(r,c(s))}var l=r.length,f=!0;return function(t,e){if(f)return f=!1,e;if(o(this))return e;for(var n=0;n<l;n++)if(r[n]===t)return e}}}},5966:(t,e,r)=>{var n=r(9306),o=r(4117);t.exports=function(t,e){var r=t[e];return o(r)?void 0:n(r)}},2478:(t,e,r)=>{var n=r(9504),o=r(8981),i=Math.floor,a=n("".charAt),c=n("".replace),u=n("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,n,f,p){var h=r+t.length,d=n.length,y=l;return void 0!==f&&(f=o(f),y=s),c(p,y,(function(o,c){var s;switch(a(c,0)){case"$":return"$";case"&":return t;case"`":return u(e,0,r);case"'":return u(e,h);case"<":s=f[u(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>d){var p=i(l/10);return 0===p?o:p<=d?void 0===n[p-1]?a(c,1):n[p-1]+a(c,1):o}s=n[l-1]}return void 0===s?"":s}))}},4576:function(t,e,r){var n=function(t){return t&&t.Math===Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:(t,e,r)=>{var n=r(9504),o=r(8981),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},421:t=>{t.exports={}},3138:t=>{t.exports=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}},397:(t,e,r)=>{var n=r(7751);t.exports=n("document","documentElement")},5917:(t,e,r)=>{var n=r(3724),o=r(9039),i=r(4055);t.exports=!n&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7055:(t,e,r)=>{var n=r(9504),o=r(9039),i=r(2195),a=Object,c=n("".split);t.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"===i(t)?c(t,""):a(t)}:a},3167:(t,e,r)=>{var n=r(4901),o=r(34),i=r(2967);t.exports=function(t,e,r){var a,c;return i&&n(a=e.constructor)&&a!==r&&o(c=a.prototype)&&c!==r.prototype&&i(t,c),t}},3706:(t,e,r)=>{var n=r(9504),o=r(4901),i=r(7629),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},7584:(t,e,r)=>{var n=r(34),o=r(6699);t.exports=function(t,e){n(e)&&"cause"in e&&o(t,"cause",e.cause)}},3451:(t,e,r)=>{var n=r(6518),o=r(9504),i=r(421),a=r(34),c=r(9297),u=r(4913).f,s=r(8480),l=r(298),f=r(4124),p=r(3392),h=r(2744),d=!1,y=p("meta"),v=0,g=function(t){u(t,y,{value:{objectID:"O"+v++,weakData:{}}})},m=t.exports={enable:function(){m.enable=function(){},d=!0;var t=s.f,e=o([].splice),r={};r[y]=1,t(r).length&&(s.f=function(r){for(var n=t(r),o=0,i=n.length;o<i;o++)if(n[o]===y){e(n,o,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(t,e){if(!a(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!c(t,y)){if(!f(t))return"F";if(!e)return"E";g(t)}return t[y].objectID},getWeakData:function(t,e){if(!c(t,y)){if(!f(t))return!0;if(!e)return!1;g(t)}return t[y].weakData},onFreeze:function(t){return h&&d&&f(t)&&!c(t,y)&&g(t),t}};i[y]=!0},1181:(t,e,r)=>{var n,o,i,a=r(8622),c=r(4576),u=r(34),s=r(6699),l=r(9297),f=r(7629),p=r(6119),h=r(421),d="Object already initialized",y=c.TypeError,v=c.WeakMap;if(a||f.state){var g=f.state||(f.state=new v);g.get=g.get,g.has=g.has,g.set=g.set,n=function(t,e){if(g.has(t))throw new y(d);return e.facade=t,g.set(t,e),e},o=function(t){return g.get(t)||{}},i=function(t){return g.has(t)}}else{var m=p("state");h[m]=!0,n=function(t,e){if(l(t,m))throw new y(d);return e.facade=t,s(t,m,e),e},o=function(t){return l(t,m)?t[m]:{}},i=function(t){return l(t,m)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!u(e)||(r=o(e)).type!==t)throw new y("Incompatible receiver, "+t+" required");return r}}}},4209:(t,e,r)=>{var n=r(8227),o=r(6269),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},4376:(t,e,r)=>{var n=r(2195);t.exports=Array.isArray||function(t){return"Array"===n(t)}},4901:t=>{var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},3517:(t,e,r)=>{var n=r(9504),o=r(9039),i=r(4901),a=r(6955),c=r(7751),u=r(3706),s=function(){},l=c("Reflect","construct"),f=/^\s*(?:class|function)\b/,p=n(f.exec),h=!f.test(s),d=function(t){if(!i(t))return!1;try{return l(s,[],t),!0}catch(t){return!1}},y=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(f,u(t))}catch(t){return!0}};y.sham=!0,t.exports=!l||o((function(){var t;return d(d.call)||!d(Object)||!d((function(){t=!0}))||t}))?y:d},6575:(t,e,r)=>{var n=r(9297);t.exports=function(t){return void 0!==t&&(n(t,"value")||n(t,"writable"))}},2796:(t,e,r)=>{var n=r(9039),o=r(4901),i=/#|\.prototype\./,a=function(t,e){var r=u[c(t)];return r===l||r!==s&&(o(e)?n(e):!!e)},c=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},s=a.NATIVE="N",l=a.POLYFILL="P";t.exports=a},4117:t=>{t.exports=function(t){return null==t}},34:(t,e,r)=>{var n=r(4901);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},3925:(t,e,r)=>{var n=r(34);t.exports=function(t){return n(t)||null===t}},6395:t=>{t.exports=!1},757:(t,e,r)=>{var n=r(7751),o=r(4901),i=r(1625),a=r(7040),c=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return o(e)&&i(e.prototype,c(t))}},2652:(t,e,r)=>{var n=r(6080),o=r(9565),i=r(8551),a=r(6823),c=r(4209),u=r(6198),s=r(1625),l=r(81),f=r(851),p=r(9539),h=TypeError,d=function(t,e){this.stopped=t,this.result=e},y=d.prototype;t.exports=function(t,e,r){var v,g,m,b,w,x,S,_=r&&r.that,E=!(!r||!r.AS_ENTRIES),j=!(!r||!r.IS_RECORD),O=!(!r||!r.IS_ITERATOR),P=!(!r||!r.INTERRUPTED),k=n(e,_),C=function(t){return v&&p(v,"normal",t),new d(!0,t)},A=function(t){return E?(i(t),P?k(t[0],t[1],C):k(t[0],t[1])):P?k(t,C):k(t)};if(j)v=t.iterator;else if(O)v=t;else{if(!(g=f(t)))throw new h(a(t)+" is not iterable");if(c(g)){for(m=0,b=u(t);b>m;m++)if((w=A(t[m]))&&s(y,w))return w;return new d(!1)}v=l(t,g)}for(x=j?t.next:v.next;!(S=o(x,v)).done;){try{w=A(S.value)}catch(t){p(v,"throw",t)}if("object"==typeof w&&w&&s(y,w))return w}return new d(!1)}},9539:(t,e,r)=>{var n=r(9565),o=r(8551),i=r(5966);t.exports=function(t,e,r){var a,c;o(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw r;return r}a=n(a,t)}catch(t){c=!0,a=t}if("throw"===e)throw r;if(c)throw a;return o(a),r}},3994:(t,e,r)=>{var n=r(7657).IteratorPrototype,o=r(2360),i=r(6980),a=r(687),c=r(6269),u=function(){return this};t.exports=function(t,e,r,s){var l=e+" Iterator";return t.prototype=o(n,{next:i(+!s,r)}),a(t,l,!1,!0),c[l]=u,t}},1088:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(6395),a=r(350),c=r(4901),u=r(3994),s=r(2787),l=r(2967),f=r(687),p=r(6699),h=r(6840),d=r(8227),y=r(6269),v=r(7657),g=a.PROPER,m=a.CONFIGURABLE,b=v.IteratorPrototype,w=v.BUGGY_SAFARI_ITERATORS,x=d("iterator"),S="keys",_="values",E="entries",j=function(){return this};t.exports=function(t,e,r,a,d,v,O){u(r,e,a);var P,k,C,A=function(t){if(t===d&&M)return M;if(!w&&t&&t in I)return I[t];switch(t){case S:case _:case E:return function(){return new r(this,t)}}return function(){return new r(this)}},L=e+" Iterator",T=!1,I=t.prototype,R=I[x]||I["@@iterator"]||d&&I[d],M=!w&&R||A(d),N="Array"===e&&I.entries||R;if(N&&(P=s(N.call(new t)))!==Object.prototype&&P.next&&(i||s(P)===b||(l?l(P,b):c(P[x])||h(P,x,j)),f(P,L,!0,!0),i&&(y[L]=j)),g&&d===_&&R&&R.name!==_&&(!i&&m?p(I,"name",_):(T=!0,M=function(){return o(R,this)})),d)if(k={values:A(_),keys:v?M:A(S),entries:A(E)},O)for(C in k)(w||T||!(C in I))&&h(I,C,k[C]);else n({target:e,proto:!0,forced:w||T},k);return i&&!O||I[x]===M||h(I,x,M,{name:d}),y[e]=M,k}},7657:(t,e,r)=>{var n,o,i,a=r(9039),c=r(4901),u=r(34),s=r(2360),l=r(2787),f=r(6840),p=r(8227),h=r(6395),d=p("iterator"),y=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(n=o):y=!0),!u(n)||a((function(){var t={};return n[d].call(t)!==t}))?n={}:h&&(n=s(n)),c(n[d])||f(n,d,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:y}},6269:t=>{t.exports={}},6198:(t,e,r)=>{var n=r(8014);t.exports=function(t){return n(t.length)}},283:(t,e,r)=>{var n=r(9504),o=r(9039),i=r(4901),a=r(9297),c=r(3724),u=r(350).CONFIGURABLE,s=r(3706),l=r(1181),f=l.enforce,p=l.get,h=String,d=Object.defineProperty,y=n("".slice),v=n("".replace),g=n([].join),m=c&&!o((function(){return 8!==d((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=t.exports=function(t,e,r){"Symbol("===y(h(e),0,7)&&(e="["+v(h(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!a(t,"name")||u&&t.name!==e)&&(c?d(t,"name",{value:e,configurable:!0}):t.name=e),m&&r&&a(r,"arity")&&t.length!==r.arity&&d(t,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?c&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=f(t);return a(n,"source")||(n.source=g(b,"string"==typeof e?e:"")),t};Function.prototype.toString=w((function(){return i(this)&&p(this).source||s(this)}),"toString")},741:t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},1955:(t,e,r)=>{var n,o,i,a,c,u=r(4576),s=r(3389),l=r(6080),f=r(9225).set,p=r(8265),h=r(9544),d=r(4265),y=r(7860),v=r(8574),g=u.MutationObserver||u.WebKitMutationObserver,m=u.document,b=u.process,w=u.Promise,x=s("queueMicrotask");if(!x){var S=new p,_=function(){var t,e;for(v&&(t=b.domain)&&t.exit();e=S.get();)try{e()}catch(t){throw S.head&&n(),t}t&&t.enter()};h||v||y||!g||!m?!d&&w&&w.resolve?((a=w.resolve(void 0)).constructor=w,c=l(a.then,a),n=function(){c(_)}):v?n=function(){b.nextTick(_)}:(f=l(f,u),n=function(){f(_)}):(o=!0,i=m.createTextNode(""),new g(_).observe(i,{characterData:!0}),n=function(){i.data=o=!o}),x=function(t){S.head||n(),S.add(t)}}t.exports=x},6043:(t,e,r)=>{var n=r(9306),o=TypeError,i=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw new o("Bad Promise constructor");e=t,r=n})),this.resolve=n(e),this.reject=n(r)};t.exports.f=function(t){return new i(t)}},2603:(t,e,r)=>{var n=r(655);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:n(t)}},4213:(t,e,r)=>{var n=r(3724),o=r(9504),i=r(9565),a=r(9039),c=r(1072),u=r(3717),s=r(8773),l=r(8981),f=r(7055),p=Object.assign,h=Object.defineProperty,d=o([].concat);t.exports=!p||a((function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection"),o="abcdefghijklmnopqrst";return t[r]=7,o.split("").forEach((function(t){e[t]=t})),7!==p({},t)[r]||c(p({},e)).join("")!==o}))?function(t,e){for(var r=l(t),o=arguments.length,a=1,p=u.f,h=s.f;o>a;)for(var y,v=f(arguments[a++]),g=p?d(c(v),p(v)):c(v),m=g.length,b=0;m>b;)y=g[b++],n&&!i(h,v,y)||(r[y]=v[y]);return r}:p},2360:(t,e,r)=>{var n,o=r(8551),i=r(6801),a=r(8727),c=r(421),u=r(397),s=r(4055),l=r(6119),f="prototype",p="script",h=l("IE_PROTO"),d=function(){},y=function(t){return"<"+p+">"+t+"</"+p+">"},v=function(t){t.write(y("")),t.close();var e=t.parentWindow.Object;return t=null,e},g=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;g="undefined"!=typeof document?document.domain&&n?v(n):(e=s("iframe"),r="java"+p+":",e.style.display="none",u.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(y("document.F=Object")),t.close(),t.F):v(n);for(var o=a.length;o--;)delete g[f][a[o]];return g()};c[h]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(d[f]=o(t),r=new d,d[f]=null,r[h]=t):r=g(),void 0===e?r:i.f(r,e)}},6801:(t,e,r)=>{var n=r(3724),o=r(8686),i=r(4913),a=r(8551),c=r(5397),u=r(1072);e.f=n&&!o?Object.defineProperties:function(t,e){a(t);for(var r,n=c(e),o=u(e),s=o.length,l=0;s>l;)i.f(t,r=o[l++],n[r]);return t}},4913:(t,e,r)=>{var n=r(3724),o=r(5917),i=r(8686),a=r(8551),c=r(6969),u=TypeError,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",p="configurable",h="writable";e.f=n?i?function(t,e,r){if(a(t),e=c(e),a(r),"function"==typeof t&&"prototype"===e&&"value"in r&&h in r&&!r[h]){var n=l(t,e);n&&n[h]&&(t[e]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:f in r?r[f]:n[f],writable:!1})}return s(t,e,r)}:s:function(t,e,r){if(a(t),e=c(e),a(r),o)try{return s(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},7347:(t,e,r)=>{var n=r(3724),o=r(9565),i=r(8773),a=r(6980),c=r(5397),u=r(6969),s=r(9297),l=r(5917),f=Object.getOwnPropertyDescriptor;e.f=n?f:function(t,e){if(t=c(t),e=u(e),l)try{return f(t,e)}catch(t){}if(s(t,e))return a(!o(i.f,t,e),t[e])}},298:(t,e,r)=>{var n=r(2195),o=r(5397),i=r(8480).f,a=r(7680),c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return c&&"Window"===n(t)?function(t){try{return i(t)}catch(t){return a(c)}}(t):i(o(t))}},8480:(t,e,r)=>{var n=r(1828),o=r(8727).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},3717:(t,e)=>{e.f=Object.getOwnPropertySymbols},2787:(t,e,r)=>{var n=r(9297),o=r(4901),i=r(8981),a=r(6119),c=r(2211),u=a("IE_PROTO"),s=Object,l=s.prototype;t.exports=c?s.getPrototypeOf:function(t){var e=i(t);if(n(e,u))return e[u];var r=e.constructor;return o(r)&&e instanceof r?r.prototype:e instanceof s?l:null}},4124:(t,e,r)=>{var n=r(9039),o=r(34),i=r(2195),a=r(5652),c=Object.isExtensible,u=n((function(){c(1)}));t.exports=u||a?function(t){return!!o(t)&&(!a||"ArrayBuffer"!==i(t))&&(!c||c(t))}:c},1625:(t,e,r)=>{var n=r(9504);t.exports=n({}.isPrototypeOf)},1828:(t,e,r)=>{var n=r(9504),o=r(9297),i=r(5397),a=r(9617).indexOf,c=r(421),u=n([].push);t.exports=function(t,e){var r,n=i(t),s=0,l=[];for(r in n)!o(c,r)&&o(n,r)&&u(l,r);for(;e.length>s;)o(n,r=e[s++])&&(~a(l,r)||u(l,r));return l}},1072:(t,e,r)=>{var n=r(1828),o=r(8727);t.exports=Object.keys||function(t){return n(t,o)}},8773:(t,e)=>{var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},2967:(t,e,r)=>{var n=r(6706),o=r(34),i=r(7750),a=r(3506);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=n(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return i(r),a(n),o(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0)},3179:(t,e,r)=>{var n=r(2140),o=r(6955);t.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},4270:(t,e,r)=>{var n=r(9565),o=r(4901),i=r(34),a=TypeError;t.exports=function(t,e){var r,c;if("string"===e&&o(r=t.toString)&&!i(c=n(r,t)))return c;if(o(r=t.valueOf)&&!i(c=n(r,t)))return c;if("string"!==e&&o(r=t.toString)&&!i(c=n(r,t)))return c;throw new a("Can't convert object to primitive value")}},5031:(t,e,r)=>{var n=r(7751),o=r(9504),i=r(8480),a=r(3717),c=r(8551),u=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(c(t)),r=a.f;return r?u(e,r(t)):e}},9167:(t,e,r)=>{var n=r(4576);t.exports=n},1103:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},916:(t,e,r)=>{var n=r(4576),o=r(550),i=r(4901),a=r(2796),c=r(3706),u=r(8227),s=r(4215),l=r(6395),f=r(9519),p=o&&o.prototype,h=u("species"),d=!1,y=i(n.PromiseRejectionEvent),v=a("Promise",(function(){var t=c(o),e=t!==String(o);if(!e&&66===f)return!0;if(l&&(!p.catch||!p.finally))return!0;if(!f||f<51||!/native code/.test(t)){var r=new o((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[h]=n,!(d=r.then((function(){}))instanceof n))return!0}return!(e||"BROWSER"!==s&&"DENO"!==s||y)}));t.exports={CONSTRUCTOR:v,REJECTION_EVENT:y,SUBCLASSING:d}},550:(t,e,r)=>{var n=r(4576);t.exports=n.Promise},3438:(t,e,r)=>{var n=r(8551),o=r(34),i=r(6043);t.exports=function(t,e){if(n(t),o(e)&&e.constructor===t)return e;var r=i.f(t);return(0,r.resolve)(e),r.promise}},537:(t,e,r)=>{var n=r(550),o=r(4428),i=r(916).CONSTRUCTOR;t.exports=i||!o((function(t){n.all(t).then(void 0,(function(){}))}))},1056:(t,e,r)=>{var n=r(4913).f;t.exports=function(t,e,r){r in t||n(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},8265:t=>{var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=e},6682:(t,e,r)=>{var n=r(9565),o=r(8551),i=r(4901),a=r(2195),c=r(7323),u=TypeError;t.exports=function(t,e){var r=t.exec;if(i(r)){var s=n(r,t,e);return null!==s&&o(s),s}if("RegExp"===a(t))return n(c,t,e);throw new u("RegExp#exec called on incompatible receiver")}},7323:(t,e,r)=>{var n,o,i=r(9565),a=r(9504),c=r(655),u=r(7979),s=r(8429),l=r(5745),f=r(2360),p=r(1181).get,h=r(3635),d=r(8814),y=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,g=v,m=a("".charAt),b=a("".indexOf),w=a("".replace),x=a("".slice),S=(o=/b*/g,i(v,n=/a/,"a"),i(v,o,"a"),0!==n.lastIndex||0!==o.lastIndex),_=s.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(S||E||_||h||d)&&(g=function(t){var e,r,n,o,a,s,l,h=this,d=p(h),j=c(t),O=d.raw;if(O)return O.lastIndex=h.lastIndex,e=i(g,O,j),h.lastIndex=O.lastIndex,e;var P=d.groups,k=_&&h.sticky,C=i(u,h),A=h.source,L=0,T=j;if(k&&(C=w(C,"y",""),-1===b(C,"g")&&(C+="g"),T=x(j,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==m(j,h.lastIndex-1))&&(A="(?: "+A+")",T=" "+T,L++),r=new RegExp("^(?:"+A+")",C)),E&&(r=new RegExp("^"+A+"$(?!\\s)",C)),S&&(n=h.lastIndex),o=i(v,k?r:h,T),k?o?(o.input=x(o.input,L),o[0]=x(o[0],L),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:S&&o&&(h.lastIndex=h.global?o.index+o[0].length:n),E&&o&&o.length>1&&i(y,o[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o&&P)for(o.groups=s=f(null),a=0;a<P.length;a++)s[(l=P[a])[0]]=o[l[1]];return o}),t.exports=g},7979:(t,e,r)=>{var n=r(8551);t.exports=function(){var t=n(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},1034:(t,e,r)=>{var n=r(9565),o=r(9297),i=r(1625),a=r(7979),c=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in c||o(t,"flags")||!i(c,t)?e:n(a,t)}},8429:(t,e,r)=>{var n=r(9039),o=r(4576).RegExp,i=n((function(){var t=o("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),a=i||n((function(){return!o("a","y").sticky})),c=i||n((function(){var t=o("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));t.exports={BROKEN_CARET:c,MISSED_STICKY:a,UNSUPPORTED_Y:i}},3635:(t,e,r)=>{var n=r(9039),o=r(4576).RegExp;t.exports=n((function(){var t=o(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},8814:(t,e,r)=>{var n=r(9039),o=r(4576).RegExp;t.exports=n((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},7750:(t,e,r)=>{var n=r(4117),o=TypeError;t.exports=function(t){if(n(t))throw new o("Can't call method on "+t);return t}},3389:(t,e,r)=>{var n=r(4576),o=r(3724),i=Object.getOwnPropertyDescriptor;t.exports=function(t){if(!o)return n[t];var e=i(n,t);return e&&e.value}},7633:(t,e,r)=>{var n=r(7751),o=r(2106),i=r(8227),a=r(3724),c=i("species");t.exports=function(t){var e=n(t);a&&e&&!e[c]&&o(e,c,{configurable:!0,get:function(){return this}})}},687:(t,e,r)=>{var n=r(4913).f,o=r(9297),i=r(8227)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:e})}},6119:(t,e,r)=>{var n=r(5745),o=r(3392),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},7629:(t,e,r)=>{var n=r(6395),o=r(4576),i=r(9433),a="__core-js_shared__",c=t.exports=o[a]||i(a,{});(c.versions||(c.versions=[])).push({version:"3.39.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(t,e,r)=>{var n=r(7629);t.exports=function(t,e){return n[t]||(n[t]=e||{})}},2293:(t,e,r)=>{var n=r(8551),o=r(5548),i=r(4117),a=r(8227)("species");t.exports=function(t,e){var r,c=n(t).constructor;return void 0===c||i(r=n(c)[a])?e:o(r)}},8183:(t,e,r)=>{var n=r(9504),o=r(1291),i=r(655),a=r(7750),c=n("".charAt),u=n("".charCodeAt),s=n("".slice),l=function(t){return function(e,r){var n,l,f=i(a(e)),p=o(r),h=f.length;return p<0||p>=h?t?"":void 0:(n=u(f,p))<55296||n>56319||p+1===h||(l=u(f,p+1))<56320||l>57343?t?c(f,p):n:t?s(f,p,p+2):l-56320+(n-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},3802:(t,e,r)=>{var n=r(9504),o=r(7750),i=r(655),a=r(7452),c=n("".replace),u=RegExp("^["+a+"]+"),s=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(t){return function(e){var r=i(o(e));return 1&t&&(r=c(r,u,"")),2&t&&(r=c(r,s,"$1")),r}};t.exports={start:l(1),end:l(2),trim:l(3)}},4495:(t,e,r)=>{var n=r(9519),o=r(9039),i=r(4576).String;t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8242:(t,e,r)=>{var n=r(9565),o=r(7751),i=r(8227),a=r(6840);t.exports=function(){var t=o("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,c=i("toPrimitive");e&&!e[c]&&a(e,c,(function(t){return n(r,this)}),{arity:1})}},1296:(t,e,r)=>{var n=r(4495);t.exports=n&&!!Symbol.for&&!!Symbol.keyFor},9225:(t,e,r)=>{var n,o,i,a,c=r(4576),u=r(8745),s=r(6080),l=r(4901),f=r(9297),p=r(9039),h=r(397),d=r(7680),y=r(4055),v=r(2812),g=r(9544),m=r(8574),b=c.setImmediate,w=c.clearImmediate,x=c.process,S=c.Dispatch,_=c.Function,E=c.MessageChannel,j=c.String,O=0,P={},k="onreadystatechange";p((function(){n=c.location}));var C=function(t){if(f(P,t)){var e=P[t];delete P[t],e()}},A=function(t){return function(){C(t)}},L=function(t){C(t.data)},T=function(t){c.postMessage(j(t),n.protocol+"//"+n.host)};b&&w||(b=function(t){v(arguments.length,1);var e=l(t)?t:_(t),r=d(arguments,1);return P[++O]=function(){u(e,void 0,r)},o(O),O},w=function(t){delete P[t]},m?o=function(t){x.nextTick(A(t))}:S&&S.now?o=function(t){S.now(A(t))}:E&&!g?(a=(i=new E).port2,i.port1.onmessage=L,o=s(a.postMessage,a)):c.addEventListener&&l(c.postMessage)&&!c.importScripts&&n&&"file:"!==n.protocol&&!p(T)?(o=T,c.addEventListener("message",L,!1)):o=k in y("script")?function(t){h.appendChild(y("script"))[k]=function(){h.removeChild(this),C(t)}}:function(t){setTimeout(A(t),0)}),t.exports={set:b,clear:w}},1240:(t,e,r)=>{var n=r(9504);t.exports=n(1..valueOf)},5610:(t,e,r)=>{var n=r(1291),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},5397:(t,e,r)=>{var n=r(7055),o=r(7750);t.exports=function(t){return n(o(t))}},1291:(t,e,r)=>{var n=r(741);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},8014:(t,e,r)=>{var n=r(1291),o=Math.min;t.exports=function(t){var e=n(t);return e>0?o(e,9007199254740991):0}},8981:(t,e,r)=>{var n=r(7750),o=Object;t.exports=function(t){return o(n(t))}},2777:(t,e,r)=>{var n=r(9565),o=r(34),i=r(757),a=r(5966),c=r(4270),u=r(8227),s=TypeError,l=u("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var r,u=a(t,l);if(u){if(void 0===e&&(e="default"),r=n(u,t,e),!o(r)||i(r))return r;throw new s("Can't convert object to primitive value")}return void 0===e&&(e="number"),c(t,e)}},6969:(t,e,r)=>{var n=r(2777),o=r(757);t.exports=function(t){var e=n(t,"string");return o(e)?e:e+""}},2140:(t,e,r)=>{var n={};n[r(8227)("toStringTag")]="z",t.exports="[object z]"===String(n)},655:(t,e,r)=>{var n=r(6955),o=String;t.exports=function(t){if("Symbol"===n(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},6823:t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},3392:(t,e,r)=>{var n=r(9504),o=0,i=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},7416:(t,e,r)=>{var n=r(9039),o=r(8227),i=r(3724),a=r(6395),c=o("iterator");t.exports=!n((function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return t.pathname="c%20d",e.forEach((function(t,r){e.delete("b"),n+=r+t})),r.delete("a",2),r.delete("b",void 0),a&&(!t.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!e.size&&(a||!i)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[c]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host}))},7040:(t,e,r)=>{var n=r(4495);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:(t,e,r)=>{var n=r(3724),o=r(9039);t.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},2812:t=>{var e=TypeError;t.exports=function(t,r){if(t<r)throw new e("Not enough arguments");return t}},8622:(t,e,r)=>{var n=r(4576),o=r(4901),i=n.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},511:(t,e,r)=>{var n=r(9167),o=r(9297),i=r(1951),a=r(4913).f;t.exports=function(t){var e=n.Symbol||(n.Symbol={});o(e,t)||a(e,t,{value:i.f(t)})}},1951:(t,e,r)=>{var n=r(8227);e.f=n},8227:(t,e,r)=>{var n=r(4576),o=r(5745),i=r(9297),a=r(3392),c=r(4495),u=r(7040),s=n.Symbol,l=o("wks"),f=u?s.for||s:s&&s.withoutSetter||a;t.exports=function(t){return i(l,t)||(l[t]=c&&i(s,t)?s[t]:f("Symbol."+t)),l[t]}},7452:t=>{t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},4601:(t,e,r)=>{var n=r(7751),o=r(9297),i=r(6699),a=r(1625),c=r(2967),u=r(7740),s=r(1056),l=r(3167),f=r(2603),p=r(7584),h=r(747),d=r(3724),y=r(6395);t.exports=function(t,e,r,v){var g="stackTraceLimit",m=v?2:1,b=t.split("."),w=b[b.length-1],x=n.apply(null,b);if(x){var S=x.prototype;if(!y&&o(S,"cause")&&delete S.cause,!r)return x;var _=n("Error"),E=e((function(t,e){var r=f(v?e:t,void 0),n=v?new x(t):new x;return void 0!==r&&i(n,"message",r),h(n,E,n.stack,2),this&&a(S,this)&&l(n,this,E),arguments.length>m&&p(n,arguments[m]),n}));if(E.prototype=S,"Error"!==w?c?c(E,_):u(E,_,{name:!0}):d&&g in x&&(s(E,x,g),s(E,x,"prepareStackTrace")),u(E,x),!y)try{S.name!==w&&i(S,"name",w),S.constructor=E}catch(t){}return E}}},8706:(t,e,r)=>{var n=r(6518),o=r(9039),i=r(4376),a=r(34),c=r(8981),u=r(6198),s=r(6837),l=r(2278),f=r(1469),p=r(597),h=r(8227),d=r(9519),y=h("isConcatSpreadable"),v=d>=51||!o((function(){var t=[];return t[y]=!1,t.concat()[0]!==t})),g=function(t){if(!a(t))return!1;var e=t[y];return void 0!==e?!!e:i(t)};n({target:"Array",proto:!0,arity:1,forced:!v||!p("concat")},{concat:function(t){var e,r,n,o,i,a=c(this),p=f(a,0),h=0;for(e=-1,n=arguments.length;e<n;e++)if(g(i=-1===e?a:arguments[e]))for(o=u(i),s(h+o),r=0;r<o;r++,h++)r in i&&l(p,h,i[r]);else s(h+1),l(p,h++,i);return p.length=h,p}})},3418:(t,e,r)=>{var n=r(6518),o=r(7916);n({target:"Array",stat:!0,forced:!r(4428)((function(t){Array.from(t)}))},{from:o})},5276:(t,e,r)=>{var n=r(6518),o=r(7476),i=r(9617).indexOf,a=r(4598),c=o([].indexOf),u=!!c&&1/c([1],1,-0)<0;n({target:"Array",proto:!0,forced:u||!a("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return u?c(this,t,e)||0:i(this,t,e)}})},3792:(t,e,r)=>{var n=r(5397),o=r(6469),i=r(6269),a=r(1181),c=r(4913).f,u=r(1088),s=r(2529),l=r(6395),f=r(3724),p="Array Iterator",h=a.set,d=a.getterFor(p);t.exports=u(Array,"Array",(function(t,e){h(this,{type:p,target:n(t),index:0,kind:e})}),(function(){var t=d(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,s(void 0,!0);switch(t.kind){case"keys":return s(r,!1);case"values":return s(e[r],!1)}return s([r,e[r]],!1)}),"values");var y=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&f&&"values"!==y.name)try{c(y,"name",{value:"values"})}catch(t){}},4114:(t,e,r)=>{var n=r(6518),o=r(8981),i=r(6198),a=r(4527),c=r(6837);n({target:"Array",proto:!0,arity:1,forced:r(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=o(this),r=i(e),n=arguments.length;c(r+n);for(var u=0;u<n;u++)e[r]=arguments[u],r++;return a(e,r),r}})},4490:(t,e,r)=>{var n=r(6518),o=r(9504),i=r(4376),a=o([].reverse),c=[1,2];n({target:"Array",proto:!0,forced:String(c)===String(c.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},4782:(t,e,r)=>{var n=r(6518),o=r(4376),i=r(3517),a=r(34),c=r(5610),u=r(6198),s=r(5397),l=r(2278),f=r(8227),p=r(597),h=r(7680),d=p("slice"),y=f("species"),v=Array,g=Math.max;n({target:"Array",proto:!0,forced:!d},{slice:function(t,e){var r,n,f,p=s(this),d=u(p),m=c(t,d),b=c(void 0===e?d:e,d);if(o(p)&&(r=p.constructor,(i(r)&&(r===v||o(r.prototype))||a(r)&&null===(r=r[y]))&&(r=void 0),r===v||void 0===r))return h(p,m,b);for(n=new(void 0===r?v:r)(g(b-m,0)),f=0;m<b;m++,f++)m in p&&l(n,f,p[m]);return n.length=f,n}})},6910:(t,e,r)=>{var n=r(6518),o=r(9504),i=r(9306),a=r(8981),c=r(6198),u=r(4606),s=r(655),l=r(9039),f=r(4488),p=r(4598),h=r(3709),d=r(3763),y=r(9519),v=r(3607),g=[],m=o(g.sort),b=o(g.push),w=l((function(){g.sort(void 0)})),x=l((function(){g.sort(null)})),S=p("sort"),_=!l((function(){if(y)return y<70;if(!(h&&h>3)){if(d)return!0;if(v)return v<603;var t,e,r,n,o="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)g.push({k:e+n,v:r})}for(g.sort((function(t,e){return e.v-t.v})),n=0;n<g.length;n++)e=g[n].k.charAt(0),o.charAt(o.length-1)!==e&&(o+=e);return"DGBEFHACIJK"!==o}}));n({target:"Array",proto:!0,forced:w||!x||!S||!_},{sort:function(t){void 0!==t&&i(t);var e=a(this);if(_)return void 0===t?m(e):m(e,t);var r,n,o=[],l=c(e);for(n=0;n<l;n++)n in e&&b(o,e[n]);for(f(o,function(t){return function(e,r){return void 0===r?-1:void 0===e?1:void 0!==t?+t(e,r)||0:s(e)>s(r)?1:-1}}(t)),r=c(o),n=0;n<r;)e[n]=o[n++];for(;n<l;)u(e,n++);return e}})},739:(t,e,r)=>{var n=r(6518),o=r(9039),i=r(8981),a=r(2777);n({target:"Date",proto:!0,arity:1,forced:o((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(t){var e=i(this),r=a(e,"number");return"number"!=typeof r||isFinite(r)?e.toISOString():null}})},9572:(t,e,r)=>{var n=r(9297),o=r(6840),i=r(3640),a=r(8227)("toPrimitive"),c=Date.prototype;n(c,a)||o(c,a,i)},6280:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(8745),a=r(4601),c="WebAssembly",u=o[c],s=7!==new Error("e",{cause:7}).cause,l=function(t,e){var r={};r[t]=a(t,e,s),n({global:!0,constructor:!0,arity:1,forced:s},r)},f=function(t,e){if(u&&u[t]){var r={};r[t]=a(c+"."+t,e,s),n({target:c,stat:!0,constructor:!0,arity:1,forced:s},r)}};l("Error",(function(t){return function(e){return i(t,this,arguments)}})),l("EvalError",(function(t){return function(e){return i(t,this,arguments)}})),l("RangeError",(function(t){return function(e){return i(t,this,arguments)}})),l("ReferenceError",(function(t){return function(e){return i(t,this,arguments)}})),l("SyntaxError",(function(t){return function(e){return i(t,this,arguments)}})),l("TypeError",(function(t){return function(e){return i(t,this,arguments)}})),l("URIError",(function(t){return function(e){return i(t,this,arguments)}})),f("CompileError",(function(t){return function(e){return i(t,this,arguments)}})),f("LinkError",(function(t){return function(e){return i(t,this,arguments)}})),f("RuntimeError",(function(t){return function(e){return i(t,this,arguments)}}))},8111:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(679),a=r(8551),c=r(4901),u=r(2787),s=r(2106),l=r(2278),f=r(9039),p=r(9297),h=r(8227),d=r(7657).IteratorPrototype,y=r(3724),v=r(6395),g="constructor",m="Iterator",b=h("toStringTag"),w=TypeError,x=o[m],S=v||!c(x)||x.prototype!==d||!f((function(){x({})})),_=function(){if(i(this,d),u(this)===d)throw new w("Abstract class Iterator not directly constructable")},E=function(t,e){y?s(d,t,{configurable:!0,get:function(){return e},set:function(e){if(a(this),this===d)throw new w("You can't redefine this property");p(this,t)?this[t]=e:l(this,t,e)}}):d[t]=e};p(d,b)||E(b,m),!S&&p(d,g)&&d[g]!==Object||E(g,_),_.prototype=d,n({global:!0,constructor:!0,forced:S},{Iterator:_})},7588:(t,e,r)=>{var n=r(6518),o=r(2652),i=r(9306),a=r(8551),c=r(1767);n({target:"Iterator",proto:!0,real:!0},{forEach:function(t){a(this),i(t);var e=c(this),r=0;o(e,(function(e){t(e,r++)}),{IS_RECORD:!0})}})},3110:(t,e,r)=>{var n=r(6518),o=r(7751),i=r(8745),a=r(9565),c=r(9504),u=r(9039),s=r(4901),l=r(757),f=r(7680),p=r(6933),h=r(4495),d=String,y=o("JSON","stringify"),v=c(/./.exec),g=c("".charAt),m=c("".charCodeAt),b=c("".replace),w=c(1..toString),x=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,_=/^[\uDC00-\uDFFF]$/,E=!h||u((function(){var t=o("Symbol")("stringify detection");return"[null]"!==y([t])||"{}"!==y({a:t})||"{}"!==y(Object(t))})),j=u((function(){return'"\\udf06\\ud834"'!==y("\udf06\ud834")||'"\\udead"'!==y("\udead")})),O=function(t,e){var r=f(arguments),n=p(e);if(s(n)||void 0!==t&&!l(t))return r[1]=function(t,e){if(s(n)&&(e=a(n,this,d(t),e)),!l(e))return e},i(y,null,r)},P=function(t,e,r){var n=g(r,e-1),o=g(r,e+1);return v(S,t)&&!v(_,o)||v(_,t)&&!v(S,n)?"\\u"+w(m(t,0),16):t};y&&n({target:"JSON",stat:!0,arity:3,forced:E||j},{stringify:function(t,e,r){var n=f(arguments),o=i(E?O:y,null,n);return j&&"string"==typeof o?b(o,x,P):o}})},4731:(t,e,r)=>{var n=r(4576);r(687)(n.JSON,"JSON",!0)},479:(t,e,r)=>{r(687)(Math,"Math",!0)},2892:(t,e,r)=>{var n=r(6518),o=r(6395),i=r(3724),a=r(4576),c=r(9167),u=r(9504),s=r(2796),l=r(9297),f=r(3167),p=r(1625),h=r(757),d=r(2777),y=r(9039),v=r(8480).f,g=r(7347).f,m=r(4913).f,b=r(1240),w=r(3802).trim,x="Number",S=a[x],_=c[x],E=S.prototype,j=a.TypeError,O=u("".slice),P=u("".charCodeAt),k=s(x,!S(" 0o1")||!S("0b1")||S("+0x1")),C=function(t){var e,r=arguments.length<1?0:S(function(t){var e=d(t,"number");return"bigint"==typeof e?e:function(t){var e,r,n,o,i,a,c,u,s=d(t,"number");if(h(s))throw new j("Cannot convert a Symbol value to a number");if("string"==typeof s&&s.length>2)if(s=w(s),43===(e=P(s,0))||45===e){if(88===(r=P(s,2))||120===r)return NaN}else if(48===e){switch(P(s,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+s}for(a=(i=O(s,2)).length,c=0;c<a;c++)if((u=P(i,c))<48||u>o)return NaN;return parseInt(i,n)}return+s}(e)}(t));return p(E,e=this)&&y((function(){b(e)}))?f(Object(r),this,C):r};C.prototype=E,k&&!o&&(E.constructor=C),n({global:!0,constructor:!0,wrap:!0,forced:k},{Number:C});var A=function(t,e){for(var r,n=i?v(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)l(e,r=n[o])&&!l(t,r)&&m(t,r,g(e,r))};o&&_&&A(c[x],_),(k||o)&&A(c[x],S)},9085:(t,e,r)=>{var n=r(6518),o=r(4213);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},3921:(t,e,r)=>{var n=r(6518),o=r(2652),i=r(2278);n({target:"Object",stat:!0},{fromEntries:function(t){var e={};return o(t,(function(t,r){i(e,t,r)}),{AS_ENTRIES:!0}),e}})},3851:(t,e,r)=>{var n=r(6518),o=r(9039),i=r(5397),a=r(7347).f,c=r(3724);n({target:"Object",stat:!0,forced:!c||o((function(){a(1)})),sham:!c},{getOwnPropertyDescriptor:function(t,e){return a(i(t),e)}})},9773:(t,e,r)=>{var n=r(6518),o=r(4495),i=r(9039),a=r(3717),c=r(8981);n({target:"Object",stat:!0,forced:!o||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(t){var e=a.f;return e?e(c(t)):[]}})},875:(t,e,r)=>{var n=r(6518),o=r(9039),i=r(8981),a=r(2787),c=r(2211);n({target:"Object",stat:!0,forced:o((function(){a(1)})),sham:!c},{getPrototypeOf:function(t){return a(i(t))}})},9432:(t,e,r)=>{var n=r(6518),o=r(8981),i=r(1072);n({target:"Object",stat:!0,forced:r(9039)((function(){i(1)}))},{keys:function(t){return i(o(t))}})},287:(t,e,r)=>{r(6518)({target:"Object",stat:!0},{setPrototypeOf:r(2967)})},6099:(t,e,r)=>{var n=r(2140),o=r(6840),i=r(3179);n||o(Object.prototype,"toString",i,{unsafe:!0})},6499:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(9306),a=r(6043),c=r(1103),u=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{all:function(t){var e=this,r=a.f(e),n=r.resolve,s=r.reject,l=c((function(){var r=i(e.resolve),a=[],c=0,l=1;u(t,(function(t){var i=c++,u=!1;l++,o(r,e,t).then((function(t){u||(u=!0,a[i]=t,--l||n(a))}),s)})),--l||n(a)}));return l.error&&s(l.value),r.promise}})},2003:(t,e,r)=>{var n=r(6518),o=r(6395),i=r(916).CONSTRUCTOR,a=r(550),c=r(7751),u=r(4901),s=r(6840),l=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&u(a)){var f=c("Promise").prototype.catch;l.catch!==f&&s(l,"catch",f,{unsafe:!0})}},436:(t,e,r)=>{var n,o,i,a=r(6518),c=r(6395),u=r(8574),s=r(4576),l=r(9565),f=r(6840),p=r(2967),h=r(687),d=r(7633),y=r(9306),v=r(4901),g=r(34),m=r(679),b=r(2293),w=r(9225).set,x=r(1955),S=r(3138),_=r(1103),E=r(8265),j=r(1181),O=r(550),P=r(916),k=r(6043),C="Promise",A=P.CONSTRUCTOR,L=P.REJECTION_EVENT,T=P.SUBCLASSING,I=j.getterFor(C),R=j.set,M=O&&O.prototype,N=O,F=M,B=s.TypeError,D=s.document,G=s.process,U=k.f,q=U,H=!!(D&&D.createEvent&&s.dispatchEvent),z="unhandledrejection",W=function(t){var e;return!(!g(t)||!v(e=t.then))&&e},V=function(t,e){var r,n,o,i=e.value,a=1===e.state,c=a?t.ok:t.fail,u=t.resolve,s=t.reject,f=t.domain;try{c?(a||(2===e.rejection&&K(e),e.rejection=1),!0===c?r=i:(f&&f.enter(),r=c(i),f&&(f.exit(),o=!0)),r===t.promise?s(new B("Promise-chain cycle")):(n=W(r))?l(n,r,u,s):u(r)):s(i)}catch(t){f&&!o&&f.exit(),s(t)}},$=function(t,e){t.notified||(t.notified=!0,x((function(){for(var r,n=t.reactions;r=n.get();)V(r,t);t.notified=!1,e&&!t.rejection&&J(t)})))},Q=function(t,e,r){var n,o;H?((n=D.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),s.dispatchEvent(n)):n={promise:e,reason:r},!L&&(o=s["on"+t])?o(n):t===z&&S("Unhandled promise rejection",r)},J=function(t){l(w,s,(function(){var e,r=t.facade,n=t.value;if(Y(t)&&(e=_((function(){u?G.emit("unhandledRejection",n,r):Q(z,r,n)})),t.rejection=u||Y(t)?2:1,e.error))throw e.value}))},Y=function(t){return 1!==t.rejection&&!t.parent},K=function(t){l(w,s,(function(){var e=t.facade;u?G.emit("rejectionHandled",e):Q("rejectionhandled",e,t.value)}))},X=function(t,e,r){return function(n){t(e,n,r)}},Z=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,$(t,!0))},tt=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new B("Promise can't be resolved itself");var n=W(e);n?x((function(){var r={done:!1};try{l(n,e,X(tt,r,t),X(Z,r,t))}catch(e){Z(r,e,t)}})):(t.value=e,t.state=1,$(t,!1))}catch(e){Z({done:!1},e,t)}}};if(A&&(F=(N=function(t){m(this,F),y(t),l(n,this);var e=I(this);try{t(X(tt,e),X(Z,e))}catch(t){Z(e,t)}}).prototype,(n=function(t){R(this,{type:C,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:null})}).prototype=f(F,"then",(function(t,e){var r=I(this),n=U(b(this,N));return r.parent=!0,n.ok=!v(t)||t,n.fail=v(e)&&e,n.domain=u?G.domain:void 0,0===r.state?r.reactions.add(n):x((function(){V(n,r)})),n.promise})),o=function(){var t=new n,e=I(t);this.promise=t,this.resolve=X(tt,e),this.reject=X(Z,e)},k.f=U=function(t){return t===N||void 0===t?new o(t):q(t)},!c&&v(O)&&M!==Object.prototype)){i=M.then,T||f(M,"then",(function(t,e){var r=this;return new N((function(t,e){l(i,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete M.constructor}catch(t){}p&&p(M,F)}a({global:!0,constructor:!0,wrap:!0,forced:A},{Promise:N}),h(N,C,!1,!0),d(C)},3362:(t,e,r)=>{r(436),r(6499),r(2003),r(7743),r(1481),r(280)},7743:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(9306),a=r(6043),c=r(1103),u=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{race:function(t){var e=this,r=a.f(e),n=r.reject,s=c((function(){var a=i(e.resolve);u(t,(function(t){o(a,e,t).then(r.resolve,n)}))}));return s.error&&n(s.value),r.promise}})},1481:(t,e,r)=>{var n=r(6518),o=r(6043);n({target:"Promise",stat:!0,forced:r(916).CONSTRUCTOR},{reject:function(t){var e=o.f(this);return(0,e.reject)(t),e.promise}})},280:(t,e,r)=>{var n=r(6518),o=r(7751),i=r(6395),a=r(550),c=r(916).CONSTRUCTOR,u=r(3438),s=o("Promise"),l=i&&!c;n({target:"Promise",stat:!0,forced:i||c},{resolve:function(t){return u(l&&this===s?a:this,t)}})},825:(t,e,r)=>{var n=r(6518),o=r(7751),i=r(8745),a=r(566),c=r(5548),u=r(8551),s=r(34),l=r(2360),f=r(9039),p=o("Reflect","construct"),h=Object.prototype,d=[].push,y=f((function(){function t(){}return!(p((function(){}),[],t)instanceof t)})),v=!f((function(){p((function(){}))})),g=y||v;n({target:"Reflect",stat:!0,forced:g,sham:g},{construct:function(t,e){c(t),u(e);var r=arguments.length<3?t:c(arguments[2]);if(v&&!y)return p(t,e,r);if(t===r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return i(d,n,e),new(i(a,t,n))}var o=r.prototype,f=l(s(o)?o:h),g=i(t,f,e);return s(g)?g:f}})},888:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(34),a=r(8551),c=r(6575),u=r(7347),s=r(2787);n({target:"Reflect",stat:!0},{get:function t(e,r){var n,l,f=arguments.length<3?e:arguments[2];return a(e)===f?e[r]:(n=u.f(e,r))?c(n)?n.value:void 0===n.get?void 0:o(n.get,f):i(l=s(e))?t(l,r,f):void 0}})},5472:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(687);n({global:!0},{Reflect:{}}),i(o.Reflect,"Reflect",!0)},7495:(t,e,r)=>{var n=r(6518),o=r(7323);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},906:(t,e,r)=>{r(7495);var n,o,i=r(6518),a=r(9565),c=r(4901),u=r(8551),s=r(655),l=(n=!1,(o=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===o.test("abc")&&n),f=/./.test;i({target:"RegExp",proto:!0,forced:!l},{test:function(t){var e=u(this),r=s(t),n=e.exec;if(!c(n))return a(f,e,r);var o=a(n,e,r);return null!==o&&(u(o),!0)}})},8781:(t,e,r)=>{var n=r(350).PROPER,o=r(6840),i=r(8551),a=r(655),c=r(9039),u=r(1034),s="toString",l=RegExp.prototype,f=l[s],p=c((function(){return"/a/b"!==f.call({source:"a",flags:"b"})})),h=n&&f.name!==s;(p||h)&&o(l,s,(function(){var t=i(this);return"/"+a(t.source)+"/"+a(u(t))}),{unsafe:!0})},7337:(t,e,r)=>{var n=r(6518),o=r(9504),i=r(5610),a=RangeError,c=String.fromCharCode,u=String.fromCodePoint,s=o([].join);n({target:"String",stat:!0,arity:1,forced:!!u&&1!==u.length},{fromCodePoint:function(t){for(var e,r=[],n=arguments.length,o=0;n>o;){if(e=+arguments[o++],i(e,1114111)!==e)throw new a(e+" is not a valid code point");r[o]=e<65536?c(e):c(55296+((e-=65536)>>10),e%1024+56320)}return s(r,"")}})},7764:(t,e,r)=>{var n=r(8183).charAt,o=r(655),i=r(1181),a=r(1088),c=r(2529),u="String Iterator",s=i.set,l=i.getterFor(u);a(String,"String",(function(t){s(this,{type:u,string:o(t),index:0})}),(function(){var t,e=l(this),r=e.string,o=e.index;return o>=r.length?c(void 0,!0):(t=n(r,o),e.index+=t.length,c(t,!1))}))},5440:(t,e,r)=>{var n=r(8745),o=r(9565),i=r(9504),a=r(9228),c=r(9039),u=r(8551),s=r(4901),l=r(4117),f=r(1291),p=r(8014),h=r(655),d=r(7750),y=r(7829),v=r(5966),g=r(2478),m=r(6682),b=r(8227)("replace"),w=Math.max,x=Math.min,S=i([].concat),_=i([].push),E=i("".indexOf),j=i("".slice),O="$0"==="a".replace(/./,"$0"),P=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(t,e,r){var i=P?"$":"$0";return[function(t,r){var n=d(this),i=l(t)?void 0:v(t,b);return i?o(i,t,n,r):o(e,h(n),t,r)},function(t,o){var a=u(this),c=h(t);if("string"==typeof o&&-1===E(o,i)&&-1===E(o,"$<")){var l=r(e,a,c,o);if(l.done)return l.value}var d=s(o);d||(o=h(o));var v,b=a.global;b&&(v=a.unicode,a.lastIndex=0);for(var O,P=[];null!==(O=m(a,c))&&(_(P,O),b);)""===h(O[0])&&(a.lastIndex=y(c,p(a.lastIndex),v));for(var k,C="",A=0,L=0;L<P.length;L++){for(var T,I=h((O=P[L])[0]),R=w(x(f(O.index),c.length),0),M=[],N=1;N<O.length;N++)_(M,void 0===(k=O[N])?k:String(k));var F=O.groups;if(d){var B=S([I],M,R,c);void 0!==F&&_(B,F),T=h(n(o,void 0,B))}else T=g(I,c,R,M,F,o);R>=A&&(C+=j(c,A,R)+T,A=R+I.length)}return C+j(c,A)}]}),!!c((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!O||P)},6412:(t,e,r)=>{r(511)("asyncIterator")},6761:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(9565),a=r(9504),c=r(6395),u=r(3724),s=r(4495),l=r(9039),f=r(9297),p=r(1625),h=r(8551),d=r(5397),y=r(6969),v=r(655),g=r(6980),m=r(2360),b=r(1072),w=r(8480),x=r(298),S=r(3717),_=r(7347),E=r(4913),j=r(6801),O=r(8773),P=r(6840),k=r(2106),C=r(5745),A=r(6119),L=r(421),T=r(3392),I=r(8227),R=r(1951),M=r(511),N=r(8242),F=r(687),B=r(1181),D=r(9213).forEach,G=A("hidden"),U="Symbol",q="prototype",H=B.set,z=B.getterFor(U),W=Object[q],V=o.Symbol,$=V&&V[q],Q=o.RangeError,J=o.TypeError,Y=o.QObject,K=_.f,X=E.f,Z=x.f,tt=O.f,et=a([].push),rt=C("symbols"),nt=C("op-symbols"),ot=C("wks"),it=!Y||!Y[q]||!Y[q].findChild,at=function(t,e,r){var n=K(W,e);n&&delete W[e],X(t,e,r),n&&t!==W&&X(W,e,n)},ct=u&&l((function(){return 7!==m(X({},"a",{get:function(){return X(this,"a",{value:7}).a}})).a}))?at:X,ut=function(t,e){var r=rt[t]=m($);return H(r,{type:U,tag:t,description:e}),u||(r.description=e),r},st=function(t,e,r){t===W&&st(nt,e,r),h(t);var n=y(e);return h(r),f(rt,n)?(r.enumerable?(f(t,G)&&t[G][n]&&(t[G][n]=!1),r=m(r,{enumerable:g(0,!1)})):(f(t,G)||X(t,G,g(1,m(null))),t[G][n]=!0),ct(t,n,r)):X(t,n,r)},lt=function(t,e){h(t);var r=d(e),n=b(r).concat(dt(r));return D(n,(function(e){u&&!i(ft,r,e)||st(t,e,r[e])})),t},ft=function(t){var e=y(t),r=i(tt,this,e);return!(this===W&&f(rt,e)&&!f(nt,e))&&(!(r||!f(this,e)||!f(rt,e)||f(this,G)&&this[G][e])||r)},pt=function(t,e){var r=d(t),n=y(e);if(r!==W||!f(rt,n)||f(nt,n)){var o=K(r,n);return!o||!f(rt,n)||f(r,G)&&r[G][n]||(o.enumerable=!0),o}},ht=function(t){var e=Z(d(t)),r=[];return D(e,(function(t){f(rt,t)||f(L,t)||et(r,t)})),r},dt=function(t){var e=t===W,r=Z(e?nt:d(t)),n=[];return D(r,(function(t){!f(rt,t)||e&&!f(W,t)||et(n,rt[t])})),n};s||(P($=(V=function(){if(p($,this))throw new J("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,e=T(t),r=function(t){var n=void 0===this?o:this;n===W&&i(r,nt,t),f(n,G)&&f(n[G],e)&&(n[G][e]=!1);var a=g(1,t);try{ct(n,e,a)}catch(t){if(!(t instanceof Q))throw t;at(n,e,a)}};return u&&it&&ct(W,e,{configurable:!0,set:r}),ut(e,t)})[q],"toString",(function(){return z(this).tag})),P(V,"withoutSetter",(function(t){return ut(T(t),t)})),O.f=ft,E.f=st,j.f=lt,_.f=pt,w.f=x.f=ht,S.f=dt,R.f=function(t){return ut(I(t),t)},u&&(k($,"description",{configurable:!0,get:function(){return z(this).description}}),c||P(W,"propertyIsEnumerable",ft,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!s,sham:!s},{Symbol:V}),D(b(ot),(function(t){M(t)})),n({target:U,stat:!0,forced:!s},{useSetter:function(){it=!0},useSimple:function(){it=!1}}),n({target:"Object",stat:!0,forced:!s,sham:!u},{create:function(t,e){return void 0===e?m(t):lt(m(t),e)},defineProperty:st,defineProperties:lt,getOwnPropertyDescriptor:pt}),n({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:ht}),N(),F(V,U),L[G]=!0},9463:(t,e,r)=>{var n=r(6518),o=r(3724),i=r(4576),a=r(9504),c=r(9297),u=r(4901),s=r(1625),l=r(655),f=r(2106),p=r(7740),h=i.Symbol,d=h&&h.prototype;if(o&&u(h)&&(!("description"in d)||void 0!==h().description)){var y={},v=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),e=s(d,this)?new h(t):void 0===t?h():h(t);return""===t&&(y[e]=!0),e};p(v,h),v.prototype=d,d.constructor=v;var g="Symbol(description detection)"===String(h("description detection")),m=a(d.valueOf),b=a(d.toString),w=/^Symbol\((.*)\)[^)]+$/,x=a("".replace),S=a("".slice);f(d,"description",{configurable:!0,get:function(){var t=m(this);if(c(y,t))return"";var e=b(t),r=g?S(e,7,-1):x(e,w,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:v})}},1510:(t,e,r)=>{var n=r(6518),o=r(7751),i=r(9297),a=r(655),c=r(5745),u=r(1296),s=c("string-to-symbol-registry"),l=c("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!u},{for:function(t){var e=a(t);if(i(s,e))return s[e];var r=o("Symbol")(e);return s[e]=r,l[r]=e,r}})},2259:(t,e,r)=>{r(511)("iterator")},2675:(t,e,r)=>{r(6761),r(1510),r(7812),r(3110),r(9773)},7812:(t,e,r)=>{var n=r(6518),o=r(9297),i=r(757),a=r(6823),c=r(5745),u=r(1296),s=c("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!u},{keyFor:function(t){if(!i(t))throw new TypeError(a(t)+" is not a symbol");if(o(s,t))return s[t]}})},5700:(t,e,r)=>{var n=r(511),o=r(8242);n("toPrimitive"),o()},8125:(t,e,r)=>{var n=r(7751),o=r(511),i=r(687);o("toStringTag"),i(n("Symbol"),"Symbol")},5746:(t,e,r)=>{var n,o=r(2744),i=r(4576),a=r(9504),c=r(6279),u=r(3451),s=r(6468),l=r(4006),f=r(34),p=r(1181).enforce,h=r(9039),d=r(8622),y=Object,v=Array.isArray,g=y.isExtensible,m=y.isFrozen,b=y.isSealed,w=y.freeze,x=y.seal,S=!i.ActiveXObject&&"ActiveXObject"in i,_=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},E=s("WeakMap",_,l),j=E.prototype,O=a(j.set);if(d)if(S){n=l.getConstructor(_,"WeakMap",!0),u.enable();var P=a(j.delete),k=a(j.has),C=a(j.get);c(j,{delete:function(t){if(f(t)&&!g(t)){var e=p(this);return e.frozen||(e.frozen=new n),P(this,t)||e.frozen.delete(t)}return P(this,t)},has:function(t){if(f(t)&&!g(t)){var e=p(this);return e.frozen||(e.frozen=new n),k(this,t)||e.frozen.has(t)}return k(this,t)},get:function(t){if(f(t)&&!g(t)){var e=p(this);return e.frozen||(e.frozen=new n),k(this,t)?C(this,t):e.frozen.get(t)}return C(this,t)},set:function(t,e){if(f(t)&&!g(t)){var r=p(this);r.frozen||(r.frozen=new n),k(this,t)?O(this,t,e):r.frozen.set(t,e)}else O(this,t,e);return this}})}else o&&h((function(){var t=w([]);return O(new E,t,1),!m(t)}))&&c(j,{set:function(t,e){var r;return v(t)&&(m(t)?r=w:b(t)&&(r=x)),O(this,t,e),r&&r(t),this}})},3772:(t,e,r)=>{r(5746)},5240:(t,e,r)=>{r(6468)("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(4006))},958:(t,e,r)=>{r(5240)},8992:(t,e,r)=>{r(8111)},3949:(t,e,r)=>{r(7588)},3500:(t,e,r)=>{var n=r(4576),o=r(7400),i=r(9296),a=r(235),c=r(6699),u=function(t){if(t&&t.forEach!==a)try{c(t,"forEach",a)}catch(e){t.forEach=a}};for(var s in o)o[s]&&u(n[s]&&n[s].prototype);u(i)},2953:(t,e,r)=>{var n=r(4576),o=r(7400),i=r(9296),a=r(3792),c=r(6699),u=r(687),s=r(8227)("iterator"),l=a.values,f=function(t,e){if(t){if(t[s]!==l)try{c(t,s,l)}catch(e){t[s]=l}if(u(t,e,!0),o[e])for(var r in a)if(t[r]!==a[r])try{c(t,r,a[r])}catch(e){t[r]=a[r]}}};for(var p in o)f(n[p]&&n[p].prototype,p);f(i,"DOMTokenList")},8406:(t,e,r)=>{r(3792),r(7337);var n=r(6518),o=r(4576),i=r(3389),a=r(7751),c=r(9565),u=r(9504),s=r(3724),l=r(7416),f=r(6840),p=r(2106),h=r(6279),d=r(687),y=r(3994),v=r(1181),g=r(679),m=r(4901),b=r(9297),w=r(6080),x=r(6955),S=r(8551),_=r(34),E=r(655),j=r(2360),O=r(6980),P=r(81),k=r(851),C=r(2529),A=r(2812),L=r(8227),T=r(4488),I=L("iterator"),R="URLSearchParams",M=R+"Iterator",N=v.set,F=v.getterFor(R),B=v.getterFor(M),D=i("fetch"),G=i("Request"),U=i("Headers"),q=G&&G.prototype,H=U&&U.prototype,z=o.TypeError,W=o.encodeURIComponent,V=String.fromCharCode,$=a("String","fromCodePoint"),Q=parseInt,J=u("".charAt),Y=u([].join),K=u([].push),X=u("".replace),Z=u([].shift),tt=u([].splice),et=u("".split),rt=u("".slice),nt=u(/./.exec),ot=/\+/g,it=/^[0-9a-f]+$/i,at=function(t,e){var r=rt(t,e,e+2);return nt(it,r)?Q(r,16):NaN},ct=function(t){for(var e=0,r=128;r>0&&t&r;r>>=1)e++;return e},ut=function(t){var e=null;switch(t.length){case 1:e=t[0];break;case 2:e=(31&t[0])<<6|63&t[1];break;case 3:e=(15&t[0])<<12|(63&t[1])<<6|63&t[2];break;case 4:e=(7&t[0])<<18|(63&t[1])<<12|(63&t[2])<<6|63&t[3]}return e>1114111?null:e},st=function(t){for(var e=(t=X(t,ot," ")).length,r="",n=0;n<e;){var o=J(t,n);if("%"===o){if("%"===J(t,n+1)||n+3>e){r+="%",n++;continue}var i=at(t,n+1);if(i!=i){r+=o,n++;continue}n+=2;var a=ct(i);if(0===a)o=V(i);else{if(1===a||a>4){r+="�",n++;continue}for(var c=[i],u=1;u<a&&!(3+ ++n>e||"%"!==J(t,n));){var s=at(t,n+1);if(s!=s){n+=3;break}if(s>191||s<128)break;K(c,s),n+=2,u++}if(c.length!==a){r+="�";continue}var l=ut(c);null===l?r+="�":o=$(l)}}r+=o,n++}return r},lt=/[!'()~]|%20/g,ft={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},pt=function(t){return ft[t]},ht=function(t){return X(W(t),lt,pt)},dt=y((function(t,e){N(this,{type:M,target:F(t).entries,index:0,kind:e})}),R,(function(){var t=B(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,C(void 0,!0);var n=e[r];switch(t.kind){case"keys":return C(n.key,!1);case"values":return C(n.value,!1)}return C([n.key,n.value],!1)}),!0),yt=function(t){this.entries=[],this.url=null,void 0!==t&&(_(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===J(t,0)?rt(t,1):t:E(t)))};yt.prototype={type:R,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,n,o,i,a,u,s=this.entries,l=k(t);if(l)for(r=(e=P(t,l)).next;!(n=c(r,e)).done;){if(i=(o=P(S(n.value))).next,(a=c(i,o)).done||(u=c(i,o)).done||!c(i,o).done)throw new z("Expected sequence with length 2");K(s,{key:E(a.value),value:E(u.value)})}else for(var f in t)b(t,f)&&K(s,{key:f,value:E(t[f])})},parseQuery:function(t){if(t)for(var e,r,n=this.entries,o=et(t,"&"),i=0;i<o.length;)(e=o[i++]).length&&(r=et(e,"="),K(n,{key:st(Z(r)),value:st(Y(r,"="))}))},serialize:function(){for(var t,e=this.entries,r=[],n=0;n<e.length;)t=e[n++],K(r,ht(t.key)+"="+ht(t.value));return Y(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var vt=function(){g(this,gt);var t=N(this,new yt(arguments.length>0?arguments[0]:void 0));s||(this.size=t.entries.length)},gt=vt.prototype;if(h(gt,{append:function(t,e){var r=F(this);A(arguments.length,2),K(r.entries,{key:E(t),value:E(e)}),s||this.length++,r.updateURL()},delete:function(t){for(var e=F(this),r=A(arguments.length,1),n=e.entries,o=E(t),i=r<2?void 0:arguments[1],a=void 0===i?i:E(i),c=0;c<n.length;){var u=n[c];if(u.key!==o||void 0!==a&&u.value!==a)c++;else if(tt(n,c,1),void 0!==a)break}s||(this.size=n.length),e.updateURL()},get:function(t){var e=F(this).entries;A(arguments.length,1);for(var r=E(t),n=0;n<e.length;n++)if(e[n].key===r)return e[n].value;return null},getAll:function(t){var e=F(this).entries;A(arguments.length,1);for(var r=E(t),n=[],o=0;o<e.length;o++)e[o].key===r&&K(n,e[o].value);return n},has:function(t){for(var e=F(this).entries,r=A(arguments.length,1),n=E(t),o=r<2?void 0:arguments[1],i=void 0===o?o:E(o),a=0;a<e.length;){var c=e[a++];if(c.key===n&&(void 0===i||c.value===i))return!0}return!1},set:function(t,e){var r=F(this);A(arguments.length,1);for(var n,o=r.entries,i=!1,a=E(t),c=E(e),u=0;u<o.length;u++)(n=o[u]).key===a&&(i?tt(o,u--,1):(i=!0,n.value=c));i||K(o,{key:a,value:c}),s||(this.size=o.length),r.updateURL()},sort:function(){var t=F(this);T(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=F(this).entries,n=w(t,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((e=r[o++]).value,e.key,this)},keys:function(){return new dt(this,"keys")},values:function(){return new dt(this,"values")},entries:function(){return new dt(this,"entries")}},{enumerable:!0}),f(gt,I,gt.entries,{name:"entries"}),f(gt,"toString",(function(){return F(this).serialize()}),{enumerable:!0}),s&&p(gt,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),d(vt,R),n({global:!0,constructor:!0,forced:!l},{URLSearchParams:vt}),!l&&m(U)){var mt=u(H.has),bt=u(H.set),wt=function(t){if(_(t)){var e,r=t.body;if(x(r)===R)return e=t.headers?new U(t.headers):new U,mt(e,"content-type")||bt(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),j(t,{body:O(0,E(r)),headers:O(0,e)})}return t};if(m(D)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return D(t,arguments.length>1?wt(arguments[1]):{})}}),m(G)){var xt=function(t){return g(this,q),new G(t,arguments.length>1?wt(arguments[1]):{})};q.constructor=xt,xt.prototype=q,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:xt})}}t.exports={URLSearchParams:vt,getState:F}},8408:(t,e,r)=>{r(8406)}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r(2675),r(9463),r(2259),r(6280),r(3418),r(3792),r(4114),r(4782),r(6099),r(7495),r(906),r(8781),r(7764),r(5440),r(2953);const n=window.wp.element,o=window.wc.wcBlocksRegistry,i=window.wp.i18n;function a(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function c(t,e){if(void 0===e&&(e=Promise),s(t,e),"undefined"==typeof document)return e.resolve(null);var r=function(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseUrl&&(e=t.sdkBaseUrl,delete t.sdkBaseUrl);var r,n,o=t,i=Object.keys(o).filter((function(t){return void 0!==o[t]&&null!==o[t]&&""!==o[t]})).reduce((function(t,e){var r,n=o[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)?t.dataAttributes[e]=n:t.queryParams[e]=n,t}),{queryParams:{},dataAttributes:{}}),a=i.queryParams,c=i.dataAttributes;return a["merchant-id"]&&-1!==a["merchant-id"].indexOf(",")&&(c["data-merchant-id"]=a["merchant-id"],a["merchant-id"]="*"),{url:"".concat(e,"?").concat((r=a,n="",Object.keys(r).forEach((function(t){0!==n.length&&(n+="&"),n+=t+"="+r[t]})),n)),dataAttributes:c}}(t),n=r.url,o=r.dataAttributes,i=o["data-namespace"]||"paypal",c=u(i);return function(t,e){var r=document.querySelector('script[src="'.concat(t,'"]'));if(null===r)return null;var n=a(t,e),o=r.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(n.dataset).length)return null;var i=!0;return Object.keys(o.dataset).forEach((function(t){o.dataset[t]!==n.dataset[t]&&(i=!1)})),i?r:null}(n,o)&&c?e.resolve(c):function(t,e){void 0===e&&(e=Promise),s(t,e);var r=t.url,n=t.attributes;if("string"!=typeof r||0===r.length)throw new Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof document)return t();!function(t){var e=t.onSuccess,r=t.onError,n=a(t.url,t.attributes);n.onerror=r,n.onload=e,document.head.insertBefore(n,document.head.firstElementChild)}({url:r,attributes:n,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(r,'" failed to load.'));return window.fetch?fetch(r).then((function(r){return 200===r.status&&e(t),r.text()})).then((function(t){var r=function(t){var e=t.split("/* Original Error:")[1];return e?e.replace(/\n/g,"").replace("*/","").trim():t}(t);e(new Error(r))})).catch((function(t){e(t)})):e(t)}})}))}({url:n,attributes:o},e).then((function(){var t=u(i);if(t)return t;throw new Error("The window.".concat(i," global variable is not available."))}))}function u(t){return window[t]}function s(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}const l=(t,e,r,n=null)=>{fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:e.nonce})}).then((t=>t.json())).then((o=>{var i;((t,e)=>!(!t||t.user!==e||(new Date).getTime()>=1e3*t.expiration))(o,e.user)&&(i=o,sessionStorage.setItem("ppcp-data-client-id",JSON.stringify(i)),t["data-client-token"]=o.token,c(t).then((t=>{"function"==typeof r&&r(t)})).catch((t=>{"function"==typeof n&&n(t)})))}))};window.widgetBuilder=window.widgetBuilder||new class{constructor(){this.paypal=null,this.buttons=new Map,this.messages=new Map,this.renderEventName="ppcp-render",document.ppcpWidgetBuilderStatus=()=>{console.log({buttons:this.buttons,messages:this.messages})},jQuery(document).off(this.renderEventName).on(this.renderEventName,(()=>{this.renderAll()}))}setPaypal(t){this.paypal=t,jQuery(document).trigger("ppcp-paypal-loaded",t)}registerButtons(t,e){t=this.sanitizeWrapper(t),this.buttons.set(this.toKey(t),{wrapper:t,options:e})}renderButtons(t){if(t=this.sanitizeWrapper(t),!this.buttons.has(this.toKey(t)))return;if(this.hasRendered(t))return;const e=this.buttons.get(this.toKey(t)),r=this.paypal.Buttons(e.options);if(!r.isEligible())return void this.buttons.delete(this.toKey(t));const n=this.buildWrapperTarget(t);n&&r.render(n)}renderAllButtons(){for(const[t,e]of this.buttons)this.renderButtons(t)}registerMessages(t,e){this.messages.set(t,{wrapper:t,options:e})}renderMessages(t){if(!this.messages.has(t))return;const e=this.messages.get(t);if(this.hasRendered(t))return void document.querySelector(t).setAttribute("data-pp-amount",e.options.amount);const r=this.paypal.Messages(e.options);r.render(e.wrapper),setTimeout((()=>{this.hasRendered(t)||r.render(e.wrapper)}),100)}renderAllMessages(){for(const[t,e]of this.messages)this.renderMessages(t)}renderAll(){this.renderAllButtons(),this.renderAllMessages()}hasRendered(t){let e=t;if(Array.isArray(t)){e=t[0];for(const r of t.slice(1))e+=" .item-"+r}const r=document.querySelector(e);return r&&r.hasChildNodes()}sanitizeWrapper(t){return Array.isArray(t)&&1===(t=t.filter((t=>!!t))).length&&(t=t[0]),t}buildWrapperTarget(t){let e=t;if(Array.isArray(t)){const r=jQuery(t[0]);if(!r.length)return;const n="item-"+t[1];let o=r.find("."+n);o.length||(o=jQuery(`<div class="${n}"></div>`),r.append(o)),e=o.get(0)}return jQuery(e).length?e:null}toKey(t){return Array.isArray(t)?JSON.stringify(t):t}};const f=window.widgetBuilder;var p=r(9457),h=r.n(p);const d={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let y;const v=new Uint8Array(16);function g(){if(!y){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");y=crypto.getRandomValues.bind(crypto)}return y(v)}const m=[];for(let t=0;t<256;++t)m.push((t+256).toString(16).slice(1));const b=function(t,e,r){if(d.randomUUID&&!e&&!t)return d.randomUUID();const n=(t=t||{}).random||(t.rng||g)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return(m[t[e+0]]+m[t[e+1]]+m[t[e+2]]+m[t[e+3]]+"-"+m[t[e+4]]+m[t[e+5]]+"-"+m[t[e+6]]+m[t[e+7]]+"-"+m[t[e+8]]+m[t[e+9]]+"-"+m[t[e+10]]+m[t[e+11]]+m[t[e+12]]+m[t[e+13]]+m[t[e+14]]+m[t[e+15]]).toLowerCase()}(n)},w=t=>{let e=(t=>{const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[(r=n,r.replace(/([-_]\w)/g,(function(t){return t[1].toUpperCase()})))]=t[n]);var r;return e})(t.url_params);t.script_attributes&&(e=h()(e,t.script_attributes));const r=(t=>{const e={},r=t?.axo?.sdk_client_token,n=b().replace(/-/g,"");return r&&(e["data-sdk-client-token"]=r,e["data-client-metadata-id"]=n),e})(t),n=((t,e)=>{const r=t?.save_payment_methods?.id_token;return r&&!e?{"data-user-id-token":r}:{}})(t,r["data-sdk-client-token"]);return h().all([e,r,n])},x=new Map,S=new Map,_=async(t,e)=>{if(!t)throw new Error("Namespace is required");if(x.has(t))return console.log(`Script already loaded for namespace: ${t}`),x.get(t);if(S.has(t))return console.log(`Script loading in progress for namespace: ${t}`),S.get(t);const r={...w(e),"data-namespace":t},n=await(async(t,e)=>e.data_client_id?.set_attribute&&"1"!==e.vault_v3_enabled?new Promise(((r,n)=>{l(t,e.data_client_id,(t=>{f.setPaypal(t),r(t)}),n)})):null)(r,e);if(n)return n;const o=new Promise(((e,n)=>{c(r).then((r=>{f.setPaypal(r),x.set(t,r),console.log(`Script loaded for namespace: ${t}`),e(r)})).catch((e=>{console.error(`Failed to load script for namespace: ${t}`,e),n(e)})).finally((()=>{S.delete(t)}))}));return S.set(t,o),o};function E(t,e){void 0===e&&(e=Promise),function(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}(t,e);var r=t.url,n=t.attributes;if("string"!=typeof r||0===r.length)throw new Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof document)return t();var o,i,a,c;i=(o={url:r,attributes:n,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(r,'" failed to load.'));return window.fetch?fetch(r).then((function(r){return 200===r.status&&e(t),r.text()})).then((function(t){var r=function(t){var e=t.split("/* Original Error:")[1];return e?e.replace(/\n/g,"").replace("*/","").trim():t}(t);e(new Error(r))})).catch((function(t){e(t)})):e(t)}}).onSuccess,a=o.onError,c=function(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}(o.url,o.attributes),c.onerror=a,c.onload=i,document.head.insertBefore(c,document.head.firstElementChild)}))}r(5700),r(9572),r(2892),r(875),r(287),r(825);const j=class{constructor(t="form.woocommerce-checkout"){this.target=t}setTarget(t){this.target=t}block(){jQuery(this.target).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}unblock(){jQuery(this.target).unblock()}};!function(){var t;function e(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var r,n="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,r){return t==Array.prototype||t==Object.prototype||(t[e]=r.value),t},o=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var e=0;e<t.length;++e){var r=t[e];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function i(t,e){if(e)t:{var r=o;t=t.split(".");for(var i=0;i<t.length-1;i++){var a=t[i];if(!(a in r))break t;r=r[a]}(e=e(i=r[t=t[t.length-1]]))!=i&&null!=e&&n(r,t,{configurable:!0,writable:!0,value:e})}}function a(t){return(t={next:t})[Symbol.iterator]=function(){return this},t}function c(t){var r="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return r?r.call(t):{next:e(t)}}if(i("Symbol",(function(t){function e(t,e){this.A=t,n(this,"description",{configurable:!0,writable:!0,value:e})}if(t)return t;e.prototype.toString=function(){return this.A};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",o=0;return function t(n){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(r+(n||"")+"_"+o++,n)}})),i("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i<r.length;i++){var c=o[r[i]];"function"==typeof c&&"function"!=typeof c.prototype[t]&&n(c.prototype,t,{configurable:!0,writable:!0,value:function(){return a(e(this))}})}return t})),"function"==typeof Object.setPrototypeOf)r=Object.setPrototypeOf;else{var u;t:{var s={};try{s.__proto__={a:!0},u=s.a;break t}catch(t){}u=!1}r=u?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var l=r;function f(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function p(t){if(t.m)throw new TypeError("Generator is already running");t.m=!0}function h(t,e){return t.h=3,{value:e}}function d(t){this.g=new f,this.G=t}function y(t,e,r,n){try{var o=e.call(t.g.j,r);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return t.g.m=!1,o;var i=o.value}catch(e){return t.g.j=null,t.g.s(e),v(t)}return t.g.j=null,n.call(t.g,i),v(t)}function v(t){for(;t.g.h;)try{var e=t.G(t.g);if(e)return t.g.m=!1,{value:e.value,done:!1}}catch(e){t.g.v=void 0,t.g.s(e)}if(t.g.m=!1,t.g.l){if(e=t.g.l,t.g.l=null,e.F)throw e.D;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function g(t){this.next=function(e){return t.o(e)},this.throw=function(e){return t.s(e)},this.return=function(e){return function(t,e){p(t.g);var r=t.g.j;return r?y(t,"return"in r?r.return:function(t){return{value:t,done:!0}},e,t.g.return):(t.g.return(e),v(t))}(t,e)},this[Symbol.iterator]=function(){return this}}function m(t,e){return e=new g(new d(e)),l&&t.prototype&&l(e,t.prototype),e}if(f.prototype.o=function(t){this.v=t},f.prototype.s=function(t){this.l={D:t,F:!0},this.h=this.C||this.u},f.prototype.return=function(t){this.l={return:t},this.h=this.u},d.prototype.o=function(t){return p(this.g),this.g.j?y(this,this.g.j.next,t,this.g.o):(this.g.o(t),v(this))},d.prototype.s=function(t){return p(this.g),this.g.j?y(this,this.g.j.throw,t,this.g.o):(this.g.s(t),v(this))},i("Array.prototype.entries",(function(t){return t||function(){return function(t,e){t instanceof String&&(t+="");var r=0,n=!1,o={next:function(){if(!n&&r<t.length){var o=r++;return{value:e(o,t[o]),done:!1}}return n=!0,{done:!0,value:void 0}}};return o[Symbol.iterator]=function(){return o},o}(this,(function(t,e){return[t,e]}))}})),"undefined"!=typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var b=function(t,e){for(var r=0;r<t.length;r++)e(t[r])},w=function(t){return t.replace(/\r?\n|\r/g,"\r\n")},x=function(t,e,r){return e instanceof Blob?(r=void 0!==r?String(r+""):"string"==typeof e.name?e.name:"blob",e.name===r&&"[object Blob]"!==Object.prototype.toString.call(e)||(e=new File([e],r)),[String(t),e]):[String(t),String(e)]},S=function(t,e){if(t.length<e)throw new TypeError(e+" argument required, but only "+t.length+" present.")},_="object"==typeof globalThis?globalThis:"object"==typeof window?window:"object"==typeof self?self:this,E=_.FormData,j=_.XMLHttpRequest&&_.XMLHttpRequest.prototype.send,O=_.Request&&_.fetch,P=_.navigator&&_.navigator.sendBeacon,k=_.Element&&_.Element.prototype,C=_.Symbol&&Symbol.toStringTag;C&&(Blob.prototype[C]||(Blob.prototype[C]="Blob"),"File"in _&&!File.prototype[C]&&(File.prototype[C]="File"));try{new File([],"")}catch(t){_.File=function(t,e,r){return t=new Blob(t,r||{}),Object.defineProperties(t,{name:{value:e},lastModified:{value:+(r&&void 0!==r.lastModified?new Date(r.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),C&&Object.defineProperty(t,C,{value:"File"}),t}}var A=function(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},L=function(t){this.i=[];var e=this;t&&b(t.elements,(function(t){if(t.name&&!t.disabled&&"submit"!==t.type&&"button"!==t.type&&!t.matches("form fieldset[disabled] *"))if("file"===t.type){var r=t.files&&t.files.length?t.files:[new File([],"",{type:"application/octet-stream"})];b(r,(function(r){e.append(t.name,r)}))}else"select-multiple"===t.type||"select-one"===t.type?b(t.options,(function(r){!r.disabled&&r.selected&&e.append(t.name,r.value)})):"checkbox"===t.type||"radio"===t.type?t.checked&&e.append(t.name,t.value):(r="textarea"===t.type?w(t.value):t.value,e.append(t.name,r))}))};if((t=L.prototype).append=function(t,e,r){S(arguments,2),this.i.push(x(t,e,r))},t.delete=function(t){S(arguments,1);var e=[];t=String(t),b(this.i,(function(r){r[0]!==t&&e.push(r)})),this.i=e},t.entries=function t(){var e,r=this;return m(t,(function(t){if(1==t.h&&(e=0),3!=t.h)return e<r.i.length?t=h(t,r.i[e]):(t.h=0,t=void 0),t;e++,t.h=2}))},t.forEach=function(t,e){S(arguments,1);for(var r=c(this),n=r.next();!n.done;n=r.next()){var o=c(n.value);n=o.next().value,o=o.next().value,t.call(e,o,n,this)}},t.get=function(t){S(arguments,1);var e=this.i;t=String(t);for(var r=0;r<e.length;r++)if(e[r][0]===t)return e[r][1];return null},t.getAll=function(t){S(arguments,1);var e=[];return t=String(t),b(this.i,(function(r){r[0]===t&&e.push(r[1])})),e},t.has=function(t){S(arguments,1),t=String(t);for(var e=0;e<this.i.length;e++)if(this.i[e][0]===t)return!0;return!1},t.keys=function t(){var e,r,n,o=this;return m(t,(function(t){if(1==t.h&&(e=c(o),r=e.next()),3!=t.h)return r.done?void(t.h=0):(n=r.value,h(t,c(n).next().value));r=e.next(),t.h=2}))},t.set=function(t,e,r){S(arguments,2),t=String(t);var n=[],o=x(t,e,r),i=!0;b(this.i,(function(e){e[0]===t?i&&(i=!n.push(o)):n.push(e)})),i&&n.push(o),this.i=n},t.values=function t(){var e,r,n,o,i=this;return m(t,(function(t){if(1==t.h&&(e=c(i),r=e.next()),3!=t.h)return r.done?void(t.h=0):(n=r.value,(o=c(n)).next(),h(t,o.next().value));r=e.next(),t.h=2}))},L.prototype._asNative=function(){for(var t=new E,e=c(this),r=e.next();!r.done;r=e.next()){var n=c(r.value);r=n.next().value,n=n.next().value,t.append(r,n)}return t},L.prototype._blob=function(){var t="----formdata-polyfill-"+Math.random(),e=[],r="--"+t+'\r\nContent-Disposition: form-data; name="';return this.forEach((function(t,n){return"string"==typeof t?e.push(r+A(w(n))+'"\r\n\r\n'+w(t)+"\r\n"):e.push(r+A(w(n))+'"; filename="'+A(t.name)+'"\r\nContent-Type: '+(t.type||"application/octet-stream")+"\r\n\r\n",t,"\r\n")})),e.push("--"+t+"--"),new Blob(e,{type:"multipart/form-data; boundary="+t})},L.prototype[Symbol.iterator]=function(){return this.entries()},L.prototype.toString=function(){return"[object FormData]"},k&&!k.matches&&(k.matches=k.matchesSelector||k.mozMatchesSelector||k.msMatchesSelector||k.oMatchesSelector||k.webkitMatchesSelector||function(t){for(var e=(t=(this.document||this.ownerDocument).querySelectorAll(t)).length;0<=--e&&t.item(e)!==this;);return-1<e}),C&&(L.prototype[C]="FormData"),j){var T=_.XMLHttpRequest.prototype.setRequestHeader;_.XMLHttpRequest.prototype.setRequestHeader=function(t,e){T.call(this,t,e),"content-type"===t.toLowerCase()&&(this.B=!0)},_.XMLHttpRequest.prototype.send=function(t){t instanceof L?(t=t._blob(),this.B||this.setRequestHeader("Content-Type",t.type),j.call(this,t)):j.call(this,t)}}O&&(_.fetch=function(t,e){return e&&e.body&&e.body instanceof L&&(e.body=e.body._blob()),O.call(this,t,e)}),P&&(_.navigator.sendBeacon=function(t,e){return e instanceof L&&(e=e._asNative()),P.call(this,t,e)}),_.FormData=L}}();const O=(t,e,r)=>(n,o)=>(r.block(),e.clear(),fetch(t.config.ajax.approve_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:t.config.ajax.approve_order.nonce,order_id:n.orderID,funding_source:window.ppcpFundingSource})}).then((t=>t.json())).then((t=>{if(r.unblock(),!t.success){if(100===t.data.code?e.message(t.data.message):e.genericError(),void 0!==o&&void 0!==o.restart)return o.restart();throw new Error(t.data.message)}document.querySelector("#place_order").click()}))),P={"#billing_email":["email_address"],"#billing_last_name":["name","surname"],"#billing_first_name":["name","given_name"],"#billing_country":["address","country_code"],"#billing_address_1":["address","address_line_1"],"#billing_address_2":["address","address_line_2"],"#billing_state":["address","admin_area_1"],"#billing_city":["address","admin_area_2"],"#billing_postcode":["address","postal_code"],"#billing_phone":["phone"]};function k(t){return{email_address:t.email_address,phone:t.phone,name:{surname:t.name?.surname,given_name:t.name?.given_name},address:{country_code:t.address?.country_code,address_line_1:t.address?.address_line_1,address_line_2:t.address?.address_line_2,admin_area_1:t.address?.admin_area_1,admin_area_2:t.address?.admin_area_2,postal_code:t.address?.postal_code}}}function C(){const t=window?.PayPalCommerceGateway?.payer??window._PpcpPayerSessionDetails;if(!t)return null;const e=function(){const t={};return Object.entries(P).forEach((([e,r])=>{const n=(t=>document.querySelector(t)?.value)(e);n&&((t,e,r)=>{let n=t;for(let t=0;t<e.length-1;t++)n=n[e[t]]=n[e[t]]||{};n[e[e.length-1]]=r})(t,r,n)})),t.phone&&"string"==typeof t.phone&&(t.phone={phone_type:"HOME",phone_number:{national_number:t.phone}}),t}();return e?function(t,e){const r=(t,e)=>{for(const[n,o]of Object.entries(e))null!=o&&(t[n]="object"==typeof o?r(t[n]||{},o):o);return t};return r(k(t),k(e))}(t,e):k(t)}const A="ppcp-gateway",L={Cart:"cart",Checkout:"checkout",BlockCart:"cart-block",BlockCheckout:"checkout-block",Product:"product",MiniCart:"mini-cart",PayNow:"pay-now",Preview:"preview",Blocks:["cart-block","checkout-block"],Gateways:["checkout","pay-now"]},T=()=>{const t=document.querySelector('input[name="payment_method"]:checked');return t?t.value:null};class I{constructor(t,e){this.url=t,this.nonce=e}async validate(t){const e=new FormData(t),r=await fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.nonce,form_encoded:new URLSearchParams(e).toString()})}),n=await r.json();if(!n.success){if(n.data.refresh&&jQuery(document.body).trigger("update_checkout"),n.data.errors)return n.data.errors;throw Error(n.data.message)}return[]}}const R=class{constructor(t,e){this.genericErrorText=t,this.wrapper=e}genericError(){this.clear(),this.message(this.genericErrorText)}appendPreparedErrorMessageElement(t){this._getMessageContainer().replaceWith(t)}message(t){this._addMessage(t),this._scrollToMessages()}messages(t){t.forEach((t=>this._addMessage(t))),this._scrollToMessages()}currentHtml(){return this._getMessageContainer().outerHTML}_addMessage(t){if(0===t.length)throw new Error("A new message text must be a non-empty string.");const e=this._getMessageContainer(),r=this._prepareMessageElement(t);e.appendChild(r)}_scrollToMessages(){jQuery.scroll_to_notices(jQuery(".woocommerce-error"))}_getMessageContainer(){let t=document.querySelector("ul.woocommerce-error");return null===t&&(t=document.createElement("ul"),t.setAttribute("class","woocommerce-error"),t.setAttribute("role","alert"),jQuery(this.wrapper).prepend(t)),t}_prepareMessageElement(t){const e=document.createElement("li");return e.innerHTML=t,e}clear(){jQuery(".woocommerce-error, .woocommerce-message").remove()}},M=class{constructor(t,e,r){this.config=t,this.errorHandler=e,this.spinner=r}subscriptionsConfiguration(t){return{createSubscription:async(e,r)=>{try{await(n=this.config,new Promise((async(t,e)=>{try{const r=new j,o=new R(n.labels.error.generic,document.querySelector(".woocommerce-notices-wrapper")),i="checkout"===n.context?"form.checkout":"form#order_review",a=n.early_checkout_validation_enabled?new I(n.ajax.validate_checkout.endpoint,n.ajax.validate_checkout.nonce):null;if(!a)return void t();a.validate(document.querySelector(i)).then((n=>{n.length>0?(r.unblock(),o.clear(),o.messages(n),jQuery(document.body).trigger("checkout_error",[o.currentHtml()]),e()):t()}))}catch(t){console.error(t),e()}})))}catch(t){throw{type:"form-validation-error"}}var n;return r.subscription.create({plan_id:t})},onApprove:(t,e)=>{fetch(this.config.ajax.approve_subscription.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.approve_subscription.nonce,order_id:t.orderID,subscription_id:t.subscriptionID})}).then((t=>t.json())).then((t=>{document.querySelector("#place_order").click()}))},onError:t=>{console.error(t)}}}configuration(){const t=this.spinner;return{createOrder:(e,r)=>{const n=C(),o=void 0!==this.config.bn_codes[this.config.context]?this.config.bn_codes[this.config.context]:"",i=this.errorHandler,a="checkout"===this.config.context?"form.checkout":"form#order_review",c=new FormData(document.querySelector(a)),u=!!jQuery("#createaccount").is(":checked"),s=T(),l=window.ppcpFundingSource,f=!!document.getElementById("wc-ppcp-credit-card-gateway-new-payment-method")?.checked;return fetch(this.config.ajax.create_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.create_order.nonce,payer:n,bn_code:o,context:this.config.context,order_id:this.config.order_id,payment_method:s,funding_source:l,form_encoded:new URLSearchParams(c).toString(),createaccount:u,save_payment_method:f})}).then((function(t){return t.json()})).then((function(e){if(!e.success){if(t.unblock(),void 0!==e.messages){const t=new DOMParser;i.appendPreparedErrorMessageElement(t.parseFromString(e.messages,"text/html").querySelector("ul"))}else i.clear(),e.data.refresh&&jQuery(document.body).trigger("update_checkout"),e.data.errors?.length>0?i.messages(e.data.errors):e.data.details?.length>0?i.message(e.data.details.map((t=>`${t.issue} ${t.description}`)).join("<br/>")):i.message(e.data.message),jQuery(document.body).trigger("checkout_error",[i.currentHtml()]);throw{type:"create-order-error",data:e.data}}const r=document.createElement("input");return r.setAttribute("type","hidden"),r.setAttribute("name","ppcp-resume-order"),r.setAttribute("value",e.data.custom_id),document.querySelector(a).appendChild(r),e.data.id}))},onApprove:O(this,this.errorHandler,this.spinner),onCancel:()=>{t.unblock()},onError:e=>{console.error(e),t.unblock(),e&&"create-order-error"===e.type||this.errorHandler.genericError()}}}};r(5276),r(3362);const N=(t,e)=>(r,n)=>{const o=!t.config.vaultingEnabled||"venmo"!==r.paymentSource,i={nonce:t.config.ajax.approve_order.nonce,order_id:r.orderID,funding_source:window.ppcpFundingSource,should_create_wc_order:o};return o&&r.payer&&(i.payer=r.payer),fetch(t.config.ajax.approve_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(i)}).then((t=>t.json())).then((r=>{if(!r.success)return e.genericError(),n.restart().catch((t=>{e.genericError()}));const o=r.data?.order_received_url;window.location.href=o||t.config.redirect}))},F=class{constructor(t,e){this.config=t,this.errorHandler=e}subscriptionsConfiguration(t){return{createSubscription:(e,r)=>r.subscription.create({plan_id:t}),onApprove:(t,e)=>{fetch(this.config.ajax.approve_subscription.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.approve_subscription.nonce,order_id:t.orderID,subscription_id:t.subscriptionID,should_create_wc_order:!context.config.vaultingEnabled||"venmo"!==t.paymentSource})}).then((t=>t.json())).then((t=>{if(!t.success)throw console.log(t),Error(t.data.message);const e=t.data?.order_received_url;location.href=e||context.config.redirect}))},onError:t=>{console.error(t)}}}configuration(){return{createOrder:(t,e)=>{const r=C(),n=void 0!==this.config.bn_codes[this.config.context]?this.config.bn_codes[this.config.context]:"";return fetch(this.config.ajax.create_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.create_order.nonce,purchase_units:[],payment_method:A,funding_source:window.ppcpFundingSource,bn_code:n,payer:r,context:this.config.context})}).then((function(t){return t.json()})).then((function(t){if(!t.success)throw console.error(t),Error(t.data.message);return t.data.id}))},onApprove:N(this,this.errorHandler),onError:t=>{this.errorHandler.genericError()}}}};function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function D(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,G(n.key),n)}}function G(t){var e=function(t){if("object"!=B(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=B(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==B(e)?e:e+""}var U=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.buttonConfig=e,this.ppcpConfig=r},(e=[{key:"isVaultV3Mode",value:function(){var t,e,r;return(null===(t=this.ppcpConfig)||void 0===t||null===(t=t.save_payment_methods)||void 0===t?void 0:t.id_token)&&!(null!==(e=this.ppcpConfig)&&void 0!==e&&null!==(e=e.data_client_id)&&void 0!==e&&e.paypal_subscriptions_enabled)&&(null===(r=this.ppcpConfig)||void 0===r?void 0:r.can_save_vault_token)}},{key:"validateContext",value:function(){var t;return null===(t=this.ppcpConfig)||void 0===t||null===(t=t.locations_with_subscription_product)||void 0===t||!t.cart||this.isVaultV3Mode()}},{key:"shippingAllowed",value:function(){return this.buttonConfig.product.needShipping}},{key:"transactionInfo",value:function(){var t=this;return new Promise((function(e,r){var n=t.ppcpConfig.ajax.cart_script_params.endpoint,o=-1!==n.indexOf("?")?"&":"?";fetch(n+o+"shipping=1",{method:"GET",credentials:"same-origin"}).then((function(t){return t.json()})).then((function(t){if(t.success){var r=t.data;e({countryCode:r.country_code,currencyCode:r.currency_code,totalPriceStatus:"FINAL",totalPrice:r.total_str,chosenShippingMethods:r.chosen_shipping_methods||null,shippingPackages:r.shipping_packages||null})}}))}))}},{key:"createOrder",value:function(){return this.actionHandler().configuration().createOrder(null,null)}},{key:"approveOrder",value:function(t,e){return this.actionHandler().configuration().onApprove(t,e)}},{key:"actionHandler",value:function(){return new F(this.ppcpConfig,this.errorHandler())}},{key:"errorHandler",value:function(){return new R(this.ppcpConfig.labels.error.generic,document.querySelector(".woocommerce-notices-wrapper"))}}])&&D(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const q=U;function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function z(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,W(n.key),n)}}function W(t){var e=function(t){if("object"!=H(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=H(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==H(e)?e:e+""}function V(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(V=function(){return!!t})()}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$(t)}function Q(t,e){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Q(t,e)}const J=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=$(e),function(t,e){if(e&&("object"==H(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,V()?Reflect.construct(e,r||[],$(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Q(t,e)}(e,t),r=e,(n=[{key:"actionHandler",value:function(){return new M(this.ppcpConfig,this.errorHandler(),new j)}}])&&z(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(q);r(6412),r(8125),r(4490),r(4731),r(479),r(3772),r(8992),r(3949),r(3500),window.ppcpResources=window.ppcpResources||{};const Y=window.ppcpResources.ButtonModuleWatcher=window.ppcpResources.ButtonModuleWatcher||new class{constructor(){this.contextBootstrapRegistry={},this.contextBootstrapWatchers=[]}watchContextBootstrap(t){this.contextBootstrapWatchers.push(t),Object.values(this.contextBootstrapRegistry).forEach(t)}registerContextBootstrap(t,e){this.contextBootstrapRegistry[t]={context:t,handler:e};for(const e of this.contextBootstrapWatchers)e(this.contextBootstrapRegistry[t])}};function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function X(t){var e,r=[],n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return K(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(t);try{for(n.s();!(e=n.n()).done;){var o=e.value,i=o.contactField,a=void 0===i?null:i,c=o.code,u=void 0===c?null:c,s=o.message,l=a?new ApplePayError(u,a,void 0===s?null:s):new ApplePayError(u);r.push(l)}}catch(t){n.e(t)}finally{n.f()}return r}r(8706),r(6910),r(739),r(3110),r(9085),r(3921),r(3851),r(9432),r(888),r(5472),r(958),r(8408);class Z{#t="";#e=!1;#r=null;constructor(...t){t.length&&(this.#t=`[${t.join(" | ")}]`)}set enabled(t){this.#e=t}log(...t){this.#e&&console.log(this.#t,...t)}error(...t){console.error(this.#t,...t)}group(t=null){this.#e&&(t&&!this.#r||(console.groupEnd(),this.#r=null),t&&(console.group(t),this.#r=t))}}class tt{constructor(t,e){this.selector=t,this.selectorInContainer=e,this.containers=[],this.reloadContainers(),jQuery(window).resize((()=>{this.refresh()})).resize(),jQuery(document).on("ppcp-smart-buttons-init",(()=>{this.refresh()})),jQuery(document).on("ppcp-shown ppcp-hidden ppcp-enabled ppcp-disabled",((t,e)=>{this.refresh(),setTimeout(this.refresh.bind(this),200)})),new MutationObserver(this.observeElementsCallback.bind(this)).observe(document.body,{childList:!0,subtree:!0})}observeElementsCallback(t,e){const r=this.selector+", .widget_shopping_cart, .widget_shopping_cart_content";let n=!1;for(const e of t)"childList"===e.type&&e.addedNodes.forEach((t=>{t.matches&&t.matches(r)&&(n=!0)}));n&&(this.reloadContainers(),this.refresh())}reloadContainers(){jQuery(this.selector).each(((t,e)=>{const r=jQuery(e).parent();this.containers.some((t=>t.is(r)))||this.containers.push(r)}))}refresh(){for(const t of this.containers){const e=jQuery(t),r=e.width();e.removeClass("ppcp-width-500 ppcp-width-300 ppcp-width-min"),r>=500?e.addClass("ppcp-width-500"):r>=300?e.addClass("ppcp-width-300"):e.addClass("ppcp-width-min");const n=e.children(":visible").first();e.find(this.selectorInContainer).each(((t,e)=>{const r=jQuery(e);if(r.is(n))return r.css("margin-top","0px"),!0;const o=r.height(),i=Math.max(11,Math.round(.3*o));r.css("margin-top",`${i}px`)}))}}}const et=Object.freeze({INVALIDATE:"ppcp_invalidate_methods",RENDER:"ppcp_render_method",REDRAW:"ppcp_redraw_method"});function rt(t,e){return{Default:{...t.style,...e.style},MiniCart:{...t.mini_cart_style,...e.mini_cart_style}}}function nt(t){return Object.values(et).includes(t)}function ot({event:t,paymentMethod:e="",callback:r}){if(!nt(t))throw new Error(`Invalid event: ${t}`);const n=e?`${t}-${e}`:t;document.body.addEventListener(n,r)}const it=t=>"string"==typeof t?document.querySelector(t):t;class at{static methodId="generic";static cssClass="";#n;#o=!1;#i=!1;#a;#c;#u;#s=[];#l;#f;#p;#h;#d=null;#y=!0;#v=!0;#g=null;#m=[];static createButton(t,e,r,n,o){const i=(()=>{const t="__ppcpPBInstances";return document.body[t]||Object.defineProperty(document.body,t,{value:new Map,enumerable:!1,writable:!1,configurable:!1}),document.body[t]})(),a=`${this.methodId}.${t}`;if(!i.has(a)){const c=new this(t,e,r,n,o);i.set(a,c)}return i.get(a)}static getWrappers(t,e){throw new Error("Must be implemented in the child class")}static getStyles(t,e){throw new Error("Must be implemented in the child class")}constructor(t,e=null,r={},n={},o=null){if(this.methodId===at.methodId)throw new Error("Cannot initialize the PaymentButton base class");r||(r={});const i=!!r?.is_debug,a=this.methodId.replace(/^ppcp?-/,"");this.#a=t,this.#l=r,this.#f=n,this.#p=e,this.#h=o,this.#n=new Z(a,t),i&&(this.#n.enabled=!0,((t,e)=>{window.ppcpPaymentButtonList=window.ppcpPaymentButtonList||{};const r=window.ppcpPaymentButtonList;r[t]=r[t]||[],r[t].push(e)})(a,this)),this.#c=this.constructor.getWrappers(this.#l,this.#f),this.applyButtonStyles(this.#l),this.registerValidationRules(this.#b.bind(this),this.#w.bind(this)),((t,e=".ppcp-button-apm")=>{let r=e;if(!window.ppcpApmButtons){if(t&&t.button){const n=t.button.wrapper;jQuery(n).children('div[class^="item-"]').length>0&&(e+=`, ${n} div[class^="item-"]`,r+=', div[class^="item-"]')}window.ppcpApmButtons=new tt(e,r)}})(this.#f),this.initEventListeners()}get methodId(){return this.constructor.methodId}get cssClass(){return this.constructor.cssClass}get isInitialized(){return this.#o}get context(){return this.#a}get buttonConfig(){return this.#l}get ppcpConfig(){return this.#f}get externalHandler(){return this.#p||{}}get contextHandler(){return this.#h||{}}get requiresShipping(){return"function"==typeof this.contextHandler.shippingAllowed&&this.contextHandler.shippingAllowed()}get wrappers(){return this.#c}get style(){return L.MiniCart===this.context?this.#u.MiniCart:this.#u.Default}get wrapperId(){return L.MiniCart===this.context?this.wrappers.MiniCart:this.isSeparateGateway?this.wrappers.Gateway:L.Blocks.includes(this.context)?this.wrappers.Block:this.wrappers.Default}get isInsideClassicGateway(){return L.Gateways.includes(this.context)}get isSeparateGateway(){return this.#l.is_wc_gateway_enabled&&this.isInsideClassicGateway}get isCurrentGateway(){if(!this.isInsideClassicGateway)return!0;const t=T();return this.isSeparateGateway?this.methodId===t:A===t}get isPreview(){return L.Preview===this.context}get isEligible(){return this.#d}set isEligible(t){t!==this.#d&&(this.#d=t,this.triggerRedraw())}get isVisible(){return this.#y}set isVisible(t){this.#y!==t&&(this.#y=t,this.triggerRedraw())}get isEnabled(){return this.#v}set isEnabled(t){this.#v!==t&&(this.#v=t,this.triggerRedraw())}get wrapperElement(){return document.getElementById(this.wrapperId)}get ppcpButtonWrapperSelector(){return L.Blocks.includes(this.context)?null:this.context===L.MiniCart?this.ppcpConfig?.button?.mini_cart_wrapper:this.ppcpConfig?.button?.wrapper}get isPresent(){return this.wrapperElement instanceof HTMLElement}get isButtonAttached(){if(!this.#g)return!1;let t=this.#g.parentElement;for(;t?.parentElement;){if("BODY"===t.tagName)return!0;t=t.parentElement}return!1}log(...t){this.#n.log(...t)}error(...t){this.#n.error(...t)}logGroup(t=null){this.#n.group(t)}#b(t,e){this.#m.push({check:t,errorMessage:e,shouldPass:!1})}#w(t){this.#m.push({check:t,shouldPass:!0})}registerValidationRules(t,e){}validateConfiguration(t=!1){for(const e of this.#m){const r=e.check();if(e.shouldPass&&r)return!0;if(!e.shouldPass&&r)return!t&&e.errorMessage&&this.error(e.errorMessage),!1}return!0}applyButtonStyles(t,e=null){e||(e=this.ppcpConfig),this.#u=this.constructor.getStyles(t,e),this.isInitialized&&this.triggerRedraw()}configure(){}init(){this.#o=!0}reinit(){this.#o=!1,this.#d=!1}triggerRedraw(){this.showPaymentGateway(),function({event:t,paymentMethod:e=""}){if(!nt(t))throw new Error(`Invalid event: ${t}`);const r=e?`${t}-${e}`:t;document.body.dispatchEvent(new Event(r))}({event:et.REDRAW,paymentMethod:this.methodId})}syncProductButtonsState(){const t=document.querySelector(this.ppcpButtonWrapperSelector);var e;t&&(this.isVisible=!!((e=t).offsetWidth||e.offsetHeight||e.getClientRects().length),this.isEnabled=!(t=>{const e=it(t);return!!e&&jQuery(e).hasClass("ppcp-disabled")})(t))}initEventListeners(){if(ot({event:et.REDRAW,paymentMethod:this.methodId,callback:()=>this.refresh()}),this.isInsideClassicGateway){const t=this.isSeparateGateway?this.methodId:A;ot({event:et.INVALIDATE,callback:()=>this.isVisible=!1}),ot({event:et.RENDER,paymentMethod:t,callback:()=>this.isVisible=!0})}this.context===L.Product&&jQuery(document).on("ppcp-shown ppcp-hidden ppcp-enabled ppcp-disabled",((t,e)=>{jQuery(e.selector).is(this.ppcpButtonWrapperSelector)&&this.syncProductButtonsState()}))}refresh(){this.isPresent&&(this.isEligible?(this.applyWrapperStyles(),this.isEligible&&this.isCurrentGateway&&this.isVisible&&(this.isButtonAttached||(this.log("refresh.addButton"),this.addButton()))):this.wrapperElement.style.display="none")}showPaymentGateway(){if(this.#i||!this.isSeparateGateway||!this.isEligible)return;const t=`style[data-hide-gateway="${this.methodId}"]`,e=`#${this.wrappers.Default}`,r=document.querySelector(`.wc_payment_method.payment_method_${this.methodId}`);document.querySelectorAll(t).forEach((t=>t.remove())),"none"!==r.style.display&&""!==r.style.display||(r.style.display="block"),document.querySelectorAll(e).forEach((t=>t.remove())),this.log("Show gateway"),this.#i=!0,this.isVisible=this.isCurrentGateway}applyWrapperStyles(){const t=this.wrapperElement,{shape:e,height:r}=this.style;for(const e of this.#s)t.classList.remove(e);this.#s=[];const n=[`ppcp-button-${e}`,"ppcp-button-apm",this.cssClass];t.classList.add(...n),this.#s.push(...n),r&&(t.style.height=`${r}px`),t.style.display=this.isVisible?"block":"none";const o=this.context===L.Product?"form.cart":null;((t,e,r=null)=>{const n=it(t);n&&(e?(jQuery(n).removeClass("ppcp-disabled").off("mouseup").find("> *").css("pointer-events",""),((t,e)=>{jQuery(document).trigger("ppcp-enabled",{handler:"ButtonsDisabler.setEnabled",action:"enable",selector:t,element:e})})(t,n)):(jQuery(n).addClass("ppcp-disabled").on("mouseup",(function(t){if(t.stopImmediatePropagation(),r){const t=jQuery(r);t.find(".single_add_to_cart_button").hasClass("disabled")&&t.find(":submit").trigger("click")}})).find("> *").css("pointer-events","none"),((t,e)=>{jQuery(document).trigger("ppcp-disabled",{handler:"ButtonsDisabler.setEnabled",action:"disable",selector:t,element:e})})(t,n)))})(t,this.isEnabled,o)}addButton(){throw new Error("Must be implemented by the child class")}insertButton(t){if(!this.isPresent)return;const e=this.wrapperElement;this.#g&&this.removeButton(),this.log("addButton",t),this.#g=t,e.appendChild(this.#g)}removeButton(){if(this.isPresent&&this.#g){this.log("removeButton");try{this.wrapperElement.removeChild(this.#g)}catch(t){}this.#g=null}}}function ct(t){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(t)}function ut(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return st(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?st(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function lt(){lt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var w={};s(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,a)&&(w=S);var _=b.prototype=g.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==ct(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ct(e)+" is not iterable")}return m.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},E(j.prototype),s(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(_),s(_,u,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))}}function ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,St(n.key),n)}}function dt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(dt=function(){return!!t})()}function yt(t,e,r,n){var o=vt(gt(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof o?function(t){return o.apply(r,t)}:o}function vt(){return vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=gt(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},vt.apply(null,arguments)}function gt(t){return gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gt(t)}function mt(t,e){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mt(t,e)}function bt(t,e,r){wt(t,e),e.set(t,r)}function wt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xt(t,e,r){return(e=St(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function St(t){var e=function(t){if("object"!=ct(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ct(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ct(e)?e:e+""}function _t(t,e){return t.get(jt(t,e))}function Et(t,e,r){return t.set(jt(t,e),r),r}function jt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ot=new WeakMap,Pt=new WeakMap,kt=new WeakMap,Ct=new WeakMap,At=new WeakMap,Lt=new WeakMap,Tt=new WeakMap,It=new WeakSet,Rt=function(t){function e(t,r,n,o,i){var a,c,u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),a=function(t,e,r){return e=gt(e),function(t,e){if(e&&("object"==ct(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,dt()?Reflect.construct(e,r||[],gt(t).constructor):e.apply(t,r))}(this,e,[t,r,n,o,i]),wt(c=a,u=It),u.add(c),bt(a,Ot,null),bt(a,Pt,[]),bt(a,kt,[]),bt(a,Ct,null),bt(a,At,null),bt(a,Lt,null),bt(a,Tt,{}),a.init=a.init.bind(a),a.onPaymentAuthorized=a.onPaymentAuthorized.bind(a),a.onButtonClick=a.onButtonClick.bind(a),Et(Tt,a,{quantity:null,items:[]}),a.log("Create instance"),a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mt(t,e)}(e,t),r=e,n=[{key:"requiresShipping",get:function(){var t;return!!yt(e,"requiresShipping",this,1)&&!(null===(t=this.buttonConfig.product)||void 0===t||!t.needShipping)&&(L.Checkout!==this.context||this.shouldUpdateButtonWithFormData)}},{key:"transactionInfo",get:function(){return _t(At,this)},set:function(t){Et(At,this,t),this.refresh()}},{key:"nonce",get:function(){var t=document.getElementById("woocommerce-process-checkout-nonce");return(null==t?void 0:t.value)||this.buttonConfig.nonce}},{key:"registerValidationRules",value:function(t,e){var r=this;e((function(){return r.isPreview})),t((function(){return!_t(Lt,r)}),"No API configuration - missing configure() call?"),t((function(){return!_t(At,r)}),"No transactionInfo - missing configure() call?"),t((function(){var t;return!(null!==(t=r.contextHandler)&&void 0!==t&&t.validateContext())}),"Invalid context handler.")}},{key:"configure",value:function(t,e){Et(Lt,this,t),Et(At,this,e)}},{key:"init",value:function(){this.isInitialized||this.validateConfiguration()&&(yt(e,"init",this,3)([]),this.checkEligibility())}},{key:"reinit",value:function(){this.validateConfiguration(!0)&&(yt(e,"reinit",this,3)([]),this.init())}},{key:"checkEligibility",value:function(){if(this.isPreview)this.isEligible=!0;else try{var t;if(null===(t=window.ApplePaySession)||void 0===t||!t.canMakePayments())return void(this.isEligible=!1);this.isEligible=!!_t(Lt,this).isEligible}catch(t){this.isEligible=!1}}},{key:"applePaySession",value:function(t){this.log("applePaySession",t);var e=new ApplePaySession(4,t);return this.requiresShipping&&(e.onshippingmethodselected=this.onShippingMethodSelected(e),e.onshippingcontactselected=this.onShippingContactSelected(e)),e.onvalidatemerchant=this.onValidateMerchant(e),e.onpaymentauthorized=this.onPaymentAuthorized(e),e.begin(),e}},{key:"applyWrapperStyles",value:function(){yt(e,"applyWrapperStyles",this,3)([]);var t=this.style.height;if(t){var r=this.wrapperElement;r.style.setProperty("--apple-pay-button-height","".concat(t,"px")),r.style.height="".concat(t,"px")}}},{key:"addButton",value:function(){var t=this,e=this.style,r=e.color,n=e.type,o=e.language,i=document.createElement("apple-pay-button");i.id="apple-"+this.wrapperId,i.setAttribute("buttonstyle",r),i.setAttribute("type",n),i.setAttribute("locale",o),i.addEventListener("click",(function(e){e.preventDefault(),t.onButtonClick()})),this.insertButton(i)}},{key:"onButtonClick",value:(i=pt(lt().mark((function t(){var e,r,n,o,i,a,c;return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.log("onButtonClick"),e=this.paymentRequest(),window.ppcpFundingSource="apple_pay",L.Checkout!==this.context){t.next=26;break}r="form.woocommerce-checkout",n=new R(PayPalCommerceGateway.labels.error.generic,document.querySelector(".woocommerce-notices-wrapper"));try{o=new FormData(document.querySelector(r)),Et(Ot,this,Object.fromEntries(o.entries())),this.updateRequestDataWithForm(e)}catch(t){console.error(t)}if(this.log("=== paymentRequest",e),i=this.applePaySession(e),!(a=PayPalCommerceGateway.early_checkout_validation_enabled?new I(PayPalCommerceGateway.ajax.validate_checkout.endpoint,PayPalCommerceGateway.ajax.validate_checkout.nonce):null)){t.next=25;break}return t.prev=11,t.next=14,a.validate(document.querySelector(r));case 14:if(!((c=t.sent).length>0)){t.next=20;break}return n.messages(c),jQuery(document.body).trigger("checkout_error",[n.currentHtml()]),i.abort(),t.abrupt("return");case 20:t.next=25;break;case 22:t.prev=22,t.t0=t.catch(11),console.error(t.t0);case 25:return t.abrupt("return");case 26:this.applePaySession(e);case 27:case"end":return t.stop()}}),t,this,[[11,22]])}))),function(){return i.apply(this,arguments)})},{key:"shouldUpdateButtonWithFormData",get:function(){var t;return L.Checkout===this.context&&"use_applepay"===(null===(t=this.buttonConfig)||void 0===t||null===(t=t.preferences)||void 0===t?void 0:t.checkout_data_mode)}},{key:"shouldCompletePaymentWithContextHandler",get:function(){return!this.contextHandler.shippingAllowed()||L.Checkout===this.context&&!this.shouldUpdateButtonWithFormData}},{key:"updateRequestDataWithForm",value:function(t){if(this.shouldUpdateButtonWithFormData&&(t.billingContact=this.fillBillingContact(_t(Ot,this)),this.requiresShipping)){t.shippingContact=this.fillShippingContact(_t(Ot,this));var e=this.transactionInfo.chosenShippingMethods[0];t.shippingMethods=[];var r,n=ut(this.transactionInfo.shippingPackages);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(e===o.id){var i={label:o.label,detail:"",amount:o.cost_str,identifier:o.id};Et(kt,this,i),t.shippingMethods.push(i);break}}}catch(t){n.e(t)}finally{n.f()}var a,c=ut(this.transactionInfo.shippingPackages);try{for(c.s();!(a=c.n()).done;){var u=a.value;e!==u.id&&t.shippingMethods.push({label:u.label,detail:"",amount:u.cost_str,identifier:u.id})}}catch(t){c.e(t)}finally{c.f()}Et(Ct,this,t),this.log("=== paymentRequest.shippingMethods",t.shippingMethods)}}},{key:"paymentRequest",value:function(){var t=_t(Lt,this),e=this.buttonConfig,r={countryCode:t.countryCode,merchantCapabilities:t.merchantCapabilities,supportedNetworks:t.supportedNetworks,requiredShippingContactFields:["postalAddress","email","phone"],requiredBillingContactFields:["postalAddress"]};this.requiresShipping||(this.shouldCompletePaymentWithContextHandler?r.requiredShippingContactFields=[]:r.requiredShippingContactFields=["email","phone"]);var n=Object.assign({},r);return n.currencyCode=e.shop.currencyCode,n.total={label:e.shop.totalLabel,type:"final",amount:this.transactionInfo.totalPrice},n}},{key:"refreshProductContextData",value:function(){var t;L.Product===this.context&&(_t(Tt,this).quantity=null===(t=document.querySelector("input.qty"))||void 0===t?void 0:t.value,_t(Tt,this).items=this.contextHandler.products(),this.log("Products updated",_t(Tt,this)))}},{key:"adminValidation",value:function(t){fetch(this.buttonConfig.ajax_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"ppcp_validate","woocommerce-process-checkout-nonce":this.nonce,validation:t}).toString()})}},{key:"onValidateMerchant",value:function(t){var e=this;return function(r){e.log("onvalidatemerchant call"),f.paypal.Applepay().validateMerchant({validationUrl:r.validationURL}).then((function(r){t.completeMerchantValidation(r.merchantSession),e.adminValidation(!0)})).catch((function(r){console.error(r),e.adminValidation(!1),e.log("onvalidatemerchant session abort"),t.abort()}))}}},{key:"onShippingMethodSelected",value:function(t){var e=this;this.log("onshippingmethodselected",this.buttonConfig.ajax_url);var r=this.buttonConfig.ajax_url;return function(n){e.log("onshippingmethodselected call");var o=e.getShippingMethodData(n);jQuery.ajax({url:r,method:"POST",data:o,success:function(r){e.log("onshippingmethodselected ok");var o=r.data;!1===r.success&&(o.errors=X(o.errors)),Et(kt,e,n.shippingMethod),o.newShippingMethods=o.newShippingMethods.sort((function(t){return t.label===_t(kt,e).label?-1:1})),!1===r.success&&(o.errors=X(o.errors)),t.completeShippingMethodSelection(o)},error:function(r,n,o){e.log("onshippingmethodselected error",n),console.warn(n,o),t.abort()}})}}},{key:"onShippingContactSelected",value:function(t){var e=this;this.log("onshippingcontactselected",this.buttonConfig.ajax_url);var r=this.buttonConfig.ajax_url;return function(n){e.log("onshippingcontactselected call");var o=e.getShippingContactData(n);jQuery.ajax({url:r,method:"POST",data:o,success:function(r){e.log("onshippingcontactselected ok");var o=r.data;Et(Pt,e,n.shippingContact),!1===r.success&&(o.errors=X(o.errors)),o.newShippingMethods&&Et(kt,e,o.newShippingMethods[0]),t.completeShippingContactSelection(o)},error:function(r,n,o){e.log("onshippingcontactselected error",n),console.warn(n,o),t.abort()}})}}},{key:"getShippingContactData",value:function(t){var e=this.buttonConfig.product.id;switch(this.refreshProductContextData(),this.context){case L.Product:return{action:"ppcp_update_shipping_contact",product_id:e,products:JSON.stringify(_t(Tt,this).items),caller_page:"productDetail",product_quantity:_t(Tt,this).quantity,simplified_contact:t.shippingContact,need_shipping:this.requiresShipping,"woocommerce-process-checkout-nonce":this.nonce};case L.Cart:case L.Checkout:case L.BlockCart:case L.BlockCheckout:case L.MiniCart:return{action:"ppcp_update_shipping_contact",simplified_contact:t.shippingContact,caller_page:"cart",need_shipping:this.requiresShipping,"woocommerce-process-checkout-nonce":this.nonce}}}},{key:"getShippingMethodData",value:function(t){var e,r,n,o,i,a,c=this.buttonConfig.product.id;switch(this.refreshProductContextData(),this.context){case L.Product:return{action:"ppcp_update_shipping_method",shipping_method:t.shippingMethod,simplified_contact:this.hasValidContactInfo(_t(Pt,this))?_t(Pt,this):null!==(e=null===(r=_t(Ct,this))||void 0===r?void 0:r.shippingContact)&&void 0!==e?e:null===(n=_t(Ct,this))||void 0===n?void 0:n.billingContact,product_id:c,products:JSON.stringify(_t(Tt,this).items),caller_page:"productDetail",product_quantity:_t(Tt,this).quantity,"woocommerce-process-checkout-nonce":this.nonce};case L.Cart:case L.Checkout:case L.BlockCart:case L.BlockCheckout:case L.MiniCart:return{action:"ppcp_update_shipping_method",shipping_method:t.shippingMethod,simplified_contact:this.hasValidContactInfo(_t(Pt,this))?_t(Pt,this):null!==(o=null===(i=_t(Ct,this))||void 0===i?void 0:i.shippingContact)&&void 0!==o?o:null===(a=_t(Ct,this))||void 0===a?void 0:a.billingContact,caller_page:"cart","woocommerce-process-checkout-nonce":this.nonce}}}},{key:"onPaymentAuthorized",value:function(t){var e=this;return this.log("onpaymentauthorized"),function(){var r=pt(lt().mark((function r(n){var o,i,a,c,u,s;return lt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.log("onpaymentauthorized call"),o=function(){var t=pt(lt().mark((function t(r){return lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,o){try{var i,a=r.billing_contact||_t(Ct,e).billingContact,c=r.shipping_contact||_t(Ct,e).shippingContact,u=_t(kt,e)||(_t(Ct,e).shippingMethods||[])[0],s={action:"ppcp_create_order",caller_page:e.context,product_id:null!==(i=e.buttonConfig.product.id)&&void 0!==i?i:null,products:JSON.stringify(_t(Tt,e).items),product_quantity:_t(Tt,e).quantity,shipping_contact:c,billing_contact:a,token:n.payment.token,shipping_method:u,"woocommerce-process-checkout-nonce":e.nonce,funding_source:"applepay",_wp_http_referer:"/?wc-ajax=update_order_review",paypal_order_id:r.paypal_order_id};e.log("onpaymentauthorized request",e.buttonConfig.ajax_url,r),jQuery.ajax({url:e.buttonConfig.ajax_url,method:"POST",data:s,complete:function(){e.log("onpaymentauthorized complete")},success:function(r){e.log("onpaymentauthorized ok"),t(r)},error:function(t,r,n){e.log("onpaymentauthorized error",r),o(new Error(n))}})}catch(t){e.error("onpaymentauthorized catch",t)}})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),r.next=4,e.contextHandler.createOrder();case 4:return i=r.sent,e.log("onpaymentauthorized paypal order ID",i,n.payment.token,n.payment.billingContact),r.prev=6,r.next=9,f.paypal.Applepay().confirmOrder({orderId:i,token:n.payment.token,billingContact:n.payment.billingContact});case 9:if(a=r.sent,e.log("onpaymentauthorized confirmOrderResponse",a),!a||!a.approveApplePayPayment){r.next=39;break}if("APPROVED"!==a.approveApplePayPayment.status){r.next=35;break}if(r.prev=13,!e.shouldCompletePaymentWithContextHandler){r.next=21;break}return c=!1,r.next=18,e.contextHandler.approveOrder({orderID:i},{restart:function(){return new Promise((function(t){c=!0,t()}))},order:{get:function(){return new Promise((function(t){t(null)}))}}});case 18:c?(e.error("onpaymentauthorized approveOrder FAIL"),t.completePayment(ApplePaySession.STATUS_FAILURE),t.abort()):(e.log("onpaymentauthorized approveOrder OK"),t.completePayment(ApplePaySession.STATUS_SUCCESS)),r.next=26;break;case 21:return u={billing_contact:n.payment.billingContact,shipping_contact:n.payment.shippingContact,paypal_order_id:i},r.next=24,o(u);case 24:"success"===(s=r.sent).result?(t.completePayment(ApplePaySession.STATUS_SUCCESS),window.location.href=s.redirect):t.completePayment(ApplePaySession.STATUS_FAILURE);case 26:r.next=33;break;case 28:r.prev=28,r.t0=r.catch(13),t.completePayment(ApplePaySession.STATUS_FAILURE),t.abort(),console.error(r.t0);case 33:r.next=37;break;case 35:console.error("Error status is not APPROVED"),t.completePayment(ApplePaySession.STATUS_FAILURE);case 37:r.next=41;break;case 39:console.error("Invalid confirmOrderResponse"),t.completePayment(ApplePaySession.STATUS_FAILURE);case 41:r.next=48;break;case 43:r.prev=43,r.t1=r.catch(6),console.error("Error confirming order with applepay token",r.t1),t.completePayment(ApplePaySession.STATUS_FAILURE),t.abort();case 48:case"end":return r.stop()}}),r,null,[[6,43],[13,28]])})));return function(t){return r.apply(this,arguments)}}()}},{key:"fillBillingContact",value:function(t){return jt(It,this,Mt).call(this,t,"billing","")}},{key:"fillShippingContact",value:function(t){return null!=t&&t.shipping_first_name?jt(It,this,Mt).call(this,t,"shipping","billing"):this.fillBillingContact(t)}},{key:"hasValidContactInfo",value:function(t){return Array.isArray(t)?t.length>0:Object.keys(t||{}).length>0}}],o=[{key:"getWrappers",value:function(t,e){var r,n,o;return function(t="",e="",r="",n="",o=""){const i=t=>t.replace(/^#/,"");return{Default:i(t),SmartButton:i(r),Block:i(n),Gateway:i(o),MiniCart:i(e)}}((null==t||null===(r=t.button)||void 0===r?void 0:r.wrapper)||"",(null==t||null===(n=t.button)||void 0===n?void 0:n.mini_cart_wrapper)||"",(null==e||null===(o=e.button)||void 0===o?void 0:o.wrapper)||"","ppc-button-applepay-container","ppc-button-ppcp-applepay")}},{key:"getStyles",value:function(t,e){var r=(null==t?void 0:t.button)||{},n={color:r.color,lang:r.lang,type:r.type},o={style:n,mini_cart_style:n};return rt((null==e?void 0:e.button)||{},o)}}],n&&ht(r.prototype,n),o&&ht(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(at);function Mt(t,e,r){t&&"object"===ct(t)||(t={});var n=function(n){return t["".concat(e,"_").concat(n)]||t["".concat(r,"_").concat(n)]||""};return{givenName:n("first_name"),familyName:n("last_name"),emailAddress:n("email"),phoneNumber:n("phone"),addressLines:[n("address_1"),n("address_2")],locality:n("city"),postalCode:n("postcode"),countryCode:n("country"),administrativeArea:n("state")}}xt(Rt,"methodId","ppcp-applepay"),xt(Rt,"cssClass","ppcp-button-applepay");const Nt=Rt,Ft=class{constructor(t,e,r,n){this.id=t,this.quantity=e,this.variations=r,this.extra=n}data(){return{id:this.id,quantity:this.quantity,variations:this.variations,extra:this.extra}}},Bt=class extends Ft{constructor(t,e,r,n){super(t,e,null,n),this.booking=r}data(){return{...super.data(),booking:this.booking}}},Dt=class{constructor(t=[]){this.cartItemKeys=t}getEndpoint(){let t="/?wc-ajax=%%endpoint%%";return"undefined"!=typeof wc_cart_fragments_params&&wc_cart_fragments_params.wc_ajax_url&&(t=wc_cart_fragments_params.wc_ajax_url),t.toString().replace("%%endpoint%%","remove_from_cart")}addFromPurchaseUnits(t){for(const e of t||[])for(const t of e.items||[])t.cart_item_key&&this.cartItemKeys.push(t.cart_item_key);return this}removeFromCart(){return new Promise(((t,e)=>{if(!this.cartItemKeys||!this.cartItemKeys.length)return void t();const r=this.cartItemKeys.length;let n=0;const o=()=>{n++,n>=r&&t()};for(const t of this.cartItemKeys){const e=new URLSearchParams;e.append("cart_item_key",t),t?fetch(this.getEndpoint(),{method:"POST",credentials:"same-origin",body:e}).then((function(t){return t.json()})).then((()=>{o()})).catch((()=>{o()})):o()}}))}};class Gt{static getPrefixedFields(t,e){const r=new FormData(t),n={};for(const[t,o]of r.entries())e&&!t.startsWith(e)||(n[t]=o);return n}static getFilteredFields(t,e,r){const n=new FormData(t),o={},i={};for(let[t,a]of n.entries()){if(-1!==t.indexOf("[]")){const e=t;i[e]=i[e]||0,t=t.replace("[]",`[${i[e]}]`),i[e]++}t&&(e&&-1!==e.indexOf(t)||r&&r.some((e=>t.startsWith(e)))||(o[t]=a))}return o}}const Ut=class{constructor(t,e,r,n){this.config=t,this.updateCart=e,this.formElement=r,this.errorHandler=n,this.cartHelper=null}subscriptionsConfiguration(t){return{createSubscription:(e,r)=>r.subscription.create({plan_id:t}),onApprove:(t,e)=>{fetch(this.config.ajax.approve_subscription.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.approve_subscription.nonce,order_id:t.orderID,subscription_id:t.subscriptionID})}).then((t=>t.json())).then((()=>{const t=this.getSubscriptionProducts();fetch(this.config.ajax.change_cart.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.change_cart.nonce,products:t})}).then((t=>t.json())).then((t=>{if(!t.success)throw console.log(t),Error(t.data.message);location.href=this.config.redirect}))}))},onError:t=>{console.error(t)}}}getSubscriptionProducts(){const t=document.querySelector('[name="add-to-cart"]').value;return[new Ft(t,1,this.variations(),this.extraFields())]}configuration(){return{createOrder:this.createOrder(),onApprove:N(this,this.errorHandler),onError:t=>{if(this.refreshMiniCart(),this.isBookingProduct()&&t.message)return this.errorHandler.clear(),void this.errorHandler.message(t.message);this.errorHandler.genericError()},onCancel:()=>{this.isBookingProduct()?this.cleanCart():this.refreshMiniCart()}}}getProducts(){if(this.isBookingProduct()){const t=document.querySelector('[name="add-to-cart"]').value;return[new Bt(t,1,Gt.getPrefixedFields(this.formElement,"wc_bookings_field"),this.extraFields())]}if(this.isGroupedProduct()){const t=[];return this.formElement.querySelectorAll('input[type="number"]').forEach((e=>{if(!e.value)return;const r=e.getAttribute("name").match(/quantity\[([\d]*)\]/);if(2!==r.length)return;const n=parseInt(r[1]),o=parseInt(e.value);t.push(new Ft(n,o,null,this.extraFields()))})),t}const t=document.querySelector('[name="add-to-cart"]').value,e=document.querySelector('[name="quantity"]').value,r=this.variations();return[new Ft(t,e,r,this.extraFields())]}extraFields(){return Gt.getFilteredFields(this.formElement,["add-to-cart","quantity","product_id","variation_id"],["attribute_","wc_bookings_field"])}createOrder(){return this.cartHelper=null,(t,e,r={})=>(this.errorHandler.clear(),this.updateCart.update((t=>{this.cartHelper=(new Dt).addFromPurchaseUnits(t);const e=C(),r=void 0!==this.config.bn_codes[this.config.context]?this.config.bn_codes[this.config.context]:"";return fetch(this.config.ajax.create_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.create_order.nonce,purchase_units:t,payer:e,bn_code:r,payment_method:A,funding_source:window.ppcpFundingSource,context:this.config.context})}).then((function(t){return t.json()})).then((function(t){if(!t.success)throw console.error(t),Error(t.data.message);return t.data.id}))}),this.getProducts(),r.updateCartOptions||{}))}variations(){return this.hasVariations()?[...this.formElement.querySelectorAll("[name^='attribute_']")].map((t=>({value:t.value,name:t.name}))):null}hasVariations(){return this.formElement.classList.contains("variations_form")}isGroupedProduct(){return this.formElement.classList.contains("grouped_form")}isBookingProduct(){return!!this.formElement.querySelector(".wc-booking-product-id")}cleanCart(){this.cartHelper.removeFromCart().then((()=>{this.refreshMiniCart()})).catch((t=>{this.refreshMiniCart()}))}refreshMiniCart(){jQuery(document.body).trigger("wc_fragment_refresh")}},qt=class{constructor(t,e){this.endpoint=t,this.nonce=e}simulate(t,e){return new Promise(((r,n)=>{fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.nonce,products:e})}).then((t=>t.json())).then((e=>{if(!e.success)return void n(e.data);const o=t(e.data);r(o)}))}))}},Ht=class{constructor(t,e){this.endpoint=t,this.nonce=e}update(t,e,r={}){return new Promise(((n,o)=>{fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.nonce,products:e,...r})}).then((t=>t.json())).then((e=>{if(!e.success)return void o(e.data);const r=t(e.data);n(r)}))}))}};function zt(t){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}function Wt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vt(n.key),n)}}function Vt(t){var e=function(t){if("object"!=zt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zt(e)?e:e+""}function $t(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return($t=function(){return!!t})()}function Qt(t){return Qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qt(t)}function Jt(t,e){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jt(t,e)}const Yt=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=Qt(e),function(t,e){if(e&&("object"==zt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,$t()?Reflect.construct(e,r||[],Qt(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jt(t,e)}(e,t),r=e,(n=[{key:"validateContext",value:function(){var t;return null===(t=this.ppcpConfig)||void 0===t||null===(t=t.locations_with_subscription_product)||void 0===t||!t.product||this.isVaultV3Mode()}},{key:"transactionInfo",value:function(){var t=this,e=new R(this.ppcpConfig.labels.error.generic,document.querySelector(".woocommerce-notices-wrapper")),r=new Ut(null,null,document.querySelector("form.cart"),e),n=PayPalCommerceGateway.data_client_id.has_subscriptions&&PayPalCommerceGateway.data_client_id.paypal_subscriptions_enabled?r.getSubscriptionProducts():r.getProducts();return new Promise((function(e,r){new qt(t.ppcpConfig.ajax.simulate_cart.endpoint,t.ppcpConfig.ajax.simulate_cart.nonce).simulate((function(t){e({countryCode:t.country_code,currencyCode:t.currency_code,totalPriceStatus:"FINAL",totalPrice:t.total})}),n)}))}},{key:"createOrder",value:function(){return this.actionHandler().configuration().createOrder(null,null,{updateCartOptions:{keepShipping:!0}})}},{key:"actionHandler",value:function(){return new Ut(this.ppcpConfig,new Ht(this.ppcpConfig.ajax.change_cart.endpoint,this.ppcpConfig.ajax.change_cart.nonce),document.querySelector("form.cart"),this.errorHandler())}},{key:"products",value:function(){return this.actionHandler().getProducts()}}])&&Wt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(q);function Kt(t){return Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(t)}function Xt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xt=function(){return!!t})()}function Zt(t){return Zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zt(t)}function te(t,e){return te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},te(t,e)}const ee=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=Zt(e),function(t,e){if(e&&("object"==Kt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xt()?Reflect.construct(e,r||[],Zt(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&te(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(q);function re(t){return re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},re(t)}function ne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ne=function(){return!!t})()}function oe(t){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oe(t)}function ie(t,e){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ie(t,e)}const ae=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=oe(e),function(t,e){if(e&&("object"==re(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ne()?Reflect.construct(e,r||[],oe(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ie(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(q);function ce(t){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(t)}function ue(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ue=function(){return!!t})()}function se(t){return se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},se(t)}function le(t,e){return le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},le(t,e)}const fe=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=se(e),function(t,e){if(e&&("object"==ce(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ue()?Reflect.construct(e,r||[],se(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&le(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(q);function pe(t){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(t)}function he(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(he=function(){return!!t})()}function de(t){return de=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},de(t)}function ye(t,e){return ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ye(t,e)}const ve=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=de(e),function(t,e){if(e&&("object"==pe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,he()?Reflect.construct(e,r||[],de(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ye(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(q);function ge(t){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(t)}function me(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,be(n.key),n)}}function be(t){var e=function(t){if("object"!=ge(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ge(e)?e:e+""}function we(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(we=function(){return!!t})()}function xe(t){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xe(t)}function Se(t,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Se(t,e)}const _e=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=xe(e),function(t,e){if(e&&("object"==ge(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,we()?Reflect.construct(e,r||[],xe(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Se(t,e)}(e,t),r=e,(n=[{key:"transactionInfo",value:function(){return{countryCode:"US",currencyCode:"USD",totalPrice:"10.00",totalPriceStatus:"FINAL"}}},{key:"createOrder",value:function(){throw new Error("Create order fail. This is just a preview.")}},{key:"approveOrder",value:function(){throw new Error("Approve order fail. This is just a preview.")}},{key:"actionHandler",value:function(){throw new Error("Action handler fail. This is just a preview.")}},{key:"errorHandler",value:function(){throw new Error("Error handler fail. This is just a preview.")}}])&&me(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(q);function Ee(t){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(t)}function je(){je=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var w={};s(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,a)&&(w=S);var _=b.prototype=g.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==Ee(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Ee(e)+" is not iterable")}return m.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},E(j.prototype),s(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(_),s(_,u,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Oe(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Pe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ke(n.key),n)}}function ke(t){var e=function(t){if("object"!=Ee(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ee(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ee(e)?e:e+""}function Ce(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ce=function(){return!!t})()}function Ae(t){return Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ae(t)}function Le(t,e){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Le(t,e)}const Te=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=Ae(e),function(t,e){if(e&&("object"==Ee(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ce()?Reflect.construct(e,r||[],Ae(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Le(t,e)}(e,t),r=e,n=[{key:"validateContext",value:function(){var t;return null===(t=this.ppcpConfig)||void 0===t||null===(t=t.locations_with_subscription_product)||void 0===t||!t.payorder||this.isVaultV3Mode()}},{key:"transactionInfo",value:function(){var t=this;return new Promise(function(){var e,r=(e=je().mark((function e(r,n){var o;return je().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=t.ppcpConfig.pay_now,r({countryCode:o.country_code,currencyCode:o.currency_code,totalPriceStatus:"FINAL",totalPrice:o.total_str});case 2:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){Oe(i,n,o,a,c,"next",t)}function c(t){Oe(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,e){return r.apply(this,arguments)}}())}},{key:"actionHandler",value:function(){return new M(this.ppcpConfig,this.errorHandler(),new j)}}],n&&Pe(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(q);function Ie(t){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(t)}function Re(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Me(n.key),n)}}function Me(t){var e=function(t){if("object"!=Ie(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ie(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ie(e)?e:e+""}var Ne=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"create",value:function(t,e,r){switch(t){case"product":return new Yt(e,r);case"cart":return new ee(e,r);case"checkout":return new J(e,r);case"pay-now":return new Te(e,r);case"mini-cart":return new ve(e,r);case"cart-block":return new ae(e,r);case"checkout-block":return new fe(e,r);case"preview":return new _e(e,r)}}}],null&&Re(t.prototype,null),e&&Re(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const Fe=Ne;function Be(t){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(t)}function De(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ge(){Ge=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var w={};s(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,a)&&(w=S);var _=b.prototype=g.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==Be(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Be(e)+" is not iterable")}return m.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},E(j.prototype),s(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(_),s(_,u,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Ue(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function qe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ue(i,n,o,a,c,"next",t)}function c(t){Ue(i,n,o,a,c,"throw",t)}a(void 0)}))}}function He(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ze(n.key),n)}}function ze(t){var e=function(t){if("object"!=Be(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Be(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Be(e)?e:e+""}function We(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function Ve(t,e){return t.get(Qe(t,e))}function $e(t,e,r){return t.set(Qe(t,e),r),r}function Qe(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Je=new WeakMap,Ye=new WeakMap,Ke=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,tr=new WeakMap,er=new WeakMap,rr=function(){return t=function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),We(this,Je,""),We(this,Ye,null),We(this,Ke,null),We(this,Xe,null),We(this,Ze,null),We(this,tr,null),We(this,er,[]),$e(Je,this,e),$e(Ye,this,r),$e(Ke,this,n),this.onContextBootstrap=this.onContextBootstrap.bind(this),Y.watchContextBootstrap(this.onContextBootstrap)},e=[{key:"onContextBootstrap",value:(o=qe(Ge().mark((function t(e){var r;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return $e(Ze,this,Fe.create(e.context,Ve(Ye,this),Ve(Ke,this),e.handler)),r=Nt.createButton(e.context,e.handler,Ve(Ye,this),Ve(Ke,this),Ve(Ze,this)),Ve(er,this).push(r),t.next=5,this.init();case 5:r.configure(Ve(Xe,this),Ve(tr,this)),r.init();case 7:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"init",value:(n=qe(Ge().mark((function t(){return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,Ve(Xe,this)){t.next=10;break}return t.t0=$e,t.t1=Xe,t.t2=this,t.next=7,window[Ve(Je,this)].Applepay().config();case 7:t.t3=t.sent,(0,t.t0)(t.t1,t.t2,t.t3),Ve(Xe,this)||console.error("No ApplePayConfig received during init");case 10:if(Ve(tr,this)){t.next=19;break}return t.t4=$e,t.t5=tr,t.t6=this,t.next=16,this.fetchTransactionInfo();case 16:t.t7=t.sent,(0,t.t4)(t.t5,t.t6,t.t7),Ve(Xe,this)||console.error("No transactionInfo found during init");case 19:t.next=24;break;case 21:t.prev=21,t.t8=t.catch(0),console.error("Error during initialization:",t.t8);case 24:case"end":return t.stop()}}),t,this,[[0,21]])}))),function(){return n.apply(this,arguments)})},{key:"fetchTransactionInfo",value:(r=qe(Ge().mark((function t(){return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,Ve(Ze,this)){t.next=3;break}throw new Error("ContextHandler is not initialized");case 3:return t.next=5,Ve(Ze,this).transactionInfo();case 5:return t.abrupt("return",t.sent);case 8:throw t.prev=8,t.t0=t.catch(0),console.error("Error fetching transaction info:",t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(){return r.apply(this,arguments)})},{key:"reinit",value:function(){var t,e=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return De(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?De(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(Ve(er,this));try{for(e.s();!(t=e.n()).done;)t.value.reinit()}catch(t){e.e(t)}finally{e.f()}}}],e&&He(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();const nr=rr;function or(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const ir=function(t,e,r,o,i){var a,c,u=(a=(0,n.useState)(null),c=2,function(t){if(Array.isArray(t))return t}(a)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(a,c)||function(t,e){if(t){if("string"==typeof t)return or(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?or(t,e):void 0}}(a,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],l=u[1],f=function(t,e){return(0,n.useMemo)((function(){var r=rt((null==e?void 0:e.button)||{},(null==t?void 0:t.button)||{});return r.MiniCart&&"buy"===r.MiniCart.type&&(r.MiniCart.type="pay"),r}),[t,e])}(r,o);return(0,n.useEffect)((function(){if(r&&i){var t=document.createElement("apple-pay-button");return t.setAttribute("buttonstyle",r.buttonColor||"black"),t.setAttribute("type",r.buttonType||"pay"),t.setAttribute("locale",r.buttonLocale||"en"),l(t),function(){l(null)}}}),[e,r,o,i,f]),s};function ar(t){return ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ar(t)}function cr(){cr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var w={};s(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,a)&&(w=S);var _=b.prototype=g.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==ar(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ar(e)+" is not iterable")}return m.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},E(j.prototype),s(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(_),s(_,u,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ur(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const lr=function(t,e){var r,o,i=(r=(0,n.useState)(!1),o=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(r,o)||function(t,e){if(t){if("string"==typeof t)return sr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sr(t,e):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],c=i[1];return e.url_params.components+=",applepay",(0,n.useEffect)((function(){var r=function(){var r,n=(r=cr().mark((function r(){return cr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,_(t,e);case 3:c(!0),r.next=9;break;case 6:r.prev=6,r.t0=r.catch(0),console.error("Error loading PayPal script: ".concat(r.t0));case 9:case"end":return r.stop()}}),r,null,[[0,6]])})),function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){ur(i,n,o,a,c,"next",t)}function c(t){ur(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return n.apply(this,arguments)}}();r()}),[t,e]),a};function fr(t){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(t)}function pr(){pr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var w={};s(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,a)&&(w=S);var _=b.prototype=g.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==fr(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(fr(e)+" is not iterable")}return m.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},E(j.prototype),s(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(_),s(_,u,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function hr(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function dr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const yr=function(t,e,r){var o,i,a=(o=(0,n.useState)(!1),i=2,function(t){if(Array.isArray(t))return t}(o)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(o,i)||function(t,e){if(t){if("string"==typeof t)return dr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dr(t,e):void 0}}(o,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=a[0],u=a[1];return(0,n.useEffect)((function(){if(t){var n=function(e){if(document!==t){var r=document.querySelector('script[src^="'.concat(e,'"]'));if(r){var n=t.createElement("script");n.src=r.src,n.async=r.async,n.type=r.type,t.head.appendChild(n)}else console.error("Script not found in the document:",e)}},o=function(){var t,o=(t=pr().mark((function t(){return pr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return");case 2:if(e&&e.sdk_url){t.next=5;break}return console.error("Invalid buttonConfig or missing sdk_url"),t.abrupt("return");case 5:return t.prev=5,t.next=8,E({url:e.sdk_url}).then((function(){n(e.sdk_url)}));case 8:u(!0),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(5),console.error("Failed to load Applepay script:",t.t0);case 14:case"end":return t.stop()}}),t,null,[[5,11]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){hr(i,n,o,a,c,"next",t)}function c(t){hr(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return o.apply(this,arguments)}}();o()}}),[t,e,r]),c};function vr(t){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vr(t)}function gr(){gr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var w={};s(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(L([])));S&&S!==r&&n.call(S,a)&&(w=S);var _=b.prototype=g.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==vr(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(vr(e)+" is not iterable")}return m.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},E(j.prototype),s(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(_),s(_,u,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function mr(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const wr=function(t,e){var r,o,i=(r=(0,n.useState)(null),o=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(r,o)||function(t,e){if(t){if("string"==typeof t)return br(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?br(t,e):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],c=i[1];return(0,n.useEffect)((function(){var r=function(){var r,n=(r=gr().mark((function r(){var n;return gr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e){r.next=2;break}return r.abrupt("return");case 2:return r.prev=2,r.next=5,window[t].Applepay().config();case 5:n=r.sent,c(n),r.next=12;break;case 9:r.prev=9,r.t0=r.catch(2),console.error("Failed to fetch Apple Pay config:",r.t0);case 12:case"end":return r.stop()}}),r,null,[[2,9]])})),function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){mr(i,n,o,a,c,"next",t)}function c(t){mr(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return n.apply(this,arguments)}}();r()}),[t,e]),a};function xr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Sr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const _r=function(t){var e=t.namespace,r=t.buttonConfig,o=t.ppcpConfig,i=xr((0,n.useState)(""),2),a=i[0],c=i[1],u=xr((0,n.useState)(null),2),s=u[0],l=u[1],f=xr((0,n.useState)(null),2),p=f[0],h=f[1],d=lr(e,o),y=yr(p,r,d),v=wr(e,y);(0,n.useEffect)((function(){s&&h(s.ownerDocument)}),[s]);var g=ir(0,e,r,o,v);return(0,n.useEffect)((function(){g&&c(g.outerHTML)}),[g]),React.createElement("div",{ref:l,dangerouslySetInnerHTML:{__html:a}})},Er=function(t){var e=t.namespace,r=t.buttonConfig,n=t.ppcpConfig;return React.createElement(_r,{namespace:e,buttonConfig:r,ppcpConfig:n})};function jr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Or(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Or(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Or(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Pr=wc.wcSettings.getSetting("ppcp-gateway_data").scriptData,kr=wc.wcSettings.getSetting("ppcp-applepay_data"),Cr=kr.scriptData,Ar="ppcpBlocksPaypalApplepay";void 0===window.PayPalCommerceGateway&&(window.PayPalCommerceGateway=Pr);var Lr,Tr=function(t){var e=t.isEditing,r=jr((0,n.useState)(!1),2),o=r[0],i=r[1],a=jr((0,n.useState)(!1),2),c=a[0],u=a[1],s=(0,n.useRef)(null);return(0,n.useEffect)((function(){e||(E({url:Cr.sdk_url}).then((function(){u(!0)})),Pr.url_params.components+=",applepay",_(Ar,Pr).then((function(){i(!0)})).catch((function(t){console.error("Failed to load PayPal script: ",t)})))}),[e]),(0,n.useEffect)((function(){if(!e&&o&&c){var t=e?Er:nr;Cr.reactWrapper=s.current,new t(Ar,Cr,Pr)}}),[o,c,e]),e?React.createElement(Er,{namespace:Ar,buttonConfig:Cr,ppcpConfig:Pr}):React.createElement("div",{ref:s,id:Cr.button.wrapper.replace("#",""),className:"ppcp-button-apm ppcp-button-applepay"})},Ir=["products"];Lr=Pr,Lr?.locations_with_subscription_product?.cart&&new J(Cr,Pr).isVaultV3Mode()&&Ir.push("subscriptions"),(0,o.registerExpressPaymentMethod)({name:kr.id,title:"PayPal - ".concat(kr.title),description:(0,i.__)("Eligible users will see the PayPal button.","woocommerce-paypal-payments"),label:React.createElement("div",{dangerouslySetInnerHTML:{__html:kr.title}}),content:React.createElement(Tr,{isEditing:!1}),edit:React.createElement(Tr,{isEditing:!0}),ariaLabel:kr.title,canMakePayment:function(){return kr.enabled},supports:{features:Ir}})})();
//# sourceMappingURL=boot-block.js.map