@blux.ai/web-sdk 2.2.13 → 2.2.14
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/.tsbuildinfo.noEmit +1 -1
- package/dist/BluxClient.d.ts +0 -2
- package/dist/BluxClient.js +70 -41
- package/dist/BluxClient.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/utils/observables.js +13 -17
- package/dist/utils/observables.js.map +1 -1
- package/package.json +1 -1
- package/scripts/cafe24/.tsbuildinfo.noEmit +1 -0
- package/scripts/cafe24/dist/.temp/index.d.ts +1 -0
- package/scripts/cafe24/dist/blux_collector.js +1 -0
- package/scripts/cafe24/dist/custom_scripts/daiso.d.ts +1 -0
- package/scripts/cafe24/dist/custom_scripts/daiso.js +114 -0
- package/scripts/cafe24/dist/custom_scripts/nerdy.d.ts +16 -0
- package/scripts/cafe24/dist/custom_scripts/nerdy.js +734 -0
- package/scripts/cafe24/dist/custom_scripts/vogoplay.d.ts +6 -0
- package/scripts/cafe24/dist/custom_scripts/vogoplay.js +147 -0
- package/scripts/cafe24/dist/deploy_all.d.ts +1 -0
- package/scripts/cafe24/dist/tsconfig.tsbuildinfo +1 -0
- package/scripts/sdk/.tsbuildinfo.noEmit +1 -0
- package/scripts/sdk/dist/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={576:e=>{for(var t=Math.floor(16777215*Math.random()),n=d.index=parseInt(16777215*Math.random(),10),r=("undefined"==typeof process||"number"!=typeof process.pid?Math.floor(1e5*Math.random()):process.pid)%65535,i=(()=>{try{return _Buffer}catch(e){try{return Buffer}catch(e){return null}}})(),s=function(e){return!(null==e||!e.constructor||"function"!=typeof e.constructor.isBuffer||!e.constructor.isBuffer(e))},a=[],o=0;o<256;o++)a[o]=(o<=15?"0":"")+o.toString(16);var c=new RegExp("^[0-9a-fA-F]{24}$"),u=[];for(o=0;o<10;)u[48+o]=o++;for(;o<16;)u[55+o]=u[87+o]=o++;function d(e){if(!(this instanceof d))return new d(e);if(e&&(e instanceof d||"ObjectID"===e._bsontype))return e;if(this._bsontype="ObjectID",null!=e&&"number"!=typeof e){var t=d.isValid(e);if(!t&&null!=e)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(t&&"string"==typeof e&&24===e.length)return d.createFromHexString(e);if(null==e||12!==e.length){if(null!=e&&"function"==typeof e.toHexString)return e;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=e}else this.id=this.generate(e)}e.exports=d,d.default=d,d.createFromTime=function(e){return new d((8===(t=(t=e=parseInt(e,10)%4294967295).toString(16)).length?t:"00000000".substring(t.length,8)+t)+"0000000000000000");var t},d.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var t="",n=0;n<24;)t+=String.fromCharCode(u[e.charCodeAt(n++)]<<4|u[e.charCodeAt(n++)]);return new d(t)},d.isValid=function(e){return null!=e&&("number"==typeof e||("string"==typeof e?12===e.length||24===e.length&&c.test(e):e instanceof d||(s(e)?d.isValid(e.toString("hex")):!("function"!=typeof e.toHexString||!i||!(e.id instanceof i||"string"==typeof e.id))&&(12===e.id.length||24===e.id.length&&c.test(e.id)))))},d.prototype={constructor:d,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(s(this.id))return this.id.toString("hex");for(var e="",t=0;t<this.id.length;t++)e+=a[this.id.charCodeAt(t)];return e},equals:function(e){return e instanceof d?this.toString()===e.toString():"string"==typeof e&&d.isValid(e)&&12===e.length&&s(this.id)?e===this.id.toString("binary"):"string"==typeof e&&d.isValid(e)&&24===e.length?e.toLowerCase()===this.toHexString():"string"==typeof e&&d.isValid(e)&&12===e.length?e===this.id:!(null==e||!(e instanceof d||e.toHexString))&&e.toHexString()===this.toHexString()},getTimestamp:function(){var e,t=new Date;return e=s(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(1e3*Math.floor(e)),t},generate:function(e){"number"!=typeof e&&(e=~~(Date.now()/1e3)),e=parseInt(e,10)%4294967295;var i=n=(n+1)%16777215;return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e,t>>16&255,t>>8&255,255&t,r>>8&255,255&r,i>>16&255,i>>8&255,255&i)}};var l=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";d.prototype[l]=function(){return"ObjectID("+this+")"},d.prototype.toJSON=d.prototype.toHexString,d.prototype.toString=d.prototype.toHexString},822:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",s="hour",a="day",o="week",c="month",u="quarter",d="year",l="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,c),s=n-i<0,a=t.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-a:a-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:o,d:a,D:l,h:s,m:i,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",_={};_[v]=m;var b="$isDayjsObject",w=function(e){return e instanceof E||!(!e||!e[b])},x=function e(t,n,r){var i;if(!t)return v;if("string"==typeof t){var s=t.toLowerCase();_[s]&&(i=s),n&&(_[s]=n,i=s);var a=t.split("-");if(!i&&a.length>1)return e(a[0])}else{var o=t.name;_[o]=t,i=o}return!r&&i&&(v=i),i||!r&&v},S=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new E(n)},k=y;k.l=x,k.i=w,k.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function m(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(k.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return k},g.isValid=function(){return!(this.$d.toString()===p)},g.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return S(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<S(e)},g.$g=function(e,t,n){return k.u(e)?this[t]:this.set(n,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var n=this,u=!!k.u(t)||t,p=k.p(e),h=function(e,t){var r=k.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return u?r:r.endOf(a)},f=function(e,t){return k.w(n.toDate()[e].apply(n.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(p){case d:return u?h(1,0):h(31,11);case c:return u?h(1,g):h(0,g+1);case o:var _=this.$locale().weekStart||0,b=(m<_?m+7:m)-_;return h(u?y-b:y+(6-b),g);case a:case l:return f(v+"Hours",0);case s:return f(v+"Minutes",1);case i:return f(v+"Seconds",2);case r:return f(v+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var o,u=k.p(e),p="set"+(this.$u?"UTC":""),h=(o={},o[a]=p+"Date",o[l]=p+"Date",o[c]=p+"Month",o[d]=p+"FullYear",o[s]=p+"Hours",o[i]=p+"Minutes",o[r]=p+"Seconds",o[n]=p+"Milliseconds",o)[u],f=u===a?this.$D+(t-this.$W):t;if(u===c||u===d){var m=this.clone().set(l,1);m.$d[h](f),m.init(),this.$d=m.set(l,Math.min(this.$D,m.daysInMonth())).$d}else h&&this.$d[h](f);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[k.p(e)]()},g.add=function(n,u){var l,p=this;n=Number(n);var h=k.p(u),f=function(e){var t=S(p);return k.w(t.date(t.date()+Math.round(e*n)),p)};if(h===c)return this.set(c,this.$M+n);if(h===d)return this.set(d,this.$y+n);if(h===a)return f(1);if(h===o)return f(7);var m=(l={},l[i]=e,l[s]=t,l[r]=1e3,l)[h]||1,g=this.$d.getTime()+n*m;return k.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),s=this.$H,a=this.$m,o=this.$M,c=n.weekdays,u=n.months,d=n.meridiem,l=function(e,n,i,s){return e&&(e[n]||e(t,r))||i[n].slice(0,s)},h=function(e){return k.s(s%12||12,e,"0")},m=d||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(f,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return k.s(t.$y,4,"0");case"M":return o+1;case"MM":return k.s(o+1,2,"0");case"MMM":return l(n.monthsShort,o,u,3);case"MMMM":return l(u,o);case"D":return t.$D;case"DD":return k.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return l(n.weekdaysMin,t.$W,c,2);case"ddd":return l(n.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(s);case"HH":return k.s(s,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return m(s,a,!0);case"A":return m(s,a,!1);case"m":return String(a);case"mm":return k.s(a,2,"0");case"s":return String(t.$s);case"ss":return k.s(t.$s,2,"0");case"SSS":return k.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,l,p){var h,f=this,m=k.p(l),g=S(n),y=(g.utcOffset()-this.utcOffset())*e,v=this-g,_=function(){return k.m(f,g)};switch(m){case d:h=_()/12;break;case c:h=_();break;case u:h=_()/3;break;case o:h=(v-y)/6048e5;break;case a:h=(v-y)/864e5;break;case s:h=v/t;break;case i:h=v/e;break;case r:h=v/1e3;break;default:h=v}return p?h:k.a(h)},g.daysInMonth=function(){return this.endOf(c).$D},g.$locale=function(){return _[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=x(e,t,!0);return r&&(n.$L=r),n},g.clone=function(){return k.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),T=E.prototype;return S.prototype=T,[["$ms",n],["$s",r],["$m",i],["$H",s],["$W",a],["$M",c],["$y",d],["$D",l]].forEach((function(e){T[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,E,S),e.$i=!0),S},S.locale=x,S.isDayjs=w,S.unix=function(e){return S(1e3*e)},S.en=_[v],S.Ls=_,S.p={},S}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};function t(e,t){return function(){return e.apply(t,arguments)}}n.r(e),n.d(e,{hasBrowserEnv:()=>le,hasStandardBrowserEnv:()=>he,hasStandardBrowserWebWorkerEnv:()=>fe,navigator:()=>pe,origin:()=>me});const{toString:r}=Object.prototype,{getPrototypeOf:i}=Object,s=(a=Object.create(null),e=>{const t=r.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const o=e=>(e=e.toLowerCase(),t=>s(t)===e),c=e=>t=>typeof t===e,{isArray:u}=Array,d=c("undefined"),l=o("ArrayBuffer"),p=c("string"),h=c("function"),f=c("number"),m=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},y=o("Date"),v=o("File"),_=o("Blob"),b=o("FileList"),w=o("URLSearchParams"),[x,S,k,E]=["ReadableStream","Request","Response","Headers"].map(o);function T(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),u(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(r=0;r<s;r++)a=i[r],t.call(null,e[a],a,e)}}function O(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,A=e=>!d(e)&&e!==I,P=(R="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>R&&e instanceof R);var R;const C=o("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M=o("RegExp"),j=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};T(n,((n,i)=>{let s;!1!==(s=t(n,i,e))&&(r[i]=s||n)})),Object.defineProperties(e,r)},U="abcdefghijklmnopqrstuvwxyz",$="0123456789",D={DIGIT:$,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+$},L=o("AsyncFunction"),Z=(B="function"==typeof setImmediate,F=h(I.postMessage),B?setImmediate:F?(z=`axios@${Math.random()}`,V=[],I.addEventListener("message",(({source:e,data:t})=>{e===I&&t===z&&V.length&&V.shift()()}),!1),e=>{V.push(e),I.postMessage(z,"*")}):e=>setTimeout(e));var B,F,z,V;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||Z,q={isArray:u,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||h(e.append)&&("formdata"===(t=s(e))||"object"===t&&h(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:p,isNumber:f,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:g,isReadableStream:x,isRequest:S,isResponse:k,isHeaders:E,isUndefined:d,isDate:y,isFile:v,isBlob:_,isRegExp:M,isFunction:h,isStream:e=>m(e)&&h(e.pipe),isURLSearchParams:w,isTypedArray:P,isFileList:b,forEach:T,merge:function e(){const{caseless:t}=A(this)&&this||{},n={},r=(r,i)=>{const s=t&&O(n,i)||i;g(n[s])&&g(r)?n[s]=e(n[s],r):g(r)?n[s]=e({},r):u(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&T(arguments[e],r);return n},extend:(e,n,r,{allOwnKeys:i}={})=>(T(n,((n,i)=>{r&&h(n)?e[i]=t(n,r):e[i]=n}),{allOwnKeys:i}),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 s,a,o;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)o=s[a],r&&!r(o,e,t)||c[o]||(t[o]=e[o],c[o]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:o,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(u(e))return e;let t=e.length;if(!f(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).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:C,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:j,freezeMethods:e=>{j(e,((t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];h(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 u(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:O,global:I,isContextDefined:A,ALPHABET:D,generateString:(e=16,t=D.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=u(e)?[]:{};return T(e,((e,t)=>{const s=n(e,r+1);!d(s)&&(i[t]=s)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:L,isThenable:e=>e&&(m(e)||h(e))&&h(e.then)&&h(e.catch),setImmediate:Z,asap:H};function K(e,t,n,r,i){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),i&&(this.response=i,this.status=i.status?i.status:null)}q.inherits(K,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:q.toJSONObject(this.config),code:this.code,status:this.status}}});const W=K.prototype,G={};["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=>{G[e]={value:e}})),Object.defineProperties(K,G),Object.defineProperty(W,"isAxiosError",{value:!0}),K.from=(e,t,n,r,i,s)=>{const a=Object.create(W);return q.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),K.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};const J=K;function Y(e){return q.isPlainObject(e)||q.isArray(e)}function Q(e){return q.endsWith(e,"[]")?e.slice(0,-2):e}function X(e,t,n){return e?e.concat(t).map((function(e,t){return e=Q(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ee=q.toFlatObject(q,{},null,(function(e){return/^is[A-Z]/.test(e)})),te=function(e,t,n){if(!q.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!q.isUndefined(t[e])}))).metaTokens,i=n.visitor||u,s=n.dots,a=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&q.isSpecCompliantForm(t);if(!q.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(q.isDate(e))return e.toISOString();if(!o&&q.isBlob(e))throw new J("Blob is not supported. Use a Buffer instead.");return q.isArrayBuffer(e)||q.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let o=e;if(e&&!i&&"object"==typeof e)if(q.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(q.isArray(e)&&function(e){return q.isArray(e)&&!e.some(Y)}(e)||(q.isFileList(e)||q.endsWith(n,"[]"))&&(o=q.toArray(e)))return n=Q(n),o.forEach((function(e,r){!q.isUndefined(e)&&null!==e&&t.append(!0===a?X([n],r,s):null===a?n:n+"[]",c(e))})),!1;return!!Y(e)||(t.append(X(i,n,s),c(e)),!1)}const d=[],l=Object.assign(ee,{defaultVisitor:u,convertValue:c,isVisitable:Y});if(!q.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!q.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),q.forEach(n,(function(n,s){!0===(!(q.isUndefined(n)||null===n)&&i.call(t,n,q.isString(s)?s.trim():s,r,l))&&e(n,r?r.concat(s):[s])})),d.pop()}}(e),t};function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function re(e,t){this._pairs=[],e&&te(e,this,t)}const ie=re.prototype;ie.append=function(e,t){this._pairs.push([e,t])},ie.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const se=re;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function oe(e,t,n){if(!t)return e;const r=n&&n.encode||ae,i=n&&n.serialize;let s;if(s=i?i(t,n):q.isURLSearchParams(t)?t.toString():new se(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const ce=class{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){q.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},de={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:se,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},le="undefined"!=typeof window&&"undefined"!=typeof document,pe="object"==typeof navigator&&navigator||void 0,he=le&&(!pe||["ReactNative","NativeScript","NS"].indexOf(pe.product)<0),fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,me=le&&window.location.href||"http://localhost",ge={...e,...de},ye=function(e){function t(e,n,r,i){let s=e[i++];if("__proto__"===s)return!0;const a=Number.isFinite(+s),o=i>=e.length;return s=!s&&q.isArray(r)?r.length:s,o?(q.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!a):(r[s]&&q.isObject(r[s])||(r[s]=[]),t(e,n,r[s],i)&&q.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}(r[s])),!a)}if(q.isFormData(e)&&q.isFunction(e.entries)){const n={};return q.forEachEntry(e,((e,r)=>{t(function(e){return q.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},ve={transitional:ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=q.isObject(e);if(i&&q.isHTMLForm(e)&&(e=new FormData(e)),q.isFormData(e))return r?JSON.stringify(ye(e)):e;if(q.isArrayBuffer(e)||q.isBuffer(e)||q.isStream(e)||q.isFile(e)||q.isBlob(e)||q.isReadableStream(e))return e;if(q.isArrayBufferView(e))return e.buffer;if(q.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ge.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ge.isNode&&q.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=q.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e){if(q.isString(e))try{return(0,JSON.parse)(e),q.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ve.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(q.isResponse(e)||q.isReadableStream(e))return e;if(e&&q.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw J.from(e,J.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ge.classes.FormData,Blob:ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};q.forEach(["delete","get","head","post","put","patch"],(e=>{ve.headers[e]={}}));const _e=ve,be=q.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"]),we=Symbol("internals");function xe(e){return e&&String(e).trim().toLowerCase()}function Se(e){return!1===e||null==e?e:q.isArray(e)?e.map(Se):String(e)}function ke(e,t,n,r,i){return q.isFunction(r)?r.call(this,t,n):(i&&(t=n),q.isString(t)?q.isString(r)?-1!==t.indexOf(r):q.isRegExp(r)?r.test(t):void 0:void 0)}class Ee{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=xe(t);if(!i)throw new Error("header name must be a non-empty string");const s=q.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Se(e))}const s=(e,t)=>q.forEach(e,((e,n)=>i(e,n,t)));if(q.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(q.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&be[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(q.isHeaders(e))for(const[t,r]of e.entries())i(r,t,n);else null!=e&&i(t,e,n);return this}get(e,t){if(e=xe(e)){const n=q.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(q.isFunction(t))return t.call(this,e,n);if(q.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=xe(e)){const n=q.findKey(this,e);return!(!n||void 0===this[n]||t&&!ke(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=xe(e)){const i=q.findKey(n,e);!i||t&&!ke(0,n[i],i,t)||(delete n[i],r=!0)}}return q.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!ke(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return q.forEach(this,((r,i)=>{const s=q.findKey(n,i);if(s)return t[s]=Se(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete t[i],t[a]=Se(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return q.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&q.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")}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[we]=this[we]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=xe(e);t[r]||(function(e,t){const n=q.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return q.isArray(e)?e.forEach(r):r(e),this}}Ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),q.reduceDescriptors(Ee.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),q.freezeMethods(Ee);const Te=Ee;function Oe(e,t){const n=this||_e,r=t||n,i=Te.from(r.headers);let s=r.data;return q.forEach(e,(function(e){s=e.call(n,s,i.normalize(),t?t.status:void 0)})),i.normalize(),s}function Ie(e){return!(!e||!e.__CANCEL__)}function Ae(e,t,n){J.call(this,null==e?"canceled":e,J.ERR_CANCELED,t,n),this.name="CanceledError"}q.inherits(Ae,J,{__CANCEL__:!0});const Pe=Ae;function Re(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new J("Request failed with status code "+n.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Ce=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,s=0,a=0;return t=void 0!==t?t:1e3,function(o){const c=Date.now(),u=r[a];i||(i=c),n[s]=o,r[s]=c;let d=a,l=0;for(;d!==s;)l+=n[d++],d%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),c-i<t)return;const p=u&&c-u;return p?Math.round(1e3*l/p):void 0}}(50,250);return function(e,t){let n,r,i=0,s=1e3/t;const a=(t,s=Date.now())=>{i=s,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),o=t-i;o>=s?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),s-o)))},()=>n&&a(n)]}((n=>{const s=n.loaded,a=n.lengthComputable?n.total:void 0,o=s-r,c=i(o);r=s,e({loaded:s,total:a,progress:a?s/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&s<=a?(a-s)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},Ne=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Me=e=>(...t)=>q.asap((()=>e(...t))),je=ge.hasStandardBrowserEnv?function(){const e=ge.navigator&&/(msie|trident)/i.test(ge.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=q.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},Ue=ge.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const a=[e+"="+encodeURIComponent(t)];q.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),q.isString(r)&&a.push("path="+r),q.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.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 $e(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const De=e=>e instanceof Te?{...e}:e;function Le(e,t){t=t||{};const n={};function r(e,t,n){return q.isPlainObject(e)&&q.isPlainObject(t)?q.merge.call({caseless:n},e,t):q.isPlainObject(t)?q.merge({},t):q.isArray(t)?t.slice():t}function i(e,t,n){return q.isUndefined(t)?q.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!q.isUndefined(t))return r(void 0,t)}function a(e,t){return q.isUndefined(t)?q.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function o(n,i,s){return s in t?r(n,i):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>i(De(e),De(t),!0)};return q.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||i,a=s(e[r],t[r],r);q.isUndefined(a)&&s!==o||(n[r]=a)})),n}const Ze=e=>{const t=Le({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:c}=t;if(t.headers=o=Te.from(o),t.url=oe($e(t.baseURL,t.url),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),q.isFormData(r))if(ge.hasStandardBrowserEnv||ge.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(!1!==(n=o.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}if(ge.hasStandardBrowserEnv&&(i&&q.isFunction(i)&&(i=i(t)),i||!1!==i&&je(t.url))){const e=s&&a&&Ue.read(a);e&&o.set(s,e)}return t},Be="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ze(e);let i=r.data;const s=Te.from(r.headers).normalize();let a,o,c,u,d,{responseType:l,onUploadProgress:p,onDownloadProgress:h}=r;function f(){u&&u(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Te.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Re((function(e){t(e),f()}),(function(e){n(e),f()}),{data:l&&"text"!==l&&"json"!==l?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 J("Request aborted",J.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new J("Network Error",J.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||ue;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new J(t,i.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,m)),m=null},void 0===i&&s.setContentType(null),"setRequestHeader"in m&&q.forEach(s.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),q.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),l&&"json"!==l&&(m.responseType=r.responseType),h&&([c,d]=Ce(h,!0),m.addEventListener("progress",c)),p&&m.upload&&([o,u]=Ce(p),m.upload.addEventListener("progress",o),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new Pe(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===ge.protocols.indexOf(y)?n(new J("Unsupported protocol "+y+":",J.ERR_BAD_REQUEST,e)):m.send(i||null)}))},Fe=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof J?t:new Pe(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,i(new J(`timeout ${t} of ms exceeded`,J.ETIMEDOUT))}),t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)})),e=null)};e.forEach((e=>e.addEventListener("abort",i)));const{signal:o}=r;return o.unsubscribe=()=>q.asap(a),o}},ze=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},Ve=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of 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()}}(e))yield*ze(n,t)}(e,t);let s,a=0,o=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return o(),void e.close();let s=r.byteLength;if(n){let e=a+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw o(e),e}},cancel:e=>(o(e),i.return())},{highWaterMark:2})},He="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,qe=He&&"function"==typeof ReadableStream,Ke=He&&("function"==typeof TextEncoder?(We=new TextEncoder,e=>We.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var We;const Ge=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Je=qe&&Ge((()=>{let e=!1;const t=new Request(ge.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Ye=qe&&Ge((()=>q.isReadableStream(new Response("").body))),Qe={stream:Ye&&(e=>e.body)};var Xe;He&&(Xe=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Qe[e]&&(Qe[e]=q.isFunction(Xe[e])?t=>t[e]():(t,n)=>{throw new J(`Response type '${e}' is not supported`,J.ERR_NOT_SUPPORT,n)})})));const et=He&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:o,onUploadProgress:c,responseType:u,headers:d,withCredentials:l="same-origin",fetchOptions:p}=Ze(e);u=u?(u+"").toLowerCase():"text";let h,f=Fe([i,s&&s.toAbortSignal()],a);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(c&&Je&&"get"!==n&&"head"!==n&&0!==(g=await(async(e,t)=>{const n=q.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(q.isBlob(e))return e.size;if(q.isSpecCompliantForm(e)){const t=new Request(ge.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return q.isArrayBufferView(e)||q.isArrayBuffer(e)?e.byteLength:(q.isURLSearchParams(e)&&(e+=""),q.isString(e)?(await Ke(e)).byteLength:void 0)})(t):n})(d,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(q.isFormData(r)&&(e=n.headers.get("content-type"))&&d.setContentType(e),n.body){const[e,t]=Ne(g,Ce(Me(c)));r=Ve(n.body,65536,e,t)}}q.isString(l)||(l=l?"include":"omit");const i="credentials"in Request.prototype;h=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:i?l:void 0});let s=await fetch(h);const a=Ye&&("stream"===u||"response"===u);if(Ye&&(o||a&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=q.toFiniteNumber(s.headers.get("content-length")),[n,r]=o&&Ne(t,Ce(Me(o),!0))||[];s=new Response(Ve(s.body,65536,n,(()=>{r&&r(),m&&m()})),e)}u=u||"text";let y=await Qe[q.findKey(Qe,u)||"text"](s,e);return!a&&m&&m(),await new Promise(((t,n)=>{Re(t,n,{data:y,headers:Te.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:h})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new J("Network Error",J.ERR_NETWORK,e,h),{cause:t.cause||t});throw J.from(t,t&&t.code,e,h)}}),tt={http:null,xhr:Be,fetch:et};q.forEach(tt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const nt=e=>`- ${e}`,rt=e=>q.isFunction(e)||null===e||!1===e,it=e=>{e=q.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!rt(n)&&(r=tt[(t=String(n)).toLowerCase()],void 0===r))throw new J(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+s]=r}if(!r){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(nt).join("\n"):" "+nt(e[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function st(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pe(null,e)}function at(e){return st(e),e.headers=Te.from(e.headers),e.data=Oe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),it(e.adapter||_e.adapter)(e).then((function(t){return st(e),t.data=Oe.call(e,e.transformResponse,t),t.headers=Te.from(t.headers),t}),(function(t){return Ie(t)||(st(e),t&&t.response&&(t.response.data=Oe.call(e,e.transformResponse,t.response),t.response.headers=Te.from(t.response.headers))),Promise.reject(t)}))}const ot={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ot[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const ct={};ot.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,s)=>{if(!1===e)throw new J(r(i," has been removed"+(t?" in "+t:"")),J.ERR_DEPRECATED);return t&&!ct[i]&&(ct[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,s)}};const ut={assertOptions:function(e,t,n){if("object"!=typeof e)throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],a=t[s];if(a){const t=e[s],n=void 0===t||a(t,s,e);if(!0!==n)throw new J("option "+s+" must be "+n,J.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new J("Unknown option "+s,J.ERR_BAD_OPTION)}},validators:ot},dt=ut.validators;class lt{constructor(e){this.defaults=e,this.interceptors={request:new ce,response:new ce}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Le(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&ut.assertOptions(n,{silentJSONParsing:dt.transitional(dt.boolean),forcedJSONParsing:dt.transitional(dt.boolean),clarifyTimeoutError:dt.transitional(dt.boolean)},!1),null!=r&&(q.isFunction(r)?t.paramsSerializer={serialize:r}:ut.assertOptions(r,{encode:dt.function,serialize:dt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=i&&q.merge(i.common,i[t.method]);i&&q.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=Te.concat(s,i);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,l=0;if(!o){const e=[at.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),d=e.length,u=Promise.resolve(t);l<d;)u=u.then(e[l++],e[l++]);return u}d=a.length;let p=t;for(l=0;l<d;){const e=a[l++],t=a[l++];try{p=e(p)}catch(e){t.call(this,e);break}}try{u=at.call(this,p)}catch(e){return Promise.reject(e)}for(l=0,d=c.length;l<d;)u=u.then(c[l++],c[l++]);return u}getUri(e){return oe($e((e=Le(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}q.forEach(["delete","get","head","options"],(function(e){lt.prototype[e]=function(t,n){return this.request(Le(n||{},{method:e,url:t,data:(n||{}).data}))}})),q.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Le(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}lt.prototype[e]=t(),lt.prototype[e+"Form"]=t(!0)}));const pt=lt;class ht{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,i){n.reason||(n.reason=new Pe(e,r,i),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 e;return{token:new ht((function(t){e=t})),cancel:e}}}const ft=ht,mt={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(mt).forEach((([e,t])=>{mt[t]=e}));const gt=mt,yt=function e(n){const r=new pt(n),i=t(pt.prototype.request,r);return q.extend(i,pt.prototype,r,{allOwnKeys:!0}),q.extend(i,r,null,{allOwnKeys:!0}),i.create=function(t){return e(Le(n,t))},i}(_e);yt.Axios=pt,yt.CanceledError=Pe,yt.CancelToken=ft,yt.isCancel=Ie,yt.VERSION="1.7.7",yt.toFormData=te,yt.AxiosError=J,yt.Cancel=yt.CanceledError,yt.all=function(e){return Promise.all(e)},yt.spread=function(e){return function(t){return e.apply(null,t)}},yt.isAxiosError=function(e){return q.isObject(e)&&!0===e.isAxiosError},yt.mergeConfig=Le,yt.AxiosHeaders=Te,yt.formToJSON=e=>ye(q.isHTMLForm(e)?new FormData(e):e),yt.getAdapter=it,yt.HttpStatusCode=gt,yt.default=yt;const vt=yt;var _t=n(576),bt=n.n(_t),wt=n(822),xt=n.n(wt),St=function(e,t){return St=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},St(e,t)};function kt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}St(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Et(e,t){var n,r,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}function Tt(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ot(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return a}function It(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function At(e){return this instanceof At?(this.v=e,this):new At(e)}function Pt(e){return"function"==typeof e}function Rt(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var Ct=Rt((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Nt(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Mt=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=Tt(s),o=a.next();!o.done;o=a.next())o.value.remove(this)}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else s.remove(this);var c=this.initialTeardown;if(Pt(c))try{c()}catch(e){i=e instanceof Ct?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Tt(u),l=d.next();!l.done;l=d.next()){var p=l.value;try{$t(p)}catch(e){i=null!=i?i:[],e instanceof Ct?i=It(It([],Ot(i)),Ot(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}if(i)throw new Ct(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)$t(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Nt(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Nt(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e;var t}(),jt=Mt.EMPTY;function Ut(e){return e instanceof Mt||e&&"closed"in e&&Pt(e.remove)&&Pt(e.add)&&Pt(e.unsubscribe)}function $t(e){Pt(e)?e():e.unsubscribe()}var Dt=null,Lt=null,Zt=void 0,Bt=!1,Ft=!1,zt={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=zt.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,It([e,t],Ot(n))):setTimeout.apply(void 0,It([e,t],Ot(n)))},clearTimeout:function(e){var t=zt.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Vt(e){zt.setTimeout((function(){if(!Dt)throw e;Dt(e)}))}function Ht(){}var qt=Kt("C",void 0,void 0);function Kt(e,t,n){return{kind:e,value:t,error:n}}var Wt=null;function Gt(e){if(Bt){var t=!Wt;if(t&&(Wt={errorThrown:!1,error:null}),e(),t){var n=Wt,r=n.errorThrown,i=n.error;if(Wt=null,r)throw i}}else e()}var Jt=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Ut(t)&&t.add(n)):n.destination=rn,n}return kt(t,e),t.create=function(e,t,n){return new en(e,t,n)},t.prototype.next=function(e){this.isStopped?nn(function(e){return Kt("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?nn(Kt("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?nn(qt,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Mt),Yt=Function.prototype.bind;function Qt(e,t){return Yt.call(e,t)}var Xt=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){tn(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){tn(e)}else tn(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){tn(e)}},e}(),en=function(e){function t(t,n,r){var i,s,a=e.call(this)||this;return Pt(t)||!t?i={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:a&&Ft?((s=Object.create(t)).unsubscribe=function(){return a.unsubscribe()},i={next:t.next&&Qt(t.next,s),error:t.error&&Qt(t.error,s),complete:t.complete&&Qt(t.complete,s)}):i=t,a.destination=new Xt(i),a}return kt(t,e),t}(Jt);function tn(e){var t;Bt?(t=e,Bt&&Wt&&(Wt.errorThrown=!0,Wt.error=t)):Vt(e)}function nn(e,t){var n=Lt;n&&zt.setTimeout((function(){return n(e,t)}))}var rn={closed:!0,next:Ht,error:function(e){throw e},complete:Ht},sn="function"==typeof Symbol&&Symbol.observable||"@@observable";function an(e){return e}var on=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,i=this,s=(r=e)&&r instanceof Jt||function(e){return e&&Pt(e.next)&&Pt(e.error)&&Pt(e.complete)}(r)&&Ut(r)?e:new en(e,t,n);return Gt((function(){var e=i,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?i._subscribe(s):i._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=cn(t))((function(t,r){var i=new en({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[sn]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===(n=e).length?an:1===n.length?n[0]:function(e){return n.reduce((function(e,t){return t(e)}),e)})(this);var n},e.prototype.toPromise=function(e){var t=this;return new(e=cn(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function cn(e){var t;return null!==(t=null!=e?e:Zt)&&void 0!==t?t:Promise}var un=Rt((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),dn=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return kt(t,e),t.prototype.lift=function(e){var t=new ln(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new un},t.prototype.next=function(e){var t=this;Gt((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=Tt(t.currentObservers),s=i.next();!s.done;s=i.next())s.value.next(e)}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;Gt((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;Gt((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,s=n.observers;return r||i?jt:(this.currentObservers=null,s.push(e),new Mt((function(){t.currentObservers=null,Nt(s,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new on;return e.source=this,e},t.create=function(e,t){return new ln(e,t)},t}(on),ln=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return kt(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:jt},t}(dn),pn=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return kt(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(dn);function hn(e){return function(t){if(function(e){return Pt(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function fn(e,t,n,r,i){return new mn(e,t,n,r,i)}var mn=function(e){function t(t,n,r,i,s,a){var o=e.call(this,t)||this;return o.onFinalize=s,o.shouldUnsubscribe=a,o._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,o._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,o._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,o}return kt(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(Jt);function gn(e,t){return hn((function(n,r){var i=0;n.subscribe(fn(r,(function(n){r.next(e.call(t,n,i++))})))}))}var yn=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function vn(e){return Pt(null==e?void 0:e.then)}function _n(e){return Pt(e[sn])}function bn(e){return Symbol.asyncIterator&&Pt(null==e?void 0:e[Symbol.asyncIterator])}function wn(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var xn="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Sn(e){return Pt(null==e?void 0:e[xn])}function kn(e){return function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),s=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||o(e,t)}))},t&&(r[e]=t(r[e])))}function o(e,t){try{(n=i[e](t)).value instanceof At?Promise.resolve(n.value.v).then(c,u):d(s[0][2],n)}catch(e){d(s[0][3],e)}var n}function c(e){o("next",e)}function u(e){o("throw",e)}function d(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}(this,arguments,(function(){var t,n,r;return Et(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,At(t.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,At(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,At(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function En(e){return Pt(null==e?void 0:e.getReader)}function Tn(e){if(e instanceof on)return e;if(null!=e){if(_n(e))return i=e,new on((function(e){var t=i[sn]();if(Pt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(yn(e))return r=e,new on((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(vn(e))return n=e,new on((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Vt)}));if(bn(e))return On(e);if(Sn(e))return t=e,new on((function(e){var n,r;try{for(var i=Tt(t),s=i.next();!s.done;s=i.next()){var a=s.value;if(e.next(a),e.closed)return}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()}));if(En(e))return On(kn(e))}var t,n,r,i;throw wn(e)}function On(e){return new on((function(t){(function(e,t){var n,r,i,s,a,o,c,u;return a=this,o=void 0,u=function(){var a,o;return Et(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Tt(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}(e),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(a=r.value,t.next(a),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return o=c.sent(),i={error:o},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))},new((c=void 0)||(c=Promise))((function(e,t){function n(e){try{i(u.next(e))}catch(e){t(e)}}function r(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof c?i:new c((function(e){e(i)}))).then(n,r)}i((u=u.apply(a,o||[])).next())}))})(e,t).catch((function(e){return t.error(e)}))}))}function In(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var s=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(s),!i)return s}function An(e,t,n){return void 0===n&&(n=1/0),Pt(t)?An((function(n,r){return gn((function(e,i){return t(n,e,r,i)}))(Tn(e(n,r)))}),n):("number"==typeof t&&(n=t),hn((function(t,r){return function(e,t,n,r){var i=[],s=0,a=0,o=!1,c=function(){!o||i.length||s||t.complete()},u=function(e){return s<r?d(e):i.push(e)},d=function(e){s++;var o=!1;Tn(n(e,a++)).subscribe(fn(t,(function(e){t.next(e)}),(function(){o=!0}),void 0,(function(){if(o)try{s--;for(;i.length&&s<r;)e=void 0,e=i.shift(),d(e);c()}catch(e){t.error(e)}var e})))};return e.subscribe(fn(t,u,(function(){o=!0,c()}))),function(){}}(t,r,e,n)})))}function Pn(e,t){return Pt(t)?An(e,t,1):An(e,1)}function Rn(e){return void 0===e&&(e=1/0),An(an,e)}var Cn=new on((function(e){return e.complete()}));function Nn(e){return e&&Pt(e.schedule)}function Mn(e){return e[e.length-1]}function jn(e){return Nn(Mn(e))?e.pop():void 0}function Un(e,t){return void 0===t&&(t=0),hn((function(n,r){n.subscribe(fn(r,(function(n){return In(r,e,(function(){return r.next(n)}),t)}),(function(){return In(r,e,(function(){return r.complete()}),t)}),(function(n){return In(r,e,(function(){return r.error(n)}),t)})))}))}function $n(e,t){return void 0===t&&(t=0),hn((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function Dn(e,t){if(!e)throw new Error("Iterable cannot be null");return new on((function(n){In(n,t,(function(){var r=e[Symbol.asyncIterator]();In(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function Ln(e,t){return t?function(e,t){if(null!=e){if(_n(e))return function(e,t){return Tn(e).pipe($n(t),Un(t))}(e,t);if(yn(e))return function(e,t){return new on((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if(vn(e))return function(e,t){return Tn(e).pipe($n(t),Un(t))}(e,t);if(bn(e))return Dn(e,t);if(Sn(e))return function(e,t){return new on((function(n){var r;return In(n,t,(function(){r=e[xn](),In(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return Pt(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(En(e))return function(e,t){return Dn(kn(e),t)}(e,t)}throw wn(e)}(e,t):Tn(e)}function Zn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=jn(e),r=function(e){return"number"==typeof Mn(e)?e.pop():1/0}(e),i=e;return i.length?1===i.length?Tn(i[0]):Rn(r)(Ln(i,n)):Cn}var Bn=function(e){function t(t,n){return e.call(this)||this}return kt(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(Mt),Fn={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Fn.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,It([e,t],Ot(n))):setInterval.apply(void 0,It([e,t],Ot(n)))},clearInterval:function(e){var t=Fn.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},zn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return kt(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),Fn.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&Fn.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Nt(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Bn),Vn={now:function(){return(Vn.delegate||Date).now()},delegate:void 0},Hn=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=Vn.now,e}(),qn=new(function(e){function t(t,n){void 0===n&&(n=Hn.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return kt(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Hn))(zn),Kn=qn;function Wn(e){for(var t,n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s=null!==(t=jn(r))&&void 0!==t?t:qn,a=null!==(n=r[0])&&void 0!==n?n:null,o=r[1]||1/0;return hn((function(t,n){var r=[],i=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),Nt(r,e),n.next(t),i&&u()},u=function(){if(r){var t=new Mt;n.add(t);var i={buffer:[],subs:t};r.push(i),In(t,s,(function(){return c(i)}),e)}};null!==a&&a>=0?In(n,s,u,a,!0):i=!0,u();var d=fn(n,(function(e){var t,n,i=r.slice();try{for(var s=Tt(i),a=s.next();!a.done;a=s.next()){var u=a.value,d=u.buffer;d.push(e),o<=d.length&&c(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==r?void 0:r.length;)n.next(r.shift().buffer);null==d||d.unsubscribe(),n.complete(),n.unsubscribe()}),void 0,(function(){return r=null}));t.subscribe(d)}))}function Gn(e,t){return hn((function(n,r){var i=0;n.subscribe(fn(r,(function(n){return e.call(t,n,i++)&&r.next(n)})))}))}var Jn=Array.isArray,Yn=Object.getPrototypeOf,Qn=Object.prototype,Xn=Object.keys;var er=Array.isArray;function tr(e){return gn((function(t){return function(e,t){return er(t)?e.apply(void 0,It([],Ot(t))):e(t)}(e,t)}))}function nr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=jn(e),r=function(e){return Pt(Mn(e))?e.pop():void 0}(e),i=function(e){if(1===e.length){var t=e[0];if(Jn(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&Yn(r)===Qn){var n=Xn(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}(e),s=i.args,a=i.keys;if(0===s.length)return Ln([],n);var o=new on(function(e,t,n){return void 0===n&&(n=an),function(r){rr(t,(function(){for(var i=e.length,s=new Array(i),a=i,o=i,c=function(i){rr(t,(function(){var c=Ln(e[i],t),u=!1;c.subscribe(fn(r,(function(e){s[i]=e,u||(u=!0,o--),o||r.next(n(s.slice()))}),(function(){--a||r.complete()})))}),r)},u=0;u<i;u++)c(u)}),r)}}(s,n,a?function(e){return function(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}(a,e)}:an));return r?o.pipe(tr(r)):o}function rr(e,t,n){e?In(n,e,t):t()}var ir=new on(Ht);function sr(e){return e instanceof Date&&!isNaN(e)}var ar=Rt((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));function or(){return new ar}function cr(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?Gn((function(t,n){return e(t,n,r)})):an,1<=0?function(){return Cn}:hn((function(e,t){var n=0;e.subscribe(fn(t,(function(e){++n<=1&&(t.next(e),1<=n&&t.complete())})))})),n?function(e){return hn((function(t,n){var r=!1;t.subscribe(fn(n,(function(e){r=!0,n.next(e)}),(function(){r||n.next(e),n.complete()})))}))}(t):(void 0===(i=function(){return new ar})&&(i=or),hn((function(e,t){var n=!1;e.subscribe(fn(t,(function(e){n=!0,t.next(e)}),(function(){return n?t.complete():t.error(i())})))}))));var i}}var ur=Rt((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function dr(e){throw new ur(e)}function lr(e){return hn((function(t,n){var r,i=null,s=!1;i=t.subscribe(fn(n,void 0,void 0,(function(a){r=Tn(e(a,lr(e)(t))),i?(i.unsubscribe(),i=null,r.subscribe(n)):s=!0}))),s&&(i.unsubscribe(),i=null,r.subscribe(n))}))}var pr,hr;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(pr||(pr={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(hr||(hr={}));const fr=pr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),mr=e=>{switch(typeof e){case"undefined":return fr.undefined;case"string":return fr.string;case"number":return isNaN(e)?fr.nan:fr.number;case"boolean":return fr.boolean;case"function":return fr.function;case"bigint":return fr.bigint;case"symbol":return fr.symbol;case"object":return Array.isArray(e)?fr.array:null===e?fr.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?fr.promise:"undefined"!=typeof Map&&e instanceof Map?fr.map:"undefined"!=typeof Set&&e instanceof Set?fr.set:"undefined"!=typeof Date&&e instanceof Date?fr.date:fr.object;default:return fr.unknown}},gr=pr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class yr extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof yr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,pr.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}yr.create=e=>new yr(e);const vr=(e,t)=>{let n;switch(e.code){case gr.invalid_type:n=e.received===fr.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case gr.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,pr.jsonStringifyReplacer)}`;break;case gr.unrecognized_keys:n=`Unrecognized key(s) in object: ${pr.joinValues(e.keys,", ")}`;break;case gr.invalid_union:n="Invalid input";break;case gr.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${pr.joinValues(e.options)}`;break;case gr.invalid_enum_value:n=`Invalid enum value. Expected ${pr.joinValues(e.options)}, received '${e.received}'`;break;case gr.invalid_arguments:n="Invalid function arguments";break;case gr.invalid_return_type:n="Invalid function return type";break;case gr.invalid_date:n="Invalid date";break;case gr.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:pr.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case gr.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case gr.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case gr.custom:n="Invalid input";break;case gr.invalid_intersection_types:n="Intersection results could not be merged";break;case gr.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case gr.not_finite:n="Number must be finite";break;default:n=t.defaultError,pr.assertNever(e)}return{message:n}};let _r=vr;function br(){return _r}const wr=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],a={...i,path:s};if(void 0!==i.message)return{...i,path:s,message:i.message};let o="";const c=r.filter((e=>!!e)).slice().reverse();for(const e of c)o=e(a,{data:t,defaultError:o}).message;return{...i,path:s,message:o}};function xr(e,t){const n=br(),r=wr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===vr?void 0:vr].filter((e=>!!e))});e.common.issues.push(r)}class Sr{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return kr;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return Sr.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return kr;if("aborted"===i.status)return kr;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===t.value||void 0===i.value&&!r.alwaysSet||(n[t.value]=i.value)}return{status:e.value,value:n}}}const kr=Object.freeze({status:"aborted"}),Er=e=>({status:"dirty",value:e}),Tr=e=>({status:"valid",value:e}),Or=e=>"aborted"===e.status,Ir=e=>"dirty"===e.status,Ar=e=>"valid"===e.status,Pr=e=>"undefined"!=typeof Promise&&e instanceof Promise;function Rr(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function Cr(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}var Nr,Mr,jr;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Nr||(Nr={}));class Ur{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $r=(e,t)=>{if(Ar(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new yr(e.common.issues);return this._error=t,this._error}}};function Dr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{var s,a;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:i.defaultError}:void 0===i.data?{message:null!==(s=null!=o?o:r)&&void 0!==s?s:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!==(a=null!=o?o:n)&&void 0!==a?a:i.defaultError}},description:i}}class Lr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return mr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:mr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Sr,ctx:{common:e.parent.common,data:e.data,parsedType:mr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Pr(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:mr(e)},i=this._parseSync({data:e,path:r.path,parent:r});return $r(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:mr(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Pr(r)?r:Promise.resolve(r));return $r(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),s=()=>r.addIssue({code:gr.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(s(),!1))):!!i||(s(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Ni({schema:this,typeName:Hi.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Mi.create(this,this._def)}nullable(){return ji.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fi.create(this,this._def)}promise(){return Ci.create(this,this._def)}or(e){return yi.create([this,e],this._def)}and(e){return wi.create(this,e,this._def)}transform(e){return new Ni({...Dr(this._def),schema:this,typeName:Hi.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ui({...Dr(this._def),innerType:this,defaultValue:t,typeName:Hi.ZodDefault})}brand(){return new Zi({typeName:Hi.ZodBranded,type:this,...Dr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new $i({...Dr(this._def),innerType:this,catchValue:t,typeName:Hi.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Bi.create(this,e)}readonly(){return Fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Zr=/^c[^\s-]{8,}$/i,Br=/^[0-9a-z]+$/,Fr=/^[0-9A-HJKMNP-TV-Z]{26}$/,zr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Vr=/^[a-z0-9_-]{21}$/i,Hr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Kr;const Wr=/^(?:(?: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])$/,Gr=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Jr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yr="((\\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])))",Qr=new RegExp(`^${Yr}$`);function Xr(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function ei(e){let t=`${Yr}T${Xr(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}class ti extends Lr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==fr.string){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.string,received:t.parsedType}),kr}const t=new Sr;let n;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const r=e.data.length>s.value,i=e.data.length<s.value;(r||i)&&(n=this._getOrReturnCtx(e,n),r?xr(n,{code:gr.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):i&&xr(n,{code:gr.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)qr.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"email",code:gr.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)Kr||(Kr=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Kr.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"emoji",code:gr.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)zr.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"uuid",code:gr.invalid_string,message:s.message}),t.dirty());else if("nanoid"===s.kind)Vr.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"nanoid",code:gr.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)Zr.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"cuid",code:gr.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)Br.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"cuid2",code:gr.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)Fr.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"ulid",code:gr.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),xr(n,{validation:"url",code:gr.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"regex",code:gr.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?ei(s).test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"date"===s.kind?Qr.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.invalid_string,validation:"date",message:s.message}),t.dirty()):"time"===s.kind?new RegExp(`^${Xr(s)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.invalid_string,validation:"time",message:s.message}),t.dirty()):"duration"===s.kind?Hr.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"duration",code:gr.invalid_string,message:s.message}),t.dirty()):"ip"===s.kind?(r=e.data,("v4"!==(i=s.version)&&i||!Wr.test(r))&&("v6"!==i&&i||!Gr.test(r))&&(n=this._getOrReturnCtx(e,n),xr(n,{validation:"ip",code:gr.invalid_string,message:s.message}),t.dirty())):"base64"===s.kind?Jr.test(e.data)||(n=this._getOrReturnCtx(e,n),xr(n,{validation:"base64",code:gr.invalid_string,message:s.message}),t.dirty()):pr.assertNever(s);var r,i;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:gr.invalid_string,...Nr.errToObj(n)})}_addCheck(e){return new ti({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Nr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Nr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Nr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Nr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Nr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Nr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Nr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Nr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Nr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Nr.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...Nr.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...Nr.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Nr.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Nr.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...Nr.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Nr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Nr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Nr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Nr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Nr.errToObj(t)})}nonempty(e){return this.min(1,Nr.errToObj(e))}trim(){return new ti({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ti({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ti({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function ni(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}ti.create=e=>{var t;return new ti({checks:[],typeName:Hi.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Dr(e)})};class ri extends Lr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==fr.number){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.number,received:t.parsedType}),kr}let t;const n=new Sr;for(const r of this._def.checks)"int"===r.kind?pr.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),xr(t,{code:gr.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),xr(t,{code:gr.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),xr(t,{code:gr.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==ni(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),xr(t,{code:gr.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),xr(t,{code:gr.not_finite,message:r.message}),n.dirty()):pr.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Nr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Nr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Nr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Nr.toString(t))}setLimit(e,t,n,r){return new ri({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Nr.toString(r)}]})}_addCheck(e){return new ri({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Nr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Nr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Nr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Nr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Nr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Nr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Nr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Nr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Nr.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&pr.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ri.create=e=>new ri({checks:[],typeName:Hi.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Dr(e)});class ii extends Lr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==fr.bigint){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.bigint,received:t.parsedType}),kr}let t;const n=new Sr;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),xr(t,{code:gr.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),xr(t,{code:gr.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),xr(t,{code:gr.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):pr.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Nr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Nr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Nr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Nr.toString(t))}setLimit(e,t,n,r){return new ii({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Nr.toString(r)}]})}_addCheck(e){return new ii({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Nr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Nr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Nr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Nr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Nr.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ii.create=e=>{var t;return new ii({checks:[],typeName:Hi.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Dr(e)})};class si extends Lr{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==fr.boolean){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.boolean,received:t.parsedType}),kr}return Tr(e.data)}}si.create=e=>new si({typeName:Hi.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Dr(e)});class ai extends Lr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==fr.date){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.date,received:t.parsedType}),kr}if(isNaN(e.data.getTime()))return xr(this._getOrReturnCtx(e),{code:gr.invalid_date}),kr;const t=new Sr;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),xr(n,{code:gr.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):pr.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ai({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Nr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Nr.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ai.create=e=>new ai({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Hi.ZodDate,...Dr(e)});class oi extends Lr{_parse(e){if(this._getType(e)!==fr.symbol){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.symbol,received:t.parsedType}),kr}return Tr(e.data)}}oi.create=e=>new oi({typeName:Hi.ZodSymbol,...Dr(e)});class ci extends Lr{_parse(e){if(this._getType(e)!==fr.undefined){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.undefined,received:t.parsedType}),kr}return Tr(e.data)}}ci.create=e=>new ci({typeName:Hi.ZodUndefined,...Dr(e)});class ui extends Lr{_parse(e){if(this._getType(e)!==fr.null){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.null,received:t.parsedType}),kr}return Tr(e.data)}}ui.create=e=>new ui({typeName:Hi.ZodNull,...Dr(e)});class di extends Lr{constructor(){super(...arguments),this._any=!0}_parse(e){return Tr(e.data)}}di.create=e=>new di({typeName:Hi.ZodAny,...Dr(e)});class li extends Lr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Tr(e.data)}}li.create=e=>new li({typeName:Hi.ZodUnknown,...Dr(e)});class pi extends Lr{_parse(e){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.never,received:t.parsedType}),kr}}pi.create=e=>new pi({typeName:Hi.ZodNever,...Dr(e)});class hi extends Lr{_parse(e){if(this._getType(e)!==fr.undefined){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.void,received:t.parsedType}),kr}return Tr(e.data)}}hi.create=e=>new hi({typeName:Hi.ZodVoid,...Dr(e)});class fi extends Lr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==fr.array)return xr(t,{code:gr.invalid_type,expected:fr.array,received:t.parsedType}),kr;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(xr(t,{code:e?gr.too_big:gr.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(xr(t,{code:gr.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(xr(t,{code:gr.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new Ur(t,e,t.path,n))))).then((e=>Sr.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new Ur(t,e,t.path,n))));return Sr.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new fi({...this._def,minLength:{value:e,message:Nr.toString(t)}})}max(e,t){return new fi({...this._def,maxLength:{value:e,message:Nr.toString(t)}})}length(e,t){return new fi({...this._def,exactLength:{value:e,message:Nr.toString(t)}})}nonempty(e){return this.min(1,e)}}function mi(e){if(e instanceof gi){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Mi.create(mi(r))}return new gi({...e._def,shape:()=>t})}return e instanceof fi?new fi({...e._def,type:mi(e.element)}):e instanceof Mi?Mi.create(mi(e.unwrap())):e instanceof ji?ji.create(mi(e.unwrap())):e instanceof xi?xi.create(e.items.map((e=>mi(e)))):e}fi.create=(e,t)=>new fi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Hi.ZodArray,...Dr(t)});class gi extends Lr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=pr.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==fr.object){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.object,received:t.parsedType}),kr}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof pi&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||s.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new Ur(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof pi){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)s.length>0&&(xr(n,{code:gr.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new Ur(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>Sr.mergeObjectSync(t,e))):Sr.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Nr.errToObj,new gi({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,s,a;const o=null!==(s=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=Nr.errToObj(e).message)&&void 0!==a?a:o}:{message:o}}}:{}})}strip(){return new gi({...this._def,unknownKeys:"strip"})}passthrough(){return new gi({...this._def,unknownKeys:"passthrough"})}extend(e){return new gi({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new gi({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Hi.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new gi({...this._def,catchall:e})}pick(e){const t={};return pr.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new gi({...this._def,shape:()=>t})}omit(e){const t={};return pr.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new gi({...this._def,shape:()=>t})}deepPartial(){return mi(this)}partial(e){const t={};return pr.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new gi({...this._def,shape:()=>t})}required(e){const t={};return pr.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Mi;)e=e._def.innerType;t[n]=e}})),new gi({...this._def,shape:()=>t})}keyof(){return Ai(pr.objectKeys(this.shape))}}gi.create=(e,t)=>new gi({shape:()=>e,unknownKeys:"strip",catchall:pi.create(),typeName:Hi.ZodObject,...Dr(t)}),gi.strictCreate=(e,t)=>new gi({shape:()=>e,unknownKeys:"strict",catchall:pi.create(),typeName:Hi.ZodObject,...Dr(t)}),gi.lazycreate=(e,t)=>new gi({shape:e,unknownKeys:"strip",catchall:pi.create(),typeName:Hi.ZodObject,...Dr(t)});class yi extends Lr{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new yr(e.ctx.common.issues)));return xr(t,{code:gr.invalid_union,unionErrors:n}),kr}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new yr(e)));return xr(t,{code:gr.invalid_union,unionErrors:i}),kr}}get options(){return this._def.options}}yi.create=(e,t)=>new yi({options:e,typeName:Hi.ZodUnion,...Dr(t)});const vi=e=>e instanceof Oi?vi(e.schema):e instanceof Ni?vi(e.innerType()):e instanceof Ii?[e.value]:e instanceof Pi?e.options:e instanceof Ri?pr.objectValues(e.enum):e instanceof Ui?vi(e._def.innerType):e instanceof ci?[void 0]:e instanceof ui?[null]:e instanceof Mi?[void 0,...vi(e.unwrap())]:e instanceof ji?[null,...vi(e.unwrap())]:e instanceof Zi||e instanceof Fi?vi(e.unwrap()):e instanceof $i?vi(e._def.innerType):[];class _i extends Lr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==fr.object)return xr(t,{code:gr.invalid_type,expected:fr.object,received:t.parsedType}),kr;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(xr(t,{code:gr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),kr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=vi(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new _i({typeName:Hi.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Dr(n)})}}function bi(e,t){const n=mr(e),r=mr(t);if(e===t)return{valid:!0,data:e};if(n===fr.object&&r===fr.object){const n=pr.objectKeys(t),r=pr.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=bi(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===fr.array&&r===fr.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=bi(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===fr.date&&r===fr.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class wi extends Lr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Or(e)||Or(r))return kr;const i=bi(e.value,r.value);return i.valid?((Ir(e)||Ir(r))&&t.dirty(),{status:t.value,value:i.data}):(xr(n,{code:gr.invalid_intersection_types}),kr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}wi.create=(e,t,n)=>new wi({left:e,right:t,typeName:Hi.ZodIntersection,...Dr(n)});class xi extends Lr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==fr.array)return xr(n,{code:gr.invalid_type,expected:fr.array,received:n.parsedType}),kr;if(n.data.length<this._def.items.length)return xr(n,{code:gr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),kr;!this._def.rest&&n.data.length>this._def.items.length&&(xr(n,{code:gr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new Ur(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Sr.mergeArray(t,e))):Sr.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new xi({...this._def,rest:e})}}xi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xi({items:e,typeName:Hi.ZodTuple,rest:null,...Dr(t)})};class Si extends Lr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==fr.object)return xr(n,{code:gr.invalid_type,expected:fr.object,received:n.parsedType}),kr;const r=[],i=this._def.keyType,s=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new Ur(n,e,n.path,e)),value:s._parse(new Ur(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Sr.mergeObjectAsync(t,r):Sr.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Si(t instanceof Lr?{keyType:e,valueType:t,typeName:Hi.ZodRecord,...Dr(n)}:{keyType:ti.create(),valueType:e,typeName:Hi.ZodRecord,...Dr(t)})}}class ki extends Lr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==fr.map)return xr(n,{code:gr.invalid_type,expected:fr.map,received:n.parsedType}),kr;const r=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new Ur(n,e,n.path,[s,"key"])),value:i._parse(new Ur(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of s){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return kr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of s){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return kr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}ki.create=(e,t,n)=>new ki({valueType:t,keyType:e,typeName:Hi.ZodMap,...Dr(n)});class Ei extends Lr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==fr.set)return xr(n,{code:gr.invalid_type,expected:fr.set,received:n.parsedType}),kr;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(xr(n,{code:gr.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(xr(n,{code:gr.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function s(e){const n=new Set;for(const r of e){if("aborted"===r.status)return kr;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new Ur(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>s(e))):s(a)}min(e,t){return new Ei({...this._def,minSize:{value:e,message:Nr.toString(t)}})}max(e,t){return new Ei({...this._def,maxSize:{value:e,message:Nr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ei.create=(e,t)=>new Ei({valueType:e,minSize:null,maxSize:null,typeName:Hi.ZodSet,...Dr(t)});class Ti extends Lr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==fr.function)return xr(t,{code:gr.invalid_type,expected:fr.function,received:t.parsedType}),kr;function n(e,n){return wr({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,br(),vr].filter((e=>!!e)),issueData:{code:gr.invalid_arguments,argumentsError:n}})}function r(e,n){return wr({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,br(),vr].filter((e=>!!e)),issueData:{code:gr.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Ci){const e=this;return Tr((async function(...t){const a=new yr([]),o=await e._def.args.parseAsync(t,i).catch((e=>{throw a.addIssue(n(t,e)),a})),c=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(c,i).catch((e=>{throw a.addIssue(r(c,e)),a}))}))}{const e=this;return Tr((function(...t){const a=e._def.args.safeParse(t,i);if(!a.success)throw new yr([n(t,a.error)]);const o=Reflect.apply(s,this,a.data),c=e._def.returns.safeParse(o,i);if(!c.success)throw new yr([r(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ti({...this._def,args:xi.create(e).rest(li.create())})}returns(e){return new Ti({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ti({args:e||xi.create([]).rest(li.create()),returns:t||li.create(),typeName:Hi.ZodFunction,...Dr(n)})}}class Oi extends Lr{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Oi.create=(e,t)=>new Oi({getter:e,typeName:Hi.ZodLazy,...Dr(t)});class Ii extends Lr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return xr(t,{received:t.data,code:gr.invalid_literal,expected:this._def.value}),kr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ai(e,t){return new Pi({values:e,typeName:Hi.ZodEnum,...Dr(t)})}Ii.create=(e,t)=>new Ii({value:e,typeName:Hi.ZodLiteral,...Dr(t)});class Pi extends Lr{constructor(){super(...arguments),Mr.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return xr(t,{expected:pr.joinValues(n),received:t.parsedType,code:gr.invalid_type}),kr}if(Rr(this,Mr,"f")||Cr(this,Mr,new Set(this._def.values),"f"),!Rr(this,Mr,"f").has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return xr(t,{received:t.data,code:gr.invalid_enum_value,options:n}),kr}return Tr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Pi.create(e,{...this._def,...t})}exclude(e,t=this._def){return Pi.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}Mr=new WeakMap,Pi.create=Ai;class Ri extends Lr{constructor(){super(...arguments),jr.set(this,void 0)}_parse(e){const t=pr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==fr.string&&n.parsedType!==fr.number){const e=pr.objectValues(t);return xr(n,{expected:pr.joinValues(e),received:n.parsedType,code:gr.invalid_type}),kr}if(Rr(this,jr,"f")||Cr(this,jr,new Set(pr.getValidEnumValues(this._def.values)),"f"),!Rr(this,jr,"f").has(e.data)){const e=pr.objectValues(t);return xr(n,{received:n.data,code:gr.invalid_enum_value,options:e}),kr}return Tr(e.data)}get enum(){return this._def.values}}jr=new WeakMap,Ri.create=(e,t)=>new Ri({values:e,typeName:Hi.ZodNativeEnum,...Dr(t)});class Ci extends Lr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==fr.promise&&!1===t.common.async)return xr(t,{code:gr.invalid_type,expected:fr.promise,received:t.parsedType}),kr;const n=t.parsedType===fr.promise?t.data:Promise.resolve(t.data);return Tr(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ci.create=(e,t)=>new Ci({type:e,typeName:Hi.ZodPromise,...Dr(t)});class Ni extends Lr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Hi.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{xr(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===r.type){const e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return kr;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?kr:"dirty"===r.status||"dirty"===t.value?Er(r.value):r}));{if("aborted"===t.value)return kr;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?kr:"dirty"===r.status||"dirty"===t.value?Er(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?kr:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?kr:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ar(e))return e;const s=r.transform(e.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>Ar(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}pr.assertNever(r)}}Ni.create=(e,t,n)=>new Ni({schema:e,typeName:Hi.ZodEffects,effect:t,...Dr(n)}),Ni.createWithPreprocess=(e,t,n)=>new Ni({schema:t,effect:{type:"preprocess",transform:e},typeName:Hi.ZodEffects,...Dr(n)});class Mi extends Lr{_parse(e){return this._getType(e)===fr.undefined?Tr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Mi.create=(e,t)=>new Mi({innerType:e,typeName:Hi.ZodOptional,...Dr(t)});class ji extends Lr{_parse(e){return this._getType(e)===fr.null?Tr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ji.create=(e,t)=>new ji({innerType:e,typeName:Hi.ZodNullable,...Dr(t)});class Ui extends Lr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===fr.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ui.create=(e,t)=>new Ui({innerType:e,typeName:Hi.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Dr(t)});class $i extends Lr{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Pr(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new yr(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new yr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}$i.create=(e,t)=>new $i({innerType:e,typeName:Hi.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Dr(t)});class Di extends Lr{_parse(e){if(this._getType(e)!==fr.nan){const t=this._getOrReturnCtx(e);return xr(t,{code:gr.invalid_type,expected:fr.nan,received:t.parsedType}),kr}return{status:"valid",value:e.data}}}Di.create=e=>new Di({typeName:Hi.ZodNaN,...Dr(e)});const Li=Symbol("zod_brand");class Zi extends Lr{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Bi extends Lr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?kr:"dirty"===e.status?(t.dirty(),Er(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?kr:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Bi({in:e,out:t,typeName:Hi.ZodPipeline})}}class Fi extends Lr{_parse(e){const t=this._def.innerType._parse(e),n=e=>(Ar(e)&&(e.value=Object.freeze(e.value)),e);return Pr(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function zi(e,t={},n){return e?di.create().superRefine(((r,i)=>{var s,a;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,o=null===(a=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===a||a,c="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...c,fatal:o})}})):di.create()}Fi.create=(e,t)=>new Fi({innerType:e,typeName:Hi.ZodReadonly,...Dr(t)});const Vi={object:gi.lazycreate};var Hi;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Hi||(Hi={}));const qi=ti.create,Ki=ri.create,Wi=Di.create,Gi=ii.create,Ji=si.create,Yi=ai.create,Qi=oi.create,Xi=ci.create,es=ui.create,ts=di.create,ns=li.create,rs=pi.create,is=hi.create,ss=fi.create,as=gi.create,os=gi.strictCreate,cs=yi.create,us=_i.create,ds=wi.create,ls=xi.create,ps=Si.create,hs=ki.create,fs=Ei.create,ms=Ti.create,gs=Oi.create,ys=Ii.create,vs=Pi.create,_s=Ri.create,bs=Ci.create,ws=Ni.create,xs=Mi.create,Ss=ji.create,ks=Ni.createWithPreprocess,Es=Bi.create,Ts={string:e=>ti.create({...e,coerce:!0}),number:e=>ri.create({...e,coerce:!0}),boolean:e=>si.create({...e,coerce:!0}),bigint:e=>ii.create({...e,coerce:!0}),date:e=>ai.create({...e,coerce:!0})},Os=kr;var Is=Object.freeze({__proto__:null,defaultErrorMap:vr,setErrorMap:function(e){_r=e},getErrorMap:br,makeIssue:wr,EMPTY_PATH:[],addIssueToContext:xr,ParseStatus:Sr,INVALID:kr,DIRTY:Er,OK:Tr,isAborted:Or,isDirty:Ir,isValid:Ar,isAsync:Pr,get util(){return pr},get objectUtil(){return hr},ZodParsedType:fr,getParsedType:mr,ZodType:Lr,datetimeRegex:ei,ZodString:ti,ZodNumber:ri,ZodBigInt:ii,ZodBoolean:si,ZodDate:ai,ZodSymbol:oi,ZodUndefined:ci,ZodNull:ui,ZodAny:di,ZodUnknown:li,ZodNever:pi,ZodVoid:hi,ZodArray:fi,ZodObject:gi,ZodUnion:yi,ZodDiscriminatedUnion:_i,ZodIntersection:wi,ZodTuple:xi,ZodRecord:Si,ZodMap:ki,ZodSet:Ei,ZodFunction:Ti,ZodLazy:Oi,ZodLiteral:Ii,ZodEnum:Pi,ZodNativeEnum:Ri,ZodPromise:Ci,ZodEffects:Ni,ZodTransformer:Ni,ZodOptional:Mi,ZodNullable:ji,ZodDefault:Ui,ZodCatch:$i,ZodNaN:Di,BRAND:Li,ZodBranded:Zi,ZodPipeline:Bi,ZodReadonly:Fi,custom:zi,Schema:Lr,ZodSchema:Lr,late:Vi,get ZodFirstPartyTypeKind(){return Hi},coerce:Ts,any:ts,array:ss,bigint:Gi,boolean:Ji,date:Yi,discriminatedUnion:us,effect:ws,enum:vs,function:ms,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>zi((t=>t instanceof e),t),intersection:ds,lazy:gs,literal:ys,map:hs,nan:Wi,nativeEnum:_s,never:rs,null:es,nullable:Ss,number:Ki,object:as,oboolean:()=>Ji().optional(),onumber:()=>Ki().optional(),optional:xs,ostring:()=>qi().optional(),pipeline:Es,preprocess:ks,promise:bs,record:ps,set:fs,strictObject:os,string:qi,symbol:Qi,transformer:ws,tuple:ls,undefined:Xi,union:cs,unknown:ns,void:is,NEVER:Os,ZodIssueCode:gr,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:yr});const As=[{name:"Afghanistan",dial_code:"93",code:"AF"},{name:"Albania",dial_code:"355",code:"AL"},{name:"Algeria",dial_code:"213",code:"DZ"},{name:"AmericanSamoa",dial_code:"1684",code:"AS"},{name:"Andorra",dial_code:"376",code:"AD"},{name:"Angola",dial_code:"244",code:"AO"},{name:"Anguilla",dial_code:"1264",code:"AI"},{name:"Antigua and Barbuda",dial_code:"1268",code:"AG"},{name:"Argentina",dial_code:"54",code:"AR"},{name:"Armenia",dial_code:"374",code:"AM"},{name:"Aruba",dial_code:"297",code:"AW"},{name:"Australia",dial_code:"61",code:"AU"},{name:"Austria",dial_code:"43",code:"AT"},{name:"Azerbaijan",dial_code:"994",code:"AZ"},{name:"Bahamas",dial_code:"1242",code:"BS"},{name:"Bahrain",dial_code:"973",code:"BH"},{name:"Bangladesh",dial_code:"880",code:"BD"},{name:"Barbados",dial_code:"1246",code:"BB"},{name:"Belarus",dial_code:"375",code:"BY"},{name:"Belgium",dial_code:"32",code:"BE"},{name:"Belize",dial_code:"501",code:"BZ"},{name:"Benin",dial_code:"229",code:"BJ"},{name:"Bermuda",dial_code:"1441",code:"BM"},{name:"Bhutan",dial_code:"975",code:"BT"},{name:"Bolivia, Plurinational State of",dial_code:"591",code:"BO"},{name:"Bosnia and Herzegovina",dial_code:"387",code:"BA"},{name:"Botswana",dial_code:"267",code:"BW"},{name:"Brazil",dial_code:"55",code:"BR"},{name:"British Indian Ocean Territory",dial_code:"246",code:"IO"},{name:"Brunei Darussalam",dial_code:"673",code:"BN"},{name:"Bulgaria",dial_code:"359",code:"BG"},{name:"Burkina Faso",dial_code:"226",code:"BF"},{name:"Burundi",dial_code:"257",code:"BI"},{name:"Cambodia",dial_code:"855",code:"KH"},{name:"Cameroon",dial_code:"237",code:"CM"},{name:"Cape Verde",dial_code:"238",code:"CV"},{name:"Cayman Islands",dial_code:" 345",code:"KY"},{name:"Central African Republic",dial_code:"236",code:"CF"},{name:"Chad",dial_code:"235",code:"TD"},{name:"Chile",dial_code:"56",code:"CL"},{name:"China",dial_code:"86",code:"CN"},{name:"Colombia",dial_code:"57",code:"CO"},{name:"Comoros",dial_code:"269",code:"KM"},{name:"Congo",dial_code:"242",code:"CG"},{name:"Congo, The Democratic Republic of the Congo",dial_code:"243",code:"CD"},{name:"Cook Islands",dial_code:"682",code:"CK"},{name:"Costa Rica",dial_code:"506",code:"CR"},{name:"Cote d'Ivoire",dial_code:"225",code:"CI"},{name:"Croatia",dial_code:"385",code:"HR"},{name:"Cuba",dial_code:"53",code:"CU"},{name:"Cyprus",dial_code:"357",code:"CY"},{name:"Czech Republic",dial_code:"420",code:"CZ"},{name:"Denmark",dial_code:"45",code:"DK"},{name:"Djibouti",dial_code:"253",code:"DJ"},{name:"Dominica",dial_code:"1767",code:"DM"},{name:"Dominican Republic",dial_code:"1849",code:"DO"},{name:"Ecuador",dial_code:"593",code:"EC"},{name:"Egypt",dial_code:"20",code:"EG"},{name:"El Salvador",dial_code:"503",code:"SV"},{name:"Equatorial Guinea",dial_code:"240",code:"GQ"},{name:"Eritrea",dial_code:"291",code:"ER"},{name:"Estonia",dial_code:"372",code:"EE"},{name:"Ethiopia",dial_code:"251",code:"ET"},{name:"Falkland Islands (Malvinas)",dial_code:"500",code:"FK"},{name:"Faroe Islands",dial_code:"298",code:"FO"},{name:"Fiji",dial_code:"679",code:"FJ"},{name:"Finland",dial_code:"358",code:"FI"},{name:"France",dial_code:"33",code:"FR"},{name:"French Guiana",dial_code:"594",code:"GF"},{name:"French Polynesia",dial_code:"689",code:"PF"},{name:"Gabon",dial_code:"241",code:"GA"},{name:"Gambia",dial_code:"220",code:"GM"},{name:"Georgia",dial_code:"995",code:"GE"},{name:"Germany",dial_code:"49",code:"DE"},{name:"Ghana",dial_code:"233",code:"GH"},{name:"Gibraltar",dial_code:"350",code:"GI"},{name:"Greece",dial_code:"30",code:"GR"},{name:"Greenland",dial_code:"299",code:"GL"},{name:"Grenada",dial_code:"1473",code:"GD"},{name:"Guadeloupe",dial_code:"590",code:"GP"},{name:"Guam",dial_code:"1671",code:"GU"},{name:"Guatemala",dial_code:"502",code:"GT"},{name:"Guinea",dial_code:"224",code:"GN"},{name:"Guinea-Bissau",dial_code:"245",code:"GW"},{name:"Haiti",dial_code:"509",code:"HT"},{name:"Holy See (Vatican City State)",dial_code:"379",code:"VA"},{name:"Honduras",dial_code:"504",code:"HN"},{name:"Hong Kong",dial_code:"852",code:"HK"},{name:"Hungary",dial_code:"36",code:"HU"},{name:"Iceland",dial_code:"354",code:"IS"},{name:"India",dial_code:"91",code:"IN"},{name:"Indonesia",dial_code:"62",code:"ID"},{name:"Iran, Islamic Republic of Persian Gulf",dial_code:"98",code:"IR"},{name:"Iraq",dial_code:"964",code:"IQ"},{name:"Ireland",dial_code:"353",code:"IE"},{name:"Israel",dial_code:"972",code:"IL"},{name:"Italy",dial_code:"39",code:"IT"},{name:"Jamaica",dial_code:"1876",code:"JM"},{name:"Japan",dial_code:"81",code:"JP"},{name:"Jordan",dial_code:"962",code:"JO"},{name:"Kenya",dial_code:"254",code:"KE"},{name:"Kiribati",dial_code:"686",code:"KI"},{name:"Korea, Democratic People's Republic of Korea",dial_code:"850",code:"KP"},{name:"Korea, Republic of South Korea",dial_code:"82",code:"KR"},{name:"Kuwait",dial_code:"965",code:"KW"},{name:"Kyrgyzstan",dial_code:"996",code:"KG"},{name:"Laos",dial_code:"856",code:"LA"},{name:"Latvia",dial_code:"371",code:"LV"},{name:"Lebanon",dial_code:"961",code:"LB"},{name:"Lesotho",dial_code:"266",code:"LS"},{name:"Liberia",dial_code:"231",code:"LR"},{name:"Libyan Arab Jamahiriya",dial_code:"218",code:"LY"},{name:"Liechtenstein",dial_code:"423",code:"LI"},{name:"Lithuania",dial_code:"370",code:"LT"},{name:"Luxembourg",dial_code:"352",code:"LU"},{name:"Macao",dial_code:"853",code:"MO"},{name:"Macedonia",dial_code:"389",code:"MK"},{name:"Madagascar",dial_code:"261",code:"MG"},{name:"Malawi",dial_code:"265",code:"MW"},{name:"Malaysia",dial_code:"60",code:"MY"},{name:"Maldives",dial_code:"960",code:"MV"},{name:"Mali",dial_code:"223",code:"ML"},{name:"Malta",dial_code:"356",code:"MT"},{name:"Marshall Islands",dial_code:"692",code:"MH"},{name:"Martinique",dial_code:"596",code:"MQ"},{name:"Mauritania",dial_code:"222",code:"MR"},{name:"Mauritius",dial_code:"230",code:"MU"},{name:"Mayotte",dial_code:"262",code:"YT"},{name:"Mexico",dial_code:"52",code:"MX"},{name:"Micronesia, Federated States of Micronesia",dial_code:"691",code:"FM"},{name:"Moldova",dial_code:"373",code:"MD"},{name:"Monaco",dial_code:"377",code:"MC"},{name:"Mongolia",dial_code:"976",code:"MN"},{name:"Montenegro",dial_code:"382",code:"ME"},{name:"Montserrat",dial_code:"1664",code:"MS"},{name:"Morocco",dial_code:"212",code:"MA"},{name:"Mozambique",dial_code:"258",code:"MZ"},{name:"Myanmar",dial_code:"95",code:"MM"},{name:"Namibia",dial_code:"264",code:"NA"},{name:"Nauru",dial_code:"674",code:"NR"},{name:"Nepal",dial_code:"977",code:"NP"},{name:"Netherlands",dial_code:"31",code:"NL"},{name:"New Caledonia",dial_code:"687",code:"NC"},{name:"New Zealand",dial_code:"64",code:"NZ"},{name:"Nicaragua",dial_code:"505",code:"NI"},{name:"Niger",dial_code:"227",code:"NE"},{name:"Nigeria",dial_code:"234",code:"NG"},{name:"Niue",dial_code:"683",code:"NU"},{name:"Norfolk Island",dial_code:"672",code:"NF"},{name:"Northern Mariana Islands",dial_code:"1670",code:"MP"},{name:"Norway",dial_code:"47",code:"NO"},{name:"Oman",dial_code:"968",code:"OM"},{name:"Pakistan",dial_code:"92",code:"PK"},{name:"Palau",dial_code:"680",code:"PW"},{name:"Palestinian Territory, Occupied",dial_code:"970",code:"PS"},{name:"Panama",dial_code:"507",code:"PA"},{name:"Papua New Guinea",dial_code:"675",code:"PG"},{name:"Paraguay",dial_code:"595",code:"PY"},{name:"Guyana",dial_code:"595",code:"GY"},{name:"Peru",dial_code:"51",code:"PE"},{name:"Philippines",dial_code:"63",code:"PH"},{name:"Poland",dial_code:"48",code:"PL"},{name:"Portugal",dial_code:"351",code:"PT"},{name:"Puerto Rico",dial_code:"1939",code:"PR"},{name:"Qatar",dial_code:"974",code:"QA"},{name:"Romania",dial_code:"40",code:"RO"},{name:"Russia",dial_code:"7",code:"RU"},{name:"Kazakhstan",dial_code:"7",code:"KZ"},{name:"Rwanda",dial_code:"250",code:"RW"},{name:"Reunion",dial_code:"262",code:"RE"},{name:"Saint Barthelemy",dial_code:"590",code:"BL"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dial_code:"290",code:"SH"},{name:"Saint Kitts and Nevis",dial_code:"1869",code:"KN"},{name:"Saint Lucia",dial_code:"1758",code:"LC"},{name:"Saint Martin",dial_code:"590",code:"MF"},{name:"Saint Pierre and Miquelon",dial_code:"508",code:"PM"},{name:"Saint Vincent and the Grenadines",dial_code:"1784",code:"VC"},{name:"Samoa",dial_code:"685",code:"WS"},{name:"San Marino",dial_code:"378",code:"SM"},{name:"Sao Tome and Principe",dial_code:"239",code:"ST"},{name:"Saudi Arabia",dial_code:"966",code:"SA"},{name:"Senegal",dial_code:"221",code:"SN"},{name:"Serbia",dial_code:"381",code:"RS"},{name:"Seychelles",dial_code:"248",code:"SC"},{name:"Sierra Leone",dial_code:"232",code:"SL"},{name:"Singapore",dial_code:"65",code:"SG"},{name:"Slovakia",dial_code:"421",code:"SK"},{name:"Slovenia",dial_code:"386",code:"SI"},{name:"Solomon Islands",dial_code:"677",code:"SB"},{name:"Somalia",dial_code:"252",code:"SO"},{name:"South Africa",dial_code:"27",code:"ZA"},{name:"South Sudan",dial_code:"211",code:"SS"},{name:"Spain",dial_code:"34",code:"ES"},{name:"Sri Lanka",dial_code:"94",code:"LK"},{name:"Sudan",dial_code:"249",code:"SD"},{name:"Suriname",dial_code:"597",code:"SR"},{name:"Swaziland",dial_code:"268",code:"SZ"},{name:"Sweden",dial_code:"46",code:"SE"},{name:"Switzerland",dial_code:"41",code:"CH"},{name:"Syrian Arab Republic",dial_code:"963",code:"SY"},{name:"Taiwan",dial_code:"886",code:"TW"},{name:"Tajikistan",dial_code:"992",code:"TJ"},{name:"Tanzania, United Republic of Tanzania",dial_code:"255",code:"TZ"},{name:"Thailand",dial_code:"66",code:"TH"},{name:"Timor-Leste",dial_code:"670",code:"TL"},{name:"Togo",dial_code:"228",code:"TG"},{name:"Tokelau",dial_code:"690",code:"TK"},{name:"Tonga",dial_code:"676",code:"TO"},{name:"Trinidad and Tobago",dial_code:"1868",code:"TT"},{name:"Tunisia",dial_code:"216",code:"TN"},{name:"Turkey",dial_code:"90",code:"TR"},{name:"Turkmenistan",dial_code:"993",code:"TM"},{name:"Turks and Caicos Islands",dial_code:"1649",code:"TC"},{name:"Tuvalu",dial_code:"688",code:"TV"},{name:"Uganda",dial_code:"256",code:"UG"},{name:"Ukraine",dial_code:"380",code:"UA"},{name:"United Arab Emirates",dial_code:"971",code:"AE"},{name:"United Kingdom",dial_code:"44",code:"GB"},{name:"United States",dial_code:"1",code:"US"},{name:"Canada",dial_code:"1",code:"CA"},{name:"Uruguay",dial_code:"598",code:"UY"},{name:"Uzbekistan",dial_code:"998",code:"UZ"},{name:"Vanuatu",dial_code:"678",code:"VU"},{name:"Venezuela, Bolivarian Republic of Venezuela",dial_code:"58",code:"VE"},{name:"Vietnam",dial_code:"84",code:"VN"},{name:"Virgin Islands, British",dial_code:"1284",code:"VG"},{name:"Virgin Islands, U.S.",dial_code:"1340",code:"VI"},{name:"Wallis and Futuna",dial_code:"681",code:"WF"},{name:"Yemen",dial_code:"967",code:"YE"},{name:"Zambia",dial_code:"260",code:"ZM"},{name:"Zimbabwe",dial_code:"263",code:"ZW"}].map((e=>e.code)),Ps=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[\+\-]\d{2}:\d{2})?$/;const Rs=Is.string().refine((e=>{return"string"==typeof(t=e)&&24===t.length&&bt().isValid(t);var t}),(e=>new yr([{code:"custom",message:`Invalid ObjectId: ${e}`,path:["some_path"]}]))).transform((e=>new(bt())(e))),Cs=(Is.union([Is.string(),Is.number()]).refine((e=>{if("number"==typeof e)return!0;const t=Number(e);return!isNaN(t)}),{message:"Invalid number or string in stringToNumberSchema"}).transform((e=>"number"==typeof e?e:Number(e))),Is.string().refine((e=>Ps.test(e)),{message:"Invalid date string"}).transform((e=>new Date(e)))),Ns=Is.string().transform((e=>e.toUpperCase())).pipe(Is.union([Is.literal("419"),Is.enum(As)])).transform((e=>"419"===e?void 0:e)),Ms=Is.record(Is.union([Cs,Is.string(),Is.number(),Is.boolean(),Is.array(Is.string()),Is.array(Is.object({})),Is.object({}),Is.null(),Is.undefined()])),js=Is.record(Is.union([Cs,Is.string(),Is.number(),Is.boolean(),Is.array(Is.string()),Is.array(Is.object({})),Is.object({}),Is.undefined()])),Us=(Is.string().transform((e=>e.split(",").map((e=>e.trim())))).refine((e=>e.every((e=>e.length>0))),{message:"Each item should not be empty"}),Is.object({section:Is.string().optional(),prev_section:Is.string().optional(),recommendation_id:Is.string().optional(),price:Is.number().optional(),order_id:Is.string().optional(),rating:Is.number().optional(),prev_page:Is.string().optional(),page:Is.string().optional(),position:Is.number().optional(),item_id:Is.string().optional(),items:Is.array(Is.object({id:Is.string(),price:Is.number(),quantity:Is.number().optional(),custom_event_properties:js.optional()})).optional(),search_query:Is.string().optional(),order_amount:Is.number().optional(),paid_amount:Is.number().optional(),tracking:Is.object({id:Is.string(),type:Is.string()}).optional(),click_target:Is.string().optional()})),$s=Is.object({url:Is.string().optional(),ref:Is.string().optional(),click_target:Is.string().optional()}),Ds=Is.object({application_id:Rs,blux_user_id:Rs.nullish(),pipeline:Is.array(Is.object({name:Is.string(),kwargs:Is.record(Is.any())})),item_id:Is.string().nullish(),item_ids:Is.array(Is.string()).nullish(),limit:Is.number(),offset:Is.number().nullish().default(0),options:Is.record(Is.string(),Is.any()).nullish()}).pick({item_id:!0,item_ids:!0,limit:!0,offset:!0}).extend({call_type:Is.string(),category_id:Is.string().nullish()});var Ls,Zs,Bs;!function(e){e.GET="get",e.POST="post",e.PUT="put",e.DELETE="delete"}(Ls||(Ls={})),function(e){e.ios="ios",e.android="android",e.browser="browser"}(Zs||(Zs={})),function(e){e.male="male",e.female="female"}(Bs||(Bs={}));const Fs="/applications/{application_id}",zs="/v2/applications/{application_id}";var Vs;function Hs(e,t){return Object.keys(t).reduce(((e,n)=>{const r=t[n];return void 0===r?e:e.replace(new RegExp(`\\{${n}\\}`,"g"),r)}),e)}!function(e){let t,n,r,i,s,a,o,c;!function(e){e.name="bluxUsersInitialize",e.path=`${Fs}/blux-users/initialize`,e.method=Ls.POST,e.bodySchema=Is.object({session_id:Is.string().optional(),device_id:Rs.optional(),custom_device_id:Is.string().optional(),country_code:Ns.optional(),device_model:Is.string(),language_code:Is.string(),os_version:Is.string(),platform:Is.nativeEnum(Zs),sdk_type:Is.string(),sdk_version:Is.string(),timezone:Is.string(),blux_user_id:Is.string().optional()}),e.pathSchema=Is.object({application_id:Is.string().optional()})}(t=e.bluxUsersInitialize||(e.bluxUsersInitialize={})),function(e){e.name="bluxUsersSignIn",e.path=`${Fs}/blux-users/{blux_user_id}/sign-in`,e.method=Ls.PUT,e.bodySchema=Is.object({user_id:Is.string(),device_id:Is.string().optional()}),e.pathSchema=Is.object({application_id:Is.string().optional(),blux_user_id:Rs})}(n=e.bluxUsersSignIn||(e.bluxUsersSignIn={})),function(e){e.name="bluxUsersSignOut",e.path=`${Fs}/blux-users/{blux_user_id}/sign-out`,e.method=Ls.PUT,e.bodySchema=Is.object({device_id:Rs.optional()}),e.pathSchema=Is.object({application_id:Is.string().optional(),blux_user_id:Rs})}(r=e.bluxUsersSignOut||(e.bluxUsersSignOut={})),function(e){e.name="bluxUsersCollectEventsV2",e.path=`${zs}/blux-users/{blux_user_id}/collect-events`,e.method=Ls.POST,e.pathSchema=Is.object({application_id:Rs,blux_user_id:Rs}),e.bodySchema=Is.object({device_id:Rs,events:Is.array(Is.object({event_type:Is.string(),event_properties:Us.optional(),custom_event_properties:js.optional(),internal_event_properties:$s.optional(),captured_at:Cs}))})}(i=e.bluxUsersCollectEventsV2||(e.bluxUsersCollectEventsV2={})),function(e){e.name="bluxUsersUpdateProperties",e.path=`${Fs}/blux-users/{blux_user_id}/update-properties`,e.method=Ls.PUT,e.bodySchema=Is.object({user_properties:Is.object({phone_number:Is.string().nullish(),email_address:Is.string().nullish(),nighttime_notification_consent:Is.boolean().nullish(),marketing_notification_consent:Is.boolean().nullish(),marketing_notification_sms_consent:Is.boolean().nullish(),marketing_notification_email_consent:Is.boolean().nullish(),marketing_notification_kakao_consent:Is.boolean().nullish(),marketing_notification_push_consent:Is.boolean().nullish(),is_all_notification_blocked:Is.boolean().nullish(),gender:Is.nativeEnum(Bs).nullish(),age:Is.number().nullish()}).optional(),custom_user_properties:Ms.optional()}),e.pathSchema=Is.object({application_id:Is.string(),blux_user_id:Rs})}(s=e.bluxUsersUpdateProperties||(e.bluxUsersUpdateProperties={})),function(e){e.name="bluxUsersGetItemRecommendationsV2",e.path=`${zs}/blux-users/{blux_user_id}/item-recommendations`,e.method=Ls.POST,e.bodySchema=Ds,e.pathSchema=Is.object({application_id:Rs,blux_user_id:Rs})}(a=e.bluxUsersGetItemRecommendationsV2||(e.bluxUsersGetItemRecommendationsV2={})),function(e){e.name="crmEventsCreate",e.path=`${Fs}/crm-events`,e.method=Ls.POST,e.bodySchema=Is.object({notification_id:Rs,crm_event_type:Is.union([Is.literal("push_opened"),Is.literal("button_clicked"),Is.literal("landing_clicked"),Is.literal("inapp_opened")]),captured_at:Cs,item_id:Is.string().optional()}),e.pathSchema=Is.object({application_id:Is.string()})}(o=e.crmEventsCreate||(e.crmEventsCreate={})),function(e){e.name="notificationsUpdate",e.path=`${Fs}/notifications/{notification_id}`,e.method=Ls.POST,e.pathSchema=Is.object({application_id:Rs,notification_id:Rs}),e.bodySchema=Is.object({status:Is.literal("received")})}(c=e.notificationsUpdate||(e.notificationsUpdate={}))}(Vs||(Vs={}));var qs=Vs.crmEventsCreate;const Ks=(e,t,n,r)=>e[qs.method](Hs(qs.path,t),n,{headers:r});var Ws=Vs.bluxUsersCollectEventsV2,Gs=Vs.bluxUsersGetItemRecommendationsV2;const Js=(e,t,n,r)=>e[Gs.method](Hs(Gs.path,t),n,{headers:r});var Ys=Vs.bluxUsersInitialize,Qs=Vs.notificationsUpdate,Xs=Vs.bluxUsersSignIn,ea=Vs.bluxUsersSignOut,ta=Vs.bluxUsersUpdateProperties;class na{}const ra={debug:console.debug.bind(console),log:console.log.bind(console),warning:console.warn.bind(console),error:console.error.bind(console),fatal:console.error.bind(console)},ia={debug:0,log:1,warning:2,error:3,fatal:4};class sa{static logLevel="error";static base(e,t,n){if(ia[t]>=ia[this.logLevel]){const r=["[BluxClient]",e];n?.extra&&r.push(n.extra),n?.tags&&r.push(n.tags),ra[t]?.(...r)}}static debug(e,t){this.base(e,"debug",t)}static log(e,t){this.base(e,"log",t)}static warning(e,t){this.base(e,"warning",t)}static error(e,t){this.base(e,"error",t)}static fatal(e,t){this.base(e,"fatal",t)}static setLevel(e){this.logLevel=e}}class aa extends na{platform="android";postMessage(e,t){"undefined"!=typeof window?window.BluxAndroid?.postMessage?window.BluxAndroid.postMessage(JSON.stringify({action:e,payload:t})):sa.error("No Android WebView available",{tags:{from:"AndroidBridge.postMessage"}}):sa.error("window is undefined",{tags:{from:"AndroidBridge.postMessage"}})}initialize(e){this.postMessage("initialize",e)}signIn(e){this.postMessage("signIn",e)}signOut(){this.postMessage("signOut")}setUserProperties(e){this.postMessage("setUserProperties",e)}setCustomUserProperties(e){this.postMessage("setCustomUserProperties",e)}sendEvent(e){this.postMessage("sendEvent",e)}}class oa extends na{platform="flutter";postMessage(e,t){"undefined"!=typeof window?window.Blux?.postMessage?window.Blux.postMessage(JSON.stringify({action:e,payload:t})):window.flutter_inappwebview?.callHandler?window.flutter_inappwebview.callHandler("Blux",JSON.stringify({action:e,payload:t})).catch((e=>sa.error(e,{tags:{from:"FlutterBridge.postMessage"}}))):sa.error("No Flutter WebView available",{tags:{from:"FlutterBridge.postMessage"}}):sa.error("window is undefined",{tags:{from:"FlutterBridge.postMessage"}})}initialize(e){this.postMessage("initialize",e)}signIn(e){this.postMessage("signIn",e)}signOut(){this.postMessage("signOut")}setUserProperties(e){this.postMessage("setUserProperties",e)}setCustomUserProperties(e){this.postMessage("setCustomUserProperties",e)}sendEvent(e){this.postMessage("sendEvent",e)}}class ca extends na{platform="ios";postMessage(e,t){if("undefined"==typeof window)return void sa.error("window is undefined",{tags:{from:"IosBridge.postMessage"}});const n=window.webkit?.messageHandlers?.Blux;n?.postMessage?n.postMessage(JSON.stringify({action:e,payload:t})):sa.error("No iOS WKWebView Blux handler available",{tags:{from:"IosBridge.postMessage"}})}initialize(e){this.postMessage("initialize",e)}signIn(e){this.postMessage("signIn",e)}signOut(){this.postMessage("signOut")}setUserProperties(e){this.postMessage("setUserProperties",e)}setCustomUserProperties(e){this.postMessage("setCustomUserProperties",e)}sendEvent(e){this.postMessage("sendEvent",e)}}class ua extends na{platform="react-native";postMessage(e,t){"undefined"!=typeof window?window.ReactNativeWebView?.postMessage?window.ReactNativeWebView.postMessage(JSON.stringify({action:e,payload:t})):sa.error("No React Native WebView available",{tags:{from:"RNBridge.postMessage"}}):sa.error("window is undefined",{tags:{from:"RNBridge.postMessage"}})}initialize(e){this.postMessage("initialize",e)}signIn(e){this.postMessage("signIn",e)}signOut(){this.postMessage("signOut")}setUserProperties(e){this.postMessage("setUserProperties",e)}setCustomUserProperties(e){this.postMessage("setCustomUserProperties",e)}sendEvent(e){this.postMessage("sendEvent",e)}}const da="data-blux-tracking-id",la="data-blux-item-id",pa={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var ha,fa=new Uint8Array(16);function ma(){if(!ha&&!(ha="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ha(fa)}for(var ga=[],ya=0;ya<256;++ya)ga.push((ya+256).toString(16).slice(1));const va=function(e,t,n){if(pa.randomUUID&&!t&&!e)return pa.randomUUID();var r=(e=e||{}).random||(e.rng||ma)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return function(e,t=0){return(ga[e[t+0]]+ga[e[t+1]]+ga[e[t+2]]+ga[e[t+3]]+"-"+ga[e[t+4]]+ga[e[t+5]]+"-"+ga[e[t+6]]+ga[e[t+7]]+"-"+ga[e[t+8]]+ga[e[t+9]]+"-"+ga[e[t+10]]+ga[e[t+11]]+ga[e[t+12]]+ga[e[t+13]]+ga[e[t+14]]+ga[e[t+15]]).toLowerCase()}(r)};var _a;!function(e){e.visit="visit",e.push_opened="push_opened",e.friendtalk_button_clicked="friendtalk_button_clicked",e.alimtalk_button_clicked="alimtalk_button_clicked",e.landing_clicked="landing_clicked",e.email_link_clicked="email_link_clicked",e.sms_link_clicked="sms_link_clicked",e.product_detail_view="product_detail_view",e.purchase="purchase",e.order="order",e.cartadd="cartadd",e.like="like",e.rate="rate",e.page_visit="page_visit",e.page_view="page_view",e.instant_impression="instant_impression",e.persistent_impression="persistent_impression",e.search="search",e.section_view="section_view",e.click="click"}(_a||(_a={}));class ba{request;constructor(e){this.request={id:va(),captured_at:(new Date).toISOString(),...e}}}class wa extends ba{constructor({eventType:e,eventProperties:t,customEventProperties:n}){super({event_type:e,event_properties:t,custom_event_properties:n})}}class xa extends ba{constructor({itemId:e,tracking:t,customEventProperties:n}){super({event_type:_a.product_detail_view,event_properties:{item_id:e,tracking:t},custom_event_properties:n})}}class Sa extends ba{constructor({section:e,tracking:t,customEventProperties:n}){super({event_type:_a.section_view,event_properties:{section:e,tracking:t},custom_event_properties:n})}}class ka extends ba{constructor({tracking:e,customEventProperties:t}){super({event_type:_a.page_visit,event_properties:{tracking:e},custom_event_properties:t})}}class Ea extends ba{constructor({itemId:e,tracking:t,customEventProperties:n}){super({event_type:_a.click,event_properties:{item_id:e,tracking:t},custom_event_properties:n})}}class Ta extends ba{constructor({tracking:e,customEventProperties:t}){super({event_type:_a.visit,event_properties:{tracking:e},custom_event_properties:t})}}const Oa="blux_deviceId",Ia="blux_url",Aa="blux_ref",Pa="blux_inapp";class Ra{static getDeviceId(){const e=localStorage.getItem(Oa);return"undefined"===e||""===e?.trim()?null:e}static setDeviceId(e){localStorage.setItem(Oa,e)}static getUrl(){const e=localStorage.getItem(Ia);return"undefined"===e||""===e?.trim()?null:e}static setUrl(e){localStorage.setItem(Ia,e)}static getRef(){const e=localStorage.getItem(Aa);return"undefined"===e||""===e?.trim()?null:e}static setRef(e){localStorage.setItem(Aa,e)}static setInappHideTimestamp(e,t){localStorage.setItem(`${Pa}/${e}`,t.toString())}static getInappHideTimestamp(e){const t=localStorage.getItem(`${Pa}/${e}`);return t?parseInt(t):null}}var Ca=["addListener","removeListener"],Na=["addEventListener","removeEventListener"],Ma=["on","off"];function ja(e,t,n,r){if(Pt(n)&&(r=n,n=void 0),r)return ja(e,t,n).pipe(tr(r));var i=Ot(function(e){return Pt(e.addEventListener)&&Pt(e.removeEventListener)}(e)?Na.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return Pt(e.addListener)&&Pt(e.removeListener)}(e)?Ca.map(Ua(e,t)):function(e){return Pt(e.on)&&Pt(e.off)}(e)?Ma.map(Ua(e,t)):[],2),s=i[0],a=i[1];if(!s&&yn(e))return An((function(e){return ja(e,t,n)}))(Tn(e));if(!s)throw new TypeError("Invalid event target");return new on((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return s(t),function(){return a(t)}}))}function Ua(e,t){return function(n){return function(r){return e[n](t,r)}}}function $a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Rn(1)(Ln(e,jn(e)))}function Da(e,t){return void 0===t&&(t=an),e=null!=e?e:La,hn((function(n,r){var i,s=!0;n.subscribe(fn(r,(function(n){var a=t(n);!s&&e(i,a)||(s=!1,i=a,r.next(n))})))}))}function La(e,t){return e===t}var Za=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Vn);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return kt(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,a=n._timestampProvider,o=n._windowTime;r||(i.push(t),!s&&i.push(a.now()+o)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,s=(i?1:2)*t;if(t<1/0&&s<r.length&&r.splice(0,r.length-s),!i){for(var a=n.now(),o=0,c=1;c<r.length&&r[c]<=a;c+=2)o=c;o&&r.splice(0,o+1)}},t}(dn);function Ba(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==t){if(!1!==t){var i=new en({next:function(){i.unsubscribe(),e()}});return Tn(t.apply(void 0,It([],Ot(n)))).subscribe(i)}}else e()}function Fa(e,t,n){var r,i,s,a,o=!1;return e&&"object"==typeof e?(r=e.bufferSize,a=void 0===r?1/0:r,i=e.windowTime,t=void 0===i?1/0:i,o=void 0!==(s=e.refCount)&&s,n=e.scheduler):a=null!=e?e:1/0,function(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new dn}:t,r=e.resetOnError,i=void 0===r||r,s=e.resetOnComplete,a=void 0===s||s,o=e.resetOnRefCountZero,c=void 0===o||o;return function(e){var t,r,s,o=0,u=!1,d=!1,l=function(){null==r||r.unsubscribe(),r=void 0},p=function(){l(),t=s=void 0,u=d=!1},h=function(){var e=t;p(),null==e||e.unsubscribe()};return hn((function(e,f){o++,d||u||l();var m=s=null!=s?s:n();f.add((function(){0!=--o||d||u||(r=Ba(h,c))})),m.subscribe(f),!t&&o>0&&(t=new en({next:function(e){return m.next(e)},error:function(e){d=!0,l(),r=Ba(p,i,e),m.error(e)},complete:function(){u=!0,l(),r=Ba(p,a),m.complete()}}),Tn(e).subscribe(t))}))(e)}}({connector:function(){return new Za(a,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}const za=nr([ja(document,"visibilitychange").pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=jn(e);return hn((function(t,r){(n?$a(e,t,n):$a(e,t)).subscribe(r)}))}(0),gn((()=>"visible"===document.visibilityState)),Da(),Fa({bufferSize:1,refCount:!0})),Zn(ja(window,"online").pipe(gn((()=>!0))),ja(window,"offline").pipe(gn((()=>!1))),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ln(e,jn(e))}(navigator.onLine)).pipe(Da(),Fa({bufferSize:1,refCount:!0}))]).pipe(gn((([e,t])=>e&&t)),Da(),Fa({bufferSize:1,refCount:!0}));function Va(){return Gn((e=>null!=e))}const Ha="blux_userId",qa="blux_sessionId";class Ka{static getBluxUserId(){const e=sessionStorage.getItem(Ha);return"undefined"===e||""===e?.trim()?null:e}static setBluxUserId(e){sessionStorage.setItem(Ha,e)}static getSessionId(){return sessionStorage.getItem(qa)}static setSessionId(e){sessionStorage.setItem(qa,e)}}const Wa=new class{api=vt.create();sdkInfo={type:Zs.browser,version:"2.2.11"};bluxUser$=new pn(void 0);apiRequestQueue$=new dn;inappQueue$=new pn(void 0);eventQueue$=new dn;userPropertiesQueue$=new dn;INITIAL_NEXT_POLL_DELAY_MS=1e4;nextPollDelayMs$=new pn(this.INITIAL_NEXT_POLL_DELAY_MS);cachedNextPollDelayMs=this.INITIAL_NEXT_POLL_DELAY_MS;lastPollTimestamp=Date.now();bluxApplicationId;bluxAPIKey;customDeviceId;bridge;impressedElements=[];intersectionObservingElements=[];intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{this.intersectionEntry$.next(e)}))}));intersectionEntry$=new dn;hitElements=[];currentInappCleanup=null;inAppCustomActionHandlers=new Set;resolveBridge(e){if("useRNBridge"in e&&e.useRNBridge)return new ua;if("bridgePlatform"in e&&e.bridgePlatform)switch(e.bridgePlatform){case"none":return null;case"android":return new aa;case"ios":return new ca;case"react-native":return new ua;case"flutter":return new oa;default:{const t=e.bridgePlatform;sa.error(`Unknown bridge platform: ${t}`,{tags:{from:"resolveBridge"}})}}return null}constructor({bluxApplicationId:e,bluxAPIKey:t,customDeviceId:n,...r},i){this.bluxApplicationId=e,this.bluxAPIKey=t,this.customDeviceId=n;const s=window?._BLUX_SDK_?.baseUrl??"https://api.blux.ai/prod";var a;this.api.defaults.baseURL=s,this.bridge=this.resolveBridge(r),this.apiRequestQueue$.pipe(Pn((async e=>{try{const t=await e.action();e.resolve(t)}catch(t){e.reject(t)}}))).subscribe(),this.bridge||Zn(this.eventQueue$.pipe(Wn(100),Gn((e=>e.length>0))),nr([this.nextPollDelayMs$,za]).pipe((a=([e,t])=>{if(!t||null==e)return ir;const n=this.lastPollTimestamp+e;return function(e,t,n){void 0===e&&(e=0),void 0===n&&(n=Kn);var r=-1;return new on((function(t){var i=sr(e)?+e-n.now():e;i<0&&(i=0);var s=0;return n.schedule((function(){t.closed||(t.next(s++),0<=r?this.schedule(void 0,r):t.complete())}),i)}))}(Math.max(0,n-Date.now()))},hn((function(e,t){var n=null,r=!1,i=function(){return r&&!n&&t.complete()};e.subscribe(fn(t,(function(e){null==n||n.unsubscribe();0;Tn(a(e)).subscribe(n=fn(t,(function(e){return t.next(e)}),(function(){n=null,i()})))}),(function(){r=!0,i()})))}))),gn((()=>[])))).pipe(Pn((async e=>{this.nextPollDelayMs$.next(null);try{const t=await this.getBluxUserWithTimeout(),n=e.map((e=>({...e,blux_id:t.id,device_id:t.deviceId}))),{data:{nextPollDelayMs:r,inapp:i}}=await this.enqueueRequest((()=>{return e=this.api,r={blux_user_id:t.id,application_id:t.applicationId},i={device_id:t.deviceId,events:n},s=this.generateApiHeader(t),e[Ws.method](Hs(Ws.path,r),i,{headers:s});var e,r,i,s}));this.lastPollTimestamp=Date.now(),this.cachedNextPollDelayMs=r,this.nextPollDelayMs$.next(Math.max(r,3e3)),i&&this.inappQueue$.next(i)}catch(e){if(sa.error(e,{tags:{from:"eventQueue"}}),this.lastPollTimestamp=Date.now(),null!==this.cachedNextPollDelayMs){const e=this.cachedNextPollDelayMs>864e5?this.cachedNextPollDelayMs:2*this.cachedNextPollDelayMs;this.cachedNextPollDelayMs=e,this.nextPollDelayMs$.next(e)}}}))).subscribe(),this.userPropertiesQueue$.pipe(Wn(100),Gn((e=>e.length>0)),Pn((async e=>{try{const t=await this.getBluxUserWithTimeout(),n=e.reduce(((e,t)=>({...e,...t.userProperties??{}})),{}),r=e.reduce(((e,t)=>({...e,...t.customUserProperties??{}})),{}),i={};if(Object.keys(n).length>0&&(i.user_properties=n),Object.keys(r).length>0&&(i.custom_user_properties=r),0===Object.keys(i).length)return void e.forEach((e=>e.resolve()));await this.enqueueRequest((()=>{return e=this.api,n={application_id:t.applicationId,blux_user_id:t.id},r=i,s=this.generateApiHeader(t),e[ta.method](Hs(ta.path,n),r,{headers:s});var e,n,r,s})),e.forEach((e=>e.resolve()))}catch(t){e.forEach((e=>e.reject(t))),sa.error(t,{tags:{from:"userPropertiesQueue"}})}}))).subscribe(),this.bluxUser$.subscribe((e=>{e&&Ka.setBluxUserId(e.id)})),this.bridge||this.inappQueue$.pipe(Va()).pipe(Pn((e=>za.pipe(cr(Boolean),Pn((()=>Ln(this.displayInapp(e)))))))).subscribe(),this.init().then((()=>{i?.({success:!0})})).catch((e=>{i?.({success:!1,errorMessage:e.message})}))}async enqueueRequest(e){return new Promise(((t,n)=>{const r={action:e,resolve:t,reject:n};this.apiRequestQueue$.next(r)}))}generateApiHeader({bluxAPIKey:e}){return{Authorization:e}}async displayInapp(e){return new Promise((t=>{const n=this.bluxUser$.getValue(),r=Ra.getInappHideTimestamp(e.inappId);if(null!==r&&xt()().isBefore(xt()(r)))return t(!0);const i=document.createElement("iframe"),s=`<script>\n (function() {\n var origReplaceState = history.replaceState;\n var origPushState = history.pushState;\n history.replaceState = function() {\n try { return origReplaceState.apply(this, arguments); }\n catch(e) { console.debug('[Blux] history.replaceState blocked in blob context'); }\n };\n history.pushState = function() {\n try { return origPushState.apply(this, arguments); }\n catch(e) { console.debug('[Blux] history.pushState blocked in blob context'); }\n };\n })();\n <\/script><base href="${e.baseUrl}/">`,a=e.htmlString.includes("<head>")?e.htmlString.replace("<head>",`<head>${s}`):e.htmlString,o=new Blob([a],{type:"text/html"}),c=URL.createObjectURL(o);i.sandbox.add("allow-scripts","allow-same-origin","allow-forms"),i.src=c,i.style.position="fixed",i.style.width=`${window.innerWidth}px`,i.style.height=`${window.innerHeight}px`,i.style.top="0",i.style.left="0",i.style.zIndex="9999",i.id=`blux-inapp-${e.inappId}`,document.body.appendChild(i);let u=null;const d=()=>{URL.revokeObjectURL(c),i.remove(),window.removeEventListener("message",p),window.visualViewport?.removeEventListener("resize",l),window.visualViewport?.removeEventListener("scroll",l),u?.unsubscribe(),this.currentInappCleanup=null,t(e.inappId)};this.currentInappCleanup=d;const l=()=>{const e=window.visualViewport?.width??window.innerWidth,t=window.visualViewport?.height??window.innerHeight,n=window.visualViewport?.offsetLeft??0,r=window.visualViewport?.offsetTop??0;i.style.width=`${e}px`,i.style.height=`${t}px`,i.style.left=`${n}px`,i.style.top=`${r}px`},p=t=>{if(t.source!==i.contentWindow)return;const r=t.data;if("resize"===r.action){const{height:e,location:t}=r.data;return i.style.width="90vw",i.style.maxWidth="448px",i.style.height=`${e}px`,i.style.left="50%",i.style.transform="translateX(-50%)","top"===t?(i.style.top="0",i.style.bottom="auto"):(i.style.top="auto",i.style.bottom="0"),window.visualViewport?.removeEventListener("resize",l),void window.visualViewport?.removeEventListener("scroll",l)}if("hide"===r.action){const{days_to_hide:t}=r.data;if(0!==t){const n=xt()().add(t,"days").valueOf();Ra.setInappHideTimestamp(e.inappId,n)}}else if("link"===r.action){const t=n?this.enqueueRequest((()=>Ks(this.api,{application_id:this.bluxApplicationId},{notification_id:e.notificationId,crm_event_type:"inapp_opened",captured_at:(new Date).toISOString()},this.generateApiHeader(n)))):Promise.resolve();if(r.data.is_blux_landing);else{const{url:e,open_in_new_tab:n,opened_by_iframe:i}=r.data,s=i&&!n;"6878af275ead5a75abbdacd7"===this.bluxApplicationId?t.finally((()=>{window.top?.postMessage({type:"blux_inapp_message",url:e},window.location.origin)})):s?t.finally((()=>{window.location.href=e})):i||(n?window.open(e,"_blank"):window.location.href=e)}}else if("custom_action"===r.action){const{action_id:e,data:t,should_dismiss:n}=r.data;for(const n of this.inAppCustomActionHandlers)try{n({actionId:e,data:t})}catch(e){sa.error(e,{tags:{from:"inAppCustomActionHandler"}})}if(!n)return}else if("inapp_opened"===r.action)return void(n&&this.enqueueRequest((()=>Ks(this.api,{application_id:this.bluxApplicationId},{notification_id:e.notificationId,crm_event_type:"inapp_opened",captured_at:(new Date).toISOString()},this.generateApiHeader(n)))));d()};u=this.urlAndRef$.pipe(Va(),Gn((function(e,t){return 1<=t})),cr()).subscribe((()=>{d()})),window.visualViewport?.addEventListener("resize",l),window.visualViewport?.addEventListener("scroll",l),window.addEventListener("message",p),n&&this.enqueueRequest((()=>{return t=this.api,r={application_id:this.bluxApplicationId,notification_id:e.notificationId},i={status:"received"},s=this.generateApiHeader(n),t[Qs.method](Hs(Qs.path,r),i,{headers:s});var t,r,i,s}))}))}async init(){if(this.handleUrlAndRef(),this.urlAndRef$.pipe(Va()).subscribe((()=>{this.sendEvent(new ka({}))})),this.bridge)return void this.bridge.initialize({bluxApplicationId:this.bluxApplicationId,bluxAPIKey:this.bluxAPIKey,customDeviceId:this.customDeviceId});const e=new URLSearchParams(window.location.search).get("blux_user_id"),t=Ka.getSessionId()??(new(bt())).toHexString();Ka.setSessionId(t),Ka.getBluxUserId()||this.sendEvent(new Ta({})),sa.debug(`Init with application id: ${this.bluxApplicationId}`);const n=Ra.getDeviceId();var r,i,s,a;n||sa.debug("No saved Device ID, register a new one."),this.registerHitTracker(),this.urlAndRef$.pipe(Va()).subscribe((()=>{this.impressedElements=[]})),this.registerImpressionTracker(),new MutationObserver((()=>{this.registerImpressionTracker()})).observe(document,{subtree:!0,childList:!0}),this.intersectionEntry$.pipe((r=e=>e.target,hn((function(e,t){var n;i&&"function"!=typeof i?(s=i.duration,n=i.element,a=i.connector):n=i;var o=new Map,c=function(e){o.forEach(e),e(t)},u=function(e){return c((function(t){return t.error(e)}))},d=0,l=!1,p=new mn(t,(function(e){try{var i=r(e),c=o.get(i);if(!c){o.set(i,c=a?a():new dn);var h=(m=i,g=c,(y=new on((function(e){d++;var t=g.subscribe(e);return function(){t.unsubscribe(),0==--d&&l&&p.unsubscribe()}}))).key=m,y);if(t.next(h),s){var f=fn(c,(function(){c.complete(),null==f||f.unsubscribe()}),void 0,void 0,(function(){return o.delete(i)}));p.add(Tn(s(h)).subscribe(f))}}c.next(n?n(e):e)}catch(e){u(e)}var m,g,y}),(function(){return c((function(e){return e.complete()}))}),u,(function(){return o.clear()}),(function(){return l=!0,0===d}));e.subscribe(p)}))),An((e=>{return e.pipe((void 0===t&&(t=qn),hn((function(e,n){var r=null,i=null,s=null,a=function(){if(r){r.unsubscribe(),r=null;var e=i;i=null,n.next(e)}};function o(){var e=s+500,i=t.now();if(i<e)return r=this.schedule(void 0,e-i),void n.add(r);a()}e.subscribe(fn(n,(function(e){i=e,s=t.now(),r||(r=t.schedule(o,500),n.add(r))}),(function(){a(),n.complete()}),void 0,(function(){i=r=null})))}))),Gn((e=>e.isIntersecting)));var t}))).subscribe((e=>{const t=e.target.getAttribute(da);t?this.impressedElements.includes(e.target)||(this.sendEvent(new Sa({section:t,tracking:{id:t,type:"impression"}})),this.impressedElements.push(e.target)):sa.warning(`Tracking ID is not found in the parent elements. Please check the tracking ID(${da}) is set correctly.`)}));const{data:o}=await(c=this.api,u={application_id:this.bluxApplicationId},d={session_id:t??void 0,device_id:n??void 0,country_code:navigator.language.split("-")[1],device_model:navigator.userAgent,language_code:navigator.language.split("-")[0],platform:Zs.browser,os_version:navigator.userAgent,sdk_version:this.sdkInfo.version,sdk_type:this.sdkInfo.type,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,blux_user_id:e??void 0,custom_device_id:this.customDeviceId},l=this.generateApiHeader({bluxAPIKey:this.bluxAPIKey}),c[Ys.method](Hs(Ys.path,u),d,{headers:l}));var c,u,d,l;o.device_id&&Ra.setDeviceId(o.device_id),this.bluxUser$.next({id:o.blux_user_id,bluxAPIKey:this.bluxAPIKey,applicationId:this.bluxApplicationId,deviceId:o.device_id})}setLogLevel(e){sa.setLevel(e)}async getBluxUserWithTimeout(){const e=await(t=this.bluxUser$.pipe(Va(),function(e){var t=sr(e)?{first:e}:{each:e},n=t.first,r=t.each,i=t.with,s=void 0===i?dr:i,a=t.scheduler,o=void 0===a?qn:a,c=t.meta,u=void 0===c?null:c;if(null==n&&null==r)throw new TypeError("No timeout provided.");return hn((function(e,t){var i,a,c=null,d=0,l=function(e){a=In(t,o,(function(){try{i.unsubscribe(),Tn(s({meta:u,lastValue:c,seen:d})).subscribe(t)}catch(e){t.error(e)}}),e)};i=e.subscribe(fn(t,(function(e){null==a||a.unsubscribe(),d++,t.next(c=e),r>0&&l(r)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),c=null}))),!d&&l(null!=n?"number"==typeof n?n:+n-o.now():r)}))}(5e3),lr((e=>{return n=Pt(t=()=>"TimeoutError"===e.name?new Error("Application ID is not initialized. Please initialize BluxClient."):e)?t:function(){return t},new on((function(e){return e.error(n())}));var t,n}))),new Promise((function(e,n){var r=new en({next:function(t){e(t),r.unsubscribe()},error:n,complete:function(){n(new ar)}});t.subscribe(r)})));var t;return e}async signIn({userId:e}){try{if(this.bridge)return void this.bridge.signIn({userId:e});const t=await this.getBluxUserWithTimeout(),{data:{blux_user_id:n}}=await this.enqueueRequest((()=>{return n=this.api,r={application_id:t.applicationId,blux_user_id:t.id},i={user_id:e,device_id:t.deviceId},s=this.generateApiHeader(t),n[Xs.method](Hs(Xs.path,r),i,{headers:s});var n,r,i,s}));n!==t.id&&(sa.debug("Blux id is changed in signIn."),this.bluxUser$.next({...t,id:n,userId:e}))}catch(e){sa.error(e,{tags:{from:"signIn"}})}}async signOut(){try{if(this.bridge)return void this.bridge.signOut();const e=await this.getBluxUserWithTimeout(),{data:{blux_user_id:t}}=await this.enqueueRequest((()=>{return t=this.api,n={application_id:e.applicationId,blux_user_id:e.id},r={device_id:e.deviceId},i=this.generateApiHeader(e),t[ea.method](Hs(ea.path,n),r,{headers:i});var t,n,r,i}));sa.debug("Blux id is changed in signOut."),this.bluxUser$.next({...e,id:t,userId:void 0})}catch(e){sa.error(e,{tags:{from:"signOut"}})}}async setUserProperties({userProperties:e}){try{if(this.bridge)return void this.bridge.setUserProperties(e);await new Promise(((t,n)=>{this.userPropertiesQueue$.next({userProperties:e,resolve:t,reject:n})}))}catch(e){sa.error(e,{tags:{from:"setUserProperties"}})}}async setCustomUserProperties({customUserProperties:e}){try{if(this.bridge)return void this.bridge.setCustomUserProperties(e);await new Promise(((t,n)=>{this.userPropertiesQueue$.next({customUserProperties:e,resolve:t,reject:n})}))}catch(e){sa.error(e,{tags:{from:"setCustomUserProperties"}})}}sendEvent(e){try{const t=(Array.isArray(e)?e:[e]).map((e=>({...e.request,internal_event_properties:{url:this.urlAndRef$.value?.url,ref:this.urlAndRef$.value?.ref}})));if(this.bridge)return void this.bridge.sendEvent({requests:t});t.forEach((e=>{this.eventQueue$.next(e)}))}catch(e){sa.error(e,{tags:{from:"sendEvent"}})}}dismissInApp(){this.currentInappCleanup?.()}addInAppCustomActionHandler(e){return this.inAppCustomActionHandlers.add(e),()=>{this.inAppCustomActionHandlers.delete(e)}}urlAndRef$=new pn(void 0);handleUrlAndRef(){this.urlAndRef$.pipe(Va()).subscribe((({url:e,ref:t})=>{t&&Ra.setRef(t),Ra.setUrl(e)})),this.urlAndRef$.next({url:window.location.href,ref:Ra.getUrl()??void 0});const e=()=>{const e=this.urlAndRef$.value?.url,t=window.location.href;e!==t&&this.urlAndRef$.next({url:t,ref:e??void 0})};window.addEventListener("popstate",e),history.pushState=new Proxy(history.pushState,{apply:(t,n,[r,i,s])=>{t.apply(n,[r,i,s]),e()}}),history.replaceState=new Proxy(history.replaceState,{apply:(t,n,[r,i,s])=>{t.apply(n,[r,i,s]),e()}})}registerImpressionTracker(){const e=Array.from(document.querySelectorAll(`[${da}]`));this.intersectionObservingElements.filter((t=>!e.includes(t))).forEach((e=>{this.intersectionObserver.unobserve(e)})),e.filter((e=>!this.intersectionObservingElements.includes(e))).forEach((e=>{this.intersectionObserver.observe(e)})),this.intersectionObservingElements=e}registerHitTracker(){document.addEventListener("click",(e=>{if(!(e.target instanceof Element))return;const t=e.target,n=t.closest(`[${la}]`);if(!n)return;const r=n.getAttribute(la);if(!r)return;const i=t.closest(`[${da}]`),s=i?.getAttribute(da);s?this.hitElements.includes(n)||(this.sendEvent(new Ea({itemId:r,tracking:{id:s,type:"hit"}})),this.hitElements.push(n)):sa.warning(`Tracking ID is not found in the parent elements. Please check the tracking ID(${da}) is set correctly.`)})),this.urlAndRef$.pipe(Va()).subscribe((()=>{this.hitElements=[]}))}async getUserRec(e){try{const t=await this.getBluxUserWithTimeout(),n=e.request;return(await Js(this.api,{application_id:t.applicationId,blux_user_id:t.id},{call_type:n.call_type,limit:n.limit,offset:n.offset},this.generateApiHeader(t))).data}catch(e){return sa.error(e,{tags:{from:"getItemRecommendations"}}),{item_ids:[],metadata:{},recommendation_id:null}}}async getItemRec(e){try{const t=await this.getBluxUserWithTimeout(),n=e.request;return(await Js(this.api,{application_id:t.applicationId,blux_user_id:t.id},{call_type:n.call_type,limit:n.limit,offset:n.offset,item_id:n.item_id},this.generateApiHeader(t))).data}catch(e){return sa.error(e,{tags:{from:"getItemRecommendations"}}),{item_ids:[],metadata:{},recommendation_id:null}}}async getItemsRec(e){try{const t=await this.getBluxUserWithTimeout(),n=e.request;return(await Js(this.api,{application_id:t.applicationId,blux_user_id:t.id},{call_type:n.call_type,limit:n.limit,offset:n.offset,item_ids:n.item_ids},this.generateApiHeader(t))).data}catch(e){return sa.error(e,{tags:{from:"getItemRecommendations"}}),{item_ids:[],metadata:{},recommendation_id:null}}}async getCategoryRec(e){try{const t=await this.getBluxUserWithTimeout(),n=e.request;return(await Js(this.api,{application_id:t.applicationId,blux_user_id:t.id},{call_type:n.call_type,limit:n.limit,offset:n.offset,category_id:n.category_id},this.generateApiHeader(t))).data}catch(e){return sa.error(e,{tags:{from:"getItemRecommendations"}}),{item_ids:[],metadata:{},recommendation_id:null}}}}({bluxApplicationId:"BLUX_APPLICATION_ID",bluxAPIKey:"BLUX_API_KEY"}),Ga=CAFE24API.init({client_id:"gRSxaEXKARIpFrRcpAEhJB",version:"2023-06-01"}),Ja="prev_section",Ya="recommendation_id";!async function(){try{const e=(await async function(){return await new Promise(((e,t)=>{Ga.getCustomerIDInfo(((n,r)=>{if(n)return t(n);e(r.id)}))}))}()).member_id;e&&await Wa.signIn({userId:e});const{pathname:t}=window.location,n=new URLSearchParams(window.location.search).get("cate_no")??t.split("/")[3],r=new URLSearchParams(window.location.search).get("product_no")??document.querySelector('meta[property="product:productId"]')?.getAttribute("content")??null,i=t.startsWith("/product")&&r,s=(t.startsWith("/product/list")||t.startsWith("/category"))&&n,a=t.startsWith("/order/orderform");i?(sessionStorage.getItem(Ya)&&sessionStorage.removeItem(Ya),(sessionStorage.getItem(Ja)??void 0)&&sessionStorage.removeItem(Ja),Wa.sendEvent(new xa({itemId:r}))):s?Wa.sendEvent(new wa({eventType:"category_page_visit",eventProperties:{},customEventProperties:{category_id:n}})):a&&Wa.sendEvent(new wa({eventType:"orderform_view",eventProperties:{}}))}catch(e){console.error("[BluxClient] Error during initialize and event handling.",e)}}()})()})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
const applicationId = "67fca864af8b28f2c86c1230";
|
|
3
|
+
const bluxApiKey = "OngWccknOnY5QfEclSMAqywlAXnxQ8lnrnRuPasS";
|
|
4
|
+
var bluxClient = (function () {
|
|
5
|
+
const api = axios.create({
|
|
6
|
+
baseURL: `https://api.blux.ai/prod/applications/${applicationId}`,
|
|
7
|
+
headers: {
|
|
8
|
+
Authorization: bluxApiKey,
|
|
9
|
+
"Content-Type": "application/json"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
function getCookies() {
|
|
13
|
+
const cookieString = document.cookie;
|
|
14
|
+
const cookies = Object.fromEntries(cookieString.split("; ").map((cookie) => cookie.split("=")));
|
|
15
|
+
return cookies;
|
|
16
|
+
}
|
|
17
|
+
// 로그인 상태에서 userId 반환, 비로그인 상태에서 undefined 반환
|
|
18
|
+
function getDaisoUserId(cookies) {
|
|
19
|
+
try {
|
|
20
|
+
const cookieValue = cookies["session_store"] ?? cookies["vuex"];
|
|
21
|
+
const decodedCookieValue = decodeURIComponent(cookieValue);
|
|
22
|
+
const cookieObject = JSON.parse(decodedCookieValue);
|
|
23
|
+
const userId = cookieObject.session?.loginInfo?.mbMngNo
|
|
24
|
+
? cookieObject.session?.loginInfo?.mbMngNo
|
|
25
|
+
: cookieObject.session?.member?.mbMngNo;
|
|
26
|
+
const ageGroup = cookieObject.session?.loginInfo?.ageGroup
|
|
27
|
+
? cookieObject.session?.loginInfo?.ageGroup
|
|
28
|
+
: cookieObject.session?.member?.ageGroup;
|
|
29
|
+
const gender = cookieObject.session?.loginInfo?.sexdSe
|
|
30
|
+
? cookieObject.session?.loginInfo?.sexdSe
|
|
31
|
+
: cookieObject.session?.member?.sexdSe;
|
|
32
|
+
return { userId, ageGroup, gender };
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
return { userId: undefined, ageGroup: undefined, gender: undefined };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function handleClick() {
|
|
39
|
+
localStorage.setItem("blux_click", "true");
|
|
40
|
+
}
|
|
41
|
+
async function handleMutation() {
|
|
42
|
+
const { userId, ageGroup, gender } = getDaisoUserId(getCookies());
|
|
43
|
+
const bluxTemp = `${localStorage.getItem("blux_temp")}`;
|
|
44
|
+
// 로그인
|
|
45
|
+
if (userId && `${localStorage.getItem("bluxLoginedUserId")}` !== userId) {
|
|
46
|
+
localStorage.setItem("bluxLoginedUserId", userId);
|
|
47
|
+
}
|
|
48
|
+
if (window.location.href !== bluxTemp) {
|
|
49
|
+
const isPDV = window.location.href.includes("pd/pdr/SCR_PDR_0001") ||
|
|
50
|
+
window.location.href.includes("pd/pdl/SCR_PDL_0001");
|
|
51
|
+
const isBack = window.location.href === localStorage.getItem("blux_referrer");
|
|
52
|
+
const isClicked = localStorage.getItem("blux_click") === "true";
|
|
53
|
+
this.isBack = isBack;
|
|
54
|
+
if (isPDV) {
|
|
55
|
+
if (isBack) {
|
|
56
|
+
localStorage.setItem("blux_temp", window.location.href);
|
|
57
|
+
localStorage.setItem("blux_click", "false");
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if (isClicked) {
|
|
61
|
+
localStorage.setItem("blux_referrer", bluxTemp);
|
|
62
|
+
localStorage.setItem("blux_temp", window.location.href);
|
|
63
|
+
localStorage.setItem("blux_click", "false");
|
|
64
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
65
|
+
const paramName = "pdNo";
|
|
66
|
+
const itemId = urlParams.get(paramName);
|
|
67
|
+
if (!itemId)
|
|
68
|
+
return;
|
|
69
|
+
api.post("/events/bulk", {
|
|
70
|
+
events: [
|
|
71
|
+
{
|
|
72
|
+
user_id: `${ageGroup}:${gender ?? "U"}`,
|
|
73
|
+
event_type: "product_detail_view",
|
|
74
|
+
event_properties: {
|
|
75
|
+
item_id: itemId
|
|
76
|
+
},
|
|
77
|
+
custom_event_properties: {
|
|
78
|
+
daiso_user_id: userId
|
|
79
|
+
},
|
|
80
|
+
captured_at: new Date().toISOString()
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
if (!isBack)
|
|
89
|
+
localStorage.setItem("blux_referrer", bluxTemp);
|
|
90
|
+
localStorage.setItem("blux_temp", window.location.href);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
init: async function () {
|
|
96
|
+
console.log("blux init success.");
|
|
97
|
+
// For obtaining referrer on Android Device
|
|
98
|
+
this.isBack = false;
|
|
99
|
+
document.addEventListener("click", handleClick.bind(this));
|
|
100
|
+
// Make MutationObserver to observe every mutation within document.body
|
|
101
|
+
const mutationObserver = new MutationObserver(handleMutation.bind(this));
|
|
102
|
+
const mutationObserverConfig = { subtree: true, childList: true };
|
|
103
|
+
mutationObserver.observe(document.body, mutationObserverConfig);
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
})();
|
|
107
|
+
try {
|
|
108
|
+
bluxClient.init();
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
console.log(e);
|
|
112
|
+
console.log("Failed to initialize BluxClient.");
|
|
113
|
+
}
|
|
114
|
+
console.log("Blux script load success.");
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Product = {
|
|
2
|
+
product_no: number;
|
|
3
|
+
detail_image: string;
|
|
4
|
+
product_name: string;
|
|
5
|
+
price: number;
|
|
6
|
+
discountprice: {
|
|
7
|
+
pc_discount_price: number;
|
|
8
|
+
mobile_discount_price: number;
|
|
9
|
+
};
|
|
10
|
+
category: {
|
|
11
|
+
category_no: number;
|
|
12
|
+
}[];
|
|
13
|
+
small_image: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const getMobileCategoryPageSlideTemplate: (productInfos: Product[], recommendationId: string) => HTMLDivElement;
|
|
16
|
+
export {};
|