@a-tech.jo/atech_payment 1.0.22 → 1.0.23

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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAU3E,OAAO,KAAK,EACR,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,SAAS,CAAC;AAIjB,YAAY,EACR,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACrB,CAAC;AA4CF,eAAO,MAAM,uBAAuB,GAChC,MAAM,MAAM,EACZ,mBAAmB,wBAAwB,KAC5C,IAEF,CAAC;AAIF,QAAA,MAAM,WAAW,GAAI,OAAO,iBAAiB,KAAG,SA2G/C,CAAC;AAIF,QAAA,MAAM,WAAW,GAAU,gDAKxB,iBAAiB,KAAG,OAAO,CAAC,OAAO,CAOrC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAW3E,OAAO,KAAK,EACR,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,SAAS,CAAC;AAIjB,YAAY,EACR,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACrB,CAAC;AA4CF,eAAO,MAAM,uBAAuB,GAChC,MAAM,MAAM,EACZ,mBAAmB,wBAAwB,KAC5C,IAEF,CAAC;AAIF,QAAA,MAAM,WAAW,GAAI,OAAO,iBAAiB,KAAG,SAwH/C,CAAC;AAIF,QAAA,MAAM,WAAW,GAAU,gDAKxB,iBAAiB,KAAG,OAAO,CAAC,OAAO,CAOrC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- import*as t from"react";import*as e from"react/jsx-runtime";var r={d:(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};r.d(n,{qT:()=>dr,Rb:()=>fr,IZ:()=>pr});var o={};r.r(o),r.d(o,{hasBrowserEnv:()=>Gt,hasStandardBrowserEnv:()=>Ht,hasStandardBrowserWebWorkerEnv:()=>Kt,navigator:()=>zt,origin:()=>Wt});const i=(a={default:()=>t.default,useEffect:()=>t.useEffect,useRef:()=>t.useRef,useState:()=>t.useState},s={},r.d(s,a),s);var a,s;function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var d=function(t){switch((process.env.NEXT_PUBLIC_PAYMENT_ENV||"").trim().toLowerCase()){case"stage":case"staging":return"staging";case"dev":case"development":case"local":return"development";default:return"production"}}(),p={BACKEND_DOMAIN:"https://stage.banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://test.oppwa.com",MEPS_DOMAIN:"https://meps-test.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network-test.payment.com",PAYPAL_DOMAIN:"https://www.sandbox.paypal.com"},h={production:{BACKEND_DOMAIN:"https://banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://oppwa.com",MEPS_DOMAIN:"https://meps.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network.payment.com",PAYPAL_DOMAIN:"https://www.paypal.com"},staging:p,development:p}[d],y=l(l({ENV:d},h),{},{getGatewayCheckoutUrl:function(t,e){return function(t,e,r){switch(e.toLowerCase()){case"hyperpay":return r?"".concat(t.HYPERPAY_DOMAIN,"/v1/paymentWidgets.js?checkoutId=").concat(r):t.HYPERPAY_DOMAIN;case"meps":return r?"".concat(t.MEPS_DOMAIN,"/checkout/version/60/checkout.js"):t.MEPS_DOMAIN;case"stripe":return t.STRIPE_DOMAIN;case"paypal":return r&&!r.startsWith("http")?"".concat(t.PAYPAL_DOMAIN).concat(r):r||t.PAYPAL_DOMAIN;case"network":return r&&!r.startsWith("http")?"".concat(t.NETWORK_DOMAIN).concat(r):r||t.NETWORK_DOMAIN;default:return t.BACKEND_DOMAIN}}(h,t,e)}});const m=y,b=(t=>{var e={};return r.d(e,t),e})({jsx:()=>e.jsx});function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){E(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function E(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=g(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const O=function(t){var e=t.checkoutId,r=t.redirectUrl,n=t.billing;return(0,i.useEffect)((function(){var t,r,o,i,a;if(e){var s=window,c=s.wpwlOptions;s.wpwlOptions=w(w({},c),{},{billingAddress:{street1:null!==(t=null==n?void 0:n.street1)&&void 0!==t?t:"",city:null!==(r=null==n?void 0:n.city)&&void 0!==r?r:"",state:null!==(o=null==n?void 0:n.state)&&void 0!==o?o:"",country:null!==(i=null==n?void 0:n.country)&&void 0!==i?i:"",postcode:null!==(a=null==n?void 0:n.postcode)&&void 0!==a?a:""},mandatoryBillingFields:{street1:!0,city:!0,state:!0,country:!0,postcode:!0}});var u=m.getGatewayCheckoutUrl("hyperpay",e),l=document.createElement("script");return l.src=u,l.async=!0,document.body.appendChild(l),function(){s.wpwlOptions=c,document.body.contains(l)&&document.body.removeChild(l)}}}),[e]),e?(0,b.jsx)("form",{action:r||window.location.href,className:"paymentWidgets","data-brands":"VISA MASTER AMEX"}):(0,b.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing HyperPay checkoutId"})},S=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("paypal",e);window.location.href=t}}),[e]),e?(0,b.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to PayPal secure checkout..."}):(0,b.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing PayPal approval URL."})},x=function(t){var e=t.clientSecret,r=t.publishableKey;return(0,i.useEffect)((function(){if(e&&r){var t=m.getGatewayCheckoutUrl("stripe"),n=document.createElement("script");return n.src=t,n.async=!0,n.onload=function(){console.log("Stripe JS loaded from:",t)},document.body.appendChild(n),function(){document.body.contains(n)&&document.body.removeChild(n)}}}),[e,r]),e&&r?(0,b.jsx)("div",{id:"stripe-checkout-container",className:"stripe-payment-container",children:(0,b.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Initializing Stripe Payment Elements..."})}):(0,b.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Stripe clientSecret or publishableKey"})},j=function(t){var e=t.checkoutId;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("meps",e),r=document.createElement("script");return r.src=t,r.async=!0,r.setAttribute("data-error","errorCallback"),r.setAttribute("data-cancel","cancelCallback"),document.body.appendChild(r),function(){document.body.contains(r)&&document.body.removeChild(r)}}}),[e]),e?(0,b.jsx)("div",{id:"embed-target",className:"meps-payment-container",children:(0,b.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Loading MEPS checkout session..."})}):(0,b.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing MEPS Checkout ID"})},R=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("network",e);window.location.href=t}}),[e]),e?(0,b.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to Network International payment page..."}):(0,b.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Network International payment URL."})};function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}var A=function(t){return t&&"object"===P(t)?t:void 0},N=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,o=e;n<o.length;n++){var i=o[n];if("string"==typeof i&&i.trim())return i.trim();if("number"==typeof i)return String(i)}return""},T=function(t){var e,r,n,o,i=A(null==t?void 0:t.user),a=null!==(e=A(null==t?void 0:t.billingAddress))&&void 0!==e?e:A(null==t?void 0:t.billing),s=(A(null==t?void 0:t.customer),null==i?void 0:i.city),c="object"===P(s)?N(null===(r=A(s))||void 0===r?void 0:r.name):N(s);return{street1:N(null==i?void 0:i.streetName,null==a?void 0:a.street1,null==a?void 0:a.street),city:N(c,null==a?void 0:a.city),state:N(null==a?void 0:a.state,c),country:N(null==i?void 0:i.countryIso2,null===(n=A(null===(o=A(s))||void 0===o?void 0:o.country))||void 0===n?void 0:n.nameIso2,null==a?void 0:a.country).toUpperCase(),postcode:N(null==i?void 0:i.postalCode,null==a?void 0:a.postcode,null==a?void 0:a.postalCode,null==a?void 0:a.zip)}},L={street1:"user.streetName",city:"user.city",state:"user.city",country:"user.countryIso2",postcode:"user.postalCode"},_=function(t){var e=T(t),r=Object.keys(e).filter((function(t){return!e[t]})).map((function(t){return L[t]}));return Array.from(new Set(r))};function C(t,e){return function(){return t.apply(e,arguments)}}const{toString:k}=Object.prototype,{getPrototypeOf:I}=Object,D=(U=Object.create(null),t=>{const e=k.call(t);return U[e]||(U[e]=e.slice(8,-1).toLowerCase())});var U;const F=t=>(t=t.toLowerCase(),e=>D(e)===t),B=t=>e=>typeof e===t,{isArray:M}=Array,q=B("undefined"),G=F("ArrayBuffer"),z=B("string"),H=B("function"),K=B("number"),W=t=>null!==t&&"object"==typeof t,J=t=>{if("object"!==D(t))return!1;const e=I(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},V=F("Date"),Y=F("File"),$=F("Blob"),X=F("FileList"),Z=F("URLSearchParams"),[Q,tt,et,rt]=["ReadableStream","Request","Response","Headers"].map(F);function nt(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),M(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(n=0;n<i;n++)a=o[n],e.call(null,t[a],a,t)}}function ot(t,e){e=e.toLowerCase();const r=Object.keys(t);let n,o=r.length;for(;o-- >0;)if(n=r[o],e===n.toLowerCase())return n;return null}const it="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,at=t=>!q(t)&&t!==it,st=(ct="undefined"!=typeof Uint8Array&&I(Uint8Array),t=>ct&&t instanceof ct);var ct;const ut=F("HTMLFormElement"),lt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),ft=F("RegExp"),dt=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};nt(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)},pt="abcdefghijklmnopqrstuvwxyz",ht="0123456789",yt={DIGIT:ht,ALPHA:pt,ALPHA_DIGIT:pt+pt.toUpperCase()+ht},mt=F("AsyncFunction"),bt=(gt="function"==typeof setImmediate,vt=H(it.postMessage),gt?setImmediate:vt?(wt=`axios@${Math.random()}`,Et=[],it.addEventListener("message",(({source:t,data:e})=>{t===it&&e===wt&&Et.length&&Et.shift()()}),!1),t=>{Et.push(t),it.postMessage(wt,"*")}):t=>setTimeout(t));var gt,vt,wt,Et;const Ot="undefined"!=typeof queueMicrotask?queueMicrotask.bind(it):"undefined"!=typeof process&&process.nextTick||bt,St={isArray:M,isArrayBuffer:G,isBuffer:function(t){return null!==t&&!q(t)&&null!==t.constructor&&!q(t.constructor)&&H(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||H(t.append)&&("formdata"===(e=D(t))||"object"===e&&H(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&G(t.buffer),e},isString:z,isNumber:K,isBoolean:t=>!0===t||!1===t,isObject:W,isPlainObject:J,isReadableStream:Q,isRequest:tt,isResponse:et,isHeaders:rt,isUndefined:q,isDate:V,isFile:Y,isBlob:$,isRegExp:ft,isFunction:H,isStream:t=>W(t)&&H(t.pipe),isURLSearchParams:Z,isTypedArray:st,isFileList:X,forEach:nt,merge:function t(){const{caseless:e}=at(this)&&this||{},r={},n=(n,o)=>{const i=e&&ot(r,o)||o;J(r[i])&&J(n)?r[i]=t(r[i],n):J(n)?r[i]=t({},n):M(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&nt(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(nt(e,((e,n)=>{r&&H(e)?t[n]=C(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,a;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],n&&!n(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==r&&I(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:D,kindOfTest:F,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(M(t))return t;let e=t.length;if(!K(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:ut,hasOwnProperty:lt,hasOwnProp:lt,reduceDescriptors:dt,freezeMethods:t=>{dt(t,((e,r)=>{if(H(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];H(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return M(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:ot,global:it,isContextDefined:at,ALPHABET:yt,generateString:(t=16,e=yt.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&H(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(W(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=M(t)?[]:{};return nt(t,((t,e)=>{const i=r(t,n+1);!q(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:mt,isThenable:t=>t&&(W(t)||H(t))&&H(t.then)&&H(t.catch),setImmediate:bt,asap:Ot};function xt(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}St.inherits(xt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:St.toJSONObject(this.config),code:this.code,status:this.status}}});const jt=xt.prototype,Rt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{Rt[t]={value:t}})),Object.defineProperties(xt,Rt),Object.defineProperty(jt,"isAxiosError",{value:!0}),xt.from=(t,e,r,n,o,i)=>{const a=Object.create(jt);return St.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),xt.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const Pt=xt;function At(t){return St.isPlainObject(t)||St.isArray(t)}function Nt(t){return St.endsWith(t,"[]")?t.slice(0,-2):t}function Tt(t,e,r){return t?t.concat(e).map((function(t,e){return t=Nt(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const Lt=St.toFlatObject(St,{},null,(function(t){return/^is[A-Z]/.test(t)})),_t=function(t,e,r){if(!St.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=St.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!St.isUndefined(e[t])}))).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&St.isSpecCompliantForm(e);if(!St.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(St.isDate(t))return t.toISOString();if(!s&&St.isBlob(t))throw new Pt("Blob is not supported. Use a Buffer instead.");return St.isArrayBuffer(t)||St.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,r,o){let s=t;if(t&&!o&&"object"==typeof t)if(St.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(St.isArray(t)&&function(t){return St.isArray(t)&&!t.some(At)}(t)||(St.isFileList(t)||St.endsWith(r,"[]"))&&(s=St.toArray(t)))return r=Nt(r),s.forEach((function(t,n){!St.isUndefined(t)&&null!==t&&e.append(!0===a?Tt([r],n,i):null===a?r:r+"[]",c(t))})),!1;return!!At(t)||(e.append(Tt(o,r,i),c(t)),!1)}const l=[],f=Object.assign(Lt,{defaultVisitor:u,convertValue:c,isVisitable:At});if(!St.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!St.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),St.forEach(r,(function(r,i){!0===(!(St.isUndefined(r)||null===r)&&o.call(e,r,St.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function Ct(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function kt(t,e){this._pairs=[],t&&_t(t,this,e)}const It=kt.prototype;It.append=function(t,e){this._pairs.push([t,e])},It.toString=function(t){const e=t?function(e){return t.call(this,e,Ct)}:Ct;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const Dt=kt;function Ut(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ft(t,e,r){if(!e)return t;const n=r&&r.encode||Ut,o=r&&r.serialize;let i;if(i=o?o(e,r):St.isURLSearchParams(e)?e.toString():new Dt(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const Bt=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){St.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Dt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Gt="undefined"!=typeof window&&"undefined"!=typeof document,zt="object"==typeof navigator&&navigator||void 0,Ht=Gt&&(!zt||["ReactNative","NativeScript","NS"].indexOf(zt.product)<0),Kt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Wt=Gt&&window.location.href||"http://localhost",Jt={...o,...qt},Vt=function(t){function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=t.length;return i=!i&&St.isArray(n)?n.length:i,s?(St.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&St.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&St.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}(n[i])),!a)}if(St.isFormData(t)&&St.isFunction(t.entries)){const r={};return St.forEachEntry(t,((t,n)=>{e(function(t){return St.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},Yt={transitional:Mt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=St.isObject(t);if(o&&St.isHTMLForm(t)&&(t=new FormData(t)),St.isFormData(t))return n?JSON.stringify(Vt(t)):t;if(St.isArrayBuffer(t)||St.isBuffer(t)||St.isStream(t)||St.isFile(t)||St.isBlob(t)||St.isReadableStream(t))return t;if(St.isArrayBufferView(t))return t.buffer;if(St.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return _t(t,new Jt.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return Jt.isNode&&St.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=St.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return _t(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(St.isString(t))try{return(0,JSON.parse)(t),St.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Yt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(St.isResponse(t)||St.isReadableStream(t))return t;if(t&&St.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw Pt.from(t,Pt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Jt.classes.FormData,Blob:Jt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};St.forEach(["delete","get","head","post","put","patch"],(t=>{Yt.headers[t]={}}));const $t=Yt,Xt=St.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Zt=Symbol("internals");function Qt(t){return t&&String(t).trim().toLowerCase()}function te(t){return!1===t||null==t?t:St.isArray(t)?t.map(te):String(t)}function ee(t,e,r,n,o){return St.isFunction(n)?n.call(this,e,r):(o&&(e=r),St.isString(e)?St.isString(n)?-1!==e.indexOf(n):St.isRegExp(n)?n.test(e):void 0:void 0)}class re{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=Qt(e);if(!o)throw new Error("header name must be a non-empty string");const i=St.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=te(t))}const i=(t,e)=>St.forEach(t,((t,r)=>o(t,r,e)));if(St.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(St.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&Xt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e);else if(St.isHeaders(t))for(const[e,n]of t.entries())o(n,e,r);else null!=t&&o(e,t,r);return this}get(t,e){if(t=Qt(t)){const r=St.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(St.isFunction(e))return e.call(this,t,r);if(St.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Qt(t)){const r=St.findKey(this,t);return!(!r||void 0===this[r]||e&&!ee(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=Qt(t)){const o=St.findKey(r,t);!o||e&&!ee(0,r[o],o,e)||(delete r[o],n=!0)}}return St.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!ee(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return St.forEach(this,((n,o)=>{const i=St.findKey(r,o);if(i)return e[i]=te(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete e[o],e[a]=te(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return St.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&St.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[Zt]=this[Zt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=Qt(t);e[n]||(function(t,e){const r=St.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return St.isArray(t)?t.forEach(n):n(t),this}}re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),St.reduceDescriptors(re.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),St.freezeMethods(re);const ne=re;function oe(t,e){const r=this||$t,n=e||r,o=ne.from(n.headers);let i=n.data;return St.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function ie(t){return!(!t||!t.__CANCEL__)}function ae(t,e,r){Pt.call(this,null==t?"canceled":t,Pt.ERR_CANCELED,e,r),this.name="CanceledError"}St.inherits(ae,Pt,{__CANCEL__:!0});const se=ae;function ce(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new Pt("Request failed with status code "+r.status,[Pt.ERR_BAD_REQUEST,Pt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const ue=(t,e,r=3)=>{let n=0;const o=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),u=n[a];o||(o=c),r[i]=s,n[i]=c;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o<e)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(t,e){let r,n,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),s=e-o;s>=i?a(t,e):(r=t,n||(n=setTimeout((()=>{n=null,a(r)}),i-s)))},()=>r&&a(r)]}((r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=i,t({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:r,lengthComputable:null!=a,[e?"download":"upload"]:!0})}),r)},le=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},fe=t=>(...e)=>St.asap((()=>t(...e))),de=Jt.hasStandardBrowserEnv?function(){const t=Jt.navigator&&/(msie|trident)/i.test(Jt.navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=St.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0},pe=Jt.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const a=[t+"="+encodeURIComponent(e)];St.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),St.isString(n)&&a.push("path="+n),St.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function he(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const ye=t=>t instanceof ne?{...t}:t;function me(t,e){e=e||{};const r={};function n(t,e,r){return St.isPlainObject(t)&&St.isPlainObject(e)?St.merge.call({caseless:r},t,e):St.isPlainObject(e)?St.merge({},e):St.isArray(e)?e.slice():e}function o(t,e,r){return St.isUndefined(e)?St.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!St.isUndefined(e))return n(void 0,e)}function a(t,e){return St.isUndefined(e)?St.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function s(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>o(ye(t),ye(e),!0)};return St.forEach(Object.keys(Object.assign({},t,e)),(function(n){const i=c[n]||o,a=i(t[n],e[n],n);St.isUndefined(a)&&i!==s||(r[n]=a)})),r}const be=t=>{const e=me({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=e;if(e.headers=s=ne.from(s),e.url=Ft(he(e.baseURL,e.url),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),St.isFormData(n))if(Jt.hasStandardBrowserEnv||Jt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(r=s.getContentType())){const[t,...e]=r?r.split(";").map((t=>t.trim())).filter(Boolean):[];s.setContentType([t||"multipart/form-data",...e].join("; "))}if(Jt.hasStandardBrowserEnv&&(o&&St.isFunction(o)&&(o=o(e)),o||!1!==o&&de(e.url))){const t=i&&a&&pe.read(a);t&&s.set(i,t)}return e},ge="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=be(t);let o=n.data;const i=ne.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=n;function h(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=ne.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());ce((function(t){e(t),h()}),(function(t){r(t),h()}),{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:t,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new Pt("Request aborted",Pt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new Pt("Network Error",Pt.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||Mt;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new Pt(e,o.clarifyTimeoutError?Pt.ETIMEDOUT:Pt.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&St.forEach(i.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),St.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),f&&"json"!==f&&(y.responseType=n.responseType),p&&([c,l]=ue(p,!0),y.addEventListener("progress",c)),d&&y.upload&&([s,u]=ue(d),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=e=>{y&&(r(!e||e.type?new se(null,t,y):e),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const b=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);b&&-1===Jt.protocols.indexOf(b)?r(new Pt("Unsupported protocol "+b+":",Pt.ERR_BAD_REQUEST,t)):y.send(o||null)}))},ve=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const o=function(t){if(!r){r=!0,a();const e=t instanceof Error?t:this.reason;n.abort(e instanceof Pt?e:new se(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new Pt(`timeout ${e} of ms exceeded`,Pt.ETIMEDOUT))}),e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:s}=n;return s.unsubscribe=()=>St.asap(a),s}},we=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,o=0;for(;o<r;)n=o+e,yield t.slice(o,n),o=n},Ee=(t,e,r,n)=>{const o=async function*(t,e){for await(const r of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}}(t))yield*we(r,e)}(t,e);let i,a=0,s=t=>{i||(i=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await o.next();if(e)return s(),void t.close();let i=n.byteLength;if(r){let t=a+=i;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw s(t),t}},cancel:t=>(s(t),o.return())},{highWaterMark:2})},Oe="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Se=Oe&&"function"==typeof ReadableStream,xe=Oe&&("function"==typeof TextEncoder?(je=new TextEncoder,t=>je.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var je;const Re=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Pe=Se&&Re((()=>{let t=!1;const e=new Request(Jt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Ae=Se&&Re((()=>St.isReadableStream(new Response("").body))),Ne={stream:Ae&&(t=>t.body)};var Te;Oe&&(Te=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!Ne[t]&&(Ne[t]=St.isFunction(Te[t])?e=>e[t]():(e,r)=>{throw new Pt(`Response type '${t}' is not supported`,Pt.ERR_NOT_SUPPORT,r)})})));const Le=Oe&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:d}=be(t);u=u?(u+"").toLowerCase():"text";let p,h=ve([o,i&&i.toAbortSignal()],a);const y=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&Pe&&"get"!==r&&"head"!==r&&0!==(m=await(async(t,e)=>{const r=St.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(St.isBlob(t))return t.size;if(St.isSpecCompliantForm(t)){const e=new Request(Jt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return St.isArrayBufferView(t)||St.isArrayBuffer(t)?t.byteLength:(St.isURLSearchParams(t)&&(t+=""),St.isString(t)?(await xe(t)).byteLength:void 0)})(e):r})(l,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(St.isFormData(n)&&(t=r.headers.get("content-type"))&&l.setContentType(t),r.body){const[t,e]=le(m,ue(fe(c)));n=Ee(r.body,65536,t,e)}}St.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:o?f:void 0});let i=await fetch(p);const a=Ae&&("stream"===u||"response"===u);if(Ae&&(s||a&&y)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=St.toFiniteNumber(i.headers.get("content-length")),[r,n]=s&&le(e,ue(fe(s),!0))||[];i=new Response(Ee(i.body,65536,r,(()=>{n&&n(),y&&y()})),t)}u=u||"text";let b=await Ne[St.findKey(Ne,u)||"text"](i,t);return!a&&y&&y(),await new Promise(((e,r)=>{ce(e,r,{data:b,headers:ne.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:p})}))}catch(e){if(y&&y(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new Pt("Network Error",Pt.ERR_NETWORK,t,p),{cause:e.cause||e});throw Pt.from(e,e&&e.code,t,p)}}),_e={http:null,xhr:ge,fetch:Le};St.forEach(_e,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Ce=t=>`- ${t}`,ke=t=>St.isFunction(t)||null===t||!1===t,Ie=t=>{t=St.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){let e;if(r=t[i],n=r,!ke(r)&&(n=_e[(e=String(r)).toLowerCase()],void 0===n))throw new Pt(`Unknown adapter '${e}'`);if(n)break;o[e||"#"+i]=n}if(!n){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let r=e?t.length>1?"since :\n"+t.map(Ce).join("\n"):" "+Ce(t[0]):"as no adapter specified";throw new Pt("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function De(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new se(null,t)}function Ue(t){return De(t),t.headers=ne.from(t.headers),t.data=oe.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ie(t.adapter||$t.adapter)(t).then((function(e){return De(t),e.data=oe.call(t,t.transformResponse,e),e.headers=ne.from(e.headers),e}),(function(e){return ie(e)||(De(t),e&&e.response&&(e.response.data=oe.call(t,t.transformResponse,e.response),e.response.headers=ne.from(e.response.headers))),Promise.reject(e)}))}const Fe={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Fe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const Be={};Fe.transitional=function(t,e,r){function n(t,e){return"[Axios v1.7.7] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new Pt(n(o," has been removed"+(e?" in "+e:"")),Pt.ERR_DEPRECATED);return e&&!Be[o]&&(Be[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}};const Me={assertOptions:function(t,e,r){if("object"!=typeof t)throw new Pt("options must be an object",Pt.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],a=e[i];if(a){const e=t[i],r=void 0===e||a(e,i,t);if(!0!==r)throw new Pt("option "+i+" must be "+r,Pt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Pt("Unknown option "+i,Pt.ERR_BAD_OPTION)}},validators:Fe},qe=Me.validators;class Ge{constructor(t){this.defaults=t,this.interceptors={request:new Bt,response:new Bt}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=me(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&Me.assertOptions(r,{silentJSONParsing:qe.transitional(qe.boolean),forcedJSONParsing:qe.transitional(qe.boolean),clarifyTimeoutError:qe.transitional(qe.boolean)},!1),null!=n&&(St.isFunction(n)?e.paramsSerializer={serialize:n}:Me.assertOptions(n,{encode:qe.function,serialize:qe.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&St.merge(o.common,o[e.method]);o&&St.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=ne.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,f=0;if(!s){const t=[Ue.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);f<l;)u=u.then(t[f++],t[f++]);return u}l=a.length;let d=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Ue.call(this,d)}catch(t){return Promise.reject(t)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(t){return Ft(he((t=me(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}St.forEach(["delete","get","head","options"],(function(t){Ge.prototype[t]=function(e,r){return this.request(me(r||{},{method:t,url:e,data:(r||{}).data}))}})),St.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,o){return this.request(me(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ge.prototype[t]=e(),Ge.prototype[t+"Form"]=e(!0)}));const ze=Ge;class He{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const r=this;this.promise.then((t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new se(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new He((function(e){t=e})),cancel:t}}}const Ke=He,We={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(We).forEach((([t,e])=>{We[e]=t}));const Je=We,Ve=function t(e){const r=new ze(e),n=C(ze.prototype.request,r);return St.extend(n,ze.prototype,r,{allOwnKeys:!0}),St.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(me(e,r))},n}($t);function Ye(t){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ye(t)}function $e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$e(Object(r),!0).forEach((function(e){Ze(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ze(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Ye(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ye(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qe(){Qe=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new T(n||[]);return o(a,"_invoke",{value:R(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function b(){}function g(){}function v(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(L([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=v.prototype=b.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Ye(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function R(e,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Ye(e)+" is not iterable")}return g.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:g,configurable:!0}),g.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function tr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function er(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){tr(i,n,o,a,s,"next",t)}function s(t){tr(i,n,o,a,s,"throw",t)}a(void 0)}))}}Ve.Axios=ze,Ve.CanceledError=se,Ve.CancelToken=Ke,Ve.isCancel=ie,Ve.VERSION="1.7.7",Ve.toFormData=_t,Ve.AxiosError=Pt,Ve.Cancel=Ve.CanceledError,Ve.all=function(t){return Promise.all(t)},Ve.spread=function(t){return function(e){return t.apply(null,e)}},Ve.isAxiosError=function(t){return St.isObject(t)&&!0===t.isAxiosError},Ve.mergeConfig=me,Ve.AxiosHeaders=ne,Ve.formToJSON=t=>Vt(St.isHTMLForm(t)?new FormData(t):t),Ve.getAdapter=Ie,Ve.HttpStatusCode=Je,Ve.default=Ve;var rr=Ve.create({baseURL:m.BACKEND_DOMAIN,headers:{"Content-Type":"application/json"},timeout:15e3});const nr={createOrder:function(){var t=er(Qe().mark((function t(e){var r,n,o,i,a;return Qe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.entityId,n=e.appId,o=e.order,i=e.redirectUrl,t.next=3,rr.post("/orders",{entityId:r,appId:n,order:o,redirectUrl:i});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),verifyOrderStatus:function(){var t=er(Qe().mark((function t(e){var r,n,o,i,a;return Qe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,rr.get("/orders/".concat(encodeURIComponent(o)),{params:Xe({entityId:n,appId:r},i?{resourcePath:i}:{})});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};function or(){or=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new T(n||[]);return o(a,"_invoke",{value:R(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function b(){}function g(){}function v(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(L([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=v.prototype=b.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==ir(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function R(e,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=P(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ir(e)+" is not iterable")}return g.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:g,configurable:!0}),g.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function ir(t){return ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ir(t)}function ar(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function sr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ar(i,n,o,a,s,"next",t)}function s(t){ar(i,n,o,a,s,"throw",t)}a(void 0)}))}}function cr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ur(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ur(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var lr={hyperpay:function(t){var e=t.orderData,r=t.order,n=t.redirectUrl,o=t.onChange;return(0,b.jsx)(O,{checkoutId:e.checkoutId,billing:T(r),redirectUrl:n,onChange:o})},paypal:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(S,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})},stripe:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(x,{clientSecret:e.clientSecret,publishableKey:e.publishableKey,redirectUrl:r,onChange:n})},meps:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(j,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},network:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(R,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})}},fr=function(t,e){lr[t]=e},dr=function(t){var e=t.entityId,r=void 0===e?null:e,n=t.appId,o=void 0===n?null:n,a=t.order,s=void 0===a?null:a,c=t.redirectUrl,u=void 0===c?"":c,l=t.onChange,f=cr((0,i.useState)(!1),2),d=f[0],p=f[1],h=cr((0,i.useState)(null),2),y=h[0],m=h[1],b=cr((0,i.useState)(null),2),g=b[0],v=b[1],w=(0,i.useRef)(l);w.current=l;var E=(0,i.useRef)(null),O=(0,i.useRef)(!0),S=s&&r&&o?JSON.stringify([r,o,u,s]):null;return(0,i.useEffect)((function(){return O.current=!0,function(){O.current=!1}}),[]),(0,i.useEffect)((function(){if(s&&r&&o&&S&&E.current!==S){E.current=S;var t=function(){return O.current&&E.current===S},e=function(){var e=sr(or().mark((function e(){var n,i,a,c,l,f,d,h,y,b;return or().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p(!0),m(null),v(null),e.next=6,nr.createOrder({entityId:r,appId:o,order:s,redirectUrl:u});case 6:if(n=e.sent,!t()||"hyperpay"!==n.provider){e.next=14;break}if(!(i=_(s)).length){e.next=14;break}return c="Missing required billing fields for HyperPay: ".concat(i.join(", ")),m({message:c,code:"MISSING_BILLING_FIELDS"}),null===(a=w.current)||void 0===a||a.call(w,{success:!1,error:c,code:"MISSING_BILLING_FIELDS",fields:i}),e.abrupt("return");case 14:t()&&(v(n),null===(l=w.current)||void 0===l||l.call(w,{status:"order_created",provider:n.provider,data:n})),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(0),console.error("Order creation error:",e.t0),t()&&(h=null===e.t0||void 0===e.t0||null===(f=e.t0.response)||void 0===f?void 0:f.data,y=(null==h?void 0:h.message)||(null==h?void 0:h.error)||(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to initiate payment order.",b=null==h?void 0:h.code,m({message:y,code:b}),null===(d=w.current)||void 0===d||d.call(w,h&&"object"===ir(h)?h:{success:!1,error:y,code:b}));case 21:return e.prev=21,t()&&p(!1),e.finish(21);case 24:case"end":return e.stop()}}),e,null,[[0,17,21,24]])})));return function(){return e.apply(this,arguments)}}();e()}}),[S]),d?i.default.createElement("div",{className:"payment-sdk-loading"},"Initializing payment..."):y?i.default.createElement("div",{className:"payment-sdk-error",role:"alert","data-code":y.code},y.message):null!=g&&g.provider&&lr[g.provider]?(0,lr[g.provider])({orderData:g,order:s,redirectUrl:u,onChange:l}):null},pr=function(){var t=sr(or().mark((function t(e){var r,n,o,i;return or().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,nr.verifyOrderStatus({appId:r,entityId:n,checkoutId:o,resourcePath:i});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),hr=n.qT,yr=n.Rb,mr=n.IZ;export{hr as PymentOrder,yr as registerPaymentProvider,mr as verifyOrder};
2
+ import*as t from"react";import*as e from"react/jsx-runtime";var r={d:(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};r.d(n,{qT:()=>Ar,Rb:()=>Pr,IZ:()=>Rr});var o={};r.r(o),r.d(o,{hasBrowserEnv:()=>ne,hasStandardBrowserEnv:()=>ie,hasStandardBrowserWebWorkerEnv:()=>ae,navigator:()=>oe,origin:()=>se});const i=(a={default:()=>t.default,useEffect:()=>t.useEffect,useRef:()=>t.useRef,useState:()=>t.useState},s={},r.d(s,a),s);var a,s;function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var d=function(t){switch((process.env.NEXT_PUBLIC_PAYMENT_ENV||"").trim().toLowerCase()){case"stage":case"staging":return"staging";case"dev":case"development":case"local":return"development";default:return"production"}}(),p={BACKEND_DOMAIN:"https://stage.banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://test.oppwa.com",MEPS_DOMAIN:"https://meps-test.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network-test.payment.com",PAYPAL_DOMAIN:"https://www.sandbox.paypal.com"},h={production:{BACKEND_DOMAIN:"https://banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://oppwa.com",MEPS_DOMAIN:"https://meps.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network.payment.com",PAYPAL_DOMAIN:"https://www.paypal.com"},staging:p,development:p}[d],y=l(l({ENV:d},h),{},{getGatewayCheckoutUrl:function(t,e){return function(t,e,r){switch(e.toLowerCase()){case"hyperpay":return r?"".concat(t.HYPERPAY_DOMAIN,"/v1/paymentWidgets.js?checkoutId=").concat(r):t.HYPERPAY_DOMAIN;case"meps":return r?"".concat(t.MEPS_DOMAIN,"/checkout/version/60/checkout.js"):t.MEPS_DOMAIN;case"stripe":return t.STRIPE_DOMAIN;case"paypal":return r&&!r.startsWith("http")?"".concat(t.PAYPAL_DOMAIN).concat(r):r||t.PAYPAL_DOMAIN;case"network":return r&&!r.startsWith("http")?"".concat(t.NETWORK_DOMAIN).concat(r):r||t.NETWORK_DOMAIN;default:return t.BACKEND_DOMAIN}}(h,t,e)}});const m=y,b=(t=>{var e={};return r.d(e,t),e})({jsx:()=>e.jsx,jsxs:()=>e.jsxs});function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=v(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==v(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const E=function(t){var e=t.checkoutId,r=t.redirectUrl,n=t.billing;return(0,i.useEffect)((function(){var t,r,o,i,a;if(e){var s=window,c=s.wpwlOptions;s.wpwlOptions=w(w({},c),{},{billingAddress:{street1:null!==(t=null==n?void 0:n.street1)&&void 0!==t?t:"",city:null!==(r=null==n?void 0:n.city)&&void 0!==r?r:"",state:null!==(o=null==n?void 0:n.state)&&void 0!==o?o:"",country:null!==(i=null==n?void 0:n.country)&&void 0!==i?i:"",postcode:null!==(a=null==n?void 0:n.postcode)&&void 0!==a?a:""},mandatoryBillingFields:{street1:!0,city:!0,state:!0,country:!0,postcode:!0}});var u=m.getGatewayCheckoutUrl("hyperpay",e),l=document.createElement("script");return l.src=u,l.async=!0,document.body.appendChild(l),function(){s.wpwlOptions=c,document.body.contains(l)&&document.body.removeChild(l)}}}),[e]),e?(0,b.jsx)("form",{action:r||window.location.href,className:"paymentWidgets","data-brands":"VISA MASTER AMEX"}):(0,b.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing HyperPay checkoutId"})},S=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("paypal",e);window.location.href=t}}),[e]),e?(0,b.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to PayPal secure checkout..."}):(0,b.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing PayPal approval URL."})},j=function(t){var e=t.clientSecret,r=t.publishableKey;return(0,i.useEffect)((function(){if(e&&r){var t=m.getGatewayCheckoutUrl("stripe"),n=document.createElement("script");return n.src=t,n.async=!0,n.onload=function(){console.log("Stripe JS loaded from:",t)},document.body.appendChild(n),function(){document.body.contains(n)&&document.body.removeChild(n)}}}),[e,r]),e&&r?(0,b.jsx)("div",{id:"stripe-checkout-container",className:"stripe-payment-container",children:(0,b.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Initializing Stripe Payment Elements..."})}):(0,b.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Stripe clientSecret or publishableKey"})},x=function(t){var e=t.checkoutId;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("meps",e),r=document.createElement("script");return r.src=t,r.async=!0,r.setAttribute("data-error","errorCallback"),r.setAttribute("data-cancel","cancelCallback"),document.body.appendChild(r),function(){document.body.contains(r)&&document.body.removeChild(r)}}}),[e]),e?(0,b.jsx)("div",{id:"embed-target",className:"meps-payment-container",children:(0,b.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Loading MEPS checkout session..."})}):(0,b.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing MEPS Checkout ID"})},P=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("network",e);window.location.href=t}}),[e]),e?(0,b.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to Network International payment page..."}):(0,b.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Network International payment URL."})};function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=C(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==C(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}var L=function(t){return t&&"object"===C(t)?t:void 0},_=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var n=0,o=e;n<o.length;n++){var i=o[n];if("string"==typeof i&&i.trim())return i.trim();if("number"==typeof i)return String(i)}return""},I=function(t){var e,r,n,o,i=L(null==t?void 0:t.user),a=null!==(e=L(null==t?void 0:t.billingAddress))&&void 0!==e?e:L(null==t?void 0:t.billing),s=(L(null==t?void 0:t.customer),null==i?void 0:i.city),c="object"===C(s)?_(null===(r=L(s))||void 0===r?void 0:r.name):_(s);return{street1:_(null==i?void 0:i.streetName,null==a?void 0:a.street1,null==a?void 0:a.street),city:_(c,null==a?void 0:a.city),state:_(null==a?void 0:a.state,c),country:_(null==i?void 0:i.countryIso2,null===(n=L(null===(o=L(s))||void 0===o?void 0:o.country))||void 0===n?void 0:n.nameIso2,null==a?void 0:a.country).toUpperCase(),postcode:_(null==i?void 0:i.postalCode,null==a?void 0:a.postcode,null==a?void 0:a.postalCode,null==a?void 0:a.zip)}},D={street1:"user.streetName",city:"user.city",state:"user.city",country:"user.countryIso2",postcode:"user.postalCode"},U=function(t){var e=I(t),r=Object.keys(e).filter((function(t){return!e[t]})).map((function(t){return D[t]}));return Array.from(new Set(r))};function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function B(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?B(Object(r),!0).forEach((function(e){q(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function q(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=F(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=F(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==F(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return G(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var H=function(t){return function(e){return e.trim()?null:"".concat(t," is required")}},W={"user.streetName":{key:"user.streetName",label:"Street address",placeholder:"Street and number",validate:H("Street address")},"user.city":{key:"user.city",label:"City",validate:H("City")},"user.countryIso2":{key:"user.countryIso2",label:"Country code",placeholder:"2-letter code, e.g. JO",validate:function(t){return/^[A-Za-z]{2}$/.test(t.trim())?null:"Enter a 2-letter country code, e.g. JO"}},"user.postalCode":{key:"user.postalCode",label:"Postal / ZIP code",validate:H("Postal / ZIP code")}},K={wrap:{width:"100%",maxWidth:420,fontFamily:"inherit"},steps:{display:"flex",gap:6,marginBottom:16},title:{fontSize:14,fontWeight:600,marginBottom:4},hint:{fontSize:12,color:"#64748b",marginBottom:12},input:{width:"100%",padding:"10px 12px",border:"1px solid #cbd5e1",borderRadius:8,fontSize:14,boxSizing:"border-box"},error:{color:"#dc2626",fontSize:12,marginTop:6},actions:{display:"flex",justifyContent:"space-between",marginTop:16},button:{padding:"9px 18px",borderRadius:8,border:"1px solid #cbd5e1",background:"#fff",cursor:"pointer",fontSize:14},primary:{padding:"9px 18px",borderRadius:8,border:"none",background:"#2563eb",color:"#fff",cursor:"pointer",fontSize:14}};const J=function(t){var e,r=t.fields,n=t.onComplete,o=r.map((function(t){return W[t]})).filter(Boolean),a=z((0,i.useState)(0),2),s=a[0],c=a[1],u=z((0,i.useState)({}),2),l=u[0],f=u[1],d=z((0,i.useState)(null),2),p=d[0],h=d[1],y=o[s];if(!y)return null;var m=s===o.length-1,v=null!==(e=l[y.key])&&void 0!==e?e:"";return(0,b.jsxs)("form",{className:"payment-sdk-billing",style:K.wrap,onSubmit:function(t){t.preventDefault();var e=y.validate(v);if(e)h(e);else if(h(null),m){var r={};o.forEach((function(t){var e,n=(null!==(e=l[t.key])&&void 0!==e?e:"").trim();r[t.key]="user.countryIso2"===t.key?n.toUpperCase():n})),n(r)}else c(s+1)},noValidate:!0,children:[(0,b.jsx)("div",{style:K.steps,role:"list","aria-label":"Billing details progress",children:o.map((function(t,e){return(0,b.jsx)("div",{role:"listitem","aria-current":e===s?"step":void 0,style:{flex:1,height:4,borderRadius:2,background:e<=s?"#2563eb":"#e2e8f0"}},t.key)}))}),(0,b.jsxs)("div",{style:K.title,children:["Billing details (",s+1," of ",o.length,")"]}),(0,b.jsx)("div",{style:K.hint,children:"Your payment provider needs this to process the card."}),(0,b.jsx)("label",{htmlFor:"billing-".concat(y.key),style:{display:"block",fontSize:13,marginBottom:6},children:y.label}),(0,b.jsx)("input",{id:"billing-".concat(y.key),style:K.input,value:v,placeholder:y.placeholder,autoFocus:!0,onChange:function(t){f(M(M({},l),{},q({},y.key,t.target.value))),h(null)}}),p&&(0,b.jsx)("div",{style:K.error,role:"alert",children:p}),(0,b.jsxs)("div",{style:K.actions,children:[(0,b.jsx)("button",{type:"button",style:M(M({},K.button),{},{visibility:0===s?"hidden":"visible"}),onClick:function(){h(null),c(s-1)},children:"Back"}),(0,b.jsx)("button",{type:"submit",style:K.primary,children:m?"Continue to payment":"Next"})]})]})};function V(t,e){return function(){return t.apply(e,arguments)}}const{toString:Y}=Object.prototype,{getPrototypeOf:$}=Object,X=(Z=Object.create(null),t=>{const e=Y.call(t);return Z[e]||(Z[e]=e.slice(8,-1).toLowerCase())});var Z;const Q=t=>(t=t.toLowerCase(),e=>X(e)===t),tt=t=>e=>typeof e===t,{isArray:et}=Array,rt=tt("undefined"),nt=Q("ArrayBuffer"),ot=tt("string"),it=tt("function"),at=tt("number"),st=t=>null!==t&&"object"==typeof t,ct=t=>{if("object"!==X(t))return!1;const e=$(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},ut=Q("Date"),lt=Q("File"),ft=Q("Blob"),dt=Q("FileList"),pt=Q("URLSearchParams"),[ht,yt,mt,bt]=["ReadableStream","Request","Response","Headers"].map(Q);function vt(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),et(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(n=0;n<i;n++)a=o[n],e.call(null,t[a],a,t)}}function gt(t,e){e=e.toLowerCase();const r=Object.keys(t);let n,o=r.length;for(;o-- >0;)if(n=r[o],e===n.toLowerCase())return n;return null}const wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ot=t=>!rt(t)&&t!==wt,Et=(St="undefined"!=typeof Uint8Array&&$(Uint8Array),t=>St&&t instanceof St);var St;const jt=Q("HTMLFormElement"),xt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Pt=Q("RegExp"),At=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};vt(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)},Rt="abcdefghijklmnopqrstuvwxyz",Tt="0123456789",Nt={DIGIT:Tt,ALPHA:Rt,ALPHA_DIGIT:Rt+Rt.toUpperCase()+Tt},kt=Q("AsyncFunction"),Ct=(Lt="function"==typeof setImmediate,_t=it(wt.postMessage),Lt?setImmediate:_t?(It=`axios@${Math.random()}`,Dt=[],wt.addEventListener("message",(({source:t,data:e})=>{t===wt&&e===It&&Dt.length&&Dt.shift()()}),!1),t=>{Dt.push(t),wt.postMessage(It,"*")}):t=>setTimeout(t));var Lt,_t,It,Dt;const Ut="undefined"!=typeof queueMicrotask?queueMicrotask.bind(wt):"undefined"!=typeof process&&process.nextTick||Ct,Ft={isArray:et,isArrayBuffer:nt,isBuffer:function(t){return null!==t&&!rt(t)&&null!==t.constructor&&!rt(t.constructor)&&it(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||it(t.append)&&("formdata"===(e=X(t))||"object"===e&&it(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&nt(t.buffer),e},isString:ot,isNumber:at,isBoolean:t=>!0===t||!1===t,isObject:st,isPlainObject:ct,isReadableStream:ht,isRequest:yt,isResponse:mt,isHeaders:bt,isUndefined:rt,isDate:ut,isFile:lt,isBlob:ft,isRegExp:Pt,isFunction:it,isStream:t=>st(t)&&it(t.pipe),isURLSearchParams:pt,isTypedArray:Et,isFileList:dt,forEach:vt,merge:function t(){const{caseless:e}=Ot(this)&&this||{},r={},n=(n,o)=>{const i=e&&gt(r,o)||o;ct(r[i])&&ct(n)?r[i]=t(r[i],n):ct(n)?r[i]=t({},n):et(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&vt(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(vt(e,((e,n)=>{r&&it(e)?t[n]=V(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,a;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],n&&!n(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==r&&$(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:X,kindOfTest:Q,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(et(t))return t;let e=t.length;if(!at(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:jt,hasOwnProperty:xt,hasOwnProp:xt,reduceDescriptors:At,freezeMethods:t=>{At(t,((e,r)=>{if(it(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];it(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return et(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:gt,global:wt,isContextDefined:Ot,ALPHABET:Nt,generateString:(t=16,e=Nt.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&it(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(st(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=et(t)?[]:{};return vt(t,((t,e)=>{const i=r(t,n+1);!rt(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:kt,isThenable:t=>t&&(st(t)||it(t))&&it(t.then)&&it(t.catch),setImmediate:Ct,asap:Ut};function Bt(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Ft.inherits(Bt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ft.toJSONObject(this.config),code:this.code,status:this.status}}});const Mt=Bt.prototype,qt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{qt[t]={value:t}})),Object.defineProperties(Bt,qt),Object.defineProperty(Mt,"isAxiosError",{value:!0}),Bt.from=(t,e,r,n,o,i)=>{const a=Object.create(Mt);return Ft.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),Bt.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const zt=Bt;function Gt(t){return Ft.isPlainObject(t)||Ft.isArray(t)}function Ht(t){return Ft.endsWith(t,"[]")?t.slice(0,-2):t}function Wt(t,e,r){return t?t.concat(e).map((function(t,e){return t=Ht(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const Kt=Ft.toFlatObject(Ft,{},null,(function(t){return/^is[A-Z]/.test(t)})),Jt=function(t,e,r){if(!Ft.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=Ft.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Ft.isUndefined(e[t])}))).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Ft.isSpecCompliantForm(e);if(!Ft.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(Ft.isDate(t))return t.toISOString();if(!s&&Ft.isBlob(t))throw new zt("Blob is not supported. Use a Buffer instead.");return Ft.isArrayBuffer(t)||Ft.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,r,o){let s=t;if(t&&!o&&"object"==typeof t)if(Ft.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(Ft.isArray(t)&&function(t){return Ft.isArray(t)&&!t.some(Gt)}(t)||(Ft.isFileList(t)||Ft.endsWith(r,"[]"))&&(s=Ft.toArray(t)))return r=Ht(r),s.forEach((function(t,n){!Ft.isUndefined(t)&&null!==t&&e.append(!0===a?Wt([r],n,i):null===a?r:r+"[]",c(t))})),!1;return!!Gt(t)||(e.append(Wt(o,r,i),c(t)),!1)}const l=[],f=Object.assign(Kt,{defaultVisitor:u,convertValue:c,isVisitable:Gt});if(!Ft.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!Ft.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),Ft.forEach(r,(function(r,i){!0===(!(Ft.isUndefined(r)||null===r)&&o.call(e,r,Ft.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function Vt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Yt(t,e){this._pairs=[],t&&Jt(t,this,e)}const $t=Yt.prototype;$t.append=function(t,e){this._pairs.push([t,e])},$t.toString=function(t){const e=t?function(e){return t.call(this,e,Vt)}:Vt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const Xt=Yt;function Zt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Qt(t,e,r){if(!e)return t;const n=r&&r.encode||Zt,o=r&&r.serialize;let i;if(i=o?o(e,r):Ft.isURLSearchParams(e)?e.toString():new Xt(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const te=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ft.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},ee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Xt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ne="undefined"!=typeof window&&"undefined"!=typeof document,oe="object"==typeof navigator&&navigator||void 0,ie=ne&&(!oe||["ReactNative","NativeScript","NS"].indexOf(oe.product)<0),ae="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,se=ne&&window.location.href||"http://localhost",ce={...o,...re},ue=function(t){function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=t.length;return i=!i&&Ft.isArray(n)?n.length:i,s?(Ft.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&Ft.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&Ft.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}(n[i])),!a)}if(Ft.isFormData(t)&&Ft.isFunction(t.entries)){const r={};return Ft.forEachEntry(t,((t,n)=>{e(function(t){return Ft.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},le={transitional:ee,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=Ft.isObject(t);if(o&&Ft.isHTMLForm(t)&&(t=new FormData(t)),Ft.isFormData(t))return n?JSON.stringify(ue(t)):t;if(Ft.isArrayBuffer(t)||Ft.isBuffer(t)||Ft.isStream(t)||Ft.isFile(t)||Ft.isBlob(t)||Ft.isReadableStream(t))return t;if(Ft.isArrayBufferView(t))return t.buffer;if(Ft.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Jt(t,new ce.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return ce.isNode&&Ft.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=Ft.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Jt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(Ft.isString(t))try{return(0,JSON.parse)(t),Ft.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||le.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(Ft.isResponse(t)||Ft.isReadableStream(t))return t;if(t&&Ft.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw zt.from(t,zt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ft.forEach(["delete","get","head","post","put","patch"],(t=>{le.headers[t]={}}));const fe=le,de=Ft.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pe=Symbol("internals");function he(t){return t&&String(t).trim().toLowerCase()}function ye(t){return!1===t||null==t?t:Ft.isArray(t)?t.map(ye):String(t)}function me(t,e,r,n,o){return Ft.isFunction(n)?n.call(this,e,r):(o&&(e=r),Ft.isString(e)?Ft.isString(n)?-1!==e.indexOf(n):Ft.isRegExp(n)?n.test(e):void 0:void 0)}class be{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=he(e);if(!o)throw new Error("header name must be a non-empty string");const i=Ft.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=ye(t))}const i=(t,e)=>Ft.forEach(t,((t,r)=>o(t,r,e)));if(Ft.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(Ft.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&de[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e);else if(Ft.isHeaders(t))for(const[e,n]of t.entries())o(n,e,r);else null!=t&&o(e,t,r);return this}get(t,e){if(t=he(t)){const r=Ft.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(Ft.isFunction(e))return e.call(this,t,r);if(Ft.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=he(t)){const r=Ft.findKey(this,t);return!(!r||void 0===this[r]||e&&!me(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=he(t)){const o=Ft.findKey(r,t);!o||e&&!me(0,r[o],o,e)||(delete r[o],n=!0)}}return Ft.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!me(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return Ft.forEach(this,((n,o)=>{const i=Ft.findKey(r,o);if(i)return e[i]=ye(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete e[o],e[a]=ye(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Ft.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&Ft.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[pe]=this[pe]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=he(t);e[n]||(function(t,e){const r=Ft.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return Ft.isArray(t)?t.forEach(n):n(t),this}}be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ft.reduceDescriptors(be.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),Ft.freezeMethods(be);const ve=be;function ge(t,e){const r=this||fe,n=e||r,o=ve.from(n.headers);let i=n.data;return Ft.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function we(t){return!(!t||!t.__CANCEL__)}function Oe(t,e,r){zt.call(this,null==t?"canceled":t,zt.ERR_CANCELED,e,r),this.name="CanceledError"}Ft.inherits(Oe,zt,{__CANCEL__:!0});const Ee=Oe;function Se(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new zt("Request failed with status code "+r.status,[zt.ERR_BAD_REQUEST,zt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const je=(t,e,r=3)=>{let n=0;const o=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),u=n[a];o||(o=c),r[i]=s,n[i]=c;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o<e)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(t,e){let r,n,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),s=e-o;s>=i?a(t,e):(r=t,n||(n=setTimeout((()=>{n=null,a(r)}),i-s)))},()=>r&&a(r)]}((r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=i,t({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:r,lengthComputable:null!=a,[e?"download":"upload"]:!0})}),r)},xe=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Pe=t=>(...e)=>Ft.asap((()=>t(...e))),Ae=ce.hasStandardBrowserEnv?function(){const t=ce.navigator&&/(msie|trident)/i.test(ce.navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=Ft.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0},Re=ce.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const a=[t+"="+encodeURIComponent(e)];Ft.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),Ft.isString(n)&&a.push("path="+n),Ft.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Te(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Ne=t=>t instanceof ve?{...t}:t;function ke(t,e){e=e||{};const r={};function n(t,e,r){return Ft.isPlainObject(t)&&Ft.isPlainObject(e)?Ft.merge.call({caseless:r},t,e):Ft.isPlainObject(e)?Ft.merge({},e):Ft.isArray(e)?e.slice():e}function o(t,e,r){return Ft.isUndefined(e)?Ft.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!Ft.isUndefined(e))return n(void 0,e)}function a(t,e){return Ft.isUndefined(e)?Ft.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function s(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>o(Ne(t),Ne(e),!0)};return Ft.forEach(Object.keys(Object.assign({},t,e)),(function(n){const i=c[n]||o,a=i(t[n],e[n],n);Ft.isUndefined(a)&&i!==s||(r[n]=a)})),r}const Ce=t=>{const e=ke({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=e;if(e.headers=s=ve.from(s),e.url=Qt(Te(e.baseURL,e.url),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Ft.isFormData(n))if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(r=s.getContentType())){const[t,...e]=r?r.split(";").map((t=>t.trim())).filter(Boolean):[];s.setContentType([t||"multipart/form-data",...e].join("; "))}if(ce.hasStandardBrowserEnv&&(o&&Ft.isFunction(o)&&(o=o(e)),o||!1!==o&&Ae(e.url))){const t=i&&a&&Re.read(a);t&&s.set(i,t)}return e},Le="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=Ce(t);let o=n.data;const i=ve.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=n;function h(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=ve.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Se((function(t){e(t),h()}),(function(t){r(t),h()}),{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:t,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new zt("Request aborted",zt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new zt("Network Error",zt.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ee;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new zt(e,o.clarifyTimeoutError?zt.ETIMEDOUT:zt.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&Ft.forEach(i.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),Ft.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),f&&"json"!==f&&(y.responseType=n.responseType),p&&([c,l]=je(p,!0),y.addEventListener("progress",c)),d&&y.upload&&([s,u]=je(d),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=e=>{y&&(r(!e||e.type?new Ee(null,t,y):e),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const b=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);b&&-1===ce.protocols.indexOf(b)?r(new zt("Unsupported protocol "+b+":",zt.ERR_BAD_REQUEST,t)):y.send(o||null)}))},_e=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const o=function(t){if(!r){r=!0,a();const e=t instanceof Error?t:this.reason;n.abort(e instanceof zt?e:new Ee(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new zt(`timeout ${e} of ms exceeded`,zt.ETIMEDOUT))}),e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:s}=n;return s.unsubscribe=()=>Ft.asap(a),s}},Ie=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,o=0;for(;o<r;)n=o+e,yield t.slice(o,n),o=n},De=(t,e,r,n)=>{const o=async function*(t,e){for await(const r of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}}(t))yield*Ie(r,e)}(t,e);let i,a=0,s=t=>{i||(i=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await o.next();if(e)return s(),void t.close();let i=n.byteLength;if(r){let t=a+=i;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw s(t),t}},cancel:t=>(s(t),o.return())},{highWaterMark:2})},Ue="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Fe=Ue&&"function"==typeof ReadableStream,Be=Ue&&("function"==typeof TextEncoder?(Me=new TextEncoder,t=>Me.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var Me;const qe=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ze=Fe&&qe((()=>{let t=!1;const e=new Request(ce.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Ge=Fe&&qe((()=>Ft.isReadableStream(new Response("").body))),He={stream:Ge&&(t=>t.body)};var We;Ue&&(We=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!He[t]&&(He[t]=Ft.isFunction(We[t])?e=>e[t]():(e,r)=>{throw new zt(`Response type '${t}' is not supported`,zt.ERR_NOT_SUPPORT,r)})})));const Ke=Ue&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:d}=Ce(t);u=u?(u+"").toLowerCase():"text";let p,h=_e([o,i&&i.toAbortSignal()],a);const y=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&ze&&"get"!==r&&"head"!==r&&0!==(m=await(async(t,e)=>{const r=Ft.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(Ft.isBlob(t))return t.size;if(Ft.isSpecCompliantForm(t)){const e=new Request(ce.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Ft.isArrayBufferView(t)||Ft.isArrayBuffer(t)?t.byteLength:(Ft.isURLSearchParams(t)&&(t+=""),Ft.isString(t)?(await Be(t)).byteLength:void 0)})(e):r})(l,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(Ft.isFormData(n)&&(t=r.headers.get("content-type"))&&l.setContentType(t),r.body){const[t,e]=xe(m,je(Pe(c)));n=De(r.body,65536,t,e)}}Ft.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:o?f:void 0});let i=await fetch(p);const a=Ge&&("stream"===u||"response"===u);if(Ge&&(s||a&&y)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=Ft.toFiniteNumber(i.headers.get("content-length")),[r,n]=s&&xe(e,je(Pe(s),!0))||[];i=new Response(De(i.body,65536,r,(()=>{n&&n(),y&&y()})),t)}u=u||"text";let b=await He[Ft.findKey(He,u)||"text"](i,t);return!a&&y&&y(),await new Promise(((e,r)=>{Se(e,r,{data:b,headers:ve.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:p})}))}catch(e){if(y&&y(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new zt("Network Error",zt.ERR_NETWORK,t,p),{cause:e.cause||e});throw zt.from(e,e&&e.code,t,p)}}),Je={http:null,xhr:Le,fetch:Ke};Ft.forEach(Je,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Ve=t=>`- ${t}`,Ye=t=>Ft.isFunction(t)||null===t||!1===t,$e=t=>{t=Ft.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){let e;if(r=t[i],n=r,!Ye(r)&&(n=Je[(e=String(r)).toLowerCase()],void 0===n))throw new zt(`Unknown adapter '${e}'`);if(n)break;o[e||"#"+i]=n}if(!n){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let r=e?t.length>1?"since :\n"+t.map(Ve).join("\n"):" "+Ve(t[0]):"as no adapter specified";throw new zt("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function Xe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ee(null,t)}function Ze(t){return Xe(t),t.headers=ve.from(t.headers),t.data=ge.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),$e(t.adapter||fe.adapter)(t).then((function(e){return Xe(t),e.data=ge.call(t,t.transformResponse,e),e.headers=ve.from(e.headers),e}),(function(e){return we(e)||(Xe(t),e&&e.response&&(e.response.data=ge.call(t,t.transformResponse,e.response),e.response.headers=ve.from(e.response.headers))),Promise.reject(e)}))}const Qe={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Qe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const tr={};Qe.transitional=function(t,e,r){function n(t,e){return"[Axios v1.7.7] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new zt(n(o," has been removed"+(e?" in "+e:"")),zt.ERR_DEPRECATED);return e&&!tr[o]&&(tr[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}};const er={assertOptions:function(t,e,r){if("object"!=typeof t)throw new zt("options must be an object",zt.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],a=e[i];if(a){const e=t[i],r=void 0===e||a(e,i,t);if(!0!==r)throw new zt("option "+i+" must be "+r,zt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new zt("Unknown option "+i,zt.ERR_BAD_OPTION)}},validators:Qe},rr=er.validators;class nr{constructor(t){this.defaults=t,this.interceptors={request:new te,response:new te}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=ke(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&er.assertOptions(r,{silentJSONParsing:rr.transitional(rr.boolean),forcedJSONParsing:rr.transitional(rr.boolean),clarifyTimeoutError:rr.transitional(rr.boolean)},!1),null!=n&&(Ft.isFunction(n)?e.paramsSerializer={serialize:n}:er.assertOptions(n,{encode:rr.function,serialize:rr.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&Ft.merge(o.common,o[e.method]);o&&Ft.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=ve.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,f=0;if(!s){const t=[Ze.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);f<l;)u=u.then(t[f++],t[f++]);return u}l=a.length;let d=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Ze.call(this,d)}catch(t){return Promise.reject(t)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(t){return Qt(Te((t=ke(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}Ft.forEach(["delete","get","head","options"],(function(t){nr.prototype[t]=function(e,r){return this.request(ke(r||{},{method:t,url:e,data:(r||{}).data}))}})),Ft.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,o){return this.request(ke(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}nr.prototype[t]=e(),nr.prototype[t+"Form"]=e(!0)}));const or=nr;class ir{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const r=this;this.promise.then((t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new Ee(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ir((function(e){t=e})),cancel:t}}}const ar=ir,sr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(sr).forEach((([t,e])=>{sr[e]=t}));const cr=sr,ur=function t(e){const r=new or(e),n=V(or.prototype.request,r);return Ft.extend(n,or.prototype,r,{allOwnKeys:!0}),Ft.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(ke(e,r))},n}(fe);function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function fr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fr(Object(r),!0).forEach((function(e){pr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function pr(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=lr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lr(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hr(){hr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new N(n||[]);return o(a,"_invoke",{value:P(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function b(){}function v(){}function g(){}var w={};u(w,a,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(k([])));E&&E!==r&&n.call(E,a)&&(w=E);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==lr(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=A(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function k(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(lr(e)+" is not iterable")}return v.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=u(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(x.prototype),u(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function yr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function mr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){yr(i,n,o,a,s,"next",t)}function s(t){yr(i,n,o,a,s,"throw",t)}a(void 0)}))}}ur.Axios=or,ur.CanceledError=Ee,ur.CancelToken=ar,ur.isCancel=we,ur.VERSION="1.7.7",ur.toFormData=Jt,ur.AxiosError=zt,ur.Cancel=ur.CanceledError,ur.all=function(t){return Promise.all(t)},ur.spread=function(t){return function(e){return t.apply(null,e)}},ur.isAxiosError=function(t){return Ft.isObject(t)&&!0===t.isAxiosError},ur.mergeConfig=ke,ur.AxiosHeaders=ve,ur.formToJSON=t=>ue(Ft.isHTMLForm(t)?new FormData(t):t),ur.getAdapter=$e,ur.HttpStatusCode=cr,ur.default=ur;var br=ur.create({baseURL:m.BACKEND_DOMAIN,headers:{"Content-Type":"application/json"},timeout:15e3});const vr={createOrder:function(){var t=mr(hr().mark((function t(e){var r,n,o,i,a;return hr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.entityId,n=e.appId,o=e.order,i=e.redirectUrl,t.next=3,br.post("/orders",{entityId:r,appId:n,order:o,redirectUrl:i});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),verifyOrderStatus:function(){var t=mr(hr().mark((function t(e){var r,n,o,i,a;return hr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,br.get("/orders/".concat(encodeURIComponent(o)),{params:dr({entityId:n,appId:r},i?{resourcePath:i}:{})});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};function gr(){gr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new N(n||[]);return o(a,"_invoke",{value:P(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function b(){}function v(){}function g(){}var w={};u(w,a,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(k([])));E&&E!==r&&n.call(E,a)&&(w=E);var S=g.prototype=b.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==wr(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=A(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function k(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(wr(e)+" is not iterable")}return v.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=u(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},j(x.prototype),u(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function wr(t){return wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wr(t)}function Or(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Er(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Or(i,n,o,a,s,"next",t)}function s(t){Or(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Sr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return jr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var xr={hyperpay:function(t){var e=t.orderData,r=t.order,n=t.redirectUrl,o=t.onChange;return(0,b.jsx)(E,{checkoutId:e.checkoutId,billing:I(r),redirectUrl:n,onChange:o})},paypal:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(S,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})},stripe:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(j,{clientSecret:e.clientSecret,publishableKey:e.publishableKey,redirectUrl:r,onChange:n})},meps:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(x,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},network:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,b.jsx)(P,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})}},Pr=function(t,e){xr[t]=e},Ar=function(t){var e=t.entityId,r=void 0===e?null:e,n=t.appId,o=void 0===n?null:n,a=t.order,s=void 0===a?null:a,c=t.redirectUrl,u=void 0===c?"":c,l=t.onChange,f=Sr((0,i.useState)(!1),2),d=f[0],p=f[1],h=Sr((0,i.useState)(null),2),y=h[0],m=h[1],v=Sr((0,i.useState)(null),2),g=v[0],w=v[1],O=Sr((0,i.useState)({}),2),E=O[0],S=O[1],j=(0,i.useRef)(l);j.current=l;var x=(0,i.useRef)(null),P=(0,i.useRef)(!0),A=s&&r&&o?JSON.stringify([r,o,u,s]):null;if((0,i.useEffect)((function(){return P.current=!0,function(){P.current=!1}}),[]),(0,i.useEffect)((function(){if(s&&r&&o&&A&&x.current!==A){x.current=A;var t=function(){return P.current&&x.current===A},e=function(){var e=Er(gr().mark((function e(){var n,i,a,c,l,f,d,h,y;return gr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p(!0),m(null),w(null),S({}),e.next=7,vr.createOrder({entityId:r,appId:o,order:s,redirectUrl:u});case 7:n=e.sent,t()&&"hyperpay"===n.provider&&(i=U(s)).length&&(null===(a=j.current)||void 0===a||a.call(j,{status:"billing_required",fields:i})),t()&&(w(n),null===(c=j.current)||void 0===c||c.call(j,{status:"order_created",provider:n.provider,data:n})),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),console.error("Order creation error:",e.t0),t()&&(d=null===e.t0||void 0===e.t0||null===(l=e.t0.response)||void 0===l?void 0:l.data,h=(null==d?void 0:d.message)||(null==d?void 0:d.error)||(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to initiate payment order.",y=null==d?void 0:d.code,m({message:h,code:y}),null===(f=j.current)||void 0===f||f.call(j,d&&"object"===wr(d)?d:{success:!1,error:h,code:y}));case 16:return e.prev=16,t()&&p(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,12,16,19]])})));return function(){return e.apply(this,arguments)}}();e()}}),[A]),d)return i.default.createElement("div",{className:"payment-sdk-loading"},"Initializing payment...");if(y)return i.default.createElement("div",{className:"payment-sdk-error",role:"alert","data-code":y.code},y.message);if(null!=g&&g.provider&&xr[g.provider]){var T=xr[g.provider],k=function(t,e){var r;if(!t)return null;var n=Object.entries(e).filter((function(t){return N(t,1)[0].startsWith("user.")}));if(!n.length)return t;var o=R({},null!==(r=L(t.user))&&void 0!==r?r:{});return n.forEach((function(t){var e=N(t,2),r=e[0],n=e[1];o[r.slice(5)]=n})),R(R({},t),{},{user:o})}(s,E);if("hyperpay"===g.provider){var C=U(k);if(C.length)return(0,b.jsx)(J,{fields:C,onComplete:function(t){S(t),null==l||l({status:"billing_completed",fields:Object.keys(t)})}})}return T({orderData:g,order:k,redirectUrl:u,onChange:l})}return null},Rr=function(){var t=Er(gr().mark((function t(e){var r,n,o,i;return gr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,vr.verifyOrderStatus({appId:r,entityId:n,checkoutId:o,resourcePath:i});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Tr=n.qT,Nr=n.Rb,kr=n.IZ;export{Tr as PymentOrder,Nr as registerPaymentProvider,kr as verifyOrder};
@@ -6,6 +6,8 @@ import type { HyperpayBilling, OrderObject } from "@/types";
6
6
  * widget asks the shopper for them.
7
7
  */
8
8
  export declare const getHyperpayBilling: (order?: OrderObject | null) => HyperpayBilling;
9
+ /** Copy values keyed by order field (e.g. "user.postalCode") into order.user. */
10
+ export declare const withBillingValues: (order: OrderObject | null | undefined, values: Record<string, string>) => OrderObject | null;
9
11
  /** Order fields HyperPay needs that the order did not provide. Empty when complete. */
10
12
  export declare const getMissingBillingFields: (order?: OrderObject | null) => string[];
11
13
  //# sourceMappingURL=billing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../../src/hyperpay/billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAe5D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,WAAW,GAAG,IAAI,KAAG,eAc/D,CAAC;AAWF,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,WAAW,GAAG,IAAI,KAAG,MAAM,EAM1E,CAAC"}
1
+ {"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../../src/hyperpay/billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAe5D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,WAAW,GAAG,IAAI,KAAG,eAc/D,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,GAC1B,OAAO,WAAW,GAAG,IAAI,GAAG,SAAS,EACrC,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC/B,WAAW,GAAG,IAShB,CAAC;AAWF,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,WAAW,GAAG,IAAI,KAAG,MAAM,EAM1E,CAAC"}
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ export interface BillingFieldSpec {
3
+ key: string;
4
+ label: string;
5
+ placeholder?: string;
6
+ validate: (value: string) => string | null;
7
+ }
8
+ export declare const BILLING_FIELD_SPECS: Record<string, BillingFieldSpec>;
9
+ interface BillingStepperProps {
10
+ fields: string[];
11
+ onComplete: (values: Record<string, string>) => void;
12
+ }
13
+ declare const BillingStepper: React.FC<BillingStepperProps>;
14
+ export default BillingStepper;
15
+ //# sourceMappingURL=billingStepper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billingStepper.d.ts","sourceRoot":"","sources":["../../../src/hyperpay/billingStepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC9C;AAID,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAuBhE,CAAC;AAEF,UAAU,mBAAmB;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CACxD;AAcD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAkFjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a-tech.jo/atech_payment",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "type": "module",
5
5
  "description": "A-Tech Payment React Package",
6
6
  "main": "./dist/index.js",