var w="https://js.stripe.com/v3",g=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var j=function(){for(var r=document.querySelectorAll('script[src^="'.concat(w,'"]')),e=0;e element.");return a.appendChild(n),n},y=function(r,e){!r||!r._registerWrapper||r._registerWrapper({name:"stripe-js",version:"3.4.1",startTime:e})},d=null,l=null,f=null,x=function(r){return function(){r(new Error("Failed to load Stripe.js?v=1773287522785"))}},L=function(r,e){return function(){window.Stripe?r(window.Stripe):e(new Error("Stripe.js not available"))}},T=function(r){return d!==null?d:(d=new Promise(function(e,n){if(typeof window>"u"||typeof document>"u"){e(null);return}if(window.Stripe){e(window.Stripe);return}try{var a=j();if(!(a&&r)){if(!a)a=p(r);else if(a&&f!==null&&l!==null){var i;a.removeEventListener("load",f),a.removeEventListener("error",l),(i=a.parentNode)===null||i===void 0||i.removeChild(a),a=p(r)}}f=L(e,n),l=x(n),a.addEventListener("load",f),a.addEventListener("error",l)}catch(o){n(o);return}}),d.catch(function(e){return d=null,Promise.reject(e)}))},C=function(r,e,n){if(r===null)return null;var a=r.apply(void 0,e);return y(a,n),a},s,h=!1,b=function(){return s||(s=T(null).catch(function(r){return s=null,Promise.reject(r)}),s)};Promise.resolve().then(function(){return b()}).catch(function(t){h||console.warn(t)});var I=function(){for(var r=arguments.length,e=new Array(r),n=0;n"u")return r.resolve(null);var e=O(t),n=e.url,a=e.attributes,i=a["data-namespace"]||"paypal",o=m(i);return a["data-js-sdk-library"]||(a["data-js-sdk-library"]="paypal-js"),q(n,a)&&o?r.resolve(o):U({url:n,attributes:a},r).then(function(){var u=m(i);if(u)return u;throw new Error("The window.".concat(i," global variable is not available."))})}function U(t,r){r===void 0&&(r=Promise),E(t,r);var e=t.url,n=t.attributes;if(typeof e!="string"||e.length===0)throw new Error("Invalid url.");if(typeof n<"u"&&typeof n!="object")throw new Error("Expected attributes to be an object.");return new r(function(a,i){if(typeof document>"u")return a();A({url:e,attributes:n,onSuccess:function(){return a()},onError:function(){var o=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return i(o)}})})}function m(t){return window[t]}function E(t,r){if(typeof t!="object"||t===null)throw new Error("Expected an options object.");var e=t.environment;if(e&&e!=="production"&&e!=="sandbox")throw new Error('The `environment` option must be either "production" or "sandbox".');if(typeof r<"u"&&typeof r!="function")throw new Error("Expected PromisePonyfill to be a function.")}export{I as a,N as l};