marlim-sdk-3ds 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ import * as MarlimSDK_3DS from 'marlim-sdk-3ds';
|
|
|
44
44
|
|
|
45
45
|
try {
|
|
46
46
|
// Etapa 2: Autenticação 3DS
|
|
47
|
-
const result = await MarlimSDK_3DS.
|
|
47
|
+
const result = await MarlimSDK_3DS.authenticate({
|
|
48
48
|
amount: 1000, // Valor em centavos
|
|
49
49
|
card: {
|
|
50
50
|
number: '1111111111111111',
|
|
@@ -103,26 +103,22 @@ MarlimSDK_3DS.init({
|
|
|
103
103
|
});
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
### `
|
|
106
|
+
### `authenticate(params: ThreedsAuthenticateParams): Promise<AuthenticationResult>`
|
|
107
107
|
|
|
108
108
|
Executa o fluxo completo de autenticação 3DS.
|
|
109
109
|
|
|
110
110
|
**Estrutura de dados:**
|
|
111
111
|
|
|
112
112
|
```typescript
|
|
113
|
+
type CardHash = string;
|
|
114
|
+
|
|
113
115
|
type CardData = {
|
|
114
116
|
number: string;
|
|
115
117
|
expirationDate: string;
|
|
116
118
|
cvv: string;
|
|
117
119
|
holderName: string;
|
|
118
120
|
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
```typescript
|
|
122
|
-
type CardHash = string;
|
|
123
|
-
```
|
|
124
121
|
|
|
125
|
-
```typescript
|
|
126
122
|
type CustomerData = {
|
|
127
123
|
name: string;
|
|
128
124
|
documentNumber: string;
|
|
@@ -161,7 +157,7 @@ type CustomerData = {
|
|
|
161
157
|
**Exemplo:**
|
|
162
158
|
|
|
163
159
|
```typescript
|
|
164
|
-
await MarlimSDK_3DS.
|
|
160
|
+
await MarlimSDK_3DS.authenticate({
|
|
165
161
|
amount: 1000,
|
|
166
162
|
card: {
|
|
167
163
|
number: '1111111111111111',
|
|
@@ -171,7 +167,7 @@ await MarlimSDK_3DS.authenticate3DS({
|
|
|
171
167
|
},
|
|
172
168
|
customer: {
|
|
173
169
|
name: 'Jose Silva',
|
|
174
|
-
documentNumber: '
|
|
170
|
+
documentNumber: '99999999999',
|
|
175
171
|
email: 'joao.silva@example.com',
|
|
176
172
|
phone: {
|
|
177
173
|
number: '999999999',
|
package/dist/main.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SetupParams } from './validations/setup-params-validation';
|
|
2
|
+
import { ThreedsAuthenticateParams, ThreedsAuthenticateResult } from './validations/threeds-authenticate-validation';
|
|
2
3
|
|
|
3
4
|
export declare function init(params: SetupParams): void;
|
|
4
|
-
export declare function authenticate(params:
|
|
5
|
+
export declare function authenticate(params: ThreedsAuthenticateParams): Promise<ThreedsAuthenticateResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var MarlimSDK_3DS=function(e){"use strict";var t=Object.defineProperty,n=(e,n,r)=>((e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r)(e,"symbol"!=typeof n?n+"":n,r);function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:s,toStringTag:a}=Symbol,c=(e=>t=>{const n=o.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),u=e=>(e=e.toLowerCase(),t=>c(t)===e),l=e=>t=>typeof t===e,{isArray:d}=Array,f=l("undefined");function p(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const h=u("ArrayBuffer");const m=l("string"),g=l("function"),v=l("number"),y=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==c(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||s in e)},w=u("Date"),_=u("File"),E=u("Blob"),z=u("FileList"),k=u("URLSearchParams"),[O,x,S,A]=["ReadableStream","Request","Response","Headers"].map(u);function T(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(p(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function R(e,t){if(p(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,P=e=>!f(e)&&e!==N;const $=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&i(Uint8Array)),j=u("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),I=u("RegExp"),Z=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};T(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const F=u("AsyncFunction"),U=(D="function"==typeof setImmediate,L=g(N.postMessage),D?setImmediate:L?(B=`axios@${Math.random()}`,M=[],N.addEventListener("message",({source:e,data:t})=>{e===N&&t===B&&M.length&&M.shift()()},!1),e=>{M.push(e),N.postMessage(B,"*")}):e=>setTimeout(e));var D,L,B,M;const q="undefined"!=typeof queueMicrotask?queueMicrotask.bind(N):"undefined"!=typeof process&&process.nextTick||U,V={isArray:d,isArrayBuffer:h,isBuffer:p,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=c(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:m,isNumber:v,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:b,isEmptyObject:e=>{if(!y(e)||p(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:O,isRequest:x,isResponse:S,isHeaders:A,isUndefined:f,isDate:w,isFile:_,isBlob:E,isRegExp:I,isFunction:g,isStream:e=>y(e)&&g(e.pipe),isURLSearchParams:k,isTypedArray:$,isFileList:z,forEach:T,merge:function e(){const{caseless:t,skipUndefined:n}=P(this)&&this||{},r={},o=(o,i)=>{const s=t&&R(r,i)||i;b(r[s])&&b(o)?r[s]=e(r[s],o):b(o)?r[s]=e({},o):d(o)?r[s]=o.slice():n&&f(o)||(r[s]=o)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&T(arguments[i],o);return r},extend:(e,t,n,{allOwnKeys:o}={})=>(T(t,(t,o)=>{n&&g(t)?e[o]=r(t,n):e[o]=t},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!v(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[s]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:Z,freezeMethods:e=>{Z(e,(t,n)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];g(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:R,global:N,isContextDefined:P,isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[a]&&e[s])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(p(e))return e;if(!("toJSON"in e)){t[r]=e;const o=d(e)?[]:{};return T(e,(e,t)=>{const i=n(e,r+1);!f(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:F,isThenable:e=>e&&(y(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:U,asap:q,isIterable:e=>null!=e&&g(e[s])};function W(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}V.inherits(W,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:V.toJSONObject(this.config),code:this.code,status:this.status}}});const J=W.prototype,H={};["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(e=>{H[e]={value:e}}),Object.defineProperties(W,H),Object.defineProperty(J,"isAxiosError",{value:!0}),W.from=(e,t,n,r,o,i)=>{const s=Object.create(J);V.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return W.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};function K(e){return V.isPlainObject(e)||V.isArray(e)}function G(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function X(e,t,n){return e?e.concat(t).map(function(e,t){return e=G(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Y=V.toFlatObject(V,{},null,function(e){return/^is[A-Z]/.test(e)});function Q(e,t,n){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!V.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(V.isBoolean(e))return e.toString();if(!a&&V.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(V.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(K)}(e)||(V.isFileList(e)||V.endsWith(n,"[]"))&&(a=V.toArray(e)))return n=G(n),a.forEach(function(e,r){!V.isUndefined(e)&&null!==e&&t.append(!0===s?X([n],r,i):null===s?n:n+"[]",c(e))}),!1;return!!K(e)||(t.append(X(o,n,i),c(e)),!1)}const l=[],d=Object.assign(Y,{defaultVisitor:u,convertValue:c,isVisitable:K});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!V.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),V.forEach(n,function(n,i){!0===(!(V.isUndefined(n)||null===n)&&o.call(t,n,V.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t}function ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function te(e,t){this._pairs=[],e&&Q(e,this,t)}const ne=te.prototype;function re(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oe(e,t,n){if(!t)return e;const r=n&&n.encode||re;V.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):V.isURLSearchParams(t)?t.toString():new te(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}ne.append=function(e,t){this._pairs.push([e,t])},ne.toString=function(e){const t=e?function(t){return e.call(this,t,ee)}:ee;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ie{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,function(t){null!==t&&e(t)})}}const se={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ae={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:te,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ce="undefined"!=typeof window&&"undefined"!=typeof document,ue="object"==typeof navigator&&navigator||void 0,le=ce&&(!ue||["ReactNative","NativeScript","NS"].indexOf(ue.product)<0),de="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fe=ce&&window.location.href||"http://localhost",pe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ce,hasStandardBrowserEnv:le,hasStandardBrowserWebWorkerEnv:de,navigator:ue,origin:fe},Symbol.toStringTag,{value:"Module"})),...ae};function he(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&V.isArray(r)?r.length:i,a)return V.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&V.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&V.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(V.isFormData(e)&&V.isFunction(e.entries)){const n={};return V.forEachEntry(e,(e,r)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const me={transitional:se,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=V.isObject(e);o&&V.isHTMLForm(e)&&(e=new FormData(e));if(V.isFormData(e))return r?JSON.stringify(he(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Q(e,new pe.classes.URLSearchParams,{visitor:function(e,t,n,r){return pe.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=V.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Q(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||me.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(o){if(n){if("SyntaxError"===o.name)throw W.from(o,W.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pe.classes.FormData,Blob:pe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],e=>{me.headers[e]={}});const ge=V.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"]),ve=Symbol("internals");function ye(e){return e&&String(e).trim().toLowerCase()}function be(e){return!1===e||null==e?e:V.isArray(e)?e.map(be):String(e)}function we(e,t,n,r,o){return V.isFunction(r)?r.call(this,t,n):(o&&(t=n),V.isString(t)?V.isString(r)?-1!==t.indexOf(r):V.isRegExp(r)?r.test(t):void 0:void 0)}let _e=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ye(t);if(!o)throw new Error("header name must be a non-empty string");const i=V.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=be(e))}const i=(e,t)=>V.forEach(e,(e,n)=>o(e,n,t));if(V.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&ge[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(V.isObject(e)&&V.isIterable(e)){let n,r,o={};for(const t of e){if(!V.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?V.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ye(e)){const n=V.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(V.isFunction(t))return t.call(this,e,n);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ye(e)){const n=V.findKey(this,e);return!(!n||void 0===this[n]||t&&!we(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ye(e)){const o=V.findKey(n,e);!o||t&&!we(0,n[o],o,t)||(delete n[o],r=!0)}}return V.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!we(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return V.forEach(this,(r,o)=>{const i=V.findKey(n,o);if(i)return t[i]=be(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=be(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&V.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ve]=this[ve]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ye(e);t[r]||(!function(e,t){const n=V.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}};function Ee(e,t){const n=this||me,r=t||n,o=_e.from(r.headers);let i=r.data;return V.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ze(e){return!(!e||!e.__CANCEL__)}function ke(e,t,n){W.call(this,null==e?"canceled":e,W.ERR_CANCELED,t,n),this.name="CanceledError"}function Oe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new W("Request failed with status code "+n.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(_e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),V.freezeMethods(_e),V.inherits(ke,W,{__CANCEL__:!0});const xe=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n)]}(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Se=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ae=e=>(...t)=>V.asap(()=>e(...t)),Te=pe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,pe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(pe.origin),pe.navigator&&/(msie|trident)/i.test(pe.navigator.userAgent)):()=>!0,Re=pe.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];V.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),V.isString(r)&&s.push("path="+r),V.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ne(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Pe=e=>e instanceof _e?{...e}:e;function $e(e,t){t=t||{};const n={};function r(e,t,n,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function o(e,t,n,o){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!V.isUndefined(t))return r(void 0,t)}function s(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(Pe(e),Pe(t),0,!0)};return V.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,s=i(e[r],t[r],r);V.isUndefined(s)&&i!==a||(n[r]=s)}),n}const je=e=>{const t=$e({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=_e.from(s),t.url=oe(Ne(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),V.isFormData(n))if(pe.hasStandardBrowserEnv||pe.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(V.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(pe.hasStandardBrowserEnv&&(r&&V.isFunction(r)&&(r=r(t)),r||!1!==r&&Te(t.url))){const e=o&&i&&Re.read(i);e&&s.set(o,e)}return t},Ce="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=je(e);let o=r.data;const i=_e.from(r.headers).normalize();let s,a,c,u,l,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=_e.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Oe(function(e){t(e),h()},function(e){n(e),h()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new W("Request aborted",W.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new W(t&&t.message?t.message:"Network Error",W.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||se;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new W(t,o.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&V.forEach(i.toJSON(),function(e,t){m.setRequestHeader(t,e)}),V.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([c,l]=xe(p,!0),m.addEventListener("progress",c)),f&&m.upload&&([a,u]=xe(f),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{m&&(n(!t||t.type?new ke(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);v&&-1===pe.protocols.indexOf(v)?n(new W("Unsupported protocol "+v+":",W.ERR_BAD_REQUEST,e)):m.send(o||null)})},Ie=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof W?t:new ke(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new W(`timeout ${t} of ms exceeded`,W.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>V.asap(s),a}},Ze=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Fe=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Ue=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Fe(e))yield*Ze(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:De}=V,Le=(({Request:e,Response:t})=>({Request:e,Response:t}))(V.global),{ReadableStream:Be,TextEncoder:Me}=V.global,qe=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},Ve=e=>{e=V.merge.call({skipUndefined:!0},Le,e);const{fetch:t,Request:n,Response:r}=e,o=t?De(t):"function"==typeof fetch,i=De(n),s=De(r);if(!o)return!1;const a=o&&De(Be),c=o&&("function"==typeof Me?(e=>t=>e.encode(t))(new Me):async e=>new Uint8Array(await new n(e).arrayBuffer())),u=i&&a&&qe(()=>{let e=!1;const t=new n(pe.origin,{body:new Be,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),l=s&&a&&qe(()=>V.isReadableStream(new r("").body)),d={stream:l&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new W(`Response type '${e}' is not supported`,W.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=V.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new n(pe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:p,timeout:h,onDownloadProgress:m,onUploadProgress:g,responseType:v,headers:y,withCredentials:b="same-origin",fetchOptions:w}=je(e),_=t||fetch;v=v?(v+"").toLowerCase():"text";let E=Ie([c,p&&p.toAbortSignal()],h),z=null;const k=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let O;try{if(g&&u&&"get"!==s&&"head"!==s&&0!==(O=await f(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(V.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Se(O,xe(Ae(g)));a=Ue(t.body,65536,e,n)}}V.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in n.prototype,c={...w,signal:E,method:s.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};z=i&&new n(o,c);let p=await(i?_(z,w):_(o,c));const h=l&&("stream"===v||"response"===v);if(l&&(m||h&&k)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});const t=V.toFiniteNumber(p.headers.get("content-length")),[n,o]=m&&Se(t,xe(Ae(m),!0))||[];p=new r(Ue(p.body,65536,n,()=>{o&&o(),k&&k()}),e)}v=v||"text";let x=await d[V.findKey(d,v)||"text"](p,e);return!h&&k&&k(),await new Promise((t,n)=>{Oe(t,n,{data:x,headers:_e.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:z})})}catch(x){if(k&&k(),x&&"TypeError"===x.name&&/Load failed|fetch/i.test(x.message))throw Object.assign(new W("Network Error",W.ERR_NETWORK,e,z),{cause:x.cause||x});throw W.from(x,x&&x.code,e,z)}}},We=new Map,Je=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,u=We;for(;c--;)s=i[c],a=u.get(s),void 0===a&&u.set(s,a=c?new Map:Ve(t)),u=a;return a};Je();const He={http:null,xhr:Ce,fetch:{get:Je}};V.forEach(He,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const Ke=e=>`- ${e}`,Ge=e=>V.isFunction(e)||null===e||!1===e,Xe=(e,t)=>{e=V.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!Ge(r)&&(o=He[(n=String(r)).toLowerCase()],void 0===o))throw new W(`Unknown adapter '${n}'`);if(o&&(V.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new W("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ke).join("\n"):" "+Ke(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function Ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ke(null,e)}function Qe(e){Ye(e),e.headers=_e.from(e.headers),e.data=Ee.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Xe(e.adapter||me.adapter,e)(e).then(function(t){return Ye(e),t.data=Ee.call(e,e.transformResponse,t),t.headers=_e.from(t.headers),t},function(t){return ze(t)||(Ye(e),t&&t.response&&(t.response.data=Ee.call(e,e.transformResponse,t.response),t.response.headers=_e.from(t.response.headers))),Promise.reject(t)})}const et="1.12.2",tt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const nt={};tt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+et+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new W(r(o," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!nt[o]&&(nt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},tt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const rt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new W("option "+i+" must be "+n,W.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new W("Unknown option "+i,W.ERR_BAD_OPTION)}},validators:tt},ot=rt.validators;let it=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ie,response:new ie}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(r){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=$e(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&rt.assertOptions(n,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean)},!1),null!=r&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:rt.assertOptions(r,{encode:ot.function,serialize:ot.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rt.assertOptions(t,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&V.merge(o.common,o[t.method]);o&&V.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=_e.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,d=0;if(!a){const e=[Qe.bind(this),void 0];for(e.unshift(...s),e.push(...c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=s.length;let f=t;for(;d<l;){const e=s[d++],t=s[d++];try{f=e(f)}catch(p){t.call(this,p);break}}try{u=Qe.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return oe(Ne((e=$e(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};V.forEach(["delete","get","head","options"],function(e){it.prototype[e]=function(t,n){return this.request($e(n||{},{method:e,url:t,data:(n||{}).data}))}}),V.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request($e(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}it.prototype[e]=t(),it.prototype[e+"Form"]=t(!0)});const st={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(st).forEach(([e,t])=>{st[t]=e});const at=function e(t){const n=new it(t),o=r(it.prototype.request,n);return V.extend(o,it.prototype,n,{allOwnKeys:!0}),V.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e($e(t,n))},o}(me);at.Axios=it,at.CanceledError=ke,at.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new ke(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},at.isCancel=ze,at.VERSION=et,at.toFormData=Q,at.AxiosError=W,at.Cancel=at.CanceledError,at.all=function(e){return Promise.all(e)},at.spread=function(e){return function(t){return e.apply(null,t)}},at.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},at.mergeConfig=$e,at.AxiosHeaders=_e,at.formToJSON=e=>he(V.isHTMLForm(e)?new FormData(e):e),at.getAdapter=Xe,at.HttpStatusCode=st,at.default=at;const{Axios:ct,AxiosError:ut,CanceledError:lt,isCancel:dt,CancelToken:ft,VERSION:pt,all:ht,Cancel:mt,isAxiosError:gt,spread:vt,toFormData:yt,AxiosHeaders:bt,HttpStatusCode:wt,formToJSON:_t,getAdapter:Et,mergeConfig:zt}=at;function kt(e){throw new Error("Base URL is not defined")}kt("sandbox"),kt("production");class Ot{constructor(e){n(this,"env"),n(this,"apiVersion"),n(this,"api"),n(this,"bearerToken"),this.apiVersion="v3",this.env=e.env,this.bearerToken=e.token,this.api=kt(this.env),this.api.interceptors.request.use(e=>(this.bearerToken&&(e.headers.Authorization=`Bearer ${this.bearerToken}`),e))}async createSetup(e){try{return(await this.api.post(`/${this.apiVersion}/3ds/setup`,e)).data}catch(t){throw this.handleError(t)}}async authenticate(e){try{return(await this.api.post(`/${this.apiVersion}/3ds/authenticate`,e)).data}catch(t){throw this.handleError(t)}}handleError(e){var t,n;return at.isAxiosError(e)?new Error((null==(n=null==(t=e.response)?void 0:t.data)?void 0:n.message)||"Request error."):e}}const xt={"01":{width:400,height:250},"02":{width:400,height:390},"03":{width:600,height:500},"04":{width:400,height:600},"05":{width:window.screen.width,height:window.screen.height}},St="step-up-iframe",At="step-up-form",Tt="challenge-modal-overlay";function Rt(){const e=document.getElementById(Tt);e&&(e.classList.remove("show"),document.body.classList.remove("challenge-modal-open"),setTimeout(()=>{Nt(document.getElementsByName(St)[0],document.getElementById(At),e,null)},300))}function Nt(e,t,n=null,r=null){e&&e.parentNode&&e.parentNode.removeChild(e),t&&t.parentNode&&t.parentNode.removeChild(t),n&&n.parentNode&&n.parentNode.removeChild(n),r&&r.parentNode&&r.parentNode.removeChild(r),document.body.classList.remove("challenge-modal-open")}async function Pt(e){return new Promise((t,n)=>{let r=null,o=null,i=null,s=null,a=null;try{!function(){if(document.getElementById("challenge-modal-css"))return;const e=document.createElement("style");e.id="challenge-modal-css",e.innerHTML="\n .challenge-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.6);\n z-index: 9998;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n visibility: hidden;\n }\n\n .challenge-modal-overlay.show {\n opacity: 1;\n visibility: visible;\n }\n\n .challenge-modal-wrapper {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .challenge-modal-container {\n position: relative;\n border-radius: 8px;\n box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);\n background: white;\n max-width: 90vw;\n max-height: 90vh;\n overflow: hidden;\n }\n\n .challenge-modal-iframe {\n border: none;\n border-radius: 8px;\n display: block;\n background: white;\n }\n\n .challenge-modal-close {\n position: absolute;\n top: -15px;\n right: -15px;\n width: 30px;\n height: 30px;\n border-radius: 50%;\n background: #333;\n color: white;\n border: 2px solid white;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: bold;\n z-index: 10000;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n line-height: 1;\n }\n\n @media (max-width: 768px) {\n .challenge-modal-container {\n margin: 20px;\n max-width: calc(100vw - 40px);\n max-height: calc(100vh - 40px);\n }\n \n .challenge-modal-iframe {\n width: 100% !important;\n min-height: 300px;\n }\n }\n\n body.challenge-modal-open {\n overflow: hidden;\n }\n ",document.head.appendChild(e)}();const n=function(e){const t=xt[e]||xt["01"];return"05"===e?{width:Math.min(.9*window.innerWidth,1200),height:Math.min(.9*window.innerHeight,800)}:t}(e.windowSize);i=function(){const e=document.createElement("div");return e.id=Tt,e.className="challenge-modal-overlay",document.body.appendChild(e),e}(),s=function(e){const t=document.createElement("div");return t.id="challenge-modal-container",t.className="challenge-modal-container",t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t}(n);const c=function(){const e=document.createElement("button");return e.className="challenge-modal-close",e.innerHTML="×",e.setAttribute("aria-label","Fechar modal"),e.addEventListener("click",Rt),e}();r=function(e){const t=document.createElement("iframe");return t.name=St,t.className="challenge-modal-iframe",t.height=e.height.toString(),t.width=e.width.toString(),t.setAttribute("allowfullscreen","true"),t.setAttribute("frameborder","0"),t}(n),o=function(e){const t=document.createElement("form");t.id=At,t.target=St,t.method="POST",t.action=e.url,t.style.display="none";const n=document.createElement("input");return n.type="hidden",n.name="JWT",n.value=e.accessToken,t.appendChild(n),document.body.appendChild(t),t}(e);const u=document.createElement("div");u.className="challenge-modal-wrapper",s.appendChild(r),u.appendChild(s),u.appendChild(c),i.appendChild(u),function(){const e=e=>{"Escape"===e.key&&Rt()};document.addEventListener("keydown",e),window.challengeModalKeyHandler=e}(),function(){const e=document.getElementById(Tt);e&&(document.body.classList.add("challenge-modal-open"),setTimeout(()=>{e.classList.add("show")},10))}(),a=function(e,t,n,r,o){return i=>{try{"completed"===i.data.status&&(console.log("Challenge completed"),Nt(e,t,n,r),o())}catch(s){console.error("Erro ao processar message do Session:",s)}}}(r,o,i,s,t),window.addEventListener("message",a,!1),o.submit()}catch(c){console.error("Erro ao processar desafio de autenticação:",c),Nt(r,o,i,s),n(c)}})}const $t="session-iframe";function jt(e){return new Promise((t,n)=>{const{env:r,accessToken:o,dataCollectionUrl:i}=e;let s=null,a=null;const c=()=>{!function(e){e&&window.removeEventListener("message",e)}(a)};try{!function(){const e=document.createElement("iframe");e.name=$t,e.height="1",e.width="1",e.style.display="none",document.body.appendChild(e)}(),s=function(e,t){const n=document.createElement("form");n.id="session-form",n.target=$t,n.method="POST",n.action=e;const r=document.createElement("input");return r.type="hidden",r.name="JWT",r.value=t,n.appendChild(r),document.body.appendChild(n),n}(i,o),a=function(e,t,n){return e=>{try{void 0===e.origin&&"profile.completed"===JSON.parse(e.data).MessageType&&(console.log("Profile completed"),n(),t())}catch(r){console.error("Erro ao processar message do Session:",r)}}}(0,t,c),window.addEventListener("message",a,!1),s.submit()}catch(u){c(),n(u)}})}function Ct(){try{return"undefined"!=typeof window&&("undefined"!=typeof document&&("undefined"!=typeof Array&&"undefined"!=typeof Object))}catch(e){return!1}}function It(e,t,n){function r(n,r){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=r}const o=(null==n?void 0:n.Parent)??Object;class i extends o{}function s(e){var t;const o=(null==n?void 0:n.Parent)?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const n of o._zod.deferred)n();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>{var r,o;return!!((null==n?void 0:n.Parent)&&t instanceof n.Parent)||(null==(o=null==(r=null==t?void 0:t._zod)?void 0:r.traits)?void 0:o.has(e))}}),Object.defineProperty(s,"name",{value:e}),s}class Zt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ft extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Ut={};function Dt(e){return Ut}function Lt(e,t){return"bigint"==typeof t?t.toString():t}function Bt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Mt(e){return null==e}function qt(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Vt=Symbol("evaluating");function Wt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Vt)return void 0===r&&(r=Vt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Jt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ht(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Kt(e){return JSON.stringify(e)}const Gt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Yt=Bt(()=>{var e;if("undefined"!=typeof navigator&&(null==(e=null==navigator?void 0:navigator.userAgent)?void 0:e.includes("Cloudflare")))return!1;try{return new Function(""),!0}catch(t){return!1}});function Qt(e){if(!1===Xt(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Xt(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function en(e){return Qt(e)?{...e}:Array.isArray(e)?[...e]:e}const tn=new Set(["string","number","symbol"]);function nn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!(null==n?void 0:n.parent)||(r._zod.parent=e),r}function on(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==(null==t?void 0:t.message)){if(void 0!==(null==t?void 0:t.error))throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const sn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function an(e,t=0){var n;if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==(null==(n=e.issues[r])?void 0:n.continue))return!0;return!1}function cn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function un(e){return"string"==typeof e?e:null==e?void 0:e.message}function ln(e,t,n){var r,o,i,s,a,c;const u={...e,path:e.path??[]};if(!e.message){const l=un(null==(i=null==(o=null==(r=e.inst)?void 0:r._zod.def)?void 0:o.error)?void 0:i.call(o,e))??un(null==(s=null==t?void 0:t.error)?void 0:s.call(t,e))??un(null==(a=n.customError)?void 0:a.call(n,e))??un(null==(c=n.localeError)?void 0:c.call(n,e))??"Invalid input";u.message=l}return delete u.inst,delete u.continue,(null==t?void 0:t.reportInput)||delete u.input,u}function dn(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function fn(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const pn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Lt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hn=It("$ZodError",pn),mn=It("$ZodError",pn,{Parent:Error});const gn=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Zt;if(s.issues.length){const t=new((null==o?void 0:o.Err)??e)(s.issues.map(e=>ln(e,i,Dt())));throw Gt(t,null==o?void 0:o.callee),t}return s.value},vn=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new((null==o?void 0:o.Err)??e)(s.issues.map(e=>ln(e,i,Dt())));throw Gt(t,null==o?void 0:o.callee),t}return s.value},yn=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Zt;return i.issues.length?{success:!1,error:new(e??hn)(i.issues.map(e=>ln(e,o,Dt())))}:{success:!0,data:i.value}},bn=yn(mn),wn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>ln(e,o,Dt())))}:{success:!0,data:i.value}},_n=wn(mn),En=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gn(e)(t,n,o)},zn=e=>(t,n,r)=>gn(e)(t,n,r),kn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return vn(e)(t,n,o)},On=e=>async(t,n,r)=>vn(e)(t,n,r),xn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yn(e)(t,n,o)},Sn=e=>(t,n,r)=>yn(e)(t,n,r),An=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return wn(e)(t,n,o)},Tn=e=>async(t,n,r)=>wn(e)(t,n,r),Rn=/^[cC][^\s-]{8,}$/,Nn=/^[0-9a-z]+$/,Pn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$n=/^[0-9a-vA-V]{20}$/,jn=/^[A-Za-z0-9]{27}$/,Cn=/^[a-zA-Z0-9_-]{21}$/,In=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Fn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Un=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Dn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ln=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Bn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Mn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vn=/^[A-Za-z0-9_-]*$/,Wn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Jn=/^\+(?:[0-9]){6,14}[0-9]$/,Hn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Kn=new RegExp(`^${Hn}$`);function Gn(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Xn=/^-?\d+$/,Yn=/^-?\d+(?:\.\d+)?/,Qn=/^(?:true|false)$/i,er=/^[^A-Z]*$/,tr=/^[^a-z]*$/,nr=It("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rr={number:"number",bigint:"bigint",object:"date"},or=It("$ZodCheckLessThan",(e,t)=>{nr.init(e,t);const n=rr[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ir=It("$ZodCheckGreaterThan",(e,t)=>{nr.init(e,t);const n=rr[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sr=It("$ZodCheckMultipleOf",(e,t)=>{nr.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);(null==e?void 0:e[1])&&(o=Number.parseInt(e[1]))}const i=n>o?n:o;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ar=It("$ZodCheckNumberFormat",(e,t)=>{var n;nr.init(e,t),t.format=t.format||"float64";const r=null==(n=t.format)?void 0:n.includes("int"),o=r?"int":"number",[i,s]=sn[t.format];e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=s,r&&(n.pattern=Xn)}),e._zod.check=n=>{const a=n.value;if(r){if(!Number.isInteger(a))return void n.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?n.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):n.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}))}a<i&&n.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>s&&n.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}}),cr=It("$ZodCheckMaxLength",(e,t)=>{var n;nr.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Mt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=dn(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ur=It("$ZodCheckMinLength",(e,t)=>{var n;nr.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Mt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=dn(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),lr=It("$ZodCheckLengthEquals",(e,t)=>{var n;nr.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Mt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=dn(r),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),dr=It("$ZodCheckStringFormat",(e,t)=>{var n,r;nr.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),fr=It("$ZodCheckRegex",(e,t)=>{dr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pr=It("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=er),dr.init(e,t)}),hr=It("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tr),dr.init(e,t)}),mr=It("$ZodCheckIncludes",(e,t)=>{nr.init(e,t);const n=nn(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),gr=It("$ZodCheckStartsWith",(e,t)=>{nr.init(e,t);const n=new RegExp(`^${nn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),vr=It("$ZodCheckEndsWith",(e,t)=>{nr.init(e,t);const n=new RegExp(`.*${nn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),yr=It("$ZodCheckOverwrite",(e,t)=>{nr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class br{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const o of r)this.content.push(o)}compile(){return new Function(...null==this?void 0:this.args,[...((null==this?void 0:this.content)??[""]).map(e=>` ${e}`)].join("\n"))}}const wr={major:4,minor:1,patch:12},_r=It("$ZodType",(e,t)=>{var n,r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wr;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const i of o)for(const t of i._zod.onattach)t(e);if(0===o.length)(r=e._zod).deferred??(r.deferred=[]),null==(n=e._zod.deferred)||n.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=an(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===(null==n?void 0:n.async))throw new Zt;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(o||(o=an(e,t)))});else{if(e.issues.length===t)continue;o||(o=an(e,t))}}return r?r.then(()=>e):e},n=(n,r,i)=>{if(an(n))return n.aborted=!0,n;const s=t(r,o,i);if(s instanceof Promise){if(!1===i.async)throw new Zt;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(r,i)=>{if(i.skipChecks)return e._zod.parse(r,i);if("backward"===i.direction){const t=e._zod.parse({value:r.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,i)):n(t,r,i)}const s=e._zod.parse(r,i);if(s instanceof Promise){if(!1===i.async)throw new Zt;return s.then(e=>t(e,o,i))}return t(s,o,i)}}e["~standard"]={validate:t=>{var n;try{const r=bn(e,t);return r.success?{value:r.data}:{issues:null==(n=r.error)?void 0:n.issues}}catch(r){return _n(e,t).then(e=>{var t;return e.success?{value:e.data}:{issues:null==(t=e.error)?void 0:t.issues}})}},vendor:"zod",version:1}}),Er=It("$ZodString",(e,t)=>{var n;_r.init(e,t),e._zod.pattern=[...(null==(n=null==e?void 0:e._zod.bag)?void 0:n.patterns)??[]].pop()??(e=>{const t=e?`[\\s\\S]{${(null==e?void 0:e.minimum)??0},${(null==e?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)})(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),zr=It("$ZodStringFormat",(e,t)=>{dr.init(e,t),Er.init(e,t)}),kr=It("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Zn),zr.init(e,t)}),Or=It("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Fn(e))}else t.pattern??(t.pattern=Fn());zr.init(e,t)}),xr=It("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Un),zr.init(e,t)}),Sr=It("$ZodURL",(e,t)=>{zr.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Wn.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ar=It("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),zr.init(e,t)}),Tr=It("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Cn),zr.init(e,t)}),Rr=It("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Rn),zr.init(e,t)}),Nr=It("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Nn),zr.init(e,t)}),Pr=It("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Pn),zr.init(e,t)}),$r=It("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$n),zr.init(e,t)}),jr=It("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=jn),zr.init(e,t)}),Cr=It("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Gn({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Hn}T(?:${r})$`)}(t)),zr.init(e,t)}),Ir=It("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Kn),zr.init(e,t)}),Zr=It("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Gn(t)}$`)),zr.init(e,t)}),Fr=It("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=In),zr.init(e,t)}),Ur=It("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Dn),zr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Dr=It("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ln),zr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Lr=It("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Bn),zr.init(e,t)}),Br=It("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Mn),zr.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Mr(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const qr=It("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=qn),zr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Mr(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const Vr=It("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Vn),zr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!Vn.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Mr(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Wr=It("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Jn),zr.init(e,t)});const Jr=It("$ZodJWT",(e,t)=>{zr.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==(null==o?void 0:o.typ)||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Hr=It("$ZodNumber",(e,t)=>{_r.init(e,t),e._zod.pattern=e._zod.bag.pattern??Yn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(s){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),Kr=It("$ZodNumber",(e,t)=>{ar.init(e,t),Hr.init(e,t)}),Gr=It("$ZodBoolean",(e,t)=>{_r.init(e,t),e._zod.pattern=Qn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(i){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Xr=It("$ZodAny",(e,t)=>{_r.init(e,t),e._zod.parse=e=>e}),Yr=It("$ZodUnknown",(e,t)=>{_r.init(e,t),e._zod.parse=e=>e}),Qr=It("$ZodNever",(e,t)=>{_r.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function eo(e,t,n){e.issues.length&&t.issues.push(...cn(n,e.issues)),t.value[n]=e.value}const to=It("$ZodArray",(e,t)=>{_r.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>eo(t,n,e))):eo(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function no(e,t,n,r){e.issues.length&&t.issues.push(...cn(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function ro(e){var t,n,r,o;const i=Object.keys(e.shape);for(const c of i)if(!(null==(o=null==(r=null==(n=null==(t=e.shape)?void 0:t[c])?void 0:n._zod)?void 0:r.traits)?void 0:o.has("$ZodType")))throw new Error(`Invalid element at key "${c}": expected a Zod schema`);const s=(a=e.shape,Object.keys(a).filter(e=>"optional"===a[e]._zod.optin&&"optional"===a[e]._zod.optout));var a;return{...e,keys:i,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(s)}}function oo(e,t,n,r,o,i){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const l of Object.keys(t)){if(a.has(l))continue;if("never"===u){s.push(l);continue}const o=c.run({value:t[l],issues:[]},r);o instanceof Promise?e.push(o.then(e=>no(e,n,l,t))):no(o,n,l,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const io=It("$ZodObject",(e,t)=>{_r.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(null==n?void 0:n.get)){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Bt(()=>ro(t));Wt(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const o=Xt,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=s.shape;for(const e of s.keys){const r=u[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?c.push(r.then(n=>no(n,t,e,a))):no(r,t,e,a)}return i?oo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),so=It("$ZodObjectJIT",(e,t)=>{io.init(e,t);const n=e._zod.parse,r=Bt(()=>ro(t));let o;const i=Xt,s=!Ut.jitless,a=s&&Yt.value,c=t.catchall;let u;e._zod.parse=(l,d)=>{u??(u=r.value);const f=l.value;return i(f)?s&&a&&!1===(null==d?void 0:d.async)&&!0!==d.jitless?(o||(o=(e=>{const t=new br(["shape","payload","ctx"]),n=r.value,o=e=>{const t=Kt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const r of n.keys)i[r]="key_"+s++;t.write("const newResult = {};");for(const r of n.keys){const e=i[r],n=Kt(r);t.write(`const ${e} = ${o(r)};`),t.write(`\n if (${e}.issues.length) {\n payload.issues = payload.issues.concat(${e}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${n}, ...iss.path] : [${n}]\n })));\n }\n \n \n if (${e}.value === undefined) {\n if (${n} in input) {\n newResult[${n}] = undefined;\n }\n } else {\n newResult[${n}] = ${e}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),l=o(l,d),c?oo([],f,l,d,u,e):l):n(l,d):(l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l)}});function ao(e,t,n,r){for(const i of e)if(0===i.issues.length)return t.value=i.value,t;const o=e.filter(e=>!an(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ln(e,r,Dt())))}),t)}const co=It("$ZodUnion",(e,t)=>{_r.init(e,t),Wt(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Wt(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Wt(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Wt(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>qt(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>ao(t,o,e,i)):ao(a,o,e,i)}}),uo=It("$ZodIntersection",(e,t)=>{_r.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>fo(e,t,n)):fo(e,o,i)}});function lo(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Qt(e)&&Qt(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const i of r){const n=lo(e[i],t[i]);if(!n.valid)return{valid:!1,mergeErrorPath:[i,...n.mergeErrorPath]};o[i]=n.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=lo(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function fo(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),an(e))return e;const r=lo(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const po=It("$ZodEnum",(e,t)=>{_r.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>tn.has(typeof e)).map(e=>"string"==typeof e?nn(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),ho=It("$ZodTransform",(e,t)=>{_r.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ft(e.constructor.name);const o=t.transform(n.value,n);if(r.async){return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n))}if(o instanceof Promise)throw new Zt;return n.value=o,n}});function mo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const go=It("$ZodOptional",(e,t)=>{_r.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Wt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${qt(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>mo(t,e.value)):mo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),vo=It("$ZodNullable",(e,t)=>{_r.init(e,t),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),Wt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${qt(e.source)}|null)$`):void 0}),Wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),yo=It("$ZodDefault",(e,t)=>{_r.init(e,t),e._zod.optin="optional",Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>bo(e,t)):bo(r,t)}});function bo(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const wo=It("$ZodPrefault",(e,t)=>{_r.init(e,t),e._zod.optin="optional",Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),_o=It("$ZodNonOptional",(e,t)=>{_r.init(e,t),Wt(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Eo(t,e)):Eo(o,e)}});function Eo(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const zo=It("$ZodCatch",(e,t)=>{_r.init(e,t),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ln(e,n,Dt()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ln(e,n,Dt()))},input:e.value}),e.issues=[]),e)}}),ko=It("$ZodPipe",(e,t)=>{_r.init(e,t),Wt(e._zod,"values",()=>t.in._zod.values),Wt(e._zod,"optin",()=>t.in._zod.optin),Wt(e._zod,"optout",()=>t.out._zod.optout),Wt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Oo(e,t.in,n)):Oo(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Oo(e,t.out,n)):Oo(r,t.out,n)}});function Oo(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const xo=It("$ZodReadonly",(e,t)=>{_r.init(e,t),Wt(e._zod,"propValues",()=>t.innerType._zod.propValues),Wt(e._zod,"values",()=>t.innerType._zod.values),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(So):So(r)}});function So(e){return e.value=Object.freeze(e.value),e}const Ao=It("$ZodCustom",(e,t)=>{nr.init(e,t),_r.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>To(t,n,r,e));To(o,n,r,e)}});function To(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(fn(e))}}class Ro{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function No(){return new Ro}const Po=No();function $o(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...on(t)})}function jo(e,t){return new or({check:"less_than",...on(t),value:e,inclusive:!1})}function Co(e,t){return new or({check:"less_than",...on(t),value:e,inclusive:!0})}function Io(e,t){return new ir({check:"greater_than",...on(t),value:e,inclusive:!1})}function Zo(e,t){return new ir({check:"greater_than",...on(t),value:e,inclusive:!0})}function Fo(e,t){return new sr({check:"multiple_of",...on(t),value:e})}function Uo(e,t){return new cr({check:"max_length",...on(t),maximum:e})}function Do(e,t){return new ur({check:"min_length",...on(t),minimum:e})}function Lo(e,t){return new lr({check:"length_equals",...on(t),length:e})}function Bo(e){return new yr({check:"overwrite",tx:e})}function Mo(e){const t=function(e,t){const n=new nr({check:"custom",...on(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(fn(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(fn(r))}},e(n.value,n)));return t}const qo=It("ZodISODateTime",(e,t)=>{Cr.init(e,t),mi.init(e,t)});function Vo(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...on(t)})}(qo,e)}const Wo=It("ZodISODate",(e,t)=>{Ir.init(e,t),mi.init(e,t)});function Jo(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...on(t)})}(Wo,e)}const Ho=It("ZodISOTime",(e,t)=>{Zr.init(e,t),mi.init(e,t)});function Ko(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...on(t)})}(Ho,e)}const Go=It("ZodISODuration",(e,t)=>{Fr.init(e,t),mi.init(e,t)});function Xo(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...on(t)})}(Go,e)}const Yo=It("ZodError",(e,t)=>{hn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e}));else if("invalid_key"===o.code)r({issues:o.issues});else if("invalid_element"===o.code)r({issues:o.issues});else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Lt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Lt,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Qo=gn(Yo),ei=vn(Yo),ti=yn(Yo),ni=wn(Yo),ri=En(Yo),oi=zn(Yo),ii=kn(Yo),si=On(Yo),ai=xn(Yo),ci=Sn(Yo),ui=An(Yo),li=Tn(Yo),di=It("ZodType",(e,t)=>(_r.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ht(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>rn(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Qo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ti(e,t,n),e.parseAsync=async(t,n)=>ei(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ni(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ri(e,t,n),e.decode=(t,n)=>oi(e,t,n),e.encodeAsync=async(t,n)=>ii(e,t,n),e.decodeAsync=async(t,n)=>si(e,t,n),e.safeEncode=(t,n)=>ai(e,t,n),e.safeDecode=(t,n)=>ci(e,t,n),e.safeEncodeAsync=async(t,n)=>ui(e,t,n),e.safeDecodeAsync=async(t,n)=>li(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...on(n)})}(us,e,t)}(t,n)),e.superRefine=t=>e.check(Mo(t)),e.overwrite=t=>e.check(Bo(t)),e.optional=()=>Qi(e),e.nullable=()=>ts(e),e.nullish=()=>Qi(ts(e)),e.nonoptional=t=>function(e,t){return new os({type:"nonoptional",innerType:e,...on(t)})}(e,t),e.array=()=>{return function(e,t,n){return new e({type:"array",element:t,...on(n)})}(qi,e,t);var t},e.or=t=>{return new Ji({type:"union",options:[e,t],...on(n)});var n},e.and=t=>new Hi({type:"intersection",left:e,right:t}),e.transform=t=>as(e,new Xi({type:"transform",transform:t})),e.default=t=>{return n=t,new ns({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():en(n)}});var n},e.prefault=t=>{return n=t,new rs({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():en(n)}});var n},e.catch=t=>{return new is({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>as(e,t),e.readonly=()=>new cs({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Po.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){var t;return null==(t=Po.get(e))?void 0:t.description},configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Po.get(e);const n=e.clone();return Po.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),fi=It("_ZodString",(e,t)=>{Er.init(e,t),di.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new fr({check:"string_format",format:"regex",...on(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new mr({check:"string_format",format:"includes",...on(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new gr({check:"string_format",format:"starts_with",...on(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new vr({check:"string_format",format:"ends_with",...on(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Do(...t)),e.max=(...t)=>e.check(Uo(...t)),e.length=(...t)=>e.check(Lo(...t)),e.nonempty=(...t)=>e.check(Do(1,...t)),e.lowercase=t=>e.check(function(e){return new pr({check:"string_format",format:"lowercase",...on(e)})}(t)),e.uppercase=t=>e.check(function(e){return new hr({check:"string_format",format:"uppercase",...on(e)})}(t)),e.trim=()=>e.check(Bo(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Bo(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Bo(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Bo(e=>e.toUpperCase()))}),pi=It("ZodString",(e,t)=>{Er.init(e,t),fi.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...on(t)})}(gi,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...on(t)})}(bi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...on(t)})}(ji,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...on(t)})}(wi,t)),e.guid=t=>e.check($o(vi,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...on(t)})}(yi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...on(t)})}(yi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...on(t)})}(yi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...on(t)})}(yi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...on(t)})}(_i,t)),e.guid=t=>e.check($o(vi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...on(t)})}(Ei,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...on(t)})}(zi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...on(t)})}(ki,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...on(t)})}(Ni,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...on(t)})}(Pi,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...on(t)})}(Oi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...on(t)})}(xi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...on(t)})}(Si,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...on(t)})}(Ai,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...on(t)})}(Ti,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...on(t)})}(Ri,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...on(t)})}($i,t)),e.datetime=t=>e.check(Vo(t)),e.date=t=>e.check(Jo(t)),e.time=t=>e.check(Ko(t)),e.duration=t=>e.check(Xo(t))});function hi(e){return function(e,t){return new e({type:"string",...on(t)})}(pi,e)}const mi=It("ZodStringFormat",(e,t)=>{zr.init(e,t),fi.init(e,t)}),gi=It("ZodEmail",(e,t)=>{xr.init(e,t),mi.init(e,t)}),vi=It("ZodGUID",(e,t)=>{kr.init(e,t),mi.init(e,t)}),yi=It("ZodUUID",(e,t)=>{Or.init(e,t),mi.init(e,t)}),bi=It("ZodURL",(e,t)=>{Sr.init(e,t),mi.init(e,t)}),wi=It("ZodEmoji",(e,t)=>{Ar.init(e,t),mi.init(e,t)}),_i=It("ZodNanoID",(e,t)=>{Tr.init(e,t),mi.init(e,t)}),Ei=It("ZodCUID",(e,t)=>{Rr.init(e,t),mi.init(e,t)}),zi=It("ZodCUID2",(e,t)=>{Nr.init(e,t),mi.init(e,t)}),ki=It("ZodULID",(e,t)=>{Pr.init(e,t),mi.init(e,t)}),Oi=It("ZodXID",(e,t)=>{$r.init(e,t),mi.init(e,t)}),xi=It("ZodKSUID",(e,t)=>{jr.init(e,t),mi.init(e,t)}),Si=It("ZodIPv4",(e,t)=>{Ur.init(e,t),mi.init(e,t)}),Ai=It("ZodIPv6",(e,t)=>{Dr.init(e,t),mi.init(e,t)}),Ti=It("ZodCIDRv4",(e,t)=>{Lr.init(e,t),mi.init(e,t)}),Ri=It("ZodCIDRv6",(e,t)=>{Br.init(e,t),mi.init(e,t)}),Ni=It("ZodBase64",(e,t)=>{qr.init(e,t),mi.init(e,t)}),Pi=It("ZodBase64URL",(e,t)=>{Vr.init(e,t),mi.init(e,t)}),$i=It("ZodE164",(e,t)=>{Wr.init(e,t),mi.init(e,t)}),ji=It("ZodJWT",(e,t)=>{Jr.init(e,t),mi.init(e,t)}),Ci=It("ZodNumber",(e,t)=>{Hr.init(e,t),di.init(e,t),e.gt=(t,n)=>e.check(Io(t,n)),e.gte=(t,n)=>e.check(Zo(t,n)),e.min=(t,n)=>e.check(Zo(t,n)),e.lt=(t,n)=>e.check(jo(t,n)),e.lte=(t,n)=>e.check(Co(t,n)),e.max=(t,n)=>e.check(Co(t,n)),e.int=t=>e.check(Zi(t)),e.safe=t=>e.check(Zi(t)),e.positive=t=>e.check(Io(0,t)),e.nonnegative=t=>e.check(Zo(0,t)),e.negative=t=>e.check(jo(0,t)),e.nonpositive=t=>e.check(Co(0,t)),e.multipleOf=(t,n)=>e.check(Fo(t,n)),e.step=(t,n)=>e.check(Fo(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});const Ii=It("ZodNumberFormat",(e,t)=>{Kr.init(e,t),Ci.init(e,t)});function Zi(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...on(t)})}(Ii,e)}const Fi=It("ZodBoolean",(e,t)=>{Gr.init(e,t),di.init(e,t)});const Ui=It("ZodAny",(e,t)=>{Xr.init(e,t),di.init(e,t)});const Di=It("ZodUnknown",(e,t)=>{Yr.init(e,t),di.init(e,t)});function Li(){return new Di({type:"unknown"})}const Bi=It("ZodNever",(e,t)=>{Qr.init(e,t),di.init(e,t)});function Mi(e){return function(e,t){return new e({type:"never",...on(t)})}(Bi,e)}const qi=It("ZodArray",(e,t)=>{to.init(e,t),di.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Do(t,n)),e.nonempty=t=>e.check(Do(1,t)),e.max=(t,n)=>e.check(Uo(t,n)),e.length=(t,n)=>e.check(Lo(t,n)),e.unwrap=()=>e.element});const Vi=It("ZodObject",(e,t)=>{so.init(e,t),di.init(e,t),Wt(e,"shape",()=>t.shape),e.keyof=()=>Gi(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Li()}),e.loose=()=>e.clone({...e._zod.def,catchall:Li()}),e.strict=()=>e.clone({...e._zod.def,catchall:Mi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Qt(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=Ht(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Jt(this,"shape",n),n},checks:[]});return rn(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Qt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Jt(this,"shape",n),n},checks:e._zod.def.checks};return rn(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ht(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Jt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return rn(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return rn(e,Ht(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Jt(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Ht(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Jt(this,"shape",r),r},checks:[]});return rn(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Ht(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Jt(this,"shape",o),o},checks:[]});return rn(t,r)}(Yi,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Ht(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return Jt(this,"shape",o),o},checks:[]});return rn(t,r)}(os,e,t[0])});function Wi(e,t){const n={type:"object",shape:e??{},...on(t)};return new Vi(n)}const Ji=It("ZodUnion",(e,t)=>{co.init(e,t),di.init(e,t),e.options=t.options});const Hi=It("ZodIntersection",(e,t)=>{uo.init(e,t),di.init(e,t)});const Ki=It("ZodEnum",(e,t)=>{po.init(e,t),di.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Ki({...t,checks:[],...on(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Ki({...t,checks:[],...on(r),entries:o})}});function Gi(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ki({type:"enum",entries:n,...on(t)})}const Xi=It("ZodTransform",(e,t)=>{ho.init(e,t),di.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ft(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(fn(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(fn(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}});const Yi=It("ZodOptional",(e,t)=>{go.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qi(e){return new Yi({type:"optional",innerType:e})}const es=It("ZodNullable",(e,t)=>{vo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ts(e){return new es({type:"nullable",innerType:e})}const ns=It("ZodDefault",(e,t)=>{yo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const rs=It("ZodPrefault",(e,t)=>{wo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});const os=It("ZodNonOptional",(e,t)=>{_o.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});const is=It("ZodCatch",(e,t)=>{zo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const ss=It("ZodPipe",(e,t)=>{ko.init(e,t),di.init(e,t),e.in=t.in,e.out=t.out});function as(e,t){return new ss({type:"pipe",in:e,out:t})}const cs=It("ZodReadonly",(e,t)=>{xo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});const us=It("ZodCustom",(e,t)=>{Ao.init(e,t),di.init(e,t)});const ls=Wi({token:hi({message:"token is required"}),env:Gi(["sandbox","production"],{message:"env is required and only sandbox or production are supported"})});const ds={amount:(fs={error:"Amount is required"},function(e,t){return new e({type:"number",checks:[],...on(t)})}(Ci,fs)),card_hash:hi().optional(),card:Wi({number:hi({error:"Card number is required"}),expirationDate:hi().refine(function(e){if(!/^(0[1-9]|1[0-2])\d{2}$/.test(e))return!1;const t=parseInt(e.substring(0,2),10),n=2e3+parseInt(e.substring(2),10),r=new Date,o=r.getFullYear(),i=r.getMonth()+1;return!(n<o)&&!(n===o&&t<i)},{error:"Invalid expiration date"}),cvv:hi({error:"CVV is required"}).regex(/^\d{3,4}$/,{message:"CVV must be 3 or 4 digits"}),holderName:hi({error:"Holder name is required"})}).optional(),customer:Wi({name:hi({error:"Name is required"}),documentNumber:hi({error:"Document number is required"}).regex(/^\d+$/,{message:"Document number must not contain special characters"}),email:hi({error:"Invalid email"}),phone:Wi({number:hi({error:"Phone number is required"}),areaCode:hi({error:"Area code is required"}),countryCode:hi({error:"Country code is required"})}),address:Wi({country:hi({error:"Country is required"}),state:hi({error:"State is required"}),city:hi({error:"City is required"}),neighborhood:hi({error:"Neighborhood is required"}),number:hi({error:"Number is required"}),street:hi({error:"Street is required"}),zipcode:hi({error:"Zipcode is required"}),complement:hi().optional()})})};var fs;const ps=Wi({...ds,challenge:function(e){return function(e,t){return new e({type:"boolean",...on(t)})}(Fi,e)}().default(!1)}).refine(e=>e.card_hash||e.card,{error:"At least one of card_hash, or card must be provided"}).refine(e=>1===[e.card_hash,e.card].filter(Boolean).length,{error:"Only one of card_hash, or card can be provided"}),hs=Wi({...ds,challenge:new Ui({type:"any"}).refine(e=>void 0===e,{error:"The field 'challenge' is only allowed in test environments."})}).refine(e=>e.card_hash||e.card,{error:"At least one of card_id, card_hash, or card must be provided"}).refine(e=>1===[e.card_hash,e.card].filter(Boolean).length,{error:"Only one of card_id, card_hash, or card can be provided"});let ms=null;return e.authenticate=async function(e){if(!ms)throw new Error("Marlim SDK not initialized");const t=("sandbox"===ms.env?ps:hs).safeParse(e);if(!t.success)throw new Error(t.error.message);const n={token:ms.token,env:ms.env},r=t.data.card,o=t.data.customer,i=t.data.card_hash,s=await async function(e,t){try{const n=new Ot(e),r=await n.createSetup(t),{access_token:o,data_collection_url:i,session_id:s,card_id:a}=r;if(!o||!i)throw new Error("Invalid API response: access_token or data_collection_url are missing.");return await jt({accessToken:o,dataCollectionUrl:i,env:e.env}),{sessionId:s,cardId:a}}catch(n){let e="Error creating 3DS session";throw n instanceof Error&&(e=n.message),new Error(e)}}(n,{card_hash:i,card_cvv:null==r?void 0:r.cvv,card_expiration_date:null==r?void 0:r.expirationDate,card_holder_name:null==r?void 0:r.holderName,card_number:null==r?void 0:r.number}),a={challenge:t.data.challenge,amount:t.data.amount,card_id:s.cardId,session_id:s.sessionId,customer:{name:o.name,document_number:o.documentNumber,email:o.email,phone:{number:o.phone.number,area_code:o.phone.areaCode,country_code:o.phone.countryCode},address:{country:o.address.country,state:o.address.state,city:o.address.city,neighborhood:o.address.neighborhood,number:o.address.number,street:o.address.street,zipcode:o.address.zipcode,complement:o.address.complement}},device:{channel:"BROWSER",color_depth:window.screen.colorDepth,screen_height:window.screen.height,screen_width:window.screen.width,time_zone_offset:(new Date).getTimezoneOffset().toString(),java_enabled:!!window.WebGLRenderingContext,javascript_enabled:Ct()}},c=await function(e,t){return new Promise(async(n,r)=>{try{const r=new Ot(e),o=await r.authenticate(t);if(o.challenge)return await Pt({url:o.challenge.url,accessToken:o.challenge.access_token,windowSize:o.challenge.window_size}),n({threedsAuthenticationId:o.authentication_id});n({threedsAuthenticationId:o.authentication_id})}catch(o){let e="Error 3DS authentication";o instanceof Error&&(e=o.message),r(e)}})}(n,a);return{card_id:s.cardId,threeds_authentication_id:c.threedsAuthenticationId}},e.init=function(e){if("undefined"==typeof window||"undefined"==typeof document)throw new Error("Marlim3dsSdk can only be called in a browser environment.");const t=ls.safeParse(e);if(!t.success)throw new Error(t.error.message);ms=t.data},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});
|
|
1
|
+
var MarlimSDK_3DS=function(e){"use strict";var t=Object.defineProperty,n=(e,n,r)=>((e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r)(e,"symbol"!=typeof n?n+"":n,r);function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:s,toStringTag:a}=Symbol,c=(e=>t=>{const n=o.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),u=e=>(e=e.toLowerCase(),t=>c(t)===e),l=e=>t=>typeof t===e,{isArray:d}=Array,f=l("undefined");function p(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const h=u("ArrayBuffer");const m=l("string"),g=l("function"),v=l("number"),y=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==c(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||s in e)},w=u("Date"),_=u("File"),E=u("Blob"),z=u("FileList"),k=u("URLSearchParams"),[O,x,S,A]=["ReadableStream","Request","Response","Headers"].map(u);function T(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(p(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function R(e,t){if(p(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,P=e=>!f(e)&&e!==N;const j=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&i(Uint8Array)),$=u("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),I=u("RegExp"),Z=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};T(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const F=u("AsyncFunction"),U=(D="function"==typeof setImmediate,L=g(N.postMessage),D?setImmediate:L?(B=`axios@${Math.random()}`,M=[],N.addEventListener("message",({source:e,data:t})=>{e===N&&t===B&&M.length&&M.shift()()},!1),e=>{M.push(e),N.postMessage(B,"*")}):e=>setTimeout(e));var D,L,B,M;const q="undefined"!=typeof queueMicrotask?queueMicrotask.bind(N):"undefined"!=typeof process&&process.nextTick||U,V={isArray:d,isArrayBuffer:h,isBuffer:p,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=c(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:m,isNumber:v,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:b,isEmptyObject:e=>{if(!y(e)||p(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:O,isRequest:x,isResponse:S,isHeaders:A,isUndefined:f,isDate:w,isFile:_,isBlob:E,isRegExp:I,isFunction:g,isStream:e=>y(e)&&g(e.pipe),isURLSearchParams:k,isTypedArray:j,isFileList:z,forEach:T,merge:function e(){const{caseless:t,skipUndefined:n}=P(this)&&this||{},r={},o=(o,i)=>{const s=t&&R(r,i)||i;b(r[s])&&b(o)?r[s]=e(r[s],o):b(o)?r[s]=e({},o):d(o)?r[s]=o.slice():n&&f(o)||(r[s]=o)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&T(arguments[i],o);return r},extend:(e,t,n,{allOwnKeys:o}={})=>(T(t,(t,o)=>{n&&g(t)?e[o]=r(t,n):e[o]=t},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!v(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[s]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:$,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:Z,freezeMethods:e=>{Z(e,(t,n)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];g(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:R,global:N,isContextDefined:P,isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[a]&&e[s])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(p(e))return e;if(!("toJSON"in e)){t[r]=e;const o=d(e)?[]:{};return T(e,(e,t)=>{const i=n(e,r+1);!f(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:F,isThenable:e=>e&&(y(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:U,asap:q,isIterable:e=>null!=e&&g(e[s])};function W(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}V.inherits(W,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:V.toJSONObject(this.config),code:this.code,status:this.status}}});const J=W.prototype,H={};["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(e=>{H[e]={value:e}}),Object.defineProperties(W,H),Object.defineProperty(J,"isAxiosError",{value:!0}),W.from=(e,t,n,r,o,i)=>{const s=Object.create(J);V.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return W.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};function K(e){return V.isPlainObject(e)||V.isArray(e)}function G(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function X(e,t,n){return e?e.concat(t).map(function(e,t){return e=G(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Y=V.toFlatObject(V,{},null,function(e){return/^is[A-Z]/.test(e)});function Q(e,t,n){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!V.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(V.isBoolean(e))return e.toString();if(!a&&V.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(V.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(K)}(e)||(V.isFileList(e)||V.endsWith(n,"[]"))&&(a=V.toArray(e)))return n=G(n),a.forEach(function(e,r){!V.isUndefined(e)&&null!==e&&t.append(!0===s?X([n],r,i):null===s?n:n+"[]",c(e))}),!1;return!!K(e)||(t.append(X(o,n,i),c(e)),!1)}const l=[],d=Object.assign(Y,{defaultVisitor:u,convertValue:c,isVisitable:K});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!V.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),V.forEach(n,function(n,i){!0===(!(V.isUndefined(n)||null===n)&&o.call(t,n,V.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t}function ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function te(e,t){this._pairs=[],e&&Q(e,this,t)}const ne=te.prototype;function re(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oe(e,t,n){if(!t)return e;const r=n&&n.encode||re;V.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):V.isURLSearchParams(t)?t.toString():new te(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}ne.append=function(e,t){this._pairs.push([e,t])},ne.toString=function(e){const t=e?function(t){return e.call(this,t,ee)}:ee;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ie{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,function(t){null!==t&&e(t)})}}const se={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ae={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:te,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ce="undefined"!=typeof window&&"undefined"!=typeof document,ue="object"==typeof navigator&&navigator||void 0,le=ce&&(!ue||["ReactNative","NativeScript","NS"].indexOf(ue.product)<0),de="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fe=ce&&window.location.href||"http://localhost",pe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ce,hasStandardBrowserEnv:le,hasStandardBrowserWebWorkerEnv:de,navigator:ue,origin:fe},Symbol.toStringTag,{value:"Module"})),...ae};function he(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&V.isArray(r)?r.length:i,a)return V.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&V.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&V.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(V.isFormData(e)&&V.isFunction(e.entries)){const n={};return V.forEachEntry(e,(e,r)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const me={transitional:se,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=V.isObject(e);o&&V.isHTMLForm(e)&&(e=new FormData(e));if(V.isFormData(e))return r?JSON.stringify(he(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Q(e,new pe.classes.URLSearchParams,{visitor:function(e,t,n,r){return pe.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=V.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Q(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||me.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(o){if(n){if("SyntaxError"===o.name)throw W.from(o,W.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pe.classes.FormData,Blob:pe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],e=>{me.headers[e]={}});const ge=V.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"]),ve=Symbol("internals");function ye(e){return e&&String(e).trim().toLowerCase()}function be(e){return!1===e||null==e?e:V.isArray(e)?e.map(be):String(e)}function we(e,t,n,r,o){return V.isFunction(r)?r.call(this,t,n):(o&&(t=n),V.isString(t)?V.isString(r)?-1!==t.indexOf(r):V.isRegExp(r)?r.test(t):void 0:void 0)}let _e=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ye(t);if(!o)throw new Error("header name must be a non-empty string");const i=V.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=be(e))}const i=(e,t)=>V.forEach(e,(e,n)=>o(e,n,t));if(V.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&ge[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(V.isObject(e)&&V.isIterable(e)){let n,r,o={};for(const t of e){if(!V.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?V.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ye(e)){const n=V.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(V.isFunction(t))return t.call(this,e,n);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ye(e)){const n=V.findKey(this,e);return!(!n||void 0===this[n]||t&&!we(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ye(e)){const o=V.findKey(n,e);!o||t&&!we(0,n[o],o,t)||(delete n[o],r=!0)}}return V.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!we(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return V.forEach(this,(r,o)=>{const i=V.findKey(n,o);if(i)return t[i]=be(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=be(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&V.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ve]=this[ve]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ye(e);t[r]||(!function(e,t){const n=V.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}};function Ee(e,t){const n=this||me,r=t||n,o=_e.from(r.headers);let i=r.data;return V.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ze(e){return!(!e||!e.__CANCEL__)}function ke(e,t,n){W.call(this,null==e?"canceled":e,W.ERR_CANCELED,t,n),this.name="CanceledError"}function Oe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new W("Request failed with status code "+n.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(_e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),V.freezeMethods(_e),V.inherits(ke,W,{__CANCEL__:!0});const xe=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n)]}(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Se=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ae=e=>(...t)=>V.asap(()=>e(...t)),Te=pe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,pe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(pe.origin),pe.navigator&&/(msie|trident)/i.test(pe.navigator.userAgent)):()=>!0,Re=pe.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];V.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),V.isString(r)&&s.push("path="+r),V.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ne(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Pe=e=>e instanceof _e?{...e}:e;function je(e,t){t=t||{};const n={};function r(e,t,n,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function o(e,t,n,o){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!V.isUndefined(t))return r(void 0,t)}function s(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(Pe(e),Pe(t),0,!0)};return V.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,s=i(e[r],t[r],r);V.isUndefined(s)&&i!==a||(n[r]=s)}),n}const $e=e=>{const t=je({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=_e.from(s),t.url=oe(Ne(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),V.isFormData(n))if(pe.hasStandardBrowserEnv||pe.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(V.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(pe.hasStandardBrowserEnv&&(r&&V.isFunction(r)&&(r=r(t)),r||!1!==r&&Te(t.url))){const e=o&&i&&Re.read(i);e&&s.set(o,e)}return t},Ce="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=$e(e);let o=r.data;const i=_e.from(r.headers).normalize();let s,a,c,u,l,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=_e.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Oe(function(e){t(e),h()},function(e){n(e),h()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new W("Request aborted",W.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new W(t&&t.message?t.message:"Network Error",W.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||se;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new W(t,o.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&V.forEach(i.toJSON(),function(e,t){m.setRequestHeader(t,e)}),V.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([c,l]=xe(p,!0),m.addEventListener("progress",c)),f&&m.upload&&([a,u]=xe(f),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{m&&(n(!t||t.type?new ke(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);v&&-1===pe.protocols.indexOf(v)?n(new W("Unsupported protocol "+v+":",W.ERR_BAD_REQUEST,e)):m.send(o||null)})},Ie=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof W?t:new ke(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new W(`timeout ${t} of ms exceeded`,W.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>V.asap(s),a}},Ze=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Fe=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Ue=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Fe(e))yield*Ze(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:De}=V,Le=(({Request:e,Response:t})=>({Request:e,Response:t}))(V.global),{ReadableStream:Be,TextEncoder:Me}=V.global,qe=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},Ve=e=>{e=V.merge.call({skipUndefined:!0},Le,e);const{fetch:t,Request:n,Response:r}=e,o=t?De(t):"function"==typeof fetch,i=De(n),s=De(r);if(!o)return!1;const a=o&&De(Be),c=o&&("function"==typeof Me?(e=>t=>e.encode(t))(new Me):async e=>new Uint8Array(await new n(e).arrayBuffer())),u=i&&a&&qe(()=>{let e=!1;const t=new n(pe.origin,{body:new Be,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),l=s&&a&&qe(()=>V.isReadableStream(new r("").body)),d={stream:l&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new W(`Response type '${e}' is not supported`,W.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=V.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new n(pe.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:p,timeout:h,onDownloadProgress:m,onUploadProgress:g,responseType:v,headers:y,withCredentials:b="same-origin",fetchOptions:w}=$e(e),_=t||fetch;v=v?(v+"").toLowerCase():"text";let E=Ie([c,p&&p.toAbortSignal()],h),z=null;const k=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let O;try{if(g&&u&&"get"!==s&&"head"!==s&&0!==(O=await f(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(V.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Se(O,xe(Ae(g)));a=Ue(t.body,65536,e,n)}}V.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in n.prototype,c={...w,signal:E,method:s.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};z=i&&new n(o,c);let p=await(i?_(z,w):_(o,c));const h=l&&("stream"===v||"response"===v);if(l&&(m||h&&k)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});const t=V.toFiniteNumber(p.headers.get("content-length")),[n,o]=m&&Se(t,xe(Ae(m),!0))||[];p=new r(Ue(p.body,65536,n,()=>{o&&o(),k&&k()}),e)}v=v||"text";let x=await d[V.findKey(d,v)||"text"](p,e);return!h&&k&&k(),await new Promise((t,n)=>{Oe(t,n,{data:x,headers:_e.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:z})})}catch(x){if(k&&k(),x&&"TypeError"===x.name&&/Load failed|fetch/i.test(x.message))throw Object.assign(new W("Network Error",W.ERR_NETWORK,e,z),{cause:x.cause||x});throw W.from(x,x&&x.code,e,z)}}},We=new Map,Je=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,u=We;for(;c--;)s=i[c],a=u.get(s),void 0===a&&u.set(s,a=c?new Map:Ve(t)),u=a;return a};Je();const He={http:null,xhr:Ce,fetch:{get:Je}};V.forEach(He,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const Ke=e=>`- ${e}`,Ge=e=>V.isFunction(e)||null===e||!1===e,Xe=(e,t)=>{e=V.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!Ge(r)&&(o=He[(n=String(r)).toLowerCase()],void 0===o))throw new W(`Unknown adapter '${n}'`);if(o&&(V.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new W("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ke).join("\n"):" "+Ke(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function Ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ke(null,e)}function Qe(e){Ye(e),e.headers=_e.from(e.headers),e.data=Ee.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Xe(e.adapter||me.adapter,e)(e).then(function(t){return Ye(e),t.data=Ee.call(e,e.transformResponse,t),t.headers=_e.from(t.headers),t},function(t){return ze(t)||(Ye(e),t&&t.response&&(t.response.data=Ee.call(e,e.transformResponse,t.response),t.response.headers=_e.from(t.response.headers))),Promise.reject(t)})}const et="1.12.2",tt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const nt={};tt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+et+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new W(r(o," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!nt[o]&&(nt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},tt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const rt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new W("option "+i+" must be "+n,W.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new W("Unknown option "+i,W.ERR_BAD_OPTION)}},validators:tt},ot=rt.validators;let it=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ie,response:new ie}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(r){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=je(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&rt.assertOptions(n,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean)},!1),null!=r&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:rt.assertOptions(r,{encode:ot.function,serialize:ot.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rt.assertOptions(t,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&V.merge(o.common,o[t.method]);o&&V.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=_e.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,d=0;if(!a){const e=[Qe.bind(this),void 0];for(e.unshift(...s),e.push(...c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=s.length;let f=t;for(;d<l;){const e=s[d++],t=s[d++];try{f=e(f)}catch(p){t.call(this,p);break}}try{u=Qe.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return oe(Ne((e=je(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};V.forEach(["delete","get","head","options"],function(e){it.prototype[e]=function(t,n){return this.request(je(n||{},{method:e,url:t,data:(n||{}).data}))}}),V.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(je(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}it.prototype[e]=t(),it.prototype[e+"Form"]=t(!0)});const st={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(st).forEach(([e,t])=>{st[t]=e});const at=function e(t){const n=new it(t),o=r(it.prototype.request,n);return V.extend(o,it.prototype,n,{allOwnKeys:!0}),V.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(je(t,n))},o}(me);at.Axios=it,at.CanceledError=ke,at.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new ke(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},at.isCancel=ze,at.VERSION=et,at.toFormData=Q,at.AxiosError=W,at.Cancel=at.CanceledError,at.all=function(e){return Promise.all(e)},at.spread=function(e){return function(t){return e.apply(null,t)}},at.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},at.mergeConfig=je,at.AxiosHeaders=_e,at.formToJSON=e=>he(V.isHTMLForm(e)?new FormData(e):e),at.getAdapter=Xe,at.HttpStatusCode=st,at.default=at;const{Axios:ct,AxiosError:ut,CanceledError:lt,isCancel:dt,CancelToken:ft,VERSION:pt,all:ht,Cancel:mt,isAxiosError:gt,spread:vt,toFormData:yt,AxiosHeaders:bt,HttpStatusCode:wt,formToJSON:_t,getAdapter:Et,mergeConfig:zt}=at;function kt(e){const t="sandbox"===e?"https://sandbox.api.marlim.com.br":"https://api.marlim.com.br";if(!t)throw new Error("Base URL is not defined");return at.create({baseURL:t,timeout:1e4,headers:{"Content-Type":"application/json"}})}kt("sandbox"),kt("production");class Ot{constructor(e){n(this,"env"),n(this,"apiVersion"),n(this,"api"),n(this,"bearerToken"),this.apiVersion="v3",this.env=e.env,this.bearerToken=e.token,this.api=kt(this.env),this.api.interceptors.request.use(e=>(this.bearerToken&&(e.headers.Authorization=`Bearer ${this.bearerToken}`),e))}async createSetup(e){try{return(await this.api.post(`/${this.apiVersion}/3ds/setup`,e)).data}catch(t){throw this.handleError(t)}}async authenticate(e){try{return(await this.api.post(`/${this.apiVersion}/3ds/authenticate`,e)).data}catch(t){throw this.handleError(t)}}handleError(e){var t,n;return at.isAxiosError(e)?new Error((null==(n=null==(t=e.response)?void 0:t.data)?void 0:n.message)||"Request error."):e}}const xt={"01":{width:400,height:250},"02":{width:400,height:390},"03":{width:600,height:500},"04":{width:400,height:600},"05":{width:window.screen.width,height:window.screen.height}},St="step-up-iframe",At="step-up-form",Tt="challenge-modal-overlay";function Rt(){const e=document.getElementById(Tt);e&&(e.classList.remove("show"),document.body.classList.remove("challenge-modal-open"),setTimeout(()=>{Nt(document.getElementsByName(St)[0],document.getElementById(At),e,null)},300))}function Nt(e,t,n=null,r=null){e&&e.parentNode&&e.parentNode.removeChild(e),t&&t.parentNode&&t.parentNode.removeChild(t),n&&n.parentNode&&n.parentNode.removeChild(n),r&&r.parentNode&&r.parentNode.removeChild(r),document.body.classList.remove("challenge-modal-open")}async function Pt(e){return new Promise((t,n)=>{let r=null,o=null,i=null,s=null,a=null;try{!function(){if(document.getElementById("challenge-modal-css"))return;const e=document.createElement("style");e.id="challenge-modal-css",e.innerHTML="\n .challenge-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.6);\n z-index: 9998;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n visibility: hidden;\n }\n\n .challenge-modal-overlay.show {\n opacity: 1;\n visibility: visible;\n }\n\n .challenge-modal-wrapper {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .challenge-modal-container {\n position: relative;\n border-radius: 8px;\n box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);\n background: white;\n max-width: 90vw;\n max-height: 90vh;\n overflow: hidden;\n }\n\n .challenge-modal-iframe {\n border: none;\n border-radius: 8px;\n display: block;\n background: white;\n }\n\n .challenge-modal-close {\n position: absolute;\n top: -15px;\n right: -15px;\n width: 30px;\n height: 30px;\n border-radius: 50%;\n background: #333;\n color: white;\n border: 2px solid white;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: bold;\n z-index: 10000;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n line-height: 1;\n }\n\n @media (max-width: 768px) {\n .challenge-modal-container {\n margin: 20px;\n max-width: calc(100vw - 40px);\n max-height: calc(100vh - 40px);\n }\n \n .challenge-modal-iframe {\n width: 100% !important;\n min-height: 300px;\n }\n }\n\n body.challenge-modal-open {\n overflow: hidden;\n }\n ",document.head.appendChild(e)}();const n=function(e){const t=xt[e]||xt["01"];return"05"===e?{width:Math.min(.9*window.innerWidth,1200),height:Math.min(.9*window.innerHeight,800)}:t}(e.windowSize);i=function(){const e=document.createElement("div");return e.id=Tt,e.className="challenge-modal-overlay",document.body.appendChild(e),e}(),s=function(e){const t=document.createElement("div");return t.id="challenge-modal-container",t.className="challenge-modal-container",t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t}(n);const c=function(){const e=document.createElement("button");return e.className="challenge-modal-close",e.innerHTML="×",e.setAttribute("aria-label","Fechar modal"),e.addEventListener("click",Rt),e}();r=function(e){const t=document.createElement("iframe");return t.name=St,t.className="challenge-modal-iframe",t.height=e.height.toString(),t.width=e.width.toString(),t.setAttribute("allowfullscreen","true"),t.setAttribute("frameborder","0"),t}(n),o=function(e){const t=document.createElement("form");t.id=At,t.target=St,t.method="POST",t.action=e.url,t.style.display="none";const n=document.createElement("input");return n.type="hidden",n.name="JWT",n.value=e.accessToken,t.appendChild(n),document.body.appendChild(t),t}(e);const u=document.createElement("div");u.className="challenge-modal-wrapper",s.appendChild(r),u.appendChild(s),u.appendChild(c),i.appendChild(u),function(){const e=e=>{"Escape"===e.key&&Rt()};document.addEventListener("keydown",e),window.challengeModalKeyHandler=e}(),function(){const e=document.getElementById(Tt);e&&(document.body.classList.add("challenge-modal-open"),setTimeout(()=>{e.classList.add("show")},10))}(),a=function(e,t,n,r,o){return i=>{try{"completed"===i.data.status&&(console.log("Challenge completed"),Nt(e,t,n,r),o())}catch(s){console.error("Erro ao processar message do Session:",s)}}}(r,o,i,s,t),window.addEventListener("message",a,!1),o.submit()}catch(c){console.error("Erro ao processar desafio de autenticação:",c),Nt(r,o,i,s),n(c)}})}const jt="session-iframe";function $t(e){return new Promise((t,n)=>{const{env:r,accessToken:o,dataCollectionUrl:i}=e;let s=null,a=null;const c=()=>{!function(e){e&&window.removeEventListener("message",e)}(a)};try{!function(){const e=document.createElement("iframe");e.name=jt,e.height="1",e.width="1",e.style.display="none",document.body.appendChild(e)}(),s=function(e,t){const n=document.createElement("form");n.id="session-form",n.target=jt,n.method="POST",n.action=e;const r=document.createElement("input");return r.type="hidden",r.name="JWT",r.value=t,n.appendChild(r),document.body.appendChild(n),n}(i,o),a=function(e,t,n){return r=>{try{r.origin===("sandbox"===e?"https://centinelapistag.cardinalcommerce.com":"https://centinelapi.cardinalcommerce.com")&&"profile.completed"===JSON.parse(r.data).MessageType&&(console.log("Profile completed"),n(),t())}catch(o){console.error("Erro ao processar message do Session:",o)}}}(r,t,c),window.addEventListener("message",a,!1),s.submit()}catch(u){c(),n(u)}})}function Ct(){try{return"undefined"!=typeof window&&("undefined"!=typeof document&&("undefined"!=typeof Array&&"undefined"!=typeof Object))}catch(e){return!1}}function It(e,t,n){function r(n,r){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,r);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=r}const o=(null==n?void 0:n.Parent)??Object;class i extends o{}function s(e){var t;const o=(null==n?void 0:n.Parent)?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const n of o._zod.deferred)n();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>{var r,o;return!!((null==n?void 0:n.Parent)&&t instanceof n.Parent)||(null==(o=null==(r=null==t?void 0:t._zod)?void 0:r.traits)?void 0:o.has(e))}}),Object.defineProperty(s,"name",{value:e}),s}class Zt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ft extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Ut={};function Dt(e){return Ut}function Lt(e,t){return"bigint"==typeof t?t.toString():t}function Bt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Mt(e){return null==e}function qt(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Vt=Symbol("evaluating");function Wt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Vt)return void 0===r&&(r=Vt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Jt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ht(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Kt(e){return JSON.stringify(e)}const Gt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Yt=Bt(()=>{var e;if("undefined"!=typeof navigator&&(null==(e=null==navigator?void 0:navigator.userAgent)?void 0:e.includes("Cloudflare")))return!1;try{return new Function(""),!0}catch(t){return!1}});function Qt(e){if(!1===Xt(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Xt(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function en(e){return Qt(e)?{...e}:Array.isArray(e)?[...e]:e}const tn=new Set(["string","number","symbol"]);function nn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!(null==n?void 0:n.parent)||(r._zod.parent=e),r}function on(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==(null==t?void 0:t.message)){if(void 0!==(null==t?void 0:t.error))throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const sn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function an(e,t=0){var n;if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==(null==(n=e.issues[r])?void 0:n.continue))return!0;return!1}function cn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function un(e){return"string"==typeof e?e:null==e?void 0:e.message}function ln(e,t,n){var r,o,i,s,a,c;const u={...e,path:e.path??[]};if(!e.message){const l=un(null==(i=null==(o=null==(r=e.inst)?void 0:r._zod.def)?void 0:o.error)?void 0:i.call(o,e))??un(null==(s=null==t?void 0:t.error)?void 0:s.call(t,e))??un(null==(a=n.customError)?void 0:a.call(n,e))??un(null==(c=n.localeError)?void 0:c.call(n,e))??"Invalid input";u.message=l}return delete u.inst,delete u.continue,(null==t?void 0:t.reportInput)||delete u.input,u}function dn(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function fn(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const pn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Lt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hn=It("$ZodError",pn),mn=It("$ZodError",pn,{Parent:Error});const gn=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Zt;if(s.issues.length){const t=new((null==o?void 0:o.Err)??e)(s.issues.map(e=>ln(e,i,Dt())));throw Gt(t,null==o?void 0:o.callee),t}return s.value},vn=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new((null==o?void 0:o.Err)??e)(s.issues.map(e=>ln(e,i,Dt())));throw Gt(t,null==o?void 0:o.callee),t}return s.value},yn=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Zt;return i.issues.length?{success:!1,error:new(e??hn)(i.issues.map(e=>ln(e,o,Dt())))}:{success:!0,data:i.value}},bn=yn(mn),wn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>ln(e,o,Dt())))}:{success:!0,data:i.value}},_n=wn(mn),En=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gn(e)(t,n,o)},zn=e=>(t,n,r)=>gn(e)(t,n,r),kn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return vn(e)(t,n,o)},On=e=>async(t,n,r)=>vn(e)(t,n,r),xn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yn(e)(t,n,o)},Sn=e=>(t,n,r)=>yn(e)(t,n,r),An=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return wn(e)(t,n,o)},Tn=e=>async(t,n,r)=>wn(e)(t,n,r),Rn=/^[cC][^\s-]{8,}$/,Nn=/^[0-9a-z]+$/,Pn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jn=/^[0-9a-vA-V]{20}$/,$n=/^[A-Za-z0-9]{27}$/,Cn=/^[a-zA-Z0-9_-]{21}$/,In=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Fn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Un=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Dn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ln=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Bn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Mn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vn=/^[A-Za-z0-9_-]*$/,Wn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Jn=/^\+(?:[0-9]){6,14}[0-9]$/,Hn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Kn=new RegExp(`^${Hn}$`);function Gn(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Xn=/^-?\d+$/,Yn=/^-?\d+(?:\.\d+)?/,Qn=/^(?:true|false)$/i,er=/^[^A-Z]*$/,tr=/^[^a-z]*$/,nr=It("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rr={number:"number",bigint:"bigint",object:"date"},or=It("$ZodCheckLessThan",(e,t)=>{nr.init(e,t);const n=rr[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ir=It("$ZodCheckGreaterThan",(e,t)=>{nr.init(e,t);const n=rr[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sr=It("$ZodCheckMultipleOf",(e,t)=>{nr.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);(null==e?void 0:e[1])&&(o=Number.parseInt(e[1]))}const i=n>o?n:o;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ar=It("$ZodCheckNumberFormat",(e,t)=>{var n;nr.init(e,t),t.format=t.format||"float64";const r=null==(n=t.format)?void 0:n.includes("int"),o=r?"int":"number",[i,s]=sn[t.format];e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=s,r&&(n.pattern=Xn)}),e._zod.check=n=>{const a=n.value;if(r){if(!Number.isInteger(a))return void n.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?n.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):n.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}))}a<i&&n.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>s&&n.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}}),cr=It("$ZodCheckMaxLength",(e,t)=>{var n;nr.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Mt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=dn(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ur=It("$ZodCheckMinLength",(e,t)=>{var n;nr.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Mt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=dn(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),lr=It("$ZodCheckLengthEquals",(e,t)=>{var n;nr.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Mt(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=dn(r),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),dr=It("$ZodCheckStringFormat",(e,t)=>{var n,r;nr.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),fr=It("$ZodCheckRegex",(e,t)=>{dr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pr=It("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=er),dr.init(e,t)}),hr=It("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tr),dr.init(e,t)}),mr=It("$ZodCheckIncludes",(e,t)=>{nr.init(e,t);const n=nn(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),gr=It("$ZodCheckStartsWith",(e,t)=>{nr.init(e,t);const n=new RegExp(`^${nn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),vr=It("$ZodCheckEndsWith",(e,t)=>{nr.init(e,t);const n=new RegExp(`.*${nn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),yr=It("$ZodCheckOverwrite",(e,t)=>{nr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class br{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const o of r)this.content.push(o)}compile(){return new Function(...null==this?void 0:this.args,[...((null==this?void 0:this.content)??[""]).map(e=>` ${e}`)].join("\n"))}}const wr={major:4,minor:1,patch:12},_r=It("$ZodType",(e,t)=>{var n,r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wr;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const i of o)for(const t of i._zod.onattach)t(e);if(0===o.length)(r=e._zod).deferred??(r.deferred=[]),null==(n=e._zod.deferred)||n.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=an(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===(null==n?void 0:n.async))throw new Zt;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(o||(o=an(e,t)))});else{if(e.issues.length===t)continue;o||(o=an(e,t))}}return r?r.then(()=>e):e},n=(n,r,i)=>{if(an(n))return n.aborted=!0,n;const s=t(r,o,i);if(s instanceof Promise){if(!1===i.async)throw new Zt;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(r,i)=>{if(i.skipChecks)return e._zod.parse(r,i);if("backward"===i.direction){const t=e._zod.parse({value:r.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,i)):n(t,r,i)}const s=e._zod.parse(r,i);if(s instanceof Promise){if(!1===i.async)throw new Zt;return s.then(e=>t(e,o,i))}return t(s,o,i)}}e["~standard"]={validate:t=>{var n;try{const r=bn(e,t);return r.success?{value:r.data}:{issues:null==(n=r.error)?void 0:n.issues}}catch(r){return _n(e,t).then(e=>{var t;return e.success?{value:e.data}:{issues:null==(t=e.error)?void 0:t.issues}})}},vendor:"zod",version:1}}),Er=It("$ZodString",(e,t)=>{var n;_r.init(e,t),e._zod.pattern=[...(null==(n=null==e?void 0:e._zod.bag)?void 0:n.patterns)??[]].pop()??(e=>{const t=e?`[\\s\\S]{${(null==e?void 0:e.minimum)??0},${(null==e?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)})(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),zr=It("$ZodStringFormat",(e,t)=>{dr.init(e,t),Er.init(e,t)}),kr=It("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Zn),zr.init(e,t)}),Or=It("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Fn(e))}else t.pattern??(t.pattern=Fn());zr.init(e,t)}),xr=It("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Un),zr.init(e,t)}),Sr=It("$ZodURL",(e,t)=>{zr.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Wn.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ar=It("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),zr.init(e,t)}),Tr=It("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Cn),zr.init(e,t)}),Rr=It("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Rn),zr.init(e,t)}),Nr=It("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Nn),zr.init(e,t)}),Pr=It("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Pn),zr.init(e,t)}),jr=It("$ZodXID",(e,t)=>{t.pattern??(t.pattern=jn),zr.init(e,t)}),$r=It("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$n),zr.init(e,t)}),Cr=It("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Gn({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Hn}T(?:${r})$`)}(t)),zr.init(e,t)}),Ir=It("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Kn),zr.init(e,t)}),Zr=It("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Gn(t)}$`)),zr.init(e,t)}),Fr=It("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=In),zr.init(e,t)}),Ur=It("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Dn),zr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Dr=It("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ln),zr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Lr=It("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Bn),zr.init(e,t)}),Br=It("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Mn),zr.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Mr(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const qr=It("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=qn),zr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Mr(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const Vr=It("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Vn),zr.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!Vn.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Mr(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Wr=It("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Jn),zr.init(e,t)});const Jr=It("$ZodJWT",(e,t)=>{zr.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==(null==o?void 0:o.typ)||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Hr=It("$ZodNumber",(e,t)=>{_r.init(e,t),e._zod.pattern=e._zod.bag.pattern??Yn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(s){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),Kr=It("$ZodNumber",(e,t)=>{ar.init(e,t),Hr.init(e,t)}),Gr=It("$ZodBoolean",(e,t)=>{_r.init(e,t),e._zod.pattern=Qn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(i){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Xr=It("$ZodAny",(e,t)=>{_r.init(e,t),e._zod.parse=e=>e}),Yr=It("$ZodUnknown",(e,t)=>{_r.init(e,t),e._zod.parse=e=>e}),Qr=It("$ZodNever",(e,t)=>{_r.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function eo(e,t,n){e.issues.length&&t.issues.push(...cn(n,e.issues)),t.value[n]=e.value}const to=It("$ZodArray",(e,t)=>{_r.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>eo(t,n,e))):eo(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function no(e,t,n,r){e.issues.length&&t.issues.push(...cn(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function ro(e){var t,n,r,o;const i=Object.keys(e.shape);for(const c of i)if(!(null==(o=null==(r=null==(n=null==(t=e.shape)?void 0:t[c])?void 0:n._zod)?void 0:r.traits)?void 0:o.has("$ZodType")))throw new Error(`Invalid element at key "${c}": expected a Zod schema`);const s=(a=e.shape,Object.keys(a).filter(e=>"optional"===a[e]._zod.optin&&"optional"===a[e]._zod.optout));var a;return{...e,keys:i,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(s)}}function oo(e,t,n,r,o,i){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const l of Object.keys(t)){if(a.has(l))continue;if("never"===u){s.push(l);continue}const o=c.run({value:t[l],issues:[]},r);o instanceof Promise?e.push(o.then(e=>no(e,n,l,t))):no(o,n,l,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const io=It("$ZodObject",(e,t)=>{_r.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(null==n?void 0:n.get)){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Bt(()=>ro(t));Wt(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const o=Xt,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=s.shape;for(const e of s.keys){const r=u[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?c.push(r.then(n=>no(n,t,e,a))):no(r,t,e,a)}return i?oo(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),so=It("$ZodObjectJIT",(e,t)=>{io.init(e,t);const n=e._zod.parse,r=Bt(()=>ro(t));let o;const i=Xt,s=!Ut.jitless,a=s&&Yt.value,c=t.catchall;let u;e._zod.parse=(l,d)=>{u??(u=r.value);const f=l.value;return i(f)?s&&a&&!1===(null==d?void 0:d.async)&&!0!==d.jitless?(o||(o=(e=>{const t=new br(["shape","payload","ctx"]),n=r.value,o=e=>{const t=Kt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const r of n.keys)i[r]="key_"+s++;t.write("const newResult = {};");for(const r of n.keys){const e=i[r],n=Kt(r);t.write(`const ${e} = ${o(r)};`),t.write(`\n if (${e}.issues.length) {\n payload.issues = payload.issues.concat(${e}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${n}, ...iss.path] : [${n}]\n })));\n }\n \n \n if (${e}.value === undefined) {\n if (${n} in input) {\n newResult[${n}] = undefined;\n }\n } else {\n newResult[${n}] = ${e}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),l=o(l,d),c?oo([],f,l,d,u,e):l):n(l,d):(l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l)}});function ao(e,t,n,r){for(const i of e)if(0===i.issues.length)return t.value=i.value,t;const o=e.filter(e=>!an(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ln(e,r,Dt())))}),t)}const co=It("$ZodUnion",(e,t)=>{_r.init(e,t),Wt(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Wt(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Wt(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Wt(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>qt(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>ao(t,o,e,i)):ao(a,o,e,i)}}),uo=It("$ZodIntersection",(e,t)=>{_r.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>fo(e,t,n)):fo(e,o,i)}});function lo(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Qt(e)&&Qt(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const i of r){const n=lo(e[i],t[i]);if(!n.valid)return{valid:!1,mergeErrorPath:[i,...n.mergeErrorPath]};o[i]=n.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=lo(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function fo(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),an(e))return e;const r=lo(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const po=It("$ZodEnum",(e,t)=>{_r.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>tn.has(typeof e)).map(e=>"string"==typeof e?nn(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),ho=It("$ZodTransform",(e,t)=>{_r.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ft(e.constructor.name);const o=t.transform(n.value,n);if(r.async){return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n))}if(o instanceof Promise)throw new Zt;return n.value=o,n}});function mo(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const go=It("$ZodOptional",(e,t)=>{_r.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Wt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${qt(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>mo(t,e.value)):mo(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),vo=It("$ZodNullable",(e,t)=>{_r.init(e,t),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),Wt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${qt(e.source)}|null)$`):void 0}),Wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),yo=It("$ZodDefault",(e,t)=>{_r.init(e,t),e._zod.optin="optional",Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>bo(e,t)):bo(r,t)}});function bo(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const wo=It("$ZodPrefault",(e,t)=>{_r.init(e,t),e._zod.optin="optional",Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),_o=It("$ZodNonOptional",(e,t)=>{_r.init(e,t),Wt(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Eo(t,e)):Eo(o,e)}});function Eo(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const zo=It("$ZodCatch",(e,t)=>{_r.init(e,t),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),Wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ln(e,n,Dt()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ln(e,n,Dt()))},input:e.value}),e.issues=[]),e)}}),ko=It("$ZodPipe",(e,t)=>{_r.init(e,t),Wt(e._zod,"values",()=>t.in._zod.values),Wt(e._zod,"optin",()=>t.in._zod.optin),Wt(e._zod,"optout",()=>t.out._zod.optout),Wt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Oo(e,t.in,n)):Oo(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Oo(e,t.out,n)):Oo(r,t.out,n)}});function Oo(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const xo=It("$ZodReadonly",(e,t)=>{_r.init(e,t),Wt(e._zod,"propValues",()=>t.innerType._zod.propValues),Wt(e._zod,"values",()=>t.innerType._zod.values),Wt(e._zod,"optin",()=>t.innerType._zod.optin),Wt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(So):So(r)}});function So(e){return e.value=Object.freeze(e.value),e}const Ao=It("$ZodCustom",(e,t)=>{nr.init(e,t),_r.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>To(t,n,r,e));To(o,n,r,e)}});function To(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(fn(e))}}class Ro{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function No(){return new Ro}const Po=No();function jo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...on(t)})}function $o(e,t){return new or({check:"less_than",...on(t),value:e,inclusive:!1})}function Co(e,t){return new or({check:"less_than",...on(t),value:e,inclusive:!0})}function Io(e,t){return new ir({check:"greater_than",...on(t),value:e,inclusive:!1})}function Zo(e,t){return new ir({check:"greater_than",...on(t),value:e,inclusive:!0})}function Fo(e,t){return new sr({check:"multiple_of",...on(t),value:e})}function Uo(e,t){return new cr({check:"max_length",...on(t),maximum:e})}function Do(e,t){return new ur({check:"min_length",...on(t),minimum:e})}function Lo(e,t){return new lr({check:"length_equals",...on(t),length:e})}function Bo(e){return new yr({check:"overwrite",tx:e})}function Mo(e){const t=function(e,t){const n=new nr({check:"custom",...on(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(fn(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(fn(r))}},e(n.value,n)));return t}const qo=It("ZodISODateTime",(e,t)=>{Cr.init(e,t),mi.init(e,t)});function Vo(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...on(t)})}(qo,e)}const Wo=It("ZodISODate",(e,t)=>{Ir.init(e,t),mi.init(e,t)});function Jo(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...on(t)})}(Wo,e)}const Ho=It("ZodISOTime",(e,t)=>{Zr.init(e,t),mi.init(e,t)});function Ko(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...on(t)})}(Ho,e)}const Go=It("ZodISODuration",(e,t)=>{Fr.init(e,t),mi.init(e,t)});function Xo(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...on(t)})}(Go,e)}const Yo=It("ZodError",(e,t)=>{hn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e}));else if("invalid_key"===o.code)r({issues:o.issues});else if("invalid_element"===o.code)r({issues:o.issues});else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Lt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Lt,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Qo=gn(Yo),ei=vn(Yo),ti=yn(Yo),ni=wn(Yo),ri=En(Yo),oi=zn(Yo),ii=kn(Yo),si=On(Yo),ai=xn(Yo),ci=Sn(Yo),ui=An(Yo),li=Tn(Yo),di=It("ZodType",(e,t)=>(_r.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ht(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(t,n)=>rn(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Qo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ti(e,t,n),e.parseAsync=async(t,n)=>ei(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ni(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ri(e,t,n),e.decode=(t,n)=>oi(e,t,n),e.encodeAsync=async(t,n)=>ii(e,t,n),e.decodeAsync=async(t,n)=>si(e,t,n),e.safeEncode=(t,n)=>ai(e,t,n),e.safeDecode=(t,n)=>ci(e,t,n),e.safeEncodeAsync=async(t,n)=>ui(e,t,n),e.safeDecodeAsync=async(t,n)=>li(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...on(n)})}(us,e,t)}(t,n)),e.superRefine=t=>e.check(Mo(t)),e.overwrite=t=>e.check(Bo(t)),e.optional=()=>Qi(e),e.nullable=()=>ts(e),e.nullish=()=>Qi(ts(e)),e.nonoptional=t=>function(e,t){return new os({type:"nonoptional",innerType:e,...on(t)})}(e,t),e.array=()=>{return function(e,t,n){return new e({type:"array",element:t,...on(n)})}(qi,e,t);var t},e.or=t=>{return new Ji({type:"union",options:[e,t],...on(n)});var n},e.and=t=>new Hi({type:"intersection",left:e,right:t}),e.transform=t=>as(e,new Xi({type:"transform",transform:t})),e.default=t=>{return n=t,new ns({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():en(n)}});var n},e.prefault=t=>{return n=t,new rs({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():en(n)}});var n},e.catch=t=>{return new is({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>as(e,t),e.readonly=()=>new cs({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Po.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){var t;return null==(t=Po.get(e))?void 0:t.description},configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Po.get(e);const n=e.clone();return Po.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),fi=It("_ZodString",(e,t)=>{Er.init(e,t),di.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new fr({check:"string_format",format:"regex",...on(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new mr({check:"string_format",format:"includes",...on(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new gr({check:"string_format",format:"starts_with",...on(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new vr({check:"string_format",format:"ends_with",...on(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Do(...t)),e.max=(...t)=>e.check(Uo(...t)),e.length=(...t)=>e.check(Lo(...t)),e.nonempty=(...t)=>e.check(Do(1,...t)),e.lowercase=t=>e.check(function(e){return new pr({check:"string_format",format:"lowercase",...on(e)})}(t)),e.uppercase=t=>e.check(function(e){return new hr({check:"string_format",format:"uppercase",...on(e)})}(t)),e.trim=()=>e.check(Bo(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Bo(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Bo(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Bo(e=>e.toUpperCase()))}),pi=It("ZodString",(e,t)=>{Er.init(e,t),fi.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...on(t)})}(gi,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...on(t)})}(bi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...on(t)})}($i,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...on(t)})}(wi,t)),e.guid=t=>e.check(jo(vi,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...on(t)})}(yi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...on(t)})}(yi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...on(t)})}(yi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...on(t)})}(yi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...on(t)})}(_i,t)),e.guid=t=>e.check(jo(vi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...on(t)})}(Ei,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...on(t)})}(zi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...on(t)})}(ki,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...on(t)})}(Ni,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...on(t)})}(Pi,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...on(t)})}(Oi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...on(t)})}(xi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...on(t)})}(Si,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...on(t)})}(Ai,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...on(t)})}(Ti,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...on(t)})}(Ri,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...on(t)})}(ji,t)),e.datetime=t=>e.check(Vo(t)),e.date=t=>e.check(Jo(t)),e.time=t=>e.check(Ko(t)),e.duration=t=>e.check(Xo(t))});function hi(e){return function(e,t){return new e({type:"string",...on(t)})}(pi,e)}const mi=It("ZodStringFormat",(e,t)=>{zr.init(e,t),fi.init(e,t)}),gi=It("ZodEmail",(e,t)=>{xr.init(e,t),mi.init(e,t)}),vi=It("ZodGUID",(e,t)=>{kr.init(e,t),mi.init(e,t)}),yi=It("ZodUUID",(e,t)=>{Or.init(e,t),mi.init(e,t)}),bi=It("ZodURL",(e,t)=>{Sr.init(e,t),mi.init(e,t)}),wi=It("ZodEmoji",(e,t)=>{Ar.init(e,t),mi.init(e,t)}),_i=It("ZodNanoID",(e,t)=>{Tr.init(e,t),mi.init(e,t)}),Ei=It("ZodCUID",(e,t)=>{Rr.init(e,t),mi.init(e,t)}),zi=It("ZodCUID2",(e,t)=>{Nr.init(e,t),mi.init(e,t)}),ki=It("ZodULID",(e,t)=>{Pr.init(e,t),mi.init(e,t)}),Oi=It("ZodXID",(e,t)=>{jr.init(e,t),mi.init(e,t)}),xi=It("ZodKSUID",(e,t)=>{$r.init(e,t),mi.init(e,t)}),Si=It("ZodIPv4",(e,t)=>{Ur.init(e,t),mi.init(e,t)}),Ai=It("ZodIPv6",(e,t)=>{Dr.init(e,t),mi.init(e,t)}),Ti=It("ZodCIDRv4",(e,t)=>{Lr.init(e,t),mi.init(e,t)}),Ri=It("ZodCIDRv6",(e,t)=>{Br.init(e,t),mi.init(e,t)}),Ni=It("ZodBase64",(e,t)=>{qr.init(e,t),mi.init(e,t)}),Pi=It("ZodBase64URL",(e,t)=>{Vr.init(e,t),mi.init(e,t)}),ji=It("ZodE164",(e,t)=>{Wr.init(e,t),mi.init(e,t)}),$i=It("ZodJWT",(e,t)=>{Jr.init(e,t),mi.init(e,t)}),Ci=It("ZodNumber",(e,t)=>{Hr.init(e,t),di.init(e,t),e.gt=(t,n)=>e.check(Io(t,n)),e.gte=(t,n)=>e.check(Zo(t,n)),e.min=(t,n)=>e.check(Zo(t,n)),e.lt=(t,n)=>e.check($o(t,n)),e.lte=(t,n)=>e.check(Co(t,n)),e.max=(t,n)=>e.check(Co(t,n)),e.int=t=>e.check(Zi(t)),e.safe=t=>e.check(Zi(t)),e.positive=t=>e.check(Io(0,t)),e.nonnegative=t=>e.check(Zo(0,t)),e.negative=t=>e.check($o(0,t)),e.nonpositive=t=>e.check(Co(0,t)),e.multipleOf=(t,n)=>e.check(Fo(t,n)),e.step=(t,n)=>e.check(Fo(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});const Ii=It("ZodNumberFormat",(e,t)=>{Kr.init(e,t),Ci.init(e,t)});function Zi(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...on(t)})}(Ii,e)}const Fi=It("ZodBoolean",(e,t)=>{Gr.init(e,t),di.init(e,t)});const Ui=It("ZodAny",(e,t)=>{Xr.init(e,t),di.init(e,t)});const Di=It("ZodUnknown",(e,t)=>{Yr.init(e,t),di.init(e,t)});function Li(){return new Di({type:"unknown"})}const Bi=It("ZodNever",(e,t)=>{Qr.init(e,t),di.init(e,t)});function Mi(e){return function(e,t){return new e({type:"never",...on(t)})}(Bi,e)}const qi=It("ZodArray",(e,t)=>{to.init(e,t),di.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Do(t,n)),e.nonempty=t=>e.check(Do(1,t)),e.max=(t,n)=>e.check(Uo(t,n)),e.length=(t,n)=>e.check(Lo(t,n)),e.unwrap=()=>e.element});const Vi=It("ZodObject",(e,t)=>{so.init(e,t),di.init(e,t),Wt(e,"shape",()=>t.shape),e.keyof=()=>Gi(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Li()}),e.loose=()=>e.clone({...e._zod.def,catchall:Li()}),e.strict=()=>e.clone({...e._zod.def,catchall:Mi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Qt(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=Ht(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Jt(this,"shape",n),n},checks:[]});return rn(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Qt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Jt(this,"shape",n),n},checks:e._zod.def.checks};return rn(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ht(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Jt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return rn(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return rn(e,Ht(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Jt(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=Ht(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Jt(this,"shape",r),r},checks:[]});return rn(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Ht(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Jt(this,"shape",o),o},checks:[]});return rn(t,r)}(Yi,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Ht(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return Jt(this,"shape",o),o},checks:[]});return rn(t,r)}(os,e,t[0])});function Wi(e,t){const n={type:"object",shape:e??{},...on(t)};return new Vi(n)}const Ji=It("ZodUnion",(e,t)=>{co.init(e,t),di.init(e,t),e.options=t.options});const Hi=It("ZodIntersection",(e,t)=>{uo.init(e,t),di.init(e,t)});const Ki=It("ZodEnum",(e,t)=>{po.init(e,t),di.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Ki({...t,checks:[],...on(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Ki({...t,checks:[],...on(r),entries:o})}});function Gi(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ki({type:"enum",entries:n,...on(t)})}const Xi=It("ZodTransform",(e,t)=>{ho.init(e,t),di.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Ft(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(fn(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(fn(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}});const Yi=It("ZodOptional",(e,t)=>{go.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qi(e){return new Yi({type:"optional",innerType:e})}const es=It("ZodNullable",(e,t)=>{vo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ts(e){return new es({type:"nullable",innerType:e})}const ns=It("ZodDefault",(e,t)=>{yo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const rs=It("ZodPrefault",(e,t)=>{wo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});const os=It("ZodNonOptional",(e,t)=>{_o.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});const is=It("ZodCatch",(e,t)=>{zo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const ss=It("ZodPipe",(e,t)=>{ko.init(e,t),di.init(e,t),e.in=t.in,e.out=t.out});function as(e,t){return new ss({type:"pipe",in:e,out:t})}const cs=It("ZodReadonly",(e,t)=>{xo.init(e,t),di.init(e,t),e.unwrap=()=>e._zod.def.innerType});const us=It("ZodCustom",(e,t)=>{Ao.init(e,t),di.init(e,t)});const ls=Wi({token:hi({message:"token is required"}),env:Gi(["sandbox","production"],{message:"env is required and only sandbox or production are supported"})});const ds={amount:(fs={error:"Amount is required"},function(e,t){return new e({type:"number",checks:[],...on(t)})}(Ci,fs)),card_hash:hi().optional(),card:Wi({number:hi({error:"Card number is required"}),expirationDate:hi().refine(function(e){if(!/^(0[1-9]|1[0-2])\d{2}$/.test(e))return!1;const t=parseInt(e.substring(0,2),10),n=2e3+parseInt(e.substring(2),10),r=new Date,o=r.getFullYear(),i=r.getMonth()+1;return!(n<o)&&!(n===o&&t<i)},{error:"Invalid expiration date"}),cvv:hi({error:"CVV is required"}).regex(/^\d{3,4}$/,{message:"CVV must be 3 or 4 digits"}),holderName:hi({error:"Holder name is required"})}).optional(),customer:Wi({name:hi({error:"Name is required"}),documentNumber:hi({error:"Document number is required"}).regex(/^\d+$/,{message:"Document number must not contain special characters"}),email:hi({error:"Invalid email"}),phone:Wi({number:hi({error:"Phone number is required"}),areaCode:hi({error:"Area code is required"}),countryCode:hi({error:"Country code is required"})}),address:Wi({country:hi({error:"Country is required"}),state:hi({error:"State is required"}),city:hi({error:"City is required"}),neighborhood:hi({error:"Neighborhood is required"}),number:hi({error:"Number is required"}),street:hi({error:"Street is required"}),zipcode:hi({error:"Zipcode is required"}),complement:hi().optional()})})};var fs;const ps=Wi({...ds,challenge:function(e){return function(e,t){return new e({type:"boolean",...on(t)})}(Fi,e)}().default(!1)}).refine(e=>e.card_hash||e.card,{error:"At least one of card_hash, or card must be provided"}).refine(e=>1===[e.card_hash,e.card].filter(Boolean).length,{error:"Only one of card_hash, or card can be provided"}),hs=Wi({...ds,challenge:new Ui({type:"any"}).refine(e=>void 0===e,{error:"The field 'challenge' is only allowed in test environments."})}).refine(e=>e.card_hash||e.card,{error:"At least one of card_id, card_hash, or card must be provided"}).refine(e=>1===[e.card_hash,e.card].filter(Boolean).length,{error:"Only one of card_id, card_hash, or card can be provided"});let ms=null;return e.authenticate=async function(e){if(!ms)throw new Error("Marlim SDK not initialized");const t=("sandbox"===ms.env?ps:hs).safeParse(e);if(!t.success)throw new Error(t.error.message);const n={token:ms.token,env:ms.env},r=t.data.card,o=t.data.customer,i=t.data.card_hash,s=await async function(e,t){try{const n=new Ot(e),r=await n.createSetup(t),{access_token:o,data_collection_url:i,session_id:s,card_id:a}=r;if(!o||!i)throw new Error("Invalid API response: access_token or data_collection_url are missing.");return await $t({accessToken:o,dataCollectionUrl:i,env:e.env}),{sessionId:s,cardId:a}}catch(n){let e="Error creating 3DS session";throw n instanceof Error&&(e=n.message),new Error(e)}}(n,{card_hash:i,card_cvv:null==r?void 0:r.cvv,card_expiration_date:null==r?void 0:r.expirationDate,card_holder_name:null==r?void 0:r.holderName,card_number:null==r?void 0:r.number}),a={challenge:t.data.challenge,amount:t.data.amount,card_id:s.cardId,session_id:s.sessionId,customer:{name:o.name,document_number:o.documentNumber,email:o.email,phone:{number:o.phone.number,area_code:o.phone.areaCode,country_code:o.phone.countryCode},address:{country:o.address.country,state:o.address.state,city:o.address.city,neighborhood:o.address.neighborhood,number:o.address.number,street:o.address.street,zipcode:o.address.zipcode,complement:o.address.complement}},device:{channel:"BROWSER",color_depth:window.screen.colorDepth,screen_height:window.screen.height,screen_width:window.screen.width,time_zone_offset:(new Date).getTimezoneOffset().toString(),java_enabled:!!window.WebGLRenderingContext,javascript_enabled:Ct()}},c=await function(e,t){return new Promise(async(n,r)=>{try{const r=new Ot(e),o=await r.authenticate(t);if(o.challenge)return await Pt({url:o.challenge.url,accessToken:o.challenge.access_token,windowSize:o.challenge.window_size}),n({threedsAuthenticationId:o.authentication_id});n({threedsAuthenticationId:o.authentication_id})}catch(o){let e="Error 3DS authentication";o instanceof Error&&(e=o.message),r(e)}})}(n,a);return{card_id:s.cardId,threeds_authentication_id:c.threedsAuthenticationId}},e.init=function(e){if("undefined"==typeof window||"undefined"==typeof document)throw new Error("Marlim3dsSdk can only be called in a browser environment.");const t=ls.safeParse(e);if(!t.success)throw new Error(t.error.message);ms=t.data},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});
|
|
@@ -93,4 +93,8 @@ type ThreedsAuthenticateParams = {
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
|
-
|
|
96
|
+
type ThreedsAuthenticateResult = {
|
|
97
|
+
card_id: string;
|
|
98
|
+
threeds_authentication_id: string;
|
|
99
|
+
};
|
|
100
|
+
export { getThreedsAuthenticateSchema, type ThreedsAuthenticateParams, type ThreedsAuthenticateResult, };
|