@one-payments/web-components 1.7.1 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  var OnePayments=function(t){"use strict";
2
2
  /*!
3
- * @one-payments/web-components v1.7.1
3
+ * @one-payments/web-components v1.7.2
4
4
  * Browser CDN Bundle (IIFE)
5
5
  *
6
6
  * This bundle is designed for direct browser usage via <script> tag.
@@ -982,7 +982,7 @@ var OnePayments=function(t){"use strict";
982
982
  `:n===It?z`
983
983
  <div class="method-icon-right">
984
984
  <img
985
- src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/7ij6D6G25TBPGfmU7G0Fk5/4c9ee7f5dd1f5f3b2c7c3f7d6e2c5a4b/FPX.svg"}"
985
+ src="${"https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/35hEmofKsxnjVV4zidB0Ir/00447c59f79d5c1e095f1354f6b909ce/FPX.svg"}"
986
986
  alt="FPX Online Banking"
987
987
  style="width: 45px; height: auto;"
988
988
  />
@@ -2648,5 +2648,5 @@ var OnePayments=function(t){"use strict";
2648
2648
  width: 100%;
2649
2649
  }
2650
2650
  }
2651
- `,Ra([ut({type:Object})],La.prototype,"config",2),Ra([ut({type:Object})],La.prototype,"adapters",2),Ra([ut({type:Number})],La.prototype,"amount",2),Ra([ut({type:String})],La.prototype,"currency",2),Ra([ut({type:String})],La.prototype,"orderId",2),Ra([ut({type:String})],La.prototype,"firstName",2),Ra([ut({type:String})],La.prototype,"lastName",2),Ra([ut({type:String})],La.prototype,"email",2),Ra([ut({type:String})],La.prototype,"phoneNumber",2),Ra([ut({type:Array})],La.prototype,"excludePaymentMethods",2),Ra([ut({type:String})],La.prototype,"width",2),Ra([ut({type:String})],La.prototype,"maxWidth",2),Ra([ut({type:Object})],La.prototype,"appearance",2),Ra([ht()],La.prototype,"currentState",2),Ra([ht()],La.prototype,"selectedMethod",2),Ra([ht()],La.prototype,"cardFormData",2),Ra([ht()],La.prototype,"formErrors",2),Ra([ht()],La.prototype,"paymentData",2),Ra([ht()],La.prototype,"feesExpanded",2),Ra([ht()],La.prototype,"isInitializing",2),Ra([ht()],La.prototype,"cardBrand",2),Ra([ht()],La.prototype,"paymentLocked",2),Ra([ht()],La.prototype,"show3DSModal",2),Ra([ht()],La.prototype,"showQRModal",2),Ra([ht()],La.prototype,"nextActionUrl",2),Ra([ht()],La.prototype,"qrCode",2),Ra([ht()],La.prototype,"qrCodeDataUrl",2),Ra([ht()],La.prototype,"qrAutoResumeTimer",2),Ra([ht()],La.prototype,"qrPollingInProgress",2),Ra([ht()],La.prototype,"availableBanks",2),Ra([ht()],La.prototype,"selectedBank",2),Ra([ht()],La.prototype,"banksLoading",2),Ra([ht()],La.prototype,"bankSearchQuery",2),Ra([ht()],La.prototype,"phoneInputValue",2),Ra([ht()],La.prototype,"phoneInputError",2),Ra([ht()],La.prototype,"selectedCountry",2),La=Ra([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("one-payment")],La);class Ua{async get(t,e){const r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await Ba(r);throw new Error(t)}return await r.json()}async post(t,e,r){const n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!n.ok){const t=await Ba(n);throw new Error(t)}return await n.json()}async put(t,e,r){const n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!n.ok){const t=await Ba(n);throw new Error(t)}return await n.json()}async patch(t,e,r){const n=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!n.ok){const t=await Ba(n);throw new Error(t)}return await n.json()}async delete(t,e){const r=await fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await Ba(r);throw new Error(t)}return await r.json()}}class ja{constructor(t="one-payments:"){this.prefix=t}async get(t){return localStorage.getItem(this.prefix+t)}async set(t,e){localStorage.setItem(this.prefix+t,e)}async remove(t){localStorage.removeItem(this.prefix+t)}async clear(){Object.keys(localStorage).forEach(t=>{t.startsWith(this.prefix)&&localStorage.removeItem(t)})}}class Ha{async sha256(t){const e="string"==typeof t?(new TextEncoder).encode(t):t,r=await crypto.subtle.digest("SHA-256",e);return this.bufferToHex(r)}async hmacSHA256(t,e){const r=new TextEncoder,n=r.encode(t),i=r.encode(e),a=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),o=await crypto.subtle.sign("HMAC",a,i);return this.bufferToHex(o)}uuid(){return crypto.randomUUID()}randomBytes(t){return crypto.getRandomValues(new Uint8Array(t))}bufferToHex(t){return Array.from(new Uint8Array(t)).map(t=>t.toString(16).padStart(2,"0")).join("")}}class za{now(){return Date.now()}async delay(t){return new Promise(e=>{setTimeout(e,t)})}}function qa(){return{http:new Ua,storage:new ja,crypto:new Ha,timer:new za}}const Va="one-payment",Ga="1.7.1";!function(){if("undefined"==typeof customElements)return console.error("[OnePayments] customElements API is not available in this environment. This bundle is designed for browser environments only."),!1;if(customElements.get(Va))return console.info(`[OnePayments] <${Va}> is already registered. Skipping re-registration.`),!0;try{return customElements.define(Va,La),console.info(`[OnePayments] Registered <${Va}> custom element (v${Ga})`),!0}catch(t){return console.error(`[OnePayments] Failed to register <${Va}>:`,t),!1}}();const Ka={createWebAdapters:qa,TAG_NAME:Va,VERSION:Ga,isRegistered:()=>"undefined"!=typeof customElements&&void 0!==customElements.get(Va),whenDefined:()=>"undefined"==typeof customElements?Promise.reject(new Error("customElements API is not available")):customElements.whenDefined(Va)};return"undefined"!=typeof window&&(window.OnePayments?console.warn("[OnePayments] window.OnePayments already exists. The bundle may have been loaded multiple times. Using existing reference."):window.OnePayments=Ka),t.OnePayments=Ka,t.TAG_NAME=Va,t.VERSION=Ga,t.createWebAdapters=qa,t.default=Ka,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({});
2651
+ `,Ra([ut({type:Object})],La.prototype,"config",2),Ra([ut({type:Object})],La.prototype,"adapters",2),Ra([ut({type:Number})],La.prototype,"amount",2),Ra([ut({type:String})],La.prototype,"currency",2),Ra([ut({type:String})],La.prototype,"orderId",2),Ra([ut({type:String})],La.prototype,"firstName",2),Ra([ut({type:String})],La.prototype,"lastName",2),Ra([ut({type:String})],La.prototype,"email",2),Ra([ut({type:String})],La.prototype,"phoneNumber",2),Ra([ut({type:Array})],La.prototype,"excludePaymentMethods",2),Ra([ut({type:String})],La.prototype,"width",2),Ra([ut({type:String})],La.prototype,"maxWidth",2),Ra([ut({type:Object})],La.prototype,"appearance",2),Ra([ht()],La.prototype,"currentState",2),Ra([ht()],La.prototype,"selectedMethod",2),Ra([ht()],La.prototype,"cardFormData",2),Ra([ht()],La.prototype,"formErrors",2),Ra([ht()],La.prototype,"paymentData",2),Ra([ht()],La.prototype,"feesExpanded",2),Ra([ht()],La.prototype,"isInitializing",2),Ra([ht()],La.prototype,"cardBrand",2),Ra([ht()],La.prototype,"paymentLocked",2),Ra([ht()],La.prototype,"show3DSModal",2),Ra([ht()],La.prototype,"showQRModal",2),Ra([ht()],La.prototype,"nextActionUrl",2),Ra([ht()],La.prototype,"qrCode",2),Ra([ht()],La.prototype,"qrCodeDataUrl",2),Ra([ht()],La.prototype,"qrAutoResumeTimer",2),Ra([ht()],La.prototype,"qrPollingInProgress",2),Ra([ht()],La.prototype,"availableBanks",2),Ra([ht()],La.prototype,"selectedBank",2),Ra([ht()],La.prototype,"banksLoading",2),Ra([ht()],La.prototype,"bankSearchQuery",2),Ra([ht()],La.prototype,"phoneInputValue",2),Ra([ht()],La.prototype,"phoneInputError",2),Ra([ht()],La.prototype,"selectedCountry",2),La=Ra([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("one-payment")],La);class Ua{async get(t,e){const r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await Ba(r);throw new Error(t)}return await r.json()}async post(t,e,r){const n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!n.ok){const t=await Ba(n);throw new Error(t)}return await n.json()}async put(t,e,r){const n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!n.ok){const t=await Ba(n);throw new Error(t)}return await n.json()}async patch(t,e,r){const n=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(e)});if(!n.ok){const t=await Ba(n);throw new Error(t)}return await n.json()}async delete(t,e){const r=await fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json",...e}});if(!r.ok){const t=await Ba(r);throw new Error(t)}return await r.json()}}class ja{constructor(t="one-payments:"){this.prefix=t}async get(t){return localStorage.getItem(this.prefix+t)}async set(t,e){localStorage.setItem(this.prefix+t,e)}async remove(t){localStorage.removeItem(this.prefix+t)}async clear(){Object.keys(localStorage).forEach(t=>{t.startsWith(this.prefix)&&localStorage.removeItem(t)})}}class Ha{async sha256(t){const e="string"==typeof t?(new TextEncoder).encode(t):t,r=await crypto.subtle.digest("SHA-256",e);return this.bufferToHex(r)}async hmacSHA256(t,e){const r=new TextEncoder,n=r.encode(t),i=r.encode(e),a=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),o=await crypto.subtle.sign("HMAC",a,i);return this.bufferToHex(o)}uuid(){return crypto.randomUUID()}randomBytes(t){return crypto.getRandomValues(new Uint8Array(t))}bufferToHex(t){return Array.from(new Uint8Array(t)).map(t=>t.toString(16).padStart(2,"0")).join("")}}class za{now(){return Date.now()}async delay(t){return new Promise(e=>{setTimeout(e,t)})}}function qa(){return{http:new Ua,storage:new ja,crypto:new Ha,timer:new za}}const Va="one-payment",Ga="1.7.2";!function(){if("undefined"==typeof customElements)return console.error("[OnePayments] customElements API is not available in this environment. This bundle is designed for browser environments only."),!1;if(customElements.get(Va))return console.info(`[OnePayments] <${Va}> is already registered. Skipping re-registration.`),!0;try{return customElements.define(Va,La),console.info(`[OnePayments] Registered <${Va}> custom element (v${Ga})`),!0}catch(t){return console.error(`[OnePayments] Failed to register <${Va}>:`,t),!1}}();const Ka={createWebAdapters:qa,TAG_NAME:Va,VERSION:Ga,isRegistered:()=>"undefined"!=typeof customElements&&void 0!==customElements.get(Va),whenDefined:()=>"undefined"==typeof customElements?Promise.reject(new Error("customElements API is not available")):customElements.whenDefined(Va)};return"undefined"!=typeof window&&(window.OnePayments?console.warn("[OnePayments] window.OnePayments already exists. The bundle may have been loaded multiple times. Using existing reference."):window.OnePayments=Ka),t.OnePayments=Ka,t.TAG_NAME=Va,t.VERSION=Ga,t.createWebAdapters=qa,t.default=Ka,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({});
2652
2652
  //# sourceMappingURL=one-payment.browser.iife.js.map