@one-payments/web-components 1.1.29 → 1.1.30
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(e){"use strict";
|
|
2
2
|
/*!
|
|
3
|
-
* @one-payments/web-components v1.1.
|
|
3
|
+
* @one-payments/web-components v1.1.29
|
|
4
4
|
* Browser CDN Bundle (IIFE)
|
|
5
5
|
*
|
|
6
6
|
* This bundle is designed for direct browser usage via <script> tag.
|
|
@@ -8,7 +8,7 @@ var OnePayments=function(e){"use strict";
|
|
|
8
8
|
*
|
|
9
9
|
* (c) 2025 One Payments
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/var t;const r=globalThis,n=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;let s=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(n&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&o.set(t,e))}return e}toString(){return this.cssText}};const a=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,i))(t)})(e):e,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:u,getPrototypeOf:p}=Object,m=globalThis,f=m.trustedTypes,g=f?f.emptyScript:"",y=m.reactiveElementPolyfillSupport,v=(e,t)=>e,b={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(n){r=null}}return r}},w=(e,t)=>!l(e,t),x={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);let k=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=x){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);void 0!==n&&d(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:i}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,set(t){const o=null==n?void 0:n.call(this);null==i||i.call(this,t),this.requestUpdate(e,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??x}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=p(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,t=[...h(e),...u(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const e=this._$Eu(t,r);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(e=this.constructor.l)||e.forEach(e=>e(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),void 0!==this.renderRoot&&this.isConnected&&(null==(t=e.hostConnected)||t.call(e))}removeController(e){var t;null==(t=this._$EO)||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(n)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const n of t){const t=document.createElement("style"),i=r.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(e=this._$EO)||e.forEach(e=>{var t;return null==(t=e.hostConnected)?void 0:t.call(e)})}enableUpdating(e){}disconnectedCallback(){var e;null==(e=this._$EO)||e.forEach(e=>{var t;return null==(t=e.hostDisconnected)?void 0:t.call(e)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var r;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==(null==(r=n.converter)?void 0:r.toAttribute)?n.converter:b).toAttribute(t,n.type);this._$Em=e,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){var r,n;const i=this.constructor,o=i._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=i.getPropertyOptions(o),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null==(r=e.converter)?void 0:r.fromAttribute)?e.converter:b;this._$Em=o;const a=s.fromAttribute(t,e.type);this[o]=a??(null==(n=this._$Ej)?void 0:n.get(o))??a,this._$Em=null}}requestUpdate(e,t,r){var n;if(void 0!==e){const i=this.constructor,o=this[e];if(r??(r=i.getPropertyOptions(e)),!((r.hasChanged??w)(o,t)||r.useDefault&&r.reflect&&o===(null==(n=this._$Ej)?void 0:n.get(e))&&!this.hasAttribute(i._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:i},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),!0!==i||void 0!==o)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===n&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e){const{wrapped:e}=r,n=this[t];!0!==e||this._$AL.has(t)||void 0===n||this.C(t,void 0,r,n)}}let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),null==(e=this._$EO)||e.forEach(e=>{var t;return null==(t=e.hostUpdate)?void 0:t.call(e)}),this.update(r)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;null==(t=this._$EO)||t.forEach(e=>{var t;return null==(t=e.hostUpdated)?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[v("elementProperties")]=new Map,k[v("finalized")]=new Map,null==y||y({ReactiveElement:k}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.1.1");const S=globalThis,E=S.trustedTypes,P=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,C="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,I="?"+A,M=`<${I}>`,T=document,F=()=>T.createComment(""),L=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,N="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,U=/>/g,q=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),z=/'/g,j=/"/g,O=/^(?:script|style|textarea|title)$/i,H=(K=1,(e,...t)=>({_$litType$:K,strings:e,values:t})),Z=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),Y=new WeakMap,W=T.createTreeWalker(T,129);var K;function Q(e,t){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(t):t}class ${constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let i=0,o=0;const s=e.length-1,a=this.parts,[l,d]=((e,t)=>{const r=e.length-1,n=[];let i,o=2===t?"<svg>":3===t?"<math>":"",s=R;for(let a=0;a<r;a++){const t=e[a];let r,l,d=-1,c=0;for(;c<t.length&&(s.lastIndex=c,l=s.exec(t),null!==l);)c=s.lastIndex,s===R?"!--"===l[1]?s=B:void 0!==l[1]?s=U:void 0!==l[2]?(O.test(l[2])&&(i=RegExp("</"+l[2],"g")),s=q):void 0!==l[3]&&(s=q):s===q?">"===l[0]?(s=i??R,d=-1):void 0===l[1]?d=-2:(d=s.lastIndex-l[2].length,r=l[1],s=void 0===l[3]?q:'"'===l[3]?j:z):s===j||s===z?s=q:s===B||s===U?s=R:(s=q,i=void 0);const h=s===q&&e[a+1].startsWith("/>")?" ":"";o+=s===R?t+M:d>=0?(n.push(r),t.slice(0,d)+C+t.slice(d)+A+h):t+A+(-2===d?a:h)}return[Q(e,o+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]})(e,t);if(this.el=$.createElement(l,r),W.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=W.nextNode())&&a.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(C)){const t=d[o++],r=n.getAttribute(e).split(A),s=/([.?@])?(.*)/.exec(t);a.push({type:1,index:i,name:s[2],strings:r,ctor:"."===s[1]?ee:"?"===s[1]?te:"@"===s[1]?re:_}),n.removeAttribute(e)}else e.startsWith(A)&&(a.push({type:6,index:i}),n.removeAttribute(e));if(O.test(n.tagName)){const e=n.textContent.split(A),t=e.length-1;if(t>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],F()),W.nextNode(),a.push({type:2,index:++i});n.append(e[t],F())}}}else if(8===n.nodeType)if(n.data===I)a.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(A,e+1));)a.push({type:7,index:i}),e+=A.length-1}i++}}static createElement(e,t){const r=T.createElement("template");return r.innerHTML=e,r}}function X(e,t,r=e,n){var i,o;if(t===Z)return t;let s=void 0!==n?null==(i=r._$Co)?void 0:i[n]:r._$Cl;const a=L(t)?void 0:t._$litDirective$;return(null==s?void 0:s.constructor)!==a&&(null==(o=null==s?void 0:s._$AO)||o.call(s,!1),void 0===a?s=void 0:(s=new a(e),s._$AT(e,r,n)),void 0!==n?(r._$Co??(r._$Co=[]))[n]=s:r._$Cl=s),void 0!==s&&(t=X(e,s._$AS(e,t.values),s,n)),t}class J{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,n=((null==e?void 0:e.creationScope)??T).importNode(t,!0);W.currentNode=n;let i=W.nextNode(),o=0,s=0,a=r[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new G(i,i.nextSibling,this,e):1===a.type?t=new a.ctor(i,a.name,a.strings,this,e):6===a.type&&(t=new ne(i,this,e)),this._$AV.push(t),a=r[++s]}o!==(null==a?void 0:a.index)&&(i=W.nextNode(),o++)}return W.currentNode=T,n}p(e){let t=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class G{get _$AU(){var e;return(null==(e=this._$AM)?void 0:e._$AU)??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=(null==n?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===(null==e?void 0:e.nodeType)&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=X(this,e,t),L(e)?e===V||null==e||""===e?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==Z&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>D(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==V&&L(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){var t;const{values:r,_$litType$:n}=e,i="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=$.createElement(Q(n.h,n.h[0]),this.options)),n);if((null==(t=this._$AH)?void 0:t._$AD)===i)this._$AH.p(r);else{const e=new J(i,this),t=e.u(this.options);e.p(r),this.T(t),this._$AH=e}}_$AC(e){let t=Y.get(e.strings);return void 0===t&&Y.set(e.strings,t=new $(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const i of e)n===t.length?t.push(r=new G(this.O(F()),this.O(F()),this,this.options)):r=t[n],r._$AI(i),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for(null==(r=this._$AP)||r.call(this,!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;void 0===this._$AM&&(this._$Cv=e,null==(t=this._$AP)||t.call(this,e))}}class _{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,i){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=V}_$AI(e,t=this,r,n){const i=this.strings;let o=!1;if(void 0===i)e=X(this,e,t,0),o=!L(e)||e!==this._$AH&&e!==Z,o&&(this._$AH=e);else{const n=e;let s,a;for(e=i[0],s=0;s<i.length-1;s++)a=X(this,n[r+s],t,s),a===Z&&(a=this._$AH[s]),o||(o=!L(a)||a!==this._$AH[s]),a===V?e=V:e!==V&&(e+=(a??"")+i[s+1]),this._$AH[s]=a}o&&!n&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ee extends _{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class te extends _{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class re extends _{constructor(e,t,r,n,i){super(e,t,r,n,i),this.type=5}_$AI(e,t=this){if((e=X(this,e,t,0)??V)===Z)return;const r=this._$AH,n=e===V&&r!==V||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,i=e!==V&&(r===V||n);n&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;"function"==typeof this._$AH?this._$AH.call((null==(t=this.options)?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class ne{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){X(this,e)}}const ie=S.litHtmlPolyfillSupport;null==ie||ie($,G),(S.litHtmlVersions??(S.litHtmlVersions=[])).push("3.3.1");const oe=globalThis;class se extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,r)=>{const n=(null==r?void 0:r.renderBefore)??t;let i=n._$litPart$;if(void 0===i){const e=(null==r?void 0:r.renderBefore)??null;n._$litPart$=i=new G(t.insertBefore(F(),e),e,void 0,r??{})}return i._$AI(e),i})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null==(e=this._$Do)||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null==(e=this._$Do)||e.setConnected(!1)}render(){return Z}}se._$litElement$=!0,se.finalized=!0,null==(t=oe.litElementHydrateSupport)||t.call(oe,{LitElement:se});const ae=oe.litElementPolyfillSupport;null==ae||ae({LitElement:se}),(oe.litElementVersions??(oe.litElementVersions=[])).push("4.2.1");const le={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:w},de=(e=le,t,r)=>{const{kind:n,metadata:i}=r;let o=globalThis.litPropertyMetadata.get(i);if(void 0===o&&globalThis.litPropertyMetadata.set(i,o=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),o.set(r.name,e),"accessor"===n){const{name:n}=r;return{set(r){const i=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,i,e)},init(t){return void 0!==t&&this.C(n,void 0,e,t),t}}}if("setter"===n){const{name:n}=r;return function(r){const i=this[n];t.call(this,r),this.requestUpdate(n,i,e)}}throw Error("Unsupported decorator location: "+n)};function ce(e){return(t,r)=>"object"==typeof r?de(e,t,r):((e,t,r)=>{const n=t.hasOwnProperty(r);return t.constructor.createProperty(r,e),n?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}function he(e){return ce({...e,state:!0,attribute:!1})}const ue="card",pe="paynow",me="idle",fe="initializing",ge="ready",ye="processing",ve="requires_action",be="succeeded",we="failed";class xe{constructor(e,t,r,n,i={},o){this.isPolling=!1,this.attempts=0,this.startTime=0,this.pollTimeoutId=null,this.adapters=e,this.baseUrl=t,this.token=r,this.onStatusUpdate=n,this.onPollStart=o,this.config={interval:i.interval??3e3,maxAttempts:i.maxAttempts??60,timeout:i.timeout??18e4,ignore3DS:i.ignore3DS??!1,ignoreQR:i.ignoreQR??!1}}start(){this.isPolling||(this.isPolling=!0,this.attempts=0,this.startTime=this.adapters.timer.now(),this.scheduleNextPoll())}stop(){this.isPolling=!1,null!==this.pollTimeoutId&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null)}get active(){return this.isPolling}get attemptCount(){return this.attempts}scheduleNextPoll(){if(!this.isPolling)return;if(this.attempts>=this.config.maxAttempts)return this.stop(),void this.onStatusUpdate({status:"failed",paymentIntentId:"",error:{code:"POLLING_MAX_ATTEMPTS",message:`Maximum polling attempts (${this.config.maxAttempts}) exceeded`}});if(this.adapters.timer.now()-this.startTime>=this.config.timeout)return this.stop(),void this.onStatusUpdate({status:"failed",paymentIntentId:"",error:{code:"POLLING_TIMEOUT",message:`Polling timeout (${this.config.timeout}ms) exceeded`}});this.pollTimeoutId=setTimeout(()=>{this.poll()},this.config.interval)}async poll(){if(this.isPolling){this.attempts++,this.onPollStart&&this.onPollStart();try{const t=await this.adapters.http.get(`${this.baseUrl}/payment-intent/get-payment-data`,{"x-token":this.token}),r={status:(e=t.result.status,"paid"===e?"succeeded":e),paymentIntentId:t.result.paymentIntentId||"",...void 0!==t.result.amount&&{amount:t.result.amount},...void 0!==t.result.currency&&{currency:t.result.currency},...void 0!==t.result.metadata&&{metadata:t.result.metadata},...void 0!==t.result.nextActionUrl&&{nextActionUrl:t.result.nextActionUrl},...void 0!==t.result.qrCode&&{qrCode:t.result.qrCode}};if(t.result.nextActionUrl&&!this.config.ignore3DS)return this.stop(),void this.onStatusUpdate(r);if(t.result.qrCode&&!this.config.ignoreQR)return this.stop(),void this.onStatusUpdate(r);if("succeeded"===t.result.status||"failed"===t.result.status||"paid"===t.result.status)return this.stop(),void this.onStatusUpdate(r);this.scheduleNextPoll()}catch(t){const e={status:"processing",paymentIntentId:"",error:{code:"POLLING_ERROR",message:t instanceof Error?t.message:"Unknown polling error"}};this.onStatusUpdate(e),this.scheduleNextPoll()}var e}}}class ke{constructor(e,t){this.state={status:me},this.subscribers=new Set,this.eventListeners={},this.paymentToken=null,this.paymentIntentId=null,this.pollingService=null,this.ignore3DSInPolling=!1,this.ignoreQRInPolling=!1,this.config=e,this.adapters=t}getApiBaseUrl(){return this.config.apiBaseUrl??function(e){switch(e){case"prod":return"https://public.one.ooo";case"demo":return"https://public.demo.one.ooo";default:return"https://public.dev.one.ooo"}}(this.config.environment)}getState(){return this.state}subscribe(e){return this.subscribers.add(e),e(this.state),()=>{this.subscribers.delete(e)}}on(e,t){this.eventListeners[e]||(this.eventListeners[e]=[]);const r=this.eventListeners[e];return r.push(t),()=>{const e=r.indexOf(t);e>-1&&r.splice(e,1)}}async initialize(e){this.setState({status:fe}),this.emit({type:"initialize",payload:e});try{const t={amount:e.amount,currency:e.currency,notes:e.notes,orderId:e.orderId},r=JSON.stringify(t),n=await this.adapters.crypto.hmacSHA256(this.config.secretKey,r),i=await this.adapters.http.post(`${this.getApiBaseUrl()}/payment-intent/create`,t,{"x-api-key":this.config.apiKey,"x-signature":n}),o=new URL(i.result.redirectUrl).searchParams.get("token");if(!o)throw new Error("No token found in redirectUrl");this.paymentToken=o,this.paymentIntentId=i.result.paymentIntentId;const s=await this.adapters.http.get(`${this.getApiBaseUrl()}/payment-intent/get-payment-data`,{"x-token":this.paymentToken}),a=await this.adapters.http.get(`${this.getApiBaseUrl()}/payment-intent/available-methods`,{"x-token":this.paymentToken}),l={id:this.paymentIntentId,amount:s.result.customerAmount||e.amount,currency:s.result.currency||e.currency,status:ge,...e.metadata&&{metadata:e.metadata}},d=a.result.paymentMethods.map((e,t)=>{let r=null;const n=e.type.toLowerCase(),i=e.capabilities||[];return n.includes("card")?r="card":(n.includes("paynow")||n.includes("bank transfer")||i.includes("payments_pay_now"))&&(r="paynow"),null===r?null:{id:r,enabled:!0,priority:t}}).filter(e=>null!==e);return this.setState({status:ge,paymentIntent:l,availableMethods:d}),this.emit({type:"initialized",payload:{paymentIntent:l,paymentData:s.result}}),l}catch(t){const e={code:"INITIALIZATION_FAILED",message:t instanceof Error?t.message:"Unknown error",timestamp:this.adapters.timer.now()};throw this.setState({status:we,error:e}),this.emit({type:"payment_failed",payload:{error:e}}),t}}async submitPayment(e,t){var r,n,i,o,s;const a=this.state;if("ready"!==a.status)throw new Error("Cannot submit payment: SDK not in ready state");if(!this.paymentToken)throw new Error("Cannot submit payment: No payment token available");this.ignore3DSInPolling=!1,this.ignoreQRInPolling=!1,this.setState({status:ye,paymentIntent:a.paymentIntent,selectedMethod:e,availableMethods:a.availableMethods}),this.emit({type:"payment_processing",payload:{paymentIntent:a.paymentIntent,methodId:e}});try{const r={firstName:String(t.firstName),lastName:String(t.lastName),email:String(t.email),paymentMethod:"card"===e?{type:"card",card:{number:String(t.cardNumber),expiryMonth:String(t.expiryMonth),expiryYear:String(t.expiryYear),cvc:String(t.cvv)}}:{type:"qr"}};return await this.adapters.http.patch(`${this.getApiBaseUrl()}/payment-intent/confirm`,r,{"x-token":this.paymentToken}),this.startPolling(),{id:this.paymentIntentId||"",amount:a.paymentIntent.amount,currency:a.paymentIntent.currency,status:ye}}catch(l){let e="Unknown error",t="PAYMENT_FAILED";if(l instanceof Error)try{if(function(e){return e instanceof Error&&("response"in e&&"object"==typeof e.response&&null!==e.response||"data"in e&&"object"==typeof e.data&&null!==e.data)}(l)){const a=null==(r=l.response)?void 0:r.data,d=l.data;a?(e=a.message||(null==(n=a.error)?void 0:n.message)||l.message,t=a.code||(null==(i=a.error)?void 0:i.code)||t):d?(e=d.message||(null==(o=d.error)?void 0:o.message)||l.message,t=d.code||(null==(s=d.error)?void 0:s.code)||t):e=l.message}else e=l.message}catch{e=l.message}const d={code:t,message:e,timestamp:this.adapters.timer.now()};throw this.setState({status:we,error:d,paymentIntent:a.paymentIntent}),this.emit({type:"payment_failed",payload:{error:d,paymentIntent:a.paymentIntent}}),l}}resumePolling(){this.paymentToken&&(this.ignore3DSInPolling=!0,this.ignoreQRInPolling=!0,this.startPolling())}destroy(){this.stopPolling(),this.subscribers.clear(),Object.keys(this.eventListeners).forEach(e=>{delete this.eventListeners[e]})}startPolling(){this.paymentToken&&(this.stopPolling(),this.pollingService=new xe(this.adapters,this.getApiBaseUrl(),this.paymentToken,this.handlePollingUpdate.bind(this),{interval:4e3,maxAttempts:100,timeout:4e5,ignore3DS:this.ignore3DSInPolling,ignoreQR:this.ignoreQRInPolling},this.handlePollStart.bind(this)),this.pollingService.start())}stopPolling(){this.pollingService&&(this.pollingService.stop(),this.pollingService=null)}handlePollStart(){this.emit({type:"poll_started",payload:{}})}handlePollingUpdate(e){if(e.error)return void console.error("Polling error:",e.error);const t=this.state;if("processing"!==t.status&&"requires_action"!==t.status)return void this.stopPolling();if(e.qrCode&&!this.ignoreQRInPolling)return void this.emit({type:"qr_code_received",payload:{qrCode:e.qrCode,methodId:t.selectedMethod}});if(e.nextActionUrl&&!this.ignore3DSInPolling){if("paynow"===t.selectedMethod&&!this.ignoreQRInPolling)return void this.emit({type:"qr_code_received",payload:{qrCode:e.nextActionUrl,methodId:t.selectedMethod}});const r={id:e.paymentIntentId,amount:e.amount??t.paymentIntent.amount,currency:e.currency??t.paymentIntent.currency,status:ve,...e.metadata&&{metadata:e.metadata}};return this.setState({status:ve,paymentIntent:r,actionUrl:e.nextActionUrl,selectedMethod:t.selectedMethod,availableMethods:t.availableMethods}),void this.emit({type:"payment_requires_action",payload:{paymentIntent:r,actionUrl:e.nextActionUrl,methodId:t.selectedMethod}})}const r={id:e.paymentIntentId,amount:e.amount??t.paymentIntent.amount,currency:e.currency??t.paymentIntent.currency,status:e.status,...e.metadata&&{metadata:e.metadata}};if("succeeded"===e.status)this.stopPolling(),this.setState({status:be,paymentIntent:r,selectedMethod:t.selectedMethod}),this.emit({type:"payment_succeeded",payload:{paymentIntent:r,methodId:t.selectedMethod}});else if("failed"===e.status){this.stopPolling();const t={code:"PAYMENT_FAILED",message:e.error&&"object"==typeof e.error&&null!==e.error&&"message"in e.error?String(e.error.message):"Payment failed",timestamp:this.adapters.timer.now()};this.setState({status:we,error:t,paymentIntent:r}),this.emit({type:"payment_failed",payload:{error:t,paymentIntent:r}})}}setState(e){const t=this.state.status;this.state=e,this.subscribers.forEach(e=>{e(this.state)}),t!==e.status&&this.emit({type:"state_changed",payload:{previousStatus:t,currentStatus:e.status}})}emit(e){const t=this.eventListeners[e.type];void 0!==t&&t.forEach(t=>{t(e)})}}var Se="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ee=function(e,t,r,n,i,o,s,a,l,d){var c=this;c.numeralDecimalMark=e||".",c.numeralIntegerScale=t>0?t:0,c.numeralDecimalScale=r>=0?r:2,c.numeralThousandsGroupStyle=n||Ee.groupStyle.thousand,c.numeralPositiveOnly=!!i,c.stripLeadingZeroes=!1!==o,c.prefix=s||""===s?s:"",c.signBeforePrefix=!!a,c.tailPrefix=!!l,c.delimiter=d||""===d?d:",",c.delimiterRE=d?new RegExp("\\"+d,"g"):""};Ee.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},Ee.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var t,r,n,i,o=this,s="";switch(e=e.replace(/[A-Za-z]/g,"").replace(o.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",o.numeralPositiveOnly?"":"-").replace("M",o.numeralDecimalMark),o.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,"$1")),r="-"===e.slice(0,1)?"-":"",n=void 0!==o.prefix?o.signBeforePrefix?r+o.prefix:o.prefix+r:r,i=e,e.indexOf(o.numeralDecimalMark)>=0&&(i=(t=e.split(o.numeralDecimalMark))[0],s=o.numeralDecimalMark+t[1].slice(0,o.numeralDecimalScale)),"-"===r&&(i=i.slice(1)),o.numeralIntegerScale>0&&(i=i.slice(0,o.numeralIntegerScale)),o.numeralThousandsGroupStyle){case Ee.groupStyle.lakh:i=i.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+o.delimiter);break;case Ee.groupStyle.wan:i=i.replace(/(\d)(?=(\d{4})+$)/g,"$1"+o.delimiter);break;case Ee.groupStyle.thousand:i=i.replace(/(\d)(?=(\d{3})+$)/g,"$1"+o.delimiter)}return o.tailPrefix?r+i.toString()+(o.numeralDecimalScale>0?s.toString():"")+o.prefix:n+i.toString()+(o.numeralDecimalScale>0?s.toString():"")}};var Pe=Ee,Ce=function(e,t,r){var n=this;n.date=[],n.blocks=[],n.datePattern=e,n.dateMin=t.split("-").reverse().map(function(e){return parseInt(e,10)}),2===n.dateMin.length&&n.dateMin.unshift(0),n.dateMax=r.split("-").reverse().map(function(e){return parseInt(e,10)}),2===n.dateMax.length&&n.dateMax.unshift(0),n.initBlocks()};Ce.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){"Y"===t?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(n,i){if(e.length>0){var o=e.slice(0,n),s=o.slice(0,1),a=e.slice(n);switch(t.datePattern[i]){case"d":"00"===o?o="01":parseInt(s,10)>3?o="0"+s:parseInt(o,10)>31&&(o="31");break;case"m":"00"===o?o="01":parseInt(s,10)>1?o="0"+s:parseInt(o,10)>12&&(o="12")}r+=o,e=a}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,n,i=this,o=i.datePattern,s=[],a=0,l=0,d=0,c=0,h=0,u=0,p=!1;return 4===e.length&&"y"!==o[0].toLowerCase()&&"y"!==o[1].toLowerCase()&&(h=2-(c="d"===o[0]?0:2),t=parseInt(e.slice(c,c+2),10),r=parseInt(e.slice(h,h+2),10),s=this.getFixedDate(t,r,0)),8===e.length&&(o.forEach(function(e,t){switch(e){case"d":a=t;break;case"m":l=t;break;default:d=t}}),u=2*d,c=a<=d?2*a:2*a+2,h=l<=d?2*l:2*l+2,t=parseInt(e.slice(c,c+2),10),r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+4),10),p=4===e.slice(u,u+4).length,s=this.getFixedDate(t,r,n)),4!==e.length||"y"!==o[0]&&"y"!==o[1]||(u=2-(h="m"===o[0]?0:2),r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+2),10),p=2===e.slice(u,u+2).length,s=[0,r,n]),6!==e.length||"Y"!==o[0]&&"Y"!==o[1]||(u=2-.5*(h="m"===o[0]?0:4),r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+4),10),p=4===e.slice(u,u+4).length,s=[0,r,n]),s=i.getRangeFixedDate(s),i.date=s,0===s.length?e:o.reduce(function(e,t){switch(t){case"d":return e+(0===s[0]?"":i.addLeadingZero(s[0]));case"m":return e+(0===s[1]?"":i.addLeadingZero(s[1]));case"y":return e+(p?i.addLeadingZeroForYear(s[2],!1):"");case"Y":return e+(p?i.addLeadingZeroForYear(s[2],!0):"")}},"")},getRangeFixedDate:function(e){var t=this,r=t.datePattern,n=t.dateMin||[],i=t.dateMax||[];return!e.length||n.length<3&&i.length<3||r.find(function(e){return"y"===e.toLowerCase()})&&0===e[2]?e:i.length&&(i[2]<e[2]||i[2]===e[2]&&(i[1]<e[1]||i[1]===e[1]&&i[0]<e[0]))?i:n.length&&(n[2]>e[2]||n[2]===e[2]&&(n[1]>e[1]||n[1]===e[1]&&n[0]>e[0]))?n:e},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),(t<7&&t%2==0||t>8&&t%2==1)&&(e=Math.min(e,2===t?this.isLeapYear(r)?29:28:30)),[e,t,r]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e,t){return t?(e<10?"000":e<100?"00":e<1e3?"0":"")+e:(e<10?"0":"")+e}};var Ae=Ce,Ie=function(e,t){var r=this;r.time=[],r.blocks=[],r.timePattern=e,r.timeFormat=t,r.initBlocks()};Ie.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return"12"===String(this.timeFormat)?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,r="";e=e.replace(/[^\d]/g,"");var n=t.getTimeFormatOptions();return t.blocks.forEach(function(i,o){if(e.length>0){var s=e.slice(0,i),a=s.slice(0,1),l=e.slice(i);switch(t.timePattern[o]){case"h":parseInt(a,10)>n.maxHourFirstDigit?s="0"+a:parseInt(s,10)>n.maxHours&&(s=n.maxHours+"");break;case"m":case"s":parseInt(a,10)>n.maxMinutesFirstDigit?s="0"+a:parseInt(s,10)>n.maxMinutes&&(s=n.maxMinutes+"")}r+=s,e=l}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var t,r,n,i=this,o=i.timePattern,s=[],a=0,l=0,d=0,c=0,h=0,u=0;return 6===e.length&&(o.forEach(function(e,t){switch(e){case"s":a=2*t;break;case"m":l=2*t;break;case"h":d=2*t}}),u=d,h=l,c=a,t=parseInt(e.slice(c,c+2),10),r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+2),10),s=this.getFixedTime(n,r,t)),4===e.length&&i.timePattern.indexOf("s")<0&&(o.forEach(function(e,t){switch(e){case"m":l=2*t;break;case"h":d=2*t}}),u=d,h=l,t=0,r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+2),10),s=this.getFixedTime(n,r,t)),i.time=s,0===s.length?e:o.reduce(function(e,t){switch(t){case"s":return e+i.addLeadingZero(s[2]);case"m":return e+i.addLeadingZero(s[1]);case"h":return e+i.addLeadingZero(s[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}};var Me=Ie,Te=function(e,t){var r=this;r.delimiter=t||""===t?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e};Te.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var r,n="",i=!1,o=0,s=(e=(e=(e=e.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(t.delimiterRE,"")).length;o<s;o++)r=t.formatter.inputDigit(e.charAt(o)),/[\s()-]/g.test(r)?(n=r,i=!0):i||(n=r);return n=(n=n.replace(/[()]/g,"")).replace(/[\s-]/g,t.delimiter)}};var Fe=Te,Le={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(e,t){return e+t},0);return e.concat(19-t)},getInfo:function(e,t){var r=Le.blocks,n=Le.re;for(var i in t=!!t,n)if(n[i].test(e)){var o=r[i];return{type:i,blocks:t?this.getStrictBlocks(o):o}}return{type:"unknown",blocks:t?this.getStrictBlocks(r.general):r.general}}},De=Le,Ne={noop:function(){},strip:function(e,t){return e.replace(t,"")},getPostDelimiter:function(e,t,r){if(0===r.length)return e.slice(-t.length)===t?t:"";var n="";return r.forEach(function(t){e.slice(-t.length)===t&&(n=t)}),n},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,n,i){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,n,i)},getPositionOffset:function(e,t,r,n,i){var o,s,a;return o=this.stripDelimiters(t.slice(0,e),n,i),s=this.stripDelimiters(r.slice(0,e),n,i),0!==(a=o.length-s.length)?a/Math.abs(a):0},stripDelimiters:function(e,t,r){var n=this;if(0===r.length){var i=t?n.getDelimiterREByDelimiter(t):"";return e.replace(i,"")}return r.forEach(function(t){t.split("").forEach(function(t){e=e.replace(n.getDelimiterREByDelimiter(t),"")})}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(e,t,r,n,i,o,s,a,l){if(0===r)return e;if(e===t&&""!==e)return"";if(l&&"-"==e.slice(0,1)){var d="-"==n.slice(0,1)?n.slice(1):n;return"-"+this.getPrefixStrippedValue(e.slice(1),t,r,d,i,o,s,a,l)}if(n.slice(0,r)!==t&&!a)return s&&!n&&e?e:"";if(n.slice(-r)!==t&&a)return s&&!n&&e?e:"";var c=this.stripDelimiters(n,i,o);return e.slice(0,r)===t||a?e.slice(-r)!==t&&a?c.slice(0,-r-1):a?e.slice(0,-r):e.slice(r):c.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(""===e.charAt(r++))return-1;return r},getFormattedValue:function(e,t,r,n,i,o){var s="",a=i.length>0,l="";return 0===r?e:(t.forEach(function(t,d){if(e.length>0){var c=e.slice(0,t),h=e.slice(t);l=a?i[o?d-1:d]||l:n,o?(d>0&&(s+=l),s+=c):(s+=c,c.length===t&&d<r-1&&(s+=l)),e=h}}),s)},fixPrefixCursor:function(e,t,r,n){if(e){var i=e.value,o=r||n[0]||" ";if(e.setSelectionRange&&t&&!(t.length+o.length<=i.length)){var s=2*i.length;setTimeout(function(){e.setSelectionRange(s,s)},1)}}},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch(t){}return!1},setSelection:function(e,t,r){if(e===this.getActiveElement(r)&&!(e&&e.value.length<=t))if(e.createTextRange){var n=e.createTextRange();n.move("character",t),n.select()}else try{e.setSelectionRange(t,t)}catch(i){console.warn("The input element type does not support selection")}},getActiveElement:function(e){var t=e.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}},Re={assign:function(e,t){return t=t||{},(e=e||{}).creditCard=!!t.creditCard,e.creditCardStrictMode=!!t.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=t.onCreditCardTypeChanged||function(){},e.phone=!!t.phone,e.phoneRegionCode=t.phoneRegionCode||"AU",e.phoneFormatter={},e.time=!!t.time,e.timePattern=t.timePattern||["h","m","s"],e.timeFormat=t.timeFormat||"24",e.timeFormatter={},e.date=!!t.date,e.datePattern=t.datePattern||["d","m","Y"],e.dateMin=t.dateMin||"",e.dateMax=t.dateMax||"",e.dateFormatter={},e.numeral=!!t.numeral,e.numeralIntegerScale=t.numeralIntegerScale>0?t.numeralIntegerScale:0,e.numeralDecimalScale=t.numeralDecimalScale>=0?t.numeralDecimalScale:2,e.numeralDecimalMark=t.numeralDecimalMark||".",e.numeralThousandsGroupStyle=t.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!t.numeralPositiveOnly,e.stripLeadingZeroes=!1!==t.stripLeadingZeroes,e.signBeforePrefix=!!t.signBeforePrefix,e.tailPrefix=!!t.tailPrefix,e.swapHiddenInput=!!t.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!t.numericOnly,e.uppercase=!!t.uppercase,e.lowercase=!!t.lowercase,e.prefix=e.creditCard||e.date?"":t.prefix||"",e.noImmediatePrefix=!!t.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!t.rawValueTrimPrefix,e.copyDelimiter=!!t.copyDelimiter,e.initValue=void 0!==t.initValue&&null!==t.initValue?t.initValue.toString():"",e.delimiter=t.delimiter||""===t.delimiter?t.delimiter:t.date?"/":t.time?":":t.numeral?",":(t.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!t.delimiterLazyShow,e.delimiters=t.delimiters||[],e.blocks=t.blocks||[],e.blocksLength=e.blocks.length,e.root="object"==typeof Se&&Se?Se:window,e.document=t.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=t.onValueChanged||function(){},e}},Be=function(e,t){var r=this,n=!1;if("string"==typeof e?(r.element=document.querySelector(e),n=document.querySelectorAll(e).length>1):void 0!==e.length&&e.length>0?(r.element=e[0],n=e.length>1):r.element=e,!r.element)throw new Error("[cleave.js] Please check the element");if(n)try{console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.")}catch(i){}t.initValue=r.element.value,r.properties=Be.DefaultProperties.assign({},t),r.init()};Be.prototype={init:function(){var e=this,t=e.properties;t.numeral||t.phone||t.creditCard||t.time||t.date||0!==t.blocksLength||t.prefix?(t.maxLength=Be.Util.getMaxLength(t.blocks),e.isAndroid=Be.Util.isAndroid(),e.lastInputValue="",e.isBackward="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),(t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue)):e.onInput(t.initValue)},initSwapHiddenInput:function(){var e=this;if(e.properties.swapHiddenInput){var t=e.element.cloneNode(!0);e.element.parentNode.insertBefore(t,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type="hidden",e.element=t,e.element.id=""}},initNumeralFormatter:function(){var e=this.properties;e.numeral&&(e.numeralFormatter=new Be.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var e=this.properties;e.time&&(e.timeFormatter=new Be.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=Be.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var e=this.properties;e.date&&(e.dateFormatter=new Be.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=Be.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var e=this.properties;if(e.phone)try{e.phoneFormatter=new Be.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch(t){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,r=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=8===r},onChange:function(e){var t=this,r=t.properties,n=Be.Util;t.isBackward=t.isBackward||"deleteContentBackward"===e.inputType;var i=n.getPostDelimiter(t.lastInputValue,r.delimiter,r.delimiters);t.isBackward&&i?r.postDelimiterBackspace=i:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),Be.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){Be.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(""))},onCopy:function(e){Be.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var t=this.properties,r=Be.Util,n=this.element.value,i="";i=t.copyDelimiter?n:r.stripDelimiters(n,t.delimiter,t.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",i):window.clipboardData.setData("Text",i),e.preventDefault()}catch(o){}},onInput:function(e){var t=this,r=t.properties,n=Be.Util,i=n.getPostDelimiter(e,r.delimiter,r.delimiters);return r.numeral||!r.postDelimiterBackspace||i||(e=n.headStr(e,e.length-r.postDelimiterBackspace.length)),r.phone?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length),void t.updateValueState()):r.numeral?(r.prefix&&r.noImmediatePrefix&&0===e.length?r.result="":r.result=r.numeralFormatter.format(e),void t.updateValueState()):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=n.stripDelimiters(e,r.delimiter,r.delimiters),e=n.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),e=r.numericOnly?n.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,r.prefix&&(r.tailPrefix?e+=r.prefix:e=r.prefix+e,0===r.blocksLength)?(r.result=e,void t.updateValueState()):(r.creditCard&&t.updateCreditCardPropsByValue(e),e=n.headStr(e,r.maxLength),r.result=n.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,r=this.properties,n=Be.Util;n.headStr(r.result,4)!==n.headStr(e,4)&&(t=Be.CreditCardDetector.getInfo(e,r.creditCardStrictMode),r.blocks=t.blocks,r.blocksLength=r.blocks.length,r.maxLength=n.getMaxLength(r.blocks),r.creditCardType!==t.type&&(r.creditCardType=t.type,r.onCreditCardTypeChanged.call(this,r.creditCardType)))},updateValueState:function(){var e=this,t=Be.Util,r=e.properties;if(e.element){var n=e.element.selectionEnd,i=e.element.value,o=r.result;n=t.getNextCursorPosition(n,i,o,r.delimiter,r.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=o,t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged()},1):(e.element.value=o,r.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged())}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=null!=e?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this.properties,t=Be.Util,r=this.element.value;return e.rawValueTrimPrefix&&(r=t.getPrefixStrippedValue(r,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),r=e.numeral?e.numeralFormatter.getRawValue(r):t.stripDelimiters(r,e.delimiter,e.delimiters)},getISOFormatDate:function(){var e=this.properties;return e.date?e.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var e=this.properties;return e.time?e.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},Be.NumeralFormatter=Pe,Be.DateFormatter=Ae,Be.TimeFormatter=Me,Be.PhoneFormatter=Fe,Be.CreditCardDetector=De,Be.Util=Ne,Be.DefaultProperties=Re,("object"==typeof Se&&Se?Se:window).Cleave=Be;var Ue=Be,qe={},ze={},je={};let Oe;const He=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];je.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},je.getSymbolTotalCodewords=function(e){return He[e]},je.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},je.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Oe=e},je.isKanjiModeEnabled=function(){return void 0!==Oe},je.toSJIS=function(e){return Oe(e)};var Ze,Ve={};function Ye(){this.buffer=[],this.length=0}(Ze=Ve).L={bit:1},Ze.M={bit:0},Ze.Q={bit:3},Ze.H={bit:2},Ze.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},Ze.from=function(e,t){if(Ze.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return Ze.L;case"m":case"medium":return Ze.M;case"q":case"quartile":return Ze.Q;case"h":case"high":return Ze.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(r){return t}},Ye.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var We=Ye;function Ke(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Ke.prototype.set=function(e,t,r,n){const i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},Ke.prototype.get=function(e,t){return this.data[e*this.size+t]},Ke.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},Ke.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Qe=Ke,$e={};!function(e){const t=je.getSymbolSize;e.getRowColCoords=function(e){if(1===e)return[];const r=Math.floor(e/7)+2,n=t(e),i=145===n?26:2*Math.ceil((n-13)/(2*r-2)),o=[n-7];for(let t=1;t<r-1;t++)o[t]=o[t-1]-i;return o.push(6),o.reverse()},e.getPositions=function(t){const r=[],n=e.getRowColCoords(t),i=n.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)0===e&&0===t||0===e&&t===i-1||e===i-1&&0===t||r.push([n[e],n[t]]);return r}}($e);var Xe={};const Je=je.getSymbolSize;Xe.getPositions=function(e){const t=Je(e);return[[0,0],[t-7,0],[0,t-7]]};var Ge={};!function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,r=3,n=40,i=10;function o(t,r,n){switch(t){case e.Patterns.PATTERN000:return(r+n)%2==0;case e.Patterns.PATTERN001:return r%2==0;case e.Patterns.PATTERN010:return n%3==0;case e.Patterns.PATTERN011:return(r+n)%3==0;case e.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case e.Patterns.PATTERN101:return r*n%2+r*n%3==0;case e.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case e.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){const r=e.size;let n=0,i=0,o=0,s=null,a=null;for(let l=0;l<r;l++){i=o=0,s=a=null;for(let d=0;d<r;d++){let r=e.get(l,d);r===s?i++:(i>=5&&(n+=t+(i-5)),s=r,i=1),r=e.get(d,l),r===a?o++:(o>=5&&(n+=t+(o-5)),a=r,o=1)}i>=5&&(n+=t+(i-5)),o>=5&&(n+=t+(o-5))}return n},e.getPenaltyN2=function(e){const t=e.size;let n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){const t=e.get(r,i)+e.get(r,i+1)+e.get(r+1,i)+e.get(r+1,i+1);4!==t&&0!==t||n++}return n*r},e.getPenaltyN3=function(e){const t=e.size;let r=0,i=0,o=0;for(let n=0;n<t;n++){i=o=0;for(let s=0;s<t;s++)i=i<<1&2047|e.get(n,s),s>=10&&(1488===i||93===i)&&r++,o=o<<1&2047|e.get(s,n),s>=10&&(1488===o||93===o)&&r++}return r*n},e.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let n=0;n<r;n++)t+=e.data[n];return Math.abs(Math.ceil(100*t/r/5)-10)*i},e.applyMask=function(e,t){const r=t.size;for(let n=0;n<r;n++)for(let i=0;i<r;i++)t.isReserved(i,n)||t.xor(i,n,o(e,i,n))},e.getBestMask=function(t,r){const n=Object.keys(e.Patterns).length;let i=0,o=1/0;for(let s=0;s<n;s++){r(s),e.applyMask(s,t);const n=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),n<o&&(o=n,i=s)}return i}}(Ge);var _e={};const et=Ve,tt=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],rt=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];_e.getBlocksCount=function(e,t){switch(t){case et.L:return tt[4*(e-1)+0];case et.M:return tt[4*(e-1)+1];case et.Q:return tt[4*(e-1)+2];case et.H:return tt[4*(e-1)+3];default:return}},_e.getTotalCodewordsCount=function(e,t){switch(t){case et.L:return rt[4*(e-1)+0];case et.M:return rt[4*(e-1)+1];case et.Q:return rt[4*(e-1)+2];case et.H:return rt[4*(e-1)+3];default:return}};var nt={},it={};const ot=new Uint8Array(512),st=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)ot[t]=e,st[e]=t,e<<=1,256&e&&(e^=285);for(let t=255;t<512;t++)ot[t]=ot[t-255]}(),it.log=function(e){if(e<1)throw new Error("log("+e+")");return st[e]},it.exp=function(e){return ot[e]},it.mul=function(e,t){return 0===e||0===t?0:ot[st[e]+st[t]]},function(e){const t=it;e.mul=function(e,r){const n=new Uint8Array(e.length+r.length-1);for(let i=0;i<e.length;i++)for(let o=0;o<r.length;o++)n[i+o]^=t.mul(e[i],r[o]);return n},e.mod=function(e,r){let n=new Uint8Array(e);for(;n.length-r.length>=0;){const e=n[0];for(let o=0;o<r.length;o++)n[o]^=t.mul(r[o],e);let i=0;for(;i<n.length&&0===n[i];)i++;n=n.slice(i)}return n},e.generateECPolynomial=function(r){let n=new Uint8Array([1]);for(let i=0;i<r;i++)n=e.mul(n,new Uint8Array([1,t.exp(i)]));return n}}(nt);const at=nt;function lt(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}lt.prototype.initialize=function(e){this.degree=e,this.genPoly=at.generateECPolynomial(this.degree)},lt.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=at.mod(t,this.genPoly),n=this.degree-r.length;if(n>0){const e=new Uint8Array(this.degree);return e.set(r,n),e}return r};var dt=lt,ct={},ht={},ut={isValid:function(e){return!isNaN(e)&&e>=1&&e<=40}},pt={};const mt="[0-9]+";let ft="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ft=ft.replace(/u/g,"\\u");const gt="(?:(?![A-Z0-9 $%*+\\-./:]|"+ft+")(?:.|[\r\n]))+";pt.KANJI=new RegExp(ft,"g"),pt.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),pt.BYTE=new RegExp(gt,"g"),pt.NUMERIC=new RegExp(mt,"g"),pt.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const yt=new RegExp("^"+ft+"$"),vt=new RegExp("^"+mt+"$"),bt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");pt.testKanji=function(e){return yt.test(e)},pt.testNumeric=function(e){return vt.test(e)},pt.testAlphanumeric=function(e){return bt.test(e)},function(e){const t=ut,r=pt;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,r){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!t.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?e.ccBits[0]:r<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return r.testNumeric(t)?e.NUMERIC:r.testAlphanumeric(t)?e.ALPHANUMERIC:r.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},e.isValid=function(e){return e&&e.bit&&e.ccBits},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(n){return r}}}(ht),function(e){const t=je,r=_e,n=Ve,i=ht,o=ut,s=t.getBCHDigit(7973);function a(e,t){return i.getCharCountIndicator(e,t)+4}function l(e,t){let r=0;return e.forEach(function(e){const n=a(e.mode,t);r+=n+e.getBitsLength()}),r}e.from=function(e,t){return o.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,n,s){if(!o.isValid(e))throw new Error("Invalid QR Code version");void 0===s&&(s=i.BYTE);const l=8*(t.getSymbolTotalCodewords(e)-r.getTotalCodewordsCount(e,n));if(s===i.MIXED)return l;const d=l-a(s,e);switch(s){case i.NUMERIC:return Math.floor(d/10*3);case i.ALPHANUMERIC:return Math.floor(d/11*2);case i.KANJI:return Math.floor(d/13);case i.BYTE:default:return Math.floor(d/8)}},e.getBestVersionForData=function(t,r){let o;const s=n.from(r,n.M);if(Array.isArray(t)){if(t.length>1)return function(t,r){for(let n=1;n<=40;n++)if(l(t,n)<=e.getCapacity(n,r,i.MIXED))return n}(t,s);if(0===t.length)return 1;o=t[0]}else o=t;return function(t,r,n){for(let i=1;i<=40;i++)if(r<=e.getCapacity(i,n,t))return i}(o.mode,o.getLength(),s)},e.getEncodedBits=function(e){if(!o.isValid(e)||e<7)throw new Error("Invalid QR Code version");let r=e<<12;for(;t.getBCHDigit(r)-s>=0;)r^=7973<<t.getBCHDigit(r)-s;return e<<12|r}}(ct);var wt={};const xt=je,kt=xt.getBCHDigit(1335);wt.getEncodedBits=function(e,t){const r=e.bit<<3|t;let n=r<<10;for(;xt.getBCHDigit(n)-kt>=0;)n^=1335<<xt.getBCHDigit(n)-kt;return 21522^(r<<10|n)};var St={};const Et=ht;function Pt(e){this.mode=Et.NUMERIC,this.data=e.toString()}Pt.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Pt.prototype.getLength=function(){return this.data.length},Pt.prototype.getBitsLength=function(){return Pt.getBitsLength(this.data.length)},Pt.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))};var Ct=Pt;const At=ht,It=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Mt(e){this.mode=At.ALPHANUMERIC,this.data=e}Mt.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},Mt.prototype.getLength=function(){return this.data.length},Mt.prototype.getBitsLength=function(){return Mt.getBitsLength(this.data.length)},Mt.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*It.indexOf(this.data[t]);r+=It.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(It.indexOf(this.data[t]),6)};var Tt=Mt;const Ft=ht;function Lt(e){this.mode=Ft.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}Lt.getBitsLength=function(e){return 8*e},Lt.prototype.getLength=function(){return this.data.length},Lt.prototype.getBitsLength=function(){return Lt.getBitsLength(this.data.length)},Lt.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)};var Dt=Lt;const Nt=ht,Rt=je;function Bt(e){this.mode=Nt.KANJI,this.data=e}Bt.getBitsLength=function(e){return 13*e},Bt.prototype.getLength=function(){return this.data.length},Bt.prototype.getBitsLength=function(){return Bt.getBitsLength(this.data.length)},Bt.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=Rt.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}};var Ut,qt=Bt,zt={exports:{}};Ut={single_source_shortest_paths:function(e,t,r){var n={},i={};i[t]=0;var o,s,a,l,d,c,h,u=Ut.PriorityQueue.make();for(u.push(t,0);!u.empty();)for(a in s=(o=u.pop()).value,l=o.cost,d=e[s]||{})d.hasOwnProperty(a)&&(c=l+d[a],h=i[a],(void 0===i[a]||h>c)&&(i[a]=c,u.push(a,c),n[a]=s));if(void 0!==r&&void 0===i[r]){var p=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(p)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var n=Ut.single_source_shortest_paths(e,t,r);return Ut.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t,r=Ut.PriorityQueue,n={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(n[t]=r[t]);return n.queue=[],n.sorter=e.sorter||r.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}},zt.exports=Ut;var jt=zt.exports;!function(e){const t=ht,r=Ct,n=Tt,i=Dt,o=qt,s=pt,a=je,l=jt;function d(e){return unescape(encodeURIComponent(e)).length}function c(e,t,r){const n=[];let i;for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function h(e){const r=c(s.NUMERIC,t.NUMERIC,e),n=c(s.ALPHANUMERIC,t.ALPHANUMERIC,e);let i,o;a.isKanjiModeEnabled()?(i=c(s.BYTE,t.BYTE,e),o=c(s.KANJI,t.KANJI,e)):(i=c(s.BYTE_KANJI,t.BYTE,e),o=[]);return r.concat(n,i,o).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function u(e,s){switch(s){case t.NUMERIC:return r.getBitsLength(e);case t.ALPHANUMERIC:return n.getBitsLength(e);case t.KANJI:return o.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e,s){let l;const d=t.getBestModeForData(e);if(l=t.from(s,d),l!==t.BYTE&&l.bit<d.bit)throw new Error('"'+e+'" cannot be encoded with mode '+t.toString(l)+".\n Suggested mode is: "+t.toString(d));switch(l!==t.KANJI||a.isKanjiModeEnabled()||(l=t.BYTE),l){case t.NUMERIC:return new r(e);case t.ALPHANUMERIC:return new n(e);case t.KANJI:return new o(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(p(t,null)):t.data&&e.push(p(t.data,t.mode)),e},[])},e.fromString=function(r,n){const i=function(e){const r=[];for(let n=0;n<e.length;n++){const i=e[n];switch(i.mode){case t.NUMERIC:r.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:r.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:r.push([i,{data:i.data,mode:t.BYTE,length:d(i.data)}]);break;case t.BYTE:r.push([{data:i.data,mode:t.BYTE,length:d(i.data)}])}}return r}(h(r,a.isKanjiModeEnabled())),o=function(e,r){const n={},i={start:{}};let o=["start"];for(let s=0;s<e.length;s++){const a=e[s],l=[];for(let e=0;e<a.length;e++){const d=a[e],c=""+s+e;l.push(c),n[c]={node:d,lastCount:0},i[c]={};for(let e=0;e<o.length;e++){const s=o[e];n[s]&&n[s].node.mode===d.mode?(i[s][c]=u(n[s].lastCount+d.length,d.mode)-u(n[s].lastCount,d.mode),n[s].lastCount+=d.length):(n[s]&&(n[s].lastCount=d.length),i[s][c]=u(d.length,d.mode)+4+t.getCharCountIndicator(d.mode,r))}}o=l}for(let t=0;t<o.length;t++)i[o[t]].end=0;return{map:i,table:n}}(i,n),s=l.find_path(o.map,"start","end"),c=[];for(let e=1;e<s.length-1;e++)c.push(o.table[s[e]].node);return e.fromArray(function(e){return e.reduce(function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}(c))},e.rawSplit=function(t){return e.fromArray(h(t,a.isKanjiModeEnabled()))}}(St);const Ot=je,Ht=Ve,Zt=We,Vt=Qe,Yt=$e,Wt=Xe,Kt=Ge,Qt=_e,$t=dt,Xt=ct,Jt=wt,Gt=ht,_t=St;function er(e,t,r){const n=e.size,i=Jt.getEncodedBits(t,r);let o,s;for(o=0;o<15;o++)s=1==(i>>o&1),o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(n-15+o,8,s,!0),o<8?e.set(8,n-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(n-8,8,1,!0)}function tr(e,t,r){const n=new Zt;r.forEach(function(t){n.put(t.mode.bit,4),n.put(t.getLength(),Gt.getCharCountIndicator(t.mode,e)),t.write(n)});const i=8*(Ot.getSymbolTotalCodewords(e)-Qt.getTotalCodewordsCount(e,t));for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);const o=(i-n.getLengthInBits())/8;for(let s=0;s<o;s++)n.put(s%2?17:236,8);return function(e,t,r){const n=Ot.getSymbolTotalCodewords(t),i=Qt.getTotalCodewordsCount(t,r),o=n-i,s=Qt.getBlocksCount(t,r),a=n%s,l=s-a,d=Math.floor(n/s),c=Math.floor(o/s),h=c+1,u=d-c,p=new $t(u);let m=0;const f=new Array(s),g=new Array(s);let y=0;const v=new Uint8Array(e.buffer);for(let S=0;S<s;S++){const e=S<l?c:h;f[S]=v.slice(m,m+e),g[S]=p.encode(f[S]),m+=e,y=Math.max(y,e)}const b=new Uint8Array(n);let w,x,k=0;for(w=0;w<y;w++)for(x=0;x<s;x++)w<f[x].length&&(b[k++]=f[x][w]);for(w=0;w<u;w++)for(x=0;x<s;x++)b[k++]=g[x][w];return b}(n,e,t)}function rr(e,t,r,n){let i;if(Array.isArray(e))i=_t.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=_t.rawSplit(e);n=Xt.getBestVersionForData(t,r)}i=_t.fromString(e,n||40)}}const o=Xt.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<o)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+o+".\n")}else t=o;const s=tr(t,r,i),a=Ot.getSymbolSize(t),l=new Vt(a);return function(e,t){const r=e.size,n=Wt.getPositions(t);for(let i=0;i<n.length;i++){const t=n[i][0],o=n[i][1];for(let n=-1;n<=7;n++)if(!(t+n<=-1||r<=t+n))for(let i=-1;i<=7;i++)o+i<=-1||r<=o+i||(n>=0&&n<=6&&(0===i||6===i)||i>=0&&i<=6&&(0===n||6===n)||n>=2&&n<=4&&i>=2&&i<=4?e.set(t+n,o+i,!0,!0):e.set(t+n,o+i,!1,!0))}}(l,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(l),function(e,t){const r=Yt.getPositions(t);for(let n=0;n<r.length;n++){const t=r[n][0],i=r[n][1];for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)-2===r||2===r||-2===n||2===n||0===r&&0===n?e.set(t+r,i+n,!0,!0):e.set(t+r,i+n,!1,!0)}}(l,t),er(l,r,0),t>=7&&function(e,t){const r=e.size,n=Xt.getEncodedBits(t);let i,o,s;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+r-8-3,s=1==(n>>a&1),e.set(i,o,s,!0),e.set(o,i,s,!0)}(l,t),function(e,t){const r=e.size;let n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let n=!1;s<t.length&&(n=1==(t[s]>>>o&1)),e.set(i,a-r,n),o--,-1===o&&(s++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}(l,s),isNaN(n)&&(n=Kt.getBestMask(l,er.bind(null,l,r))),Kt.applyMask(n,l),er(l,r,n),{modules:l,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}ze.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,n,i=Ht.M;return void 0!==t&&(i=Ht.from(t.errorCorrectionLevel,Ht.M),r=Xt.from(t.version),n=Kt.from(t.maskPattern),t.toSJISFunc&&Ot.setToSJISFunction(t.toSJISFunc)),rr(e,r,i,n)};var nr={},ir={};!function(e){function t(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}e.getOptions=function(e){e||(e={}),e.color||(e.color={});const r=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:r,color:{dark:t(e.color.dark||"#000000ff"),light:t(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},e.getImageWidth=function(t,r){const n=e.getScale(t,r);return Math.floor((t+2*r.margin)*n)},e.qrToImageData=function(t,r,n){const i=r.modules.size,o=r.modules.data,s=e.getScale(i,n),a=Math.floor((i+2*n.margin)*s),l=n.margin*s,d=[n.color.light,n.color.dark];for(let e=0;e<a;e++)for(let r=0;r<a;r++){let c=4*(e*a+r),h=n.color.light;if(e>=l&&r>=l&&e<a-l&&r<a-l){h=d[o[Math.floor((e-l)/s)*i+Math.floor((r-l)/s)]?1:0]}t[c++]=h.r,t[c++]=h.g,t[c++]=h.b,t[c]=h.a}}}(ir),function(e){const t=ir;e.render=function(e,r,n){let i=n,o=r;void 0!==i||r&&r.getContext||(i=r,r=void 0),r||(o=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),i=t.getOptions(i);const s=t.getImageWidth(e.modules.size,i),a=o.getContext("2d"),l=a.createImageData(s,s);return t.qrToImageData(l.data,e,i),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(a,o,s),a.putImageData(l,0,0),o},e.renderToDataURL=function(t,r,n){let i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});const o=e.render(t,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}}(nr);var or={};const sr=ir;function ar(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function lr(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}or.render=function(e,t,r){const n=sr.getOptions(t),i=e.modules.size,o=e.modules.data,s=i+2*n.margin,a=n.color.light.a?"<path "+ar(n.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",l="<path "+ar(n.color.dark,"stroke")+' d="'+function(e,t,r){let n="",i=0,o=!1,s=0;for(let a=0;a<e.length;a++){const l=Math.floor(a%t),d=Math.floor(a/t);l||o||(o=!0),e[a]?(s++,a>0&&l>0&&e[a-1]||(n+=o?lr("M",l+r,.5+d+r):lr("m",i,0),i=0,o=!1),l+1<t&&e[a+1]||(n+=lr("h",s),s=0)):i++}return n}(o,i,n.margin)+'"/>',d='viewBox="0 0 '+s+" "+s+'"',c='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+d+' shape-rendering="crispEdges">'+a+l+"</svg>\n";return"function"==typeof r&&r(null,c),c};const dr=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},cr=ze,hr=nr,ur=or;function pr(e,t,r,n,i){const o=[].slice.call(arguments,1),s=o.length,a="function"==typeof o[s-1];if(!a&&!dr())throw new Error("Callback required as last argument");if(!a){if(s<1)throw new Error("Too few arguments provided");return 1===s?(r=t,t=n=void 0):2!==s||t.getContext||(n=r,r=t,t=void 0),new Promise(function(i,o){try{const o=cr.create(r,n);i(e(o,t,n))}catch(s){o(s)}})}if(s<2)throw new Error("Too few arguments provided");2===s?(i=r,r=t,t=n=void 0):3===s&&(t.getContext&&void 0===i?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0));try{const o=cr.create(r,n);i(null,e(o,t,n))}catch(l){i(l)}}qe.create=cr.create,qe.toCanvas=pr.bind(null,hr.render),qe.toDataURL=pr.bind(null,hr.renderToDataURL),qe.toString=pr.bind(null,function(e,t,r){return ur.render(e,r)});var mr=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,gr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?fr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&mr(t,r,o),o};let yr=class extends se{constructor(){super(...arguments),this.currentState={status:"idle"},this.selectedMethod=null,this.cardFormData={cardNumber:"",expiry:"",cvv:"",cardholderName:""},this.formErrors={},this.paymentData=null,this.feesExpanded=!1,this.isInitializing=!0,this.cardBrand="unknown",this.paymentLocked=!1,this.show3DSModal=!1,this.showQRModal=!1,this.nextActionUrl=null,this.qrCode=null,this.qrCodeDataUrl=null,this.qrAutoResumeTimer=null,this.qrPollingInProgress=!1,this.sdk=null,this.isInitialized=!1,this.cardNumberCleave=null,this.expiryCleave=null,this.leaveEventsCounter=0,this.previousState=null,this.handle3DSPostMessage=e=>{"ON_AWX_3DS_START_PAGE_LEAVE"===e.data&&(this.leaveEventsCounter++,this.leaveEventsCounter>1&&this.handle3DSComplete())}}hasAllRequiredProps(){return!!(this.config&&this.adapters&&this.amount&&this.currency&&this.orderId)&&(!(!this.firstName||"string"!=typeof this.firstName||""===this.firstName.trim())&&(!(!this.lastName||"string"!=typeof this.lastName||""===this.lastName.trim())&&!(!this.email||"string"!=typeof this.email||""===this.email.trim())))}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.handle3DSPostMessage),this.addEventListener("force-close-3ds-modal",()=>{this.show3DSModal&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0)})}firstUpdated(){this.initializeSDK()}updated(e){super.updated(e),!this.isInitialized&&this.hasAllRequiredProps()&&(console.info("[OnePayment] All required props now available. Initializing SDK..."),this.initializeSDK())}disconnectedCallback(){var e;super.disconnectedCallback(),null==(e=this.sdk)||e.destroy(),this.isInitialized=!1,this.destroyCleave(),window.removeEventListener("message",this.handle3DSPostMessage),null!==this.qrAutoResumeTimer&&clearTimeout(this.qrAutoResumeTimer)}setupCleave(){setTimeout(()=>{var e,t;const r=null==(e=this.shadowRoot)?void 0:e.querySelector("#cardNumber"),n=null==(t=this.shadowRoot)?void 0:t.querySelector("#expiry");r&&!this.cardNumberCleave&&(this.cardNumberCleave=new Ue(r,{creditCard:!0,delimiter:" ",onCreditCardTypeChanged:e=>{this.cardBrand={visa:"visa",mastercard:"mastercard",amex:"amex",discover:"discover"}[e]||"unknown"}})),n&&!this.expiryCleave&&(this.expiryCleave=new Ue(n,{date:!0,datePattern:["m","y"],delimiter:"/"}))},50)}destroyCleave(){this.cardNumberCleave&&(this.cardNumberCleave.destroy(),this.cardNumberCleave=null),this.expiryCleave&&(this.expiryCleave.destroy(),this.expiryCleave=null)}getFilteredPaymentMethods(){const e=("ready"===this.currentState.status||"processing"===this.currentState.status||"requires_action"===this.currentState.status)&&this.currentState.availableMethods||[];return 0===e.length?[]:e.filter(e=>{var t;return!(null==(t=this.excludePaymentMethods)?void 0:t.includes(e.id))}).map(e=>{if(e.id===pe){if("SGD"!==this.getTransactionData().currency)return{id:e.id,enabled:!1,disabledReason:"PayNow is only available for SGD currency"}}return{id:e.id,enabled:!0}})}initializeSDK(){var e;this.config&&this.adapters&&this.amount&&this.currency&&this.orderId?this.firstName&&"string"==typeof this.firstName&&""!==this.firstName.trim()?this.lastName&&"string"==typeof this.lastName&&""!==this.lastName.trim()?this.email&&"string"==typeof this.email&&""!==this.email.trim()?this.isInitialized||(this.isInitialized=!0,null==(e=this.sdk)||e.destroy(),this.sdk=new ke(this.config,this.adapters),this.sdk.subscribe(e=>{var t;"requires_action"===(null==(t=this.previousState)?void 0:t.status)&&"requires_action"!==e.status&&this.show3DSModal&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling()),this.previousState=e,this.currentState=e,this.dispatchEvent(new CustomEvent("state-change",{detail:{state:e},bubbles:!0,composed:!0}))}),this.sdk.on("payment_succeeded",e=>{this.dispatchEvent(new CustomEvent("payment-success",{detail:{paymentIntentId:e.payload.paymentIntent.id},bubbles:!0,composed:!0}))}),this.sdk.on("payment_failed",e=>{this.dispatchEvent(new CustomEvent("payment-error",{detail:{error:e.payload.error.message},bubbles:!0,composed:!0}))}),this.sdk.on("initialized",e=>{this.paymentData=e.payload.paymentData,this.isInitializing=!1}),this.sdk.on("payment_requires_action",e=>{this.nextActionUrl=e.payload.actionUrl,this.show3DSModal=!0,this.paymentLocked=!0,this.leaveEventsCounter=0}),this.sdk.on("poll_started",()=>{const e="undefined"!=typeof window&&"ReactNativeWebView"in window;this.show3DSModal&&e&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling())}),this.sdk.on("qr_code_received",async e=>{if(this.qrCode=e.payload.qrCode,!this.qrCode)return;const t=this.qrCode.startsWith("http://")||this.qrCode.startsWith("https://"),r=this.qrCode.startsWith("data:image");if(t||r)this.qrCodeDataUrl=this.qrCode;else try{const e=await qe.toDataURL(this.qrCode,{width:300,margin:2,color:{dark:"#000000",light:"#FFFFFF"}});this.qrCodeDataUrl=e}catch(n){this.qrCodeDataUrl=null}this.showQRModal=!0,this.paymentLocked=!0,this.qrAutoResumeTimer=window.setTimeout(()=>{this.handleQRScanned()},1e4)}),this.sdk.initialize({amount:this.amount,currency:this.currency,orderId:this.orderId})):console.error("OnePayment: email is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: lastName is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: firstName is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: Missing required props. Ensure config, adapters, amount, currency, and orderId are provided.")}handleMethodSelect(e){this.paymentLocked||(this.selectedMethod=e)}handleQRScanned(){null!==this.qrAutoResumeTimer&&(clearTimeout(this.qrAutoResumeTimer),this.qrAutoResumeTimer=null),this.qrPollingInProgress=!0,this.sdk&&this.sdk.resumePolling()}handle3DSComplete(){this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling()}handleInputChange(e,t){if(this.cardFormData={...this.cardFormData,[e]:t},this.formErrors[e]){const t={...this.formErrors};delete t[e],this.formErrors=t}}luhnCheck(e){const t=e.replace(/\s/g,"");if(!/^\d+$/.test(t))return!1;let r=0,n=!1;for(let i=t.length-1;i>=0;i--){const e=t.charAt(i);if(!e)continue;let o=parseInt(e,10);n&&(o*=2,o>9&&(o-=9)),r+=o,n=!n}return r%10==0}validateExpiry(e){const t=e.trim();if(!/^\d{1,2}\/\d{2}$/.test(t))return{valid:!1,error:"Invalid format (MM/YY)"};const r=t.split("/"),n=r[0],i=r[1];if(!n||!i)return{valid:!1,error:"Invalid format (MM/YY)"};const o=parseInt(n,10);if(o<1||o>12)return{valid:!1,error:"Invalid month (01-12)"};const s=new Date,a=s.getFullYear(),l=s.getMonth()+1;let d;if(2!==i.length)return{valid:!1,error:"Invalid year format"};{const e=parseInt(i,10),t=a%100,r=100*Math.floor(a/100);if(e<t){d=t-e>80?r+100+e:r+e}else d=r+e}return d<a||d===a&&o<l?{valid:!1,error:"Card has expired"}:{valid:!0}}validateCardForm(){const e={};if(this.cardFormData.cardNumber.trim()?this.luhnCheck(this.cardFormData.cardNumber)||(e.cardNumber="Invalid card number"):e.cardNumber="Please enter card number",this.cardFormData.expiry.trim()){const t=this.validateExpiry(this.cardFormData.expiry);t.valid||(e.expiry=t.error)}else e.expiry="Please enter expiry date";return this.cardFormData.cvv.trim()||(e.cvv="Please enter CVV"),this.cardFormData.cardholderName.trim()||(e.cardholderName="Please enter cardholder name"),this.formErrors=e,0===Object.keys(e).length}handleCardPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(!this.validateCardForm())return;this.paymentLocked=!0;const e=this.cardFormData.expiry.split("/"),t=(e[0]||"").trim(),r=`20${(e[1]||"").trim().substring(0,2)}`;this.sdk.submitPayment(ue,{cardNumber:this.cardFormData.cardNumber.replace(/\s/g,""),expiryMonth:t,expiryYear:r,cvv:this.cardFormData.cvv,firstName:this.firstName,lastName:this.lastName,email:this.email})}handlePayNowPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(pe,{firstName:this.firstName,lastName:this.lastName,email:this.email}))}getTransactionData(){var e;const t=this.paymentData;if(!t)return{currency:this.currency,charge:this.amount,fees:0,feeBreakdown:{transactionFee:0,merchantFee:0,merchantFeeLabel:""},netAmount:this.amount};const r=null==(e=t.fees)?void 0:e.find(e=>"merchant"===e.owner),n="number"==typeof t.totalFee?t.totalFee:Number(t.totalFee)||0,i="number"==typeof t.totalSystemFee?t.totalSystemFee:Number(t.totalSystemFee)||0,o=null!=t.initialAmount?"number"==typeof t.initialAmount?t.initialAmount:Number(t.initialAmount)||0:this.amount,s=null!=t.customerAmount?"number"==typeof t.customerAmount?t.customerAmount:Number(t.customerAmount)||0:o,a=n-i;return{currency:t.currency||this.currency,charge:o,fees:n,feeBreakdown:{transactionFee:a,merchantFee:a,merchantFeeLabel:(r?"percentage"===r.type?`${r.value}%`:`${r.value} ${r.currency}`:"")||"0%"},netAmount:s}}renderTransactionDetailsSkeleton(){return H`
|
|
11
|
+
*/var t;const r=globalThis,n=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;let s=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(n&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&o.set(t,e))}return e}toString(){return this.cssText}};const a=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,i))(t)})(e):e,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:u,getPrototypeOf:p}=Object,m=globalThis,f=m.trustedTypes,g=f?f.emptyScript:"",y=m.reactiveElementPolyfillSupport,v=(e,t)=>e,b={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(n){r=null}}return r}},w=(e,t)=>!l(e,t),x={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);let k=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=x){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);void 0!==n&&d(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:i}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,set(t){const o=null==n?void 0:n.call(this);null==i||i.call(this,t),this.requestUpdate(e,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??x}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=p(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,t=[...h(e),...u(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const e=this._$Eu(t,r);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(e=this.constructor.l)||e.forEach(e=>e(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),void 0!==this.renderRoot&&this.isConnected&&(null==(t=e.hostConnected)||t.call(e))}removeController(e){var t;null==(t=this._$EO)||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(n)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const n of t){const t=document.createElement("style"),i=r.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=n.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(e=this._$EO)||e.forEach(e=>{var t;return null==(t=e.hostConnected)?void 0:t.call(e)})}enableUpdating(e){}disconnectedCallback(){var e;null==(e=this._$EO)||e.forEach(e=>{var t;return null==(t=e.hostDisconnected)?void 0:t.call(e)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var r;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==(null==(r=n.converter)?void 0:r.toAttribute)?n.converter:b).toAttribute(t,n.type);this._$Em=e,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){var r,n;const i=this.constructor,o=i._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=i.getPropertyOptions(o),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null==(r=e.converter)?void 0:r.fromAttribute)?e.converter:b;this._$Em=o;const a=s.fromAttribute(t,e.type);this[o]=a??(null==(n=this._$Ej)?void 0:n.get(o))??a,this._$Em=null}}requestUpdate(e,t,r){var n;if(void 0!==e){const i=this.constructor,o=this[e];if(r??(r=i.getPropertyOptions(e)),!((r.hasChanged??w)(o,t)||r.useDefault&&r.reflect&&o===(null==(n=this._$Ej)?void 0:n.get(e))&&!this.hasAttribute(i._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:i},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),!0!==i||void 0!==o)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===n&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e){const{wrapped:e}=r,n=this[t];!0!==e||this._$AL.has(t)||void 0===n||this.C(t,void 0,r,n)}}let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),null==(e=this._$EO)||e.forEach(e=>{var t;return null==(t=e.hostUpdate)?void 0:t.call(e)}),this.update(r)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;null==(t=this._$EO)||t.forEach(e=>{var t;return null==(t=e.hostUpdated)?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[v("elementProperties")]=new Map,k[v("finalized")]=new Map,null==y||y({ReactiveElement:k}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.1.1");const S=globalThis,E=S.trustedTypes,P=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,C="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,I="?"+A,M=`<${I}>`,T=document,F=()=>T.createComment(""),L=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,N="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,U=/>/g,q=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),z=/'/g,j=/"/g,O=/^(?:script|style|textarea|title)$/i,H=(K=1,(e,...t)=>({_$litType$:K,strings:e,values:t})),Z=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),Y=new WeakMap,W=T.createTreeWalker(T,129);var K;function Q(e,t){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(t):t}class ${constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let i=0,o=0;const s=e.length-1,a=this.parts,[l,d]=((e,t)=>{const r=e.length-1,n=[];let i,o=2===t?"<svg>":3===t?"<math>":"",s=R;for(let a=0;a<r;a++){const t=e[a];let r,l,d=-1,c=0;for(;c<t.length&&(s.lastIndex=c,l=s.exec(t),null!==l);)c=s.lastIndex,s===R?"!--"===l[1]?s=B:void 0!==l[1]?s=U:void 0!==l[2]?(O.test(l[2])&&(i=RegExp("</"+l[2],"g")),s=q):void 0!==l[3]&&(s=q):s===q?">"===l[0]?(s=i??R,d=-1):void 0===l[1]?d=-2:(d=s.lastIndex-l[2].length,r=l[1],s=void 0===l[3]?q:'"'===l[3]?j:z):s===j||s===z?s=q:s===B||s===U?s=R:(s=q,i=void 0);const h=s===q&&e[a+1].startsWith("/>")?" ":"";o+=s===R?t+M:d>=0?(n.push(r),t.slice(0,d)+C+t.slice(d)+A+h):t+A+(-2===d?a:h)}return[Q(e,o+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]})(e,t);if(this.el=$.createElement(l,r),W.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=W.nextNode())&&a.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(C)){const t=d[o++],r=n.getAttribute(e).split(A),s=/([.?@])?(.*)/.exec(t);a.push({type:1,index:i,name:s[2],strings:r,ctor:"."===s[1]?ee:"?"===s[1]?te:"@"===s[1]?re:_}),n.removeAttribute(e)}else e.startsWith(A)&&(a.push({type:6,index:i}),n.removeAttribute(e));if(O.test(n.tagName)){const e=n.textContent.split(A),t=e.length-1;if(t>0){n.textContent=E?E.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],F()),W.nextNode(),a.push({type:2,index:++i});n.append(e[t],F())}}}else if(8===n.nodeType)if(n.data===I)a.push({type:2,index:i});else{let e=-1;for(;-1!==(e=n.data.indexOf(A,e+1));)a.push({type:7,index:i}),e+=A.length-1}i++}}static createElement(e,t){const r=T.createElement("template");return r.innerHTML=e,r}}function X(e,t,r=e,n){var i,o;if(t===Z)return t;let s=void 0!==n?null==(i=r._$Co)?void 0:i[n]:r._$Cl;const a=L(t)?void 0:t._$litDirective$;return(null==s?void 0:s.constructor)!==a&&(null==(o=null==s?void 0:s._$AO)||o.call(s,!1),void 0===a?s=void 0:(s=new a(e),s._$AT(e,r,n)),void 0!==n?(r._$Co??(r._$Co=[]))[n]=s:r._$Cl=s),void 0!==s&&(t=X(e,s._$AS(e,t.values),s,n)),t}class J{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,n=((null==e?void 0:e.creationScope)??T).importNode(t,!0);W.currentNode=n;let i=W.nextNode(),o=0,s=0,a=r[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new G(i,i.nextSibling,this,e):1===a.type?t=new a.ctor(i,a.name,a.strings,this,e):6===a.type&&(t=new ne(i,this,e)),this._$AV.push(t),a=r[++s]}o!==(null==a?void 0:a.index)&&(i=W.nextNode(),o++)}return W.currentNode=T,n}p(e){let t=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class G{get _$AU(){var e;return(null==(e=this._$AM)?void 0:e._$AU)??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=(null==n?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===(null==e?void 0:e.nodeType)&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=X(this,e,t),L(e)?e===V||null==e||""===e?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==Z&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>D(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]))(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==V&&L(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){var t;const{values:r,_$litType$:n}=e,i="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=$.createElement(Q(n.h,n.h[0]),this.options)),n);if((null==(t=this._$AH)?void 0:t._$AD)===i)this._$AH.p(r);else{const e=new J(i,this),t=e.u(this.options);e.p(r),this.T(t),this._$AH=e}}_$AC(e){let t=Y.get(e.strings);return void 0===t&&Y.set(e.strings,t=new $(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const i of e)n===t.length?t.push(r=new G(this.O(F()),this.O(F()),this,this.options)):r=t[n],r._$AI(i),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for(null==(r=this._$AP)||r.call(this,!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;void 0===this._$AM&&(this._$Cv=e,null==(t=this._$AP)||t.call(this,e))}}class _{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,i){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=V}_$AI(e,t=this,r,n){const i=this.strings;let o=!1;if(void 0===i)e=X(this,e,t,0),o=!L(e)||e!==this._$AH&&e!==Z,o&&(this._$AH=e);else{const n=e;let s,a;for(e=i[0],s=0;s<i.length-1;s++)a=X(this,n[r+s],t,s),a===Z&&(a=this._$AH[s]),o||(o=!L(a)||a!==this._$AH[s]),a===V?e=V:e!==V&&(e+=(a??"")+i[s+1]),this._$AH[s]=a}o&&!n&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ee extends _{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class te extends _{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class re extends _{constructor(e,t,r,n,i){super(e,t,r,n,i),this.type=5}_$AI(e,t=this){if((e=X(this,e,t,0)??V)===Z)return;const r=this._$AH,n=e===V&&r!==V||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,i=e!==V&&(r===V||n);n&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;"function"==typeof this._$AH?this._$AH.call((null==(t=this.options)?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class ne{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){X(this,e)}}const ie=S.litHtmlPolyfillSupport;null==ie||ie($,G),(S.litHtmlVersions??(S.litHtmlVersions=[])).push("3.3.1");const oe=globalThis;class se extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,r)=>{const n=(null==r?void 0:r.renderBefore)??t;let i=n._$litPart$;if(void 0===i){const e=(null==r?void 0:r.renderBefore)??null;n._$litPart$=i=new G(t.insertBefore(F(),e),e,void 0,r??{})}return i._$AI(e),i})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null==(e=this._$Do)||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null==(e=this._$Do)||e.setConnected(!1)}render(){return Z}}se._$litElement$=!0,se.finalized=!0,null==(t=oe.litElementHydrateSupport)||t.call(oe,{LitElement:se});const ae=oe.litElementPolyfillSupport;null==ae||ae({LitElement:se}),(oe.litElementVersions??(oe.litElementVersions=[])).push("4.2.1");const le={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:w},de=(e=le,t,r)=>{const{kind:n,metadata:i}=r;let o=globalThis.litPropertyMetadata.get(i);if(void 0===o&&globalThis.litPropertyMetadata.set(i,o=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),o.set(r.name,e),"accessor"===n){const{name:n}=r;return{set(r){const i=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,i,e)},init(t){return void 0!==t&&this.C(n,void 0,e,t),t}}}if("setter"===n){const{name:n}=r;return function(r){const i=this[n];t.call(this,r),this.requestUpdate(n,i,e)}}throw Error("Unsupported decorator location: "+n)};function ce(e){return(t,r)=>"object"==typeof r?de(e,t,r):((e,t,r)=>{const n=t.hasOwnProperty(r);return t.constructor.createProperty(r,e),n?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}function he(e){return ce({...e,state:!0,attribute:!1})}const ue="card",pe="paynow",me="idle",fe="initializing",ge="ready",ye="processing",ve="requires_action",be="succeeded",we="failed";class xe{constructor(e,t,r,n,i={},o){this.isPolling=!1,this.attempts=0,this.startTime=0,this.pollTimeoutId=null,this.adapters=e,this.baseUrl=t,this.token=r,this.onStatusUpdate=n,this.onPollStart=o,this.config={interval:i.interval??3e3,maxAttempts:i.maxAttempts??60,timeout:i.timeout??18e4,ignore3DS:i.ignore3DS??!1,ignoreQR:i.ignoreQR??!1}}start(){this.isPolling||(this.isPolling=!0,this.attempts=0,this.startTime=this.adapters.timer.now(),this.scheduleNextPoll())}stop(){this.isPolling=!1,null!==this.pollTimeoutId&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null)}get active(){return this.isPolling}get attemptCount(){return this.attempts}scheduleNextPoll(){if(!this.isPolling)return;if(this.attempts>=this.config.maxAttempts)return this.stop(),void this.onStatusUpdate({status:"failed",paymentIntentId:"",error:{code:"POLLING_MAX_ATTEMPTS",message:`Maximum polling attempts (${this.config.maxAttempts}) exceeded`}});if(this.adapters.timer.now()-this.startTime>=this.config.timeout)return this.stop(),void this.onStatusUpdate({status:"failed",paymentIntentId:"",error:{code:"POLLING_TIMEOUT",message:`Polling timeout (${this.config.timeout}ms) exceeded`}});this.pollTimeoutId=setTimeout(()=>{this.poll()},this.config.interval)}async poll(){if(this.isPolling){this.attempts++,this.onPollStart&&this.onPollStart();try{const t=await this.adapters.http.get(`${this.baseUrl}/payment-intent/get-payment-data`,{"x-token":this.token}),r={status:(e=t.result.status,"paid"===e?"succeeded":e),paymentIntentId:t.result.paymentIntentId||"",...void 0!==t.result.amount&&{amount:t.result.amount},...void 0!==t.result.currency&&{currency:t.result.currency},...void 0!==t.result.metadata&&{metadata:t.result.metadata},...void 0!==t.result.nextActionUrl&&{nextActionUrl:t.result.nextActionUrl},...void 0!==t.result.qrCode&&{qrCode:t.result.qrCode}};if(t.result.nextActionUrl&&!this.config.ignore3DS)return this.stop(),void this.onStatusUpdate(r);if(t.result.qrCode&&!this.config.ignoreQR)return this.stop(),void this.onStatusUpdate(r);if("succeeded"===t.result.status||"failed"===t.result.status||"paid"===t.result.status)return this.stop(),void this.onStatusUpdate(r);this.scheduleNextPoll()}catch(t){const e={status:"processing",paymentIntentId:"",error:{code:"POLLING_ERROR",message:t instanceof Error?t.message:"Unknown polling error"}};this.onStatusUpdate(e),this.scheduleNextPoll()}var e}}}class ke{constructor(e,t){this.state={status:me},this.subscribers=new Set,this.eventListeners={},this.paymentToken=null,this.paymentIntentId=null,this.pollingService=null,this.ignore3DSInPolling=!1,this.ignoreQRInPolling=!1,this.config=e,this.adapters=t}getApiBaseUrl(){return this.config.apiBaseUrl??function(e){switch(e){case"prod":return"https://public.prod.one.ooo";case"demo":return"https://public.demo.one.ooo";default:return"https://public.dev.one.ooo"}}(this.config.environment)}getState(){return this.state}subscribe(e){return this.subscribers.add(e),e(this.state),()=>{this.subscribers.delete(e)}}on(e,t){this.eventListeners[e]||(this.eventListeners[e]=[]);const r=this.eventListeners[e];return r.push(t),()=>{const e=r.indexOf(t);e>-1&&r.splice(e,1)}}async initialize(e){this.setState({status:fe}),this.emit({type:"initialize",payload:e});try{const t={amount:e.amount,currency:e.currency,notes:e.notes,orderId:e.orderId},r=JSON.stringify(t),n=await this.adapters.crypto.hmacSHA256(this.config.secretKey,r),i=await this.adapters.http.post(`${this.getApiBaseUrl()}/payment-intent/create`,t,{"x-api-key":this.config.apiKey,"x-signature":n}),o=new URL(i.result.redirectUrl).searchParams.get("token");if(!o)throw new Error("No token found in redirectUrl");this.paymentToken=o,this.paymentIntentId=i.result.paymentIntentId;const s=await this.adapters.http.get(`${this.getApiBaseUrl()}/payment-intent/get-payment-data`,{"x-token":this.paymentToken}),a=await this.adapters.http.get(`${this.getApiBaseUrl()}/payment-intent/available-methods`,{"x-token":this.paymentToken}),l={id:this.paymentIntentId,amount:s.result.customerAmount||e.amount,currency:s.result.currency||e.currency,status:ge,...e.metadata&&{metadata:e.metadata}},d=a.result.paymentMethods.map((e,t)=>{let r=null;const n=e.type.toLowerCase(),i=e.capabilities||[];return n.includes("card")?r="card":(n.includes("paynow")||n.includes("bank transfer")||i.includes("payments_pay_now"))&&(r="paynow"),null===r?null:{id:r,enabled:!0,priority:t}}).filter(e=>null!==e);return this.setState({status:ge,paymentIntent:l,availableMethods:d}),this.emit({type:"initialized",payload:{paymentIntent:l,paymentData:s.result}}),l}catch(t){const e={code:"INITIALIZATION_FAILED",message:t instanceof Error?t.message:"Unknown error",timestamp:this.adapters.timer.now()};throw this.setState({status:we,error:e}),this.emit({type:"payment_failed",payload:{error:e}}),t}}async submitPayment(e,t){var r,n,i,o,s;const a=this.state;if("ready"!==a.status)throw new Error("Cannot submit payment: SDK not in ready state");if(!this.paymentToken)throw new Error("Cannot submit payment: No payment token available");this.ignore3DSInPolling=!1,this.ignoreQRInPolling=!1,this.setState({status:ye,paymentIntent:a.paymentIntent,selectedMethod:e,availableMethods:a.availableMethods}),this.emit({type:"payment_processing",payload:{paymentIntent:a.paymentIntent,methodId:e}});try{const r={firstName:String(t.firstName),lastName:String(t.lastName),email:String(t.email),paymentMethod:"card"===e?{type:"card",card:{number:String(t.cardNumber),expiryMonth:String(t.expiryMonth),expiryYear:String(t.expiryYear),cvc:String(t.cvv)}}:{type:"qr"}};return await this.adapters.http.patch(`${this.getApiBaseUrl()}/payment-intent/confirm`,r,{"x-token":this.paymentToken}),this.startPolling(),{id:this.paymentIntentId||"",amount:a.paymentIntent.amount,currency:a.paymentIntent.currency,status:ye}}catch(l){let e="Unknown error",t="PAYMENT_FAILED";if(l instanceof Error)try{if(function(e){return e instanceof Error&&("response"in e&&"object"==typeof e.response&&null!==e.response||"data"in e&&"object"==typeof e.data&&null!==e.data)}(l)){const a=null==(r=l.response)?void 0:r.data,d=l.data;a?(e=a.message||(null==(n=a.error)?void 0:n.message)||l.message,t=a.code||(null==(i=a.error)?void 0:i.code)||t):d?(e=d.message||(null==(o=d.error)?void 0:o.message)||l.message,t=d.code||(null==(s=d.error)?void 0:s.code)||t):e=l.message}else e=l.message}catch{e=l.message}const d={code:t,message:e,timestamp:this.adapters.timer.now()};throw this.setState({status:we,error:d,paymentIntent:a.paymentIntent}),this.emit({type:"payment_failed",payload:{error:d,paymentIntent:a.paymentIntent}}),l}}resumePolling(){this.paymentToken&&(this.ignore3DSInPolling=!0,this.ignoreQRInPolling=!0,this.startPolling())}destroy(){this.stopPolling(),this.subscribers.clear(),Object.keys(this.eventListeners).forEach(e=>{delete this.eventListeners[e]})}startPolling(){this.paymentToken&&(this.stopPolling(),this.pollingService=new xe(this.adapters,this.getApiBaseUrl(),this.paymentToken,this.handlePollingUpdate.bind(this),{interval:4e3,maxAttempts:100,timeout:4e5,ignore3DS:this.ignore3DSInPolling,ignoreQR:this.ignoreQRInPolling},this.handlePollStart.bind(this)),this.pollingService.start())}stopPolling(){this.pollingService&&(this.pollingService.stop(),this.pollingService=null)}handlePollStart(){this.emit({type:"poll_started",payload:{}})}handlePollingUpdate(e){if(e.error)return void console.error("Polling error:",e.error);const t=this.state;if("processing"!==t.status&&"requires_action"!==t.status)return void this.stopPolling();if(e.qrCode&&!this.ignoreQRInPolling)return void this.emit({type:"qr_code_received",payload:{qrCode:e.qrCode,methodId:t.selectedMethod}});if(e.nextActionUrl&&!this.ignore3DSInPolling){if("paynow"===t.selectedMethod&&!this.ignoreQRInPolling)return void this.emit({type:"qr_code_received",payload:{qrCode:e.nextActionUrl,methodId:t.selectedMethod}});const r={id:e.paymentIntentId,amount:e.amount??t.paymentIntent.amount,currency:e.currency??t.paymentIntent.currency,status:ve,...e.metadata&&{metadata:e.metadata}};return this.setState({status:ve,paymentIntent:r,actionUrl:e.nextActionUrl,selectedMethod:t.selectedMethod,availableMethods:t.availableMethods}),void this.emit({type:"payment_requires_action",payload:{paymentIntent:r,actionUrl:e.nextActionUrl,methodId:t.selectedMethod}})}const r={id:e.paymentIntentId,amount:e.amount??t.paymentIntent.amount,currency:e.currency??t.paymentIntent.currency,status:e.status,...e.metadata&&{metadata:e.metadata}};if("succeeded"===e.status)this.stopPolling(),this.setState({status:be,paymentIntent:r,selectedMethod:t.selectedMethod}),this.emit({type:"payment_succeeded",payload:{paymentIntent:r,methodId:t.selectedMethod}});else if("failed"===e.status){this.stopPolling();const t={code:"PAYMENT_FAILED",message:e.error&&"object"==typeof e.error&&null!==e.error&&"message"in e.error?String(e.error.message):"Payment failed",timestamp:this.adapters.timer.now()};this.setState({status:we,error:t,paymentIntent:r}),this.emit({type:"payment_failed",payload:{error:t,paymentIntent:r}})}}setState(e){const t=this.state.status;this.state=e,this.subscribers.forEach(e=>{e(this.state)}),t!==e.status&&this.emit({type:"state_changed",payload:{previousStatus:t,currentStatus:e.status}})}emit(e){const t=this.eventListeners[e.type];void 0!==t&&t.forEach(t=>{t(e)})}}var Se="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ee=function(e,t,r,n,i,o,s,a,l,d){var c=this;c.numeralDecimalMark=e||".",c.numeralIntegerScale=t>0?t:0,c.numeralDecimalScale=r>=0?r:2,c.numeralThousandsGroupStyle=n||Ee.groupStyle.thousand,c.numeralPositiveOnly=!!i,c.stripLeadingZeroes=!1!==o,c.prefix=s||""===s?s:"",c.signBeforePrefix=!!a,c.tailPrefix=!!l,c.delimiter=d||""===d?d:",",c.delimiterRE=d?new RegExp("\\"+d,"g"):""};Ee.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},Ee.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var t,r,n,i,o=this,s="";switch(e=e.replace(/[A-Za-z]/g,"").replace(o.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",o.numeralPositiveOnly?"":"-").replace("M",o.numeralDecimalMark),o.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,"$1")),r="-"===e.slice(0,1)?"-":"",n=void 0!==o.prefix?o.signBeforePrefix?r+o.prefix:o.prefix+r:r,i=e,e.indexOf(o.numeralDecimalMark)>=0&&(i=(t=e.split(o.numeralDecimalMark))[0],s=o.numeralDecimalMark+t[1].slice(0,o.numeralDecimalScale)),"-"===r&&(i=i.slice(1)),o.numeralIntegerScale>0&&(i=i.slice(0,o.numeralIntegerScale)),o.numeralThousandsGroupStyle){case Ee.groupStyle.lakh:i=i.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+o.delimiter);break;case Ee.groupStyle.wan:i=i.replace(/(\d)(?=(\d{4})+$)/g,"$1"+o.delimiter);break;case Ee.groupStyle.thousand:i=i.replace(/(\d)(?=(\d{3})+$)/g,"$1"+o.delimiter)}return o.tailPrefix?r+i.toString()+(o.numeralDecimalScale>0?s.toString():"")+o.prefix:n+i.toString()+(o.numeralDecimalScale>0?s.toString():"")}};var Pe=Ee,Ce=function(e,t,r){var n=this;n.date=[],n.blocks=[],n.datePattern=e,n.dateMin=t.split("-").reverse().map(function(e){return parseInt(e,10)}),2===n.dateMin.length&&n.dateMin.unshift(0),n.dateMax=r.split("-").reverse().map(function(e){return parseInt(e,10)}),2===n.dateMax.length&&n.dateMax.unshift(0),n.initBlocks()};Ce.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){"Y"===t?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(n,i){if(e.length>0){var o=e.slice(0,n),s=o.slice(0,1),a=e.slice(n);switch(t.datePattern[i]){case"d":"00"===o?o="01":parseInt(s,10)>3?o="0"+s:parseInt(o,10)>31&&(o="31");break;case"m":"00"===o?o="01":parseInt(s,10)>1?o="0"+s:parseInt(o,10)>12&&(o="12")}r+=o,e=a}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,n,i=this,o=i.datePattern,s=[],a=0,l=0,d=0,c=0,h=0,u=0,p=!1;return 4===e.length&&"y"!==o[0].toLowerCase()&&"y"!==o[1].toLowerCase()&&(h=2-(c="d"===o[0]?0:2),t=parseInt(e.slice(c,c+2),10),r=parseInt(e.slice(h,h+2),10),s=this.getFixedDate(t,r,0)),8===e.length&&(o.forEach(function(e,t){switch(e){case"d":a=t;break;case"m":l=t;break;default:d=t}}),u=2*d,c=a<=d?2*a:2*a+2,h=l<=d?2*l:2*l+2,t=parseInt(e.slice(c,c+2),10),r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+4),10),p=4===e.slice(u,u+4).length,s=this.getFixedDate(t,r,n)),4!==e.length||"y"!==o[0]&&"y"!==o[1]||(u=2-(h="m"===o[0]?0:2),r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+2),10),p=2===e.slice(u,u+2).length,s=[0,r,n]),6!==e.length||"Y"!==o[0]&&"Y"!==o[1]||(u=2-.5*(h="m"===o[0]?0:4),r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+4),10),p=4===e.slice(u,u+4).length,s=[0,r,n]),s=i.getRangeFixedDate(s),i.date=s,0===s.length?e:o.reduce(function(e,t){switch(t){case"d":return e+(0===s[0]?"":i.addLeadingZero(s[0]));case"m":return e+(0===s[1]?"":i.addLeadingZero(s[1]));case"y":return e+(p?i.addLeadingZeroForYear(s[2],!1):"");case"Y":return e+(p?i.addLeadingZeroForYear(s[2],!0):"")}},"")},getRangeFixedDate:function(e){var t=this,r=t.datePattern,n=t.dateMin||[],i=t.dateMax||[];return!e.length||n.length<3&&i.length<3||r.find(function(e){return"y"===e.toLowerCase()})&&0===e[2]?e:i.length&&(i[2]<e[2]||i[2]===e[2]&&(i[1]<e[1]||i[1]===e[1]&&i[0]<e[0]))?i:n.length&&(n[2]>e[2]||n[2]===e[2]&&(n[1]>e[1]||n[1]===e[1]&&n[0]>e[0]))?n:e},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),(t<7&&t%2==0||t>8&&t%2==1)&&(e=Math.min(e,2===t?this.isLeapYear(r)?29:28:30)),[e,t,r]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e,t){return t?(e<10?"000":e<100?"00":e<1e3?"0":"")+e:(e<10?"0":"")+e}};var Ae=Ce,Ie=function(e,t){var r=this;r.time=[],r.blocks=[],r.timePattern=e,r.timeFormat=t,r.initBlocks()};Ie.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return"12"===String(this.timeFormat)?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,r="";e=e.replace(/[^\d]/g,"");var n=t.getTimeFormatOptions();return t.blocks.forEach(function(i,o){if(e.length>0){var s=e.slice(0,i),a=s.slice(0,1),l=e.slice(i);switch(t.timePattern[o]){case"h":parseInt(a,10)>n.maxHourFirstDigit?s="0"+a:parseInt(s,10)>n.maxHours&&(s=n.maxHours+"");break;case"m":case"s":parseInt(a,10)>n.maxMinutesFirstDigit?s="0"+a:parseInt(s,10)>n.maxMinutes&&(s=n.maxMinutes+"")}r+=s,e=l}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var t,r,n,i=this,o=i.timePattern,s=[],a=0,l=0,d=0,c=0,h=0,u=0;return 6===e.length&&(o.forEach(function(e,t){switch(e){case"s":a=2*t;break;case"m":l=2*t;break;case"h":d=2*t}}),u=d,h=l,c=a,t=parseInt(e.slice(c,c+2),10),r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+2),10),s=this.getFixedTime(n,r,t)),4===e.length&&i.timePattern.indexOf("s")<0&&(o.forEach(function(e,t){switch(e){case"m":l=2*t;break;case"h":d=2*t}}),u=d,h=l,t=0,r=parseInt(e.slice(h,h+2),10),n=parseInt(e.slice(u,u+2),10),s=this.getFixedTime(n,r,t)),i.time=s,0===s.length?e:o.reduce(function(e,t){switch(t){case"s":return e+i.addLeadingZero(s[2]);case"m":return e+i.addLeadingZero(s[1]);case"h":return e+i.addLeadingZero(s[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}};var Me=Ie,Te=function(e,t){var r=this;r.delimiter=t||""===t?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e};Te.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var r,n="",i=!1,o=0,s=(e=(e=(e=e.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(t.delimiterRE,"")).length;o<s;o++)r=t.formatter.inputDigit(e.charAt(o)),/[\s()-]/g.test(r)?(n=r,i=!0):i||(n=r);return n=(n=n.replace(/[()]/g,"")).replace(/[\s-]/g,t.delimiter)}};var Fe=Te,Le={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(e,t){return e+t},0);return e.concat(19-t)},getInfo:function(e,t){var r=Le.blocks,n=Le.re;for(var i in t=!!t,n)if(n[i].test(e)){var o=r[i];return{type:i,blocks:t?this.getStrictBlocks(o):o}}return{type:"unknown",blocks:t?this.getStrictBlocks(r.general):r.general}}},De=Le,Ne={noop:function(){},strip:function(e,t){return e.replace(t,"")},getPostDelimiter:function(e,t,r){if(0===r.length)return e.slice(-t.length)===t?t:"";var n="";return r.forEach(function(t){e.slice(-t.length)===t&&(n=t)}),n},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,n,i){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,n,i)},getPositionOffset:function(e,t,r,n,i){var o,s,a;return o=this.stripDelimiters(t.slice(0,e),n,i),s=this.stripDelimiters(r.slice(0,e),n,i),0!==(a=o.length-s.length)?a/Math.abs(a):0},stripDelimiters:function(e,t,r){var n=this;if(0===r.length){var i=t?n.getDelimiterREByDelimiter(t):"";return e.replace(i,"")}return r.forEach(function(t){t.split("").forEach(function(t){e=e.replace(n.getDelimiterREByDelimiter(t),"")})}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(e,t,r,n,i,o,s,a,l){if(0===r)return e;if(e===t&&""!==e)return"";if(l&&"-"==e.slice(0,1)){var d="-"==n.slice(0,1)?n.slice(1):n;return"-"+this.getPrefixStrippedValue(e.slice(1),t,r,d,i,o,s,a,l)}if(n.slice(0,r)!==t&&!a)return s&&!n&&e?e:"";if(n.slice(-r)!==t&&a)return s&&!n&&e?e:"";var c=this.stripDelimiters(n,i,o);return e.slice(0,r)===t||a?e.slice(-r)!==t&&a?c.slice(0,-r-1):a?e.slice(0,-r):e.slice(r):c.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(""===e.charAt(r++))return-1;return r},getFormattedValue:function(e,t,r,n,i,o){var s="",a=i.length>0,l="";return 0===r?e:(t.forEach(function(t,d){if(e.length>0){var c=e.slice(0,t),h=e.slice(t);l=a?i[o?d-1:d]||l:n,o?(d>0&&(s+=l),s+=c):(s+=c,c.length===t&&d<r-1&&(s+=l)),e=h}}),s)},fixPrefixCursor:function(e,t,r,n){if(e){var i=e.value,o=r||n[0]||" ";if(e.setSelectionRange&&t&&!(t.length+o.length<=i.length)){var s=2*i.length;setTimeout(function(){e.setSelectionRange(s,s)},1)}}},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch(t){}return!1},setSelection:function(e,t,r){if(e===this.getActiveElement(r)&&!(e&&e.value.length<=t))if(e.createTextRange){var n=e.createTextRange();n.move("character",t),n.select()}else try{e.setSelectionRange(t,t)}catch(i){console.warn("The input element type does not support selection")}},getActiveElement:function(e){var t=e.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}},Re={assign:function(e,t){return t=t||{},(e=e||{}).creditCard=!!t.creditCard,e.creditCardStrictMode=!!t.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=t.onCreditCardTypeChanged||function(){},e.phone=!!t.phone,e.phoneRegionCode=t.phoneRegionCode||"AU",e.phoneFormatter={},e.time=!!t.time,e.timePattern=t.timePattern||["h","m","s"],e.timeFormat=t.timeFormat||"24",e.timeFormatter={},e.date=!!t.date,e.datePattern=t.datePattern||["d","m","Y"],e.dateMin=t.dateMin||"",e.dateMax=t.dateMax||"",e.dateFormatter={},e.numeral=!!t.numeral,e.numeralIntegerScale=t.numeralIntegerScale>0?t.numeralIntegerScale:0,e.numeralDecimalScale=t.numeralDecimalScale>=0?t.numeralDecimalScale:2,e.numeralDecimalMark=t.numeralDecimalMark||".",e.numeralThousandsGroupStyle=t.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!t.numeralPositiveOnly,e.stripLeadingZeroes=!1!==t.stripLeadingZeroes,e.signBeforePrefix=!!t.signBeforePrefix,e.tailPrefix=!!t.tailPrefix,e.swapHiddenInput=!!t.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!t.numericOnly,e.uppercase=!!t.uppercase,e.lowercase=!!t.lowercase,e.prefix=e.creditCard||e.date?"":t.prefix||"",e.noImmediatePrefix=!!t.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!t.rawValueTrimPrefix,e.copyDelimiter=!!t.copyDelimiter,e.initValue=void 0!==t.initValue&&null!==t.initValue?t.initValue.toString():"",e.delimiter=t.delimiter||""===t.delimiter?t.delimiter:t.date?"/":t.time?":":t.numeral?",":(t.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!t.delimiterLazyShow,e.delimiters=t.delimiters||[],e.blocks=t.blocks||[],e.blocksLength=e.blocks.length,e.root="object"==typeof Se&&Se?Se:window,e.document=t.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=t.onValueChanged||function(){},e}},Be=function(e,t){var r=this,n=!1;if("string"==typeof e?(r.element=document.querySelector(e),n=document.querySelectorAll(e).length>1):void 0!==e.length&&e.length>0?(r.element=e[0],n=e.length>1):r.element=e,!r.element)throw new Error("[cleave.js] Please check the element");if(n)try{console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.")}catch(i){}t.initValue=r.element.value,r.properties=Be.DefaultProperties.assign({},t),r.init()};Be.prototype={init:function(){var e=this,t=e.properties;t.numeral||t.phone||t.creditCard||t.time||t.date||0!==t.blocksLength||t.prefix?(t.maxLength=Be.Util.getMaxLength(t.blocks),e.isAndroid=Be.Util.isAndroid(),e.lastInputValue="",e.isBackward="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),(t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue)):e.onInput(t.initValue)},initSwapHiddenInput:function(){var e=this;if(e.properties.swapHiddenInput){var t=e.element.cloneNode(!0);e.element.parentNode.insertBefore(t,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type="hidden",e.element=t,e.element.id=""}},initNumeralFormatter:function(){var e=this.properties;e.numeral&&(e.numeralFormatter=new Be.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var e=this.properties;e.time&&(e.timeFormatter=new Be.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=Be.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var e=this.properties;e.date&&(e.dateFormatter=new Be.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=Be.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var e=this.properties;if(e.phone)try{e.phoneFormatter=new Be.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch(t){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,r=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=8===r},onChange:function(e){var t=this,r=t.properties,n=Be.Util;t.isBackward=t.isBackward||"deleteContentBackward"===e.inputType;var i=n.getPostDelimiter(t.lastInputValue,r.delimiter,r.delimiters);t.isBackward&&i?r.postDelimiterBackspace=i:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),Be.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){Be.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(""))},onCopy:function(e){Be.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var t=this.properties,r=Be.Util,n=this.element.value,i="";i=t.copyDelimiter?n:r.stripDelimiters(n,t.delimiter,t.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",i):window.clipboardData.setData("Text",i),e.preventDefault()}catch(o){}},onInput:function(e){var t=this,r=t.properties,n=Be.Util,i=n.getPostDelimiter(e,r.delimiter,r.delimiters);return r.numeral||!r.postDelimiterBackspace||i||(e=n.headStr(e,e.length-r.postDelimiterBackspace.length)),r.phone?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length),void t.updateValueState()):r.numeral?(r.prefix&&r.noImmediatePrefix&&0===e.length?r.result="":r.result=r.numeralFormatter.format(e),void t.updateValueState()):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=n.stripDelimiters(e,r.delimiter,r.delimiters),e=n.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),e=r.numericOnly?n.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,r.prefix&&(r.tailPrefix?e+=r.prefix:e=r.prefix+e,0===r.blocksLength)?(r.result=e,void t.updateValueState()):(r.creditCard&&t.updateCreditCardPropsByValue(e),e=n.headStr(e,r.maxLength),r.result=n.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,r=this.properties,n=Be.Util;n.headStr(r.result,4)!==n.headStr(e,4)&&(t=Be.CreditCardDetector.getInfo(e,r.creditCardStrictMode),r.blocks=t.blocks,r.blocksLength=r.blocks.length,r.maxLength=n.getMaxLength(r.blocks),r.creditCardType!==t.type&&(r.creditCardType=t.type,r.onCreditCardTypeChanged.call(this,r.creditCardType)))},updateValueState:function(){var e=this,t=Be.Util,r=e.properties;if(e.element){var n=e.element.selectionEnd,i=e.element.value,o=r.result;n=t.getNextCursorPosition(n,i,o,r.delimiter,r.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=o,t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged()},1):(e.element.value=o,r.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged())}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=null!=e?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this.properties,t=Be.Util,r=this.element.value;return e.rawValueTrimPrefix&&(r=t.getPrefixStrippedValue(r,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),r=e.numeral?e.numeralFormatter.getRawValue(r):t.stripDelimiters(r,e.delimiter,e.delimiters)},getISOFormatDate:function(){var e=this.properties;return e.date?e.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var e=this.properties;return e.time?e.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},Be.NumeralFormatter=Pe,Be.DateFormatter=Ae,Be.TimeFormatter=Me,Be.PhoneFormatter=Fe,Be.CreditCardDetector=De,Be.Util=Ne,Be.DefaultProperties=Re,("object"==typeof Se&&Se?Se:window).Cleave=Be;var Ue=Be,qe={},ze={},je={};let Oe;const He=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];je.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},je.getSymbolTotalCodewords=function(e){return He[e]},je.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},je.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Oe=e},je.isKanjiModeEnabled=function(){return void 0!==Oe},je.toSJIS=function(e){return Oe(e)};var Ze,Ve={};function Ye(){this.buffer=[],this.length=0}(Ze=Ve).L={bit:1},Ze.M={bit:0},Ze.Q={bit:3},Ze.H={bit:2},Ze.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},Ze.from=function(e,t){if(Ze.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return Ze.L;case"m":case"medium":return Ze.M;case"q":case"quartile":return Ze.Q;case"h":case"high":return Ze.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(r){return t}},Ye.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var We=Ye;function Ke(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Ke.prototype.set=function(e,t,r,n){const i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},Ke.prototype.get=function(e,t){return this.data[e*this.size+t]},Ke.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},Ke.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Qe=Ke,$e={};!function(e){const t=je.getSymbolSize;e.getRowColCoords=function(e){if(1===e)return[];const r=Math.floor(e/7)+2,n=t(e),i=145===n?26:2*Math.ceil((n-13)/(2*r-2)),o=[n-7];for(let t=1;t<r-1;t++)o[t]=o[t-1]-i;return o.push(6),o.reverse()},e.getPositions=function(t){const r=[],n=e.getRowColCoords(t),i=n.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)0===e&&0===t||0===e&&t===i-1||e===i-1&&0===t||r.push([n[e],n[t]]);return r}}($e);var Xe={};const Je=je.getSymbolSize;Xe.getPositions=function(e){const t=Je(e);return[[0,0],[t-7,0],[0,t-7]]};var Ge={};!function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,r=3,n=40,i=10;function o(t,r,n){switch(t){case e.Patterns.PATTERN000:return(r+n)%2==0;case e.Patterns.PATTERN001:return r%2==0;case e.Patterns.PATTERN010:return n%3==0;case e.Patterns.PATTERN011:return(r+n)%3==0;case e.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case e.Patterns.PATTERN101:return r*n%2+r*n%3==0;case e.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case e.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){const r=e.size;let n=0,i=0,o=0,s=null,a=null;for(let l=0;l<r;l++){i=o=0,s=a=null;for(let d=0;d<r;d++){let r=e.get(l,d);r===s?i++:(i>=5&&(n+=t+(i-5)),s=r,i=1),r=e.get(d,l),r===a?o++:(o>=5&&(n+=t+(o-5)),a=r,o=1)}i>=5&&(n+=t+(i-5)),o>=5&&(n+=t+(o-5))}return n},e.getPenaltyN2=function(e){const t=e.size;let n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){const t=e.get(r,i)+e.get(r,i+1)+e.get(r+1,i)+e.get(r+1,i+1);4!==t&&0!==t||n++}return n*r},e.getPenaltyN3=function(e){const t=e.size;let r=0,i=0,o=0;for(let n=0;n<t;n++){i=o=0;for(let s=0;s<t;s++)i=i<<1&2047|e.get(n,s),s>=10&&(1488===i||93===i)&&r++,o=o<<1&2047|e.get(s,n),s>=10&&(1488===o||93===o)&&r++}return r*n},e.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let n=0;n<r;n++)t+=e.data[n];return Math.abs(Math.ceil(100*t/r/5)-10)*i},e.applyMask=function(e,t){const r=t.size;for(let n=0;n<r;n++)for(let i=0;i<r;i++)t.isReserved(i,n)||t.xor(i,n,o(e,i,n))},e.getBestMask=function(t,r){const n=Object.keys(e.Patterns).length;let i=0,o=1/0;for(let s=0;s<n;s++){r(s),e.applyMask(s,t);const n=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),n<o&&(o=n,i=s)}return i}}(Ge);var _e={};const et=Ve,tt=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],rt=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];_e.getBlocksCount=function(e,t){switch(t){case et.L:return tt[4*(e-1)+0];case et.M:return tt[4*(e-1)+1];case et.Q:return tt[4*(e-1)+2];case et.H:return tt[4*(e-1)+3];default:return}},_e.getTotalCodewordsCount=function(e,t){switch(t){case et.L:return rt[4*(e-1)+0];case et.M:return rt[4*(e-1)+1];case et.Q:return rt[4*(e-1)+2];case et.H:return rt[4*(e-1)+3];default:return}};var nt={},it={};const ot=new Uint8Array(512),st=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)ot[t]=e,st[e]=t,e<<=1,256&e&&(e^=285);for(let t=255;t<512;t++)ot[t]=ot[t-255]}(),it.log=function(e){if(e<1)throw new Error("log("+e+")");return st[e]},it.exp=function(e){return ot[e]},it.mul=function(e,t){return 0===e||0===t?0:ot[st[e]+st[t]]},function(e){const t=it;e.mul=function(e,r){const n=new Uint8Array(e.length+r.length-1);for(let i=0;i<e.length;i++)for(let o=0;o<r.length;o++)n[i+o]^=t.mul(e[i],r[o]);return n},e.mod=function(e,r){let n=new Uint8Array(e);for(;n.length-r.length>=0;){const e=n[0];for(let o=0;o<r.length;o++)n[o]^=t.mul(r[o],e);let i=0;for(;i<n.length&&0===n[i];)i++;n=n.slice(i)}return n},e.generateECPolynomial=function(r){let n=new Uint8Array([1]);for(let i=0;i<r;i++)n=e.mul(n,new Uint8Array([1,t.exp(i)]));return n}}(nt);const at=nt;function lt(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}lt.prototype.initialize=function(e){this.degree=e,this.genPoly=at.generateECPolynomial(this.degree)},lt.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=at.mod(t,this.genPoly),n=this.degree-r.length;if(n>0){const e=new Uint8Array(this.degree);return e.set(r,n),e}return r};var dt=lt,ct={},ht={},ut={isValid:function(e){return!isNaN(e)&&e>=1&&e<=40}},pt={};const mt="[0-9]+";let ft="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ft=ft.replace(/u/g,"\\u");const gt="(?:(?![A-Z0-9 $%*+\\-./:]|"+ft+")(?:.|[\r\n]))+";pt.KANJI=new RegExp(ft,"g"),pt.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),pt.BYTE=new RegExp(gt,"g"),pt.NUMERIC=new RegExp(mt,"g"),pt.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const yt=new RegExp("^"+ft+"$"),vt=new RegExp("^"+mt+"$"),bt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");pt.testKanji=function(e){return yt.test(e)},pt.testNumeric=function(e){return vt.test(e)},pt.testAlphanumeric=function(e){return bt.test(e)},function(e){const t=ut,r=pt;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,r){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!t.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?e.ccBits[0]:r<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return r.testNumeric(t)?e.NUMERIC:r.testAlphanumeric(t)?e.ALPHANUMERIC:r.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},e.isValid=function(e){return e&&e.bit&&e.ccBits},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(n){return r}}}(ht),function(e){const t=je,r=_e,n=Ve,i=ht,o=ut,s=t.getBCHDigit(7973);function a(e,t){return i.getCharCountIndicator(e,t)+4}function l(e,t){let r=0;return e.forEach(function(e){const n=a(e.mode,t);r+=n+e.getBitsLength()}),r}e.from=function(e,t){return o.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,n,s){if(!o.isValid(e))throw new Error("Invalid QR Code version");void 0===s&&(s=i.BYTE);const l=8*(t.getSymbolTotalCodewords(e)-r.getTotalCodewordsCount(e,n));if(s===i.MIXED)return l;const d=l-a(s,e);switch(s){case i.NUMERIC:return Math.floor(d/10*3);case i.ALPHANUMERIC:return Math.floor(d/11*2);case i.KANJI:return Math.floor(d/13);case i.BYTE:default:return Math.floor(d/8)}},e.getBestVersionForData=function(t,r){let o;const s=n.from(r,n.M);if(Array.isArray(t)){if(t.length>1)return function(t,r){for(let n=1;n<=40;n++)if(l(t,n)<=e.getCapacity(n,r,i.MIXED))return n}(t,s);if(0===t.length)return 1;o=t[0]}else o=t;return function(t,r,n){for(let i=1;i<=40;i++)if(r<=e.getCapacity(i,n,t))return i}(o.mode,o.getLength(),s)},e.getEncodedBits=function(e){if(!o.isValid(e)||e<7)throw new Error("Invalid QR Code version");let r=e<<12;for(;t.getBCHDigit(r)-s>=0;)r^=7973<<t.getBCHDigit(r)-s;return e<<12|r}}(ct);var wt={};const xt=je,kt=xt.getBCHDigit(1335);wt.getEncodedBits=function(e,t){const r=e.bit<<3|t;let n=r<<10;for(;xt.getBCHDigit(n)-kt>=0;)n^=1335<<xt.getBCHDigit(n)-kt;return 21522^(r<<10|n)};var St={};const Et=ht;function Pt(e){this.mode=Et.NUMERIC,this.data=e.toString()}Pt.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Pt.prototype.getLength=function(){return this.data.length},Pt.prototype.getBitsLength=function(){return Pt.getBitsLength(this.data.length)},Pt.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))};var Ct=Pt;const At=ht,It=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Mt(e){this.mode=At.ALPHANUMERIC,this.data=e}Mt.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},Mt.prototype.getLength=function(){return this.data.length},Mt.prototype.getBitsLength=function(){return Mt.getBitsLength(this.data.length)},Mt.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*It.indexOf(this.data[t]);r+=It.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(It.indexOf(this.data[t]),6)};var Tt=Mt;const Ft=ht;function Lt(e){this.mode=Ft.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}Lt.getBitsLength=function(e){return 8*e},Lt.prototype.getLength=function(){return this.data.length},Lt.prototype.getBitsLength=function(){return Lt.getBitsLength(this.data.length)},Lt.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)};var Dt=Lt;const Nt=ht,Rt=je;function Bt(e){this.mode=Nt.KANJI,this.data=e}Bt.getBitsLength=function(e){return 13*e},Bt.prototype.getLength=function(){return this.data.length},Bt.prototype.getBitsLength=function(){return Bt.getBitsLength(this.data.length)},Bt.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=Rt.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}};var Ut,qt=Bt,zt={exports:{}};Ut={single_source_shortest_paths:function(e,t,r){var n={},i={};i[t]=0;var o,s,a,l,d,c,h,u=Ut.PriorityQueue.make();for(u.push(t,0);!u.empty();)for(a in s=(o=u.pop()).value,l=o.cost,d=e[s]||{})d.hasOwnProperty(a)&&(c=l+d[a],h=i[a],(void 0===i[a]||h>c)&&(i[a]=c,u.push(a,c),n[a]=s));if(void 0!==r&&void 0===i[r]){var p=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(p)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var n=Ut.single_source_shortest_paths(e,t,r);return Ut.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t,r=Ut.PriorityQueue,n={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(n[t]=r[t]);return n.queue=[],n.sorter=e.sorter||r.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}},zt.exports=Ut;var jt=zt.exports;!function(e){const t=ht,r=Ct,n=Tt,i=Dt,o=qt,s=pt,a=je,l=jt;function d(e){return unescape(encodeURIComponent(e)).length}function c(e,t,r){const n=[];let i;for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function h(e){const r=c(s.NUMERIC,t.NUMERIC,e),n=c(s.ALPHANUMERIC,t.ALPHANUMERIC,e);let i,o;a.isKanjiModeEnabled()?(i=c(s.BYTE,t.BYTE,e),o=c(s.KANJI,t.KANJI,e)):(i=c(s.BYTE_KANJI,t.BYTE,e),o=[]);return r.concat(n,i,o).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function u(e,s){switch(s){case t.NUMERIC:return r.getBitsLength(e);case t.ALPHANUMERIC:return n.getBitsLength(e);case t.KANJI:return o.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e,s){let l;const d=t.getBestModeForData(e);if(l=t.from(s,d),l!==t.BYTE&&l.bit<d.bit)throw new Error('"'+e+'" cannot be encoded with mode '+t.toString(l)+".\n Suggested mode is: "+t.toString(d));switch(l!==t.KANJI||a.isKanjiModeEnabled()||(l=t.BYTE),l){case t.NUMERIC:return new r(e);case t.ALPHANUMERIC:return new n(e);case t.KANJI:return new o(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(p(t,null)):t.data&&e.push(p(t.data,t.mode)),e},[])},e.fromString=function(r,n){const i=function(e){const r=[];for(let n=0;n<e.length;n++){const i=e[n];switch(i.mode){case t.NUMERIC:r.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:r.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:r.push([i,{data:i.data,mode:t.BYTE,length:d(i.data)}]);break;case t.BYTE:r.push([{data:i.data,mode:t.BYTE,length:d(i.data)}])}}return r}(h(r,a.isKanjiModeEnabled())),o=function(e,r){const n={},i={start:{}};let o=["start"];for(let s=0;s<e.length;s++){const a=e[s],l=[];for(let e=0;e<a.length;e++){const d=a[e],c=""+s+e;l.push(c),n[c]={node:d,lastCount:0},i[c]={};for(let e=0;e<o.length;e++){const s=o[e];n[s]&&n[s].node.mode===d.mode?(i[s][c]=u(n[s].lastCount+d.length,d.mode)-u(n[s].lastCount,d.mode),n[s].lastCount+=d.length):(n[s]&&(n[s].lastCount=d.length),i[s][c]=u(d.length,d.mode)+4+t.getCharCountIndicator(d.mode,r))}}o=l}for(let t=0;t<o.length;t++)i[o[t]].end=0;return{map:i,table:n}}(i,n),s=l.find_path(o.map,"start","end"),c=[];for(let e=1;e<s.length-1;e++)c.push(o.table[s[e]].node);return e.fromArray(function(e){return e.reduce(function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}(c))},e.rawSplit=function(t){return e.fromArray(h(t,a.isKanjiModeEnabled()))}}(St);const Ot=je,Ht=Ve,Zt=We,Vt=Qe,Yt=$e,Wt=Xe,Kt=Ge,Qt=_e,$t=dt,Xt=ct,Jt=wt,Gt=ht,_t=St;function er(e,t,r){const n=e.size,i=Jt.getEncodedBits(t,r);let o,s;for(o=0;o<15;o++)s=1==(i>>o&1),o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(n-15+o,8,s,!0),o<8?e.set(8,n-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(n-8,8,1,!0)}function tr(e,t,r){const n=new Zt;r.forEach(function(t){n.put(t.mode.bit,4),n.put(t.getLength(),Gt.getCharCountIndicator(t.mode,e)),t.write(n)});const i=8*(Ot.getSymbolTotalCodewords(e)-Qt.getTotalCodewordsCount(e,t));for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);const o=(i-n.getLengthInBits())/8;for(let s=0;s<o;s++)n.put(s%2?17:236,8);return function(e,t,r){const n=Ot.getSymbolTotalCodewords(t),i=Qt.getTotalCodewordsCount(t,r),o=n-i,s=Qt.getBlocksCount(t,r),a=n%s,l=s-a,d=Math.floor(n/s),c=Math.floor(o/s),h=c+1,u=d-c,p=new $t(u);let m=0;const f=new Array(s),g=new Array(s);let y=0;const v=new Uint8Array(e.buffer);for(let S=0;S<s;S++){const e=S<l?c:h;f[S]=v.slice(m,m+e),g[S]=p.encode(f[S]),m+=e,y=Math.max(y,e)}const b=new Uint8Array(n);let w,x,k=0;for(w=0;w<y;w++)for(x=0;x<s;x++)w<f[x].length&&(b[k++]=f[x][w]);for(w=0;w<u;w++)for(x=0;x<s;x++)b[k++]=g[x][w];return b}(n,e,t)}function rr(e,t,r,n){let i;if(Array.isArray(e))i=_t.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=_t.rawSplit(e);n=Xt.getBestVersionForData(t,r)}i=_t.fromString(e,n||40)}}const o=Xt.getBestVersionForData(i,r);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<o)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+o+".\n")}else t=o;const s=tr(t,r,i),a=Ot.getSymbolSize(t),l=new Vt(a);return function(e,t){const r=e.size,n=Wt.getPositions(t);for(let i=0;i<n.length;i++){const t=n[i][0],o=n[i][1];for(let n=-1;n<=7;n++)if(!(t+n<=-1||r<=t+n))for(let i=-1;i<=7;i++)o+i<=-1||r<=o+i||(n>=0&&n<=6&&(0===i||6===i)||i>=0&&i<=6&&(0===n||6===n)||n>=2&&n<=4&&i>=2&&i<=4?e.set(t+n,o+i,!0,!0):e.set(t+n,o+i,!1,!0))}}(l,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(l),function(e,t){const r=Yt.getPositions(t);for(let n=0;n<r.length;n++){const t=r[n][0],i=r[n][1];for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)-2===r||2===r||-2===n||2===n||0===r&&0===n?e.set(t+r,i+n,!0,!0):e.set(t+r,i+n,!1,!0)}}(l,t),er(l,r,0),t>=7&&function(e,t){const r=e.size,n=Xt.getEncodedBits(t);let i,o,s;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+r-8-3,s=1==(n>>a&1),e.set(i,o,s,!0),e.set(o,i,s,!0)}(l,t),function(e,t){const r=e.size;let n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let n=!1;s<t.length&&(n=1==(t[s]>>>o&1)),e.set(i,a-r,n),o--,-1===o&&(s++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}(l,s),isNaN(n)&&(n=Kt.getBestMask(l,er.bind(null,l,r))),Kt.applyMask(n,l),er(l,r,n),{modules:l,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}ze.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,n,i=Ht.M;return void 0!==t&&(i=Ht.from(t.errorCorrectionLevel,Ht.M),r=Xt.from(t.version),n=Kt.from(t.maskPattern),t.toSJISFunc&&Ot.setToSJISFunction(t.toSJISFunc)),rr(e,r,i,n)};var nr={},ir={};!function(e){function t(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}e.getOptions=function(e){e||(e={}),e.color||(e.color={});const r=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:r,color:{dark:t(e.color.dark||"#000000ff"),light:t(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},e.getImageWidth=function(t,r){const n=e.getScale(t,r);return Math.floor((t+2*r.margin)*n)},e.qrToImageData=function(t,r,n){const i=r.modules.size,o=r.modules.data,s=e.getScale(i,n),a=Math.floor((i+2*n.margin)*s),l=n.margin*s,d=[n.color.light,n.color.dark];for(let e=0;e<a;e++)for(let r=0;r<a;r++){let c=4*(e*a+r),h=n.color.light;if(e>=l&&r>=l&&e<a-l&&r<a-l){h=d[o[Math.floor((e-l)/s)*i+Math.floor((r-l)/s)]?1:0]}t[c++]=h.r,t[c++]=h.g,t[c++]=h.b,t[c]=h.a}}}(ir),function(e){const t=ir;e.render=function(e,r,n){let i=n,o=r;void 0!==i||r&&r.getContext||(i=r,r=void 0),r||(o=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),i=t.getOptions(i);const s=t.getImageWidth(e.modules.size,i),a=o.getContext("2d"),l=a.createImageData(s,s);return t.qrToImageData(l.data,e,i),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(a,o,s),a.putImageData(l,0,0),o},e.renderToDataURL=function(t,r,n){let i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});const o=e.render(t,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}}(nr);var or={};const sr=ir;function ar(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function lr(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}or.render=function(e,t,r){const n=sr.getOptions(t),i=e.modules.size,o=e.modules.data,s=i+2*n.margin,a=n.color.light.a?"<path "+ar(n.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",l="<path "+ar(n.color.dark,"stroke")+' d="'+function(e,t,r){let n="",i=0,o=!1,s=0;for(let a=0;a<e.length;a++){const l=Math.floor(a%t),d=Math.floor(a/t);l||o||(o=!0),e[a]?(s++,a>0&&l>0&&e[a-1]||(n+=o?lr("M",l+r,.5+d+r):lr("m",i,0),i=0,o=!1),l+1<t&&e[a+1]||(n+=lr("h",s),s=0)):i++}return n}(o,i,n.margin)+'"/>',d='viewBox="0 0 '+s+" "+s+'"',c='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+d+' shape-rendering="crispEdges">'+a+l+"</svg>\n";return"function"==typeof r&&r(null,c),c};const dr=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},cr=ze,hr=nr,ur=or;function pr(e,t,r,n,i){const o=[].slice.call(arguments,1),s=o.length,a="function"==typeof o[s-1];if(!a&&!dr())throw new Error("Callback required as last argument");if(!a){if(s<1)throw new Error("Too few arguments provided");return 1===s?(r=t,t=n=void 0):2!==s||t.getContext||(n=r,r=t,t=void 0),new Promise(function(i,o){try{const o=cr.create(r,n);i(e(o,t,n))}catch(s){o(s)}})}if(s<2)throw new Error("Too few arguments provided");2===s?(i=r,r=t,t=n=void 0):3===s&&(t.getContext&&void 0===i?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0));try{const o=cr.create(r,n);i(null,e(o,t,n))}catch(l){i(l)}}qe.create=cr.create,qe.toCanvas=pr.bind(null,hr.render),qe.toDataURL=pr.bind(null,hr.renderToDataURL),qe.toString=pr.bind(null,function(e,t,r){return ur.render(e,r)});var mr=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,gr=(e,t,r,n)=>{for(var i,o=n>1?void 0:n?fr(t,r):t,s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&mr(t,r,o),o};let yr=class extends se{constructor(){super(...arguments),this.currentState={status:"idle"},this.selectedMethod=null,this.cardFormData={cardNumber:"",expiry:"",cvv:"",cardholderName:""},this.formErrors={},this.paymentData=null,this.feesExpanded=!1,this.isInitializing=!0,this.cardBrand="unknown",this.paymentLocked=!1,this.show3DSModal=!1,this.showQRModal=!1,this.nextActionUrl=null,this.qrCode=null,this.qrCodeDataUrl=null,this.qrAutoResumeTimer=null,this.qrPollingInProgress=!1,this.sdk=null,this.isInitialized=!1,this.cardNumberCleave=null,this.expiryCleave=null,this.leaveEventsCounter=0,this.previousState=null,this.handle3DSPostMessage=e=>{"ON_AWX_3DS_START_PAGE_LEAVE"===e.data&&(this.leaveEventsCounter++,this.leaveEventsCounter>1&&this.handle3DSComplete())}}hasAllRequiredProps(){return!!(this.config&&this.adapters&&this.amount&&this.currency&&this.orderId)&&(!(!this.firstName||"string"!=typeof this.firstName||""===this.firstName.trim())&&(!(!this.lastName||"string"!=typeof this.lastName||""===this.lastName.trim())&&!(!this.email||"string"!=typeof this.email||""===this.email.trim())))}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.handle3DSPostMessage),this.addEventListener("force-close-3ds-modal",()=>{this.show3DSModal&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0)})}firstUpdated(){this.initializeSDK()}updated(e){super.updated(e),!this.isInitialized&&this.hasAllRequiredProps()&&(console.info("[OnePayment] All required props now available. Initializing SDK..."),this.initializeSDK())}disconnectedCallback(){var e;super.disconnectedCallback(),null==(e=this.sdk)||e.destroy(),this.isInitialized=!1,this.destroyCleave(),window.removeEventListener("message",this.handle3DSPostMessage),null!==this.qrAutoResumeTimer&&clearTimeout(this.qrAutoResumeTimer)}setupCleave(){setTimeout(()=>{var e,t;const r=null==(e=this.shadowRoot)?void 0:e.querySelector("#cardNumber"),n=null==(t=this.shadowRoot)?void 0:t.querySelector("#expiry");r&&!this.cardNumberCleave&&(this.cardNumberCleave=new Ue(r,{creditCard:!0,delimiter:" ",onCreditCardTypeChanged:e=>{this.cardBrand={visa:"visa",mastercard:"mastercard",amex:"amex",discover:"discover"}[e]||"unknown"}})),n&&!this.expiryCleave&&(this.expiryCleave=new Ue(n,{date:!0,datePattern:["m","y"],delimiter:"/"}))},50)}destroyCleave(){this.cardNumberCleave&&(this.cardNumberCleave.destroy(),this.cardNumberCleave=null),this.expiryCleave&&(this.expiryCleave.destroy(),this.expiryCleave=null)}getFilteredPaymentMethods(){const e=("ready"===this.currentState.status||"processing"===this.currentState.status||"requires_action"===this.currentState.status)&&this.currentState.availableMethods||[];return 0===e.length?[]:e.filter(e=>{var t;return!(null==(t=this.excludePaymentMethods)?void 0:t.includes(e.id))}).map(e=>{if(e.id===pe){if("SGD"!==this.getTransactionData().currency)return{id:e.id,enabled:!1,disabledReason:"PayNow is only available for SGD currency"}}return{id:e.id,enabled:!0}})}initializeSDK(){var e;this.config&&this.adapters&&this.amount&&this.currency&&this.orderId?this.firstName&&"string"==typeof this.firstName&&""!==this.firstName.trim()?this.lastName&&"string"==typeof this.lastName&&""!==this.lastName.trim()?this.email&&"string"==typeof this.email&&""!==this.email.trim()?this.isInitialized||(this.isInitialized=!0,null==(e=this.sdk)||e.destroy(),this.sdk=new ke(this.config,this.adapters),this.sdk.subscribe(e=>{var t;"requires_action"===(null==(t=this.previousState)?void 0:t.status)&&"requires_action"!==e.status&&this.show3DSModal&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling()),this.previousState=e,this.currentState=e,this.dispatchEvent(new CustomEvent("state-change",{detail:{state:e},bubbles:!0,composed:!0}))}),this.sdk.on("payment_succeeded",e=>{this.dispatchEvent(new CustomEvent("payment-success",{detail:{paymentIntentId:e.payload.paymentIntent.id},bubbles:!0,composed:!0}))}),this.sdk.on("payment_failed",e=>{this.dispatchEvent(new CustomEvent("payment-error",{detail:{error:e.payload.error.message},bubbles:!0,composed:!0}))}),this.sdk.on("initialized",e=>{this.paymentData=e.payload.paymentData,this.isInitializing=!1}),this.sdk.on("payment_requires_action",e=>{this.nextActionUrl=e.payload.actionUrl,this.show3DSModal=!0,this.paymentLocked=!0,this.leaveEventsCounter=0}),this.sdk.on("poll_started",()=>{const e="undefined"!=typeof window&&"ReactNativeWebView"in window;this.show3DSModal&&e&&(this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling())}),this.sdk.on("qr_code_received",async e=>{if(this.qrCode=e.payload.qrCode,!this.qrCode)return;const t=this.qrCode.startsWith("http://")||this.qrCode.startsWith("https://"),r=this.qrCode.startsWith("data:image");if(t||r)this.qrCodeDataUrl=this.qrCode;else try{const e=await qe.toDataURL(this.qrCode,{width:300,margin:2,color:{dark:"#000000",light:"#FFFFFF"}});this.qrCodeDataUrl=e}catch(n){this.qrCodeDataUrl=null}this.showQRModal=!0,this.paymentLocked=!0,this.qrAutoResumeTimer=window.setTimeout(()=>{this.handleQRScanned()},1e4)}),this.sdk.initialize({amount:this.amount,currency:this.currency,orderId:this.orderId})):console.error("OnePayment: email is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: lastName is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: firstName is required and must be a non-empty string. Customer information is required for all payment methods."):console.error("OnePayment: Missing required props. Ensure config, adapters, amount, currency, and orderId are provided.")}handleMethodSelect(e){this.paymentLocked||(this.selectedMethod=e)}handleQRScanned(){null!==this.qrAutoResumeTimer&&(clearTimeout(this.qrAutoResumeTimer),this.qrAutoResumeTimer=null),this.qrPollingInProgress=!0,this.sdk&&this.sdk.resumePolling()}handle3DSComplete(){this.show3DSModal=!1,this.nextActionUrl=null,this.leaveEventsCounter=0,this.sdk&&this.sdk.resumePolling()}handleInputChange(e,t){if(this.cardFormData={...this.cardFormData,[e]:t},this.formErrors[e]){const t={...this.formErrors};delete t[e],this.formErrors=t}}luhnCheck(e){const t=e.replace(/\s/g,"");if(!/^\d+$/.test(t))return!1;let r=0,n=!1;for(let i=t.length-1;i>=0;i--){const e=t.charAt(i);if(!e)continue;let o=parseInt(e,10);n&&(o*=2,o>9&&(o-=9)),r+=o,n=!n}return r%10==0}validateExpiry(e){const t=e.trim();if(!/^\d{1,2}\/\d{2}$/.test(t))return{valid:!1,error:"Invalid format (MM/YY)"};const r=t.split("/"),n=r[0],i=r[1];if(!n||!i)return{valid:!1,error:"Invalid format (MM/YY)"};const o=parseInt(n,10);if(o<1||o>12)return{valid:!1,error:"Invalid month (01-12)"};const s=new Date,a=s.getFullYear(),l=s.getMonth()+1;let d;if(2!==i.length)return{valid:!1,error:"Invalid year format"};{const e=parseInt(i,10),t=a%100,r=100*Math.floor(a/100);if(e<t){d=t-e>80?r+100+e:r+e}else d=r+e}return d<a||d===a&&o<l?{valid:!1,error:"Card has expired"}:{valid:!0}}validateCardForm(){const e={};if(this.cardFormData.cardNumber.trim()?this.luhnCheck(this.cardFormData.cardNumber)||(e.cardNumber="Invalid card number"):e.cardNumber="Please enter card number",this.cardFormData.expiry.trim()){const t=this.validateExpiry(this.cardFormData.expiry);t.valid||(e.expiry=t.error)}else e.expiry="Please enter expiry date";return this.cardFormData.cvv.trim()||(e.cvv="Please enter CVV"),this.cardFormData.cardholderName.trim()||(e.cardholderName="Please enter cardholder name"),this.formErrors=e,0===Object.keys(e).length}handleCardPayment(){if(!this.sdk||"ready"!==this.currentState.status)return;if(!this.validateCardForm())return;this.paymentLocked=!0;const e=this.cardFormData.expiry.split("/"),t=(e[0]||"").trim(),r=`20${(e[1]||"").trim().substring(0,2)}`;this.sdk.submitPayment(ue,{cardNumber:this.cardFormData.cardNumber.replace(/\s/g,""),expiryMonth:t,expiryYear:r,cvv:this.cardFormData.cvv,firstName:this.firstName,lastName:this.lastName,email:this.email})}handlePayNowPayment(){this.sdk&&"ready"===this.currentState.status&&(this.paymentLocked=!0,this.sdk.submitPayment(pe,{firstName:this.firstName,lastName:this.lastName,email:this.email}))}getTransactionData(){var e;const t=this.paymentData;if(!t)return{currency:this.currency,charge:this.amount,fees:0,feeBreakdown:{transactionFee:0,merchantFee:0,merchantFeeLabel:""},netAmount:this.amount};const r=null==(e=t.fees)?void 0:e.find(e=>"merchant"===e.owner),n="number"==typeof t.totalFee?t.totalFee:Number(t.totalFee)||0,i="number"==typeof t.totalSystemFee?t.totalSystemFee:Number(t.totalSystemFee)||0,o=null!=t.initialAmount?"number"==typeof t.initialAmount?t.initialAmount:Number(t.initialAmount)||0:this.amount,s=null!=t.customerAmount?"number"==typeof t.customerAmount?t.customerAmount:Number(t.customerAmount)||0:o,a=n-i;return{currency:t.currency||this.currency,charge:o,fees:n,feeBreakdown:{transactionFee:a,merchantFee:a,merchantFeeLabel:(r?"percentage"===r.type?`${r.value}%`:`${r.value} ${r.currency}`:"")||"0%"},netAmount:s}}renderTransactionDetailsSkeleton(){return H`
|
|
12
12
|
<div class="skeleton-transaction">
|
|
13
13
|
<div class="skeleton skeleton-title"></div>
|
|
14
14
|
<div class="skeleton-row">
|
|
@@ -1597,5 +1597,5 @@ var OnePayments=function(e){"use strict";
|
|
|
1597
1597
|
transform: translateX(-50%) translateY(0);
|
|
1598
1598
|
}
|
|
1599
1599
|
}
|
|
1600
|
-
`,gr([ce({type:Object})],yr.prototype,"config",2),gr([ce({type:Object})],yr.prototype,"adapters",2),gr([ce({type:Number})],yr.prototype,"amount",2),gr([ce({type:String})],yr.prototype,"currency",2),gr([ce({type:String})],yr.prototype,"orderId",2),gr([ce({type:String})],yr.prototype,"firstName",2),gr([ce({type:String})],yr.prototype,"lastName",2),gr([ce({type:String})],yr.prototype,"email",2),gr([ce({type:Array})],yr.prototype,"excludePaymentMethods",2),gr([ce({type:String})],yr.prototype,"width",2),gr([ce({type:String})],yr.prototype,"maxWidth",2),gr([he()],yr.prototype,"currentState",2),gr([he()],yr.prototype,"selectedMethod",2),gr([he()],yr.prototype,"cardFormData",2),gr([he()],yr.prototype,"formErrors",2),gr([he()],yr.prototype,"paymentData",2),gr([he()],yr.prototype,"feesExpanded",2),gr([he()],yr.prototype,"isInitializing",2),gr([he()],yr.prototype,"cardBrand",2),gr([he()],yr.prototype,"paymentLocked",2),gr([he()],yr.prototype,"show3DSModal",2),gr([he()],yr.prototype,"showQRModal",2),gr([he()],yr.prototype,"nextActionUrl",2),gr([he()],yr.prototype,"qrCode",2),gr([he()],yr.prototype,"qrCodeDataUrl",2),gr([he()],yr.prototype,"qrAutoResumeTimer",2),gr([he()],yr.prototype,"qrPollingInProgress",2),yr=gr([(e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)})("one-payment")],yr);class br{async get(e,t){const r=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",...t}});if(!r.ok){const e=await vr(r);throw new Error(e)}return await r.json()}async post(e,t,r){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async put(e,t,r){const n=await fetch(e,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async patch(e,t,r){const n=await fetch(e,{method:"PATCH",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async delete(e,t){const r=await fetch(e,{method:"DELETE",headers:{"Content-Type":"application/json",...t}});if(!r.ok){const e=await vr(r);throw new Error(e)}return await r.json()}}class wr{constructor(e="one-payments:"){this.prefix=e}async get(e){return localStorage.getItem(this.prefix+e)}async set(e,t){localStorage.setItem(this.prefix+e,t)}async remove(e){localStorage.removeItem(this.prefix+e)}async clear(){Object.keys(localStorage).forEach(e=>{e.startsWith(this.prefix)&&localStorage.removeItem(e)})}}class xr{async sha256(e){const t="string"==typeof e?(new TextEncoder).encode(e):e,r=await crypto.subtle.digest("SHA-256",t);return this.bufferToHex(r)}async hmacSHA256(e,t){const r=new TextEncoder,n=r.encode(e),i=r.encode(t),o=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),s=await crypto.subtle.sign("HMAC",o,i);return this.bufferToHex(s)}uuid(){return crypto.randomUUID()}randomBytes(e){return crypto.getRandomValues(new Uint8Array(e))}bufferToHex(e){return Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}}class kr{now(){return Date.now()}async delay(e){return new Promise(t=>{setTimeout(t,e)})}}function Sr(){return{http:new br,storage:new wr,crypto:new xr,timer:new kr}}const Er="one-payment",Pr="1.1.
|
|
1600
|
+
`,gr([ce({type:Object})],yr.prototype,"config",2),gr([ce({type:Object})],yr.prototype,"adapters",2),gr([ce({type:Number})],yr.prototype,"amount",2),gr([ce({type:String})],yr.prototype,"currency",2),gr([ce({type:String})],yr.prototype,"orderId",2),gr([ce({type:String})],yr.prototype,"firstName",2),gr([ce({type:String})],yr.prototype,"lastName",2),gr([ce({type:String})],yr.prototype,"email",2),gr([ce({type:Array})],yr.prototype,"excludePaymentMethods",2),gr([ce({type:String})],yr.prototype,"width",2),gr([ce({type:String})],yr.prototype,"maxWidth",2),gr([he()],yr.prototype,"currentState",2),gr([he()],yr.prototype,"selectedMethod",2),gr([he()],yr.prototype,"cardFormData",2),gr([he()],yr.prototype,"formErrors",2),gr([he()],yr.prototype,"paymentData",2),gr([he()],yr.prototype,"feesExpanded",2),gr([he()],yr.prototype,"isInitializing",2),gr([he()],yr.prototype,"cardBrand",2),gr([he()],yr.prototype,"paymentLocked",2),gr([he()],yr.prototype,"show3DSModal",2),gr([he()],yr.prototype,"showQRModal",2),gr([he()],yr.prototype,"nextActionUrl",2),gr([he()],yr.prototype,"qrCode",2),gr([he()],yr.prototype,"qrCodeDataUrl",2),gr([he()],yr.prototype,"qrAutoResumeTimer",2),gr([he()],yr.prototype,"qrPollingInProgress",2),yr=gr([(e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)})("one-payment")],yr);class br{async get(e,t){const r=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",...t}});if(!r.ok){const e=await vr(r);throw new Error(e)}return await r.json()}async post(e,t,r){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async put(e,t,r){const n=await fetch(e,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async patch(e,t,r){const n=await fetch(e,{method:"PATCH",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async delete(e,t){const r=await fetch(e,{method:"DELETE",headers:{"Content-Type":"application/json",...t}});if(!r.ok){const e=await vr(r);throw new Error(e)}return await r.json()}}class wr{constructor(e="one-payments:"){this.prefix=e}async get(e){return localStorage.getItem(this.prefix+e)}async set(e,t){localStorage.setItem(this.prefix+e,t)}async remove(e){localStorage.removeItem(this.prefix+e)}async clear(){Object.keys(localStorage).forEach(e=>{e.startsWith(this.prefix)&&localStorage.removeItem(e)})}}class xr{async sha256(e){const t="string"==typeof e?(new TextEncoder).encode(e):e,r=await crypto.subtle.digest("SHA-256",t);return this.bufferToHex(r)}async hmacSHA256(e,t){const r=new TextEncoder,n=r.encode(e),i=r.encode(t),o=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),s=await crypto.subtle.sign("HMAC",o,i);return this.bufferToHex(s)}uuid(){return crypto.randomUUID()}randomBytes(e){return crypto.getRandomValues(new Uint8Array(e))}bufferToHex(e){return Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}}class kr{now(){return Date.now()}async delay(e){return new Promise(t=>{setTimeout(t,e)})}}function Sr(){return{http:new br,storage:new wr,crypto:new xr,timer:new kr}}const Er="one-payment",Pr="1.1.29";!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(Er))return console.info(`[OnePayments] <${Er}> is already registered. Skipping re-registration.`),!0;try{return customElements.define(Er,yr),console.info(`[OnePayments] Registered <${Er}> custom element (v${Pr})`),!0}catch(e){return console.error(`[OnePayments] Failed to register <${Er}>:`,e),!1}}();const Cr={createWebAdapters:Sr,TAG_NAME:Er,VERSION:Pr,isRegistered:()=>"undefined"!=typeof customElements&&void 0!==customElements.get(Er),whenDefined:()=>"undefined"==typeof customElements?Promise.reject(new Error("customElements API is not available")):customElements.whenDefined(Er)};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=Cr),e.OnePayments=Cr,e.TAG_NAME=Er,e.VERSION=Pr,e.createWebAdapters=Sr,e.default=Cr,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),e}({});
|
|
1601
1601
|
//# sourceMappingURL=one-payment.browser.iife.js.map
|