import{getUrlFromMap as n}from"../../../core/Environment/Environment.js";import{CDN_ENVIRONMENTS as e}from"../../../core/Environment/constants.js";import s from"../../../core/Errors/AdyenCheckoutError.js";import t from"../../../utils/Script.js";function r(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n}class i{isAvailable(){return null!=this.AdyenPasskey}async load(){if(this.isAvailable())return this.AdyenPasskey;try{var r;const s=n(this.environment,e),a=new t({src:`${s}${i.PASSKEY_SDK_URL}`,component:"paybybank_pix",analytics:this.analytics});return await a.load(),this.AdyenPasskey=null===(r=window.AdyenPasskey)||void 0===r?void 0:r.default,this.AdyenPasskey}catch(n){throw new s("SCRIPT_ERROR",`Unable to load script. Message: ${n instanceof Error?n.message:"Unknown error loading Passkey sdk"}`)}}constructor({analytics:n,environment:e}){r(this,"AdyenPasskey",void 0),r(this,"analytics",void 0),r(this,"environment",void 0),this.analytics=n,this.environment=e}}r(i,"PASSKEY_SDK_URL","js/adyenpasskey/1.2.0/adyen-passkey.js");export{i as PasskeySdkLoader};
//# sourceMappingURL=PasskeySdkLoader.js.map
