(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,n=window.wp.i18n,r=window.wp.element,a=window.wp.blockEditor,o=window.wp.components,c=window.React;var l,i,u,s=e.n(c);!function(e){e.INITIAL="initial",e.PENDING="pending",e.REJECTED="rejected",e.RESOLVED="resolved"}(l||(l={})),function(e){e.LOADING_STATUS="setLoadingStatus",e.RESET_OPTIONS="resetOptions",e.SET_BRAINTREE_INSTANCE="braintreeInstance"}(i||(i={})),function(e){e.NUMBER="number",e.CVV="cvv",e.EXPIRATION_DATE="expirationDate",e.EXPIRATION_MONTH="expirationMonth",e.EXPIRATION_YEAR="expirationYear",e.POSTAL_CODE="postalCode"}(u||(u={}));var p=function(){return p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n because window.").concat(c,".").concat(l," is undefined."),u="string"==typeof a?a:a.join(",");if(!u.includes(n)){var s=[u,n].filter(Boolean).join();i+="\nTo fix the issue, add '".concat(n,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n``.")}return i}function _(e){var t=e,n=f;t[n];var r=m(t,[n+""]);return"react-paypal-js-".concat(function(e){for(var t="",n=0;n component. Failed to initialize: ".concat(e))})}return!1===P.current.isEligible()?(L(!1),D):_.current?(P.current.render(_.current).catch(function(e){null!==_.current&&0!==_.current.children.length&&B(function(){throw new Error("Failed to render component. ".concat(e))})}),D):D},d(d([N],y,!0),[b.fundingSource],!1)),(0,c.useEffect)(function(){null!==I&&(!0===i?I.disable().catch(function(){}):I.enable().catch(function(){}))},[i,I]),s().createElement(s().Fragment,null,x?s().createElement("div",{ref:_,style:h,className:w}):u)};function O(e,t){void 0===t&&(t={});var n=document.createElement("script");return n.src=e,Object.keys(t).forEach(function(e){n.setAttribute(e,t[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",t["data-csp-nonce"])}),n}function N(e,t){if(void 0===t&&(t=Promise),C(e,t),"undefined"==typeof document)return t.resolve(null);var n=function(e){var t,n,r=e.sdkBaseUrl,a=e.environment,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a component. ".concat(e))})})}(e.Marks(p({},a)))}},[l,a.fundingSource]),s().createElement(s().Fragment,null,f?s().createElement("div",{ref:u,className:n}):r)};I.displayName="PayPalMarks";var T=function(e){var t=e.className,n=void 0===t?"":t,r=e.forceReRender,a=void 0===r?[]:r,o=m(e,["className","forceReRender"]),l=R()[0],i=l.isResolved,u=l.options,f=(0,c.useRef)(null),y=(0,c.useRef)(null),b=(0,c.useState)(null)[1];return(0,c.useEffect)(function(){if(!1!==i){var e=g(u[v]);if(void 0===e||void 0===e.Messages)return b(function(){throw new Error(E({reactComponentName:T.displayName,sdkComponentKey:"messages",sdkRequestedComponents:u.components,sdkDataNamespace:u[v]}))});y.current=e.Messages(p({},o)),y.current.render(f.current).catch(function(e){null!==f.current&&0!==f.current.children.length&&b(function(){throw new Error("Failed to render component. ".concat(e))})})}},d([i],a,!0)),s().createElement("div",{ref:f,className:n})};T.displayName="PayPalMessages";var A=function(e){var t,n=e.options,r=void 0===n?{clientId:"test"}:n,a=e.children,o=e.deferLoading,u=void 0!==o&&o,m=(0,c.useReducer)(P,{options:p(p({},r),(t={},t.dataJsSdkLibrary=y,t[b]=y,t[f]="".concat(_(r)),t)),loadingStatus:u?l.INITIAL:l.PENDING}),d=m[0],v=m[1];return(0,c.useEffect)(function(){if(!1===u&&d.loadingStatus===l.INITIAL)return v({type:i.LOADING_STATUS,value:l.PENDING});if(d.loadingStatus===l.PENDING){var e=!0;return N(d.options).then(function(){e&&v({type:i.LOADING_STATUS,value:l.RESOLVED})}).catch(function(t){console.error("".concat("Failed to load the PayPal JS SDK script."," ").concat(t)),e&&v({type:i.LOADING_STATUS,value:{state:l.REJECTED,message:String(t)}})}),function(){e=!1}}},[d.options,u,d.loadingStatus]),s().createElement(S.Provider,{value:p(p({},d),{dispatch:v})},a)};function x(){}function L(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var i=r&&r.prototype instanceof l?r:l,u=Object.create(i.prototype);return B(u,"_invoke",function(n,r,a){var o,l,i,u=0,s=a||[],p=!1,m={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,l=0,i=e,m.n=n,c}};function d(n,r){for(l=n,i=r,t=0;!p&&u&&!a&&t3?(a=f===r)&&(i=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=d&&((a=n<2&&dr||r>f)&&(o[4]=n,o[5]=r,m.n=f,l=0))}if(a||n>1)return c;throw p=!0,r}return function(a,s,f){if(u>1)throw TypeError("Generator is already running");for(p&&1===s&&d(s,f),l=s,i=f;(t=l<2?e:i)||!p;){o||(l?l<3?(l>1&&(m.n=-1),d(l,i)):m.n=i:m.v=i);try{if(u=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,i)))throw TypeError("iterator result is not an object");if(!t.done)return t;i=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(p=m.n<0)?i:n.call(r,m))!==c)break}catch(t){o=e,l=1,i=t}finally{u=1}}return{value:t,done:p}}}(n,a,o),!0),u}var c={};function l(){}function i(){}function u(){}t=Object.getPrototypeOf;var s=[][r]?t(t([][r]())):(B(t={},r,function(){return this}),t),p=u.prototype=l.prototype=Object.create(s);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,B(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return i.prototype=u,B(p,"constructor",u),B(u,"constructor",i),i.displayName="GeneratorFunction",B(u,a,"GeneratorFunction"),B(p),B(p,a,"Generator"),B(p,r,function(){return this}),B(p,"toString",function(){return"[object Generator]"}),(L=function(){return{w:o,m}})()}function B(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}B=function(e,t,n,r){function o(t,n){B(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},B(e,t,n,r)}function D(e,t,n,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n