@bool-ts/guard-sdk 1.1.0-beta.2 → 1.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var lK=Object.defineProperty;var m4=(c,K)=>{for(var w in K)lK(c,w,{get:K[w],enumerable:!0,configurable:!0,set:(P)=>K[w]=()=>P})};var Y2=function(c,K,w,P){var S=arguments.length,h=S<3?K:P===null?P=Object.getOwnPropertyDescriptor(K,w):P,W;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")h=Reflect.decorate(c,K,w,P);else for(var M=c.length-1;M>=0;M--)if(W=c[M])h=(S<3?W(h):S>3?W(K,w,h):W(K,w))||h;return S>3&&h&&Object.defineProperty(K,w,h),h},O2=(c,K)=>(w,P)=>K(w,P,c);var x2={};m4(x2,{ETokenAudiences:()=>_6});var _6;((K)=>K.SYSTEM="https://api-guard.booljs.com")(_6||={});var Yc={};m4(Yc,{service:()=>iK,guardMetadata:()=>TK,guardClient:()=>nK,authState:()=>pK});var pK=Symbol.for("__boolGuard::authState"),TK=Symbol.for("__boolGuard::guardMetadata"),iK=Symbol.for("__boolGuard::authService"),nK=Symbol.for("__boolGuard::guardClient");var tK=Object.create,{getPrototypeOf:dK,defineProperty:u4,getOwnPropertyNames:sK}=Object,aK=Object.prototype.hasOwnProperty,h4=(c,K,w)=>{w=c!=null?tK(dK(c)):{};let P=K||!c||!c.__esModule?u4(w,"default",{value:c,enumerable:!0}):w;for(let S of sK(c))if(!aK.call(P,S))u4(P,S,{get:()=>c[S],enumerable:!0});return P},_=(c,K)=>()=>(K||c((K={exports:{}}).exports,K),K.exports),c0=(c,K)=>{for(var w in K)u4(c,w,{get:K[w],enumerable:!0,configurable:!0,set:(P)=>K[w]=()=>P})},K0=import.meta.require,e4=_(()=>{/*! *****************************************************************************
2
+ var L1=Object.defineProperty;var m6=(K,w)=>{for(var W in w)L1(K,W,{get:w[W],enumerable:!0,configurable:!0,set:(S)=>w[W]=()=>S})};var h4=function(K,w,W,S){var M=arguments.length,b=M<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,W):S,P;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")b=Reflect.decorate(K,w,W,S);else for(var J=K.length-1;J>=0;J--)if(P=K[J])b=(M<3?P(b):M>3?P(w,W,b):P(w,W))||b;return M>3&&b&&Object.defineProperty(w,W,b),b},D4=(K,w)=>(W,S)=>w(W,S,K);var c4={};m6(c4,{ETokenAudiences:()=>a8});var a8;((w)=>w.SYSTEM="https://api-guard.booljs.com")(a8||={});var h2={};m6(h2,{service:()=>F1,guardMetadata:()=>h1,guardClient:()=>E1,authState:()=>q1});var q1=Symbol.for("__boolGuard::authState"),h1=Symbol.for("__boolGuard::guardMetadata"),F1=Symbol.for("__boolGuard::authService"),E1=Symbol.for("__boolGuard::guardClient");var v1=Object.create,{getPrototypeOf:R1,defineProperty:f6,getOwnPropertyNames:j1}=Object,k1=Object.prototype.hasOwnProperty,J6=(K,w,W)=>{W=K!=null?v1(R1(K)):{};let S=w||!K||!K.__esModule?f6(W,"default",{value:K,enumerable:!0}):W;for(let M of j1(K))if(!k1.call(S,M))f6(S,M,{get:()=>K[M],enumerable:!0});return S},m=(K,w)=>()=>(w||K((w={exports:{}}).exports,w),w.exports),g1=(K,w)=>{for(var W in w)f6(K,W,{get:w[W],enumerable:!0,configurable:!0,set:(S)=>w[W]=()=>S})},Z1=import.meta.require,e6=m(()=>{/*! *****************************************************************************
3
3
  Copyright (C) Microsoft. All rights reserved.
4
4
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5
5
  this file except in compliance with the License. You may obtain a copy of the
@@ -12,28 +12,30 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
12
12
 
13
13
  See the Apache Version 2.0 License for specific language governing permissions
14
14
  and limitations under the License.
15
- ***************************************************************************** */var c;(function(K){(function(w){var P=typeof globalThis==="object"?globalThis:typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:J(),S=h(K);if(typeof P.Reflect<"u")S=h(P.Reflect,S);if(w(S,P),typeof P.Reflect>"u")P.Reflect=K;function h(O,G){return function(V,z){if(Object.defineProperty(O,V,{configurable:!0,writable:!0,value:z}),G)G(V,z)}}function W(){try{return Function("return this;")()}catch(O){}}function M(){try{return(0,eval)("(function() { return this; })()")}catch(O){}}function J(){return W()||M()}})(function(w,P){var S=Object.prototype.hasOwnProperty,h=typeof Symbol==="function",W=h&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",M=h&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",J=typeof Object.create==="function",O={__proto__:[]}instanceof Array,G=!J&&!O,V={create:J?function(){return _c(Object.create(null))}:O?function(){return _c({__proto__:null})}:function(){return _c({})},has:G?function(X,U){return S.call(X,U)}:function(X,U){return U in X},get:G?function(X,U){return S.call(X,U)?X[U]:void 0}:function(X,U){return X[U]}},z=Object.getPrototypeOf(Function),L=typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:R4(),I=typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:p2(),$=typeof WeakMap==="function"?WeakMap:g4(),q=h?Symbol.for("@reflect-metadata:registry"):void 0,b=dc(),Y=sc(b);function B(X,U,v,Z){if(!y(v)){if(!s(X))throw TypeError();if(!d(U))throw TypeError();if(!d(Z)&&!y(Z)&&!$c(Z))throw TypeError();if($c(Z))Z=void 0;return v=p(v),a(X,U,v,Z)}else{if(!s(X))throw TypeError();if(!hc(U))throw TypeError();return C(X,U)}}w("decorate",B);function D(X,U){function v(Z,m){if(!d(Z))throw TypeError();if(!y(m)&&!Jc(m))throw TypeError();vc(X,U,Z,m)}return v}w("metadata",D);function H(X,U,v,Z){if(!d(v))throw TypeError();if(!y(Z))Z=p(Z);return vc(X,U,v,Z)}w("defineMetadata",H);function o(X,U,v){if(!d(U))throw TypeError();if(!y(v))v=p(v);return bc(X,U,v)}w("hasMetadata",o);function Q(X,U,v){if(!d(U))throw TypeError();if(!y(v))v=p(v);return wc(X,U,v)}w("hasOwnMetadata",Q);function r(X,U,v){if(!d(U))throw TypeError();if(!y(v))v=p(v);return Nc(X,U,v)}w("getMetadata",r);function g(X,U,v){if(!d(U))throw TypeError();if(!y(v))v=p(v);return qc(X,U,v)}w("getOwnMetadata",g);function A(X,U){if(!d(X))throw TypeError();if(!y(U))U=p(U);return l(X,U)}w("getMetadataKeys",A);function u(X,U){if(!d(X))throw TypeError();if(!y(U))U=p(U);return Gc(X,U)}w("getOwnMetadataKeys",u);function i(X,U,v){if(!d(U))throw TypeError();if(!y(v))v=p(v);if(!d(U))throw TypeError();if(!y(v))v=p(v);var Z=I2(U,v,!1);if(y(Z))return!1;return Z.OrdinaryDeleteMetadata(X,U,v)}w("deleteMetadata",i);function C(X,U){for(var v=X.length-1;v>=0;--v){var Z=X[v],m=Z(U);if(!y(m)&&!$c(m)){if(!hc(m))throw TypeError();U=m}}return U}function a(X,U,v,Z){for(var m=X.length-1;m>=0;--m){var Pc=X[m],j=Pc(U,v,Z);if(!y(j)&&!$c(j)){if(!d(j))throw TypeError();Z=j}}return Z}function bc(X,U,v){var Z=wc(X,U,v);if(Z)return!0;var m=zc(U);if(!$c(m))return bc(X,m,v);return!1}function wc(X,U,v){var Z=I2(U,v,!1);if(y(Z))return!1;return Rc(Z.OrdinaryHasOwnMetadata(X,U,v))}function Nc(X,U,v){var Z=wc(X,U,v);if(Z)return qc(X,U,v);var m=zc(U);if(!$c(m))return Nc(X,m,v);return}function qc(X,U,v){var Z=I2(U,v,!1);if(y(Z))return;return Z.OrdinaryGetOwnMetadata(X,U,v)}function vc(X,U,v,Z){var m=I2(v,Z,!0);m.OrdinaryDefineOwnMetadata(X,U,v,Z)}function l(X,U){var v=Gc(X,U),Z=zc(X);if(Z===null)return v;var m=l(Z,U);if(m.length<=0)return v;if(v.length<=0)return m;var Pc=new I,j=[];for(var N=0,E=v;N<E.length;N++){var k=E[N],x=Pc.has(k);if(!x)Pc.add(k),j.push(k)}for(var R=0,f=m;R<f.length;R++){var k=f[R],x=Pc.has(k);if(!x)Pc.add(k),j.push(k)}return j}function Gc(X,U){var v=I2(X,U,!1);if(!v)return[];return v.OrdinaryOwnMetadataKeys(X,U)}function Fc(X){if(X===null)return 1;switch(typeof X){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return X===null?1:6;default:return 6}}function y(X){return X===void 0}function $c(X){return X===null}function Zc(X){return typeof X==="symbol"}function d(X){return typeof X==="object"?X!==null:typeof X==="function"}function Ec(X,U){switch(Fc(X)){case 0:return X;case 1:return X;case 2:return X;case 3:return X;case 4:return X;case 5:return X}var v=U===3?"string":U===5?"number":"default",Z=Mc(X,W);if(Z!==void 0){var m=Z.call(X,v);if(d(m))throw TypeError();return m}return Uc(X,v==="default"?"number":v)}function Uc(X,U){if(U==="string"){var v=X.toString;if(T(v)){var Z=v.call(X);if(!d(Z))return Z}var m=X.valueOf;if(T(m)){var Z=m.call(X);if(!d(Z))return Z}}else{var m=X.valueOf;if(T(m)){var Z=m.call(X);if(!d(Z))return Z}var Pc=X.toString;if(T(Pc)){var Z=Pc.call(X);if(!d(Z))return Z}}throw TypeError()}function Rc(X){return!!X}function Ac(X){return""+X}function p(X){var U=Ec(X,3);if(Zc(U))return U;return Ac(U)}function s(X){return Array.isArray?Array.isArray(X):X instanceof Object?X instanceof Array:Object.prototype.toString.call(X)==="[object Array]"}function T(X){return typeof X==="function"}function hc(X){return typeof X==="function"}function Jc(X){switch(Fc(X)){case 3:return!0;case 4:return!0;default:return!1}}function jc(X,U){return X===U||X!==X&&U!==U}function Mc(X,U){var v=X[U];if(v===void 0||v===null)return;if(!T(v))throw TypeError();return v}function yc(X){var U=Mc(X,M);if(!T(U))throw TypeError();var v=U.call(X);if(!d(v))throw TypeError();return v}function Xc(X){return X.value}function Bc(X){var U=X.next();return U.done?!1:U}function rc(X){var U=X.return;if(U)U.call(X)}function zc(X){var U=Object.getPrototypeOf(X);if(typeof X!=="function"||X===z)return U;if(U!==z)return U;var v=X.prototype,Z=v&&Object.getPrototypeOf(v);if(Z==null||Z===Object.prototype)return U;var m=Z.constructor;if(typeof m!=="function")return U;if(m===X)return U;return m}function tc(){var X;if(!y(q)&&typeof P.Reflect<"u"&&!(q in P.Reflect)&&typeof P.Reflect.defineMetadata==="function")X=E4(P.Reflect);var U,v,Z,m=new $,Pc={registerProvider:j,getProvider:E,setProvider:x};return Pc;function j(R){if(!Object.isExtensible(Pc))throw Error("Cannot add provider to a frozen registry.");switch(!0){case X===R:break;case y(U):U=R;break;case U===R:break;case y(v):v=R;break;case v===R:break;default:if(Z===void 0)Z=new I;Z.add(R);break}}function N(R,f){if(!y(U)){if(U.isProviderFor(R,f))return U;if(!y(v)){if(v.isProviderFor(R,f))return U;if(!y(Z)){var t=yc(Z);while(!0){var n=Bc(t);if(!n)return;var Ic=Xc(n);if(Ic.isProviderFor(R,f))return rc(t),Ic}}}}if(!y(X)&&X.isProviderFor(R,f))return X;return}function E(R,f){var t=m.get(R),n;if(!y(t))n=t.get(f);if(!y(n))return n;if(n=N(R,f),!y(n)){if(y(t))t=new L,m.set(R,t);t.set(f,n)}return n}function k(R){if(y(R))throw TypeError();return U===R||v===R||!y(Z)&&Z.has(R)}function x(R,f,t){if(!k(t))throw Error("Metadata provider not registered.");var n=E(R,f);if(n!==t){if(!y(n))return!1;var Ic=m.get(R);if(y(Ic))Ic=new L,m.set(R,Ic);Ic.set(f,t)}return!0}}function dc(){var X;if(!y(q)&&d(P.Reflect)&&Object.isExtensible(P.Reflect))X=P.Reflect[q];if(y(X))X=tc();if(!y(q)&&d(P.Reflect)&&Object.isExtensible(P.Reflect))Object.defineProperty(P.Reflect,q,{enumerable:!1,configurable:!1,writable:!1,value:X});return X}function sc(X){var U=new $,v={isProviderFor:function(k,x){var R=U.get(k);if(y(R))return!1;return R.has(x)},OrdinaryDefineOwnMetadata:j,OrdinaryHasOwnMetadata:m,OrdinaryGetOwnMetadata:Pc,OrdinaryOwnMetadataKeys:N,OrdinaryDeleteMetadata:E};return b.registerProvider(v),v;function Z(k,x,R){var f=U.get(k),t=!1;if(y(f)){if(!R)return;f=new L,U.set(k,f),t=!0}var n=f.get(x);if(y(n)){if(!R)return;if(n=new L,f.set(x,n),!X.setProvider(k,x,v)){if(f.delete(x),t)U.delete(k);throw Error("Wrong provider for target.")}}return n}function m(k,x,R){var f=Z(x,R,!1);if(y(f))return!1;return Rc(f.has(k))}function Pc(k,x,R){var f=Z(x,R,!1);if(y(f))return;return f.get(k)}function j(k,x,R,f){var t=Z(R,f,!0);t.set(k,x)}function N(k,x){var R=[],f=Z(k,x,!1);if(y(f))return R;var t=f.keys(),n=yc(t),Ic=0;while(!0){var Q2=Bc(n);if(!Q2)return R.length=Ic,R;var ac=Xc(Q2);try{R[Ic]=ac}catch(Hc){try{rc(n)}finally{throw Hc}}Ic++}}function E(k,x,R){var f=Z(x,R,!1);if(y(f))return!1;if(!f.delete(k))return!1;if(f.size===0){var t=U.get(x);if(!y(t)){if(t.delete(R),t.size===0)U.delete(t)}}return!0}}function E4(X){var{defineMetadata:U,hasOwnMetadata:v,getOwnMetadata:Z,getOwnMetadataKeys:m,deleteMetadata:Pc}=X,j=new $,N={isProviderFor:function(E,k){var x=j.get(E);if(!y(x)&&x.has(k))return!0;if(m(E,k).length){if(y(x))x=new I,j.set(E,x);return x.add(k),!0}return!1},OrdinaryDefineOwnMetadata:U,OrdinaryHasOwnMetadata:v,OrdinaryGetOwnMetadata:Z,OrdinaryOwnMetadataKeys:m,OrdinaryDeleteMetadata:Pc};return N}function I2(X,U,v){var Z=b.getProvider(X,U);if(!y(Z))return Z;if(v){if(b.setProvider(X,U,Y))return Y;throw Error("Illegal state.")}return}function R4(){var X={},U=[],v=function(){function N(E,k,x){this._index=0,this._keys=E,this._values=k,this._selector=x}return N.prototype["@@iterator"]=function(){return this},N.prototype[M]=function(){return this},N.prototype.next=function(){var E=this._index;if(E>=0&&E<this._keys.length){var k=this._selector(this._keys[E],this._values[E]);if(E+1>=this._keys.length)this._index=-1,this._keys=U,this._values=U;else this._index++;return{value:k,done:!1}}return{value:void 0,done:!0}},N.prototype.throw=function(E){if(this._index>=0)this._index=-1,this._keys=U,this._values=U;throw E},N.prototype.return=function(E){if(this._index>=0)this._index=-1,this._keys=U,this._values=U;return{value:E,done:!0}},N}(),Z=function(){function N(){this._keys=[],this._values=[],this._cacheKey=X,this._cacheIndex=-2}return Object.defineProperty(N.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),N.prototype.has=function(E){return this._find(E,!1)>=0},N.prototype.get=function(E){var k=this._find(E,!1);return k>=0?this._values[k]:void 0},N.prototype.set=function(E,k){var x=this._find(E,!0);return this._values[x]=k,this},N.prototype.delete=function(E){var k=this._find(E,!1);if(k>=0){var x=this._keys.length;for(var R=k+1;R<x;R++)this._keys[R-1]=this._keys[R],this._values[R-1]=this._values[R];if(this._keys.length--,this._values.length--,jc(E,this._cacheKey))this._cacheKey=X,this._cacheIndex=-2;return!0}return!1},N.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=X,this._cacheIndex=-2},N.prototype.keys=function(){return new v(this._keys,this._values,m)},N.prototype.values=function(){return new v(this._keys,this._values,Pc)},N.prototype.entries=function(){return new v(this._keys,this._values,j)},N.prototype["@@iterator"]=function(){return this.entries()},N.prototype[M]=function(){return this.entries()},N.prototype._find=function(E,k){if(!jc(this._cacheKey,E)){this._cacheIndex=-1;for(var x=0;x<this._keys.length;x++)if(jc(this._keys[x],E)){this._cacheIndex=x;break}}if(this._cacheIndex<0&&k)this._cacheIndex=this._keys.length,this._keys.push(E),this._values.push(void 0);return this._cacheIndex},N}();return Z;function m(N,E){return N}function Pc(N,E){return E}function j(N,E){return[N,E]}}function p2(){var X=function(){function U(){this._map=new L}return Object.defineProperty(U.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),U.prototype.has=function(v){return this._map.has(v)},U.prototype.add=function(v){return this._map.set(v,v),this},U.prototype.delete=function(v){return this._map.delete(v)},U.prototype.clear=function(){this._map.clear()},U.prototype.keys=function(){return this._map.keys()},U.prototype.values=function(){return this._map.keys()},U.prototype.entries=function(){return this._map.entries()},U.prototype["@@iterator"]=function(){return this.keys()},U.prototype[M]=function(){return this.keys()},U}();return X}function g4(){var X=16,U=V.create(),v=Z();return function(){function E(){this._key=Z()}return E.prototype.has=function(k){var x=m(k,!1);return x!==void 0?V.has(x,this._key):!1},E.prototype.get=function(k){var x=m(k,!1);return x!==void 0?V.get(x,this._key):void 0},E.prototype.set=function(k,x){var R=m(k,!0);return R[this._key]=x,this},E.prototype.delete=function(k){var x=m(k,!1);return x!==void 0?delete x[this._key]:!1},E.prototype.clear=function(){this._key=Z()},E}();function Z(){var E;do E="@@WeakMap@@"+N();while(V.has(U,E));return U[E]=!0,E}function m(E,k){if(!S.call(E,v)){if(!k)return;Object.defineProperty(E,v,{value:V.create()})}return E[v]}function Pc(E,k){for(var x=0;x<k;++x)E[x]=Math.random()*255|0;return E}function j(E){if(typeof Uint8Array==="function"){var k=new Uint8Array(E);if(typeof crypto<"u")crypto.getRandomValues(k);else if(typeof msCrypto<"u")msCrypto.getRandomValues(k);else Pc(k,E);return k}return Pc(Array(E),E)}function N(){var E=j(X);E[6]=E[6]&79|64,E[8]=E[8]&191|128;var k="";for(var x=0;x<X;++x){var R=E[x];if(x===4||x===6||x===8)k+="-";if(R<16)k+="0";k+=R.toString(16).toLowerCase()}return k}}function _c(X){return X.__=void 0,delete X.__,X}})})(c||(c={}))}),H2=_((c,K)=>{K.exports=TypeError}),w0=_((c,K)=>{K.exports=K0("util").inspect}),W4=_((c,K)=>{var w=typeof Map==="function"&&Map.prototype,P=Object.getOwnPropertyDescriptor&&w?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,S=w&&P&&typeof P.get==="function"?P.get:null,h=w&&Map.prototype.forEach,W=typeof Set==="function"&&Set.prototype,M=Object.getOwnPropertyDescriptor&&W?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,J=W&&M&&typeof M.get==="function"?M.get:null,O=W&&Set.prototype.forEach,G=typeof WeakMap==="function"&&WeakMap.prototype,V=G?WeakMap.prototype.has:null,z=typeof WeakSet==="function"&&WeakSet.prototype,L=z?WeakSet.prototype.has:null,I=typeof WeakRef==="function"&&WeakRef.prototype,$=I?WeakRef.prototype.deref:null,q=Boolean.prototype.valueOf,b=Object.prototype.toString,Y=Function.prototype.toString,B=String.prototype.match,D=String.prototype.slice,H=String.prototype.replace,o=String.prototype.toUpperCase,Q=String.prototype.toLowerCase,r=RegExp.prototype.test,g=Array.prototype.concat,A=Array.prototype.join,u=Array.prototype.slice,i=Math.floor,C=typeof BigInt==="function"?BigInt.prototype.valueOf:null,a=Object.getOwnPropertySymbols,bc=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null,wc=typeof Symbol==="function"&&typeof Symbol.iterator==="object",Nc=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===wc?"object":"symbol")?Symbol.toStringTag:null,qc=Object.prototype.propertyIsEnumerable,vc=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(j){return j.__proto__}:null);function l(j,N){if(j===1/0||j===-1/0||j!==j||j&&j>-1000&&j<1000||r.call(/e/,N))return N;var E=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof j==="number"){var k=j<0?-i(-j):i(j);if(k!==j){var x=String(k),R=D.call(N,x.length+1);return H.call(x,E,"$&_")+"."+H.call(H.call(R,/([0-9]{3})/g,"$&_"),/_$/,"")}}return H.call(N,E,"$&_")}var Gc=w0(),Fc=Gc.custom,y=jc(Fc)?Fc:null,$c={__proto__:null,double:'"',single:"'"},Zc={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};K.exports=function j(N,E,k,x){var R=E||{};if(Xc(R,"quoteStyle")&&!Xc($c,R.quoteStyle))throw TypeError('option "quoteStyle" must be "single" or "double"');if(Xc(R,"maxStringLength")&&(typeof R.maxStringLength==="number"?R.maxStringLength<0&&R.maxStringLength!==1/0:R.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=Xc(R,"customInspect")?R.customInspect:!0;if(typeof f!=="boolean"&&f!=="symbol")throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Xc(R,"indent")&&R.indent!==null&&R.indent!=="\t"&&!(parseInt(R.indent,10)===R.indent&&R.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Xc(R,"numericSeparator")&&typeof R.numericSeparator!=="boolean")throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var t=R.numericSeparator;if(typeof N>"u")return"undefined";if(N===null)return"null";if(typeof N==="boolean")return N?"true":"false";if(typeof N==="string")return p2(N,R);if(typeof N==="number"){if(N===0)return 1/0/N>0?"0":"-0";var n=String(N);return t?l(N,n):n}if(typeof N==="bigint"){var Ic=String(N)+"n";return t?l(N,Ic):Ic}var Q2=typeof R.depth>"u"?5:R.depth;if(typeof k>"u")k=0;if(k>=Q2&&Q2>0&&typeof N==="object")return Rc(N)?"[Array]":"[Object]";var ac=Z(R,k);if(typeof x>"u")x=[];else if(zc(x,N)>=0)return"[Circular]";function Hc(U2,i2,eK){if(i2)x=u.call(x),x.push(i2);if(eK){var y6={depth:R.depth};if(Xc(R,"quoteStyle"))y6.quoteStyle=R.quoteStyle;return j(U2,y6,k+1,x)}return j(U2,R,k+1,x)}if(typeof N==="function"&&!p(N)){var Z6=rc(N),A6=Pc(N,Hc);return"[Function"+(Z6?": "+Z6:" (anonymous)")+"]"+(A6.length>0?" { "+A.call(A6,", ")+" }":"")}if(jc(N)){var r6=wc?H.call(String(N),/^(Symbol\(.*\))_[^)]*$/,"$1"):bc.call(N);return typeof N==="object"&&!wc?_c(r6):r6}if(R4(N)){var k2="<"+Q.call(String(N.nodeName)),k4=N.attributes||[];for(var T2=0;T2<k4.length;T2++)k2+=" "+k4[T2].name+"="+d(Ec(k4[T2].value),"double",R);if(k2+=">",N.childNodes&&N.childNodes.length)k2+="...";return k2+="</"+Q.call(String(N.nodeName))+">",k2}if(Rc(N)){if(N.length===0)return"[]";var x4=Pc(N,Hc);if(ac&&!v(x4))return"["+m(x4,ac)+"]";return"[ "+A.call(x4,", ")+" ]"}if(s(N)){var Z4=Pc(N,Hc);if(!("cause"in Error.prototype)&&"cause"in N&&!qc.call(N,"cause"))return"{ ["+String(N)+"] "+A.call(g.call("[cause]: "+Hc(N.cause),Z4),", ")+" }";if(Z4.length===0)return"["+String(N)+"]";return"{ ["+String(N)+"] "+A.call(Z4,", ")+" }"}if(typeof N==="object"&&f){if(y&&typeof N[y]==="function"&&Gc)return Gc(N,{depth:Q2-k});else if(f!=="symbol"&&typeof N.inspect==="function")return N.inspect()}if(tc(N)){var o6=[];if(h)h.call(N,function(U2,i2){o6.push(Hc(i2,N,!0)+" => "+Hc(U2,N))});return U("Map",S.call(N),o6,ac)}if(E4(N)){var m6=[];if(O)O.call(N,function(U2){m6.push(Hc(U2,N))});return U("Set",J.call(N),m6,ac)}if(dc(N))return X("WeakMap");if(I2(N))return X("WeakSet");if(sc(N))return X("WeakRef");if(hc(N))return _c(Hc(Number(N)));if(Mc(N))return _c(Hc(C.call(N)));if(Jc(N))return _c(q.call(N));if(T(N))return _c(Hc(String(N)));if(typeof window<"u"&&N===window)return"{ [object Window] }";if(typeof globalThis<"u"&&N===globalThis||typeof global<"u"&&N===global)return"{ [object globalThis] }";if(!Ac(N)&&!p(N)){var A4=Pc(N,Hc),u6=vc?vc(N)===Object.prototype:N instanceof Object||N.constructor===Object,r4=N instanceof Object?"":"null prototype",C6=!u6&&Nc&&Object(N)===N&&Nc in N?D.call(Bc(N),8,-1):r4?"Object":"",fK=u6||typeof N.constructor!=="function"?"":N.constructor.name?N.constructor.name+" ":"",o4=fK+(C6||r4?"["+A.call(g.call([],C6||[],r4||[]),": ")+"] ":"");if(A4.length===0)return o4+"{}";if(ac)return o4+"{"+m(A4,ac)+"}";return o4+"{ "+A.call(A4,", ")+" }"}return String(N)};function d(j,N,E){var k=E.quoteStyle||N,x=$c[k];return x+j+x}function Ec(j){return H.call(String(j),/"/g,"&quot;")}function Uc(j){return!Nc||!(typeof j==="object"&&((Nc in j)||typeof j[Nc]<"u"))}function Rc(j){return Bc(j)==="[object Array]"&&Uc(j)}function Ac(j){return Bc(j)==="[object Date]"&&Uc(j)}function p(j){return Bc(j)==="[object RegExp]"&&Uc(j)}function s(j){return Bc(j)==="[object Error]"&&Uc(j)}function T(j){return Bc(j)==="[object String]"&&Uc(j)}function hc(j){return Bc(j)==="[object Number]"&&Uc(j)}function Jc(j){return Bc(j)==="[object Boolean]"&&Uc(j)}function jc(j){if(wc)return j&&typeof j==="object"&&j instanceof Symbol;if(typeof j==="symbol")return!0;if(!j||typeof j!=="object"||!bc)return!1;try{return bc.call(j),!0}catch(N){}return!1}function Mc(j){if(!j||typeof j!=="object"||!C)return!1;try{return C.call(j),!0}catch(N){}return!1}var yc=Object.prototype.hasOwnProperty||function(j){return j in this};function Xc(j,N){return yc.call(j,N)}function Bc(j){return b.call(j)}function rc(j){if(j.name)return j.name;var N=B.call(Y.call(j),/^function\s*([\w$]+)/);if(N)return N[1];return null}function zc(j,N){if(j.indexOf)return j.indexOf(N);for(var E=0,k=j.length;E<k;E++)if(j[E]===N)return E;return-1}function tc(j){if(!S||!j||typeof j!=="object")return!1;try{S.call(j);try{J.call(j)}catch(N){return!0}return j instanceof Map}catch(N){}return!1}function dc(j){if(!V||!j||typeof j!=="object")return!1;try{V.call(j,V);try{L.call(j,L)}catch(N){return!0}return j instanceof WeakMap}catch(N){}return!1}function sc(j){if(!$||!j||typeof j!=="object")return!1;try{return $.call(j),!0}catch(N){}return!1}function E4(j){if(!J||!j||typeof j!=="object")return!1;try{J.call(j);try{S.call(j)}catch(N){return!0}return j instanceof Set}catch(N){}return!1}function I2(j){if(!L||!j||typeof j!=="object")return!1;try{L.call(j,L);try{V.call(j,V)}catch(N){return!0}return j instanceof WeakSet}catch(N){}return!1}function R4(j){if(!j||typeof j!=="object")return!1;if(typeof HTMLElement<"u"&&j instanceof HTMLElement)return!0;return typeof j.nodeName==="string"&&typeof j.getAttribute==="function"}function p2(j,N){if(j.length>N.maxStringLength){var E=j.length-N.maxStringLength,k="... "+E+" more character"+(E>1?"s":"");return p2(D.call(j,0,N.maxStringLength),N)+k}var x=Zc[N.quoteStyle||"single"];x.lastIndex=0;var R=H.call(H.call(j,x,"\\$1"),/[\x00-\x1f]/g,g4);return d(R,"single",N)}function g4(j){var N=j.charCodeAt(0),E={8:"b",9:"t",10:"n",12:"f",13:"r"}[N];if(E)return"\\"+E;return"\\x"+(N<16?"0":"")+o.call(N.toString(16))}function _c(j){return"Object("+j+")"}function X(j){return j+" { ? }"}function U(j,N,E,k){var x=k?m(E,k):A.call(E,", ");return j+" ("+N+") {"+x+"}"}function v(j){for(var N=0;N<j.length;N++)if(zc(j[N],`
16
- `)>=0)return!1;return!0}function Z(j,N){var E;if(j.indent==="\t")E="\t";else if(typeof j.indent==="number"&&j.indent>0)E=A.call(Array(j.indent+1)," ");else return null;return{base:E,prev:A.call(Array(N+1),E)}}function m(j,N){if(j.length===0)return"";var E=`
17
- `+N.prev+N.base;return E+A.call(j,","+E)+`
18
- `+N.prev}function Pc(j,N){var E=Rc(j),k=[];if(E){k.length=j.length;for(var x=0;x<j.length;x++)k[x]=Xc(j,x)?N(j[x],j):""}var R=typeof a==="function"?a(j):[],f;if(wc){f={};for(var t=0;t<R.length;t++)f["$"+R[t]]=R[t]}for(var n in j){if(!Xc(j,n))continue;if(E&&String(Number(n))===n&&n<j.length)continue;if(wc&&f["$"+n]instanceof Symbol)continue;else if(r.call(/[^\w$]/,n))k.push(N(n,j)+": "+N(j[n],j));else k.push(n+": "+N(j[n],j))}if(typeof a==="function"){for(var Ic=0;Ic<R.length;Ic++)if(qc.call(j,R[Ic]))k.push("["+N(R[Ic])+"]: "+N(j[R[Ic]],j))}return k}}),P0=_((c,K)=>{var w=W4(),P=H2(),S=function(O,G,V){var z=O,L;for(;(L=z.next)!=null;z=L)if(L.key===G){if(z.next=L.next,!V)L.next=O.next,O.next=L;return L}},h=function(O,G){if(!O)return;var V=S(O,G);return V&&V.value},W=function(O,G,V){var z=S(O,G);if(z)z.value=V;else O.next={key:G,next:O.next,value:V}},M=function(O,G){if(!O)return!1;return!!S(O,G)},J=function(O,G){if(O)return S(O,G,!0)};K.exports=function(){var O,G={assert:function(V){if(!G.has(V))throw new P("Side channel does not contain "+w(V))},delete:function(V){var z=O&&O.next,L=J(O,V);if(L&&z&&z===L)O=void 0;return!!L},get:function(V){return h(O,V)},has:function(V){return M(O,V)},set:function(V,z){if(!O)O={next:void 0};W(O,V,z)}};return G}}),l6=_((c,K)=>{K.exports=Object}),S0=_((c,K)=>{K.exports=Error}),h0=_((c,K)=>{K.exports=EvalError}),W0=_((c,K)=>{K.exports=RangeError}),M0=_((c,K)=>{K.exports=ReferenceError}),b0=_((c,K)=>{K.exports=SyntaxError}),I0=_((c,K)=>{K.exports=URIError}),O0=_((c,K)=>{K.exports=Math.abs}),J0=_((c,K)=>{K.exports=Math.floor}),D0=_((c,K)=>{K.exports=Math.max}),N0=_((c,K)=>{K.exports=Math.min}),G0=_((c,K)=>{K.exports=Math.pow}),j0=_((c,K)=>{K.exports=Math.round}),X0=_((c,K)=>{K.exports=Number.isNaN||function(w){return w!==w}}),B0=_((c,K)=>{var w=X0();K.exports=function(P){if(w(P)||P===0)return P;return P<0?-1:1}}),z0=_((c,K)=>{K.exports=Object.getOwnPropertyDescriptor}),p6=_((c,K)=>{var w=z0();if(w)try{w([],"length")}catch(P){w=null}K.exports=w}),$0=_((c,K)=>{var w=Object.defineProperty||!1;if(w)try{w({},"a",{value:1})}catch(P){w=!1}K.exports=w}),Q0=_((c,K)=>{K.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var w={},P=Symbol("test"),S=Object(P);if(typeof P==="string")return!1;if(Object.prototype.toString.call(P)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(S)!=="[object Symbol]")return!1;var h=42;w[P]=h;for(var W in w)return!1;if(typeof Object.keys==="function"&&Object.keys(w).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(w).length!==0)return!1;var M=Object.getOwnPropertySymbols(w);if(M.length!==1||M[0]!==P)return!1;if(!Object.prototype.propertyIsEnumerable.call(w,P))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var J=Object.getOwnPropertyDescriptor(w,P);if(J.value!==h||J.enumerable!==!0)return!1}return!0}}),U0=_((c,K)=>{var w=typeof Symbol<"u"&&Symbol,P=Q0();K.exports=function(){if(typeof w!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof w("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return P()}}),T6=_((c,K)=>{K.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),i6=_((c,K)=>{var w=l6();K.exports=w.getPrototypeOf||null}),Y0=_((c,K)=>{var w="Function.prototype.bind called on incompatible ",P=Object.prototype.toString,S=Math.max,h="[object Function]",W=function(O,G){var V=[];for(var z=0;z<O.length;z+=1)V[z]=O[z];for(var L=0;L<G.length;L+=1)V[L+O.length]=G[L];return V},M=function(O,G){var V=[];for(var z=G||0,L=0;z<O.length;z+=1,L+=1)V[L]=O[z];return V},J=function(O,G){var V="";for(var z=0;z<O.length;z+=1)if(V+=O[z],z+1<O.length)V+=G;return V};K.exports=function(O){var G=this;if(typeof G!=="function"||P.apply(G)!==h)throw TypeError(w+G);var V=M(arguments,1),z,L=function(){if(this instanceof z){var Y=G.apply(this,W(V,arguments));if(Object(Y)===Y)return Y;return this}return G.apply(O,W(V,arguments))},I=S(0,G.length-V.length),$=[];for(var q=0;q<I;q++)$[q]="$"+q;if(z=Function("binder","return function ("+J($,",")+"){ return binder.apply(this,arguments); }")(L),G.prototype){var b=function(){};b.prototype=G.prototype,z.prototype=new b,b.prototype=null}return z}}),M4=_((c,K)=>{var w=Y0();K.exports=Function.prototype.bind||w}),l4=_((c,K)=>{K.exports=Function.prototype.call}),n6=_((c,K)=>{K.exports=Function.prototype.apply}),H0=_((c,K)=>{K.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),V0=_((c,K)=>{var w=M4(),P=n6(),S=l4(),h=H0();K.exports=h||w.call(S,P)}),t6=_((c,K)=>{var w=M4(),P=H2(),S=l4(),h=V0();K.exports=function(W){if(W.length<1||typeof W[0]!=="function")throw new P("a function is required");return h(w,S,W)}}),L0=_((c,K)=>{var w=t6(),P=p6(),S;try{S=[].__proto__===Array.prototype}catch(J){if(!J||typeof J!=="object"||!("code"in J)||J.code!=="ERR_PROTO_ACCESS")throw J}var h=!!S&&P&&P(Object.prototype,"__proto__"),W=Object,M=W.getPrototypeOf;K.exports=h&&typeof h.get==="function"?w([h.get]):typeof M==="function"?function(J){return M(J==null?J:W(J))}:!1}),q0=_((c,K)=>{var w=T6(),P=i6(),S=L0();K.exports=w?function(h){return w(h)}:P?function(h){if(!h||typeof h!=="object"&&typeof h!=="function")throw TypeError("getProto: not an object");return P(h)}:S?function(h){return S(h)}:null}),v0=_((c,K)=>{var w=Function.prototype.call,P=Object.prototype.hasOwnProperty,S=M4();K.exports=S.call(w,P)}),p4=_((c,K)=>{var w,P=l6(),S=S0(),h=h0(),W=W0(),M=M0(),J=b0(),O=H2(),G=I0(),V=O0(),z=J0(),L=D0(),I=N0(),$=G0(),q=j0(),b=B0(),Y=Function,B=function(p){try{return Y('"use strict"; return ('+p+").constructor;")()}catch(s){}},D=p6(),H=$0(),o=function(){throw new O},Q=D?function(){try{return arguments.callee,o}catch(p){try{return D(arguments,"callee").get}catch(s){return o}}}():o,r=U0()(),g=q0(),A=i6(),u=T6(),i=n6(),C=l4(),a={},bc=typeof Uint8Array>"u"||!g?w:g(Uint8Array),wc={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?w:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?w:ArrayBuffer,"%ArrayIteratorPrototype%":r&&g?g([][Symbol.iterator]()):w,"%AsyncFromSyncIteratorPrototype%":w,"%AsyncFunction%":a,"%AsyncGenerator%":a,"%AsyncGeneratorFunction%":a,"%AsyncIteratorPrototype%":a,"%Atomics%":typeof Atomics>"u"?w:Atomics,"%BigInt%":typeof BigInt>"u"?w:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?w:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?w:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?w:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S,"%eval%":eval,"%EvalError%":h,"%Float16Array%":typeof Float16Array>"u"?w:Float16Array,"%Float32Array%":typeof Float32Array>"u"?w:Float32Array,"%Float64Array%":typeof Float64Array>"u"?w:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?w:FinalizationRegistry,"%Function%":Y,"%GeneratorFunction%":a,"%Int8Array%":typeof Int8Array>"u"?w:Int8Array,"%Int16Array%":typeof Int16Array>"u"?w:Int16Array,"%Int32Array%":typeof Int32Array>"u"?w:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":r&&g?g(g([][Symbol.iterator]())):w,"%JSON%":typeof JSON==="object"?JSON:w,"%Map%":typeof Map>"u"?w:Map,"%MapIteratorPrototype%":typeof Map>"u"||!r||!g?w:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":P,"%Object.getOwnPropertyDescriptor%":D,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?w:Promise,"%Proxy%":typeof Proxy>"u"?w:Proxy,"%RangeError%":W,"%ReferenceError%":M,"%Reflect%":typeof Reflect>"u"?w:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?w:Set,"%SetIteratorPrototype%":typeof Set>"u"||!r||!g?w:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?w:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":r&&g?g(""[Symbol.iterator]()):w,"%Symbol%":r?Symbol:w,"%SyntaxError%":J,"%ThrowTypeError%":Q,"%TypedArray%":bc,"%TypeError%":O,"%Uint8Array%":typeof Uint8Array>"u"?w:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?w:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?w:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?w:Uint32Array,"%URIError%":G,"%WeakMap%":typeof WeakMap>"u"?w:WeakMap,"%WeakRef%":typeof WeakRef>"u"?w:WeakRef,"%WeakSet%":typeof WeakSet>"u"?w:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":i,"%Object.defineProperty%":H,"%Object.getPrototypeOf%":A,"%Math.abs%":V,"%Math.floor%":z,"%Math.max%":L,"%Math.min%":I,"%Math.pow%":$,"%Math.round%":q,"%Math.sign%":b,"%Reflect.getPrototypeOf%":u};if(g)try{null.error}catch(p){Nc=g(g(p)),wc["%Error.prototype%"]=Nc}var Nc,qc=function p(s){var T;if(s==="%AsyncFunction%")T=B("async function () {}");else if(s==="%GeneratorFunction%")T=B("function* () {}");else if(s==="%AsyncGeneratorFunction%")T=B("async function* () {}");else if(s==="%AsyncGenerator%"){var hc=p("%AsyncGeneratorFunction%");if(hc)T=hc.prototype}else if(s==="%AsyncIteratorPrototype%"){var Jc=p("%AsyncGenerator%");if(Jc&&g)T=g(Jc.prototype)}return wc[s]=T,T},vc={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},l=M4(),Gc=v0(),Fc=l.call(C,Array.prototype.concat),y=l.call(i,Array.prototype.splice),$c=l.call(C,String.prototype.replace),Zc=l.call(C,String.prototype.slice),d=l.call(C,RegExp.prototype.exec),Ec=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Uc=/\\(\\)?/g,Rc=function(p){var s=Zc(p,0,1),T=Zc(p,-1);if(s==="%"&&T!=="%")throw new J("invalid intrinsic syntax, expected closing `%`");else if(T==="%"&&s!=="%")throw new J("invalid intrinsic syntax, expected opening `%`");var hc=[];return $c(p,Ec,function(Jc,jc,Mc,yc){hc[hc.length]=Mc?$c(yc,Uc,"$1"):jc||Jc}),hc},Ac=function(p,s){var T=p,hc;if(Gc(vc,T))hc=vc[T],T="%"+hc[0]+"%";if(Gc(wc,T)){var Jc=wc[T];if(Jc===a)Jc=qc(T);if(typeof Jc>"u"&&!s)throw new O("intrinsic "+p+" exists, but is not available. Please file an issue!");return{alias:hc,name:T,value:Jc}}throw new J("intrinsic "+p+" does not exist!")};K.exports=function(p,s){if(typeof p!=="string"||p.length===0)throw new O("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof s!=="boolean")throw new O('"allowMissing" argument must be a boolean');if(d(/^%?[^%]*%?$/,p)===null)throw new J("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var T=Rc(p),hc=T.length>0?T[0]:"",Jc=Ac("%"+hc+"%",s),jc=Jc.name,Mc=Jc.value,yc=!1,Xc=Jc.alias;if(Xc)hc=Xc[0],y(T,Fc([0,1],Xc));for(var Bc=1,rc=!0;Bc<T.length;Bc+=1){var zc=T[Bc],tc=Zc(zc,0,1),dc=Zc(zc,-1);if((tc==='"'||tc==="'"||tc==="`"||(dc==='"'||dc==="'"||dc==="`"))&&tc!==dc)throw new J("property names with quotes must have matching quotes");if(zc==="constructor"||!rc)yc=!0;if(hc+="."+zc,jc="%"+hc+"%",Gc(wc,jc))Mc=wc[jc];else if(Mc!=null){if(!(zc in Mc)){if(!s)throw new O("base intrinsic for "+p+" exists, but the property is not available.");return}if(D&&Bc+1>=T.length){var sc=D(Mc,zc);if(rc=!!sc,rc&&"get"in sc&&!("originalValue"in sc.get))Mc=sc.get;else Mc=Mc[zc]}else rc=Gc(Mc,zc),Mc=Mc[zc];if(rc&&!yc)wc[jc]=Mc}}return Mc}}),d6=_((c,K)=>{var w=p4(),P=t6(),S=P([w("%String.prototype.indexOf%")]);K.exports=function(h,W){var M=w(h,!!W);if(typeof M==="function"&&S(h,".prototype.")>-1)return P([M]);return M}}),s6=_((c,K)=>{var w=p4(),P=d6(),S=W4(),h=H2(),W=w("%Map%",!0),M=P("Map.prototype.get",!0),J=P("Map.prototype.set",!0),O=P("Map.prototype.has",!0),G=P("Map.prototype.delete",!0),V=P("Map.prototype.size",!0);K.exports=!!W&&function(){var z,L={assert:function(I){if(!L.has(I))throw new h("Side channel does not contain "+S(I))},delete:function(I){if(z){var $=G(z,I);if(V(z)===0)z=void 0;return $}return!1},get:function(I){if(z)return M(z,I)},has:function(I){if(z)return O(z,I);return!1},set:function(I,$){if(!z)z=new W;J(z,I,$)}};return L}}),F0=_((c,K)=>{var w=p4(),P=d6(),S=W4(),h=s6(),W=H2(),M=w("%WeakMap%",!0),J=P("WeakMap.prototype.get",!0),O=P("WeakMap.prototype.set",!0),G=P("WeakMap.prototype.has",!0),V=P("WeakMap.prototype.delete",!0);K.exports=M?function(){var z,L,I={assert:function($){if(!I.has($))throw new W("Side channel does not contain "+S($))},delete:function($){if(M&&$&&(typeof $==="object"||typeof $==="function")){if(z)return V(z,$)}else if(h){if(L)return L.delete($)}return!1},get:function($){if(M&&$&&(typeof $==="object"||typeof $==="function")){if(z)return J(z,$)}return L&&L.get($)},has:function($){if(M&&$&&(typeof $==="object"||typeof $==="function")){if(z)return G(z,$)}return!!L&&L.has($)},set:function($,q){if(M&&$&&(typeof $==="object"||typeof $==="function")){if(!z)z=new M;O(z,$,q)}else if(h){if(!L)L=h();L.set($,q)}}};return I}:h}),E0=_((c,K)=>{var w=H2(),P=W4(),S=P0(),h=s6(),W=F0(),M=W||h||S;K.exports=function(){var J,O={assert:function(G){if(!O.has(G))throw new w("Side channel does not contain "+P(G))},delete:function(G){return!!J&&J.delete(G)},get:function(G){return J&&J.get(G)},has:function(G){return!!J&&J.has(G)},set:function(G,V){if(!J)J=M();J.set(G,V)}};return O}}),T4=_((c,K)=>{var w=String.prototype.replace,P=/%20/g,S={RFC1738:"RFC1738",RFC3986:"RFC3986"};K.exports={default:S.RFC3986,formatters:{RFC1738:function(h){return w.call(h,P,"+")},RFC3986:function(h){return String(h)}},RFC1738:S.RFC1738,RFC3986:S.RFC3986}}),a6=_((c,K)=>{var w=T4(),P=Object.prototype.hasOwnProperty,S=Array.isArray,h=function(){var Y=[];for(var B=0;B<256;++B)Y.push("%"+((B<16?"0":"")+B.toString(16)).toUpperCase());return Y}(),W=function(Y){while(Y.length>1){var B=Y.pop(),D=B.obj[B.prop];if(S(D)){var H=[];for(var o=0;o<D.length;++o)if(typeof D[o]<"u")H.push(D[o]);B.obj[B.prop]=H}}},M=function(Y,B){var D=B&&B.plainObjects?{__proto__:null}:{};for(var H=0;H<Y.length;++H)if(typeof Y[H]<"u")D[H]=Y[H];return D},J=function Y(B,D,H){if(!D)return B;if(typeof D!=="object"&&typeof D!=="function"){if(S(B))B.push(D);else if(B&&typeof B==="object"){if(H&&(H.plainObjects||H.allowPrototypes)||!P.call(Object.prototype,D))B[D]=!0}else return[B,D];return B}if(!B||typeof B!=="object")return[B].concat(D);var o=B;if(S(B)&&!S(D))o=M(B,H);if(S(B)&&S(D))return D.forEach(function(Q,r){if(P.call(B,r)){var g=B[r];if(g&&typeof g==="object"&&Q&&typeof Q==="object")B[r]=Y(g,Q,H);else B.push(Q)}else B[r]=Q}),B;return Object.keys(D).reduce(function(Q,r){var g=D[r];if(P.call(Q,r))Q[r]=Y(Q[r],g,H);else Q[r]=g;return Q},o)},O=function(Y,B){return Object.keys(B).reduce(function(D,H){return D[H]=B[H],D},Y)},G=function(Y,B,D){var H=Y.replace(/\+/g," ");if(D==="iso-8859-1")return H.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(H)}catch(o){return H}},V=1024,z=function(Y,B,D,H,o){if(Y.length===0)return Y;var Q=Y;if(typeof Y==="symbol")Q=Symbol.prototype.toString.call(Y);else if(typeof Y!=="string")Q=String(Y);if(D==="iso-8859-1")return escape(Q).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});var r="";for(var g=0;g<Q.length;g+=V){var A=Q.length>=V?Q.slice(g,g+V):Q,u=[];for(var i=0;i<A.length;++i){var C=A.charCodeAt(i);if(C===45||C===46||C===95||C===126||C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122||o===w.RFC1738&&(C===40||C===41)){u[u.length]=A.charAt(i);continue}if(C<128){u[u.length]=h[C];continue}if(C<2048){u[u.length]=h[192|C>>6]+h[128|C&63];continue}if(C<55296||C>=57344){u[u.length]=h[224|C>>12]+h[128|C>>6&63]+h[128|C&63];continue}i+=1,C=65536+((C&1023)<<10|A.charCodeAt(i)&1023),u[u.length]=h[240|C>>18]+h[128|C>>12&63]+h[128|C>>6&63]+h[128|C&63]}r+=u.join("")}return r},L=function(Y){var B=[{obj:{o:Y},prop:"o"}],D=[];for(var H=0;H<B.length;++H){var o=B[H],Q=o.obj[o.prop],r=Object.keys(Q);for(var g=0;g<r.length;++g){var A=r[g],u=Q[A];if(typeof u==="object"&&u!==null&&D.indexOf(u)===-1)B.push({obj:Q,prop:A}),D.push(u)}}return W(B),Y},I=function(Y){return Object.prototype.toString.call(Y)==="[object RegExp]"},$=function(Y){if(!Y||typeof Y!=="object")return!1;return!!(Y.constructor&&Y.constructor.isBuffer&&Y.constructor.isBuffer(Y))},q=function(Y,B){return[].concat(Y,B)},b=function(Y,B){if(S(Y)){var D=[];for(var H=0;H<Y.length;H+=1)D.push(B(Y[H]));return D}return B(Y)};K.exports={arrayToObject:M,assign:O,combine:q,compact:L,decode:G,encode:z,isBuffer:$,isRegExp:I,maybeMap:b,merge:J}}),R0=_((c,K)=>{var w=E0(),P=a6(),S=T4(),h=Object.prototype.hasOwnProperty,W={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,Y){return b+"["+Y+"]"},repeat:function(b){return b}},M=Array.isArray,J=Array.prototype.push,O=function(b,Y){J.apply(b,M(Y)?Y:[Y])},G=Date.prototype.toISOString,V=S.default,z={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:P.encode,encodeValuesOnly:!1,filter:void 0,format:V,formatter:S.formatters[V],indices:!1,serializeDate:function(b){return G.call(b)},skipNulls:!1,strictNullHandling:!1},L=function(b){return typeof b==="string"||typeof b==="number"||typeof b==="boolean"||typeof b==="symbol"||typeof b==="bigint"},I={},$=function b(Y,B,D,H,o,Q,r,g,A,u,i,C,a,bc,wc,Nc,qc,vc){var l=Y,Gc=vc,Fc=0,y=!1;while((Gc=Gc.get(I))!==void 0&&!y){var $c=Gc.get(Y);if(Fc+=1,typeof $c<"u")if($c===Fc)throw RangeError("Cyclic object value");else y=!0;if(typeof Gc.get(I)>"u")Fc=0}if(typeof u==="function")l=u(B,l);else if(l instanceof Date)l=a(l);else if(D==="comma"&&M(l))l=P.maybeMap(l,function(Mc){if(Mc instanceof Date)return a(Mc);return Mc});if(l===null){if(Q)return A&&!Nc?A(B,z.encoder,qc,"key",bc):B;l=""}if(L(l)||P.isBuffer(l)){if(A){var Zc=Nc?B:A(B,z.encoder,qc,"key",bc);return[wc(Zc)+"="+wc(A(l,z.encoder,qc,"value",bc))]}return[wc(B)+"="+wc(String(l))]}var d=[];if(typeof l>"u")return d;var Ec;if(D==="comma"&&M(l)){if(Nc&&A)l=P.maybeMap(l,A);Ec=[{value:l.length>0?l.join(",")||null:void 0}]}else if(M(u))Ec=u;else{var Uc=Object.keys(l);Ec=i?Uc.sort(i):Uc}var Rc=g?String(B).replace(/\./g,"%2E"):String(B),Ac=H&&M(l)&&l.length===1?Rc+"[]":Rc;if(o&&M(l)&&l.length===0)return Ac+"[]";for(var p=0;p<Ec.length;++p){var s=Ec[p],T=typeof s==="object"&&s&&typeof s.value<"u"?s.value:l[s];if(r&&T===null)continue;var hc=C&&g?String(s).replace(/\./g,"%2E"):String(s),Jc=M(l)?typeof D==="function"?D(Ac,hc):Ac:Ac+(C?"."+hc:"["+hc+"]");vc.set(Y,Fc);var jc=w();jc.set(I,vc),O(d,b(T,Jc,D,H,o,Q,r,g,D==="comma"&&Nc&&M(l)?null:A,u,i,C,a,bc,wc,Nc,qc,jc))}return d},q=function(b){if(!b)return z;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.encodeDotInKeys<"u"&&typeof b.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(b.encoder!==null&&typeof b.encoder<"u"&&typeof b.encoder!=="function")throw TypeError("Encoder has to be a function.");var Y=b.charset||z.charset;if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var B=S.default;if(typeof b.format<"u"){if(!h.call(S.formatters,b.format))throw TypeError("Unknown format option provided.");B=b.format}var D=S.formatters[B],H=z.filter;if(typeof b.filter==="function"||M(b.filter))H=b.filter;var o;if(b.arrayFormat in W)o=b.arrayFormat;else if("indices"in b)o=b.indices?"indices":"repeat";else o=z.arrayFormat;if("commaRoundTrip"in b&&typeof b.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");var Q=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:z.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix==="boolean"?b.addQueryPrefix:z.addQueryPrefix,allowDots:Q,allowEmptyArrays:typeof b.allowEmptyArrays==="boolean"?!!b.allowEmptyArrays:z.allowEmptyArrays,arrayFormat:o,charset:Y,charsetSentinel:typeof b.charsetSentinel==="boolean"?b.charsetSentinel:z.charsetSentinel,commaRoundTrip:!!b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?z.delimiter:b.delimiter,encode:typeof b.encode==="boolean"?b.encode:z.encode,encodeDotInKeys:typeof b.encodeDotInKeys==="boolean"?b.encodeDotInKeys:z.encodeDotInKeys,encoder:typeof b.encoder==="function"?b.encoder:z.encoder,encodeValuesOnly:typeof b.encodeValuesOnly==="boolean"?b.encodeValuesOnly:z.encodeValuesOnly,filter:H,format:B,formatter:D,serializeDate:typeof b.serializeDate==="function"?b.serializeDate:z.serializeDate,skipNulls:typeof b.skipNulls==="boolean"?b.skipNulls:z.skipNulls,sort:typeof b.sort==="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling==="boolean"?b.strictNullHandling:z.strictNullHandling}};K.exports=function(b,Y){var B=b,D=q(Y),H,o;if(typeof D.filter==="function")o=D.filter,B=o("",B);else if(M(D.filter))o=D.filter,H=o;var Q=[];if(typeof B!=="object"||B===null)return"";var r=W[D.arrayFormat],g=r==="comma"&&D.commaRoundTrip;if(!H)H=Object.keys(B);if(D.sort)H.sort(D.sort);var A=w();for(var u=0;u<H.length;++u){var i=H[u],C=B[i];if(D.skipNulls&&C===null)continue;O(Q,$(C,i,r,g,D.allowEmptyArrays,D.strictNullHandling,D.skipNulls,D.encodeDotInKeys,D.encode?D.encoder:null,D.filter,D.sort,D.allowDots,D.serializeDate,D.format,D.formatter,D.encodeValuesOnly,D.charset,A))}var a=Q.join(D.delimiter),bc=D.addQueryPrefix===!0?"?":"";if(D.charsetSentinel)if(D.charset==="iso-8859-1")bc+="utf8=%26%2310003%3B&";else bc+="utf8=%E2%9C%93&";return a.length>0?bc+a:""}}),g0=_((c,K)=>{var w=a6(),P=Object.prototype.hasOwnProperty,S=Array.isArray,h={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:w.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1000,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},W=function(I){return I.replace(/&#(\d+);/g,function($,q){return String.fromCharCode(parseInt(q,10))})},M=function(I,$,q){if(I&&typeof I==="string"&&$.comma&&I.indexOf(",")>-1)return I.split(",");if($.throwOnLimitExceeded&&q>=$.arrayLimit)throw RangeError("Array limit exceeded. Only "+$.arrayLimit+" element"+($.arrayLimit===1?"":"s")+" allowed in an array.");return I},J="utf8=%26%2310003%3B",O="utf8=%E2%9C%93",G=function(I,$){var q={__proto__:null},b=$.ignoreQueryPrefix?I.replace(/^\?/,""):I;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var Y=$.parameterLimit===1/0?void 0:$.parameterLimit,B=b.split($.delimiter,$.throwOnLimitExceeded?Y+1:Y);if($.throwOnLimitExceeded&&B.length>Y)throw RangeError("Parameter limit exceeded. Only "+Y+" parameter"+(Y===1?"":"s")+" allowed.");var D=-1,H,o=$.charset;if($.charsetSentinel){for(H=0;H<B.length;++H)if(B[H].indexOf("utf8=")===0){if(B[H]===O)o="utf-8";else if(B[H]===J)o="iso-8859-1";D=H,H=B.length}}for(H=0;H<B.length;++H){if(H===D)continue;var Q=B[H],r=Q.indexOf("]="),g=r===-1?Q.indexOf("="):r+1,A,u;if(g===-1)A=$.decoder(Q,h.decoder,o,"key"),u=$.strictNullHandling?null:"";else A=$.decoder(Q.slice(0,g),h.decoder,o,"key"),u=w.maybeMap(M(Q.slice(g+1),$,S(q[A])?q[A].length:0),function(C){return $.decoder(C,h.decoder,o,"value")});if(u&&$.interpretNumericEntities&&o==="iso-8859-1")u=W(String(u));if(Q.indexOf("[]=")>-1)u=S(u)?[u]:u;var i=P.call(q,A);if(i&&$.duplicates==="combine")q[A]=w.combine(q[A],u);else if(!i||$.duplicates==="last")q[A]=u}return q},V=function(I,$,q,b){var Y=0;if(I.length>0&&I[I.length-1]==="[]"){var B=I.slice(0,-1).join("");Y=Array.isArray($)&&$[B]?$[B].length:0}var D=b?$:M($,q,Y);for(var H=I.length-1;H>=0;--H){var o,Q=I[H];if(Q==="[]"&&q.parseArrays)o=q.allowEmptyArrays&&(D===""||q.strictNullHandling&&D===null)?[]:w.combine([],D);else{o=q.plainObjects?{__proto__:null}:{};var r=Q.charAt(0)==="["&&Q.charAt(Q.length-1)==="]"?Q.slice(1,-1):Q,g=q.decodeDotInKeys?r.replace(/%2E/g,"."):r,A=parseInt(g,10);if(!q.parseArrays&&g==="")o={0:D};else if(!isNaN(A)&&Q!==g&&String(A)===g&&A>=0&&(q.parseArrays&&A<=q.arrayLimit))o=[],o[A]=D;else if(g!=="__proto__")o[g]=D}D=o}return D},z=function(I,$,q,b){if(!I)return;var Y=q.allowDots?I.replace(/\.([^.[]+)/g,"[$1]"):I,B=/(\[[^[\]]*])/,D=/(\[[^[\]]*])/g,H=q.depth>0&&B.exec(Y),o=H?Y.slice(0,H.index):Y,Q=[];if(o){if(!q.plainObjects&&P.call(Object.prototype,o)){if(!q.allowPrototypes)return}Q.push(o)}var r=0;while(q.depth>0&&(H=D.exec(Y))!==null&&r<q.depth){if(r+=1,!q.plainObjects&&P.call(Object.prototype,H[1].slice(1,-1))){if(!q.allowPrototypes)return}Q.push(H[1])}if(H){if(q.strictDepth===!0)throw RangeError("Input depth exceeded depth option of "+q.depth+" and strictDepth is true");Q.push("["+Y.slice(H.index)+"]")}return V(Q,$,q,b)},L=function(I){if(!I)return h;if(typeof I.allowEmptyArrays<"u"&&typeof I.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof I.decodeDotInKeys<"u"&&typeof I.decodeDotInKeys!=="boolean")throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(I.decoder!==null&&typeof I.decoder<"u"&&typeof I.decoder!=="function")throw TypeError("Decoder has to be a function.");if(typeof I.charset<"u"&&I.charset!=="utf-8"&&I.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof I.throwOnLimitExceeded<"u"&&typeof I.throwOnLimitExceeded!=="boolean")throw TypeError("`throwOnLimitExceeded` option must be a boolean");var $=typeof I.charset>"u"?h.charset:I.charset,q=typeof I.duplicates>"u"?h.duplicates:I.duplicates;if(q!=="combine"&&q!=="first"&&q!=="last")throw TypeError("The duplicates option must be either combine, first, or last");var b=typeof I.allowDots>"u"?I.decodeDotInKeys===!0?!0:h.allowDots:!!I.allowDots;return{allowDots:b,allowEmptyArrays:typeof I.allowEmptyArrays==="boolean"?!!I.allowEmptyArrays:h.allowEmptyArrays,allowPrototypes:typeof I.allowPrototypes==="boolean"?I.allowPrototypes:h.allowPrototypes,allowSparse:typeof I.allowSparse==="boolean"?I.allowSparse:h.allowSparse,arrayLimit:typeof I.arrayLimit==="number"?I.arrayLimit:h.arrayLimit,charset:$,charsetSentinel:typeof I.charsetSentinel==="boolean"?I.charsetSentinel:h.charsetSentinel,comma:typeof I.comma==="boolean"?I.comma:h.comma,decodeDotInKeys:typeof I.decodeDotInKeys==="boolean"?I.decodeDotInKeys:h.decodeDotInKeys,decoder:typeof I.decoder==="function"?I.decoder:h.decoder,delimiter:typeof I.delimiter==="string"||w.isRegExp(I.delimiter)?I.delimiter:h.delimiter,depth:typeof I.depth==="number"||I.depth===!1?+I.depth:h.depth,duplicates:q,ignoreQueryPrefix:I.ignoreQueryPrefix===!0,interpretNumericEntities:typeof I.interpretNumericEntities==="boolean"?I.interpretNumericEntities:h.interpretNumericEntities,parameterLimit:typeof I.parameterLimit==="number"?I.parameterLimit:h.parameterLimit,parseArrays:I.parseArrays!==!1,plainObjects:typeof I.plainObjects==="boolean"?I.plainObjects:h.plainObjects,strictDepth:typeof I.strictDepth==="boolean"?!!I.strictDepth:h.strictDepth,strictNullHandling:typeof I.strictNullHandling==="boolean"?I.strictNullHandling:h.strictNullHandling,throwOnLimitExceeded:typeof I.throwOnLimitExceeded==="boolean"?I.throwOnLimitExceeded:!1}};K.exports=function(I,$){var q=L($);if(I===""||I===null||typeof I>"u")return q.plainObjects?{__proto__:null}:{};var b=typeof I==="string"?G(I,q):I,Y=q.plainObjects?{__proto__:null}:{},B=Object.keys(b);for(var D=0;D<B.length;++D){var H=B[D],o=z(H,b[H],q,typeof I==="string");Y=w.merge(Y,o,q)}if(q.allowSparse===!0)return Y;return w.compact(Y)}}),k0=_((c,K)=>{var w=R0(),P=g0(),S=T4();K.exports={formats:S,parse:P,stringify:w}}),p9=h4(e4(),1),x0={};c0(x0,{zodSchemaKey:()=>r0,webSocketServerArgsKey:()=>D2,webSocketMessageArgsKey:()=>t2,webSocketKey:()=>P4,webSocketEventKey:()=>o0,webSocketEventArgumentsKey:()=>Z0,webSocketConnectionArgsKey:()=>N2,webSocketCloseReasonArgsKey:()=>P8,webSocketCloseCodeArgsKey:()=>w8,routeModelArgsKey:()=>mc,responseStatusTextArgsKey:()=>h8,responseStatusArgsKey:()=>s2,responseHeadersArgsKey:()=>oc,responseBodyArgsKey:()=>d2,requestHeadersArgsKey:()=>K2,requestHeaderArgsKey:()=>ec,requestBodyArgsKey:()=>G2,requestArgsKey:()=>lc,queryArgsKey:()=>S8,paramsArgsKey:()=>y4,paramArgsKey:()=>j2,moduleKey:()=>n2,middlewareKey:()=>n4,interceptorKey:()=>i4,injectableKey:()=>K8,injectKey:()=>w4,httpServerArgsKey:()=>fc,guardKey:()=>c8,controllerKey:()=>K4,controllerHttpKey:()=>A0,contextArgsKey:()=>w2,containerKey:()=>J2,configKey:()=>C4,argumentsKey:()=>Qc});var Qc=Symbol.for("____boolTypescriptCore:arguments__"),Z0=Symbol.for("____boolTypescriptCore:webSocketEventArguments__"),C4=Symbol.for("____boolTypescriptCore:config__"),K4=Symbol.for("____boolTypescriptCore:controller__"),i4=Symbol.for("____boolTypescriptCore:interceptor__"),c8=Symbol.for("____boolTypescriptCore:guard__"),A0=Symbol.for("____boolTypescriptCore:controller.http__"),w4=Symbol.for("____boolTypescriptCore:inject__"),K8=Symbol.for("____boolTypescriptCore:injectable__"),n4=Symbol.for("____boolTypescriptCore:middleware__"),n2=Symbol.for("____boolTypescriptCore:module__"),J2=Symbol.for("____boolTypescriptCore:container__"),r0=Symbol.for("____boolTypescriptCore:zodSchema__"),P4=Symbol.for("____boolTypescriptCore:webSocket__"),o0=Symbol.for("____boolTypescriptCore:webSocket:event__"),D2=Symbol.for("____boolTypescriptCore:webSocketArguments:server__"),N2=Symbol.for("____boolTypescriptCore:webSocketArguments:connection__"),t2=Symbol.for("____boolTypescriptCore:webSocketArguments:message__"),w8=Symbol.for("____boolTypescriptCore:webSocketArguments:closeCode__"),P8=Symbol.for("____boolTypescriptCore:webSocketArguments:closeReason__"),fc=Symbol.for("____boolTypescriptCore:httpArguments:server__"),K2=Symbol.for("____boolTypescriptCore:httpArguments:requestHeaders__"),ec=Symbol.for("____boolTypescriptCore:httpArguments:requestHeader__"),G2=Symbol.for("____boolTypescriptCore:httpArguments:requestBody__"),y4=Symbol.for("____boolTypescriptCore:httpArguments:params__"),j2=Symbol.for("____boolTypescriptCore:httpArguments:param__"),S8=Symbol.for("____boolTypescriptCore:httpArguments:query__"),lc=Symbol.for("____boolTypescriptCore:httpArguments:request__"),oc=Symbol.for("____boolTypescriptCore:httpArguments:responseHeaders__"),w2=Symbol.for("____boolTypescriptCore:httpArguments:context__"),mc=Symbol.for("____boolTypescriptCore:httpArguments:routeModel__"),d2=Symbol.for("____boolTypescriptCore:httpArguments:responseBody__"),s2=Symbol.for("____boolTypescriptCore:httpArguments:responseStatus__"),h8=Symbol.for("____boolTypescriptCore:httpArguments:responseStatusText__"),W8=(c)=>(K,w,P)=>{if(!w)return;let S=Reflect.getOwnMetadata(Qc,K.constructor,w)||{};S[`argumentIndexes.${P}`]={index:P,type:K2,validationSchema:c},Reflect.defineMetadata(Qc,S,K.constructor,w)};var b4=(c)=>(K,w,P)=>{if(!w)return;let S=Reflect.getOwnMetadata(Qc,K.constructor,w)||{};S[`argumentIndexes.${P}`]={index:P,type:w2,key:c},Reflect.defineMetadata(Qc,S,K.constructor,w)},M8=()=>(c,K,w)=>{if(!K)return;let P=Reflect.getOwnMetadata(Qc,c.constructor,K)||{};P[`argumentIndexes.${w}`]={index:w,type:mc},Reflect.defineMetadata(Qc,P,c.constructor,K)};var b8=(c)=>(K,w,P)=>{let S=Reflect.getMetadata(w4,K)||[];S[P]=c,Reflect.defineMetadata(w4,S,K)};var I8=()=>(c)=>{Reflect.defineMetadata(i4,void 0,c)},O8=()=>(c)=>{Reflect.defineMetadata(n4,void 0,c)};var T9=Symbol("__bool:webSocket.upgrade__");var m0=Object.freeze({400:"BAD_REQUEST",401:"UNAUTHORIZED",402:"PAYMENT_REQUIRED",403:"FORBIDDEN",404:"NOT_FOUND",405:"METHOD_NOT_ALLOWED",406:"NOT_ACCEPTABLE",407:"PROXY_AUTHENCATION_REQUIRED",408:"REQUEST_TIMEOUT",409:"CONFLICT",410:"GONE",411:"LENGTH_REQUIRED",412:"PRECONDITION_FAILED",413:"PAYLOAD_TOO_LARGE",414:"URI_TOO_LONG",415:"UNSUPPORTED_MEDIA_TYPE",416:"RANGE_NOT_SATISFIABLE",417:"EXPECTATION_FAILED",418:"IM_A_TEAPOT",421:"MISDIRECTED_REQUEST",422:"UNPROCESSABLE_ENTITY",423:"LOCKED",424:"FAILED_DEPENDENCY",425:"TOO_EARLY_",426:"UPGRAGE_REQUIRED",428:"PRECONDITION_REQUIRED",429:"TOO_MANY_REQUESTS",431:"REQUEST_HEADER_FIELDS_TOO_LARGE",451:"UNAVAILABLE_FOR_LEGAL_REASONS"});class P2 extends Error{httpCode;message;data;constructor({httpCode:c,data:K,message:w}){super();this.httpCode=c,this.message=!w?.trim()?m0[c]:w.trim(),this.data=K}}var u0=Object.freeze({500:"INTERNAL_SERVER_ERROR",501:"NOT_IMPLEMENTED",502:"BAD_GATEWAY",503:"SERVICE_UNAVAILABLE",504:"GATEWAY_TIMEOUT",505:"HTTP_VERSION_NOT_SUPPORTED",506:"VARIANT_ALSO_NEGOTIATES",507:"INSUFFICIENT_STORAGE",508:"LOOP_DETECTED",510:"NOT_EXTENDED",511:"NETWORK_AUTHENTICATION_REQUIRED"});class t4 extends Error{httpCode;message;data;constructor({httpCode:c,data:K,message:w}){super();this.httpCode=c,this.message=!w?.trim()?u0[c]:w.trim(),this.data=K}}var C0=(c,K=new Headers)=>{if(K.set("Content-Type","application/json"),c instanceof P2||c instanceof t4)return new Response(JSON.stringify(c),{status:c.httpCode,statusText:c.message,headers:K});return new Response(JSON.stringify((()=>{switch(typeof c){case"object":return!(c instanceof Error)?c:{message:c.message,code:c.name,cause:c.cause};case"string":return{message:c};case"number":return{code:c};default:return}})()),{status:500,statusText:"INTERNAL SERVER ERROR",headers:K})},gc;(function(c){c.year="year",c.month="month",c.day="day",c.hours="hours",c.minutes="minutes",c.seconds="seconds",c.miliseconds="miliseconds"})(gc||(gc={}));var y0=(c,K,w=gc.day)=>{let P=c instanceof Date?c:new Date(c);switch(w){case gc.year:P.setFullYear(P.getFullYear()+K);break;case gc.month:P.setMonth(P.getMonth()+K);break;case gc.day:P.setDate(P.getDate()+K);break;case gc.hours:P.setHours(P.getHours()+K);break;case gc.minutes:P.setMinutes(P.getMinutes()+K);break;case gc.seconds:P.setSeconds(P.getSeconds()+K);break;case gc.miliseconds:P.setMilliseconds(P.getMilliseconds()+K);break}return P},_0=h4(k0(),1),i9=async function(){}.constructor,f6=Object.freeze({black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37,gray:90}),e6=Object.freeze({black:40,red:41,green:42,yellow:43,blue:44,magenta:45,cyan:46,white:47,gray:100}),c2=(c,K={})=>{let{color:w,backgroundColor:P,bold:S,underline:h}=K,W="";if(S)W+="\x1B[1m";if(h)W+="\x1B[4m";if(w&&f6[w])W+=`\x1B[${f6[w]}m`;if(P&&e6[P])W+=`\x1B[${e6[P]}m`;return`${W}${c}\x1B[0m`},f0=(c)=>{let{headers:K,method:w}=c,P=K.get("upgrade")?.toLowerCase()||"",S=K.get("connection")?.toLowerCase()||"";return w==="GET"&&P?.toLowerCase()==="websocket"&&S?.toLowerCase().includes("upgrade")};class a2{_staticMap=new Map;_dynamicMap=new Map;_options=void 0;constructor(...c){c.forEach((K)=>{K.staticEntries.forEach(([w,P])=>this.set(w,P,{isStatic:!0,isPassthrough:!0})),K.dynamicEntries.forEach(([w,P])=>this.set(w,P,{isStatic:!1}))})}get(c,K){return!(K||this._options)?.isStatic?this._dynamicMap.get(c):this._staticMap.get(c)}has(c,K){return!(K||this._options)?.isStatic?this._dynamicMap.has(c):this._staticMap.has(c)}set(c,K,w){let P=w||this._options;if(!P?.isStatic)this._dynamicMap.set(c,K);else if(!this._staticMap.has(c))this._staticMap.set(c,K);else if(!P.isPassthrough)throw Error(`${String(c)} already exists in context static collection.`);return this}setOptions(c){return this._options=c,this}get staticEntries(){return[...this._staticMap.entries()]}get dynamicEntries(){return[...this._dynamicMap.entries()]}}class pc{static rootPattern=":([a-z0-9A-Z_-]{1,})";static innerRootPattern="([a-z0-9A-Z_-]{1,})";alias;_map=new Map;constructor(c){this.alias=this._thinAlias(c)}test(c,K){try{let w=this._map.get(K),P=this.alias.split("/"),S=this._thinAlias(c).split("/");if(!w)return;if(P.length!==S.length)return;let h=Object(),W=this.alias.replace(new RegExp(pc.rootPattern,"g"),pc.innerRootPattern);if(!new RegExp(W).test(this._thinAlias(c)))return;for(let M=0;M<P.length;M++){let J=P[M],O=S[M];if(!new RegExp(pc.rootPattern,"g").test(J)){if(J!==O)return}else{let G=!1;if(J.replace(new RegExp(pc.rootPattern,"g"),(V,z,L)=>{if(L===0)O.replace(new RegExp(pc.innerRootPattern,"g"),(I,$,q)=>{if(q===0)Object.assign(h,{[z]:I});return I});return V}),G)return}continue}return Object.freeze({parameters:h,model:w})}catch(w){return console.error(w),!1}}isMatch(c,K){try{if(!this._map.get(K))return;let w=this.alias.split("/"),P=this._thinAlias(c).split("/");if(w.length!==P.length)return!1;let S=Object();for(let h=0;h<w.length;h++){let W=w[h],M=P[h];if(!new RegExp(pc.rootPattern,"g").test(W)){if(W!==M)return!1}else{let J=!1;if(W.replace(new RegExp(pc.rootPattern,"g"),(O,G,V)=>{if(!new RegExp(V,"g").test(M))J=!0;else Object.assign(S,{[G]:M});return""}),J)return!1}continue}return!0}catch(w){console.error(w);return}}get(c){if(!this._map.get("GET"))this._map.set("GET",c);return this}post(c){if(!this._map.get("POST"))this._map.set("POST",c);return this}put(c){if(!this._map.get("PUT"))this._map.set("PUT",c);return this}delete(c){if(!this._map.get("DELETE"))this._map.set("DELETE",c);return this}connect(c){if(!this._map.get("CONNECT"))return this._map.set("CONNECT",c);return this}options(c){if(!this._map.get("OPTIONS"))return this._map.set("OPTIONS",c);return this}trace(c){if(!this._map.get("TRACE"))return this._map.set("TRACE",c);return this}patch(c){if(!this._map.get("PATCH"))return this._map.set("PATCH",c);return this}_thinAlias(c){return c.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}get _fullPath(){return this.alias.split("/").map((c,K)=>{let w=new RegExp(":([a-z0-9A-Z_.-]{1,})(\\(.*?\\))","g");if(!w.test(c)){if(w=new RegExp(":([a-z0-9A-Z_.-]{1,})","g"),!w.test(c))return c;return c.replace(w,(P,S)=>`${P}(.*?)`)}return c}).join("/")}get _filteredPath(){return this.alias.split("/").map((c,K)=>{let w=new RegExp(":([a-z0-9A-Z_.-]{1,})((.*?))","g");if(!w.test(c)){if(w=new RegExp(":([a-z0-9A-Z_.-]{1,})","g"),!w.test(c))return c;return c.replace(w,(P,S)=>"(.*?)")}return c.replace(w,(P,S,h)=>h)}).join("/")}}var e0=pc;class _4{alias;_routes=new Map;constructor(c){this.alias=this._thinAlias(c)}route(c){let K=this._thinAlias(`${this.alias}/${c}`),w=this._routes.get(K),P=!w?new e0(`${this.alias}/${c}`):w;if(!w)this._routes.set(K,P);return P}_thinAlias(c){return c.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}get routes(){return this._routes}}class f4{_routers=new Map;add(...c){for(let K of c){if(this._routers.has(K.alias))continue;this._routers.set(K.alias,K)}return this}find(c,K){for(let w of this._routers.values())for(let P of w.routes.values()){let S=P.test(c,K);if(!S)continue;return S}return}}var n9=h4(e4(),1);class c4{_mapper=new Map;constructor(...c){c.forEach((K)=>{K.entries.forEach(([w,P])=>{this._mapper.set(w,P)})})}get(c){if(this._mapper.has(c))return this._mapper.get(c);if(typeof c!=="function")return;let K=Reflect.getMetadataKeys(c);if(![K8,K4,n4,c8,i4,P4].some((S)=>K.includes(S)))throw Error("Missing dependency declaration, please check @Injectable() used on dependency(ies).");let w=(Reflect.getOwnMetadata(w4,c)||[]).map((S)=>this.get(S)),P=new c(...w);return this._mapper.set(c,P),P}set(c,K){if(this._mapper.has(c))throw Error(`${String(c)} already exists in injector collection.`);this._mapper.set(c,K)}get entries(){return[...this._mapper.entries()]}}class J8{error;constructor(c){this.error=c}}var l0=J8;class D8{eventName;metadata;_context=void 0;constructor({eventName:c,metadata:K}){this.eventName=c,this.metadata=K}bind(c){return this._context=c,this}execute(){if(this._context&&typeof this.metadata.descriptor.value==="function")this.metadata.descriptor.value=this.metadata.descriptor.value.bind(this._context);return Object.freeze({methodName:this.metadata.methodName,descriptor:this.metadata.descriptor,arguments:this.metadata.arguments})}}class d4{rawAlias;alias;routes=[];constructor(c="/"){this.rawAlias=c,this.alias=d4.thinAlias(c)}addRoutes(...c){for(let K of c)if(!this.routes.includes(K))this.routes.push(K);return this}bind(c){for(let K of this.routes)K.bind(c);return this}execute(){let c=new Map;for(let K of this.routes)c.set(`${this.alias}:::${K.eventName}`,K.execute());return c}static thinAlias(c){return c.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class S4{rawPrefix;prefix;routers=[];constructor(c="/"){this.rawPrefix=c,this.prefix=S4.thinPrefix(c)}addRouters(...c){for(let K=0;K<c.length;K++)if(!this.routers.includes(c[K]))this.routers.push(c[K]);for(let K of c)if(!this.routers.includes(K))this.routers.push(K);return this}execute(){let c=new Map;for(let K of this.routers){let w=K.execute();for(let[P,S]of w.entries())c.set(`/${S4.thinPrefix(`${this.prefix}/${P}`)}`,S)}return c}static thinPrefix(c){return c.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class p0{classConstructor;options;#c;#K;#w=new c4;#P=new Map;#h;#W=900;#S;constructor(c,K){if(this.classConstructor=c,this.options=K,this.#K=Reflect.getOwnMetadataKeys(c),!this.#K.includes(J2)&&!this.#K.includes(n2))throw Error(`Can not detect! ${c.name} class is not a container or module.`);this.#W=typeof K.static?.cacheTimeInSeconds!=="number"?900:K.static.cacheTimeInSeconds,this.#h=Object.freeze({allowLogsMethods:this.options?.log?.methods||[],staticOption:this.options.static,allowOrigins:!this.options.cors?.origins?["*"]:typeof this.options.cors.origins!=="string"?this.options.cors.origins.includes("*")||this.options.cors.origins.length<1?["*"]:this.options.cors.origins:[this.options.cors.origins!=="*"?this.options.cors.origins:"*"],allowMethods:this.options.cors?.methods||["GET","POST","PUT","PATCH","DELETE","OPTIONS"],allowCredentials:!this.options.cors?.credentials?!1:!0,allowHeaders:!this.options.cors?.headers||this.options.cors.headers.includes("*")?["*"]:this.options.cors.headers})}useValidator(c){this.#S=c}async preLaunch(){if(this.#c)return this.#c;let c=!this.#K.includes(J2)?void 0:Reflect.getOwnMetadata(J2,this.classConstructor),K=!this.#K.includes(J2)?[this.classConstructor]:c?.modules||[],w=!c?void 0:await this.containerResolution({containerClass:this.classConstructor,options:this.options,extendInjector:this.#w}),P=await Promise.all(K.map((W)=>this.moduleResolution({moduleClass:W,options:this.options,extendInjector:!w?this.#w:w.injector})));if([...new Set(P.map((W)=>W.prefix))].length!==P.length)throw Error("Module prefix should be unique.");let S=new Map;for(let W of P){let M=W.webSocketRouterGroup.execute();for(let[J,O]of M.entries())S.set(J,O)}let h=Object.freeze({containerMetadata:c,modulesConverted:K,resolutedContainer:w,resolutedModules:P,webSocketsMap:S});return this.#c=h,h}async listen(){let{allowLogsMethods:c,allowOrigins:K,allowMethods:w,allowHeaders:P,allowCredentials:S,staticOption:h}=this.#h,{resolutedContainer:W,resolutedModules:M,webSocketsMap:J}=await this.preLaunch(),O=Bun.serve({port:this.options.port,fetch:async(G,V)=>{let z=performance.now(),L=new URL(G.url),I=_0.parse(L.searchParams.toString(),this.options.queryParser),$=G.headers.get("origin")||"*",q=G.method.toUpperCase(),b=new Headers,Y=new a2().setOptions({isStatic:!0}).set(fc,V).set(lc,G).set(ec,G.headers).set(oc,b).set(S8,I);try{let B=f0(G),D;if(B){for(let A of M){let u=A.webSocketHttpRouterGroup.find(L.pathname,G.method);if(u){D=Object.freeze({route:u,resolution:A});break}}if(!D)return this.finalizeResponse(new Response(JSON.stringify({httpCode:404,message:"Route not found",data:void 0}),{status:404,statusText:"Not found.",headers:b}));let g=await this.webSocketFetcher({request:G,server:V},{query:I,responseHeaders:b,route:D.route,moduleResolution:D.resolution});return g instanceof Response?g:void 0}if([...!S?[]:[{key:"Access-Control-Allow-Credentials",value:"true"}],{key:"Access-Control-Allow-Origin",value:K.includes("*")?"*":!K.includes($)?K[0]:$},{key:"Access-Control-Allow-Methods",value:w.join(", ")},{key:"Access-Control-Allow-Headers",value:P.join(", ")}].forEach(({key:g,value:A})=>b.set(g,A)),!w.includes(q))return this.finalizeResponse(new Response(void 0,{status:405,statusText:"Method Not Allowed.",headers:b}));if(G.method.toUpperCase()==="OPTIONS")return this.finalizeResponse(K.includes("*")||K.includes($)?new Response(void 0,{status:204,statusText:"No Content.",headers:b}):new Response(void 0,{status:417,statusText:"Expectation Failed.",headers:b}));if(h){let{path:g,headers:A}=h,u=`${g}/${L.pathname}`,i=this.#P.get(u);if(!i){let C=Bun.file(u);if(await C.exists()){if(A)for(let[a,bc]of Object.entries(A))b.set(a,bc);return b.set("Content-Type",C.type),this.finalizeResponse(new Response(await C.arrayBuffer(),{status:200,statusText:"SUCCESS",headers:b}))}}else{let C=new Date>i.expiredAt;if(C)this.#P.delete(u);let a=!C?i.file:Bun.file(u);if(await a.exists()){if(this.#P.set(u,Object.freeze({expiredAt:y0(new Date,this.#W,gc.seconds),file:a})),A)for(let[bc,wc]of Object.entries(A))b.set(bc,wc);return b.set("Content-Type",a.type),this.finalizeResponse(new Response(await a.arrayBuffer(),{status:200,statusText:"SUCCESS",headers:b}))}}}if(W){let{context:g}=await this.httpFetcher({context:Y,resolutedMap:{injector:W.injector,startMiddlewareGroup:W.startMiddlewareGroup,guardGroup:W.guardGroup},options:{isContainer:!0}});Y=g}for(let g of M){let A=g.controllerRouterGroup.find(L.pathname,q);if(A){D=Object.freeze({route:A,resolution:g});break}}if(!D)Y.setOptions({isStatic:!1}).set(s2,404).set(h8,"Not found.").set(d2,{httpCode:404,message:"Route not found",data:void 0});else{let{context:g}=await this.httpFetcher({context:Y,route:D.route,resolutedMap:D.resolution});Y=g}if(W){let{context:g}=await this.httpFetcher({context:Y,resolutedMap:{injector:W.injector,endMiddlewareGroup:W.endMiddlewareGroup},options:{isContainer:!0}});Y=g}let H=Y.get(oc,{isStatic:!0})||new Headers,o=Y.get(d2,{isStatic:!1})||void 0,Q=Y.get(s2,{isStatic:!1}),r=Y.get(s2,{isStatic:!1});return this.serializeResponse({status:typeof Q!=="number"?void 0:Q,statusText:typeof r!=="string"?void 0:r,headers:H,data:o})}catch(B){return this.options.debug&&console.error(B),this.finalizeResponse(C0(B,b))}finally{if(c){let B=performance.now(),D=c2(L.pathname,{color:"blue"}),H=`${Bun.color("yellow","ansi")}${process.pid}`,o=c2(G.method,{color:"yellow",backgroundColor:"blue"}),Q=c2(`${G.headers.get("x-forwarded-for")||G.headers.get("x-real-ip")||V.requestIP(G)?.address||"<Unknown>"}`,{color:"yellow"}),r=c2(`${Math.round((B-z+Number.EPSILON)*100)/100}ms`,{color:"yellow",backgroundColor:"blue"});c.includes(G.method.toUpperCase())&&console.info(`PID: ${H} - Method: ${o} - IP: ${Q} - ${D} - Time: ${r}`)}}},websocket:{open:(G)=>{let V=`${G.data.pathname}:::open`,z=J.get(V);if(!z)return;let L=z.arguments||{},I=[];for(let[$,q]of Object.entries(L))switch(q.type){case N2:I[q.index]=G;break;case D2:I[q.index]=O;break}z.descriptor.value(...I)},close:(G,V,z)=>{let L=`${G.data.pathname}:::close`,I=J.get(L);if(!I)return;let $=I.arguments||{},q=[];for(let[b,Y]of Object.entries($))switch(Y.type){case N2:q[Y.index]=G;break;case D2:q[Y.index]=O;break;case w8:q[Y.index]=V;break;case P8:q[Y.index]=z;break}I.descriptor.value(...q)},message:(G,V)=>{let z=`${G.data.pathname}:::message`,L=J.get(z);if(!L)return;let I=L.arguments||{},$=[];for(let[q,b]of Object.entries(I))switch(b.type){case N2:$[b.index]=G;break;case t2:$[b.index]=V;break;case D2:$[b.index]=O;break}L.descriptor.value(...$)},drain:(G)=>{let V=`${G.data.pathname}:::drain`,z=J.get(V);if(!z)return;let L=z.arguments||{},I=[];for(let[$,q]of Object.entries(L))switch(q.type){case N2:I[q.index]=G;break;case D2:I[q.index]=O;break}z.descriptor.value(...I)},ping:(G,V)=>{let z=`${G.data.pathname}:::ping`,L=J.get(z);if(!L)return;let I=L.arguments||{},$=[];for(let[q,b]of Object.entries(I))switch(b.type){case N2:$[b.index]=G;break;case D2:$[b.index]=O;break;case t2:$[b.index]=V;break}L.descriptor.value(...$)},pong:(G,V)=>{let z=`${G.data.pathname}:::pong`,L=J.get(z);if(!L)return;let I=L.arguments||{},$=[];for(let[q,b]of Object.entries(I))switch(b.type){case N2:$[b.index]=G;break;case D2:$[b.index]=O;break;case t2:$[b.index]=V;break}L.descriptor.value(...$)}}})}async containerResolution({containerClass:c,options:K,extendInjector:w}){if(!Reflect.getOwnMetadataKeys(c).includes(J2))throw Error(`${c.name} is not a container.`);let P=new c4(w),S=Reflect.getOwnMetadata(J2,c),{loaders:h,middlewares:W,guards:M,dependencies:J,config:O}=S||{},{config:G}=Object.freeze({config:{...typeof K.config!=="function"?K.config:await K.config(),...typeof O!=="function"?typeof O!=="object"?void 0:("key"in O)&&("value"in O)&&typeof O.key==="symbol"?typeof O.value!=="function"?O.value:await O.value():O:await O()}});if(P.set(O&&"key"in O&&"value"in O&&typeof O.key==="symbol"?O.key:C4,G),h){let I=[];for(let[q,b]of Object.entries(h))I.push(async()=>{try{let Y=await b({config:G});return console.info(`${c2(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${q}] initialized successfully.`),Y}catch(Y){throw console.error(`${c2(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${q}] initialization failed.`),K.debug&&console.error(Y),Y}});let $=await Promise.all(I.map((q)=>q()));for(let[q,b]of $)P.set(q,b)}!J||J.map((I)=>P.get(I));let V=[],z=[];!W||W.forEach((I)=>{let $=P.get(I);if($.start&&typeof $.start==="function"){let q=Reflect.getOwnMetadata(Qc,I,"start")||{};V.push(Object.freeze({class:I,funcName:"start",func:$.start.bind($),argumentsMetadata:q}))}if($.end&&typeof $.end==="function"){let q=Reflect.getOwnMetadata(Qc,I,"end")||{};z.push(Object.freeze({class:I,funcName:"end",func:$.end.bind($),argumentsMetadata:q}))}});let L=!M?[]:M.map((I)=>{let $=P.get(I),q=Reflect.getOwnMetadata(Qc,I,"enforce")||{};return Object.freeze({class:I,funcName:"enforce",func:$.enforce.bind($),argumentsMetadata:q})});return Object.freeze({injector:P,startMiddlewareGroup:V,endMiddlewareGroup:z,guardGroup:L})}async moduleResolution({moduleClass:c,options:K,extendInjector:w}){if(!Reflect.getOwnMetadataKeys(c).includes(n2))throw Error(`${c.name} is not a module.`);let P=new c4(w),S=Reflect.getOwnMetadata(n2,c),{loaders:h,middlewares:W,guards:M,interceptors:J,controllers:O,dependencies:G,webSockets:V,prefix:z,config:L}=S||{},I=`${K.prefix||""}/${z||""}`,{config:$}=Object.freeze({config:{...typeof K.config!=="function"?K.config:await K.config(),...typeof L!=="function"?typeof L!=="object"?void 0:("key"in L)&&("value"in L)&&typeof L.key==="symbol"?typeof L.value!=="function"?L.value:await L.value():L:await L()}});if(P.set(L&&"key"in L&&"value"in L&&typeof L.key==="symbol"?L.key:C4,$),h){let r=[];for(let[A,u]of Object.entries(h))r.push(async()=>{try{let i=await u({config:$});return console.info(`${c2(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${A}] initialized successfully.`),i}catch(i){throw console.error(`${c2(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${A}] initialization failed.`),K.debug&&console.error(i),i}});let g=await Promise.all(r.map((A)=>A()));for(let A=0;A<g.length;A++){let[u,i]=g[A];P.set(u,i)}}!G||G.map((r)=>P.get(r));let q=[],b=[];!W||W.forEach((r)=>{let g=P.get(r);if(g.start&&typeof g.start==="function"){let A=Reflect.getOwnMetadata(Qc,r,"start")||{};q.push(Object.freeze({class:r,funcName:"start",func:g.start.bind(g),argumentsMetadata:A}))}if(g.end&&typeof g.end==="function"){let A=Reflect.getOwnMetadata(Qc,r,"end")||{};b.push(Object.freeze({class:r,funcName:"end",func:g.end.bind(g),argumentsMetadata:A}))}});let Y=!M?[]:M.map((r)=>{let g=P.get(r),A=Reflect.getOwnMetadata(Qc,r,"enforce")||{};return Object.freeze({class:r,funcName:"enforce",func:g.enforce.bind(g),argumentsMetadata:A})}),B=[],D=[];!J||J.forEach((r)=>{let g=P.get(r);if(g.open&&typeof g.open==="function"){let A=Reflect.getOwnMetadata(Qc,r,"open")||{};B.push(Object.freeze({class:r,funcName:"open",func:g.open.bind(g),argumentsMetadata:A}))}if(g.close&&typeof g.close==="function"){let A=Reflect.getOwnMetadata(Qc,r,"close")||{};D.push(Object.freeze({class:r,funcName:"close",func:g.close.bind(g),argumentsMetadata:A}))}});let H=new f4;!O||O.forEach((r)=>this.initControllerInstance({controllerConstructor:r,httpRouterGroup:H,injector:P,prefix:I}));let o=new f4,Q=new S4;return V&&V.forEach((r)=>this.initWebSocketInstance({webSocketConstructor:r,httpRouterGroup:o,webSocketRouterGroup:Q,injector:P,prefix:I})),Object.freeze({prefix:z||"",injector:P,startMiddlewareGroup:q,endMiddlewareGroup:b,guardGroup:Y,openInterceptorGroup:B,closeInterceptorGroup:D,controllerRouterGroup:H,webSocketHttpRouterGroup:o,webSocketRouterGroup:Q})}async argumentsResolution(c,K,w,P){if(!this.#S)return c;try{let S=await this.#S.validate(c,K,w,P);if(!(S instanceof l0))return S;throw new P2({httpCode:400,message:`Validation at the [${P.toString()}] method fails at positional argument [${w}].`,data:S.error})}catch(S){if(S instanceof P2)throw S;throw new t4({httpCode:500,message:`Validation at the [${P.toString()}] method error at positional argument [${w}].`,data:!(S instanceof Error)?S:[{message:S.message,code:S.name,cause:S.cause}]})}}initControllerInstance({controllerConstructor:c,httpRouterGroup:K,injector:w,prefix:P}){if(!Reflect.getOwnMetadataKeys(c).includes(K4))throw Error(`${c.name} is not a controller.`);let S=w.get(c);if(!S)throw Error("Can not initialize controller.");let h=Reflect.getOwnMetadata(K4,c)||{prefix:"/",httpMetadata:[]},W=new _4(`/${P||""}/${h.prefix}`);return h.httpMetadata.forEach((M)=>{if(typeof M.descriptor.value!=="function")return;let J=W.route(M.path),O=M.descriptor.value.bind(S),G=Object.freeze({class:c,funcName:M.methodName,func:O,argumentsMetadata:M.argumentsMetadata});switch(M.httpMethod){case"GET":return J.get(G);case"POST":return J.post(G);case"PUT":return J.put(G);case"PATCH":return J.patch(G);case"DELETE":return J.delete(G);case"OPTIONS":return J.options(G)}}),K.add(W)}initWebSocketInstance({injector:c,httpRouterGroup:K,prefix:w,webSocketRouterGroup:P,webSocketConstructor:S}){if(!Reflect.getOwnMetadataKeys(S).includes(P4))throw Error(`${S.name} is not a websocket route.`);let h=c.get(S);if(!h)throw Error("Can not initialize webSocket.");let W=Reflect.getOwnMetadata(P4,S)||{prefix:"/",events:[],http:[]},M=`/${w||""}/${W.prefix}`,J=new _4(M);for(let[G,V]of Object.entries(W.http)){if(typeof V.descriptor?.value!=="function")continue;let z=J.route(V.path),L=V.descriptor.value.bind(h),I=Object.freeze({class:S,funcName:V.methodName,func:L,argumentsMetadata:V.argumentsMetadata});switch(V.httpMethod){case"GET":z.get(I);break;case"POST":z.post(I);break}}K.add(J);let O=new d4(M);for(let[G,V]of Object.entries(W.events)){let z=new D8({eventName:G,metadata:V});O.addRoutes(z)}return O.bind(h),P.addRouters(O),Object.freeze({httpRouterGroup:K,webSocketRouterGroup:P})}serializeResponse({status:c,statusText:K,headers:w,data:P}){let S=w.get("Content-Type")||"text/plain";if(S.includes("application/json"))return this.finalizeResponse(new Response(P instanceof ReadableStream?P:JSON.stringify(P),{status:c,statusText:K,headers:w}));if(S.includes("text/plain")||S.includes("text/html"))return this.finalizeResponse(new Response(P instanceof ReadableStream?P:String(P),{status:c,statusText:K,headers:w}));if(S.includes("application/octet-stream")){if(P instanceof Uint8Array||P instanceof ArrayBuffer||P instanceof Blob||P instanceof ReadableStream)return this.finalizeResponse(new Response(P instanceof Uint8Array?String.fromCharCode(...new Uint8Array(P)):P,{status:c,statusText:K,headers:w}));throw Error("Invalid data type for application/octet-stream")}if(S.includes("multipart/form-data")){if(P instanceof FormData)return this.finalizeResponse(new Response(P,{status:c,statusText:K,headers:w}));throw Error("multipart/form-data requires FormData object")}return this.finalizeResponse(new Response(String(P),{status:c,statusText:K,headers:w}))}finalizeResponse(c){return c.headers.set("X-Powered-By","Bool Typescript"),c}async httpFetcher({context:c,route:K,options:w,resolutedMap:P}){let S={isStatic:!0},h=(!c?new a2:new a2(c)).setOptions(S);if(K)h.set(y4,K.parameters).set(mc,K.model);let W=h.get(fc,S)||void 0,M=h.get(lc,S)||void 0,J=h.get(ec,S)||void 0,O=h.get(oc,S)||void 0,G=h.get(y4,S)||void 0,V=h.get(mc,S)||void 0;if(P){let{startMiddlewareGroup:z,guardGroup:L}=P;if(z)for(let I=0;I<z.length;I++){let $=[],{func:q,funcName:b,argumentsMetadata:Y}=z[I];for(let[B,D]of Object.entries(Y))switch(D.type){case w2:$[D.index]=!D.key?h:h.get(D.key,S);break;case lc:$[D.index]=!D.validationSchema?M:await this.argumentsResolution(M,D.validationSchema,D.index,b);break;case G2:$[D.index]=!D.validationSchema?await M?.[D.parser||"json"]():await this.argumentsResolution(await M?.[D.parser||"json"](),D.validationSchema,D.index,b);break;case K2:$[D.index]=!D.validationSchema?J:await this.argumentsResolution(J?.toJSON(),D.validationSchema,D.index,b);break;case ec:$[D.index]=!D.validationSchema?J?.get(D.key)||void 0:await this.argumentsResolution(J?.get(D.key)||void 0,D.validationSchema,D.index,b);break;case j2:$[D.index]=!D.validationSchema?G?.[D.key]||void 0:await this.argumentsResolution(G?.[D.key]||void 0,D.validationSchema,D.index,b);break;case mc:$[D.index]=V;break;case oc:$[D.index]=O;break;case fc:$[D.index]=W;break;default:$[D.index]=!D.validationSchema?!h.has(D.type,S)?void 0:h.get(D.type,S):await this.argumentsResolution(!(D.type in h)?void 0:h.get(D.type,S),D.validationSchema,D.index,b);break}await q(...$)}if(L)for(let I=0;I<L.length;I++){let $=[],{func:q,funcName:b,argumentsMetadata:Y}=L[I];for(let[D,H]of Object.entries(Y))switch(H.type){case lc:$[H.index]=!H.validationSchema?M:await this.argumentsResolution(M,H.validationSchema,H.index,b);break;case G2:$[H.index]=!H.validationSchema?await M?.[H.parser||"json"]():await this.argumentsResolution(await M?.[H.parser||"json"](),H.validationSchema,H.index,b);break;case w2:$[H.index]=!H.key?h:h.get(H.key);break;case K2:$[H.index]=!H.validationSchema?J:await this.argumentsResolution(J?.toJSON(),H.validationSchema,H.index,b);break;case oc:$[H.index]=O;break;case ec:$[H.index]=!H.validationSchema?J?.get(H.key)||void 0:await this.argumentsResolution(J?.get(H.key)||void 0,H.validationSchema,H.index,b);break;case j2:$[H.index]=!H.validationSchema?G?.[H.key]||void 0:await this.argumentsResolution(G?.[H.key],H.validationSchema,H.index,b);break;case mc:$[H.index]=V;break;case fc:$[H.index]=W;break;default:$[H.index]=!H.validationSchema?!h.has(H.type)?void 0:h.get(H.type):await this.argumentsResolution(h.get(H.type),H.validationSchema,H.index,b);break}let B=await q(...$);if(typeof B!=="boolean"||!B)throw new P2({httpCode:401,message:"Unauthorization.",data:void 0})}}if(V&&!w?.isContainer){if(P&&"openInterceptorGroup"in P&&P.openInterceptorGroup){let{openInterceptorGroup:q}=P;for(let b=0;b<q.length;b++){let Y=[],{func:B,funcName:D,argumentsMetadata:H}=q[b];for(let[o,Q]of Object.entries(H))switch(Q.type){case lc:Y[Q.index]=!Q.validationSchema?M:await this.argumentsResolution(M,Q.validationSchema,Q.index,D);break;case G2:Y[Q.index]=!Q.validationSchema?await M?.[Q.parser||"json"]():await this.argumentsResolution(await M?.[Q.parser||"json"](),Q.validationSchema,Q.index,D);break;case w2:Y[Q.index]=!Q.key?h:h.get(Q.key);break;case K2:Y[Q.index]=!Q.validationSchema?J:await this.argumentsResolution(J?.toJSON(),Q.validationSchema,Q.index,D);break;case ec:Y[Q.index]=!Q.validationSchema?J?.get(Q.key)||void 0:await this.argumentsResolution(J?.get(Q.key)||void 0,Q.validationSchema,Q.index,D);break;case oc:Y[Q.index]=O;break;case j2:Y[Q.index]=!Q.validationSchema?G?.[Q.key]||void 0:await this.argumentsResolution(G?.[Q.key]||void 0,Q.validationSchema,Q.index,D);break;case mc:Y[Q.index]=V;break;case fc:Y[Q.index]=W;break;default:Y[Q.index]=!Q.validationSchema?!h.has(Q.type)?void 0:h.get(Q.type):await this.argumentsResolution(h.get(Q.type),Q.validationSchema,Q.index,D);break}await B(...Y)}}let z=[],{func:L,funcName:I,argumentsMetadata:$}=V;for(let[q,b]of Object.entries($))switch(b.type){case lc:z[b.index]=!b.validationSchema?M:await this.argumentsResolution(M,b.validationSchema,b.index,I);break;case G2:z[b.index]=!b.validationSchema?await M?.[b.parser||"json"]():await this.argumentsResolution(await M?.[b.parser||"json"](),b.validationSchema,b.index,I);break;case w2:z[b.index]=!b.key?h:h.get(b.key);break;case K2:z[b.index]=!b.validationSchema?J:await this.argumentsResolution(J?.toJSON(),b.validationSchema,b.index,I);break;case ec:z[b.index]=!b.validationSchema?J?.get(b.key)||void 0:await this.argumentsResolution(J?.get(b.key)||void 0,b.validationSchema,b.index,I);break;case oc:z[b.index]=O;break;case j2:z[b.index]=!b.validationSchema?G?.[b.key]||void 0:await this.argumentsResolution(G?.[b.key]||void 0,b.validationSchema,b.index,I);break;case mc:z[b.index]=V;break;case fc:z[b.index]=W;break;default:z[b.index]=!b.validationSchema?!h.has(b.type)?void 0:h.get(b.type):await this.argumentsResolution(h.get(b.type),b.validationSchema,b.index,I);break}if(h.set(d2,await L(...z),{isStatic:!1}),P&&"closeInterceptorGroup"in P&&P.closeInterceptorGroup){let{closeInterceptorGroup:q}=P;for(let b=0;b<q.length;b++){let Y=[],{func:B,funcName:D,argumentsMetadata:H}=q[b];for(let[o,Q]of Object.entries(H))switch(Q.type){case lc:Y[Q.index]=!Q.validationSchema?M:await this.argumentsResolution(M,Q.validationSchema,Q.index,D);break;case G2:Y[Q.index]=!Q.validationSchema?await M?.[Q.parser||"json"]():await this.argumentsResolution(await M?.[Q.parser||"json"](),Q.validationSchema,Q.index,D);break;case w2:Y[Q.index]=!Q.key?h:h.get(Q.key);break;case K2:Y[Q.index]=!Q.validationSchema?J:await this.argumentsResolution(J?.toJSON(),Q.validationSchema,Q.index,D);break;case oc:Y[Q.index]=h.get(Q.type);break;case ec:Y[Q.index]=!Q.validationSchema?J?.get(Q.key)||void 0:await this.argumentsResolution(J?.get(Q.key)||void 0,Q.validationSchema,Q.index,D);break;case j2:Y[Q.index]=!Q.validationSchema?G?.[Q.key]||void 0:await this.argumentsResolution(G?.[Q.key]||void 0,Q.validationSchema,Q.index,D);break;case mc:Y[Q.index]=V;break;case fc:Y[Q.index]=W;break;default:Y[Q.index]=!Q.validationSchema?!h.has(Q.type)?void 0:h.get(Q.type):await this.argumentsResolution(h.get(Q.type),Q.validationSchema,Q.index,D);break}await B(...Y)}}}if(P){let{endMiddlewareGroup:z}=P;if(z)for(let L=0;L<z.length;L++){let I=[],{func:$,funcName:q,argumentsMetadata:b}=z[L];for(let[Y,B]of Object.entries(b))switch(B.type){case lc:I[B.index]=!B.validationSchema?M:await this.argumentsResolution(M,B.validationSchema,B.index,q);break;case G2:I[B.index]=!B.validationSchema?await M?.[B.parser||"json"]():await this.argumentsResolution(await M?.[B.parser||"json"](),B.validationSchema,B.index,q);break;case w2:I[B.index]=!B.key?h:h.get(B.key);break;case K2:I[B.index]=!B.validationSchema?J:await this.argumentsResolution(J?.toJSON(),B.validationSchema,B.index,q);break;case oc:I[B.index]=h.get(B.type);break;case ec:I[B.index]=!B.validationSchema?J?.get(B.key)||void 0:await this.argumentsResolution(J?.get(B.key)||void 0,B.validationSchema,B.index,q);break;case j2:I[B.index]=!B.validationSchema?G?.[B.key]||void 0:await this.argumentsResolution(G?.[B.key]||void 0,B.validationSchema,B.index,q);break;case mc:I[B.index]=V;break;case fc:I[B.index]=W;break;default:I[B.index]=!B.validationSchema?!h.has(B.type)?void 0:h.get(B.type):await this.argumentsResolution(!(B.type in h)?void 0:h.get(B.type),B.validationSchema,B.index,q);break}await $(...I)}}return Object.freeze({context:h})}async webSocketFetcher(c,K){let{request:w,server:P}=c,{query:S,responseHeaders:h,route:{model:W}}=K,M=await W.func(...[P,w,S]);if(typeof M!=="boolean")return this.finalizeResponse(new Response(JSON.stringify({httpCode:500,message:"Can not detect webSocket upgrade result.",data:void 0}),{status:500,statusText:"Internal server error.",headers:h}));if(!M)return this.finalizeResponse(new Response(JSON.stringify({httpCode:500,message:"Can not upgrade.",data:void 0}),{status:500,statusText:"Internal server error.",headers:h}));return M}}var t9=h4(e4(),1);var s4=()=>b4(Yc.authState);class a4{open(c,K){if(Reflect.getOwnMetadataKeys(c.class.prototype,c.funcName).includes(Yc.authState)){if(!K)throw new P2({httpCode:401,message:"Unauthorized",data:void 0});return}if(Reflect.getOwnMetadataKeys(c.class).includes(Yc.authState)){if(!K)throw new P2({httpCode:401,message:"Unauthorized",data:void 0});return}}}Y2([O2(0,M8()),O2(1,s4())],a4.prototype,"open",null),a4=Y2([I8()],a4);var Tc=new TextEncoder,V2=new TextDecoder;function N8(...c){let K=c.reduce((S,{length:h})=>S+h,0),w=new Uint8Array(K),P=0;for(let S of c)w.set(S,P),P+=S.length;return w}function G8(c){if(Uint8Array.prototype.toBase64)return c.toBase64();let K=32768,w=[];for(let P=0;P<c.length;P+=K)w.push(String.fromCharCode.apply(null,c.subarray(P,P+K)));return btoa(w.join(""))}function j8(c){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(c);let K=atob(c),w=new Uint8Array(K.length);for(let P=0;P<K.length;P++)w[P]=K.charCodeAt(P);return w}function X8(c){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof c==="string"?c:V2.decode(c),{alphabet:"base64url"});let K=c;if(K instanceof Uint8Array)K=V2.decode(K);K=K.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return j8(K)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function I4(c){let K=c;if(typeof K==="string")K=Tc.encode(K);if(Uint8Array.prototype.toBase64)return K.toBase64({alphabet:"base64url",omitPadding:!0});return G8(K).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class O4 extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(c,K){super(c,K);this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class kc extends O4{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class S2 extends O4{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class c6 extends O4{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}function uc(c,K="algorithm.name"){return TypeError(`CryptoKey does not support this operation, its ${K} must be ${c}`)}function L2(c,K){return c.name===K}function K6(c){return parseInt(c.name.slice(4),10)}function n0(c){switch(c){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}function t0(c,K){if(K&&!c.usages.includes(K))throw TypeError(`CryptoKey does not support this operation, its usages must include ${K}.`)}function B8(c,K,w){switch(K){case"HS256":case"HS384":case"HS512":{if(!L2(c.algorithm,"HMAC"))throw uc("HMAC");let P=parseInt(K.slice(2),10);if(K6(c.algorithm.hash)!==P)throw uc(`SHA-${P}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!L2(c.algorithm,"RSASSA-PKCS1-v1_5"))throw uc("RSASSA-PKCS1-v1_5");let P=parseInt(K.slice(2),10);if(K6(c.algorithm.hash)!==P)throw uc(`SHA-${P}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!L2(c.algorithm,"RSA-PSS"))throw uc("RSA-PSS");let P=parseInt(K.slice(2),10);if(K6(c.algorithm.hash)!==P)throw uc(`SHA-${P}`,"algorithm.hash");break}case"Ed25519":case"EdDSA":{if(!L2(c.algorithm,"Ed25519"))throw uc("Ed25519");break}case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":{if(!L2(c.algorithm,K))throw uc(K);break}case"ES256":case"ES384":case"ES512":{if(!L2(c.algorithm,"ECDSA"))throw uc("ECDSA");let P=n0(K);if(c.algorithm.namedCurve!==P)throw uc(P,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}t0(c,w)}function z8(c,K,...w){if(w=w.filter(Boolean),w.length>2){let P=w.pop();c+=`one of type ${w.join(", ")}, or ${P}.`}else if(w.length===2)c+=`one of type ${w[0]} or ${w[1]}.`;else c+=`of type ${w[0]}.`;if(K==null)c+=` Received ${K}`;else if(typeof K==="function"&&K.name)c+=` Received function ${K.name}`;else if(typeof K==="object"&&K!=null){if(K.constructor?.name)c+=` Received an instance of ${K.constructor.name}`}return c}var $8=(c,...K)=>{return z8("Key must be ",c,...K)};function w6(c,K,...w){return z8(`Key for the ${c} algorithm must be `,K,...w)}function P6(c){return c?.[Symbol.toStringTag]==="CryptoKey"}function S6(c){return c?.[Symbol.toStringTag]==="KeyObject"}var h6=(c)=>{return P6(c)||S6(c)};var Q8=(...c)=>{let K=c.filter(Boolean);if(K.length===0||K.length===1)return!0;let w;for(let P of K){let S=Object.keys(P);if(!w||w.size===0){w=new Set(S);continue}for(let h of S){if(w.has(h))return!1;w.add(h)}}return!0};function d0(c){return typeof c==="object"&&c!==null}var J4=(c)=>{if(!d0(c)||Object.prototype.toString.call(c)!=="[object Object]")return!1;if(Object.getPrototypeOf(c)===null)return!0;let K=c;while(Object.getPrototypeOf(K)!==null)K=Object.getPrototypeOf(K);return Object.getPrototypeOf(c)===K};var U8=(c,K)=>{if(c.startsWith("RS")||c.startsWith("PS")){let{modulusLength:w}=K.algorithm;if(typeof w!=="number"||w<2048)throw TypeError(`${c} requires key modulusLength to be 2048 bits or larger`)}};function s0(c){let K,w;switch(c.kty){case"AKP":{switch(c.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":K={name:c.alg},w=c.priv?["sign"]:["verify"];break;default:throw new kc('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(c.alg){case"PS256":case"PS384":case"PS512":K={name:"RSA-PSS",hash:`SHA-${c.alg.slice(-3)}`},w=c.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":K={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${c.alg.slice(-3)}`},w=c.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":K={name:"RSA-OAEP",hash:`SHA-${parseInt(c.alg.slice(-3),10)||1}`},w=c.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new kc('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(c.alg){case"ES256":K={name:"ECDSA",namedCurve:"P-256"},w=c.d?["sign"]:["verify"];break;case"ES384":K={name:"ECDSA",namedCurve:"P-384"},w=c.d?["sign"]:["verify"];break;case"ES512":K={name:"ECDSA",namedCurve:"P-521"},w=c.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":K={name:"ECDH",namedCurve:c.crv},w=c.d?["deriveBits"]:[];break;default:throw new kc('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(c.alg){case"Ed25519":case"EdDSA":K={name:"Ed25519"},w=c.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":K={name:c.crv},w=c.d?["deriveBits"]:[];break;default:throw new kc('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new kc('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:K,keyUsages:w}}var Y8=async(c)=>{if(!c.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:K,keyUsages:w}=s0(c),P={...c};if(P.kty!=="AKP")delete P.alg;return delete P.use,crypto.subtle.importKey("jwk",P,K,c.ext??(c.d||c.priv?!1:!0),c.key_ops??w)};var H8=(c,K,w,P,S)=>{if(S.crit!==void 0&&P?.crit===void 0)throw new c('"crit" (Critical) Header Parameter MUST be integrity protected');if(!P||P.crit===void 0)return new Set;if(!Array.isArray(P.crit)||P.crit.length===0||P.crit.some((W)=>typeof W!=="string"||W.length===0))throw new c('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let h;if(w!==void 0)h=new Map([...Object.entries(w),...K.entries()]);else h=K;for(let W of P.crit){if(!h.has(W))throw new kc(`Extension Header Parameter "${W}" is not recognized`);if(S[W]===void 0)throw new c(`Extension Header Parameter "${W}" is missing`);if(h.get(W)&&P[W]===void 0)throw new c(`Extension Header Parameter "${W}" MUST be integrity protected`)}return new Set(P.crit)};function Z2(c){return J4(c)&&typeof c.kty==="string"}function V8(c){return c.kty!=="oct"&&(c.kty==="AKP"&&typeof c.priv==="string"||typeof c.d==="string")}function L8(c){return c.kty!=="oct"&&typeof c.d>"u"&&typeof c.priv>"u"}function q8(c){return c.kty==="oct"&&typeof c.k==="string"}var q2,v8=async(c,K,w,P=!1)=>{q2||=new WeakMap;let S=q2.get(c);if(S?.[w])return S[w];let h=await Y8({...K,alg:w});if(P)Object.freeze(c);if(!S)q2.set(c,{[w]:h});else S[w]=h;return h},c1=(c,K)=>{q2||=new WeakMap;let w=q2.get(c);if(w?.[K])return w[K];let P=c.type==="public",S=P?!0:!1,h;if(c.asymmetricKeyType==="x25519"){switch(K){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError("given KeyObject instance cannot be used for this algorithm")}h=c.toCryptoKey(c.asymmetricKeyType,S,P?[]:["deriveBits"])}if(c.asymmetricKeyType==="ed25519"){if(K!=="EdDSA"&&K!=="Ed25519")throw TypeError("given KeyObject instance cannot be used for this algorithm");h=c.toCryptoKey(c.asymmetricKeyType,S,[P?"verify":"sign"])}switch(c.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(K!==c.asymmetricKeyType.toUpperCase())throw TypeError("given KeyObject instance cannot be used for this algorithm");h=c.toCryptoKey(c.asymmetricKeyType,S,[P?"verify":"sign"])}}if(c.asymmetricKeyType==="rsa"){let W;switch(K){case"RSA-OAEP":W="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":W="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":W="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":W="SHA-512";break;default:throw TypeError("given KeyObject instance cannot be used for this algorithm")}if(K.startsWith("RSA-OAEP"))return c.toCryptoKey({name:"RSA-OAEP",hash:W},S,P?["encrypt"]:["decrypt"]);h=c.toCryptoKey({name:K.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:W},S,[P?"verify":"sign"])}if(c.asymmetricKeyType==="ec"){let M=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(c.asymmetricKeyDetails?.namedCurve);if(!M)throw TypeError("given KeyObject instance cannot be used for this algorithm");if(K==="ES256"&&M==="P-256")h=c.toCryptoKey({name:"ECDSA",namedCurve:M},S,[P?"verify":"sign"]);if(K==="ES384"&&M==="P-384")h=c.toCryptoKey({name:"ECDSA",namedCurve:M},S,[P?"verify":"sign"]);if(K==="ES512"&&M==="P-521")h=c.toCryptoKey({name:"ECDSA",namedCurve:M},S,[P?"verify":"sign"]);if(K.startsWith("ECDH-ES"))h=c.toCryptoKey({name:"ECDH",namedCurve:M},S,P?[]:["deriveBits"])}if(!h)throw TypeError("given KeyObject instance cannot be used for this algorithm");if(!w)q2.set(c,{[K]:h});else w[K]=h;return h},F8=async(c,K)=>{if(c instanceof Uint8Array)return c;if(P6(c))return c;if(S6(c)){if(c.type==="secret")return c.export();if("toCryptoKey"in c&&typeof c.toCryptoKey==="function")try{return c1(c,K)}catch(P){if(P instanceof TypeError)throw P}let w=c.export({format:"jwk"});return v8(c,w,K)}if(Z2(c)){if(c.k)return X8(c.k);return v8(c,c,K,!0)}throw Error("unreachable")};var v2=(c)=>c?.[Symbol.toStringTag],W6=(c,K,w)=>{if(K.use!==void 0){let P;switch(w){case"sign":case"verify":P="sig";break;case"encrypt":case"decrypt":P="enc";break}if(K.use!==P)throw TypeError(`Invalid key for this operation, its "use" must be "${P}" when present`)}if(K.alg!==void 0&&K.alg!==c)throw TypeError(`Invalid key for this operation, its "alg" must be "${c}" when present`);if(Array.isArray(K.key_ops)){let P;switch(!0){case(w==="sign"||w==="verify"):case c==="dir":case c.includes("CBC-HS"):P=w;break;case c.startsWith("PBES2"):P="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(c):if(!c.includes("GCM")&&c.endsWith("KW"))P=w==="encrypt"?"wrapKey":"unwrapKey";else P=w;break;case(w==="encrypt"&&c.startsWith("RSA")):P="wrapKey";break;case w==="decrypt":P=c.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(P&&K.key_ops?.includes?.(P)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${P}" when present`)}return!0},K1=(c,K,w)=>{if(K instanceof Uint8Array)return;if(Z2(K)){if(q8(K)&&W6(c,K,w))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!h6(K))throw TypeError(w6(c,K,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(K.type!=="secret")throw TypeError(`${v2(K)} instances for symmetric algorithms must be of type "secret"`)},w1=(c,K,w)=>{if(Z2(K))switch(w){case"decrypt":case"sign":if(V8(K)&&W6(c,K,w))return;throw TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(L8(K)&&W6(c,K,w))return;throw TypeError("JSON Web Key for this operation be a public JWK")}if(!h6(K))throw TypeError(w6(c,K,"CryptoKey","KeyObject","JSON Web Key"));if(K.type==="secret")throw TypeError(`${v2(K)} instances for asymmetric algorithms must not be of type "secret"`);if(K.type==="public")switch(w){case"sign":throw TypeError(`${v2(K)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${v2(K)} instances for asymmetric algorithm decryption must be of type "private"`);default:break}if(K.type==="private")switch(w){case"verify":throw TypeError(`${v2(K)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${v2(K)} instances for asymmetric algorithm encryption must be of type "public"`);default:break}},E8=(c,K,w)=>{if(c.startsWith("HS")||c==="dir"||c.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(c)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(c))K1(c,K,w);else w1(c,K,w)};var R8=(c,K)=>{let w=`SHA-${c.slice(-3)}`;switch(c){case"HS256":case"HS384":case"HS512":return{hash:w,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:w,name:"RSA-PSS",saltLength:parseInt(c.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:w,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:w,name:"ECDSA",namedCurve:K.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:c};default:throw new kc(`alg ${c} is not supported either by JOSE or your javascript runtime`)}};var g8=async(c,K,w)=>{if(K instanceof Uint8Array){if(!c.startsWith("HS"))throw TypeError($8(K,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",K,{hash:`SHA-${c.slice(-3)}`,name:"HMAC"},!1,[w])}return B8(K,c,w),K};var h2=(c)=>Math.floor(c.getTime()/1000);var P1=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,D4=(c)=>{let K=P1.exec(c);if(!K||K[4]&&K[1])throw TypeError("Invalid time period format");let w=parseFloat(K[2]),P=K[3].toLowerCase(),S;switch(P){case"sec":case"secs":case"second":case"seconds":case"s":S=Math.round(w);break;case"minute":case"minutes":case"min":case"mins":case"m":S=Math.round(w*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":S=Math.round(w*3600);break;case"day":case"days":case"d":S=Math.round(w*86400);break;case"week":case"weeks":case"w":S=Math.round(w*604800);break;default:S=Math.round(w*31557600);break}if(K[1]==="-"||K[4]==="ago")return-S;return S};function X2(c,K){if(!Number.isFinite(K))throw TypeError(`Invalid ${c} input`);return K}class M6{#c;constructor(c){if(!J4(c))throw TypeError("JWT Claims Set MUST be an object");this.#c=structuredClone(c)}data(){return Tc.encode(JSON.stringify(this.#c))}get iss(){return this.#c.iss}set iss(c){this.#c.iss=c}get sub(){return this.#c.sub}set sub(c){this.#c.sub=c}get aud(){return this.#c.aud}set aud(c){this.#c.aud=c}set jti(c){this.#c.jti=c}set nbf(c){if(typeof c==="number")this.#c.nbf=X2("setNotBefore",c);else if(c instanceof Date)this.#c.nbf=X2("setNotBefore",h2(c));else this.#c.nbf=h2(new Date)+D4(c)}set exp(c){if(typeof c==="number")this.#c.exp=X2("setExpirationTime",c);else if(c instanceof Date)this.#c.exp=X2("setExpirationTime",h2(c));else this.#c.exp=h2(new Date)+D4(c)}set iat(c){if(typeof c>"u")this.#c.iat=h2(new Date);else if(c instanceof Date)this.#c.iat=X2("setIssuedAt",h2(c));else if(typeof c==="string")this.#c.iat=X2("setIssuedAt",h2(new Date)+D4(c));else this.#c.iat=X2("setIssuedAt",c)}}var k8=async(c,K,w)=>{let P=await g8(c,K,"sign");U8(c,P);let S=await crypto.subtle.sign(R8(c,P.algorithm),P,w);return new Uint8Array(S)};class b6{#c;#K;#w;constructor(c){if(!(c instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#c=c}setProtectedHeader(c){if(this.#K)throw TypeError("setProtectedHeader can only be called once");return this.#K=c,this}setUnprotectedHeader(c){if(this.#w)throw TypeError("setUnprotectedHeader can only be called once");return this.#w=c,this}async sign(c,K){if(!this.#K&&!this.#w)throw new S2("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Q8(this.#K,this.#w))throw new S2("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let w={...this.#K,...this.#w},P=H8(S2,new Map([["b64",!0]]),K?.crit,this.#K,w),S=!0;if(P.has("b64")){if(S=this.#K.b64,typeof S!=="boolean")throw new S2('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}let{alg:h}=w;if(typeof h!=="string"||!h)throw new S2('JWS "alg" (Algorithm) Header Parameter missing or invalid');E8(h,c,"sign");let W=this.#c;if(S)W=Tc.encode(I4(W));let M;if(this.#K)M=Tc.encode(I4(JSON.stringify(this.#K)));else M=Tc.encode("");let J=N8(M,Tc.encode("."),W),O=await F8(c,h),G=await k8(h,O,J),V={signature:I4(G),payload:""};if(S)V.payload=V2.decode(W);if(this.#w)V.header=this.#w;if(this.#K)V.protected=V2.decode(M);return V}}class I6{#c;constructor(c){this.#c=new b6(c)}setProtectedHeader(c){return this.#c.setProtectedHeader(c),this}async sign(c,K){let w=await this.#c.sign(c,K);if(w.payload===void 0)throw TypeError("use the flattened module for creating JWS with b64: false");return`${w.protected}.${w.payload}.${w.signature}`}}class N4{#c;#K;constructor(c={}){this.#K=new M6(c)}setIssuer(c){return this.#K.iss=c,this}setSubject(c){return this.#K.sub=c,this}setAudience(c){return this.#K.aud=c,this}setJti(c){return this.#K.jti=c,this}setNotBefore(c){return this.#K.nbf=c,this}setExpirationTime(c){return this.#K.exp=c,this}setIssuedAt(c){return this.#K.iat=c,this}setProtectedHeader(c){return this.#c=c,this}async sign(c,K){let w=new I6(this.#K.data());if(w.setProtectedHeader(this.#c),Array.isArray(this.#c?.crit)&&this.#c.crit.includes("b64")&&this.#c.b64===!1)throw new c6("JWTs MUST NOT use unencoded payload");return w.sign(c,K)}}var JP=Object.freeze({status:"aborted"});function F(c,K,w){function P(M,J){var O;Object.defineProperty(M,"_zod",{value:M._zod??{},enumerable:!1}),(O=M._zod).traits??(O.traits=new Set),M._zod.traits.add(c),K(M,J);for(let G in W.prototype)if(!(G in M))Object.defineProperty(M,G,{value:W.prototype[G].bind(M)});M._zod.constr=W,M._zod.def=J}let S=w?.Parent??Object;class h extends S{}Object.defineProperty(h,"name",{value:c});function W(M){var J;let O=w?.Parent?new h:this;P(O,M),(J=O._zod).deferred??(J.deferred=[]);for(let G of O._zod.deferred)G();return O}return Object.defineProperty(W,"init",{value:P}),Object.defineProperty(W,Symbol.hasInstance,{value:(M)=>{if(w?.Parent&&M instanceof w.Parent)return!0;return M?._zod?.traits?.has(c)}}),Object.defineProperty(W,"name",{value:c}),W}var DP=Symbol("zod_brand");class ic extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class A2 extends Error{constructor(c){super(`Encountered unidirectional transform during encode: ${c}`);this.name="ZodEncodeError"}}var G4={};function nc(c){if(c)Object.assign(G4,c);return G4}var cc={};m4(cc,{unwrapMessage:()=>r2,uint8ArrayToHex:()=>E1,uint8ArrayToBase64url:()=>v1,uint8ArrayToBase64:()=>_8,stringifyPrimitive:()=>o8,shallowClone:()=>A8,safeExtend:()=>U1,required:()=>V1,randomString:()=>G1,propertyKeyTypes:()=>N6,promiseAllObject:()=>N1,primitiveTypes:()=>r8,prefixIssues:()=>C2,pick:()=>z1,partial:()=>H1,optionalKeys:()=>G6,omit:()=>$1,objectClone:()=>O1,numKeys:()=>j1,nullish:()=>m2,normalizeParams:()=>e,mergeDefs:()=>M2,merge:()=>Y1,jsonStringifyReplacer:()=>E2,joinValues:()=>I1,issue:()=>R2,isPlainObject:()=>B2,isObject:()=>F2,hexToUint8Array:()=>F1,getSizableOrigin:()=>C8,getParsedType:()=>X1,getLengthableOrigin:()=>y2,getEnumValues:()=>J6,getElementAtPath:()=>D1,floatSafeRemainder:()=>Z8,finalizeIssue:()=>Cc,extend:()=>Q1,escapeRegex:()=>z2,esc:()=>j4,defineLazy:()=>Kc,createTransparentProxy:()=>B1,cloneDef:()=>J1,clone:()=>xc,cleanRegex:()=>u2,cleanEnum:()=>L1,captureStackTrace:()=>X4,cached:()=>o2,base64urlToUint8Array:()=>q1,base64ToUint8Array:()=>y8,assignProp:()=>W2,assertNotEqual:()=>h1,assertNever:()=>M1,assertIs:()=>W1,assertEqual:()=>S1,assert:()=>b1,allowsEval:()=>D6,aborted:()=>b2,NUMBER_FORMAT_RANGES:()=>m8,Class:()=>f8,BIGINT_FORMAT_RANGES:()=>u8});function S1(c){return c}function h1(c){return c}function W1(c){}function M1(c){throw Error()}function b1(c){}function J6(c){let K=Object.values(c).filter((P)=>typeof P==="number");return Object.entries(c).filter(([P,S])=>K.indexOf(+P)===-1).map(([P,S])=>S)}function I1(c,K="|"){return c.map((w)=>o8(w)).join(K)}function E2(c,K){if(typeof K==="bigint")return K.toString();return K}function o2(c){return{get value(){{let w=c();return Object.defineProperty(this,"value",{value:w}),w}throw Error("cached value already set")}}}function m2(c){return c===null||c===void 0}function u2(c){let K=c.startsWith("^")?1:0,w=c.endsWith("$")?c.length-1:c.length;return c.slice(K,w)}function Z8(c,K){let w=(c.toString().split(".")[1]||"").length,P=K.toString(),S=(P.split(".")[1]||"").length;if(S===0&&/\d?e-\d?/.test(P)){let J=P.match(/\d?e-(\d?)/);if(J?.[1])S=Number.parseInt(J[1])}let h=w>S?w:S,W=Number.parseInt(c.toFixed(h).replace(".","")),M=Number.parseInt(K.toFixed(h).replace(".",""));return W%M/10**h}var x8=Symbol("evaluating");function Kc(c,K,w){let P=void 0;Object.defineProperty(c,K,{get(){if(P===x8)return;if(P===void 0)P=x8,P=w();return P},set(S){Object.defineProperty(c,K,{value:S})},configurable:!0})}function O1(c){return Object.create(Object.getPrototypeOf(c),Object.getOwnPropertyDescriptors(c))}function W2(c,K,w){Object.defineProperty(c,K,{value:w,writable:!0,enumerable:!0,configurable:!0})}function M2(...c){let K={};for(let w of c){let P=Object.getOwnPropertyDescriptors(w);Object.assign(K,P)}return Object.defineProperties({},K)}function J1(c){return M2(c._zod.def)}function D1(c,K){if(!K)return c;return K.reduce((w,P)=>w?.[P],c)}function N1(c){let K=Object.keys(c),w=K.map((P)=>c[P]);return Promise.all(w).then((P)=>{let S={};for(let h=0;h<K.length;h++)S[K[h]]=P[h];return S})}function G1(c=10){let w="";for(let P=0;P<c;P++)w+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return w}function j4(c){return JSON.stringify(c)}var X4="captureStackTrace"in Error?Error.captureStackTrace:(...c)=>{};function F2(c){return typeof c==="object"&&c!==null&&!Array.isArray(c)}var D6=o2(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(c){return!1}});function B2(c){if(F2(c)===!1)return!1;let K=c.constructor;if(K===void 0)return!0;let w=K.prototype;if(F2(w)===!1)return!1;if(Object.prototype.hasOwnProperty.call(w,"isPrototypeOf")===!1)return!1;return!0}function A8(c){if(B2(c))return{...c};if(Array.isArray(c))return[...c];return c}function j1(c){let K=0;for(let w in c)if(Object.prototype.hasOwnProperty.call(c,w))K++;return K}var X1=(c)=>{let K=typeof c;switch(K){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(c)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(c))return"array";if(c===null)return"null";if(c.then&&typeof c.then==="function"&&c.catch&&typeof c.catch==="function")return"promise";if(typeof Map<"u"&&c instanceof Map)return"map";if(typeof Set<"u"&&c instanceof Set)return"set";if(typeof Date<"u"&&c instanceof Date)return"date";if(typeof File<"u"&&c instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${K}`)}},N6=new Set(["string","number","symbol"]),r8=new Set(["string","number","bigint","boolean","symbol","undefined"]);function z2(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xc(c,K,w){let P=new c._zod.constr(K??c._zod.def);if(!K||w?.parent)P._zod.parent=c;return P}function e(c){let K=c;if(!K)return{};if(typeof K==="string")return{error:()=>K};if(K?.message!==void 0){if(K?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");K.error=K.message}if(delete K.message,typeof K.error==="string")return{...K,error:()=>K.error};return K}function B1(c){let K;return new Proxy({},{get(w,P,S){return K??(K=c()),Reflect.get(K,P,S)},set(w,P,S,h){return K??(K=c()),Reflect.set(K,P,S,h)},has(w,P){return K??(K=c()),Reflect.has(K,P)},deleteProperty(w,P){return K??(K=c()),Reflect.deleteProperty(K,P)},ownKeys(w){return K??(K=c()),Reflect.ownKeys(K)},getOwnPropertyDescriptor(w,P){return K??(K=c()),Reflect.getOwnPropertyDescriptor(K,P)},defineProperty(w,P,S){return K??(K=c()),Reflect.defineProperty(K,P,S)}})}function o8(c){if(typeof c==="bigint")return c.toString()+"n";if(typeof c==="string")return`"${c}"`;return`${c}`}function G6(c){return Object.keys(c).filter((K)=>{return c[K]._zod.optin==="optional"&&c[K]._zod.optout==="optional"})}var m8={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},u8={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function z1(c,K){let w=c._zod.def,P=M2(c._zod.def,{get shape(){let S={};for(let h in K){if(!(h in w.shape))throw Error(`Unrecognized key: "${h}"`);if(!K[h])continue;S[h]=w.shape[h]}return W2(this,"shape",S),S},checks:[]});return xc(c,P)}function $1(c,K){let w=c._zod.def,P=M2(c._zod.def,{get shape(){let S={...c._zod.def.shape};for(let h in K){if(!(h in w.shape))throw Error(`Unrecognized key: "${h}"`);if(!K[h])continue;delete S[h]}return W2(this,"shape",S),S},checks:[]});return xc(c,P)}function Q1(c,K){if(!B2(K))throw Error("Invalid input to extend: expected a plain object");let w=c._zod.def.checks;if(w&&w.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let S=M2(c._zod.def,{get shape(){let h={...c._zod.def.shape,...K};return W2(this,"shape",h),h},checks:[]});return xc(c,S)}function U1(c,K){if(!B2(K))throw Error("Invalid input to safeExtend: expected a plain object");let w={...c._zod.def,get shape(){let P={...c._zod.def.shape,...K};return W2(this,"shape",P),P},checks:c._zod.def.checks};return xc(c,w)}function Y1(c,K){let w=M2(c._zod.def,{get shape(){let P={...c._zod.def.shape,...K._zod.def.shape};return W2(this,"shape",P),P},get catchall(){return K._zod.def.catchall},checks:[]});return xc(c,w)}function H1(c,K,w){let P=M2(K._zod.def,{get shape(){let S=K._zod.def.shape,h={...S};if(w)for(let W in w){if(!(W in S))throw Error(`Unrecognized key: "${W}"`);if(!w[W])continue;h[W]=c?new c({type:"optional",innerType:S[W]}):S[W]}else for(let W in S)h[W]=c?new c({type:"optional",innerType:S[W]}):S[W];return W2(this,"shape",h),h},checks:[]});return xc(K,P)}function V1(c,K,w){let P=M2(K._zod.def,{get shape(){let S=K._zod.def.shape,h={...S};if(w)for(let W in w){if(!(W in h))throw Error(`Unrecognized key: "${W}"`);if(!w[W])continue;h[W]=new c({type:"nonoptional",innerType:S[W]})}else for(let W in S)h[W]=new c({type:"nonoptional",innerType:S[W]});return W2(this,"shape",h),h},checks:[]});return xc(K,P)}function b2(c,K=0){if(c.aborted===!0)return!0;for(let w=K;w<c.issues.length;w++)if(c.issues[w]?.continue!==!0)return!0;return!1}function C2(c,K){return K.map((w)=>{var P;return(P=w).path??(P.path=[]),w.path.unshift(c),w})}function r2(c){return typeof c==="string"?c:c?.message}function Cc(c,K,w){let P={...c,path:c.path??[]};if(!c.message){let S=r2(c.inst?._zod.def?.error?.(c))??r2(K?.error?.(c))??r2(w.customError?.(c))??r2(w.localeError?.(c))??"Invalid input";P.message=S}if(delete P.inst,delete P.continue,!K?.reportInput)delete P.input;return P}function C8(c){if(c instanceof Set)return"set";if(c instanceof Map)return"map";if(c instanceof File)return"file";return"unknown"}function y2(c){if(Array.isArray(c))return"array";if(typeof c==="string")return"string";return"unknown"}function R2(...c){let[K,w,P]=c;if(typeof K==="string")return{message:K,code:"custom",input:w,inst:P};return{...K}}function L1(c){return Object.entries(c).filter(([K,w])=>{return Number.isNaN(Number.parseInt(K,10))}).map((K)=>K[1])}function y8(c){let K=atob(c),w=new Uint8Array(K.length);for(let P=0;P<K.length;P++)w[P]=K.charCodeAt(P);return w}function _8(c){let K="";for(let w=0;w<c.length;w++)K+=String.fromCharCode(c[w]);return btoa(K)}function q1(c){let K=c.replace(/-/g,"+").replace(/_/g,"/"),w="=".repeat((4-K.length%4)%4);return y8(K+w)}function v1(c){return _8(c).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function F1(c){let K=c.replace(/^0x/,"");if(K.length%2!==0)throw Error("Invalid hex string length");let w=new Uint8Array(K.length/2);for(let P=0;P<K.length;P+=2)w[P/2]=Number.parseInt(K.slice(P,P+2),16);return w}function E1(c){return Array.from(c).map((K)=>K.toString(16).padStart(2,"0")).join("")}class f8{constructor(...c){}}var e8=(c,K)=>{c.name="$ZodError",Object.defineProperty(c,"_zod",{value:c._zod,enumerable:!1}),Object.defineProperty(c,"issues",{value:K,enumerable:!1}),c.message=JSON.stringify(K,E2,2),Object.defineProperty(c,"toString",{value:()=>c.message,enumerable:!1})},B4=F("$ZodError",e8),j6=F("$ZodError",e8,{Parent:Error});function l8(c,K=(w)=>w.message){let w={},P=[];for(let S of c.issues)if(S.path.length>0)w[S.path[0]]=w[S.path[0]]||[],w[S.path[0]].push(K(S));else P.push(K(S));return{formErrors:P,fieldErrors:w}}function p8(c,K=(w)=>w.message){let w={_errors:[]},P=(S)=>{for(let h of S.issues)if(h.code==="invalid_union"&&h.errors.length)h.errors.map((W)=>P({issues:W}));else if(h.code==="invalid_key")P({issues:h.issues});else if(h.code==="invalid_element")P({issues:h.issues});else if(h.path.length===0)w._errors.push(K(h));else{let W=w,M=0;while(M<h.path.length){let J=h.path[M];if(M!==h.path.length-1)W[J]=W[J]||{_errors:[]};else W[J]=W[J]||{_errors:[]},W[J]._errors.push(K(h));W=W[J],M++}}};return P(c),w}var z4=(c)=>(K,w,P,S)=>{let h=P?Object.assign(P,{async:!1}):{async:!1},W=K._zod.run({value:w,issues:[]},h);if(W instanceof Promise)throw new ic;if(W.issues.length){let M=new(S?.Err??c)(W.issues.map((J)=>Cc(J,h,nc())));throw X4(M,S?.callee),M}return W.value};var $4=(c)=>async(K,w,P,S)=>{let h=P?Object.assign(P,{async:!0}):{async:!0},W=K._zod.run({value:w,issues:[]},h);if(W instanceof Promise)W=await W;if(W.issues.length){let M=new(S?.Err??c)(W.issues.map((J)=>Cc(J,h,nc())));throw X4(M,S?.callee),M}return W.value};var _2=(c)=>(K,w,P)=>{let S=P?{...P,async:!1}:{async:!1},h=K._zod.run({value:w,issues:[]},S);if(h instanceof Promise)throw new ic;return h.issues.length?{success:!1,error:new(c??B4)(h.issues.map((W)=>Cc(W,S,nc())))}:{success:!0,data:h.value}},T8=_2(j6),f2=(c)=>async(K,w,P)=>{let S=P?Object.assign(P,{async:!0}):{async:!0},h=K._zod.run({value:w,issues:[]},S);if(h instanceof Promise)h=await h;return h.issues.length?{success:!1,error:new c(h.issues.map((W)=>Cc(W,S,nc())))}:{success:!0,data:h.value}},i8=f2(j6),n8=(c)=>(K,w,P)=>{let S=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return z4(c)(K,w,S)};var t8=(c)=>(K,w,P)=>{return z4(c)(K,w,P)};var d8=(c)=>async(K,w,P)=>{let S=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return $4(c)(K,w,S)};var s8=(c)=>async(K,w,P)=>{return $4(c)(K,w,P)};var a8=(c)=>(K,w,P)=>{let S=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return _2(c)(K,w,S)};var c5=(c)=>(K,w,P)=>{return _2(c)(K,w,P)};var K5=(c)=>async(K,w,P)=>{let S=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return f2(c)(K,w,S)};var w5=(c)=>async(K,w,P)=>{return f2(c)(K,w,P)};var P5=/^[cC][^\s-]{8,}$/,S5=/^[0-9a-z]+$/,h5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,W5=/^[0-9a-vA-V]{20}$/,M5=/^[A-Za-z0-9]{27}$/,b5=/^[a-zA-Z0-9_-]{21}$/,I5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var O5=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,X6=(c)=>{if(!c)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${c}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var J5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function D5(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var N5=/^(?:(?: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])$/,G5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,j5=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,X5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,B5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,B6=/^[A-Za-z0-9_-]*$/,z5=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;var $5=/^\+(?:[0-9]){6,14}[0-9]$/,Q5="(?:(?:\\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])))",U5=new RegExp(`^${Q5}$`);function Y5(c){return typeof c.precision==="number"?c.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":c.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${c.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function H5(c){return new RegExp(`^${Y5(c)}$`)}function V5(c){let K=Y5({precision:c.precision}),w=["Z"];if(c.local)w.push("");if(c.offset)w.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let P=`${K}(?:${w.join("|")})`;return new RegExp(`^${Q5}T(?:${P})$`)}var L5=(c)=>{let K=c?`[\\s\\S]{${c?.minimum??0},${c?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${K}$`)};var q5=/^[^A-Z]*$/,v5=/^[^a-z]*$/;var Vc=F("$ZodCheck",(c,K)=>{var w;c._zod??(c._zod={}),c._zod.def=K,(w=c._zod).onattach??(w.onattach=[])});var F5=F("$ZodCheckMaxLength",(c,K)=>{var w;Vc.init(c,K),(w=c._zod.def).when??(w.when=(P)=>{let S=P.value;return!m2(S)&&S.length!==void 0}),c._zod.onattach.push((P)=>{let S=P._zod.bag.maximum??Number.POSITIVE_INFINITY;if(K.maximum<S)P._zod.bag.maximum=K.maximum}),c._zod.check=(P)=>{let S=P.value;if(S.length<=K.maximum)return;let W=y2(S);P.issues.push({origin:W,code:"too_big",maximum:K.maximum,inclusive:!0,input:S,inst:c,continue:!K.abort})}}),E5=F("$ZodCheckMinLength",(c,K)=>{var w;Vc.init(c,K),(w=c._zod.def).when??(w.when=(P)=>{let S=P.value;return!m2(S)&&S.length!==void 0}),c._zod.onattach.push((P)=>{let S=P._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(K.minimum>S)P._zod.bag.minimum=K.minimum}),c._zod.check=(P)=>{let S=P.value;if(S.length>=K.minimum)return;let W=y2(S);P.issues.push({origin:W,code:"too_small",minimum:K.minimum,inclusive:!0,input:S,inst:c,continue:!K.abort})}}),R5=F("$ZodCheckLengthEquals",(c,K)=>{var w;Vc.init(c,K),(w=c._zod.def).when??(w.when=(P)=>{let S=P.value;return!m2(S)&&S.length!==void 0}),c._zod.onattach.push((P)=>{let S=P._zod.bag;S.minimum=K.length,S.maximum=K.length,S.length=K.length}),c._zod.check=(P)=>{let S=P.value,h=S.length;if(h===K.length)return;let W=y2(S),M=h>K.length;P.issues.push({origin:W,...M?{code:"too_big",maximum:K.length}:{code:"too_small",minimum:K.length},inclusive:!0,exact:!0,input:P.value,inst:c,continue:!K.abort})}}),e2=F("$ZodCheckStringFormat",(c,K)=>{var w,P;if(Vc.init(c,K),c._zod.onattach.push((S)=>{let h=S._zod.bag;if(h.format=K.format,K.pattern)h.patterns??(h.patterns=new Set),h.patterns.add(K.pattern)}),K.pattern)(w=c._zod).check??(w.check=(S)=>{if(K.pattern.lastIndex=0,K.pattern.test(S.value))return;S.issues.push({origin:"string",code:"invalid_format",format:K.format,input:S.value,...K.pattern?{pattern:K.pattern.toString()}:{},inst:c,continue:!K.abort})});else(P=c._zod).check??(P.check=()=>{})}),g5=F("$ZodCheckRegex",(c,K)=>{e2.init(c,K),c._zod.check=(w)=>{if(K.pattern.lastIndex=0,K.pattern.test(w.value))return;w.issues.push({origin:"string",code:"invalid_format",format:"regex",input:w.value,pattern:K.pattern.toString(),inst:c,continue:!K.abort})}}),k5=F("$ZodCheckLowerCase",(c,K)=>{K.pattern??(K.pattern=q5),e2.init(c,K)}),x5=F("$ZodCheckUpperCase",(c,K)=>{K.pattern??(K.pattern=v5),e2.init(c,K)}),Z5=F("$ZodCheckIncludes",(c,K)=>{Vc.init(c,K);let w=z2(K.includes),P=new RegExp(typeof K.position==="number"?`^.{${K.position}}${w}`:w);K.pattern=P,c._zod.onattach.push((S)=>{let h=S._zod.bag;h.patterns??(h.patterns=new Set),h.patterns.add(P)}),c._zod.check=(S)=>{if(S.value.includes(K.includes,K.position))return;S.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:K.includes,input:S.value,inst:c,continue:!K.abort})}}),A5=F("$ZodCheckStartsWith",(c,K)=>{Vc.init(c,K);let w=new RegExp(`^${z2(K.prefix)}.*`);K.pattern??(K.pattern=w),c._zod.onattach.push((P)=>{let S=P._zod.bag;S.patterns??(S.patterns=new Set),S.patterns.add(w)}),c._zod.check=(P)=>{if(P.value.startsWith(K.prefix))return;P.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:K.prefix,input:P.value,inst:c,continue:!K.abort})}}),r5=F("$ZodCheckEndsWith",(c,K)=>{Vc.init(c,K);let w=new RegExp(`.*${z2(K.suffix)}$`);K.pattern??(K.pattern=w),c._zod.onattach.push((P)=>{let S=P._zod.bag;S.patterns??(S.patterns=new Set),S.patterns.add(w)}),c._zod.check=(P)=>{if(P.value.endsWith(K.suffix))return;P.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:K.suffix,input:P.value,inst:c,continue:!K.abort})}});var o5=F("$ZodCheckOverwrite",(c,K)=>{Vc.init(c,K),c._zod.check=(w)=>{w.value=K.tx(w.value)}});class z6{constructor(c=[]){if(this.content=[],this.indent=0,this)this.args=c}indented(c){this.indent+=1,c(this),this.indent-=1}write(c){if(typeof c==="function"){c(this,{execution:"sync"}),c(this,{execution:"async"});return}let w=c.split(`
19
- `).filter((h)=>h),P=Math.min(...w.map((h)=>h.length-h.trimStart().length)),S=w.map((h)=>h.slice(P)).map((h)=>" ".repeat(this.indent*2)+h);for(let h of S)this.content.push(h)}compile(){let c=Function,K=this?.args,P=[...(this?.content??[""]).map((S)=>` ${S}`)];return new c(...K,P.join(`
20
- `))}}var u5={major:4,minor:1,patch:12};var Oc=F("$ZodType",(c,K)=>{var w;c??(c={}),c._zod.def=K,c._zod.bag=c._zod.bag||{},c._zod.version=u5;let P=[...c._zod.def.checks??[]];if(c._zod.traits.has("$ZodCheck"))P.unshift(c);for(let S of P)for(let h of S._zod.onattach)h(c);if(P.length===0)(w=c._zod).deferred??(w.deferred=[]),c._zod.deferred?.push(()=>{c._zod.run=c._zod.parse});else{let S=(W,M,J)=>{let O=b2(W),G;for(let V of M){if(V._zod.def.when){if(!V._zod.def.when(W))continue}else if(O)continue;let z=W.issues.length,L=V._zod.check(W);if(L instanceof Promise&&J?.async===!1)throw new ic;if(G||L instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await L,W.issues.length===z)return;if(!O)O=b2(W,z)});else{if(W.issues.length===z)continue;if(!O)O=b2(W,z)}}if(G)return G.then(()=>{return W});return W},h=(W,M,J)=>{if(b2(W))return W.aborted=!0,W;let O=S(M,P,J);if(O instanceof Promise){if(J.async===!1)throw new ic;return O.then((G)=>c._zod.parse(G,J))}return c._zod.parse(O,J)};c._zod.run=(W,M)=>{if(M.skipChecks)return c._zod.parse(W,M);if(M.direction==="backward"){let O=c._zod.parse({value:W.value,issues:[]},{...M,skipChecks:!0});if(O instanceof Promise)return O.then((G)=>{return h(G,W,M)});return h(O,W,M)}let J=c._zod.parse(W,M);if(J instanceof Promise){if(M.async===!1)throw new ic;return J.then((O)=>S(O,P,M))}return S(J,P,M)}}c["~standard"]={validate:(S)=>{try{let h=T8(c,S);return h.success?{value:h.data}:{issues:h.error?.issues}}catch(h){return i8(c,S).then((W)=>W.success?{value:W.data}:{issues:W.error?.issues})}},vendor:"zod",version:1}}),H4=F("$ZodString",(c,K)=>{Oc.init(c,K),c._zod.pattern=[...c?._zod.bag?.patterns??[]].pop()??L5(c._zod.bag),c._zod.parse=(w,P)=>{if(K.coerce)try{w.value=String(w.value)}catch(S){}if(typeof w.value==="string")return w;return w.issues.push({expected:"string",code:"invalid_type",input:w.value,inst:c}),w}}),Sc=F("$ZodStringFormat",(c,K)=>{e2.init(c,K),H4.init(c,K)}),i5=F("$ZodGUID",(c,K)=>{K.pattern??(K.pattern=O5),Sc.init(c,K)}),n5=F("$ZodUUID",(c,K)=>{if(K.version){let P={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[K.version];if(P===void 0)throw Error(`Invalid UUID version: "${K.version}"`);K.pattern??(K.pattern=X6(P))}else K.pattern??(K.pattern=X6());Sc.init(c,K)}),t5=F("$ZodEmail",(c,K)=>{K.pattern??(K.pattern=J5),Sc.init(c,K)}),d5=F("$ZodURL",(c,K)=>{Sc.init(c,K),c._zod.check=(w)=>{try{let P=w.value.trim(),S=new URL(P);if(K.hostname){if(K.hostname.lastIndex=0,!K.hostname.test(S.hostname))w.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:z5.source,input:w.value,inst:c,continue:!K.abort})}if(K.protocol){if(K.protocol.lastIndex=0,!K.protocol.test(S.protocol.endsWith(":")?S.protocol.slice(0,-1):S.protocol))w.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:K.protocol.source,input:w.value,inst:c,continue:!K.abort})}if(K.normalize)w.value=S.href;else w.value=P;return}catch(P){w.issues.push({code:"invalid_format",format:"url",input:w.value,inst:c,continue:!K.abort})}}}),s5=F("$ZodEmoji",(c,K)=>{K.pattern??(K.pattern=D5()),Sc.init(c,K)}),a5=F("$ZodNanoID",(c,K)=>{K.pattern??(K.pattern=b5),Sc.init(c,K)}),c3=F("$ZodCUID",(c,K)=>{K.pattern??(K.pattern=P5),Sc.init(c,K)}),K3=F("$ZodCUID2",(c,K)=>{K.pattern??(K.pattern=S5),Sc.init(c,K)}),w3=F("$ZodULID",(c,K)=>{K.pattern??(K.pattern=h5),Sc.init(c,K)}),P3=F("$ZodXID",(c,K)=>{K.pattern??(K.pattern=W5),Sc.init(c,K)}),S3=F("$ZodKSUID",(c,K)=>{K.pattern??(K.pattern=M5),Sc.init(c,K)}),h3=F("$ZodISODateTime",(c,K)=>{K.pattern??(K.pattern=V5(K)),Sc.init(c,K)}),W3=F("$ZodISODate",(c,K)=>{K.pattern??(K.pattern=U5),Sc.init(c,K)}),M3=F("$ZodISOTime",(c,K)=>{K.pattern??(K.pattern=H5(K)),Sc.init(c,K)}),b3=F("$ZodISODuration",(c,K)=>{K.pattern??(K.pattern=I5),Sc.init(c,K)}),I3=F("$ZodIPv4",(c,K)=>{K.pattern??(K.pattern=N5),Sc.init(c,K),c._zod.onattach.push((w)=>{let P=w._zod.bag;P.format="ipv4"})}),O3=F("$ZodIPv6",(c,K)=>{K.pattern??(K.pattern=G5),Sc.init(c,K),c._zod.onattach.push((w)=>{let P=w._zod.bag;P.format="ipv6"}),c._zod.check=(w)=>{try{new URL(`http://[${w.value}]`)}catch{w.issues.push({code:"invalid_format",format:"ipv6",input:w.value,inst:c,continue:!K.abort})}}}),J3=F("$ZodCIDRv4",(c,K)=>{K.pattern??(K.pattern=j5),Sc.init(c,K)}),D3=F("$ZodCIDRv6",(c,K)=>{K.pattern??(K.pattern=X5),Sc.init(c,K),c._zod.check=(w)=>{let P=w.value.split("/");try{if(P.length!==2)throw Error();let[S,h]=P;if(!h)throw Error();let W=Number(h);if(`${W}`!==h)throw Error();if(W<0||W>128)throw Error();new URL(`http://[${S}]`)}catch{w.issues.push({code:"invalid_format",format:"cidrv6",input:w.value,inst:c,continue:!K.abort})}}});function N3(c){if(c==="")return!0;if(c.length%4!==0)return!1;try{return atob(c),!0}catch{return!1}}var G3=F("$ZodBase64",(c,K)=>{K.pattern??(K.pattern=B5),Sc.init(c,K),c._zod.onattach.push((w)=>{w._zod.bag.contentEncoding="base64"}),c._zod.check=(w)=>{if(N3(w.value))return;w.issues.push({code:"invalid_format",format:"base64",input:w.value,inst:c,continue:!K.abort})}});function g1(c){if(!B6.test(c))return!1;let K=c.replace(/[-_]/g,(P)=>P==="-"?"+":"/"),w=K.padEnd(Math.ceil(K.length/4)*4,"=");return N3(w)}var j3=F("$ZodBase64URL",(c,K)=>{K.pattern??(K.pattern=B6),Sc.init(c,K),c._zod.onattach.push((w)=>{w._zod.bag.contentEncoding="base64url"}),c._zod.check=(w)=>{if(g1(w.value))return;w.issues.push({code:"invalid_format",format:"base64url",input:w.value,inst:c,continue:!K.abort})}}),X3=F("$ZodE164",(c,K)=>{K.pattern??(K.pattern=$5),Sc.init(c,K)});function k1(c,K=null){try{let w=c.split(".");if(w.length!==3)return!1;let[P]=w;if(!P)return!1;let S=JSON.parse(atob(P));if("typ"in S&&S?.typ!=="JWT")return!1;if(!S.alg)return!1;if(K&&(!("alg"in S)||S.alg!==K))return!1;return!0}catch{return!1}}var B3=F("$ZodJWT",(c,K)=>{Sc.init(c,K),c._zod.check=(w)=>{if(k1(w.value,K.alg))return;w.issues.push({code:"invalid_format",format:"jwt",input:w.value,inst:c,continue:!K.abort})}});var z3=F("$ZodUnknown",(c,K)=>{Oc.init(c,K),c._zod.parse=(w)=>w}),$3=F("$ZodNever",(c,K)=>{Oc.init(c,K),c._zod.parse=(w,P)=>{return w.issues.push({expected:"never",code:"invalid_type",input:w.value,inst:c}),w}});function C5(c,K,w){if(c.issues.length)K.issues.push(...C2(w,c.issues));K.value[w]=c.value}var Q3=F("$ZodArray",(c,K)=>{Oc.init(c,K),c._zod.parse=(w,P)=>{let S=w.value;if(!Array.isArray(S))return w.issues.push({expected:"array",code:"invalid_type",input:S,inst:c}),w;w.value=Array(S.length);let h=[];for(let W=0;W<S.length;W++){let M=S[W],J=K.element._zod.run({value:M,issues:[]},P);if(J instanceof Promise)h.push(J.then((O)=>C5(O,w,W)));else C5(J,w,W)}if(h.length)return Promise.all(h).then(()=>w);return w}});function Y4(c,K,w,P){if(c.issues.length)K.issues.push(...C2(w,c.issues));if(c.value===void 0){if(w in P)K.value[w]=void 0}else K.value[w]=c.value}function U3(c){let K=Object.keys(c.shape);for(let P of K)if(!c.shape?.[P]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${P}": expected a Zod schema`);let w=G6(c.shape);return{...c,keys:K,keySet:new Set(K),numKeys:K.length,optionalKeys:new Set(w)}}function Y3(c,K,w,P,S,h){let W=[],M=S.keySet,J=S.catchall._zod,O=J.def.type;for(let G of Object.keys(K)){if(M.has(G))continue;if(O==="never"){W.push(G);continue}let V=J.run({value:K[G],issues:[]},P);if(V instanceof Promise)c.push(V.then((z)=>Y4(z,w,G,K)));else Y4(V,w,G,K)}if(W.length)w.issues.push({code:"unrecognized_keys",keys:W,input:K,inst:h});if(!c.length)return w;return Promise.all(c).then(()=>{return w})}var x1=F("$ZodObject",(c,K)=>{if(Oc.init(c,K),!Object.getOwnPropertyDescriptor(K,"shape")?.get){let M=K.shape;Object.defineProperty(K,"shape",{get:()=>{let J={...M};return Object.defineProperty(K,"shape",{value:J}),J}})}let P=o2(()=>U3(K));Kc(c._zod,"propValues",()=>{let M=K.shape,J={};for(let O in M){let G=M[O]._zod;if(G.values){J[O]??(J[O]=new Set);for(let V of G.values)J[O].add(V)}}return J});let S=F2,h=K.catchall,W;c._zod.parse=(M,J)=>{W??(W=P.value);let O=M.value;if(!S(O))return M.issues.push({expected:"object",code:"invalid_type",input:O,inst:c}),M;M.value={};let G=[],V=W.shape;for(let z of W.keys){let I=V[z]._zod.run({value:O[z],issues:[]},J);if(I instanceof Promise)G.push(I.then(($)=>Y4($,M,z,O)));else Y4(I,M,z,O)}if(!h)return G.length?Promise.all(G).then(()=>M):M;return Y3(G,O,M,J,P.value,c)}}),H3=F("$ZodObjectJIT",(c,K)=>{x1.init(c,K);let w=c._zod.parse,P=o2(()=>U3(K)),S=(z)=>{let L=new z6(["shape","payload","ctx"]),I=P.value,$=(B)=>{let D=j4(B);return`shape[${D}]._zod.run({ value: input[${D}], issues: [] }, ctx)`};L.write("const input = payload.value;");let q=Object.create(null),b=0;for(let B of I.keys)q[B]=`key_${b++}`;L.write("const newResult = {};");for(let B of I.keys){let D=q[B],H=j4(B);L.write(`const ${D} = ${$(B)};`),L.write(`
21
- if (${D}.issues.length) {
22
- payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
15
+ ***************************************************************************** */var K;(function(w){(function(W){var S=typeof globalThis==="object"?globalThis:typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:O(),M=b(w);if(typeof S.Reflect<"u")M=b(S.Reflect,M);if(W(M,S),typeof S.Reflect>"u")S.Reflect=w;function b(N,G){return function(H,Q){if(Object.defineProperty(N,H,{configurable:!0,writable:!0,value:Q}),G)G(H,Q)}}function P(){try{return Function("return this;")()}catch(N){}}function J(){try{return(0,eval)("(function() { return this; })()")}catch(N){}}function O(){return P()||J()}})(function(W,S){var M=Object.prototype.hasOwnProperty,b=typeof Symbol==="function",P=b&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",J=b&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",O=typeof Object.create==="function",N={__proto__:[]}instanceof Array,G=!O&&!N,H={create:O?function(){return T2(Object.create(null))}:N?function(){return T2({__proto__:null})}:function(){return T2({})},has:G?function(z,L){return M.call(z,L)}:function(z,L){return L in z},get:G?function(z,L){return M.call(z,L)?z[L]:void 0}:function(z,L){return z[L]}},Q=Object.getPrototypeOf(Function),F=typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:c6(),D=typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:e4(),Y=typeof WeakMap==="function"?WeakMap:C6(),E=b?Symbol.for("@reflect-metadata:registry"):void 0,I=a2(),q=s2(I);function U(z,L,v,c){if(!_(v)){if(!a(z))throw TypeError();if(!t(L))throw TypeError();if(!t(c)&&!_(c)&&!H2(c))throw TypeError();if(H2(c))c=void 0;return v=p(v),s(z,L,v,c)}else{if(!a(z))throw TypeError();if(!b2(L))throw TypeError();return r(z,L)}}W("decorate",U);function B(z,L){function v(c,o){if(!t(c))throw TypeError();if(!_(o)&&!D2(o))throw TypeError();j2(z,L,c,o)}return v}W("metadata",B);function h(z,L,v,c){if(!t(v))throw TypeError();if(!_(c))c=p(c);return j2(z,L,v,c)}W("defineMetadata",h);function u(z,L,v){if(!t(L))throw TypeError();if(!_(v))v=p(v);return O2(z,L,v)}W("hasMetadata",u);function V(z,L,v){if(!t(L))throw TypeError();if(!_(v))v=p(v);return W2(z,L,v)}W("hasOwnMetadata",V);function x(z,L,v){if(!t(L))throw TypeError();if(!_(v))v=p(v);return X2(z,L,v)}W("getMetadata",x);function g(z,L,v){if(!t(L))throw TypeError();if(!_(v))v=p(v);return R2(z,L,v)}W("getOwnMetadata",g);function C(z,L){if(!t(z))throw TypeError();if(!_(L))L=p(L);return l(z,L)}W("getMetadataKeys",C);function y(z,L){if(!t(z))throw TypeError();if(!_(L))L=p(L);return Q2(z,L)}W("getOwnMetadataKeys",y);function e(z,L,v){if(!t(L))throw TypeError();if(!_(v))v=p(v);if(!t(L))throw TypeError();if(!_(v))v=p(v);var c=I4(L,v,!1);if(_(c))return!1;return c.OrdinaryDeleteMetadata(z,L,v)}W("deleteMetadata",e);function r(z,L){for(var v=z.length-1;v>=0;--v){var c=z[v],o=c(L);if(!_(o)&&!H2(o)){if(!b2(o))throw TypeError();L=o}}return L}function s(z,L,v,c){for(var o=z.length-1;o>=0;--o){var S2=z[o],$=S2(L,v,c);if(!_($)&&!H2($)){if(!t($))throw TypeError();c=$}}return c}function O2(z,L,v){var c=W2(z,L,v);if(c)return!0;var o=Y2(L);if(!H2(o))return O2(z,o,v);return!1}function W2(z,L,v){var c=I4(L,v,!1);if(_(c))return!1;return Z2(c.OrdinaryHasOwnMetadata(z,L,v))}function X2(z,L,v){var c=W2(z,L,v);if(c)return R2(z,L,v);var o=Y2(L);if(!H2(o))return X2(z,o,v);return}function R2(z,L,v){var c=I4(L,v,!1);if(_(c))return;return c.OrdinaryGetOwnMetadata(z,L,v)}function j2(z,L,v,c){var o=I4(v,c,!0);o.OrdinaryDefineOwnMetadata(z,L,v,c)}function l(z,L){var v=Q2(z,L),c=Y2(z);if(c===null)return v;var o=l(c,L);if(o.length<=0)return v;if(v.length<=0)return o;var S2=new D,$=[];for(var X=0,j=v;X<j.length;X++){var Z=j[X],A=S2.has(Z);if(!A)S2.add(Z),$.push(Z)}for(var k=0,f=o;k<f.length;k++){var Z=f[k],A=S2.has(Z);if(!A)S2.add(Z),$.push(Z)}return $}function Q2(z,L){var v=I4(z,L,!1);if(!v)return[];return v.OrdinaryOwnMetadataKeys(z,L)}function k2(z){if(z===null)return 1;switch(typeof z){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return z===null?1:6;default:return 6}}function _(z){return z===void 0}function H2(z){return z===null}function x2(z){return typeof z==="symbol"}function t(z){return typeof z==="object"?z!==null:typeof z==="function"}function g2(z,L){switch(k2(z)){case 0:return z;case 1:return z;case 2:return z;case 3:return z;case 4:return z;case 5:return z}var v=L===3?"string":L===5?"number":"default",c=J2(z,P);if(c!==void 0){var o=c.call(z,v);if(t(o))throw TypeError();return o}return q2(z,v==="default"?"number":v)}function q2(z,L){if(L==="string"){var v=z.toString;if(i(v)){var c=v.call(z);if(!t(c))return c}var o=z.valueOf;if(i(o)){var c=o.call(z);if(!t(c))return c}}else{var o=z.valueOf;if(i(o)){var c=o.call(z);if(!t(c))return c}var S2=z.toString;if(i(S2)){var c=S2.call(z);if(!t(c))return c}}throw TypeError()}function Z2(z){return!!z}function u2(z){return""+z}function p(z){var L=g2(z,3);if(x2(L))return L;return u2(L)}function a(z){return Array.isArray?Array.isArray(z):z instanceof Object?z instanceof Array:Object.prototype.toString.call(z)==="[object Array]"}function i(z){return typeof z==="function"}function b2(z){return typeof z==="function"}function D2(z){switch(k2(z)){case 3:return!0;case 4:return!0;default:return!1}}function $2(z,L){return z===L||z!==z&&L!==L}function J2(z,L){var v=z[L];if(v===void 0||v===null)return;if(!i(v))throw TypeError();return v}function f2(z){var L=J2(z,J);if(!i(L))throw TypeError();var v=L.call(z);if(!t(v))throw TypeError();return v}function z2(z){return z.value}function U2(z){var L=z.next();return L.done?!1:L}function o2(z){var L=z.return;if(L)L.call(z)}function Y2(z){var L=Object.getPrototypeOf(z);if(typeof z!=="function"||z===Q)return L;if(L!==Q)return L;var v=z.prototype,c=v&&Object.getPrototypeOf(v);if(c==null||c===Object.prototype)return L;var o=c.constructor;if(typeof o!=="function")return L;if(o===z)return L;return o}function t2(){var z;if(!_(E)&&typeof S.Reflect<"u"&&!(E in S.Reflect)&&typeof S.Reflect.defineMetadata==="function")z=A6(S.Reflect);var L,v,c,o=new Y,S2={registerProvider:$,getProvider:j,setProvider:A};return S2;function $(k){if(!Object.isExtensible(S2))throw Error("Cannot add provider to a frozen registry.");switch(!0){case z===k:break;case _(L):L=k;break;case L===k:break;case _(v):v=k;break;case v===k:break;default:if(c===void 0)c=new D;c.add(k);break}}function X(k,f){if(!_(L)){if(L.isProviderFor(k,f))return L;if(!_(v)){if(v.isProviderFor(k,f))return L;if(!_(c)){var n=f2(c);while(!0){var d=U2(n);if(!d)return;var N2=z2(d);if(N2.isProviderFor(k,f))return o2(n),N2}}}}if(!_(z)&&z.isProviderFor(k,f))return z;return}function j(k,f){var n=o.get(k),d;if(!_(n))d=n.get(f);if(!_(d))return d;if(d=X(k,f),!_(d)){if(_(n))n=new F,o.set(k,n);n.set(f,d)}return d}function Z(k){if(_(k))throw TypeError();return L===k||v===k||!_(c)&&c.has(k)}function A(k,f,n){if(!Z(n))throw Error("Metadata provider not registered.");var d=j(k,f);if(d!==n){if(!_(d))return!1;var N2=o.get(k);if(_(N2))N2=new F,o.set(k,N2);N2.set(f,n)}return!0}}function a2(){var z;if(!_(E)&&t(S.Reflect)&&Object.isExtensible(S.Reflect))z=S.Reflect[E];if(_(z))z=t2();if(!_(E)&&t(S.Reflect)&&Object.isExtensible(S.Reflect))Object.defineProperty(S.Reflect,E,{enumerable:!1,configurable:!1,writable:!1,value:z});return z}function s2(z){var L=new Y,v={isProviderFor:function(Z,A){var k=L.get(Z);if(_(k))return!1;return k.has(A)},OrdinaryDefineOwnMetadata:$,OrdinaryHasOwnMetadata:o,OrdinaryGetOwnMetadata:S2,OrdinaryOwnMetadataKeys:X,OrdinaryDeleteMetadata:j};return I.registerProvider(v),v;function c(Z,A,k){var f=L.get(Z),n=!1;if(_(f)){if(!k)return;f=new F,L.set(Z,f),n=!0}var d=f.get(A);if(_(d)){if(!k)return;if(d=new F,f.set(A,d),!z.setProvider(Z,A,v)){if(f.delete(A),n)L.delete(Z);throw Error("Wrong provider for target.")}}return d}function o(Z,A,k){var f=c(A,k,!1);if(_(f))return!1;return Z2(f.has(Z))}function S2(Z,A,k){var f=c(A,k,!1);if(_(f))return;return f.get(Z)}function $(Z,A,k,f){var n=c(k,f,!0);n.set(Z,A)}function X(Z,A){var k=[],f=c(Z,A,!1);if(_(f))return k;var n=f.keys(),d=f2(n),N2=0;while(!0){var L4=U2(d);if(!L4)return k.length=N2,k;var K4=z2(L4);try{k[N2]=K4}catch(F2){try{o2(d)}finally{throw F2}}N2++}}function j(Z,A,k){var f=c(A,k,!1);if(_(f))return!1;if(!f.delete(Z))return!1;if(f.size===0){var n=L.get(A);if(!_(n)){if(n.delete(k),n.size===0)L.delete(n)}}return!0}}function A6(z){var{defineMetadata:L,hasOwnMetadata:v,getOwnMetadata:c,getOwnMetadataKeys:o,deleteMetadata:S2}=z,$=new Y,X={isProviderFor:function(j,Z){var A=$.get(j);if(!_(A)&&A.has(Z))return!0;if(o(j,Z).length){if(_(A))A=new D,$.set(j,A);return A.add(Z),!0}return!1},OrdinaryDefineOwnMetadata:L,OrdinaryHasOwnMetadata:v,OrdinaryGetOwnMetadata:c,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:S2};return X}function I4(z,L,v){var c=I.getProvider(z,L);if(!_(c))return c;if(v){if(I.setProvider(z,L,q))return q;throw Error("Illegal state.")}return}function c6(){var z={},L=[],v=function(){function X(j,Z,A){this._index=0,this._keys=j,this._values=Z,this._selector=A}return X.prototype["@@iterator"]=function(){return this},X.prototype[J]=function(){return this},X.prototype.next=function(){var j=this._index;if(j>=0&&j<this._keys.length){var Z=this._selector(this._keys[j],this._values[j]);if(j+1>=this._keys.length)this._index=-1,this._keys=L,this._values=L;else this._index++;return{value:Z,done:!1}}return{value:void 0,done:!0}},X.prototype.throw=function(j){if(this._index>=0)this._index=-1,this._keys=L,this._values=L;throw j},X.prototype.return=function(j){if(this._index>=0)this._index=-1,this._keys=L,this._values=L;return{value:j,done:!0}},X}(),c=function(){function X(){this._keys=[],this._values=[],this._cacheKey=z,this._cacheIndex=-2}return Object.defineProperty(X.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),X.prototype.has=function(j){return this._find(j,!1)>=0},X.prototype.get=function(j){var Z=this._find(j,!1);return Z>=0?this._values[Z]:void 0},X.prototype.set=function(j,Z){var A=this._find(j,!0);return this._values[A]=Z,this},X.prototype.delete=function(j){var Z=this._find(j,!1);if(Z>=0){var A=this._keys.length;for(var k=Z+1;k<A;k++)this._keys[k-1]=this._keys[k],this._values[k-1]=this._values[k];if(this._keys.length--,this._values.length--,$2(j,this._cacheKey))this._cacheKey=z,this._cacheIndex=-2;return!0}return!1},X.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=z,this._cacheIndex=-2},X.prototype.keys=function(){return new v(this._keys,this._values,o)},X.prototype.values=function(){return new v(this._keys,this._values,S2)},X.prototype.entries=function(){return new v(this._keys,this._values,$)},X.prototype["@@iterator"]=function(){return this.entries()},X.prototype[J]=function(){return this.entries()},X.prototype._find=function(j,Z){if(!$2(this._cacheKey,j)){this._cacheIndex=-1;for(var A=0;A<this._keys.length;A++)if($2(this._keys[A],j)){this._cacheIndex=A;break}}if(this._cacheIndex<0&&Z)this._cacheIndex=this._keys.length,this._keys.push(j),this._values.push(void 0);return this._cacheIndex},X}();return c;function o(X,j){return X}function S2(X,j){return j}function $(X,j){return[X,j]}}function e4(){var z=function(){function L(){this._map=new F}return Object.defineProperty(L.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),L.prototype.has=function(v){return this._map.has(v)},L.prototype.add=function(v){return this._map.set(v,v),this},L.prototype.delete=function(v){return this._map.delete(v)},L.prototype.clear=function(){this._map.clear()},L.prototype.keys=function(){return this._map.keys()},L.prototype.values=function(){return this._map.keys()},L.prototype.entries=function(){return this._map.entries()},L.prototype["@@iterator"]=function(){return this.keys()},L.prototype[J]=function(){return this.keys()},L}();return z}function C6(){var z=16,L=H.create(),v=c();return function(){function j(){this._key=c()}return j.prototype.has=function(Z){var A=o(Z,!1);return A!==void 0?H.has(A,this._key):!1},j.prototype.get=function(Z){var A=o(Z,!1);return A!==void 0?H.get(A,this._key):void 0},j.prototype.set=function(Z,A){var k=o(Z,!0);return k[this._key]=A,this},j.prototype.delete=function(Z){var A=o(Z,!1);return A!==void 0?delete A[this._key]:!1},j.prototype.clear=function(){this._key=c()},j}();function c(){var j;do j="@@WeakMap@@"+X();while(H.has(L,j));return L[j]=!0,j}function o(j,Z){if(!M.call(j,v)){if(!Z)return;Object.defineProperty(j,v,{value:H.create()})}return j[v]}function S2(j,Z){for(var A=0;A<Z;++A)j[A]=Math.random()*255|0;return j}function $(j){if(typeof Uint8Array==="function"){var Z=new Uint8Array(j);if(typeof crypto<"u")crypto.getRandomValues(Z);else if(typeof msCrypto<"u")msCrypto.getRandomValues(Z);else S2(Z,j);return Z}return S2(Array(j),j)}function X(){var j=$(z);j[6]=j[6]&79|64,j[8]=j[8]&191|128;var Z="";for(var A=0;A<z;++A){var k=j[A];if(A===4||A===6||A===8)Z+="-";if(k<16)Z+="0";Z+=k.toString(16).toLowerCase()}return Z}}function T2(z){return z.__=void 0,delete z.__,z}})})(K||(K={}))}),F4=m((K,w)=>{w.exports=TypeError}),A1=m((K,w)=>{w.exports=Z1("util").inspect}),O6=m((K,w)=>{var W=typeof Map==="function"&&Map.prototype,S=Object.getOwnPropertyDescriptor&&W?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,M=W&&S&&typeof S.get==="function"?S.get:null,b=W&&Map.prototype.forEach,P=typeof Set==="function"&&Set.prototype,J=Object.getOwnPropertyDescriptor&&P?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,O=P&&J&&typeof J.get==="function"?J.get:null,N=P&&Set.prototype.forEach,G=typeof WeakMap==="function"&&WeakMap.prototype,H=G?WeakMap.prototype.has:null,Q=typeof WeakSet==="function"&&WeakSet.prototype,F=Q?WeakSet.prototype.has:null,D=typeof WeakRef==="function"&&WeakRef.prototype,Y=D?WeakRef.prototype.deref:null,E=Boolean.prototype.valueOf,I=Object.prototype.toString,q=Function.prototype.toString,U=String.prototype.match,B=String.prototype.slice,h=String.prototype.replace,u=String.prototype.toUpperCase,V=String.prototype.toLowerCase,x=RegExp.prototype.test,g=Array.prototype.concat,C=Array.prototype.join,y=Array.prototype.slice,e=Math.floor,r=typeof BigInt==="function"?BigInt.prototype.valueOf:null,s=Object.getOwnPropertySymbols,O2=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null,W2=typeof Symbol==="function"&&typeof Symbol.iterator==="object",X2=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===W2?"object":"symbol")?Symbol.toStringTag:null,R2=Object.prototype.propertyIsEnumerable,j2=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function l($,X){if($===1/0||$===-1/0||$!==$||$&&$>-1000&&$<1000||x.call(/e/,X))return X;var j=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $==="number"){var Z=$<0?-e(-$):e($);if(Z!==$){var A=String(Z),k=B.call(X,A.length+1);return h.call(A,j,"$&_")+"."+h.call(h.call(k,/([0-9]{3})/g,"$&_"),/_$/,"")}}return h.call(X,j,"$&_")}var Q2=A1(),k2=Q2.custom,_=$2(k2)?k2:null,H2={__proto__:null,double:'"',single:"'"},x2={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};w.exports=function $(X,j,Z,A){var k=j||{};if(z2(k,"quoteStyle")&&!z2(H2,k.quoteStyle))throw TypeError('option "quoteStyle" must be "single" or "double"');if(z2(k,"maxStringLength")&&(typeof k.maxStringLength==="number"?k.maxStringLength<0&&k.maxStringLength!==1/0:k.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=z2(k,"customInspect")?k.customInspect:!0;if(typeof f!=="boolean"&&f!=="symbol")throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z2(k,"indent")&&k.indent!==null&&k.indent!=="\t"&&!(parseInt(k.indent,10)===k.indent&&k.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z2(k,"numericSeparator")&&typeof k.numericSeparator!=="boolean")throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var n=k.numericSeparator;if(typeof X>"u")return"undefined";if(X===null)return"null";if(typeof X==="boolean")return X?"true":"false";if(typeof X==="string")return e4(X,k);if(typeof X==="number"){if(X===0)return 1/0/X>0?"0":"-0";var d=String(X);return n?l(X,d):d}if(typeof X==="bigint"){var N2=String(X)+"n";return n?l(X,N2):N2}var L4=typeof k.depth>"u"?5:k.depth;if(typeof Z>"u")Z=0;if(Z>=L4&&L4>0&&typeof X==="object")return Z2(X)?"[Array]":"[Object]";var K4=c(k,Z);if(typeof A>"u")A=[];else if(Y2(A,X)>=0)return"[Circular]";function F2(q4,n4,V1){if(n4)A=y.call(A),A.push(n4);if(V1){var t8={depth:k.depth};if(z2(k,"quoteStyle"))t8.quoteStyle=k.quoteStyle;return $(q4,t8,Z+1,A)}return $(q4,k,Z+1,A)}if(typeof X==="function"&&!p(X)){var T8=o2(X),l8=S2(X,F2);return"[Function"+(T8?": "+T8:" (anonymous)")+"]"+(l8.length>0?" { "+C.call(l8,", ")+" }":"")}if($2(X)){var p8=W2?h.call(String(X),/^(Symbol\(.*\))_[^)]*$/,"$1"):O2.call(X);return typeof X==="object"&&!W2?T2(p8):p8}if(c6(X)){var A4="<"+V.call(String(X.nodeName)),x6=X.attributes||[];for(var d4=0;d4<x6.length;d4++)A4+=" "+x6[d4].name+"="+t(g2(x6[d4].value),"double",k);if(A4+=">",X.childNodes&&X.childNodes.length)A4+="...";return A4+="</"+V.call(String(X.nodeName))+">",A4}if(Z2(X)){if(X.length===0)return"[]";var u6=S2(X,F2);if(K4&&!v(u6))return"["+o(u6,K4)+"]";return"[ "+C.call(u6,", ")+" ]"}if(a(X)){var o6=S2(X,F2);if(!("cause"in Error.prototype)&&"cause"in X&&!R2.call(X,"cause"))return"{ ["+String(X)+"] "+C.call(g.call("[cause]: "+F2(X.cause),o6),", ")+" }";if(o6.length===0)return"["+String(X)+"]";return"{ ["+String(X)+"] "+C.call(o6,", ")+" }"}if(typeof X==="object"&&f){if(_&&typeof X[_]==="function"&&Q2)return Q2(X,{depth:L4-Z});else if(f!=="symbol"&&typeof X.inspect==="function")return X.inspect()}if(t2(X)){var i8=[];if(b)b.call(X,function(q4,n4){i8.push(F2(n4,X,!0)+" => "+F2(q4,X))});return L("Map",M.call(X),i8,K4)}if(A6(X)){var e8=[];if(N)N.call(X,function(q4){e8.push(F2(q4,X))});return L("Set",O.call(X),e8,K4)}if(a2(X))return z("WeakMap");if(I4(X))return z("WeakSet");if(s2(X))return z("WeakRef");if(b2(X))return T2(F2(Number(X)));if(J2(X))return T2(F2(r.call(X)));if(D2(X))return T2(E.call(X));if(i(X))return T2(F2(String(X)));if(typeof window<"u"&&X===window)return"{ [object Window] }";if(typeof globalThis<"u"&&X===globalThis||typeof global<"u"&&X===global)return"{ [object globalThis] }";if(!u2(X)&&!p(X)){var y6=S2(X,F2),d8=j2?j2(X)===Object.prototype:X instanceof Object||X.constructor===Object,r6=X instanceof Object?"":"null prototype",n8=!d8&&X2&&Object(X)===X&&X2 in X?B.call(U2(X),8,-1):r6?"Object":"",H1=d8||typeof X.constructor!=="function"?"":X.constructor.name?X.constructor.name+" ":"",_6=H1+(n8||r6?"["+C.call(g.call([],n8||[],r6||[]),": ")+"] ":"");if(y6.length===0)return _6+"{}";if(K4)return _6+"{"+o(y6,K4)+"}";return _6+"{ "+C.call(y6,", ")+" }"}return String(X)};function t($,X,j){var Z=j.quoteStyle||X,A=H2[Z];return A+$+A}function g2($){return h.call(String($),/"/g,"&quot;")}function q2($){return!X2||!(typeof $==="object"&&((X2 in $)||typeof $[X2]<"u"))}function Z2($){return U2($)==="[object Array]"&&q2($)}function u2($){return U2($)==="[object Date]"&&q2($)}function p($){return U2($)==="[object RegExp]"&&q2($)}function a($){return U2($)==="[object Error]"&&q2($)}function i($){return U2($)==="[object String]"&&q2($)}function b2($){return U2($)==="[object Number]"&&q2($)}function D2($){return U2($)==="[object Boolean]"&&q2($)}function $2($){if(W2)return $&&typeof $==="object"&&$ instanceof Symbol;if(typeof $==="symbol")return!0;if(!$||typeof $!=="object"||!O2)return!1;try{return O2.call($),!0}catch(X){}return!1}function J2($){if(!$||typeof $!=="object"||!r)return!1;try{return r.call($),!0}catch(X){}return!1}var f2=Object.prototype.hasOwnProperty||function($){return $ in this};function z2($,X){return f2.call($,X)}function U2($){return I.call($)}function o2($){if($.name)return $.name;var X=U.call(q.call($),/^function\s*([\w$]+)/);if(X)return X[1];return null}function Y2($,X){if($.indexOf)return $.indexOf(X);for(var j=0,Z=$.length;j<Z;j++)if($[j]===X)return j;return-1}function t2($){if(!M||!$||typeof $!=="object")return!1;try{M.call($);try{O.call($)}catch(X){return!0}return $ instanceof Map}catch(X){}return!1}function a2($){if(!H||!$||typeof $!=="object")return!1;try{H.call($,H);try{F.call($,F)}catch(X){return!0}return $ instanceof WeakMap}catch(X){}return!1}function s2($){if(!Y||!$||typeof $!=="object")return!1;try{return Y.call($),!0}catch(X){}return!1}function A6($){if(!O||!$||typeof $!=="object")return!1;try{O.call($);try{M.call($)}catch(X){return!0}return $ instanceof Set}catch(X){}return!1}function I4($){if(!F||!$||typeof $!=="object")return!1;try{F.call($,F);try{H.call($,H)}catch(X){return!0}return $ instanceof WeakSet}catch(X){}return!1}function c6($){if(!$||typeof $!=="object")return!1;if(typeof HTMLElement<"u"&&$ instanceof HTMLElement)return!0;return typeof $.nodeName==="string"&&typeof $.getAttribute==="function"}function e4($,X){if($.length>X.maxStringLength){var j=$.length-X.maxStringLength,Z="... "+j+" more character"+(j>1?"s":"");return e4(B.call($,0,X.maxStringLength),X)+Z}var A=x2[X.quoteStyle||"single"];A.lastIndex=0;var k=h.call(h.call($,A,"\\$1"),/[\x00-\x1f]/g,C6);return t(k,"single",X)}function C6($){var X=$.charCodeAt(0),j={8:"b",9:"t",10:"n",12:"f",13:"r"}[X];if(j)return"\\"+j;return"\\x"+(X<16?"0":"")+u.call(X.toString(16))}function T2($){return"Object("+$+")"}function z($){return $+" { ? }"}function L($,X,j,Z){var A=Z?o(j,Z):C.call(j,", ");return $+" ("+X+") {"+A+"}"}function v($){for(var X=0;X<$.length;X++)if(Y2($[X],`
16
+ `)>=0)return!1;return!0}function c($,X){var j;if($.indent==="\t")j="\t";else if(typeof $.indent==="number"&&$.indent>0)j=C.call(Array($.indent+1)," ");else return null;return{base:j,prev:C.call(Array(X+1),j)}}function o($,X){if($.length===0)return"";var j=`
17
+ `+X.prev+X.base;return j+C.call($,","+j)+`
18
+ `+X.prev}function S2($,X){var j=Z2($),Z=[];if(j){Z.length=$.length;for(var A=0;A<$.length;A++)Z[A]=z2($,A)?X($[A],$):""}var k=typeof s==="function"?s($):[],f;if(W2){f={};for(var n=0;n<k.length;n++)f["$"+k[n]]=k[n]}for(var d in $){if(!z2($,d))continue;if(j&&String(Number(d))===d&&d<$.length)continue;if(W2&&f["$"+d]instanceof Symbol)continue;else if(x.call(/[^\w$]/,d))Z.push(X(d,$)+": "+X($[d],$));else Z.push(d+": "+X($[d],$))}if(typeof s==="function"){for(var N2=0;N2<k.length;N2++)if(R2.call($,k[N2]))Z.push("["+X(k[N2])+"]: "+X($[k[N2]],$))}return Z}}),c1=m((K,w)=>{var W=O6(),S=F4(),M=function(N,G,H){var Q=N,F;for(;(F=Q.next)!=null;Q=F)if(F.key===G){if(Q.next=F.next,!H)F.next=N.next,N.next=F;return F}},b=function(N,G){if(!N)return;var H=M(N,G);return H&&H.value},P=function(N,G,H){var Q=M(N,G);if(Q)Q.value=H;else N.next={key:G,next:N.next,value:H}},J=function(N,G){if(!N)return!1;return!!M(N,G)},O=function(N,G){if(N)return M(N,G,!0)};w.exports=function(){var N,G={assert:function(H){if(!G.has(H))throw new S("Side channel does not contain "+W(H))},delete:function(H){var Q=N&&N.next,F=O(N,H);if(F&&Q&&Q===F)N=void 0;return!!F},get:function(H){return b(N,H)},has:function(H){return J(N,H)},set:function(H,Q){if(!N)N={next:void 0};P(N,H,Q)}};return G}}),wK=m((K,w)=>{w.exports=Object}),C1=m((K,w)=>{w.exports=Error}),x1=m((K,w)=>{w.exports=EvalError}),u1=m((K,w)=>{w.exports=RangeError}),o1=m((K,w)=>{w.exports=ReferenceError}),y1=m((K,w)=>{w.exports=SyntaxError}),r1=m((K,w)=>{w.exports=URIError}),_1=m((K,w)=>{w.exports=Math.abs}),m1=m((K,w)=>{w.exports=Math.floor}),f1=m((K,w)=>{w.exports=Math.max}),T1=m((K,w)=>{w.exports=Math.min}),l1=m((K,w)=>{w.exports=Math.pow}),p1=m((K,w)=>{w.exports=Math.round}),i1=m((K,w)=>{w.exports=Number.isNaN||function(W){return W!==W}}),e1=m((K,w)=>{var W=i1();w.exports=function(S){if(W(S)||S===0)return S;return S<0?-1:1}}),d1=m((K,w)=>{w.exports=Object.getOwnPropertyDescriptor}),WK=m((K,w)=>{var W=d1();if(W)try{W([],"length")}catch(S){W=null}w.exports=W}),n1=m((K,w)=>{var W=Object.defineProperty||!1;if(W)try{W({},"a",{value:1})}catch(S){W=!1}w.exports=W}),t1=m((K,w)=>{w.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var W={},S=Symbol("test"),M=Object(S);if(typeof S==="string")return!1;if(Object.prototype.toString.call(S)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(M)!=="[object Symbol]")return!1;var b=42;W[S]=b;for(var P in W)return!1;if(typeof Object.keys==="function"&&Object.keys(W).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(W).length!==0)return!1;var J=Object.getOwnPropertySymbols(W);if(J.length!==1||J[0]!==S)return!1;if(!Object.prototype.propertyIsEnumerable.call(W,S))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var O=Object.getOwnPropertyDescriptor(W,S);if(O.value!==b||O.enumerable!==!0)return!1}return!0}}),a1=m((K,w)=>{var W=typeof Symbol<"u"&&Symbol,S=t1();w.exports=function(){if(typeof W!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof W("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return S()}}),SK=m((K,w)=>{w.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),MK=m((K,w)=>{var W=wK();w.exports=W.getPrototypeOf||null}),s1=m((K,w)=>{var W="Function.prototype.bind called on incompatible ",S=Object.prototype.toString,M=Math.max,b="[object Function]",P=function(N,G){var H=[];for(var Q=0;Q<N.length;Q+=1)H[Q]=N[Q];for(var F=0;F<G.length;F+=1)H[F+N.length]=G[F];return H},J=function(N,G){var H=[];for(var Q=G||0,F=0;Q<N.length;Q+=1,F+=1)H[F]=N[Q];return H},O=function(N,G){var H="";for(var Q=0;Q<N.length;Q+=1)if(H+=N[Q],Q+1<N.length)H+=G;return H};w.exports=function(N){var G=this;if(typeof G!=="function"||S.apply(G)!==b)throw TypeError(W+G);var H=J(arguments,1),Q,F=function(){if(this instanceof Q){var q=G.apply(this,P(H,arguments));if(Object(q)===q)return q;return this}return G.apply(N,P(H,arguments))},D=M(0,G.length-H.length),Y=[];for(var E=0;E<D;E++)Y[E]="$"+E;if(Q=Function("binder","return function ("+O(Y,",")+"){ return binder.apply(this,arguments); }")(F),G.prototype){var I=function(){};I.prototype=G.prototype,Q.prototype=new I,I.prototype=null}return Q}}),N6=m((K,w)=>{var W=s1();w.exports=Function.prototype.bind||W}),d6=m((K,w)=>{w.exports=Function.prototype.call}),bK=m((K,w)=>{w.exports=Function.prototype.apply}),K9=m((K,w)=>{w.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),w9=m((K,w)=>{var W=N6(),S=bK(),M=d6(),b=K9();w.exports=b||W.call(M,S)}),PK=m((K,w)=>{var W=N6(),S=F4(),M=d6(),b=w9();w.exports=function(P){if(P.length<1||typeof P[0]!=="function")throw new S("a function is required");return b(W,M,P)}}),W9=m((K,w)=>{var W=PK(),S=WK(),M;try{M=[].__proto__===Array.prototype}catch(O){if(!O||typeof O!=="object"||!("code"in O)||O.code!=="ERR_PROTO_ACCESS")throw O}var b=!!M&&S&&S(Object.prototype,"__proto__"),P=Object,J=P.getPrototypeOf;w.exports=b&&typeof b.get==="function"?W([b.get]):typeof J==="function"?function(O){return J(O==null?O:P(O))}:!1}),S9=m((K,w)=>{var W=SK(),S=MK(),M=W9();w.exports=W?function(b){return W(b)}:S?function(b){if(!b||typeof b!=="object"&&typeof b!=="function")throw TypeError("getProto: not an object");return S(b)}:M?function(b){return M(b)}:null}),M9=m((K,w)=>{var W=Function.prototype.call,S=Object.prototype.hasOwnProperty,M=N6();w.exports=M.call(W,S)}),n6=m((K,w)=>{var W,S=wK(),M=C1(),b=x1(),P=u1(),J=o1(),O=y1(),N=F4(),G=r1(),H=_1(),Q=m1(),F=f1(),D=T1(),Y=l1(),E=p1(),I=e1(),q=Function,U=function(p){try{return q('"use strict"; return ('+p+").constructor;")()}catch(a){}},B=WK(),h=n1(),u=function(){throw new N},V=B?function(){try{return arguments.callee,u}catch(p){try{return B(arguments,"callee").get}catch(a){return u}}}():u,x=a1()(),g=S9(),C=MK(),y=SK(),e=bK(),r=d6(),s={},O2=typeof Uint8Array>"u"||!g?W:g(Uint8Array),W2={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?W:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?W:ArrayBuffer,"%ArrayIteratorPrototype%":x&&g?g([][Symbol.iterator]()):W,"%AsyncFromSyncIteratorPrototype%":W,"%AsyncFunction%":s,"%AsyncGenerator%":s,"%AsyncGeneratorFunction%":s,"%AsyncIteratorPrototype%":s,"%Atomics%":typeof Atomics>"u"?W:Atomics,"%BigInt%":typeof BigInt>"u"?W:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?W:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?W:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?W:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":M,"%eval%":eval,"%EvalError%":b,"%Float16Array%":typeof Float16Array>"u"?W:Float16Array,"%Float32Array%":typeof Float32Array>"u"?W:Float32Array,"%Float64Array%":typeof Float64Array>"u"?W:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?W:FinalizationRegistry,"%Function%":q,"%GeneratorFunction%":s,"%Int8Array%":typeof Int8Array>"u"?W:Int8Array,"%Int16Array%":typeof Int16Array>"u"?W:Int16Array,"%Int32Array%":typeof Int32Array>"u"?W:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":x&&g?g(g([][Symbol.iterator]())):W,"%JSON%":typeof JSON==="object"?JSON:W,"%Map%":typeof Map>"u"?W:Map,"%MapIteratorPrototype%":typeof Map>"u"||!x||!g?W:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":S,"%Object.getOwnPropertyDescriptor%":B,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?W:Promise,"%Proxy%":typeof Proxy>"u"?W:Proxy,"%RangeError%":P,"%ReferenceError%":J,"%Reflect%":typeof Reflect>"u"?W:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?W:Set,"%SetIteratorPrototype%":typeof Set>"u"||!x||!g?W:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?W:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":x&&g?g(""[Symbol.iterator]()):W,"%Symbol%":x?Symbol:W,"%SyntaxError%":O,"%ThrowTypeError%":V,"%TypedArray%":O2,"%TypeError%":N,"%Uint8Array%":typeof Uint8Array>"u"?W:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?W:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?W:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?W:Uint32Array,"%URIError%":G,"%WeakMap%":typeof WeakMap>"u"?W:WeakMap,"%WeakRef%":typeof WeakRef>"u"?W:WeakRef,"%WeakSet%":typeof WeakSet>"u"?W:WeakSet,"%Function.prototype.call%":r,"%Function.prototype.apply%":e,"%Object.defineProperty%":h,"%Object.getPrototypeOf%":C,"%Math.abs%":H,"%Math.floor%":Q,"%Math.max%":F,"%Math.min%":D,"%Math.pow%":Y,"%Math.round%":E,"%Math.sign%":I,"%Reflect.getPrototypeOf%":y};if(g)try{null.error}catch(p){X2=g(g(p)),W2["%Error.prototype%"]=X2}var X2,R2=function p(a){var i;if(a==="%AsyncFunction%")i=U("async function () {}");else if(a==="%GeneratorFunction%")i=U("function* () {}");else if(a==="%AsyncGeneratorFunction%")i=U("async function* () {}");else if(a==="%AsyncGenerator%"){var b2=p("%AsyncGeneratorFunction%");if(b2)i=b2.prototype}else if(a==="%AsyncIteratorPrototype%"){var D2=p("%AsyncGenerator%");if(D2&&g)i=g(D2.prototype)}return W2[a]=i,i},j2={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},l=N6(),Q2=M9(),k2=l.call(r,Array.prototype.concat),_=l.call(e,Array.prototype.splice),H2=l.call(r,String.prototype.replace),x2=l.call(r,String.prototype.slice),t=l.call(r,RegExp.prototype.exec),g2=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q2=/\\(\\)?/g,Z2=function(p){var a=x2(p,0,1),i=x2(p,-1);if(a==="%"&&i!=="%")throw new O("invalid intrinsic syntax, expected closing `%`");else if(i==="%"&&a!=="%")throw new O("invalid intrinsic syntax, expected opening `%`");var b2=[];return H2(p,g2,function(D2,$2,J2,f2){b2[b2.length]=J2?H2(f2,q2,"$1"):$2||D2}),b2},u2=function(p,a){var i=p,b2;if(Q2(j2,i))b2=j2[i],i="%"+b2[0]+"%";if(Q2(W2,i)){var D2=W2[i];if(D2===s)D2=R2(i);if(typeof D2>"u"&&!a)throw new N("intrinsic "+p+" exists, but is not available. Please file an issue!");return{alias:b2,name:i,value:D2}}throw new O("intrinsic "+p+" does not exist!")};w.exports=function(p,a){if(typeof p!=="string"||p.length===0)throw new N("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!=="boolean")throw new N('"allowMissing" argument must be a boolean');if(t(/^%?[^%]*%?$/,p)===null)throw new O("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=Z2(p),b2=i.length>0?i[0]:"",D2=u2("%"+b2+"%",a),$2=D2.name,J2=D2.value,f2=!1,z2=D2.alias;if(z2)b2=z2[0],_(i,k2([0,1],z2));for(var U2=1,o2=!0;U2<i.length;U2+=1){var Y2=i[U2],t2=x2(Y2,0,1),a2=x2(Y2,-1);if((t2==='"'||t2==="'"||t2==="`"||(a2==='"'||a2==="'"||a2==="`"))&&t2!==a2)throw new O("property names with quotes must have matching quotes");if(Y2==="constructor"||!o2)f2=!0;if(b2+="."+Y2,$2="%"+b2+"%",Q2(W2,$2))J2=W2[$2];else if(J2!=null){if(!(Y2 in J2)){if(!a)throw new N("base intrinsic for "+p+" exists, but the property is not available.");return}if(B&&U2+1>=i.length){var s2=B(J2,Y2);if(o2=!!s2,o2&&"get"in s2&&!("originalValue"in s2.get))J2=s2.get;else J2=J2[Y2]}else o2=Q2(J2,Y2),J2=J2[Y2];if(o2&&!f2)W2[$2]=J2}}return J2}}),JK=m((K,w)=>{var W=n6(),S=PK(),M=S([W("%String.prototype.indexOf%")]);w.exports=function(b,P){var J=W(b,!!P);if(typeof J==="function"&&M(b,".prototype.")>-1)return S([J]);return J}}),OK=m((K,w)=>{var W=n6(),S=JK(),M=O6(),b=F4(),P=W("%Map%",!0),J=S("Map.prototype.get",!0),O=S("Map.prototype.set",!0),N=S("Map.prototype.has",!0),G=S("Map.prototype.delete",!0),H=S("Map.prototype.size",!0);w.exports=!!P&&function(){var Q,F={assert:function(D){if(!F.has(D))throw new b("Side channel does not contain "+M(D))},delete:function(D){if(Q){var Y=G(Q,D);if(H(Q)===0)Q=void 0;return Y}return!1},get:function(D){if(Q)return J(Q,D)},has:function(D){if(Q)return N(Q,D);return!1},set:function(D,Y){if(!Q)Q=new P;O(Q,D,Y)}};return F}}),b9=m((K,w)=>{var W=n6(),S=JK(),M=O6(),b=OK(),P=F4(),J=W("%WeakMap%",!0),O=S("WeakMap.prototype.get",!0),N=S("WeakMap.prototype.set",!0),G=S("WeakMap.prototype.has",!0),H=S("WeakMap.prototype.delete",!0);w.exports=J?function(){var Q,F,D={assert:function(Y){if(!D.has(Y))throw new P("Side channel does not contain "+M(Y))},delete:function(Y){if(J&&Y&&(typeof Y==="object"||typeof Y==="function")){if(Q)return H(Q,Y)}else if(b){if(F)return F.delete(Y)}return!1},get:function(Y){if(J&&Y&&(typeof Y==="object"||typeof Y==="function")){if(Q)return O(Q,Y)}return F&&F.get(Y)},has:function(Y){if(J&&Y&&(typeof Y==="object"||typeof Y==="function")){if(Q)return G(Q,Y)}return!!F&&F.has(Y)},set:function(Y,E){if(J&&Y&&(typeof Y==="object"||typeof Y==="function")){if(!Q)Q=new J;N(Q,Y,E)}else if(b){if(!F)F=b();F.set(Y,E)}}};return D}:b}),P9=m((K,w)=>{var W=F4(),S=O6(),M=c1(),b=OK(),P=b9(),J=P||b||M;w.exports=function(){var O,N={assert:function(G){if(!N.has(G))throw new W("Side channel does not contain "+S(G))},delete:function(G){return!!O&&O.delete(G)},get:function(G){return O&&O.get(G)},has:function(G){return!!O&&O.has(G)},set:function(G,H){if(!O)O=J();O.set(G,H)}};return N}}),t6=m((K,w)=>{var W=String.prototype.replace,S=/%20/g,M={RFC1738:"RFC1738",RFC3986:"RFC3986"};w.exports={default:M.RFC3986,formatters:{RFC1738:function(b){return W.call(b,S,"+")},RFC3986:function(b){return String(b)}},RFC1738:M.RFC1738,RFC3986:M.RFC3986}}),NK=m((K,w)=>{var W=t6(),S=Object.prototype.hasOwnProperty,M=Array.isArray,b=function(){var q=[];for(var U=0;U<256;++U)q.push("%"+((U<16?"0":"")+U.toString(16)).toUpperCase());return q}(),P=function(q){while(q.length>1){var U=q.pop(),B=U.obj[U.prop];if(M(B)){var h=[];for(var u=0;u<B.length;++u)if(typeof B[u]<"u")h.push(B[u]);U.obj[U.prop]=h}}},J=function(q,U){var B=U&&U.plainObjects?{__proto__:null}:{};for(var h=0;h<q.length;++h)if(typeof q[h]<"u")B[h]=q[h];return B},O=function q(U,B,h){if(!B)return U;if(typeof B!=="object"&&typeof B!=="function"){if(M(U))U.push(B);else if(U&&typeof U==="object"){if(h&&(h.plainObjects||h.allowPrototypes)||!S.call(Object.prototype,B))U[B]=!0}else return[U,B];return U}if(!U||typeof U!=="object")return[U].concat(B);var u=U;if(M(U)&&!M(B))u=J(U,h);if(M(U)&&M(B))return B.forEach(function(V,x){if(S.call(U,x)){var g=U[x];if(g&&typeof g==="object"&&V&&typeof V==="object")U[x]=q(g,V,h);else U.push(V)}else U[x]=V}),U;return Object.keys(B).reduce(function(V,x){var g=B[x];if(S.call(V,x))V[x]=q(V[x],g,h);else V[x]=g;return V},u)},N=function(q,U){return Object.keys(U).reduce(function(B,h){return B[h]=U[h],B},q)},G=function(q,U,B){var h=q.replace(/\+/g," ");if(B==="iso-8859-1")return h.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(h)}catch(u){return h}},H=1024,Q=function(q,U,B,h,u){if(q.length===0)return q;var V=q;if(typeof q==="symbol")V=Symbol.prototype.toString.call(q);else if(typeof q!=="string")V=String(q);if(B==="iso-8859-1")return escape(V).replace(/%u[0-9a-f]{4}/gi,function(s){return"%26%23"+parseInt(s.slice(2),16)+"%3B"});var x="";for(var g=0;g<V.length;g+=H){var C=V.length>=H?V.slice(g,g+H):V,y=[];for(var e=0;e<C.length;++e){var r=C.charCodeAt(e);if(r===45||r===46||r===95||r===126||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||u===W.RFC1738&&(r===40||r===41)){y[y.length]=C.charAt(e);continue}if(r<128){y[y.length]=b[r];continue}if(r<2048){y[y.length]=b[192|r>>6]+b[128|r&63];continue}if(r<55296||r>=57344){y[y.length]=b[224|r>>12]+b[128|r>>6&63]+b[128|r&63];continue}e+=1,r=65536+((r&1023)<<10|C.charCodeAt(e)&1023),y[y.length]=b[240|r>>18]+b[128|r>>12&63]+b[128|r>>6&63]+b[128|r&63]}x+=y.join("")}return x},F=function(q){var U=[{obj:{o:q},prop:"o"}],B=[];for(var h=0;h<U.length;++h){var u=U[h],V=u.obj[u.prop],x=Object.keys(V);for(var g=0;g<x.length;++g){var C=x[g],y=V[C];if(typeof y==="object"&&y!==null&&B.indexOf(y)===-1)U.push({obj:V,prop:C}),B.push(y)}}return P(U),q},D=function(q){return Object.prototype.toString.call(q)==="[object RegExp]"},Y=function(q){if(!q||typeof q!=="object")return!1;return!!(q.constructor&&q.constructor.isBuffer&&q.constructor.isBuffer(q))},E=function(q,U){return[].concat(q,U)},I=function(q,U){if(M(q)){var B=[];for(var h=0;h<q.length;h+=1)B.push(U(q[h]));return B}return U(q)};w.exports={arrayToObject:J,assign:N,combine:E,compact:F,decode:G,encode:Q,isBuffer:Y,isRegExp:D,maybeMap:I,merge:O}}),J9=m((K,w)=>{var W=P9(),S=NK(),M=t6(),b=Object.prototype.hasOwnProperty,P={brackets:function(I){return I+"[]"},comma:"comma",indices:function(I,q){return I+"["+q+"]"},repeat:function(I){return I}},J=Array.isArray,O=Array.prototype.push,N=function(I,q){O.apply(I,J(q)?q:[q])},G=Date.prototype.toISOString,H=M.default,Q={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:S.encode,encodeValuesOnly:!1,filter:void 0,format:H,formatter:M.formatters[H],indices:!1,serializeDate:function(I){return G.call(I)},skipNulls:!1,strictNullHandling:!1},F=function(I){return typeof I==="string"||typeof I==="number"||typeof I==="boolean"||typeof I==="symbol"||typeof I==="bigint"},D={},Y=function I(q,U,B,h,u,V,x,g,C,y,e,r,s,O2,W2,X2,R2,j2){var l=q,Q2=j2,k2=0,_=!1;while((Q2=Q2.get(D))!==void 0&&!_){var H2=Q2.get(q);if(k2+=1,typeof H2<"u")if(H2===k2)throw RangeError("Cyclic object value");else _=!0;if(typeof Q2.get(D)>"u")k2=0}if(typeof y==="function")l=y(U,l);else if(l instanceof Date)l=s(l);else if(B==="comma"&&J(l))l=S.maybeMap(l,function(J2){if(J2 instanceof Date)return s(J2);return J2});if(l===null){if(V)return C&&!X2?C(U,Q.encoder,R2,"key",O2):U;l=""}if(F(l)||S.isBuffer(l)){if(C){var x2=X2?U:C(U,Q.encoder,R2,"key",O2);return[W2(x2)+"="+W2(C(l,Q.encoder,R2,"value",O2))]}return[W2(U)+"="+W2(String(l))]}var t=[];if(typeof l>"u")return t;var g2;if(B==="comma"&&J(l)){if(X2&&C)l=S.maybeMap(l,C);g2=[{value:l.length>0?l.join(",")||null:void 0}]}else if(J(y))g2=y;else{var q2=Object.keys(l);g2=e?q2.sort(e):q2}var Z2=g?String(U).replace(/\./g,"%2E"):String(U),u2=h&&J(l)&&l.length===1?Z2+"[]":Z2;if(u&&J(l)&&l.length===0)return u2+"[]";for(var p=0;p<g2.length;++p){var a=g2[p],i=typeof a==="object"&&a&&typeof a.value<"u"?a.value:l[a];if(x&&i===null)continue;var b2=r&&g?String(a).replace(/\./g,"%2E"):String(a),D2=J(l)?typeof B==="function"?B(u2,b2):u2:u2+(r?"."+b2:"["+b2+"]");j2.set(q,k2);var $2=W();$2.set(D,j2),N(t,I(i,D2,B,h,u,V,x,g,B==="comma"&&X2&&J(l)?null:C,y,e,r,s,O2,W2,X2,R2,$2))}return t},E=function(I){if(!I)return Q;if(typeof I.allowEmptyArrays<"u"&&typeof I.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof I.encodeDotInKeys<"u"&&typeof I.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(I.encoder!==null&&typeof I.encoder<"u"&&typeof I.encoder!=="function")throw TypeError("Encoder has to be a function.");var q=I.charset||Q.charset;if(typeof I.charset<"u"&&I.charset!=="utf-8"&&I.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var U=M.default;if(typeof I.format<"u"){if(!b.call(M.formatters,I.format))throw TypeError("Unknown format option provided.");U=I.format}var B=M.formatters[U],h=Q.filter;if(typeof I.filter==="function"||J(I.filter))h=I.filter;var u;if(I.arrayFormat in P)u=I.arrayFormat;else if("indices"in I)u=I.indices?"indices":"repeat";else u=Q.arrayFormat;if("commaRoundTrip"in I&&typeof I.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");var V=typeof I.allowDots>"u"?I.encodeDotInKeys===!0?!0:Q.allowDots:!!I.allowDots;return{addQueryPrefix:typeof I.addQueryPrefix==="boolean"?I.addQueryPrefix:Q.addQueryPrefix,allowDots:V,allowEmptyArrays:typeof I.allowEmptyArrays==="boolean"?!!I.allowEmptyArrays:Q.allowEmptyArrays,arrayFormat:u,charset:q,charsetSentinel:typeof I.charsetSentinel==="boolean"?I.charsetSentinel:Q.charsetSentinel,commaRoundTrip:!!I.commaRoundTrip,delimiter:typeof I.delimiter>"u"?Q.delimiter:I.delimiter,encode:typeof I.encode==="boolean"?I.encode:Q.encode,encodeDotInKeys:typeof I.encodeDotInKeys==="boolean"?I.encodeDotInKeys:Q.encodeDotInKeys,encoder:typeof I.encoder==="function"?I.encoder:Q.encoder,encodeValuesOnly:typeof I.encodeValuesOnly==="boolean"?I.encodeValuesOnly:Q.encodeValuesOnly,filter:h,format:U,formatter:B,serializeDate:typeof I.serializeDate==="function"?I.serializeDate:Q.serializeDate,skipNulls:typeof I.skipNulls==="boolean"?I.skipNulls:Q.skipNulls,sort:typeof I.sort==="function"?I.sort:null,strictNullHandling:typeof I.strictNullHandling==="boolean"?I.strictNullHandling:Q.strictNullHandling}};w.exports=function(I,q){var U=I,B=E(q),h,u;if(typeof B.filter==="function")u=B.filter,U=u("",U);else if(J(B.filter))u=B.filter,h=u;var V=[];if(typeof U!=="object"||U===null)return"";var x=P[B.arrayFormat],g=x==="comma"&&B.commaRoundTrip;if(!h)h=Object.keys(U);if(B.sort)h.sort(B.sort);var C=W();for(var y=0;y<h.length;++y){var e=h[y],r=U[e];if(B.skipNulls&&r===null)continue;N(V,Y(r,e,x,g,B.allowEmptyArrays,B.strictNullHandling,B.skipNulls,B.encodeDotInKeys,B.encode?B.encoder:null,B.filter,B.sort,B.allowDots,B.serializeDate,B.format,B.formatter,B.encodeValuesOnly,B.charset,C))}var s=V.join(B.delimiter),O2=B.addQueryPrefix===!0?"?":"";if(B.charsetSentinel)if(B.charset==="iso-8859-1")O2+="utf8=%26%2310003%3B&";else O2+="utf8=%E2%9C%93&";return s.length>0?O2+s:""}}),O9=m((K,w)=>{var W=NK(),S=Object.prototype.hasOwnProperty,M=Array.isArray,b={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:W.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1000,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},P=function(D){return D.replace(/&#(\d+);/g,function(Y,E){return String.fromCharCode(parseInt(E,10))})},J=function(D,Y,E){if(D&&typeof D==="string"&&Y.comma&&D.indexOf(",")>-1)return D.split(",");if(Y.throwOnLimitExceeded&&E>=Y.arrayLimit)throw RangeError("Array limit exceeded. Only "+Y.arrayLimit+" element"+(Y.arrayLimit===1?"":"s")+" allowed in an array.");return D},O="utf8=%26%2310003%3B",N="utf8=%E2%9C%93",G=function(D,Y){var E={__proto__:null},I=Y.ignoreQueryPrefix?D.replace(/^\?/,""):D;I=I.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var q=Y.parameterLimit===1/0?void 0:Y.parameterLimit,U=I.split(Y.delimiter,Y.throwOnLimitExceeded?q+1:q);if(Y.throwOnLimitExceeded&&U.length>q)throw RangeError("Parameter limit exceeded. Only "+q+" parameter"+(q===1?"":"s")+" allowed.");var B=-1,h,u=Y.charset;if(Y.charsetSentinel){for(h=0;h<U.length;++h)if(U[h].indexOf("utf8=")===0){if(U[h]===N)u="utf-8";else if(U[h]===O)u="iso-8859-1";B=h,h=U.length}}for(h=0;h<U.length;++h){if(h===B)continue;var V=U[h],x=V.indexOf("]="),g=x===-1?V.indexOf("="):x+1,C,y;if(g===-1)C=Y.decoder(V,b.decoder,u,"key"),y=Y.strictNullHandling?null:"";else C=Y.decoder(V.slice(0,g),b.decoder,u,"key"),y=W.maybeMap(J(V.slice(g+1),Y,M(E[C])?E[C].length:0),function(r){return Y.decoder(r,b.decoder,u,"value")});if(y&&Y.interpretNumericEntities&&u==="iso-8859-1")y=P(String(y));if(V.indexOf("[]=")>-1)y=M(y)?[y]:y;var e=S.call(E,C);if(e&&Y.duplicates==="combine")E[C]=W.combine(E[C],y);else if(!e||Y.duplicates==="last")E[C]=y}return E},H=function(D,Y,E,I){var q=0;if(D.length>0&&D[D.length-1]==="[]"){var U=D.slice(0,-1).join("");q=Array.isArray(Y)&&Y[U]?Y[U].length:0}var B=I?Y:J(Y,E,q);for(var h=D.length-1;h>=0;--h){var u,V=D[h];if(V==="[]"&&E.parseArrays)u=E.allowEmptyArrays&&(B===""||E.strictNullHandling&&B===null)?[]:W.combine([],B);else{u=E.plainObjects?{__proto__:null}:{};var x=V.charAt(0)==="["&&V.charAt(V.length-1)==="]"?V.slice(1,-1):V,g=E.decodeDotInKeys?x.replace(/%2E/g,"."):x,C=parseInt(g,10);if(!E.parseArrays&&g==="")u={0:B};else if(!isNaN(C)&&V!==g&&String(C)===g&&C>=0&&(E.parseArrays&&C<=E.arrayLimit))u=[],u[C]=B;else if(g!=="__proto__")u[g]=B}B=u}return B},Q=function(D,Y,E,I){if(!D)return;var q=E.allowDots?D.replace(/\.([^.[]+)/g,"[$1]"):D,U=/(\[[^[\]]*])/,B=/(\[[^[\]]*])/g,h=E.depth>0&&U.exec(q),u=h?q.slice(0,h.index):q,V=[];if(u){if(!E.plainObjects&&S.call(Object.prototype,u)){if(!E.allowPrototypes)return}V.push(u)}var x=0;while(E.depth>0&&(h=B.exec(q))!==null&&x<E.depth){if(x+=1,!E.plainObjects&&S.call(Object.prototype,h[1].slice(1,-1))){if(!E.allowPrototypes)return}V.push(h[1])}if(h){if(E.strictDepth===!0)throw RangeError("Input depth exceeded depth option of "+E.depth+" and strictDepth is true");V.push("["+q.slice(h.index)+"]")}return H(V,Y,E,I)},F=function(D){if(!D)return b;if(typeof D.allowEmptyArrays<"u"&&typeof D.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof D.decodeDotInKeys<"u"&&typeof D.decodeDotInKeys!=="boolean")throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(D.decoder!==null&&typeof D.decoder<"u"&&typeof D.decoder!=="function")throw TypeError("Decoder has to be a function.");if(typeof D.charset<"u"&&D.charset!=="utf-8"&&D.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof D.throwOnLimitExceeded<"u"&&typeof D.throwOnLimitExceeded!=="boolean")throw TypeError("`throwOnLimitExceeded` option must be a boolean");var Y=typeof D.charset>"u"?b.charset:D.charset,E=typeof D.duplicates>"u"?b.duplicates:D.duplicates;if(E!=="combine"&&E!=="first"&&E!=="last")throw TypeError("The duplicates option must be either combine, first, or last");var I=typeof D.allowDots>"u"?D.decodeDotInKeys===!0?!0:b.allowDots:!!D.allowDots;return{allowDots:I,allowEmptyArrays:typeof D.allowEmptyArrays==="boolean"?!!D.allowEmptyArrays:b.allowEmptyArrays,allowPrototypes:typeof D.allowPrototypes==="boolean"?D.allowPrototypes:b.allowPrototypes,allowSparse:typeof D.allowSparse==="boolean"?D.allowSparse:b.allowSparse,arrayLimit:typeof D.arrayLimit==="number"?D.arrayLimit:b.arrayLimit,charset:Y,charsetSentinel:typeof D.charsetSentinel==="boolean"?D.charsetSentinel:b.charsetSentinel,comma:typeof D.comma==="boolean"?D.comma:b.comma,decodeDotInKeys:typeof D.decodeDotInKeys==="boolean"?D.decodeDotInKeys:b.decodeDotInKeys,decoder:typeof D.decoder==="function"?D.decoder:b.decoder,delimiter:typeof D.delimiter==="string"||W.isRegExp(D.delimiter)?D.delimiter:b.delimiter,depth:typeof D.depth==="number"||D.depth===!1?+D.depth:b.depth,duplicates:E,ignoreQueryPrefix:D.ignoreQueryPrefix===!0,interpretNumericEntities:typeof D.interpretNumericEntities==="boolean"?D.interpretNumericEntities:b.interpretNumericEntities,parameterLimit:typeof D.parameterLimit==="number"?D.parameterLimit:b.parameterLimit,parseArrays:D.parseArrays!==!1,plainObjects:typeof D.plainObjects==="boolean"?D.plainObjects:b.plainObjects,strictDepth:typeof D.strictDepth==="boolean"?!!D.strictDepth:b.strictDepth,strictNullHandling:typeof D.strictNullHandling==="boolean"?D.strictNullHandling:b.strictNullHandling,throwOnLimitExceeded:typeof D.throwOnLimitExceeded==="boolean"?D.throwOnLimitExceeded:!1}};w.exports=function(D,Y){var E=F(Y);if(D===""||D===null||typeof D>"u")return E.plainObjects?{__proto__:null}:{};var I=typeof D==="string"?G(D,E):D,q=E.plainObjects?{__proto__:null}:{},U=Object.keys(I);for(var B=0;B<U.length;++B){var h=U[B],u=Q(h,I[h],E,typeof D==="string");q=W.merge(q,u,E)}if(E.allowSparse===!0)return q;return W.compact(q)}}),N9=m((K,w)=>{var W=J9(),S=O9(),M=t6();w.exports={formats:M,parse:S,stringify:W}}),EW=J6(e6(),1),I9={};g1(I9,{zodSchemaKey:()=>B9,webSocketServerArgsKey:()=>B4,webSocketMessageArgsKey:()=>a4,webSocketKey:()=>b6,webSocketEventKey:()=>X9,webSocketEventArgumentsKey:()=>D9,webSocketConnectionArgsKey:()=>X4,webSocketCloseReasonArgsKey:()=>BK,webSocketCloseCodeArgsKey:()=>GK,routeModelArgsKey:()=>r2,responseStatusTextArgsKey:()=>QK,responseStatusArgsKey:()=>K6,responseHeadersArgsKey:()=>y2,responseBodyArgsKey:()=>s4,requestHeadersArgsKey:()=>W4,requestHeaderArgsKey:()=>p2,requestBodyArgsKey:()=>Q4,requestArgsKey:()=>i2,queryArgsKey:()=>XK,paramsArgsKey:()=>l6,paramArgsKey:()=>$4,moduleKey:()=>t4,middlewareKey:()=>s6,interceptorKey:()=>a6,injectableKey:()=>DK,injectKey:()=>M6,httpServerArgsKey:()=>l2,guardKey:()=>IK,controllerKey:()=>S6,controllerHttpKey:()=>G9,contextArgsKey:()=>S4,containerKey:()=>G4,configKey:()=>T6,argumentsKey:()=>V2});var V2=Symbol.for("____boolTypescriptCore:arguments__"),D9=Symbol.for("____boolTypescriptCore:webSocketEventArguments__"),T6=Symbol.for("____boolTypescriptCore:config__"),S6=Symbol.for("____boolTypescriptCore:controller__"),a6=Symbol.for("____boolTypescriptCore:interceptor__"),IK=Symbol.for("____boolTypescriptCore:guard__"),G9=Symbol.for("____boolTypescriptCore:controller.http__"),M6=Symbol.for("____boolTypescriptCore:inject__"),DK=Symbol.for("____boolTypescriptCore:injectable__"),s6=Symbol.for("____boolTypescriptCore:middleware__"),t4=Symbol.for("____boolTypescriptCore:module__"),G4=Symbol.for("____boolTypescriptCore:container__"),B9=Symbol.for("____boolTypescriptCore:zodSchema__"),b6=Symbol.for("____boolTypescriptCore:webSocket__"),X9=Symbol.for("____boolTypescriptCore:webSocket:event__"),B4=Symbol.for("____boolTypescriptCore:webSocketArguments:server__"),X4=Symbol.for("____boolTypescriptCore:webSocketArguments:connection__"),a4=Symbol.for("____boolTypescriptCore:webSocketArguments:message__"),GK=Symbol.for("____boolTypescriptCore:webSocketArguments:closeCode__"),BK=Symbol.for("____boolTypescriptCore:webSocketArguments:closeReason__"),l2=Symbol.for("____boolTypescriptCore:httpArguments:server__"),W4=Symbol.for("____boolTypescriptCore:httpArguments:requestHeaders__"),p2=Symbol.for("____boolTypescriptCore:httpArguments:requestHeader__"),Q4=Symbol.for("____boolTypescriptCore:httpArguments:requestBody__"),l6=Symbol.for("____boolTypescriptCore:httpArguments:params__"),$4=Symbol.for("____boolTypescriptCore:httpArguments:param__"),XK=Symbol.for("____boolTypescriptCore:httpArguments:query__"),i2=Symbol.for("____boolTypescriptCore:httpArguments:request__"),y2=Symbol.for("____boolTypescriptCore:httpArguments:responseHeaders__"),S4=Symbol.for("____boolTypescriptCore:httpArguments:context__"),r2=Symbol.for("____boolTypescriptCore:httpArguments:routeModel__"),s4=Symbol.for("____boolTypescriptCore:httpArguments:responseBody__"),K6=Symbol.for("____boolTypescriptCore:httpArguments:responseStatus__"),QK=Symbol.for("____boolTypescriptCore:httpArguments:responseStatusText__"),$K=(K)=>(w,W,S)=>{if(!W)return;let M=Reflect.getOwnMetadata(V2,w.constructor,W)||{};M[`argumentIndexes.${S}`]={index:S,type:W4,validationSchema:K},Reflect.defineMetadata(V2,M,w.constructor,W)};var I6=(K)=>(w,W,S)=>{if(!W)return;let M=Reflect.getOwnMetadata(V2,w.constructor,W)||{};M[`argumentIndexes.${S}`]={index:S,type:S4,key:K},Reflect.defineMetadata(V2,M,w.constructor,W)},zK=()=>(K,w,W)=>{if(!w)return;let S=Reflect.getOwnMetadata(V2,K.constructor,w)||{};S[`argumentIndexes.${W}`]={index:W,type:r2},Reflect.defineMetadata(V2,S,K.constructor,w)};var UK=(K)=>(w,W,S)=>{let M=Reflect.getMetadata(M6,w)||[];M[S]=K,Reflect.defineMetadata(M6,M,w)};var YK=()=>(K)=>{Reflect.defineMetadata(a6,void 0,K)},HK=()=>(K)=>{Reflect.defineMetadata(s6,void 0,K)};var vW=Symbol("__bool:webSocket.upgrade__");var Q9=Object.freeze({400:"BAD_REQUEST",401:"UNAUTHORIZED",402:"PAYMENT_REQUIRED",403:"FORBIDDEN",404:"NOT_FOUND",405:"METHOD_NOT_ALLOWED",406:"NOT_ACCEPTABLE",407:"PROXY_AUTHENCATION_REQUIRED",408:"REQUEST_TIMEOUT",409:"CONFLICT",410:"GONE",411:"LENGTH_REQUIRED",412:"PRECONDITION_FAILED",413:"PAYLOAD_TOO_LARGE",414:"URI_TOO_LONG",415:"UNSUPPORTED_MEDIA_TYPE",416:"RANGE_NOT_SATISFIABLE",417:"EXPECTATION_FAILED",418:"IM_A_TEAPOT",421:"MISDIRECTED_REQUEST",422:"UNPROCESSABLE_ENTITY",423:"LOCKED",424:"FAILED_DEPENDENCY",425:"TOO_EARLY_",426:"UPGRAGE_REQUIRED",428:"PRECONDITION_REQUIRED",429:"TOO_MANY_REQUESTS",431:"REQUEST_HEADER_FIELDS_TOO_LARGE",451:"UNAVAILABLE_FOR_LEGAL_REASONS"});class M4 extends Error{httpCode;message;data;constructor({httpCode:K,data:w,message:W}){super();this.httpCode=K,this.message=!W?.trim()?Q9[K]:W.trim(),this.data=w}}var $9=Object.freeze({500:"INTERNAL_SERVER_ERROR",501:"NOT_IMPLEMENTED",502:"BAD_GATEWAY",503:"SERVICE_UNAVAILABLE",504:"GATEWAY_TIMEOUT",505:"HTTP_VERSION_NOT_SUPPORTED",506:"VARIANT_ALSO_NEGOTIATES",507:"INSUFFICIENT_STORAGE",508:"LOOP_DETECTED",510:"NOT_EXTENDED",511:"NETWORK_AUTHENTICATION_REQUIRED"});class K8 extends Error{httpCode;message;data;constructor({httpCode:K,data:w,message:W}){super();this.httpCode=K,this.message=!W?.trim()?$9[K]:W.trim(),this.data=w}}var z9=(K,w=new Headers)=>{if(w.set("Content-Type","application/json"),K instanceof M4||K instanceof K8)return new Response(JSON.stringify(K),{status:K.httpCode,statusText:K.message,headers:w});return new Response(JSON.stringify((()=>{switch(typeof K){case"object":return!(K instanceof Error)?K:{message:K.message,code:K.name,cause:K.cause};case"string":return{message:K};case"number":return{code:K};default:return}})()),{status:500,statusText:"INTERNAL SERVER ERROR",headers:w})},A2;(function(K){K.year="year",K.month="month",K.day="day",K.hours="hours",K.minutes="minutes",K.seconds="seconds",K.miliseconds="miliseconds"})(A2||(A2={}));var U9=(K,w,W=A2.day)=>{let S=K instanceof Date?K:new Date(K);switch(W){case A2.year:S.setFullYear(S.getFullYear()+w);break;case A2.month:S.setMonth(S.getMonth()+w);break;case A2.day:S.setDate(S.getDate()+w);break;case A2.hours:S.setHours(S.getHours()+w);break;case A2.minutes:S.setMinutes(S.getMinutes()+w);break;case A2.seconds:S.setSeconds(S.getSeconds()+w);break;case A2.miliseconds:S.setMilliseconds(S.getMilliseconds()+w);break}return S},Y9=J6(N9(),1),RW=async function(){}.constructor,s8=Object.freeze({black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37,gray:90}),KK=Object.freeze({black:40,red:41,green:42,yellow:43,blue:44,magenta:45,cyan:46,white:47,gray:100}),w4=(K,w={})=>{let{color:W,backgroundColor:S,bold:M,underline:b}=w,P="";if(M)P+="\x1B[1m";if(b)P+="\x1B[4m";if(W&&s8[W])P+=`\x1B[${s8[W]}m`;if(S&&KK[S])P+=`\x1B[${KK[S]}m`;return`${P}${K}\x1B[0m`},H9=(K)=>{let{headers:w,method:W}=K,S=w.get("upgrade")?.toLowerCase()||"",M=w.get("connection")?.toLowerCase()||"";return W==="GET"&&S?.toLowerCase()==="websocket"&&M?.toLowerCase().includes("upgrade")};class w6{_staticMap=new Map;_dynamicMap=new Map;_options=void 0;constructor(...K){K.forEach((w)=>{w.staticEntries.forEach(([W,S])=>this.set(W,S,{isStatic:!0,isPassthrough:!0})),w.dynamicEntries.forEach(([W,S])=>this.set(W,S,{isStatic:!1}))})}get(K,w){return!(w||this._options)?.isStatic?this._dynamicMap.get(K):this._staticMap.get(K)}has(K,w){return!(w||this._options)?.isStatic?this._dynamicMap.has(K):this._staticMap.has(K)}set(K,w,W){let S=W||this._options;if(!S?.isStatic)this._dynamicMap.set(K,w);else if(!this._staticMap.has(K))this._staticMap.set(K,w);else if(!S.isPassthrough)throw Error(`${String(K)} already exists in context static collection.`);return this}setOptions(K){return this._options=K,this}get staticEntries(){return[...this._staticMap.entries()]}get dynamicEntries(){return[...this._dynamicMap.entries()]}}class e2{static rootPattern=":([a-z0-9A-Z_-]{1,})";static innerRootPattern="([a-z0-9A-Z_-]{1,})";alias;_map=new Map;constructor(K){this.alias=this._thinAlias(K)}test(K,w){try{let W=this._map.get(w),S=this.alias.split("/"),M=this._thinAlias(K).split("/");if(!W)return;if(S.length!==M.length)return;let b=Object(),P=this.alias.replace(new RegExp(e2.rootPattern,"g"),e2.innerRootPattern);if(!new RegExp(P).test(this._thinAlias(K)))return;for(let J=0;J<S.length;J++){let O=S[J],N=M[J];if(!new RegExp(e2.rootPattern,"g").test(O)){if(O!==N)return}else{let G=!1;if(O.replace(new RegExp(e2.rootPattern,"g"),(H,Q,F)=>{if(F===0)N.replace(new RegExp(e2.innerRootPattern,"g"),(D,Y,E)=>{if(E===0)Object.assign(b,{[Q]:D});return D});return H}),G)return}continue}return Object.freeze({parameters:b,model:W})}catch(W){return console.error(W),!1}}isMatch(K,w){try{if(!this._map.get(w))return;let W=this.alias.split("/"),S=this._thinAlias(K).split("/");if(W.length!==S.length)return!1;let M=Object();for(let b=0;b<W.length;b++){let P=W[b],J=S[b];if(!new RegExp(e2.rootPattern,"g").test(P)){if(P!==J)return!1}else{let O=!1;if(P.replace(new RegExp(e2.rootPattern,"g"),(N,G,H)=>{if(!new RegExp(H,"g").test(J))O=!0;else Object.assign(M,{[G]:J});return""}),O)return!1}continue}return!0}catch(W){console.error(W);return}}get(K){if(!this._map.get("GET"))this._map.set("GET",K);return this}post(K){if(!this._map.get("POST"))this._map.set("POST",K);return this}put(K){if(!this._map.get("PUT"))this._map.set("PUT",K);return this}delete(K){if(!this._map.get("DELETE"))this._map.set("DELETE",K);return this}connect(K){if(!this._map.get("CONNECT"))return this._map.set("CONNECT",K);return this}options(K){if(!this._map.get("OPTIONS"))return this._map.set("OPTIONS",K);return this}trace(K){if(!this._map.get("TRACE"))return this._map.set("TRACE",K);return this}patch(K){if(!this._map.get("PATCH"))return this._map.set("PATCH",K);return this}_thinAlias(K){return K.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}get _fullPath(){return this.alias.split("/").map((K,w)=>{let W=new RegExp(":([a-z0-9A-Z_.-]{1,})(\\(.*?\\))","g");if(!W.test(K)){if(W=new RegExp(":([a-z0-9A-Z_.-]{1,})","g"),!W.test(K))return K;return K.replace(W,(S,M)=>`${S}(.*?)`)}return K}).join("/")}get _filteredPath(){return this.alias.split("/").map((K,w)=>{let W=new RegExp(":([a-z0-9A-Z_.-]{1,})((.*?))","g");if(!W.test(K)){if(W=new RegExp(":([a-z0-9A-Z_.-]{1,})","g"),!W.test(K))return K;return K.replace(W,(S,M)=>"(.*?)")}return K.replace(W,(S,M,b)=>b)}).join("/")}}var V9=e2;class p6{alias;_routes=new Map;constructor(K){this.alias=this._thinAlias(K)}route(K){let w=this._thinAlias(`${this.alias}/${K}`),W=this._routes.get(w),S=!W?new V9(`${this.alias}/${K}`):W;if(!W)this._routes.set(w,S);return S}_thinAlias(K){return K.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}get routes(){return this._routes}}class i6{_routers=new Map;add(...K){for(let w of K){if(this._routers.has(w.alias))continue;this._routers.set(w.alias,w)}return this}find(K,w){for(let W of this._routers.values())for(let S of W.routes.values()){let M=S.test(K,w);if(!M)continue;return M}return}}var jW=J6(e6(),1);class W6{_mapper=new Map;constructor(...K){K.forEach((w)=>{w.entries.forEach(([W,S])=>{this._mapper.set(W,S)})})}get(K){if(this._mapper.has(K))return this._mapper.get(K);if(typeof K!=="function")return;let w=Reflect.getMetadataKeys(K);if(![DK,S6,s6,IK,a6,b6].some((M)=>w.includes(M)))throw Error("Missing dependency declaration, please check @Injectable() used on dependency(ies).");let W=(Reflect.getOwnMetadata(M6,K)||[]).map((M)=>this.get(M)),S=new K(...W);return this._mapper.set(K,S),S}set(K,w){if(this._mapper.has(K))throw Error(`${String(K)} already exists in injector collection.`);this._mapper.set(K,w)}get entries(){return[...this._mapper.entries()]}}class VK{error;constructor(K){this.error=K}}var L9=VK;class LK{eventName;metadata;_context=void 0;constructor({eventName:K,metadata:w}){this.eventName=K,this.metadata=w}bind(K){return this._context=K,this}execute(){if(this._context&&typeof this.metadata.descriptor.value==="function")this.metadata.descriptor.value=this.metadata.descriptor.value.bind(this._context);return Object.freeze({methodName:this.metadata.methodName,descriptor:this.metadata.descriptor,arguments:this.metadata.arguments})}}class w8{rawAlias;alias;routes=[];constructor(K="/"){this.rawAlias=K,this.alias=w8.thinAlias(K)}addRoutes(...K){for(let w of K)if(!this.routes.includes(w))this.routes.push(w);return this}bind(K){for(let w of this.routes)w.bind(K);return this}execute(){let K=new Map;for(let w of this.routes)K.set(`${this.alias}:::${w.eventName}`,w.execute());return K}static thinAlias(K){return K.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class P6{rawPrefix;prefix;routers=[];constructor(K="/"){this.rawPrefix=K,this.prefix=P6.thinPrefix(K)}addRouters(...K){for(let w=0;w<K.length;w++)if(!this.routers.includes(K[w]))this.routers.push(K[w]);for(let w of K)if(!this.routers.includes(w))this.routers.push(w);return this}execute(){let K=new Map;for(let w of this.routers){let W=w.execute();for(let[S,M]of W.entries())K.set(`/${P6.thinPrefix(`${this.prefix}/${S}`)}`,M)}return K}static thinPrefix(K){return K.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class q9{classConstructor;options;#K;#w;#W=new W6;#S=new Map;#b;#P=900;#M;constructor(K,w){if(this.classConstructor=K,this.options=w,this.#w=Reflect.getOwnMetadataKeys(K),!this.#w.includes(G4)&&!this.#w.includes(t4))throw Error(`Can not detect! ${K.name} class is not a container or module.`);this.#P=typeof w.static?.cacheTimeInSeconds!=="number"?900:w.static.cacheTimeInSeconds,this.#b=Object.freeze({allowLogsMethods:this.options?.log?.methods||[],staticOption:this.options.static,allowOrigins:!this.options.cors?.origins?["*"]:typeof this.options.cors.origins!=="string"?this.options.cors.origins.includes("*")||this.options.cors.origins.length<1?["*"]:this.options.cors.origins:[this.options.cors.origins!=="*"?this.options.cors.origins:"*"],allowMethods:this.options.cors?.methods||["GET","POST","PUT","PATCH","DELETE","OPTIONS"],allowCredentials:!this.options.cors?.credentials?!1:!0,allowHeaders:!this.options.cors?.headers||this.options.cors.headers.includes("*")?["*"]:this.options.cors.headers})}useValidator(K){this.#M=K}async preLaunch(){if(this.#K)return this.#K;let K=!this.#w.includes(G4)?void 0:Reflect.getOwnMetadata(G4,this.classConstructor),w=!this.#w.includes(G4)?[this.classConstructor]:K?.modules||[],W=!K?void 0:await this.containerResolution({containerClass:this.classConstructor,options:this.options,extendInjector:this.#W}),S=await Promise.all(w.map((P)=>this.moduleResolution({moduleClass:P,options:this.options,extendInjector:!W?this.#W:W.injector})));if([...new Set(S.map((P)=>P.prefix))].length!==S.length)throw Error("Module prefix should be unique.");let M=new Map;for(let P of S){let J=P.webSocketRouterGroup.execute();for(let[O,N]of J.entries())M.set(O,N)}let b=Object.freeze({containerMetadata:K,modulesConverted:w,resolutedContainer:W,resolutedModules:S,webSocketsMap:M});return this.#K=b,b}async listen(){let{allowLogsMethods:K,allowOrigins:w,allowMethods:W,allowHeaders:S,allowCredentials:M,staticOption:b}=this.#b,{resolutedContainer:P,resolutedModules:J,webSocketsMap:O}=await this.preLaunch(),N=Bun.serve({port:this.options.port,fetch:async(G,H)=>{let Q=performance.now(),F=new URL(G.url),D=Y9.parse(F.searchParams.toString(),this.options.queryParser),Y=G.headers.get("origin")||"*",E=G.method.toUpperCase(),I=new Headers,q=new w6().setOptions({isStatic:!0}).set(l2,H).set(i2,G).set(p2,G.headers).set(y2,I).set(XK,D);try{let U=H9(G),B;if(U){for(let C of J){let y=C.webSocketHttpRouterGroup.find(F.pathname,G.method);if(y){B=Object.freeze({route:y,resolution:C});break}}if(!B)return this.finalizeResponse(new Response(JSON.stringify({httpCode:404,message:"Route not found.",data:void 0}),{status:404,statusText:"Not found.",headers:I}));let g=await this.webSocketFetcher({request:G,server:H},{query:D,responseHeaders:I,route:B.route,moduleResolution:B.resolution});return g instanceof Response?g:void 0}if([...!M?[]:[{key:"Access-Control-Allow-Credentials",value:"true"}],{key:"Access-Control-Allow-Origin",value:w.includes("*")?"*":!w.includes(Y)?w[0]:Y},{key:"Access-Control-Allow-Methods",value:W.join(", ")},{key:"Access-Control-Allow-Headers",value:S.join(", ")}].forEach(({key:g,value:C})=>I.set(g,C)),!W.includes(E))return this.finalizeResponse(new Response(void 0,{status:405,statusText:"Method Not Allowed.",headers:I}));if(G.method.toUpperCase()==="OPTIONS")return this.finalizeResponse(w.includes("*")||w.includes(Y)?new Response(void 0,{status:204,statusText:"No Content.",headers:I}):new Response(void 0,{status:417,statusText:"Expectation Failed.",headers:I}));if(b){let{path:g,headers:C}=b,y=`${g}/${F.pathname}`,e=this.#S.get(y);if(!e){let r=Bun.file(y);if(await r.exists()){if(C)for(let[s,O2]of Object.entries(C))I.set(s,O2);return I.set("Content-Type",r.type),this.finalizeResponse(new Response(await r.arrayBuffer(),{status:200,statusText:"SUCCESS",headers:I}))}}else{let r=new Date>e.expiredAt;if(r)this.#S.delete(y);let s=!r?e.file:Bun.file(y);if(await s.exists()){if(this.#S.set(y,Object.freeze({expiredAt:U9(new Date,this.#P,A2.seconds),file:s})),C)for(let[O2,W2]of Object.entries(C))I.set(O2,W2);return I.set("Content-Type",s.type),this.finalizeResponse(new Response(await s.arrayBuffer(),{status:200,statusText:"SUCCESS",headers:I}))}}}if(P){let{context:g}=await this.httpFetcher({context:q,resolutedMap:{injector:P.injector,startMiddlewareGroup:P.startMiddlewareGroup,guardGroup:P.guardGroup},options:{isContainer:!0}});q=g}for(let g of J){let C=g.controllerRouterGroup.find(F.pathname,E);if(C){B=Object.freeze({route:C,resolution:g});break}}if(!B)q.setOptions({isStatic:!1}).set(K6,404).set(QK,"Not found.").set(s4,JSON.stringify({httpCode:404,message:"Route not found.",data:void 0}));else{let{context:g}=await this.httpFetcher({context:q,route:B.route,resolutedMap:B.resolution});q=g}if(P){let{context:g}=await this.httpFetcher({context:q,resolutedMap:{injector:P.injector,endMiddlewareGroup:P.endMiddlewareGroup},options:{isContainer:!0}});q=g}let h=q.get(y2,{isStatic:!0})||new Headers,u=q.get(s4,{isStatic:!1})||void 0,V=q.get(K6,{isStatic:!1}),x=q.get(K6,{isStatic:!1});return this.serializeResponse({status:typeof V!=="number"?void 0:V,statusText:typeof x!=="string"?void 0:x,headers:h,data:u})}catch(U){return this.options.debug&&console.error(U),this.finalizeResponse(z9(U,I))}finally{if(K){let U=performance.now(),B=w4(F.pathname,{color:"blue"}),h=`${Bun.color("yellow","ansi")}${process.pid}`,u=w4(G.method,{color:"yellow",backgroundColor:"blue"}),V=w4(`${G.headers.get("x-forwarded-for")||G.headers.get("x-real-ip")||H.requestIP(G)?.address||"<Unknown>"}`,{color:"yellow"}),x=w4(`${Math.round((U-Q+Number.EPSILON)*100)/100}ms`,{color:"yellow",backgroundColor:"blue"});K.includes(G.method.toUpperCase())&&console.info(`PID: ${h} - Method: ${u} - IP: ${V} - ${B} - Time: ${x}`)}}},websocket:{open:(G)=>{let H=`${G.data.pathname}:::open`,Q=O.get(H);if(!Q)return;let F=Q.arguments||{},D=[];for(let[Y,E]of Object.entries(F))switch(E.type){case X4:D[E.index]=G;break;case B4:D[E.index]=N;break}Q.descriptor.value(...D)},close:(G,H,Q)=>{let F=`${G.data.pathname}:::close`,D=O.get(F);if(!D)return;let Y=D.arguments||{},E=[];for(let[I,q]of Object.entries(Y))switch(q.type){case X4:E[q.index]=G;break;case B4:E[q.index]=N;break;case GK:E[q.index]=H;break;case BK:E[q.index]=Q;break}D.descriptor.value(...E)},message:(G,H)=>{let Q=`${G.data.pathname}:::message`,F=O.get(Q);if(!F)return;let D=F.arguments||{},Y=[];for(let[E,I]of Object.entries(D))switch(I.type){case X4:Y[I.index]=G;break;case a4:Y[I.index]=H;break;case B4:Y[I.index]=N;break}F.descriptor.value(...Y)},drain:(G)=>{let H=`${G.data.pathname}:::drain`,Q=O.get(H);if(!Q)return;let F=Q.arguments||{},D=[];for(let[Y,E]of Object.entries(F))switch(E.type){case X4:D[E.index]=G;break;case B4:D[E.index]=N;break}Q.descriptor.value(...D)},ping:(G,H)=>{let Q=`${G.data.pathname}:::ping`,F=O.get(Q);if(!F)return;let D=F.arguments||{},Y=[];for(let[E,I]of Object.entries(D))switch(I.type){case X4:Y[I.index]=G;break;case B4:Y[I.index]=N;break;case a4:Y[I.index]=H;break}F.descriptor.value(...Y)},pong:(G,H)=>{let Q=`${G.data.pathname}:::pong`,F=O.get(Q);if(!F)return;let D=F.arguments||{},Y=[];for(let[E,I]of Object.entries(D))switch(I.type){case X4:Y[I.index]=G;break;case B4:Y[I.index]=N;break;case a4:Y[I.index]=H;break}F.descriptor.value(...Y)}}})}async containerResolution({containerClass:K,options:w,extendInjector:W}){if(!Reflect.getOwnMetadataKeys(K).includes(G4))throw Error(`${K.name} is not a container.`);let S=new W6(W),M=Reflect.getOwnMetadata(G4,K),{loaders:b,middlewares:P,guards:J,dependencies:O,config:N}=M||{},{config:G}=Object.freeze({config:{...typeof w.config!=="function"?w.config:await w.config(),...typeof N!=="function"?typeof N!=="object"?void 0:("key"in N)&&("value"in N)&&typeof N.key==="symbol"?typeof N.value!=="function"?N.value:await N.value():N:await N()}});if(S.set(N&&"key"in N&&"value"in N&&typeof N.key==="symbol"?N.key:T6,G),b){let D=[];for(let[E,I]of Object.entries(b))D.push(async()=>{try{let q=await I({config:G});return console.info(`${w4(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${E}] initialized successfully.`),q}catch(q){throw console.error(`${w4(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${E}] initialization failed.`),w.debug&&console.error(q),q}});let Y=await Promise.all(D.map((E)=>E()));for(let[E,I]of Y)S.set(E,I)}!O||O.map((D)=>S.get(D));let H=[],Q=[];!P||P.forEach((D)=>{let Y=S.get(D);if(Y.start&&typeof Y.start==="function"){let E=Reflect.getOwnMetadata(V2,D,"start")||{};H.push(Object.freeze({class:D,funcName:"start",func:Y.start.bind(Y),argumentsMetadata:E}))}if(Y.end&&typeof Y.end==="function"){let E=Reflect.getOwnMetadata(V2,D,"end")||{};Q.push(Object.freeze({class:D,funcName:"end",func:Y.end.bind(Y),argumentsMetadata:E}))}});let F=!J?[]:J.map((D)=>{let Y=S.get(D),E=Reflect.getOwnMetadata(V2,D,"enforce")||{};return Object.freeze({class:D,funcName:"enforce",func:Y.enforce.bind(Y),argumentsMetadata:E})});return Object.freeze({injector:S,startMiddlewareGroup:H,endMiddlewareGroup:Q,guardGroup:F})}async moduleResolution({moduleClass:K,options:w,extendInjector:W}){if(!Reflect.getOwnMetadataKeys(K).includes(t4))throw Error(`${K.name} is not a module.`);let S=new W6(W),M=Reflect.getOwnMetadata(t4,K),{loaders:b,middlewares:P,guards:J,interceptors:O,controllers:N,dependencies:G,webSockets:H,prefix:Q,config:F}=M||{},D=`${w.prefix||""}/${Q||""}`,{config:Y}=Object.freeze({config:!F?void 0:{...typeof w.config!=="function"?w.config:await w.config(),...typeof F!=="function"?typeof F!=="object"?void 0:("key"in F)&&("value"in F)&&typeof F.key==="symbol"?typeof F.value!=="function"?F.value:await F.value():F:await F()}});if(Y&&S.set(F&&"key"in F&&"value"in F&&typeof F.key==="symbol"?F.key:T6,Y),b){let x=[];for(let[C,y]of Object.entries(b))x.push(async()=>{try{let e=await y({config:Y});return console.info(`${w4(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${C}] initialized successfully.`),e}catch(e){throw console.error(`${w4(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${C}] initialization failed.`),w.debug&&console.error(e),e}});let g=await Promise.all(x.map((C)=>C()));for(let C=0;C<g.length;C++){let[y,e]=g[C];S.set(y,e)}}!G||G.map((x)=>S.get(x));let E=[],I=[];!P||P.forEach((x)=>{let g=S.get(x);if(g.start&&typeof g.start==="function"){let C=Reflect.getOwnMetadata(V2,x,"start")||{};E.push(Object.freeze({class:x,funcName:"start",func:g.start.bind(g),argumentsMetadata:C}))}if(g.end&&typeof g.end==="function"){let C=Reflect.getOwnMetadata(V2,x,"end")||{};I.push(Object.freeze({class:x,funcName:"end",func:g.end.bind(g),argumentsMetadata:C}))}});let q=!J?[]:J.map((x)=>{let g=S.get(x),C=Reflect.getOwnMetadata(V2,x,"enforce")||{};return Object.freeze({class:x,funcName:"enforce",func:g.enforce.bind(g),argumentsMetadata:C})}),U=[],B=[];!O||O.forEach((x)=>{let g=S.get(x);if(g.open&&typeof g.open==="function"){let C=Reflect.getOwnMetadata(V2,x,"open")||{};U.push(Object.freeze({class:x,funcName:"open",func:g.open.bind(g),argumentsMetadata:C}))}if(g.close&&typeof g.close==="function"){let C=Reflect.getOwnMetadata(V2,x,"close")||{};B.push(Object.freeze({class:x,funcName:"close",func:g.close.bind(g),argumentsMetadata:C}))}});let h=new i6;!N||N.forEach((x)=>this.initControllerInstance({controllerConstructor:x,httpRouterGroup:h,injector:S,prefix:D}));let u=new i6,V=new P6;return H&&H.forEach((x)=>this.initWebSocketInstance({webSocketConstructor:x,httpRouterGroup:u,webSocketRouterGroup:V,injector:S,prefix:D})),Object.freeze({prefix:Q||"",injector:S,startMiddlewareGroup:E,endMiddlewareGroup:I,guardGroup:q,openInterceptorGroup:U,closeInterceptorGroup:B,controllerRouterGroup:h,webSocketHttpRouterGroup:u,webSocketRouterGroup:V})}async argumentsResolution(K,w,W,S){if(!this.#M)return K;try{let M=await this.#M.validate(K,w,W,S);if(!(M instanceof L9))return M;throw new M4({httpCode:400,message:`Validation at the [${S.toString()}] method fails at positional argument [${W}].`,data:M.error})}catch(M){if(M instanceof M4)throw M;throw new K8({httpCode:500,message:`Validation at the [${S.toString()}] method error at positional argument [${W}].`,data:!(M instanceof Error)?M:[{message:M.message,code:M.name,cause:M.cause}]})}}initControllerInstance({controllerConstructor:K,httpRouterGroup:w,injector:W,prefix:S}){if(!Reflect.getOwnMetadataKeys(K).includes(S6))throw Error(`${K.name} is not a controller.`);let M=W.get(K);if(!M)throw Error("Can not initialize controller.");let b=Reflect.getOwnMetadata(S6,K)||{prefix:"/",httpMetadata:[]},P=new p6(`/${S||""}/${b.prefix}`);return b.httpMetadata.forEach((J)=>{if(typeof J.descriptor.value!=="function")return;let O=P.route(J.path),N=J.descriptor.value.bind(M),G=Object.freeze({class:K,funcName:J.methodName,func:N,argumentsMetadata:J.argumentsMetadata});switch(J.httpMethod){case"GET":return O.get(G);case"POST":return O.post(G);case"PUT":return O.put(G);case"PATCH":return O.patch(G);case"DELETE":return O.delete(G);case"OPTIONS":return O.options(G)}}),w.add(P)}initWebSocketInstance({injector:K,httpRouterGroup:w,prefix:W,webSocketRouterGroup:S,webSocketConstructor:M}){if(!Reflect.getOwnMetadataKeys(M).includes(b6))throw Error(`${M.name} is not a websocket route.`);let b=K.get(M);if(!b)throw Error("Can not initialize webSocket.");let P=Reflect.getOwnMetadata(b6,M)||{prefix:"/",events:[],http:[]},J=`/${W||""}/${P.prefix}`,O=new p6(J);for(let[G,H]of Object.entries(P.http)){if(typeof H.descriptor?.value!=="function")continue;let Q=O.route(H.path),F=H.descriptor.value.bind(b),D=Object.freeze({class:M,funcName:H.methodName,func:F,argumentsMetadata:H.argumentsMetadata});switch(H.httpMethod){case"GET":Q.get(D);break;case"POST":Q.post(D);break}}w.add(O);let N=new w8(J);for(let[G,H]of Object.entries(P.events)){let Q=new LK({eventName:G,metadata:H});N.addRoutes(Q)}return N.bind(b),S.addRouters(N),Object.freeze({httpRouterGroup:w,webSocketRouterGroup:S})}serializeResponse({status:K,statusText:w,headers:W,data:S}){let M=W.get("Content-Type")||"text/plain";if(M.includes("application/json"))return this.finalizeResponse(new Response(S instanceof ReadableStream?S:JSON.stringify(S),{status:K,statusText:w,headers:W}));if(M.includes("text/plain")||M.includes("text/html"))return this.finalizeResponse(new Response(S instanceof ReadableStream?S:String(S),{status:K,statusText:w,headers:W}));if(M.includes("application/octet-stream")){if(S instanceof Uint8Array||S instanceof ArrayBuffer||S instanceof Blob||S instanceof ReadableStream)return this.finalizeResponse(new Response(S,{status:K,statusText:w,headers:W}));throw Error("Invalid data type for application/octet-stream")}if(M.includes("multipart/form-data")){if(S instanceof FormData)return this.finalizeResponse(new Response(S,{status:K,statusText:w,headers:W}));throw Error("multipart/form-data requires FormData object")}return this.finalizeResponse(new Response(String(S),{status:K,statusText:w,headers:W}))}finalizeResponse(K){return K.headers.set("X-Powered-By","Bool Typescript"),K}async httpFetcher({context:K,route:w,options:W,resolutedMap:S}){let M={isStatic:!0},b=(!K?new w6:new w6(K)).setOptions(M);if(w)b.set(l6,w.parameters).set(r2,w.model);let P=b.get(l2,M)||void 0,J=b.get(i2,M)||void 0,O=b.get(p2,M)||void 0,N=b.get(y2,M)||void 0,G=b.get(l6,M)||void 0,H=b.get(r2,M)||void 0;if(S){let{startMiddlewareGroup:Q,guardGroup:F}=S;if(Q)for(let D=0;D<Q.length;D++){let Y=[],{func:E,funcName:I,argumentsMetadata:q}=Q[D];for(let[U,B]of Object.entries(q))switch(B.type){case S4:Y[B.index]=!B.key?b:b.get(B.key,M);break;case i2:Y[B.index]=!B.validationSchema?J:await this.argumentsResolution(J,B.validationSchema,B.index,I);break;case Q4:Y[B.index]=!B.validationSchema?await J?.[B.parser||"json"]():await this.argumentsResolution(await J?.[B.parser||"json"](),B.validationSchema,B.index,I);break;case W4:Y[B.index]=!B.validationSchema?O:await this.argumentsResolution(O?.toJSON(),B.validationSchema,B.index,I);break;case p2:Y[B.index]=!B.validationSchema?O?.get(B.key)||void 0:await this.argumentsResolution(O?.get(B.key)||void 0,B.validationSchema,B.index,I);break;case $4:Y[B.index]=!B.validationSchema?G?.[B.key]||void 0:await this.argumentsResolution(G?.[B.key]||void 0,B.validationSchema,B.index,I);break;case r2:Y[B.index]=H;break;case y2:Y[B.index]=N;break;case l2:Y[B.index]=P;break;default:Y[B.index]=!B.validationSchema?!b.has(B.type,M)?void 0:b.get(B.type,M):await this.argumentsResolution(!(B.type in b)?void 0:b.get(B.type,M),B.validationSchema,B.index,I);break}await E(...Y)}if(F)for(let D=0;D<F.length;D++){let Y=[],{func:E,funcName:I,argumentsMetadata:q}=F[D];for(let[B,h]of Object.entries(q))switch(h.type){case i2:Y[h.index]=!h.validationSchema?J:await this.argumentsResolution(J,h.validationSchema,h.index,I);break;case Q4:Y[h.index]=!h.validationSchema?await J?.[h.parser||"json"]():await this.argumentsResolution(await J?.[h.parser||"json"](),h.validationSchema,h.index,I);break;case S4:Y[h.index]=!h.key?b:b.get(h.key);break;case W4:Y[h.index]=!h.validationSchema?O:await this.argumentsResolution(O?.toJSON(),h.validationSchema,h.index,I);break;case y2:Y[h.index]=N;break;case p2:Y[h.index]=!h.validationSchema?O?.get(h.key)||void 0:await this.argumentsResolution(O?.get(h.key)||void 0,h.validationSchema,h.index,I);break;case $4:Y[h.index]=!h.validationSchema?G?.[h.key]||void 0:await this.argumentsResolution(G?.[h.key],h.validationSchema,h.index,I);break;case r2:Y[h.index]=H;break;case l2:Y[h.index]=P;break;default:Y[h.index]=!h.validationSchema?!b.has(h.type)?void 0:b.get(h.type):await this.argumentsResolution(b.get(h.type),h.validationSchema,h.index,I);break}let U=await E(...Y);if(typeof U!=="boolean"||!U)throw new M4({httpCode:401,message:"Unauthorization.",data:void 0})}}if(H&&!W?.isContainer){if(S&&"openInterceptorGroup"in S&&S.openInterceptorGroup){let{openInterceptorGroup:E}=S;for(let I=0;I<E.length;I++){let q=[],{func:U,funcName:B,argumentsMetadata:h}=E[I];for(let[u,V]of Object.entries(h))switch(V.type){case i2:q[V.index]=!V.validationSchema?J:await this.argumentsResolution(J,V.validationSchema,V.index,B);break;case Q4:q[V.index]=!V.validationSchema?await J?.[V.parser||"json"]():await this.argumentsResolution(await J?.[V.parser||"json"](),V.validationSchema,V.index,B);break;case S4:q[V.index]=!V.key?b:b.get(V.key);break;case W4:q[V.index]=!V.validationSchema?O:await this.argumentsResolution(O?.toJSON(),V.validationSchema,V.index,B);break;case p2:q[V.index]=!V.validationSchema?O?.get(V.key)||void 0:await this.argumentsResolution(O?.get(V.key)||void 0,V.validationSchema,V.index,B);break;case y2:q[V.index]=N;break;case $4:q[V.index]=!V.validationSchema?G?.[V.key]||void 0:await this.argumentsResolution(G?.[V.key]||void 0,V.validationSchema,V.index,B);break;case r2:q[V.index]=H;break;case l2:q[V.index]=P;break;default:q[V.index]=!V.validationSchema?!b.has(V.type)?void 0:b.get(V.type):await this.argumentsResolution(b.get(V.type),V.validationSchema,V.index,B);break}await U(...q)}}let Q=[],{func:F,funcName:D,argumentsMetadata:Y}=H;for(let[E,I]of Object.entries(Y))switch(I.type){case i2:Q[I.index]=!I.validationSchema?J:await this.argumentsResolution(J,I.validationSchema,I.index,D);break;case Q4:Q[I.index]=!I.validationSchema?await J?.[I.parser||"json"]():await this.argumentsResolution(await J?.[I.parser||"json"](),I.validationSchema,I.index,D);break;case S4:Q[I.index]=!I.key?b:b.get(I.key);break;case W4:Q[I.index]=!I.validationSchema?O:await this.argumentsResolution(O?.toJSON(),I.validationSchema,I.index,D);break;case p2:Q[I.index]=!I.validationSchema?O?.get(I.key)||void 0:await this.argumentsResolution(O?.get(I.key)||void 0,I.validationSchema,I.index,D);break;case y2:Q[I.index]=N;break;case $4:Q[I.index]=!I.validationSchema?G?.[I.key]||void 0:await this.argumentsResolution(G?.[I.key]||void 0,I.validationSchema,I.index,D);break;case r2:Q[I.index]=H;break;case l2:Q[I.index]=P;break;default:Q[I.index]=!I.validationSchema?!b.has(I.type)?void 0:b.get(I.type):await this.argumentsResolution(b.get(I.type),I.validationSchema,I.index,D);break}if(b.set(s4,await F(...Q),{isStatic:!1}),S&&"closeInterceptorGroup"in S&&S.closeInterceptorGroup){let{closeInterceptorGroup:E}=S;for(let I=0;I<E.length;I++){let q=[],{func:U,funcName:B,argumentsMetadata:h}=E[I];for(let[u,V]of Object.entries(h))switch(V.type){case i2:q[V.index]=!V.validationSchema?J:await this.argumentsResolution(J,V.validationSchema,V.index,B);break;case Q4:q[V.index]=!V.validationSchema?await J?.[V.parser||"json"]():await this.argumentsResolution(await J?.[V.parser||"json"](),V.validationSchema,V.index,B);break;case S4:q[V.index]=!V.key?b:b.get(V.key);break;case W4:q[V.index]=!V.validationSchema?O:await this.argumentsResolution(O?.toJSON(),V.validationSchema,V.index,B);break;case y2:q[V.index]=b.get(V.type);break;case p2:q[V.index]=!V.validationSchema?O?.get(V.key)||void 0:await this.argumentsResolution(O?.get(V.key)||void 0,V.validationSchema,V.index,B);break;case $4:q[V.index]=!V.validationSchema?G?.[V.key]||void 0:await this.argumentsResolution(G?.[V.key]||void 0,V.validationSchema,V.index,B);break;case r2:q[V.index]=H;break;case l2:q[V.index]=P;break;default:q[V.index]=!V.validationSchema?!b.has(V.type)?void 0:b.get(V.type):await this.argumentsResolution(b.get(V.type),V.validationSchema,V.index,B);break}await U(...q)}}}if(S){let{endMiddlewareGroup:Q}=S;if(Q)for(let F=0;F<Q.length;F++){let D=[],{func:Y,funcName:E,argumentsMetadata:I}=Q[F];for(let[q,U]of Object.entries(I))switch(U.type){case i2:D[U.index]=!U.validationSchema?J:await this.argumentsResolution(J,U.validationSchema,U.index,E);break;case Q4:D[U.index]=!U.validationSchema?await J?.[U.parser||"json"]():await this.argumentsResolution(await J?.[U.parser||"json"](),U.validationSchema,U.index,E);break;case S4:D[U.index]=!U.key?b:b.get(U.key);break;case W4:D[U.index]=!U.validationSchema?O:await this.argumentsResolution(O?.toJSON(),U.validationSchema,U.index,E);break;case y2:D[U.index]=b.get(U.type);break;case p2:D[U.index]=!U.validationSchema?O?.get(U.key)||void 0:await this.argumentsResolution(O?.get(U.key)||void 0,U.validationSchema,U.index,E);break;case $4:D[U.index]=!U.validationSchema?G?.[U.key]||void 0:await this.argumentsResolution(G?.[U.key]||void 0,U.validationSchema,U.index,E);break;case r2:D[U.index]=H;break;case l2:D[U.index]=P;break;default:D[U.index]=!U.validationSchema?!b.has(U.type)?void 0:b.get(U.type):await this.argumentsResolution(!(U.type in b)?void 0:b.get(U.type),U.validationSchema,U.index,E);break}await Y(...D)}}return Object.freeze({context:b})}async webSocketFetcher(K,w){let{request:W,server:S}=K,{query:M,responseHeaders:b,route:{model:P}}=w,J=await P.func(...[S,W,M]);if(typeof J!=="boolean")return this.finalizeResponse(new Response(JSON.stringify({httpCode:500,message:"Can not detect webSocket upgrade result.",data:void 0}),{status:500,statusText:"Internal server error.",headers:b}));if(!J)return this.finalizeResponse(new Response(JSON.stringify({httpCode:500,message:"Can not upgrade.",data:void 0}),{status:500,statusText:"Internal server error.",headers:b}));return J}}var kW=J6(e6(),1);var W8=()=>I6(h2.authState);class S8{open(K,w){if(Reflect.getOwnMetadataKeys(K.class.prototype,K.funcName).includes(h2.authState)){if(!w)throw new M4({httpCode:401,message:"Unauthorized",data:void 0});return}if(Reflect.getOwnMetadataKeys(K.class).includes(h2.authState)){if(!w)throw new M4({httpCode:401,message:"Unauthorized",data:void 0});return}}}h4([D4(0,zK()),D4(1,W8())],S8.prototype,"open",null),S8=h4([YK()],S8);var D6=new TextEncoder,G6=new TextDecoder;function qK(...K){let w=K.reduce((M,{length:b})=>M+b,0),W=new Uint8Array(w),S=0;for(let M of K)W.set(M,S),S+=M.length;return W}function B6(K){let w=new Uint8Array(K.length);for(let W=0;W<K.length;W++){let S=K.charCodeAt(W);if(S>127)throw TypeError("non-ASCII string encountered in encode()");w[W]=S}return w}function hK(K){if(Uint8Array.prototype.toBase64)return K.toBase64();let w=32768,W=[];for(let S=0;S<K.length;S+=w)W.push(String.fromCharCode.apply(null,K.subarray(S,S+w)));return btoa(W.join(""))}function FK(K){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(K);let w=atob(K),W=new Uint8Array(w.length);for(let S=0;S<w.length;S++)W[S]=w.charCodeAt(S);return W}function EK(K){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof K==="string"?K:G6.decode(K),{alphabet:"base64url"});let w=K;if(w instanceof Uint8Array)w=G6.decode(w);w=w.replace(/-/g,"+").replace(/_/g,"/");try{return FK(w)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function X6(K){let w=K;if(typeof w==="string")w=D6.encode(w);if(Uint8Array.prototype.toBase64)return w.toBase64({alphabet:"base64url",omitPadding:!0});return hK(w).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class Q6 extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(K,w){super(K,w);this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class c2 extends Q6{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class b4 extends Q6{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class M8 extends Q6{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}var _2=(K,w="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${w} must be ${K}`),E4=(K,w)=>K.name===w;function b8(K){return parseInt(K.name.slice(4),10)}function h9(K){switch(K){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}function F9(K,w){if(w&&!K.usages.includes(w))throw TypeError(`CryptoKey does not support this operation, its usages must include ${w}.`)}function vK(K,w,W){switch(w){case"HS256":case"HS384":case"HS512":{if(!E4(K.algorithm,"HMAC"))throw _2("HMAC");let S=parseInt(w.slice(2),10);if(b8(K.algorithm.hash)!==S)throw _2(`SHA-${S}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!E4(K.algorithm,"RSASSA-PKCS1-v1_5"))throw _2("RSASSA-PKCS1-v1_5");let S=parseInt(w.slice(2),10);if(b8(K.algorithm.hash)!==S)throw _2(`SHA-${S}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!E4(K.algorithm,"RSA-PSS"))throw _2("RSA-PSS");let S=parseInt(w.slice(2),10);if(b8(K.algorithm.hash)!==S)throw _2(`SHA-${S}`,"algorithm.hash");break}case"Ed25519":case"EdDSA":{if(!E4(K.algorithm,"Ed25519"))throw _2("Ed25519");break}case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":{if(!E4(K.algorithm,w))throw _2(w);break}case"ES256":case"ES384":case"ES512":{if(!E4(K.algorithm,"ECDSA"))throw _2("ECDSA");let S=h9(w);if(K.algorithm.namedCurve!==S)throw _2(S,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}F9(K,W)}function RK(K,w,...W){if(W=W.filter(Boolean),W.length>2){let S=W.pop();K+=`one of type ${W.join(", ")}, or ${S}.`}else if(W.length===2)K+=`one of type ${W[0]} or ${W[1]}.`;else K+=`of type ${W[0]}.`;if(w==null)K+=` Received ${w}`;else if(typeof w==="function"&&w.name)K+=` Received function ${w.name}`;else if(typeof w==="object"&&w!=null){if(w.constructor?.name)K+=` Received an instance of ${w.constructor.name}`}return K}var jK=(K,...w)=>RK("Key must be ",K,...w),P8=(K,w,...W)=>RK(`Key for the ${K} algorithm must be `,w,...W);var J8=(K)=>{if(K?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return K instanceof CryptoKey}catch{return!1}},O8=(K)=>K?.[Symbol.toStringTag]==="KeyObject",N8=(K)=>J8(K)||O8(K);function kK(...K){let w=K.filter(Boolean);if(w.length===0||w.length===1)return!0;let W;for(let S of w){let M=Object.keys(S);if(!W||W.size===0){W=new Set(M);continue}for(let b of M){if(W.has(b))return!1;W.add(b)}}return!0}var E9=(K)=>typeof K==="object"&&K!==null;function $6(K){if(!E9(K)||Object.prototype.toString.call(K)!=="[object Object]")return!1;if(Object.getPrototypeOf(K)===null)return!0;let w=K;while(Object.getPrototypeOf(w)!==null)w=Object.getPrototypeOf(w);return Object.getPrototypeOf(K)===w}function gK(K,w){if(K.startsWith("RS")||K.startsWith("PS")){let{modulusLength:W}=w.algorithm;if(typeof W!=="number"||W<2048)throw TypeError(`${K} requires key modulusLength to be 2048 bits or larger`)}}function v9(K){let w,W;switch(K.kty){case"AKP":{switch(K.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":w={name:K.alg},W=K.priv?["sign"]:["verify"];break;default:throw new c2('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(K.alg){case"PS256":case"PS384":case"PS512":w={name:"RSA-PSS",hash:`SHA-${K.alg.slice(-3)}`},W=K.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":w={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${K.alg.slice(-3)}`},W=K.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":w={name:"RSA-OAEP",hash:`SHA-${parseInt(K.alg.slice(-3),10)||1}`},W=K.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new c2('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(K.alg){case"ES256":w={name:"ECDSA",namedCurve:"P-256"},W=K.d?["sign"]:["verify"];break;case"ES384":w={name:"ECDSA",namedCurve:"P-384"},W=K.d?["sign"]:["verify"];break;case"ES512":w={name:"ECDSA",namedCurve:"P-521"},W=K.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":w={name:"ECDH",namedCurve:K.crv},W=K.d?["deriveBits"]:[];break;default:throw new c2('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(K.alg){case"Ed25519":case"EdDSA":w={name:"Ed25519"},W=K.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":w={name:K.crv},W=K.d?["deriveBits"]:[];break;default:throw new c2('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new c2('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:w,keyUsages:W}}async function ZK(K){if(!K.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:w,keyUsages:W}=v9(K),S={...K};if(S.kty!=="AKP")delete S.alg;return delete S.use,crypto.subtle.importKey("jwk",S,w,K.ext??(K.d||K.priv?!1:!0),K.key_ops??W)}function AK(K,w,W,S,M){if(M.crit!==void 0&&S?.crit===void 0)throw new K('"crit" (Critical) Header Parameter MUST be integrity protected');if(!S||S.crit===void 0)return new Set;if(!Array.isArray(S.crit)||S.crit.length===0||S.crit.some((P)=>typeof P!=="string"||P.length===0))throw new K('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let b;if(W!==void 0)b=new Map([...Object.entries(W),...w.entries()]);else b=w;for(let P of S.crit){if(!b.has(P))throw new c2(`Extension Header Parameter "${P}" is not recognized`);if(M[P]===void 0)throw new K(`Extension Header Parameter "${P}" is missing`);if(b.get(P)&&S[P]===void 0)throw new K(`Extension Header Parameter "${P}" MUST be integrity protected`)}return new Set(S.crit)}var C4=(K)=>$6(K)&&typeof K.kty==="string",cK=(K)=>K.kty!=="oct"&&(K.kty==="AKP"&&typeof K.priv==="string"||typeof K.d==="string"),CK=(K)=>K.kty!=="oct"&&K.d===void 0&&K.priv===void 0,xK=(K)=>K.kty==="oct"&&typeof K.k==="string";var v4,uK=async(K,w,W,S=!1)=>{v4||=new WeakMap;let M=v4.get(K);if(M?.[W])return M[W];let b=await ZK({...w,alg:W});if(S)Object.freeze(K);if(!M)v4.set(K,{[W]:b});else M[W]=b;return b},j9=(K,w)=>{v4||=new WeakMap;let W=v4.get(K);if(W?.[w])return W[w];let S=K.type==="public",M=S?!0:!1,b;if(K.asymmetricKeyType==="x25519"){switch(w){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError("given KeyObject instance cannot be used for this algorithm")}b=K.toCryptoKey(K.asymmetricKeyType,M,S?[]:["deriveBits"])}if(K.asymmetricKeyType==="ed25519"){if(w!=="EdDSA"&&w!=="Ed25519")throw TypeError("given KeyObject instance cannot be used for this algorithm");b=K.toCryptoKey(K.asymmetricKeyType,M,[S?"verify":"sign"])}switch(K.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(w!==K.asymmetricKeyType.toUpperCase())throw TypeError("given KeyObject instance cannot be used for this algorithm");b=K.toCryptoKey(K.asymmetricKeyType,M,[S?"verify":"sign"])}}if(K.asymmetricKeyType==="rsa"){let P;switch(w){case"RSA-OAEP":P="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":P="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":P="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":P="SHA-512";break;default:throw TypeError("given KeyObject instance cannot be used for this algorithm")}if(w.startsWith("RSA-OAEP"))return K.toCryptoKey({name:"RSA-OAEP",hash:P},M,S?["encrypt"]:["decrypt"]);b=K.toCryptoKey({name:w.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:P},M,[S?"verify":"sign"])}if(K.asymmetricKeyType==="ec"){let J=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(K.asymmetricKeyDetails?.namedCurve);if(!J)throw TypeError("given KeyObject instance cannot be used for this algorithm");if(w==="ES256"&&J==="P-256")b=K.toCryptoKey({name:"ECDSA",namedCurve:J},M,[S?"verify":"sign"]);if(w==="ES384"&&J==="P-384")b=K.toCryptoKey({name:"ECDSA",namedCurve:J},M,[S?"verify":"sign"]);if(w==="ES512"&&J==="P-521")b=K.toCryptoKey({name:"ECDSA",namedCurve:J},M,[S?"verify":"sign"]);if(w.startsWith("ECDH-ES"))b=K.toCryptoKey({name:"ECDH",namedCurve:J},M,S?[]:["deriveBits"])}if(!b)throw TypeError("given KeyObject instance cannot be used for this algorithm");if(!W)v4.set(K,{[w]:b});else W[w]=b;return b};async function oK(K,w){if(K instanceof Uint8Array)return K;if(J8(K))return K;if(O8(K)){if(K.type==="secret")return K.export();if("toCryptoKey"in K&&typeof K.toCryptoKey==="function")try{return j9(K,w)}catch(S){if(S instanceof TypeError)throw S}let W=K.export({format:"jwk"});return uK(K,W,w)}if(C4(K)){if(K.k)return EK(K.k);return uK(K,K,w,!0)}throw Error("unreachable")}var R4=(K)=>K?.[Symbol.toStringTag],I8=(K,w,W)=>{if(w.use!==void 0){let S;switch(W){case"sign":case"verify":S="sig";break;case"encrypt":case"decrypt":S="enc";break}if(w.use!==S)throw TypeError(`Invalid key for this operation, its "use" must be "${S}" when present`)}if(w.alg!==void 0&&w.alg!==K)throw TypeError(`Invalid key for this operation, its "alg" must be "${K}" when present`);if(Array.isArray(w.key_ops)){let S;switch(!0){case(W==="sign"||W==="verify"):case K==="dir":case K.includes("CBC-HS"):S=W;break;case K.startsWith("PBES2"):S="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(K):if(!K.includes("GCM")&&K.endsWith("KW"))S=W==="encrypt"?"wrapKey":"unwrapKey";else S=W;break;case(W==="encrypt"&&K.startsWith("RSA")):S="wrapKey";break;case W==="decrypt":S=K.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(S&&w.key_ops?.includes?.(S)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${S}" when present`)}return!0},k9=(K,w,W)=>{if(w instanceof Uint8Array)return;if(C4(w)){if(xK(w)&&I8(K,w,W))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!N8(w))throw TypeError(P8(K,w,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(w.type!=="secret")throw TypeError(`${R4(w)} instances for symmetric algorithms must be of type "secret"`)},g9=(K,w,W)=>{if(C4(w))switch(W){case"decrypt":case"sign":if(cK(w)&&I8(K,w,W))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(CK(w)&&I8(K,w,W))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!N8(w))throw TypeError(P8(K,w,"CryptoKey","KeyObject","JSON Web Key"));if(w.type==="secret")throw TypeError(`${R4(w)} instances for asymmetric algorithms must not be of type "secret"`);if(w.type==="public")switch(W){case"sign":throw TypeError(`${R4(w)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${R4(w)} instances for asymmetric algorithm decryption must be of type "private"`)}if(w.type==="private")switch(W){case"verify":throw TypeError(`${R4(w)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${R4(w)} instances for asymmetric algorithm encryption must be of type "public"`)}};function yK(K,w,W){switch(K.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":k9(K,w,W);break;default:g9(K,w,W)}}function rK(K,w){let W=`SHA-${K.slice(-3)}`;switch(K){case"HS256":case"HS384":case"HS512":return{hash:W,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:W,name:"RSA-PSS",saltLength:parseInt(K.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:W,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:W,name:"ECDSA",namedCurve:w.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:K};default:throw new c2(`alg ${K} is not supported either by JOSE or your javascript runtime`)}}async function _K(K,w,W){if(w instanceof Uint8Array){if(!K.startsWith("HS"))throw TypeError(jK(w,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",w,{hash:`SHA-${K.slice(-3)}`,name:"HMAC"},!1,[W])}return vK(w,K,W),w}var z4=(K)=>Math.floor(K.getTime()/1000),mK=60,fK=mK*60,G8=fK*24,Z9=G8*7,A9=G8*365.25,c9=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function D8(K){let w=c9.exec(K);if(!w||w[4]&&w[1])throw TypeError("Invalid time period format");let W=parseFloat(w[2]),S=w[3].toLowerCase(),M;switch(S){case"sec":case"secs":case"second":case"seconds":case"s":M=Math.round(W);break;case"minute":case"minutes":case"min":case"mins":case"m":M=Math.round(W*mK);break;case"hour":case"hours":case"hr":case"hrs":case"h":M=Math.round(W*fK);break;case"day":case"days":case"d":M=Math.round(W*G8);break;case"week":case"weeks":case"w":M=Math.round(W*Z9);break;default:M=Math.round(W*A9);break}if(w[1]==="-"||w[4]==="ago")return-M;return M}function U4(K,w){if(!Number.isFinite(w))throw TypeError(`Invalid ${K} input`);return w}class B8{#K;constructor(K){if(!$6(K))throw TypeError("JWT Claims Set MUST be an object");this.#K=structuredClone(K)}data(){return D6.encode(JSON.stringify(this.#K))}get iss(){return this.#K.iss}set iss(K){this.#K.iss=K}get sub(){return this.#K.sub}set sub(K){this.#K.sub=K}get aud(){return this.#K.aud}set aud(K){this.#K.aud=K}set jti(K){this.#K.jti=K}set nbf(K){if(typeof K==="number")this.#K.nbf=U4("setNotBefore",K);else if(K instanceof Date)this.#K.nbf=U4("setNotBefore",z4(K));else this.#K.nbf=z4(new Date)+D8(K)}set exp(K){if(typeof K==="number")this.#K.exp=U4("setExpirationTime",K);else if(K instanceof Date)this.#K.exp=U4("setExpirationTime",z4(K));else this.#K.exp=z4(new Date)+D8(K)}set iat(K){if(K===void 0)this.#K.iat=z4(new Date);else if(K instanceof Date)this.#K.iat=U4("setIssuedAt",z4(K));else if(typeof K==="string")this.#K.iat=U4("setIssuedAt",z4(new Date)+D8(K));else this.#K.iat=U4("setIssuedAt",K)}}async function TK(K,w,W){let S=await _K(K,w,"sign");gK(K,S);let M=await crypto.subtle.sign(rK(K,S.algorithm),S,W);return new Uint8Array(M)}class X8{#K;#w;#W;constructor(K){if(!(K instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#K=K}setProtectedHeader(K){if(this.#w)throw TypeError("setProtectedHeader can only be called once");return this.#w=K,this}setUnprotectedHeader(K){if(this.#W)throw TypeError("setUnprotectedHeader can only be called once");return this.#W=K,this}async sign(K,w){if(!this.#w&&!this.#W)throw new b4("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!kK(this.#w,this.#W))throw new b4("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let W={...this.#w,...this.#W},S=AK(b4,new Map([["b64",!0]]),w?.crit,this.#w,W),M=!0;if(S.has("b64")){if(M=this.#w.b64,typeof M!=="boolean")throw new b4('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}let{alg:b}=W;if(typeof b!=="string"||!b)throw new b4('JWS "alg" (Algorithm) Header Parameter missing or invalid');yK(b,K,"sign");let P,J;if(M)P=X6(this.#K),J=B6(P);else J=this.#K,P="";let O,N;if(this.#w)O=X6(JSON.stringify(this.#w)),N=B6(O);else O="",N=new Uint8Array;let G=qK(N,B6("."),J),H=await oK(K,b),Q=await TK(b,H,G),F={signature:X6(Q),payload:P};if(this.#W)F.header=this.#W;if(this.#w)F.protected=O;return F}}class Q8{#K;constructor(K){this.#K=new X8(K)}setProtectedHeader(K){return this.#K.setProtectedHeader(K),this}async sign(K,w){let W=await this.#K.sign(K,w);if(W.payload===void 0)throw TypeError("use the flattened module for creating JWS with b64: false");return`${W.protected}.${W.payload}.${W.signature}`}}class z6{#K;#w;constructor(K={}){this.#w=new B8(K)}setIssuer(K){return this.#w.iss=K,this}setSubject(K){return this.#w.sub=K,this}setAudience(K){return this.#w.aud=K,this}setJti(K){return this.#w.jti=K,this}setNotBefore(K){return this.#w.nbf=K,this}setExpirationTime(K){return this.#w.exp=K,this}setIssuedAt(K){return this.#w.iat=K,this}setProtectedHeader(K){return this.#K=K,this}async sign(K,w){let W=new Q8(this.#w.data());if(W.setProtectedHeader(this.#K),Array.isArray(this.#K?.crit)&&this.#K.crit.includes("b64")&&this.#K.b64===!1)throw new M8("JWTs MUST NOT use unencoded payload");return W.sign(K,w)}}var fS=Object.freeze({status:"aborted"});function R(K,w,W){function S(J,O){if(!J._zod)Object.defineProperty(J,"_zod",{value:{def:O,constr:P,traits:new Set},enumerable:!1});if(J._zod.traits.has(K))return;J._zod.traits.add(K),w(J,O);let N=P.prototype,G=Object.keys(N);for(let H=0;H<G.length;H++){let Q=G[H];if(!(Q in J))J[Q]=N[Q].bind(J)}}let M=W?.Parent??Object;class b extends M{}Object.defineProperty(b,"name",{value:K});function P(J){var O;let N=W?.Parent?new b:this;S(N,J),(O=N._zod).deferred??(O.deferred=[]);for(let G of N._zod.deferred)G();return N}return Object.defineProperty(P,"init",{value:S}),Object.defineProperty(P,Symbol.hasInstance,{value:(J)=>{if(W?.Parent&&J instanceof W.Parent)return!0;return J?._zod?.traits?.has(K)}}),Object.defineProperty(P,"name",{value:K}),P}var TS=Symbol("zod_brand");class d2 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class x4 extends Error{constructor(K){super(`Encountered unidirectional transform during encode: ${K}`);this.name="ZodEncodeError"}}var U6={};function n2(K){if(K)Object.assign(U6,K);return U6}var K2={};m6(K2,{unwrapMessage:()=>u4,uint8ArrayToHex:()=>Pw,uint8ArrayToBase64url:()=>Mw,uint8ArrayToBase64:()=>K3,stringifyPrimitive:()=>dK,slugify:()=>z8,shallowClone:()=>iK,safeExtend:()=>a9,required:()=>ww,randomString:()=>l9,propertyKeyTypes:()=>Y8,promiseAllObject:()=>T9,primitiveTypes:()=>eK,prefixIssues:()=>m4,pick:()=>d9,partial:()=>Kw,optionalKeys:()=>H8,omit:()=>n9,objectClone:()=>_9,numKeys:()=>p9,nullish:()=>r4,normalizeParams:()=>T,mergeDefs:()=>J4,merge:()=>s9,jsonStringifyReplacer:()=>k4,joinValues:()=>r9,issue:()=>g4,isPlainObject:()=>Y4,isObject:()=>j4,hexToUint8Array:()=>bw,getSizableOrigin:()=>aK,getParsedType:()=>i9,getLengthableOrigin:()=>f4,getEnumValues:()=>o4,getElementAtPath:()=>f9,floatSafeRemainder:()=>pK,finalizeIssue:()=>m2,extend:()=>t9,escapeRegex:()=>H4,esc:()=>Y6,defineLazy:()=>w2,createTransparentProxy:()=>e9,cloneDef:()=>m9,clone:()=>C2,cleanRegex:()=>_4,cleanEnum:()=>Ww,captureStackTrace:()=>H6,cached:()=>y4,base64urlToUint8Array:()=>Sw,base64ToUint8Array:()=>sK,assignProp:()=>P4,assertNotEqual:()=>x9,assertNever:()=>o9,assertIs:()=>u9,assertEqual:()=>C9,assert:()=>y9,allowsEval:()=>U8,aborted:()=>O4,NUMBER_FORMAT_RANGES:()=>nK,Class:()=>w3,BIGINT_FORMAT_RANGES:()=>tK});function C9(K){return K}function x9(K){return K}function u9(K){}function o9(K){throw Error("Unexpected value in exhaustive check")}function y9(K){}function o4(K){let w=Object.values(K).filter((S)=>typeof S==="number");return Object.entries(K).filter(([S,M])=>w.indexOf(+S)===-1).map(([S,M])=>M)}function r9(K,w="|"){return K.map((W)=>dK(W)).join(w)}function k4(K,w){if(typeof w==="bigint")return w.toString();return w}function y4(K){return{get value(){{let W=K();return Object.defineProperty(this,"value",{value:W}),W}throw Error("cached value already set")}}}function r4(K){return K===null||K===void 0}function _4(K){let w=K.startsWith("^")?1:0,W=K.endsWith("$")?K.length-1:K.length;return K.slice(w,W)}function pK(K,w){let W=(K.toString().split(".")[1]||"").length,S=w.toString(),M=(S.split(".")[1]||"").length;if(M===0&&/\d?e-\d?/.test(S)){let O=S.match(/\d?e-(\d?)/);if(O?.[1])M=Number.parseInt(O[1])}let b=W>M?W:M,P=Number.parseInt(K.toFixed(b).replace(".","")),J=Number.parseInt(w.toFixed(b).replace(".",""));return P%J/10**b}var lK=Symbol("evaluating");function w2(K,w,W){let S=void 0;Object.defineProperty(K,w,{get(){if(S===lK)return;if(S===void 0)S=lK,S=W();return S},set(M){Object.defineProperty(K,w,{value:M})},configurable:!0})}function _9(K){return Object.create(Object.getPrototypeOf(K),Object.getOwnPropertyDescriptors(K))}function P4(K,w,W){Object.defineProperty(K,w,{value:W,writable:!0,enumerable:!0,configurable:!0})}function J4(...K){let w={};for(let W of K){let S=Object.getOwnPropertyDescriptors(W);Object.assign(w,S)}return Object.defineProperties({},w)}function m9(K){return J4(K._zod.def)}function f9(K,w){if(!w)return K;return w.reduce((W,S)=>W?.[S],K)}function T9(K){let w=Object.keys(K),W=w.map((S)=>K[S]);return Promise.all(W).then((S)=>{let M={};for(let b=0;b<w.length;b++)M[w[b]]=S[b];return M})}function l9(K=10){let W="";for(let S=0;S<K;S++)W+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return W}function Y6(K){return JSON.stringify(K)}function z8(K){return K.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var H6="captureStackTrace"in Error?Error.captureStackTrace:(...K)=>{};function j4(K){return typeof K==="object"&&K!==null&&!Array.isArray(K)}var U8=y4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(K){return!1}});function Y4(K){if(j4(K)===!1)return!1;let w=K.constructor;if(w===void 0)return!0;if(typeof w!=="function")return!0;let W=w.prototype;if(j4(W)===!1)return!1;if(Object.prototype.hasOwnProperty.call(W,"isPrototypeOf")===!1)return!1;return!0}function iK(K){if(Y4(K))return{...K};if(Array.isArray(K))return[...K];return K}function p9(K){let w=0;for(let W in K)if(Object.prototype.hasOwnProperty.call(K,W))w++;return w}var i9=(K)=>{let w=typeof K;switch(w){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(K)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(K))return"array";if(K===null)return"null";if(K.then&&typeof K.then==="function"&&K.catch&&typeof K.catch==="function")return"promise";if(typeof Map<"u"&&K instanceof Map)return"map";if(typeof Set<"u"&&K instanceof Set)return"set";if(typeof Date<"u"&&K instanceof Date)return"date";if(typeof File<"u"&&K instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${w}`)}},Y8=new Set(["string","number","symbol"]),eK=new Set(["string","number","bigint","boolean","symbol","undefined"]);function H4(K){return K.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C2(K,w,W){let S=new K._zod.constr(w??K._zod.def);if(!w||W?.parent)S._zod.parent=K;return S}function T(K){let w=K;if(!w)return{};if(typeof w==="string")return{error:()=>w};if(w?.message!==void 0){if(w?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");w.error=w.message}if(delete w.message,typeof w.error==="string")return{...w,error:()=>w.error};return w}function e9(K){let w;return new Proxy({},{get(W,S,M){return w??(w=K()),Reflect.get(w,S,M)},set(W,S,M,b){return w??(w=K()),Reflect.set(w,S,M,b)},has(W,S){return w??(w=K()),Reflect.has(w,S)},deleteProperty(W,S){return w??(w=K()),Reflect.deleteProperty(w,S)},ownKeys(W){return w??(w=K()),Reflect.ownKeys(w)},getOwnPropertyDescriptor(W,S){return w??(w=K()),Reflect.getOwnPropertyDescriptor(w,S)},defineProperty(W,S,M){return w??(w=K()),Reflect.defineProperty(w,S,M)}})}function dK(K){if(typeof K==="bigint")return K.toString()+"n";if(typeof K==="string")return`"${K}"`;return`${K}`}function H8(K){return Object.keys(K).filter((w)=>{return K[w]._zod.optin==="optional"&&K[w]._zod.optout==="optional"})}var nK={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},tK={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function d9(K,w){let W=K._zod.def,S=J4(K._zod.def,{get shape(){let M={};for(let b in w){if(!(b in W.shape))throw Error(`Unrecognized key: "${b}"`);if(!w[b])continue;M[b]=W.shape[b]}return P4(this,"shape",M),M},checks:[]});return C2(K,S)}function n9(K,w){let W=K._zod.def,S=J4(K._zod.def,{get shape(){let M={...K._zod.def.shape};for(let b in w){if(!(b in W.shape))throw Error(`Unrecognized key: "${b}"`);if(!w[b])continue;delete M[b]}return P4(this,"shape",M),M},checks:[]});return C2(K,S)}function t9(K,w){if(!Y4(w))throw Error("Invalid input to extend: expected a plain object");let W=K._zod.def.checks;if(W&&W.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let M=J4(K._zod.def,{get shape(){let b={...K._zod.def.shape,...w};return P4(this,"shape",b),b},checks:[]});return C2(K,M)}function a9(K,w){if(!Y4(w))throw Error("Invalid input to safeExtend: expected a plain object");let W={...K._zod.def,get shape(){let S={...K._zod.def.shape,...w};return P4(this,"shape",S),S},checks:K._zod.def.checks};return C2(K,W)}function s9(K,w){let W=J4(K._zod.def,{get shape(){let S={...K._zod.def.shape,...w._zod.def.shape};return P4(this,"shape",S),S},get catchall(){return w._zod.def.catchall},checks:[]});return C2(K,W)}function Kw(K,w,W){let S=J4(w._zod.def,{get shape(){let M=w._zod.def.shape,b={...M};if(W)for(let P in W){if(!(P in M))throw Error(`Unrecognized key: "${P}"`);if(!W[P])continue;b[P]=K?new K({type:"optional",innerType:M[P]}):M[P]}else for(let P in M)b[P]=K?new K({type:"optional",innerType:M[P]}):M[P];return P4(this,"shape",b),b},checks:[]});return C2(w,S)}function ww(K,w,W){let S=J4(w._zod.def,{get shape(){let M=w._zod.def.shape,b={...M};if(W)for(let P in W){if(!(P in b))throw Error(`Unrecognized key: "${P}"`);if(!W[P])continue;b[P]=new K({type:"nonoptional",innerType:M[P]})}else for(let P in M)b[P]=new K({type:"nonoptional",innerType:M[P]});return P4(this,"shape",b),b},checks:[]});return C2(w,S)}function O4(K,w=0){if(K.aborted===!0)return!0;for(let W=w;W<K.issues.length;W++)if(K.issues[W]?.continue!==!0)return!0;return!1}function m4(K,w){return w.map((W)=>{var S;return(S=W).path??(S.path=[]),W.path.unshift(K),W})}function u4(K){return typeof K==="string"?K:K?.message}function m2(K,w,W){let S={...K,path:K.path??[]};if(!K.message){let M=u4(K.inst?._zod.def?.error?.(K))??u4(w?.error?.(K))??u4(W.customError?.(K))??u4(W.localeError?.(K))??"Invalid input";S.message=M}if(delete S.inst,delete S.continue,!w?.reportInput)delete S.input;return S}function aK(K){if(K instanceof Set)return"set";if(K instanceof Map)return"map";if(K instanceof File)return"file";return"unknown"}function f4(K){if(Array.isArray(K))return"array";if(typeof K==="string")return"string";return"unknown"}function g4(...K){let[w,W,S]=K;if(typeof w==="string")return{message:w,code:"custom",input:W,inst:S};return{...w}}function Ww(K){return Object.entries(K).filter(([w,W])=>{return Number.isNaN(Number.parseInt(w,10))}).map((w)=>w[1])}function sK(K){let w=atob(K),W=new Uint8Array(w.length);for(let S=0;S<w.length;S++)W[S]=w.charCodeAt(S);return W}function K3(K){let w="";for(let W=0;W<K.length;W++)w+=String.fromCharCode(K[W]);return btoa(w)}function Sw(K){let w=K.replace(/-/g,"+").replace(/_/g,"/"),W="=".repeat((4-w.length%4)%4);return sK(w+W)}function Mw(K){return K3(K).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function bw(K){let w=K.replace(/^0x/,"");if(w.length%2!==0)throw Error("Invalid hex string length");let W=new Uint8Array(w.length/2);for(let S=0;S<w.length;S+=2)W[S/2]=Number.parseInt(w.slice(S,S+2),16);return W}function Pw(K){return Array.from(K).map((w)=>w.toString(16).padStart(2,"0")).join("")}class w3{constructor(...K){}}var W3=(K,w)=>{K.name="$ZodError",Object.defineProperty(K,"_zod",{value:K._zod,enumerable:!1}),Object.defineProperty(K,"issues",{value:w,enumerable:!1}),K.message=JSON.stringify(w,k4,2),Object.defineProperty(K,"toString",{value:()=>K.message,enumerable:!1})},V6=R("$ZodError",W3),V8=R("$ZodError",W3,{Parent:Error});function S3(K,w=(W)=>W.message){let W={},S=[];for(let M of K.issues)if(M.path.length>0)W[M.path[0]]=W[M.path[0]]||[],W[M.path[0]].push(w(M));else S.push(w(M));return{formErrors:S,fieldErrors:W}}function M3(K,w=(W)=>W.message){let W={_errors:[]},S=(M)=>{for(let b of M.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map((P)=>S({issues:P}));else if(b.code==="invalid_key")S({issues:b.issues});else if(b.code==="invalid_element")S({issues:b.issues});else if(b.path.length===0)W._errors.push(w(b));else{let P=W,J=0;while(J<b.path.length){let O=b.path[J];if(J!==b.path.length-1)P[O]=P[O]||{_errors:[]};else P[O]=P[O]||{_errors:[]},P[O]._errors.push(w(b));P=P[O],J++}}};return S(K),W}var L6=(K)=>(w,W,S,M)=>{let b=S?Object.assign(S,{async:!1}):{async:!1},P=w._zod.run({value:W,issues:[]},b);if(P instanceof Promise)throw new d2;if(P.issues.length){let J=new(M?.Err??K)(P.issues.map((O)=>m2(O,b,n2())));throw H6(J,M?.callee),J}return P.value};var q6=(K)=>async(w,W,S,M)=>{let b=S?Object.assign(S,{async:!0}):{async:!0},P=w._zod.run({value:W,issues:[]},b);if(P instanceof Promise)P=await P;if(P.issues.length){let J=new(M?.Err??K)(P.issues.map((O)=>m2(O,b,n2())));throw H6(J,M?.callee),J}return P.value};var T4=(K)=>(w,W,S)=>{let M=S?{...S,async:!1}:{async:!1},b=w._zod.run({value:W,issues:[]},M);if(b instanceof Promise)throw new d2;return b.issues.length?{success:!1,error:new(K??V6)(b.issues.map((P)=>m2(P,M,n2())))}:{success:!0,data:b.value}},b3=T4(V8),l4=(K)=>async(w,W,S)=>{let M=S?Object.assign(S,{async:!0}):{async:!0},b=w._zod.run({value:W,issues:[]},M);if(b instanceof Promise)b=await b;return b.issues.length?{success:!1,error:new K(b.issues.map((P)=>m2(P,M,n2())))}:{success:!0,data:b.value}},P3=l4(V8),J3=(K)=>(w,W,S)=>{let M=S?Object.assign(S,{direction:"backward"}):{direction:"backward"};return L6(K)(w,W,M)};var O3=(K)=>(w,W,S)=>{return L6(K)(w,W,S)};var N3=(K)=>async(w,W,S)=>{let M=S?Object.assign(S,{direction:"backward"}):{direction:"backward"};return q6(K)(w,W,M)};var I3=(K)=>async(w,W,S)=>{return q6(K)(w,W,S)};var D3=(K)=>(w,W,S)=>{let M=S?Object.assign(S,{direction:"backward"}):{direction:"backward"};return T4(K)(w,W,M)};var G3=(K)=>(w,W,S)=>{return T4(K)(w,W,S)};var B3=(K)=>async(w,W,S)=>{let M=S?Object.assign(S,{direction:"backward"}):{direction:"backward"};return l4(K)(w,W,M)};var X3=(K)=>async(w,W,S)=>{return l4(K)(w,W,S)};var Q3=/^[cC][^\s-]{8,}$/,$3=/^[0-9a-z]+$/,z3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U3=/^[0-9a-vA-V]{20}$/,Y3=/^[A-Za-z0-9]{27}$/,H3=/^[a-zA-Z0-9_-]{21}$/,V3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var L3=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,L8=(K)=>{if(!K)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${K}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var q3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Ow="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function h3(){return new RegExp(Ow,"u")}var F3=/^(?:(?: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])$/,E3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var v3=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,R3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,j3=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,q8=/^[A-Za-z0-9_-]*$/;var k3=/^\+(?:[0-9]){6,14}[0-9]$/,g3="(?:(?:\\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])))",Z3=new RegExp(`^${g3}$`);function A3(K){return typeof K.precision==="number"?K.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":K.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${K.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function c3(K){return new RegExp(`^${A3(K)}$`)}function C3(K){let w=A3({precision:K.precision}),W=["Z"];if(K.local)W.push("");if(K.offset)W.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let S=`${w}(?:${W.join("|")})`;return new RegExp(`^${g3}T(?:${S})$`)}var x3=(K)=>{let w=K?`[\\s\\S]{${K?.minimum??0},${K?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${w}$`)};var u3=/^[^A-Z]*$/,o3=/^[^a-z]*$/;var E2=R("$ZodCheck",(K,w)=>{var W;K._zod??(K._zod={}),K._zod.def=w,(W=K._zod).onattach??(W.onattach=[])});var y3=R("$ZodCheckMaxLength",(K,w)=>{var W;E2.init(K,w),(W=K._zod.def).when??(W.when=(S)=>{let M=S.value;return!r4(M)&&M.length!==void 0}),K._zod.onattach.push((S)=>{let M=S._zod.bag.maximum??Number.POSITIVE_INFINITY;if(w.maximum<M)S._zod.bag.maximum=w.maximum}),K._zod.check=(S)=>{let M=S.value;if(M.length<=w.maximum)return;let P=f4(M);S.issues.push({origin:P,code:"too_big",maximum:w.maximum,inclusive:!0,input:M,inst:K,continue:!w.abort})}}),r3=R("$ZodCheckMinLength",(K,w)=>{var W;E2.init(K,w),(W=K._zod.def).when??(W.when=(S)=>{let M=S.value;return!r4(M)&&M.length!==void 0}),K._zod.onattach.push((S)=>{let M=S._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(w.minimum>M)S._zod.bag.minimum=w.minimum}),K._zod.check=(S)=>{let M=S.value;if(M.length>=w.minimum)return;let P=f4(M);S.issues.push({origin:P,code:"too_small",minimum:w.minimum,inclusive:!0,input:M,inst:K,continue:!w.abort})}}),_3=R("$ZodCheckLengthEquals",(K,w)=>{var W;E2.init(K,w),(W=K._zod.def).when??(W.when=(S)=>{let M=S.value;return!r4(M)&&M.length!==void 0}),K._zod.onattach.push((S)=>{let M=S._zod.bag;M.minimum=w.length,M.maximum=w.length,M.length=w.length}),K._zod.check=(S)=>{let M=S.value,b=M.length;if(b===w.length)return;let P=f4(M),J=b>w.length;S.issues.push({origin:P,...J?{code:"too_big",maximum:w.length}:{code:"too_small",minimum:w.length},inclusive:!0,exact:!0,input:S.value,inst:K,continue:!w.abort})}}),p4=R("$ZodCheckStringFormat",(K,w)=>{var W,S;if(E2.init(K,w),K._zod.onattach.push((M)=>{let b=M._zod.bag;if(b.format=w.format,w.pattern)b.patterns??(b.patterns=new Set),b.patterns.add(w.pattern)}),w.pattern)(W=K._zod).check??(W.check=(M)=>{if(w.pattern.lastIndex=0,w.pattern.test(M.value))return;M.issues.push({origin:"string",code:"invalid_format",format:w.format,input:M.value,...w.pattern?{pattern:w.pattern.toString()}:{},inst:K,continue:!w.abort})});else(S=K._zod).check??(S.check=()=>{})}),m3=R("$ZodCheckRegex",(K,w)=>{p4.init(K,w),K._zod.check=(W)=>{if(w.pattern.lastIndex=0,w.pattern.test(W.value))return;W.issues.push({origin:"string",code:"invalid_format",format:"regex",input:W.value,pattern:w.pattern.toString(),inst:K,continue:!w.abort})}}),f3=R("$ZodCheckLowerCase",(K,w)=>{w.pattern??(w.pattern=u3),p4.init(K,w)}),T3=R("$ZodCheckUpperCase",(K,w)=>{w.pattern??(w.pattern=o3),p4.init(K,w)}),l3=R("$ZodCheckIncludes",(K,w)=>{E2.init(K,w);let W=H4(w.includes),S=new RegExp(typeof w.position==="number"?`^.{${w.position}}${W}`:W);w.pattern=S,K._zod.onattach.push((M)=>{let b=M._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(S)}),K._zod.check=(M)=>{if(M.value.includes(w.includes,w.position))return;M.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:w.includes,input:M.value,inst:K,continue:!w.abort})}}),p3=R("$ZodCheckStartsWith",(K,w)=>{E2.init(K,w);let W=new RegExp(`^${H4(w.prefix)}.*`);w.pattern??(w.pattern=W),K._zod.onattach.push((S)=>{let M=S._zod.bag;M.patterns??(M.patterns=new Set),M.patterns.add(W)}),K._zod.check=(S)=>{if(S.value.startsWith(w.prefix))return;S.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:w.prefix,input:S.value,inst:K,continue:!w.abort})}}),i3=R("$ZodCheckEndsWith",(K,w)=>{E2.init(K,w);let W=new RegExp(`.*${H4(w.suffix)}$`);w.pattern??(w.pattern=W),K._zod.onattach.push((S)=>{let M=S._zod.bag;M.patterns??(M.patterns=new Set),M.patterns.add(W)}),K._zod.check=(S)=>{if(S.value.endsWith(w.suffix))return;S.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:w.suffix,input:S.value,inst:K,continue:!w.abort})}});var e3=R("$ZodCheckOverwrite",(K,w)=>{E2.init(K,w),K._zod.check=(W)=>{W.value=w.tx(W.value)}});class h8{constructor(K=[]){if(this.content=[],this.indent=0,this)this.args=K}indented(K){this.indent+=1,K(this),this.indent-=1}write(K){if(typeof K==="function"){K(this,{execution:"sync"}),K(this,{execution:"async"});return}let W=K.split(`
19
+ `).filter((b)=>b),S=Math.min(...W.map((b)=>b.length-b.trimStart().length)),M=W.map((b)=>b.slice(S)).map((b)=>" ".repeat(this.indent*2)+b);for(let b of M)this.content.push(b)}compile(){let K=Function,w=this?.args,S=[...(this?.content??[""]).map((M)=>` ${M}`)];return new K(...w,S.join(`
20
+ `))}}var n3={major:4,minor:2,patch:1};var I2=R("$ZodType",(K,w)=>{var W;K??(K={}),K._zod.def=w,K._zod.bag=K._zod.bag||{},K._zod.version=n3;let S=[...K._zod.def.checks??[]];if(K._zod.traits.has("$ZodCheck"))S.unshift(K);for(let M of S)for(let b of M._zod.onattach)b(K);if(S.length===0)(W=K._zod).deferred??(W.deferred=[]),K._zod.deferred?.push(()=>{K._zod.run=K._zod.parse});else{let M=(P,J,O)=>{let N=O4(P),G;for(let H of J){if(H._zod.def.when){if(!H._zod.def.when(P))continue}else if(N)continue;let Q=P.issues.length,F=H._zod.check(P);if(F instanceof Promise&&O?.async===!1)throw new d2;if(G||F instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await F,P.issues.length===Q)return;if(!N)N=O4(P,Q)});else{if(P.issues.length===Q)continue;if(!N)N=O4(P,Q)}}if(G)return G.then(()=>{return P});return P},b=(P,J,O)=>{if(O4(P))return P.aborted=!0,P;let N=M(J,S,O);if(N instanceof Promise){if(O.async===!1)throw new d2;return N.then((G)=>K._zod.parse(G,O))}return K._zod.parse(N,O)};K._zod.run=(P,J)=>{if(J.skipChecks)return K._zod.parse(P,J);if(J.direction==="backward"){let N=K._zod.parse({value:P.value,issues:[]},{...J,skipChecks:!0});if(N instanceof Promise)return N.then((G)=>{return b(G,P,J)});return b(N,P,J)}let O=K._zod.parse(P,J);if(O instanceof Promise){if(J.async===!1)throw new d2;return O.then((N)=>M(N,S,J))}return M(O,S,J)}}K["~standard"]={validate:(M)=>{try{let b=b3(K,M);return b.success?{value:b.data}:{issues:b.error?.issues}}catch(b){return P3(K,M).then((P)=>P.success?{value:P.data}:{issues:P.error?.issues})}},vendor:"zod",version:1}}),v6=R("$ZodString",(K,w)=>{I2.init(K,w),K._zod.pattern=[...K?._zod.bag?.patterns??[]].pop()??x3(K._zod.bag),K._zod.parse=(W,S)=>{if(w.coerce)try{W.value=String(W.value)}catch(M){}if(typeof W.value==="string")return W;return W.issues.push({expected:"string",code:"invalid_type",input:W.value,inst:K}),W}}),M2=R("$ZodStringFormat",(K,w)=>{p4.init(K,w),v6.init(K,w)}),b5=R("$ZodGUID",(K,w)=>{w.pattern??(w.pattern=L3),M2.init(K,w)}),P5=R("$ZodUUID",(K,w)=>{if(w.version){let S={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[w.version];if(S===void 0)throw Error(`Invalid UUID version: "${w.version}"`);w.pattern??(w.pattern=L8(S))}else w.pattern??(w.pattern=L8());M2.init(K,w)}),J5=R("$ZodEmail",(K,w)=>{w.pattern??(w.pattern=q3),M2.init(K,w)}),O5=R("$ZodURL",(K,w)=>{M2.init(K,w),K._zod.check=(W)=>{try{let S=W.value.trim(),M=new URL(S);if(w.hostname){if(w.hostname.lastIndex=0,!w.hostname.test(M.hostname))W.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:w.hostname.source,input:W.value,inst:K,continue:!w.abort})}if(w.protocol){if(w.protocol.lastIndex=0,!w.protocol.test(M.protocol.endsWith(":")?M.protocol.slice(0,-1):M.protocol))W.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:w.protocol.source,input:W.value,inst:K,continue:!w.abort})}if(w.normalize)W.value=M.href;else W.value=S;return}catch(S){W.issues.push({code:"invalid_format",format:"url",input:W.value,inst:K,continue:!w.abort})}}}),N5=R("$ZodEmoji",(K,w)=>{w.pattern??(w.pattern=h3()),M2.init(K,w)}),I5=R("$ZodNanoID",(K,w)=>{w.pattern??(w.pattern=H3),M2.init(K,w)}),D5=R("$ZodCUID",(K,w)=>{w.pattern??(w.pattern=Q3),M2.init(K,w)}),G5=R("$ZodCUID2",(K,w)=>{w.pattern??(w.pattern=$3),M2.init(K,w)}),B5=R("$ZodULID",(K,w)=>{w.pattern??(w.pattern=z3),M2.init(K,w)}),X5=R("$ZodXID",(K,w)=>{w.pattern??(w.pattern=U3),M2.init(K,w)}),Q5=R("$ZodKSUID",(K,w)=>{w.pattern??(w.pattern=Y3),M2.init(K,w)}),$5=R("$ZodISODateTime",(K,w)=>{w.pattern??(w.pattern=C3(w)),M2.init(K,w)}),z5=R("$ZodISODate",(K,w)=>{w.pattern??(w.pattern=Z3),M2.init(K,w)}),U5=R("$ZodISOTime",(K,w)=>{w.pattern??(w.pattern=c3(w)),M2.init(K,w)}),Y5=R("$ZodISODuration",(K,w)=>{w.pattern??(w.pattern=V3),M2.init(K,w)}),H5=R("$ZodIPv4",(K,w)=>{w.pattern??(w.pattern=F3),M2.init(K,w),K._zod.bag.format="ipv4"}),V5=R("$ZodIPv6",(K,w)=>{w.pattern??(w.pattern=E3),M2.init(K,w),K._zod.bag.format="ipv6",K._zod.check=(W)=>{try{new URL(`http://[${W.value}]`)}catch{W.issues.push({code:"invalid_format",format:"ipv6",input:W.value,inst:K,continue:!w.abort})}}});var L5=R("$ZodCIDRv4",(K,w)=>{w.pattern??(w.pattern=v3),M2.init(K,w)}),q5=R("$ZodCIDRv6",(K,w)=>{w.pattern??(w.pattern=R3),M2.init(K,w),K._zod.check=(W)=>{let S=W.value.split("/");try{if(S.length!==2)throw Error();let[M,b]=S;if(!b)throw Error();let P=Number(b);if(`${P}`!==b)throw Error();if(P<0||P>128)throw Error();new URL(`http://[${M}]`)}catch{W.issues.push({code:"invalid_format",format:"cidrv6",input:W.value,inst:K,continue:!w.abort})}}});function h5(K){if(K==="")return!0;if(K.length%4!==0)return!1;try{return atob(K),!0}catch{return!1}}var F5=R("$ZodBase64",(K,w)=>{w.pattern??(w.pattern=j3),M2.init(K,w),K._zod.bag.contentEncoding="base64",K._zod.check=(W)=>{if(h5(W.value))return;W.issues.push({code:"invalid_format",format:"base64",input:W.value,inst:K,continue:!w.abort})}});function Nw(K){if(!q8.test(K))return!1;let w=K.replace(/[-_]/g,(S)=>S==="-"?"+":"/"),W=w.padEnd(Math.ceil(w.length/4)*4,"=");return h5(W)}var E5=R("$ZodBase64URL",(K,w)=>{w.pattern??(w.pattern=q8),M2.init(K,w),K._zod.bag.contentEncoding="base64url",K._zod.check=(W)=>{if(Nw(W.value))return;W.issues.push({code:"invalid_format",format:"base64url",input:W.value,inst:K,continue:!w.abort})}}),v5=R("$ZodE164",(K,w)=>{w.pattern??(w.pattern=k3),M2.init(K,w)});function Iw(K,w=null){try{let W=K.split(".");if(W.length!==3)return!1;let[S]=W;if(!S)return!1;let M=JSON.parse(atob(S));if("typ"in M&&M?.typ!=="JWT")return!1;if(!M.alg)return!1;if(w&&(!("alg"in M)||M.alg!==w))return!1;return!0}catch{return!1}}var R5=R("$ZodJWT",(K,w)=>{M2.init(K,w),K._zod.check=(W)=>{if(Iw(W.value,w.alg))return;W.issues.push({code:"invalid_format",format:"jwt",input:W.value,inst:K,continue:!w.abort})}});var j5=R("$ZodUnknown",(K,w)=>{I2.init(K,w),K._zod.parse=(W)=>W}),k5=R("$ZodNever",(K,w)=>{I2.init(K,w),K._zod.parse=(W,S)=>{return W.issues.push({expected:"never",code:"invalid_type",input:W.value,inst:K}),W}});function t3(K,w,W){if(K.issues.length)w.issues.push(...m4(W,K.issues));w.value[W]=K.value}var g5=R("$ZodArray",(K,w)=>{I2.init(K,w),K._zod.parse=(W,S)=>{let M=W.value;if(!Array.isArray(M))return W.issues.push({expected:"array",code:"invalid_type",input:M,inst:K}),W;W.value=Array(M.length);let b=[];for(let P=0;P<M.length;P++){let J=M[P],O=w.element._zod.run({value:J,issues:[]},S);if(O instanceof Promise)b.push(O.then((N)=>t3(N,W,P)));else t3(O,W,P)}if(b.length)return Promise.all(b).then(()=>W);return W}});function E6(K,w,W,S){if(K.issues.length)w.issues.push(...m4(W,K.issues));if(K.value===void 0){if(W in S)w.value[W]=void 0}else w.value[W]=K.value}function Z5(K){let w=Object.keys(K.shape);for(let S of w)if(!K.shape?.[S]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${S}": expected a Zod schema`);let W=H8(K.shape);return{...K,keys:w,keySet:new Set(w),numKeys:w.length,optionalKeys:new Set(W)}}function A5(K,w,W,S,M,b){let P=[],J=M.keySet,O=M.catchall._zod,N=O.def.type;for(let G in w){if(J.has(G))continue;if(N==="never"){P.push(G);continue}let H=O.run({value:w[G],issues:[]},S);if(H instanceof Promise)K.push(H.then((Q)=>E6(Q,W,G,w)));else E6(H,W,G,w)}if(P.length)W.issues.push({code:"unrecognized_keys",keys:P,input:w,inst:b});if(!K.length)return W;return Promise.all(K).then(()=>{return W})}var Dw=R("$ZodObject",(K,w)=>{if(I2.init(K,w),!Object.getOwnPropertyDescriptor(w,"shape")?.get){let J=w.shape;Object.defineProperty(w,"shape",{get:()=>{let O={...J};return Object.defineProperty(w,"shape",{value:O}),O}})}let S=y4(()=>Z5(w));w2(K._zod,"propValues",()=>{let J=w.shape,O={};for(let N in J){let G=J[N]._zod;if(G.values){O[N]??(O[N]=new Set);for(let H of G.values)O[N].add(H)}}return O});let M=j4,b=w.catchall,P;K._zod.parse=(J,O)=>{P??(P=S.value);let N=J.value;if(!M(N))return J.issues.push({expected:"object",code:"invalid_type",input:N,inst:K}),J;J.value={};let G=[],H=P.shape;for(let Q of P.keys){let D=H[Q]._zod.run({value:N[Q],issues:[]},O);if(D instanceof Promise)G.push(D.then((Y)=>E6(Y,J,Q,N)));else E6(D,J,Q,N)}if(!b)return G.length?Promise.all(G).then(()=>J):J;return A5(G,N,J,O,S.value,K)}}),c5=R("$ZodObjectJIT",(K,w)=>{Dw.init(K,w);let W=K._zod.parse,S=y4(()=>Z5(w)),M=(Q)=>{let F=new h8(["shape","payload","ctx"]),D=S.value,Y=(U)=>{let B=Y6(U);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};F.write("const input = payload.value;");let E=Object.create(null),I=0;for(let U of D.keys)E[U]=`key_${I++}`;F.write("const newResult = {};");for(let U of D.keys){let B=E[U],h=Y6(U);F.write(`const ${B} = ${Y(U)};`),F.write(`
21
+ if (${B}.issues.length) {
22
+ payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
23
23
  ...iss,
24
- path: iss.path ? [${H}, ...iss.path] : [${H}]
24
+ path: iss.path ? [${h}, ...iss.path] : [${h}]
25
25
  })));
26
26
  }
27
27
 
28
28
 
29
- if (${D}.value === undefined) {
30
- if (${H} in input) {
31
- newResult[${H}] = undefined;
29
+ if (${B}.value === undefined) {
30
+ if (${h} in input) {
31
+ newResult[${h}] = undefined;
32
32
  }
33
33
  } else {
34
- newResult[${H}] = ${D}.value;
34
+ newResult[${h}] = ${B}.value;
35
35
  }
36
36
 
37
- `)}L.write("payload.value = newResult;"),L.write("return payload;");let Y=L.compile();return(B,D)=>Y(z,B,D)},h,W=F2,M=!G4.jitless,O=M&&D6.value,G=K.catchall,V;c._zod.parse=(z,L)=>{V??(V=P.value);let I=z.value;if(!W(I))return z.issues.push({expected:"object",code:"invalid_type",input:I,inst:c}),z;if(M&&O&&L?.async===!1&&L.jitless!==!0){if(!h)h=S(K.shape);if(z=h(z,L),!G)return z;return Y3([],I,z,L,V,c)}return w(z,L)}});function y5(c,K,w,P){for(let h of c)if(h.issues.length===0)return K.value=h.value,K;let S=c.filter((h)=>!b2(h));if(S.length===1)return K.value=S[0].value,S[0];return K.issues.push({code:"invalid_union",input:K.value,inst:w,errors:c.map((h)=>h.issues.map((W)=>Cc(W,P,nc())))}),K}var V3=F("$ZodUnion",(c,K)=>{Oc.init(c,K),Kc(c._zod,"optin",()=>K.options.some((S)=>S._zod.optin==="optional")?"optional":void 0),Kc(c._zod,"optout",()=>K.options.some((S)=>S._zod.optout==="optional")?"optional":void 0),Kc(c._zod,"values",()=>{if(K.options.every((S)=>S._zod.values))return new Set(K.options.flatMap((S)=>Array.from(S._zod.values)));return}),Kc(c._zod,"pattern",()=>{if(K.options.every((S)=>S._zod.pattern)){let S=K.options.map((h)=>h._zod.pattern);return new RegExp(`^(${S.map((h)=>u2(h.source)).join("|")})$`)}return});let w=K.options.length===1,P=K.options[0]._zod.run;c._zod.parse=(S,h)=>{if(w)return P(S,h);let W=!1,M=[];for(let J of K.options){let O=J._zod.run({value:S.value,issues:[]},h);if(O instanceof Promise)M.push(O),W=!0;else{if(O.issues.length===0)return O;M.push(O)}}if(!W)return y5(M,S,c,h);return Promise.all(M).then((J)=>{return y5(J,S,c,h)})}});var L3=F("$ZodIntersection",(c,K)=>{Oc.init(c,K),c._zod.parse=(w,P)=>{let S=w.value,h=K.left._zod.run({value:S,issues:[]},P),W=K.right._zod.run({value:S,issues:[]},P);if(h instanceof Promise||W instanceof Promise)return Promise.all([h,W]).then(([J,O])=>{return _5(w,J,O)});return _5(w,h,W)}});function $6(c,K){if(c===K)return{valid:!0,data:c};if(c instanceof Date&&K instanceof Date&&+c===+K)return{valid:!0,data:c};if(B2(c)&&B2(K)){let w=Object.keys(K),P=Object.keys(c).filter((h)=>w.indexOf(h)!==-1),S={...c,...K};for(let h of P){let W=$6(c[h],K[h]);if(!W.valid)return{valid:!1,mergeErrorPath:[h,...W.mergeErrorPath]};S[h]=W.data}return{valid:!0,data:S}}if(Array.isArray(c)&&Array.isArray(K)){if(c.length!==K.length)return{valid:!1,mergeErrorPath:[]};let w=[];for(let P=0;P<c.length;P++){let S=c[P],h=K[P],W=$6(S,h);if(!W.valid)return{valid:!1,mergeErrorPath:[P,...W.mergeErrorPath]};w.push(W.data)}return{valid:!0,data:w}}return{valid:!1,mergeErrorPath:[]}}function _5(c,K,w){if(K.issues.length)c.issues.push(...K.issues);if(w.issues.length)c.issues.push(...w.issues);if(b2(c))return c;let P=$6(K.value,w.value);if(!P.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(P.mergeErrorPath)}`);return c.value=P.data,c}var q3=F("$ZodEnum",(c,K)=>{Oc.init(c,K);let w=J6(K.entries),P=new Set(w);c._zod.values=P,c._zod.pattern=new RegExp(`^(${w.filter((S)=>N6.has(typeof S)).map((S)=>typeof S==="string"?z2(S):S.toString()).join("|")})$`),c._zod.parse=(S,h)=>{let W=S.value;if(P.has(W))return S;return S.issues.push({code:"invalid_value",values:w,input:W,inst:c}),S}});var v3=F("$ZodTransform",(c,K)=>{Oc.init(c,K),c._zod.parse=(w,P)=>{if(P.direction==="backward")throw new A2(c.constructor.name);let S=K.transform(w.value,w);if(P.async)return(S instanceof Promise?S:Promise.resolve(S)).then((W)=>{return w.value=W,w});if(S instanceof Promise)throw new ic;return w.value=S,w}});function f5(c,K){if(c.issues.length&&K===void 0)return{issues:[],value:void 0};return c}var F3=F("$ZodOptional",(c,K)=>{Oc.init(c,K),c._zod.optin="optional",c._zod.optout="optional",Kc(c._zod,"values",()=>{return K.innerType._zod.values?new Set([...K.innerType._zod.values,void 0]):void 0}),Kc(c._zod,"pattern",()=>{let w=K.innerType._zod.pattern;return w?new RegExp(`^(${u2(w.source)})?$`):void 0}),c._zod.parse=(w,P)=>{if(K.innerType._zod.optin==="optional"){let S=K.innerType._zod.run(w,P);if(S instanceof Promise)return S.then((h)=>f5(h,w.value));return f5(S,w.value)}if(w.value===void 0)return w;return K.innerType._zod.run(w,P)}}),E3=F("$ZodNullable",(c,K)=>{Oc.init(c,K),Kc(c._zod,"optin",()=>K.innerType._zod.optin),Kc(c._zod,"optout",()=>K.innerType._zod.optout),Kc(c._zod,"pattern",()=>{let w=K.innerType._zod.pattern;return w?new RegExp(`^(${u2(w.source)}|null)$`):void 0}),Kc(c._zod,"values",()=>{return K.innerType._zod.values?new Set([...K.innerType._zod.values,null]):void 0}),c._zod.parse=(w,P)=>{if(w.value===null)return w;return K.innerType._zod.run(w,P)}}),R3=F("$ZodDefault",(c,K)=>{Oc.init(c,K),c._zod.optin="optional",Kc(c._zod,"values",()=>K.innerType._zod.values),c._zod.parse=(w,P)=>{if(P.direction==="backward")return K.innerType._zod.run(w,P);if(w.value===void 0)return w.value=K.defaultValue,w;let S=K.innerType._zod.run(w,P);if(S instanceof Promise)return S.then((h)=>e5(h,K));return e5(S,K)}});function e5(c,K){if(c.value===void 0)c.value=K.defaultValue;return c}var g3=F("$ZodPrefault",(c,K)=>{Oc.init(c,K),c._zod.optin="optional",Kc(c._zod,"values",()=>K.innerType._zod.values),c._zod.parse=(w,P)=>{if(P.direction==="backward")return K.innerType._zod.run(w,P);if(w.value===void 0)w.value=K.defaultValue;return K.innerType._zod.run(w,P)}}),k3=F("$ZodNonOptional",(c,K)=>{Oc.init(c,K),Kc(c._zod,"values",()=>{let w=K.innerType._zod.values;return w?new Set([...w].filter((P)=>P!==void 0)):void 0}),c._zod.parse=(w,P)=>{let S=K.innerType._zod.run(w,P);if(S instanceof Promise)return S.then((h)=>l5(h,c));return l5(S,c)}});function l5(c,K){if(!c.issues.length&&c.value===void 0)c.issues.push({code:"invalid_type",expected:"nonoptional",input:c.value,inst:K});return c}var x3=F("$ZodCatch",(c,K)=>{Oc.init(c,K),Kc(c._zod,"optin",()=>K.innerType._zod.optin),Kc(c._zod,"optout",()=>K.innerType._zod.optout),Kc(c._zod,"values",()=>K.innerType._zod.values),c._zod.parse=(w,P)=>{if(P.direction==="backward")return K.innerType._zod.run(w,P);let S=K.innerType._zod.run(w,P);if(S instanceof Promise)return S.then((h)=>{if(w.value=h.value,h.issues.length)w.value=K.catchValue({...w,error:{issues:h.issues.map((W)=>Cc(W,P,nc()))},input:w.value}),w.issues=[];return w});if(w.value=S.value,S.issues.length)w.value=K.catchValue({...w,error:{issues:S.issues.map((h)=>Cc(h,P,nc()))},input:w.value}),w.issues=[];return w}});var Z3=F("$ZodPipe",(c,K)=>{Oc.init(c,K),Kc(c._zod,"values",()=>K.in._zod.values),Kc(c._zod,"optin",()=>K.in._zod.optin),Kc(c._zod,"optout",()=>K.out._zod.optout),Kc(c._zod,"propValues",()=>K.in._zod.propValues),c._zod.parse=(w,P)=>{if(P.direction==="backward"){let h=K.out._zod.run(w,P);if(h instanceof Promise)return h.then((W)=>U4(W,K.in,P));return U4(h,K.in,P)}let S=K.in._zod.run(w,P);if(S instanceof Promise)return S.then((h)=>U4(h,K.out,P));return U4(S,K.out,P)}});function U4(c,K,w){if(c.issues.length)return c.aborted=!0,c;return K._zod.run({value:c.value,issues:c.issues},w)}var A3=F("$ZodReadonly",(c,K)=>{Oc.init(c,K),Kc(c._zod,"propValues",()=>K.innerType._zod.propValues),Kc(c._zod,"values",()=>K.innerType._zod.values),Kc(c._zod,"optin",()=>K.innerType._zod.optin),Kc(c._zod,"optout",()=>K.innerType._zod.optout),c._zod.parse=(w,P)=>{if(P.direction==="backward")return K.innerType._zod.run(w,P);let S=K.innerType._zod.run(w,P);if(S instanceof Promise)return S.then(p5);return p5(S)}});function p5(c){return c.value=Object.freeze(c.value),c}var r3=F("$ZodCustom",(c,K)=>{Vc.init(c,K),Oc.init(c,K),c._zod.parse=(w,P)=>{return w},c._zod.check=(w)=>{let P=w.value,S=K.fn(P);if(S instanceof Promise)return S.then((h)=>T5(h,w,P,c));T5(S,w,P,c);return}});function T5(c,K,w,P){if(!c){let S={code:"custom",input:w,inst:P,path:[...P._zod.def.path??[]],continue:!P._zod.def.abort};if(P._zod.def.params)S.params=P._zod.def.params;K.issues.push(R2(S))}}var kP=Symbol("ZodOutput"),xP=Symbol("ZodInput");class o3{constructor(){this._map=new WeakMap,this._idmap=new Map}add(c,...K){let w=K[0];if(this._map.set(c,w),w&&typeof w==="object"&&"id"in w){if(this._idmap.has(w.id))throw Error(`ID ${w.id} already exists in the registry`);this._idmap.set(w.id,c)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(c){let K=this._map.get(c);if(K&&typeof K==="object"&&"id"in K)this._idmap.delete(K.id);return this._map.delete(c),this}get(c){let K=c._zod.parent;if(K){let w={...this.get(K)??{}};delete w.id;let P={...w,...this._map.get(c)};return Object.keys(P).length?P:void 0}return this._map.get(c)}has(c){return this._map.has(c)}}function Z1(){return new o3}var l2=Z1();function m3(c,K){return new c({type:"string",...e(K)})}function Q6(c,K){return new c({type:"string",format:"email",check:"string_format",abort:!1,...e(K)})}function U6(c,K){return new c({type:"string",format:"guid",check:"string_format",abort:!1,...e(K)})}function u3(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,...e(K)})}function C3(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...e(K)})}function y3(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...e(K)})}function _3(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...e(K)})}function f3(c,K){return new c({type:"string",format:"url",check:"string_format",abort:!1,...e(K)})}function e3(c,K){return new c({type:"string",format:"emoji",check:"string_format",abort:!1,...e(K)})}function l3(c,K){return new c({type:"string",format:"nanoid",check:"string_format",abort:!1,...e(K)})}function p3(c,K){return new c({type:"string",format:"cuid",check:"string_format",abort:!1,...e(K)})}function T3(c,K){return new c({type:"string",format:"cuid2",check:"string_format",abort:!1,...e(K)})}function i3(c,K){return new c({type:"string",format:"ulid",check:"string_format",abort:!1,...e(K)})}function n3(c,K){return new c({type:"string",format:"xid",check:"string_format",abort:!1,...e(K)})}function t3(c,K){return new c({type:"string",format:"ksuid",check:"string_format",abort:!1,...e(K)})}function d3(c,K){return new c({type:"string",format:"ipv4",check:"string_format",abort:!1,...e(K)})}function s3(c,K){return new c({type:"string",format:"ipv6",check:"string_format",abort:!1,...e(K)})}function a3(c,K){return new c({type:"string",format:"cidrv4",check:"string_format",abort:!1,...e(K)})}function cK(c,K){return new c({type:"string",format:"cidrv6",check:"string_format",abort:!1,...e(K)})}function KK(c,K){return new c({type:"string",format:"base64",check:"string_format",abort:!1,...e(K)})}function wK(c,K){return new c({type:"string",format:"base64url",check:"string_format",abort:!1,...e(K)})}function PK(c,K){return new c({type:"string",format:"e164",check:"string_format",abort:!1,...e(K)})}function SK(c,K){return new c({type:"string",format:"jwt",check:"string_format",abort:!1,...e(K)})}function hK(c,K){return new c({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...e(K)})}function WK(c,K){return new c({type:"string",format:"date",check:"string_format",...e(K)})}function MK(c,K){return new c({type:"string",format:"time",check:"string_format",precision:null,...e(K)})}function bK(c,K){return new c({type:"string",format:"duration",check:"string_format",...e(K)})}function IK(c){return new c({type:"unknown"})}function OK(c,K){return new c({type:"never",...e(K)})}function V4(c,K){return new F5({check:"max_length",...e(K),maximum:c})}function g2(c,K){return new E5({check:"min_length",...e(K),minimum:c})}function L4(c,K){return new R5({check:"length_equals",...e(K),length:c})}function Y6(c,K){return new g5({check:"string_format",format:"regex",...e(K),pattern:c})}function H6(c){return new k5({check:"string_format",format:"lowercase",...e(c)})}function V6(c){return new x5({check:"string_format",format:"uppercase",...e(c)})}function L6(c,K){return new Z5({check:"string_format",format:"includes",...e(K),includes:c})}function q6(c,K){return new A5({check:"string_format",format:"starts_with",...e(K),prefix:c})}function v6(c,K){return new r5({check:"string_format",format:"ends_with",...e(K),suffix:c})}function $2(c){return new o5({check:"overwrite",tx:c})}function F6(c){return $2((K)=>K.normalize(c))}function E6(){return $2((c)=>c.trim())}function R6(){return $2((c)=>c.toLowerCase())}function g6(){return $2((c)=>c.toUpperCase())}function JK(c,K,w){return new c({type:"array",element:K,...e(w)})}function DK(c,K,w){return new c({type:"custom",check:"custom",fn:K,...e(w)})}function NK(c){let K=A1((w)=>{return w.addIssue=(P)=>{if(typeof P==="string")w.issues.push(R2(P,w.value,K._zod.def));else{let S=P;if(S.fatal)S.continue=!1;S.code??(S.code="custom"),S.input??(S.input=w.value),S.inst??(S.inst=K),S.continue??(S.continue=!K._zod.def.abort),w.issues.push(R2(S))}},c(w.value,w)});return K}function A1(c,K){let w=new Vc({check:"custom",...e(K)});return w._zod.check=c,w}var p1=F("ZodISODateTime",(c,K)=>{h3.init(c,K),Wc.init(c,K)});function GK(c){return hK(p1,c)}var T1=F("ZodISODate",(c,K)=>{W3.init(c,K),Wc.init(c,K)});function jK(c){return WK(T1,c)}var i1=F("ZodISOTime",(c,K)=>{M3.init(c,K),Wc.init(c,K)});function XK(c){return MK(i1,c)}var n1=F("ZodISODuration",(c,K)=>{b3.init(c,K),Wc.init(c,K)});function BK(c){return bK(n1,c)}var zK=(c,K)=>{B4.init(c,K),c.name="ZodError",Object.defineProperties(c,{format:{value:(w)=>p8(c,w)},flatten:{value:(w)=>l8(c,w)},addIssue:{value:(w)=>{c.issues.push(w),c.message=JSON.stringify(c.issues,E2,2)}},addIssues:{value:(w)=>{c.issues.push(...w),c.message=JSON.stringify(c.issues,E2,2)}},isEmpty:{get(){return c.issues.length===0}}})},IS=F("ZodError",zK),Lc=F("ZodError",zK,{Parent:Error});var $K=z4(Lc),QK=$4(Lc),UK=_2(Lc),YK=f2(Lc),HK=n8(Lc),VK=t8(Lc),LK=d8(Lc),qK=s8(Lc),vK=a8(Lc),FK=c5(Lc),EK=K5(Lc),RK=w5(Lc);var Dc=F("ZodType",(c,K)=>{return Oc.init(c,K),c.def=K,c.type=K.type,Object.defineProperty(c,"_def",{value:K}),c.check=(...w)=>{return c.clone(cc.mergeDefs(K,{checks:[...K.checks??[],...w.map((P)=>typeof P==="function"?{_zod:{check:P,def:{check:"custom"},onattach:[]}}:P)]}))},c.clone=(w,P)=>xc(c,w,P),c.brand=()=>c,c.register=(w,P)=>{return w.add(c,P),c},c.parse=(w,P)=>$K(c,w,P,{callee:c.parse}),c.safeParse=(w,P)=>UK(c,w,P),c.parseAsync=async(w,P)=>QK(c,w,P,{callee:c.parseAsync}),c.safeParseAsync=async(w,P)=>YK(c,w,P),c.spa=c.safeParseAsync,c.encode=(w,P)=>HK(c,w,P),c.decode=(w,P)=>VK(c,w,P),c.encodeAsync=async(w,P)=>LK(c,w,P),c.decodeAsync=async(w,P)=>qK(c,w,P),c.safeEncode=(w,P)=>vK(c,w,P),c.safeDecode=(w,P)=>FK(c,w,P),c.safeEncodeAsync=async(w,P)=>EK(c,w,P),c.safeDecodeAsync=async(w,P)=>RK(c,w,P),c.refine=(w,P)=>c.check(y9(w,P)),c.superRefine=(w)=>c.check(_9(w)),c.overwrite=(w)=>c.check($2(w)),c.optional=()=>xK(c),c.nullable=()=>ZK(c),c.nullish=()=>xK(ZK(c)),c.nonoptional=(w)=>Z9(c,w),c.array=()=>Q9(c),c.or=(w)=>H9([c,w]),c.and=(w)=>L9(c,w),c.transform=(w)=>AK(c,F9(w)),c.default=(w)=>g9(c,w),c.prefault=(w)=>x9(c,w),c.catch=(w)=>r9(c,w),c.pipe=(w)=>AK(c,w),c.readonly=()=>u9(c),c.describe=(w)=>{let P=c.clone();return l2.add(P,{description:w}),P},Object.defineProperty(c,"description",{get(){return l2.get(c)?.description},configurable:!0}),c.meta=(...w)=>{if(w.length===0)return l2.get(c);let P=c.clone();return l2.add(P,w[0]),P},c.isOptional=()=>c.safeParse(void 0).success,c.isNullable=()=>c.safeParse(null).success,c}),rK=F("_ZodString",(c,K)=>{H4.init(c,K),Dc.init(c,K);let w=c._zod.bag;c.format=w.format??null,c.minLength=w.minimum??null,c.maxLength=w.maximum??null,c.regex=(...P)=>c.check(Y6(...P)),c.includes=(...P)=>c.check(L6(...P)),c.startsWith=(...P)=>c.check(q6(...P)),c.endsWith=(...P)=>c.check(v6(...P)),c.min=(...P)=>c.check(g2(...P)),c.max=(...P)=>c.check(V4(...P)),c.length=(...P)=>c.check(L4(...P)),c.nonempty=(...P)=>c.check(g2(1,...P)),c.lowercase=(P)=>c.check(H6(P)),c.uppercase=(P)=>c.check(V6(P)),c.trim=()=>c.check(E6()),c.normalize=(...P)=>c.check(F6(...P)),c.toLowerCase=()=>c.check(R6()),c.toUpperCase=()=>c.check(g6())}),a1=F("ZodString",(c,K)=>{H4.init(c,K),rK.init(c,K),c.email=(w)=>c.check(Q6(mK,w)),c.url=(w)=>c.check(f3(c9,w)),c.jwt=(w)=>c.check(SK(j9,w)),c.emoji=(w)=>c.check(e3(K9,w)),c.guid=(w)=>c.check(U6(gK,w)),c.uuid=(w)=>c.check(u3(v4,w)),c.uuidv4=(w)=>c.check(C3(v4,w)),c.uuidv6=(w)=>c.check(y3(v4,w)),c.uuidv7=(w)=>c.check(_3(v4,w)),c.nanoid=(w)=>c.check(l3(w9,w)),c.guid=(w)=>c.check(U6(gK,w)),c.cuid=(w)=>c.check(p3(P9,w)),c.cuid2=(w)=>c.check(T3(S9,w)),c.ulid=(w)=>c.check(i3(h9,w)),c.base64=(w)=>c.check(KK(D9,w)),c.base64url=(w)=>c.check(wK(N9,w)),c.xid=(w)=>c.check(n3(W9,w)),c.ksuid=(w)=>c.check(t3(M9,w)),c.ipv4=(w)=>c.check(d3(b9,w)),c.ipv6=(w)=>c.check(s3(I9,w)),c.cidrv4=(w)=>c.check(a3(O9,w)),c.cidrv6=(w)=>c.check(cK(J9,w)),c.e164=(w)=>c.check(PK(G9,w)),c.datetime=(w)=>c.check(GK(w)),c.date=(w)=>c.check(jK(w)),c.time=(w)=>c.check(XK(w)),c.duration=(w)=>c.check(BK(w))});function oK(c){return m3(a1,c)}var Wc=F("ZodStringFormat",(c,K)=>{Sc.init(c,K),rK.init(c,K)}),mK=F("ZodEmail",(c,K)=>{t5.init(c,K),Wc.init(c,K)});function uK(c){return Q6(mK,c)}var gK=F("ZodGUID",(c,K)=>{i5.init(c,K),Wc.init(c,K)});var v4=F("ZodUUID",(c,K)=>{n5.init(c,K),Wc.init(c,K)});var c9=F("ZodURL",(c,K)=>{d5.init(c,K),Wc.init(c,K)});var K9=F("ZodEmoji",(c,K)=>{s5.init(c,K),Wc.init(c,K)});var w9=F("ZodNanoID",(c,K)=>{a5.init(c,K),Wc.init(c,K)});var P9=F("ZodCUID",(c,K)=>{c3.init(c,K),Wc.init(c,K)});var S9=F("ZodCUID2",(c,K)=>{K3.init(c,K),Wc.init(c,K)});var h9=F("ZodULID",(c,K)=>{w3.init(c,K),Wc.init(c,K)});var W9=F("ZodXID",(c,K)=>{P3.init(c,K),Wc.init(c,K)});var M9=F("ZodKSUID",(c,K)=>{S3.init(c,K),Wc.init(c,K)});var b9=F("ZodIPv4",(c,K)=>{I3.init(c,K),Wc.init(c,K)});var I9=F("ZodIPv6",(c,K)=>{O3.init(c,K),Wc.init(c,K)});var O9=F("ZodCIDRv4",(c,K)=>{J3.init(c,K),Wc.init(c,K)});var J9=F("ZodCIDRv6",(c,K)=>{D3.init(c,K),Wc.init(c,K)});var D9=F("ZodBase64",(c,K)=>{G3.init(c,K),Wc.init(c,K)});var N9=F("ZodBase64URL",(c,K)=>{j3.init(c,K),Wc.init(c,K)});var G9=F("ZodE164",(c,K)=>{X3.init(c,K),Wc.init(c,K)});var j9=F("ZodJWT",(c,K)=>{B3.init(c,K),Wc.init(c,K)});var X9=F("ZodUnknown",(c,K)=>{z3.init(c,K),Dc.init(c,K)});function kK(){return IK(X9)}var B9=F("ZodNever",(c,K)=>{$3.init(c,K),Dc.init(c,K)});function z9(c){return OK(B9,c)}var $9=F("ZodArray",(c,K)=>{Q3.init(c,K),Dc.init(c,K),c.element=K.element,c.min=(w,P)=>c.check(g2(w,P)),c.nonempty=(w)=>c.check(g2(1,w)),c.max=(w,P)=>c.check(V4(w,P)),c.length=(w,P)=>c.check(L4(w,P)),c.unwrap=()=>c.element});function Q9(c,K){return JK($9,c,K)}var U9=F("ZodObject",(c,K)=>{H3.init(c,K),Dc.init(c,K),cc.defineLazy(c,"shape",()=>{return K.shape}),c.keyof=()=>q9(Object.keys(c._zod.def.shape)),c.catchall=(w)=>c.clone({...c._zod.def,catchall:w}),c.passthrough=()=>c.clone({...c._zod.def,catchall:kK()}),c.loose=()=>c.clone({...c._zod.def,catchall:kK()}),c.strict=()=>c.clone({...c._zod.def,catchall:z9()}),c.strip=()=>c.clone({...c._zod.def,catchall:void 0}),c.extend=(w)=>{return cc.extend(c,w)},c.safeExtend=(w)=>{return cc.safeExtend(c,w)},c.merge=(w)=>cc.merge(c,w),c.pick=(w)=>cc.pick(c,w),c.omit=(w)=>cc.omit(c,w),c.partial=(...w)=>cc.partial(yK,c,w[0]),c.required=(...w)=>cc.required(_K,c,w[0])});function CK(c,K){let w={type:"object",shape:c??{},...cc.normalizeParams(K)};return new U9(w)}var Y9=F("ZodUnion",(c,K)=>{V3.init(c,K),Dc.init(c,K),c.options=K.options});function H9(c,K){return new Y9({type:"union",options:c,...cc.normalizeParams(K)})}var V9=F("ZodIntersection",(c,K)=>{L3.init(c,K),Dc.init(c,K)});function L9(c,K){return new V9({type:"intersection",left:c,right:K})}var k6=F("ZodEnum",(c,K)=>{q3.init(c,K),Dc.init(c,K),c.enum=K.entries,c.options=Object.values(K.entries);let w=new Set(Object.keys(K.entries));c.extract=(P,S)=>{let h={};for(let W of P)if(w.has(W))h[W]=K.entries[W];else throw Error(`Key ${W} not found in enum`);return new k6({...K,checks:[],...cc.normalizeParams(S),entries:h})},c.exclude=(P,S)=>{let h={...K.entries};for(let W of P)if(w.has(W))delete h[W];else throw Error(`Key ${W} not found in enum`);return new k6({...K,checks:[],...cc.normalizeParams(S),entries:h})}});function q9(c,K){let w=Array.isArray(c)?Object.fromEntries(c.map((P)=>[P,P])):c;return new k6({type:"enum",entries:w,...cc.normalizeParams(K)})}var v9=F("ZodTransform",(c,K)=>{v3.init(c,K),Dc.init(c,K),c._zod.parse=(w,P)=>{if(P.direction==="backward")throw new A2(c.constructor.name);w.addIssue=(h)=>{if(typeof h==="string")w.issues.push(cc.issue(h,w.value,K));else{let W=h;if(W.fatal)W.continue=!1;W.code??(W.code="custom"),W.input??(W.input=w.value),W.inst??(W.inst=c),w.issues.push(cc.issue(W))}};let S=K.transform(w.value,w);if(S instanceof Promise)return S.then((h)=>{return w.value=h,w});return w.value=S,w}});function F9(c){return new v9({type:"transform",transform:c})}var yK=F("ZodOptional",(c,K)=>{F3.init(c,K),Dc.init(c,K),c.unwrap=()=>c._zod.def.innerType});function xK(c){return new yK({type:"optional",innerType:c})}var E9=F("ZodNullable",(c,K)=>{E3.init(c,K),Dc.init(c,K),c.unwrap=()=>c._zod.def.innerType});function ZK(c){return new E9({type:"nullable",innerType:c})}var R9=F("ZodDefault",(c,K)=>{R3.init(c,K),Dc.init(c,K),c.unwrap=()=>c._zod.def.innerType,c.removeDefault=c.unwrap});function g9(c,K){return new R9({type:"default",innerType:c,get defaultValue(){return typeof K==="function"?K():cc.shallowClone(K)}})}var k9=F("ZodPrefault",(c,K)=>{g3.init(c,K),Dc.init(c,K),c.unwrap=()=>c._zod.def.innerType});function x9(c,K){return new k9({type:"prefault",innerType:c,get defaultValue(){return typeof K==="function"?K():cc.shallowClone(K)}})}var _K=F("ZodNonOptional",(c,K)=>{k3.init(c,K),Dc.init(c,K),c.unwrap=()=>c._zod.def.innerType});function Z9(c,K){return new _K({type:"nonoptional",innerType:c,...cc.normalizeParams(K)})}var A9=F("ZodCatch",(c,K)=>{x3.init(c,K),Dc.init(c,K),c.unwrap=()=>c._zod.def.innerType,c.removeCatch=c.unwrap});function r9(c,K){return new A9({type:"catch",innerType:c,catchValue:typeof K==="function"?K:()=>K})}var o9=F("ZodPipe",(c,K)=>{Z3.init(c,K),Dc.init(c,K),c.in=K.in,c.out=K.out});function AK(c,K){return new o9({type:"pipe",in:c,out:K})}var m9=F("ZodReadonly",(c,K)=>{A3.init(c,K),Dc.init(c,K),c.unwrap=()=>c._zod.def.innerType});function u9(c){return new m9({type:"readonly",innerType:c})}var C9=F("ZodCustom",(c,K)=>{r3.init(c,K),Dc.init(c,K)});function y9(c,K={}){return DK(C9,c,K)}function _9(c){return NK(c)}class F4{params;#c=x2.ETokenAudiences.SYSTEM;#K=1;token;constructor(c){this.params=c}async signToken(){let{params:{credential:{tenantId:c,appId:K,modeId:w,secretKey:P},options:S}}=this;try{let h=new Uint8Array(Buffer.from(P,"base64")),W=await crypto.subtle.importKey("raw",h,{name:"HMAC",hash:"SHA-512"},!1,["sign","verify"]),M=await new N4({tenantId:c,appId:K,modeId:w,iss:c,aud:x2.ETokenAudiences.SYSTEM}).setProtectedHeader({alg:"HS512"}).sign(W);return this.token=M,M}catch(h){if(S?.logs)console.error("[BoolGuard] Sign token error:",h);throw h}}async ping(){let{token:c,params:{credential:{tenantId:K,appId:w,modeId:P},options:S}}=this;try{let h=c||await this.signToken(),W=new Headers;W.append("X-Tenant-ID",K),W.append("X-App-ID",w),W.append("X-Mode-ID",P),W.append("Authorization",`Bearer ${h}`);let M=await fetch(`${this.#c}/v${S?.version||this.#K}/tenant-app-modes/ping`,{method:"GET",headers:W});if(!M.ok)throw await M.json();return M.ok}catch(h){if(S?.logs)console.error("[BoolGuard] Ping error:",h);return!1}}async createPlainAccount({identity:c,password:K,metadata:w}){let{token:P,params:{credential:{tenantId:S,appId:h,modeId:W},options:M}}=this;try{let J=P||await this.signToken(),O=new Headers;O.append("X-Tenant-ID",S),O.append("X-App-ID",h),O.append("X-Mode-ID",W),O.append("Authorization",`Bearer ${J}`),O.append("Content-Type","application/json");let G=await fetch(`${this.#c}/v${M?.version||this.#K}/tenant-app-mode-accounts`,{method:"POST",headers:O,body:JSON.stringify({data:Object.freeze({type:"plain",identity:c,password:K,metadata:w})})});if(!G.ok)throw await G.json();let{data:V}=await G.json();return Object.freeze({account:V.account,credential:V.credential})}catch(J){if(M?.logs)console.error("[BoolGuard] Create plain account error:",J);throw J}}async createEmailAccount({identity:c,password:K,metadata:w}){let{token:P,params:{credential:{tenantId:S,appId:h,modeId:W},options:M}}=this;try{let J=P||await this.signToken(),O=new Headers;O.append("X-Tenant-ID",S),O.append("X-App-ID",h),O.append("X-Mode-ID",W),O.append("Authorization",`Bearer ${J}`),O.append("Content-Type","application/json");let G=await fetch(`${this.#c}/v${M?.version||this.#K}/tenant-app-mode-accounts`,{method:"POST",headers:O,body:JSON.stringify({data:Object.freeze({type:"email",identity:c,password:K,metadata:w})})});if(!G.ok)throw await G.json();let{data:V}=await G.json();return Object.freeze({account:V.account,credential:V.credential})}catch(J){if(M?.logs)console.error("[BoolGuard] Create email account error:",J);throw J}}async authenticate({identity:c,password:K}){let{token:w,params:{credential:{tenantId:P,appId:S,modeId:h},options:W}}=this;try{let M=w||await this.signToken(),J=await uK().safeParseAsync(c),O=new Headers;O.append("X-Tenant-ID",P),O.append("X-App-ID",S),O.append("X-Mode-ID",h),O.append("Authorization",`Bearer ${M}`),O.append("Content-Type","application/json");let G=await fetch(`${this.#c}/v${W?.version||this.#K}/tenant-app-mode-accounts/authenticate`,{method:"POST",headers:O,body:JSON.stringify({data:Object.freeze({type:!J.success?"plain":"email",identity:c,password:K})})});if(!G.ok)throw await G.json();let{data:V}=await G.json();return Object.freeze({account:V.account,credential:V.credential,token:V.token})}catch(M){if(W?.logs)console.error("[BoolGuard] Authenticate error:",M);throw M}}async verifyToken({token:c}){let{params:{credential:{tenantId:K,appId:w,modeId:P},options:S}}=this;try{let h=this.token||await this.signToken(),W=new Headers;W.append("X-Tenant-ID",K),W.append("X-App-ID",w),W.append("X-Mode-ID",P),W.append("Authorization",`Bearer ${h}`),W.append("Content-Type","application/json");let M=await fetch(`${this.#c}/v${S?.version||this.#K}/tenant-app-mode-accounts/verify`,{method:"POST",headers:W,body:JSON.stringify({data:Object.freeze({token:c})})});if(!M.ok)throw await M.json();let{data:J}=await M.json();return Object.freeze({account:J.account,credential:J.credential})}catch(h){if(S?.logs)console.error("[BoolGuard] Verify token error:",h);throw h}}}var Dh=async({credential:c,definition:K,options:w})=>{let P=new F4({credential:c,definition:K,options:w});if(await P.signToken(),!await P.ping())throw Error("Ping to Bool Guard service failed!");return[Yc.guardClient,P]};var f9=CK({authorization:oK().startsWith("Bearer ").min(24).transform((c)=>{let[K,w]=c.split(" ");return Object.freeze({schema:K,token:w})})});class x6{clientInstance;constructor(c){this.clientInstance=c}async start(c,K){let w=await f9.safeParseAsync(K.toJSON());if(!w.success)return c.set(Yc.authState,void 0);else{let{authorization:{token:P}}=w.data;try{let{account:S,credential:h}=await this.clientInstance.verifyToken({token:P}),W=Object.freeze({account:S,credential:h});return c.set(Yc.authState,W)}catch(S){return console.error(S),c.set(Yc.authState,void 0)}}}}Y2([O2(0,b4()),O2(1,W8())],x6.prototype,"start",null),x6=Y2([O8(),O2(0,b8(Yc.guardClient))],x6);export{Dh as loader,x6 as Middleware,Yc as Keys,a4 as Interceptor,x2 as Enums,F4 as Client,s4 as AuthState};
37
+ `)}F.write("payload.value = newResult;"),F.write("return payload;");let q=F.compile();return(U,B)=>q(Q,U,B)},b,P=j4,J=!U6.jitless,N=J&&U8.value,G=w.catchall,H;K._zod.parse=(Q,F)=>{H??(H=S.value);let D=Q.value;if(!P(D))return Q.issues.push({expected:"object",code:"invalid_type",input:D,inst:K}),Q;if(J&&N&&F?.async===!1&&F.jitless!==!0){if(!b)b=M(w.shape);if(Q=b(Q,F),!G)return Q;return A5([],D,Q,F,H,K)}return W(Q,F)}});function a3(K,w,W,S){for(let b of K)if(b.issues.length===0)return w.value=b.value,w;let M=K.filter((b)=>!O4(b));if(M.length===1)return w.value=M[0].value,M[0];return w.issues.push({code:"invalid_union",input:w.value,inst:W,errors:K.map((b)=>b.issues.map((P)=>m2(P,S,n2())))}),w}var C5=R("$ZodUnion",(K,w)=>{I2.init(K,w),w2(K._zod,"optin",()=>w.options.some((M)=>M._zod.optin==="optional")?"optional":void 0),w2(K._zod,"optout",()=>w.options.some((M)=>M._zod.optout==="optional")?"optional":void 0),w2(K._zod,"values",()=>{if(w.options.every((M)=>M._zod.values))return new Set(w.options.flatMap((M)=>Array.from(M._zod.values)));return}),w2(K._zod,"pattern",()=>{if(w.options.every((M)=>M._zod.pattern)){let M=w.options.map((b)=>b._zod.pattern);return new RegExp(`^(${M.map((b)=>_4(b.source)).join("|")})$`)}return});let W=w.options.length===1,S=w.options[0]._zod.run;K._zod.parse=(M,b)=>{if(W)return S(M,b);let P=!1,J=[];for(let O of w.options){let N=O._zod.run({value:M.value,issues:[]},b);if(N instanceof Promise)J.push(N),P=!0;else{if(N.issues.length===0)return N;J.push(N)}}if(!P)return a3(J,M,K,b);return Promise.all(J).then((O)=>{return a3(O,M,K,b)})}});var x5=R("$ZodIntersection",(K,w)=>{I2.init(K,w),K._zod.parse=(W,S)=>{let M=W.value,b=w.left._zod.run({value:M,issues:[]},S),P=w.right._zod.run({value:M,issues:[]},S);if(b instanceof Promise||P instanceof Promise)return Promise.all([b,P]).then(([O,N])=>{return s3(W,O,N)});return s3(W,b,P)}});function F8(K,w){if(K===w)return{valid:!0,data:K};if(K instanceof Date&&w instanceof Date&&+K===+w)return{valid:!0,data:K};if(Y4(K)&&Y4(w)){let W=Object.keys(w),S=Object.keys(K).filter((b)=>W.indexOf(b)!==-1),M={...K,...w};for(let b of S){let P=F8(K[b],w[b]);if(!P.valid)return{valid:!1,mergeErrorPath:[b,...P.mergeErrorPath]};M[b]=P.data}return{valid:!0,data:M}}if(Array.isArray(K)&&Array.isArray(w)){if(K.length!==w.length)return{valid:!1,mergeErrorPath:[]};let W=[];for(let S=0;S<K.length;S++){let M=K[S],b=w[S],P=F8(M,b);if(!P.valid)return{valid:!1,mergeErrorPath:[S,...P.mergeErrorPath]};W.push(P.data)}return{valid:!0,data:W}}return{valid:!1,mergeErrorPath:[]}}function s3(K,w,W){if(w.issues.length)K.issues.push(...w.issues);if(W.issues.length)K.issues.push(...W.issues);if(O4(K))return K;let S=F8(w.value,W.value);if(!S.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(S.mergeErrorPath)}`);return K.value=S.data,K}var u5=R("$ZodEnum",(K,w)=>{I2.init(K,w);let W=o4(w.entries),S=new Set(W);K._zod.values=S,K._zod.pattern=new RegExp(`^(${W.filter((M)=>Y8.has(typeof M)).map((M)=>typeof M==="string"?H4(M):M.toString()).join("|")})$`),K._zod.parse=(M,b)=>{let P=M.value;if(S.has(P))return M;return M.issues.push({code:"invalid_value",values:W,input:P,inst:K}),M}});var o5=R("$ZodTransform",(K,w)=>{I2.init(K,w),K._zod.parse=(W,S)=>{if(S.direction==="backward")throw new x4(K.constructor.name);let M=w.transform(W.value,W);if(S.async)return(M instanceof Promise?M:Promise.resolve(M)).then((P)=>{return W.value=P,W});if(M instanceof Promise)throw new d2;return W.value=M,W}});function K5(K,w){if(K.issues.length&&w===void 0)return{issues:[],value:void 0};return K}var y5=R("$ZodOptional",(K,w)=>{I2.init(K,w),K._zod.optin="optional",K._zod.optout="optional",w2(K._zod,"values",()=>{return w.innerType._zod.values?new Set([...w.innerType._zod.values,void 0]):void 0}),w2(K._zod,"pattern",()=>{let W=w.innerType._zod.pattern;return W?new RegExp(`^(${_4(W.source)})?$`):void 0}),K._zod.parse=(W,S)=>{if(w.innerType._zod.optin==="optional"){let M=w.innerType._zod.run(W,S);if(M instanceof Promise)return M.then((b)=>K5(b,W.value));return K5(M,W.value)}if(W.value===void 0)return W;return w.innerType._zod.run(W,S)}}),r5=R("$ZodNullable",(K,w)=>{I2.init(K,w),w2(K._zod,"optin",()=>w.innerType._zod.optin),w2(K._zod,"optout",()=>w.innerType._zod.optout),w2(K._zod,"pattern",()=>{let W=w.innerType._zod.pattern;return W?new RegExp(`^(${_4(W.source)}|null)$`):void 0}),w2(K._zod,"values",()=>{return w.innerType._zod.values?new Set([...w.innerType._zod.values,null]):void 0}),K._zod.parse=(W,S)=>{if(W.value===null)return W;return w.innerType._zod.run(W,S)}}),_5=R("$ZodDefault",(K,w)=>{I2.init(K,w),K._zod.optin="optional",w2(K._zod,"values",()=>w.innerType._zod.values),K._zod.parse=(W,S)=>{if(S.direction==="backward")return w.innerType._zod.run(W,S);if(W.value===void 0)return W.value=w.defaultValue,W;let M=w.innerType._zod.run(W,S);if(M instanceof Promise)return M.then((b)=>w5(b,w));return w5(M,w)}});function w5(K,w){if(K.value===void 0)K.value=w.defaultValue;return K}var m5=R("$ZodPrefault",(K,w)=>{I2.init(K,w),K._zod.optin="optional",w2(K._zod,"values",()=>w.innerType._zod.values),K._zod.parse=(W,S)=>{if(S.direction==="backward")return w.innerType._zod.run(W,S);if(W.value===void 0)W.value=w.defaultValue;return w.innerType._zod.run(W,S)}}),f5=R("$ZodNonOptional",(K,w)=>{I2.init(K,w),w2(K._zod,"values",()=>{let W=w.innerType._zod.values;return W?new Set([...W].filter((S)=>S!==void 0)):void 0}),K._zod.parse=(W,S)=>{let M=w.innerType._zod.run(W,S);if(M instanceof Promise)return M.then((b)=>W5(b,K));return W5(M,K)}});function W5(K,w){if(!K.issues.length&&K.value===void 0)K.issues.push({code:"invalid_type",expected:"nonoptional",input:K.value,inst:w});return K}var T5=R("$ZodCatch",(K,w)=>{I2.init(K,w),w2(K._zod,"optin",()=>w.innerType._zod.optin),w2(K._zod,"optout",()=>w.innerType._zod.optout),w2(K._zod,"values",()=>w.innerType._zod.values),K._zod.parse=(W,S)=>{if(S.direction==="backward")return w.innerType._zod.run(W,S);let M=w.innerType._zod.run(W,S);if(M instanceof Promise)return M.then((b)=>{if(W.value=b.value,b.issues.length)W.value=w.catchValue({...W,error:{issues:b.issues.map((P)=>m2(P,S,n2()))},input:W.value}),W.issues=[];return W});if(W.value=M.value,M.issues.length)W.value=w.catchValue({...W,error:{issues:M.issues.map((b)=>m2(b,S,n2()))},input:W.value}),W.issues=[];return W}});var l5=R("$ZodPipe",(K,w)=>{I2.init(K,w),w2(K._zod,"values",()=>w.in._zod.values),w2(K._zod,"optin",()=>w.in._zod.optin),w2(K._zod,"optout",()=>w.out._zod.optout),w2(K._zod,"propValues",()=>w.in._zod.propValues),K._zod.parse=(W,S)=>{if(S.direction==="backward"){let b=w.out._zod.run(W,S);if(b instanceof Promise)return b.then((P)=>F6(P,w.in,S));return F6(b,w.in,S)}let M=w.in._zod.run(W,S);if(M instanceof Promise)return M.then((b)=>F6(b,w.out,S));return F6(M,w.out,S)}});function F6(K,w,W){if(K.issues.length)return K.aborted=!0,K;return w._zod.run({value:K.value,issues:K.issues},W)}var p5=R("$ZodReadonly",(K,w)=>{I2.init(K,w),w2(K._zod,"propValues",()=>w.innerType._zod.propValues),w2(K._zod,"values",()=>w.innerType._zod.values),w2(K._zod,"optin",()=>w.innerType?._zod?.optin),w2(K._zod,"optout",()=>w.innerType?._zod?.optout),K._zod.parse=(W,S)=>{if(S.direction==="backward")return w.innerType._zod.run(W,S);let M=w.innerType._zod.run(W,S);if(M instanceof Promise)return M.then(S5);return S5(M)}});function S5(K){return K.value=Object.freeze(K.value),K}var i5=R("$ZodCustom",(K,w)=>{E2.init(K,w),I2.init(K,w),K._zod.parse=(W,S)=>{return W},K._zod.check=(W)=>{let S=W.value,M=w.fn(S);if(M instanceof Promise)return M.then((b)=>M5(b,W,S,K));M5(M,W,S,K);return}});function M5(K,w,W,S){if(!K){let M={code:"custom",input:W,inst:S,path:[...S._zod.def.path??[]],continue:!S._zod.def.abort};if(S._zod.def.params)M.params=S._zod.def.params;w.issues.push(g4(M))}}var e5,DM=Symbol("ZodOutput"),GM=Symbol("ZodInput");class d5{constructor(){this._map=new WeakMap,this._idmap=new Map}add(K,...w){let W=w[0];if(this._map.set(K,W),W&&typeof W==="object"&&"id"in W){if(this._idmap.has(W.id))throw Error(`ID ${W.id} already exists in the registry`);this._idmap.set(W.id,K)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(K){let w=this._map.get(K);if(w&&typeof w==="object"&&"id"in w)this._idmap.delete(w.id);return this._map.delete(K),this}get(K){let w=K._zod.parent;if(w){let W={...this.get(w)??{}};delete W.id;let S={...W,...this._map.get(K)};return Object.keys(S).length?S:void 0}return this._map.get(K)}has(K){return this._map.has(K)}}function Gw(){return new d5}(e5=globalThis).__zod_globalRegistry??(e5.__zod_globalRegistry=Gw());var V4=globalThis.__zod_globalRegistry;function n5(K,w){return new K({type:"string",...T(w)})}function E8(K,w){return new K({type:"string",format:"email",check:"string_format",abort:!1,...T(w)})}function v8(K,w){return new K({type:"string",format:"guid",check:"string_format",abort:!1,...T(w)})}function t5(K,w){return new K({type:"string",format:"uuid",check:"string_format",abort:!1,...T(w)})}function a5(K,w){return new K({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(w)})}function s5(K,w){return new K({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(w)})}function K0(K,w){return new K({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(w)})}function w0(K,w){return new K({type:"string",format:"url",check:"string_format",abort:!1,...T(w)})}function W0(K,w){return new K({type:"string",format:"emoji",check:"string_format",abort:!1,...T(w)})}function S0(K,w){return new K({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(w)})}function M0(K,w){return new K({type:"string",format:"cuid",check:"string_format",abort:!1,...T(w)})}function b0(K,w){return new K({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(w)})}function P0(K,w){return new K({type:"string",format:"ulid",check:"string_format",abort:!1,...T(w)})}function J0(K,w){return new K({type:"string",format:"xid",check:"string_format",abort:!1,...T(w)})}function O0(K,w){return new K({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(w)})}function N0(K,w){return new K({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(w)})}function I0(K,w){return new K({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(w)})}function D0(K,w){return new K({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(w)})}function G0(K,w){return new K({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(w)})}function B0(K,w){return new K({type:"string",format:"base64",check:"string_format",abort:!1,...T(w)})}function X0(K,w){return new K({type:"string",format:"base64url",check:"string_format",abort:!1,...T(w)})}function Q0(K,w){return new K({type:"string",format:"e164",check:"string_format",abort:!1,...T(w)})}function $0(K,w){return new K({type:"string",format:"jwt",check:"string_format",abort:!1,...T(w)})}function z0(K,w){return new K({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(w)})}function U0(K,w){return new K({type:"string",format:"date",check:"string_format",...T(w)})}function Y0(K,w){return new K({type:"string",format:"time",check:"string_format",precision:null,...T(w)})}function H0(K,w){return new K({type:"string",format:"duration",check:"string_format",...T(w)})}function V0(K){return new K({type:"unknown"})}function L0(K,w){return new K({type:"never",...T(w)})}function R6(K,w){return new y3({check:"max_length",...T(w),maximum:K})}function Z4(K,w){return new r3({check:"min_length",...T(w),minimum:K})}function j6(K,w){return new _3({check:"length_equals",...T(w),length:K})}function R8(K,w){return new m3({check:"string_format",format:"regex",...T(w),pattern:K})}function j8(K){return new f3({check:"string_format",format:"lowercase",...T(K)})}function k8(K){return new T3({check:"string_format",format:"uppercase",...T(K)})}function g8(K,w){return new l3({check:"string_format",format:"includes",...T(w),includes:K})}function Z8(K,w){return new p3({check:"string_format",format:"starts_with",...T(w),prefix:K})}function A8(K,w){return new i3({check:"string_format",format:"ends_with",...T(w),suffix:K})}function N4(K){return new e3({check:"overwrite",tx:K})}function c8(K){return N4((w)=>w.normalize(K))}function C8(){return N4((K)=>K.trim())}function x8(){return N4((K)=>K.toLowerCase())}function u8(){return N4((K)=>K.toUpperCase())}function o8(){return N4((K)=>z8(K))}function q0(K,w,W){return new K({type:"array",element:w,...T(W)})}function h0(K,w,W){return new K({type:"custom",check:"custom",fn:w,...T(W)})}function F0(K){let w=Bw((W)=>{return W.addIssue=(S)=>{if(typeof S==="string")W.issues.push(g4(S,W.value,w._zod.def));else{let M=S;if(M.fatal)M.continue=!1;M.code??(M.code="custom"),M.input??(M.input=W.value),M.inst??(M.inst=w),M.continue??(M.continue=!w._zod.def.abort),W.issues.push(g4(M))}},K(W.value,W)});return w}function Bw(K,w){let W=new E2({check:"custom",...T(w)});return W._zod.check=K,W}function y8(K){let w=K?.target??"draft-2020-12";if(w==="draft-4")w="draft-04";if(w==="draft-7")w="draft-07";return{processors:K.processors??{},metadataRegistry:K?.metadata??V4,target:w,unrepresentable:K?.unrepresentable??"throw",override:K?.override??(()=>{}),io:K?.io??"output",counter:0,seen:new Map,cycles:K?.cycles??"ref",reused:K?.reused??"inline",external:K?.external??void 0}}function G2(K,w,W={path:[],schemaPath:[]}){var S;let M=K._zod.def,b=w.seen.get(K);if(b){if(b.count++,W.schemaPath.includes(K))b.cycle=W.path;return b.schema}let P={schema:{},count:1,cycle:void 0,path:W.path};w.seen.set(K,P);let J=K._zod.toJSONSchema?.();if(J)P.schema=J;else{let G={...W,schemaPath:[...W.schemaPath,K],path:W.path},H=K._zod.parent;if(H)P.ref=H,G2(H,w,G),w.seen.get(H).isParent=!0;else if(K._zod.processJSONSchema)K._zod.processJSONSchema(w,P.schema,G);else{let Q=P.schema,F=w.processors[M.type];if(!F)throw Error(`[toJSONSchema]: Non-representable type encountered: ${M.type}`);F(K,w,Q,G)}}let O=w.metadataRegistry.get(K);if(O)Object.assign(P.schema,O);if(w.io==="input"&&L2(K))delete P.schema.examples,delete P.schema.default;if(w.io==="input"&&P.schema._prefault)(S=P.schema).default??(S.default=P.schema._prefault);return delete P.schema._prefault,w.seen.get(K).schema}function r8(K,w){let W=K.seen.get(w);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let S=(b)=>{let P=K.target==="draft-2020-12"?"$defs":"definitions";if(K.external){let G=K.external.registry.get(b[0])?.id,H=K.external.uri??((F)=>F);if(G)return{ref:H(G)};let Q=b[1].defId??b[1].schema.id??`schema${K.counter++}`;return b[1].defId=Q,{defId:Q,ref:`${H("__shared")}#/${P}/${Q}`}}if(b[1]===W)return{ref:"#"};let O=`${"#"}/${P}/`,N=b[1].schema.id??`__schema${K.counter++}`;return{defId:N,ref:O+N}},M=(b)=>{if(b[1].schema.$ref)return;let P=b[1],{ref:J,defId:O}=S(b);if(P.def={...P.schema},O)P.defId=O;let N=P.schema;for(let G in N)delete N[G];N.$ref=J};if(K.cycles==="throw")for(let b of K.seen.entries()){let P=b[1];if(P.cycle)throw Error(`Cycle detected: #/${P.cycle?.join("/")}/<root>
38
38
 
39
- //# debugId=6BD6855EB86E29BB64756E2164756E21
39
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let b of K.seen.entries()){let P=b[1];if(w===b[0]){M(b);continue}if(K.external){let O=K.external.registry.get(b[0])?.id;if(w!==b[0]&&O){M(b);continue}}if(K.metadataRegistry.get(b[0])?.id){M(b);continue}if(P.cycle){M(b);continue}if(P.count>1){if(K.reused==="ref"){M(b);continue}}}}function _8(K,w){let W=K.seen.get(w);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let S=(P)=>{let J=K.seen.get(P),O=J.def??J.schema,N={...O};if(J.ref===null)return;let G=J.ref;if(J.ref=null,G){S(G);let H=K.seen.get(G).schema;if(H.$ref&&(K.target==="draft-07"||K.target==="draft-04"||K.target==="openapi-3.0"))O.allOf=O.allOf??[],O.allOf.push(H);else Object.assign(O,H),Object.assign(O,N)}if(!J.isParent)K.override({zodSchema:P,jsonSchema:O,path:J.path??[]})};for(let P of[...K.seen.entries()].reverse())S(P[0]);let M={};if(K.target==="draft-2020-12")M.$schema="https://json-schema.org/draft/2020-12/schema";else if(K.target==="draft-07")M.$schema="http://json-schema.org/draft-07/schema#";else if(K.target==="draft-04")M.$schema="http://json-schema.org/draft-04/schema#";else if(K.target==="openapi-3.0");if(K.external?.uri){let P=K.external.registry.get(w)?.id;if(!P)throw Error("Schema is missing an `id` property");M.$id=K.external.uri(P)}Object.assign(M,W.def??W.schema);let b=K.external?.defs??{};for(let P of K.seen.entries()){let J=P[1];if(J.def&&J.defId)b[J.defId]=J.def}if(K.external);else if(Object.keys(b).length>0)if(K.target==="draft-2020-12")M.$defs=b;else M.definitions=b;try{let P=JSON.parse(JSON.stringify(M));return Object.defineProperty(P,"~standard",{value:{...w["~standard"],jsonSchema:{input:i4(w,"input"),output:i4(w,"output")}},enumerable:!1,writable:!1}),P}catch(P){throw Error("Error converting schema to JSON.")}}function L2(K,w){let W=w??{seen:new Set};if(W.seen.has(K))return!1;W.seen.add(K);let S=K._zod.def;if(S.type==="transform")return!0;if(S.type==="array")return L2(S.element,W);if(S.type==="set")return L2(S.valueType,W);if(S.type==="lazy")return L2(S.getter(),W);if(S.type==="promise"||S.type==="optional"||S.type==="nonoptional"||S.type==="nullable"||S.type==="readonly"||S.type==="default"||S.type==="prefault")return L2(S.innerType,W);if(S.type==="intersection")return L2(S.left,W)||L2(S.right,W);if(S.type==="record"||S.type==="map")return L2(S.keyType,W)||L2(S.valueType,W);if(S.type==="pipe")return L2(S.in,W)||L2(S.out,W);if(S.type==="object"){for(let M in S.shape)if(L2(S.shape[M],W))return!0;return!1}if(S.type==="union"){for(let M of S.options)if(L2(M,W))return!0;return!1}if(S.type==="tuple"){for(let M of S.items)if(L2(M,W))return!0;if(S.rest&&L2(S.rest,W))return!0;return!1}return!1}var E0=(K,w={})=>(W)=>{let S=y8({...W,processors:w});return G2(K,S),r8(S,K),_8(S,K)},i4=(K,w)=>(W)=>{let{libraryOptions:S,target:M}=W??{},b=y8({...S??{},target:M,io:w,processors:{}});return G2(K,b),r8(b,K),_8(b,K)};var Xw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},v0=(K,w,W,S)=>{let M=W;M.type="string";let{minimum:b,maximum:P,format:J,patterns:O,contentEncoding:N}=K._zod.bag;if(typeof b==="number")M.minLength=b;if(typeof P==="number")M.maxLength=P;if(J){if(M.format=Xw[J]??J,M.format==="")delete M.format}if(N)M.contentEncoding=N;if(O&&O.size>0){let G=[...O];if(G.length===1)M.pattern=G[0].source;else if(G.length>1)M.allOf=[...G.map((H)=>({...w.target==="draft-07"||w.target==="draft-04"||w.target==="openapi-3.0"?{type:"string"}:{},pattern:H.source}))]}};var R0=(K,w,W,S)=>{W.not={}};var j0=(K,w,W,S)=>{};var k0=(K,w,W,S)=>{let M=K._zod.def,b=o4(M.entries);if(b.every((P)=>typeof P==="number"))W.type="number";if(b.every((P)=>typeof P==="string"))W.type="string";W.enum=b};var g0=(K,w,W,S)=>{if(w.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")};var Z0=(K,w,W,S)=>{if(w.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")};var A0=(K,w,W,S)=>{let M=W,b=K._zod.def,{minimum:P,maximum:J}=K._zod.bag;if(typeof P==="number")M.minItems=P;if(typeof J==="number")M.maxItems=J;M.type="array",M.items=G2(b.element,w,{...S,path:[...S.path,"items"]})},c0=(K,w,W,S)=>{let M=W,b=K._zod.def;M.type="object",M.properties={};let P=b.shape;for(let N in P)M.properties[N]=G2(P[N],w,{...S,path:[...S.path,"properties",N]});let J=new Set(Object.keys(P)),O=new Set([...J].filter((N)=>{let G=b.shape[N]._zod;if(w.io==="input")return G.optin===void 0;else return G.optout===void 0}));if(O.size>0)M.required=Array.from(O);if(b.catchall?._zod.def.type==="never")M.additionalProperties=!1;else if(!b.catchall){if(w.io==="output")M.additionalProperties=!1}else if(b.catchall)M.additionalProperties=G2(b.catchall,w,{...S,path:[...S.path,"additionalProperties"]})},C0=(K,w,W,S)=>{let M=K._zod.def,b=M.inclusive===!1,P=M.options.map((J,O)=>G2(J,w,{...S,path:[...S.path,b?"oneOf":"anyOf",O]}));if(b)W.oneOf=P;else W.anyOf=P},x0=(K,w,W,S)=>{let M=K._zod.def,b=G2(M.left,w,{...S,path:[...S.path,"allOf",0]}),P=G2(M.right,w,{...S,path:[...S.path,"allOf",1]}),J=(N)=>("allOf"in N)&&Object.keys(N).length===1,O=[...J(b)?b.allOf:[b],...J(P)?P.allOf:[P]];W.allOf=O};var u0=(K,w,W,S)=>{let M=K._zod.def,b=G2(M.innerType,w,S),P=w.seen.get(K);if(w.target==="openapi-3.0")P.ref=M.innerType,W.nullable=!0;else W.anyOf=[b,{type:"null"}]},o0=(K,w,W,S)=>{let M=K._zod.def;G2(M.innerType,w,S);let b=w.seen.get(K);b.ref=M.innerType},y0=(K,w,W,S)=>{let M=K._zod.def;G2(M.innerType,w,S);let b=w.seen.get(K);b.ref=M.innerType,W.default=JSON.parse(JSON.stringify(M.defaultValue))},r0=(K,w,W,S)=>{let M=K._zod.def;G2(M.innerType,w,S);let b=w.seen.get(K);if(b.ref=M.innerType,w.io==="input")W._prefault=JSON.parse(JSON.stringify(M.defaultValue))},_0=(K,w,W,S)=>{let M=K._zod.def;G2(M.innerType,w,S);let b=w.seen.get(K);b.ref=M.innerType;let P;try{P=M.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}W.default=P},m0=(K,w,W,S)=>{let M=K._zod.def,b=w.io==="input"?M.in._zod.def.type==="transform"?M.out:M.in:M.out;G2(b,w,S);let P=w.seen.get(K);P.ref=b},f0=(K,w,W,S)=>{let M=K._zod.def;G2(M.innerType,w,S);let b=w.seen.get(K);b.ref=M.innerType,W.readOnly=!0};var T0=(K,w,W,S)=>{let M=K._zod.def;G2(M.innerType,w,S);let b=w.seen.get(K);b.ref=M.innerType};var Ew=R("ZodISODateTime",(K,w)=>{$5.init(K,w),P2.init(K,w)});function l0(K){return z0(Ew,K)}var vw=R("ZodISODate",(K,w)=>{z5.init(K,w),P2.init(K,w)});function p0(K){return U0(vw,K)}var Rw=R("ZodISOTime",(K,w)=>{U5.init(K,w),P2.init(K,w)});function i0(K){return Y0(Rw,K)}var jw=R("ZodISODuration",(K,w)=>{Y5.init(K,w),P2.init(K,w)});function e0(K){return H0(jw,K)}var d0=(K,w)=>{V6.init(K,w),K.name="ZodError",Object.defineProperties(K,{format:{value:(W)=>M3(K,W)},flatten:{value:(W)=>S3(K,W)},addIssue:{value:(W)=>{K.issues.push(W),K.message=JSON.stringify(K.issues,k4,2)}},addIssues:{value:(W)=>{K.issues.push(...W),K.message=JSON.stringify(K.issues,k4,2)}},isEmpty:{get(){return K.issues.length===0}}})},pM=R("ZodError",d0),v2=R("ZodError",d0,{Parent:Error});var n0=L6(v2),t0=q6(v2),a0=T4(v2),s0=l4(v2),K1=J3(v2),w1=O3(v2),W1=N3(v2),S1=I3(v2),M1=D3(v2),b1=G3(v2),P1=B3(v2),J1=X3(v2);var B2=R("ZodType",(K,w)=>{return I2.init(K,w),Object.assign(K["~standard"],{jsonSchema:{input:i4(K,"input"),output:i4(K,"output")}}),K.toJSONSchema=E0(K,{}),K.def=w,K.type=w.type,Object.defineProperty(K,"_def",{value:w}),K.check=(...W)=>{return K.clone(K2.mergeDefs(w,{checks:[...w.checks??[],...W.map((S)=>typeof S==="function"?{_zod:{check:S,def:{check:"custom"},onattach:[]}}:S)]}))},K.clone=(W,S)=>C2(K,W,S),K.brand=()=>K,K.register=(W,S)=>{return W.add(K,S),K},K.parse=(W,S)=>n0(K,W,S,{callee:K.parse}),K.safeParse=(W,S)=>a0(K,W,S),K.parseAsync=async(W,S)=>t0(K,W,S,{callee:K.parseAsync}),K.safeParseAsync=async(W,S)=>s0(K,W,S),K.spa=K.safeParseAsync,K.encode=(W,S)=>K1(K,W,S),K.decode=(W,S)=>w1(K,W,S),K.encodeAsync=async(W,S)=>W1(K,W,S),K.decodeAsync=async(W,S)=>S1(K,W,S),K.safeEncode=(W,S)=>M1(K,W,S),K.safeDecode=(W,S)=>b1(K,W,S),K.safeEncodeAsync=async(W,S)=>P1(K,W,S),K.safeDecodeAsync=async(W,S)=>J1(K,W,S),K.refine=(W,S)=>K.check(VW(W,S)),K.superRefine=(W)=>K.check(LW(W)),K.overwrite=(W)=>K.check(N4(W)),K.optional=()=>I1(K),K.nullable=()=>D1(K),K.nullish=()=>I1(D1(K)),K.nonoptional=(W)=>XW(K,W),K.array=()=>KW(K),K.or=(W)=>SW([K,W]),K.and=(W)=>bW(K,W),K.transform=(W)=>G1(K,OW(W)),K.default=(W)=>DW(K,W),K.prefault=(W)=>BW(K,W),K.catch=(W)=>$W(K,W),K.pipe=(W)=>G1(K,W),K.readonly=()=>YW(K),K.describe=(W)=>{let S=K.clone();return V4.add(S,{description:W}),S},Object.defineProperty(K,"description",{get(){return V4.get(K)?.description},configurable:!0}),K.meta=(...W)=>{if(W.length===0)return V4.get(K);let S=K.clone();return V4.add(S,W[0]),S},K.isOptional=()=>K.safeParse(void 0).success,K.isNullable=()=>K.safeParse(null).success,K}),B1=R("_ZodString",(K,w)=>{v6.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(S,M,b)=>v0(K,S,M,b);let W=K._zod.bag;K.format=W.format??null,K.minLength=W.minimum??null,K.maxLength=W.maximum??null,K.regex=(...S)=>K.check(R8(...S)),K.includes=(...S)=>K.check(g8(...S)),K.startsWith=(...S)=>K.check(Z8(...S)),K.endsWith=(...S)=>K.check(A8(...S)),K.min=(...S)=>K.check(Z4(...S)),K.max=(...S)=>K.check(R6(...S)),K.length=(...S)=>K.check(j6(...S)),K.nonempty=(...S)=>K.check(Z4(1,...S)),K.lowercase=(S)=>K.check(j8(S)),K.uppercase=(S)=>K.check(k8(S)),K.trim=()=>K.check(C8()),K.normalize=(...S)=>K.check(c8(...S)),K.toLowerCase=()=>K.check(x8()),K.toUpperCase=()=>K.check(u8()),K.slugify=()=>K.check(o8())}),Aw=R("ZodString",(K,w)=>{v6.init(K,w),B1.init(K,w),K.email=(W)=>K.check(E8(Q1,W)),K.url=(W)=>K.check(w0(cw,W)),K.jwt=(W)=>K.check($0(dw,W)),K.emoji=(W)=>K.check(W0(Cw,W)),K.guid=(W)=>K.check(v8(O1,W)),K.uuid=(W)=>K.check(t5(g6,W)),K.uuidv4=(W)=>K.check(a5(g6,W)),K.uuidv6=(W)=>K.check(s5(g6,W)),K.uuidv7=(W)=>K.check(K0(g6,W)),K.nanoid=(W)=>K.check(S0(xw,W)),K.guid=(W)=>K.check(v8(O1,W)),K.cuid=(W)=>K.check(M0(uw,W)),K.cuid2=(W)=>K.check(b0(ow,W)),K.ulid=(W)=>K.check(P0(yw,W)),K.base64=(W)=>K.check(B0(pw,W)),K.base64url=(W)=>K.check(X0(iw,W)),K.xid=(W)=>K.check(J0(rw,W)),K.ksuid=(W)=>K.check(O0(_w,W)),K.ipv4=(W)=>K.check(N0(mw,W)),K.ipv6=(W)=>K.check(I0(fw,W)),K.cidrv4=(W)=>K.check(D0(Tw,W)),K.cidrv6=(W)=>K.check(G0(lw,W)),K.e164=(W)=>K.check(Q0(ew,W)),K.datetime=(W)=>K.check(l0(W)),K.date=(W)=>K.check(p0(W)),K.time=(W)=>K.check(i0(W)),K.duration=(W)=>K.check(e0(W))});function X1(K){return n5(Aw,K)}var P2=R("ZodStringFormat",(K,w)=>{M2.init(K,w),B1.init(K,w)}),Q1=R("ZodEmail",(K,w)=>{J5.init(K,w),P2.init(K,w)});function $1(K){return E8(Q1,K)}var O1=R("ZodGUID",(K,w)=>{b5.init(K,w),P2.init(K,w)});var g6=R("ZodUUID",(K,w)=>{P5.init(K,w),P2.init(K,w)});var cw=R("ZodURL",(K,w)=>{O5.init(K,w),P2.init(K,w)});var Cw=R("ZodEmoji",(K,w)=>{N5.init(K,w),P2.init(K,w)});var xw=R("ZodNanoID",(K,w)=>{I5.init(K,w),P2.init(K,w)});var uw=R("ZodCUID",(K,w)=>{D5.init(K,w),P2.init(K,w)});var ow=R("ZodCUID2",(K,w)=>{G5.init(K,w),P2.init(K,w)});var yw=R("ZodULID",(K,w)=>{B5.init(K,w),P2.init(K,w)});var rw=R("ZodXID",(K,w)=>{X5.init(K,w),P2.init(K,w)});var _w=R("ZodKSUID",(K,w)=>{Q5.init(K,w),P2.init(K,w)});var mw=R("ZodIPv4",(K,w)=>{H5.init(K,w),P2.init(K,w)});var fw=R("ZodIPv6",(K,w)=>{V5.init(K,w),P2.init(K,w)});var Tw=R("ZodCIDRv4",(K,w)=>{L5.init(K,w),P2.init(K,w)});var lw=R("ZodCIDRv6",(K,w)=>{q5.init(K,w),P2.init(K,w)});var pw=R("ZodBase64",(K,w)=>{F5.init(K,w),P2.init(K,w)});var iw=R("ZodBase64URL",(K,w)=>{E5.init(K,w),P2.init(K,w)});var ew=R("ZodE164",(K,w)=>{v5.init(K,w),P2.init(K,w)});var dw=R("ZodJWT",(K,w)=>{R5.init(K,w),P2.init(K,w)});var nw=R("ZodUnknown",(K,w)=>{j5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>j0(K,W,S,M)});function N1(){return V0(nw)}var tw=R("ZodNever",(K,w)=>{k5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>R0(K,W,S,M)});function aw(K){return L0(tw,K)}var sw=R("ZodArray",(K,w)=>{g5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>A0(K,W,S,M),K.element=w.element,K.min=(W,S)=>K.check(Z4(W,S)),K.nonempty=(W)=>K.check(Z4(1,W)),K.max=(W,S)=>K.check(R6(W,S)),K.length=(W,S)=>K.check(j6(W,S)),K.unwrap=()=>K.element});function KW(K,w){return q0(sw,K,w)}var wW=R("ZodObject",(K,w)=>{c5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>c0(K,W,S,M),K2.defineLazy(K,"shape",()=>{return w.shape}),K.keyof=()=>PW(Object.keys(K._zod.def.shape)),K.catchall=(W)=>K.clone({...K._zod.def,catchall:W}),K.passthrough=()=>K.clone({...K._zod.def,catchall:N1()}),K.loose=()=>K.clone({...K._zod.def,catchall:N1()}),K.strict=()=>K.clone({...K._zod.def,catchall:aw()}),K.strip=()=>K.clone({...K._zod.def,catchall:void 0}),K.extend=(W)=>{return K2.extend(K,W)},K.safeExtend=(W)=>{return K2.safeExtend(K,W)},K.merge=(W)=>K2.merge(K,W),K.pick=(W)=>K2.pick(K,W),K.omit=(W)=>K2.omit(K,W),K.partial=(...W)=>K2.partial(U1,K,W[0]),K.required=(...W)=>K2.required(Y1,K,W[0])});function z1(K,w){let W={type:"object",shape:K??{},...K2.normalizeParams(w)};return new wW(W)}var WW=R("ZodUnion",(K,w)=>{C5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>C0(K,W,S,M),K.options=w.options});function SW(K,w){return new WW({type:"union",options:K,...K2.normalizeParams(w)})}var MW=R("ZodIntersection",(K,w)=>{x5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>x0(K,W,S,M)});function bW(K,w){return new MW({type:"intersection",left:K,right:w})}var m8=R("ZodEnum",(K,w)=>{u5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(S,M,b)=>k0(K,S,M,b),K.enum=w.entries,K.options=Object.values(w.entries);let W=new Set(Object.keys(w.entries));K.extract=(S,M)=>{let b={};for(let P of S)if(W.has(P))b[P]=w.entries[P];else throw Error(`Key ${P} not found in enum`);return new m8({...w,checks:[],...K2.normalizeParams(M),entries:b})},K.exclude=(S,M)=>{let b={...w.entries};for(let P of S)if(W.has(P))delete b[P];else throw Error(`Key ${P} not found in enum`);return new m8({...w,checks:[],...K2.normalizeParams(M),entries:b})}});function PW(K,w){let W=Array.isArray(K)?Object.fromEntries(K.map((S)=>[S,S])):K;return new m8({type:"enum",entries:W,...K2.normalizeParams(w)})}var JW=R("ZodTransform",(K,w)=>{o5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>Z0(K,W,S,M),K._zod.parse=(W,S)=>{if(S.direction==="backward")throw new x4(K.constructor.name);W.addIssue=(b)=>{if(typeof b==="string")W.issues.push(K2.issue(b,W.value,w));else{let P=b;if(P.fatal)P.continue=!1;P.code??(P.code="custom"),P.input??(P.input=W.value),P.inst??(P.inst=K),W.issues.push(K2.issue(P))}};let M=w.transform(W.value,W);if(M instanceof Promise)return M.then((b)=>{return W.value=b,W});return W.value=M,W}});function OW(K){return new JW({type:"transform",transform:K})}var U1=R("ZodOptional",(K,w)=>{y5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>T0(K,W,S,M),K.unwrap=()=>K._zod.def.innerType});function I1(K){return new U1({type:"optional",innerType:K})}var NW=R("ZodNullable",(K,w)=>{r5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>u0(K,W,S,M),K.unwrap=()=>K._zod.def.innerType});function D1(K){return new NW({type:"nullable",innerType:K})}var IW=R("ZodDefault",(K,w)=>{_5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>y0(K,W,S,M),K.unwrap=()=>K._zod.def.innerType,K.removeDefault=K.unwrap});function DW(K,w){return new IW({type:"default",innerType:K,get defaultValue(){return typeof w==="function"?w():K2.shallowClone(w)}})}var GW=R("ZodPrefault",(K,w)=>{m5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>r0(K,W,S,M),K.unwrap=()=>K._zod.def.innerType});function BW(K,w){return new GW({type:"prefault",innerType:K,get defaultValue(){return typeof w==="function"?w():K2.shallowClone(w)}})}var Y1=R("ZodNonOptional",(K,w)=>{f5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>o0(K,W,S,M),K.unwrap=()=>K._zod.def.innerType});function XW(K,w){return new Y1({type:"nonoptional",innerType:K,...K2.normalizeParams(w)})}var QW=R("ZodCatch",(K,w)=>{T5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>_0(K,W,S,M),K.unwrap=()=>K._zod.def.innerType,K.removeCatch=K.unwrap});function $W(K,w){return new QW({type:"catch",innerType:K,catchValue:typeof w==="function"?w:()=>w})}var zW=R("ZodPipe",(K,w)=>{l5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>m0(K,W,S,M),K.in=w.in,K.out=w.out});function G1(K,w){return new zW({type:"pipe",in:K,out:w})}var UW=R("ZodReadonly",(K,w)=>{p5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>f0(K,W,S,M),K.unwrap=()=>K._zod.def.innerType});function YW(K){return new UW({type:"readonly",innerType:K})}var HW=R("ZodCustom",(K,w)=>{i5.init(K,w),B2.init(K,w),K._zod.processJSONSchema=(W,S,M)=>g0(K,W,S,M)});function VW(K,w={}){return h0(HW,K,w)}function LW(K){return F0(K)}class Z6{params;#K=c4.ETokenAudiences.SYSTEM;#w=1;token;constructor(K){this.params=K}async signToken(){let{params:{credential:{tenantId:K,appId:w,modeId:W,secretKey:S},options:M}}=this;try{let b=new Uint8Array(Buffer.from(S,"base64")),P=await crypto.subtle.importKey("raw",b,{name:"HMAC",hash:"SHA-512"},!1,["sign","verify"]),J=await new z6({tenantId:K,appId:w,modeId:W,iss:K,aud:c4.ETokenAudiences.SYSTEM}).setProtectedHeader({alg:"HS512"}).sign(P);return this.token=J,J}catch(b){if(M?.logs)console.error("[BoolGuard] Sign token error:",b);throw b}}async ping(){let{token:K,params:{credential:{tenantId:w,appId:W,modeId:S},options:M}}=this;try{let b=K||await this.signToken(),P=new Headers;P.append("X-Tenant-ID",w),P.append("X-App-ID",W),P.append("X-Mode-ID",S),P.append("Authorization",`Bearer ${b}`);let J=await fetch(`${this.#K}/v${M?.version||this.#w}/tenant-app-modes/ping`,{method:"GET",headers:P});if(!J.ok)throw await J.json();return J.ok}catch(b){if(M?.logs)console.error("[BoolGuard] Ping error:",b);return!1}}async createPlainAccount({identity:K,password:w,metadata:W}){let{token:S,params:{credential:{tenantId:M,appId:b,modeId:P},options:J}}=this;try{let O=S||await this.signToken(),N=new Headers;N.append("X-Tenant-ID",M),N.append("X-App-ID",b),N.append("X-Mode-ID",P),N.append("Authorization",`Bearer ${O}`),N.append("Content-Type","application/json");let G=await fetch(`${this.#K}/v${J?.version||this.#w}/tenant-app-mode-accounts`,{method:"POST",headers:N,body:JSON.stringify({data:Object.freeze({type:"plain",identity:K,password:w,metadata:W})})});if(!G.ok)throw await G.json();let{data:H}=await G.json();return Object.freeze({account:H.account,credential:H.credential})}catch(O){if(J?.logs)console.error("[BoolGuard] Create plain account error:",O);throw O}}async createEmailAccount({identity:K,password:w,metadata:W}){let{token:S,params:{credential:{tenantId:M,appId:b,modeId:P},options:J}}=this;try{let O=S||await this.signToken(),N=new Headers;N.append("X-Tenant-ID",M),N.append("X-App-ID",b),N.append("X-Mode-ID",P),N.append("Authorization",`Bearer ${O}`),N.append("Content-Type","application/json");let G=await fetch(`${this.#K}/v${J?.version||this.#w}/tenant-app-mode-accounts`,{method:"POST",headers:N,body:JSON.stringify({data:Object.freeze({type:"email",identity:K,password:w,metadata:W})})});if(!G.ok)throw await G.json();let{data:H}=await G.json();return Object.freeze({account:H.account,credential:H.credential})}catch(O){if(J?.logs)console.error("[BoolGuard] Create email account error:",O);throw O}}async authenticate({identity:K,password:w}){let{token:W,params:{credential:{tenantId:S,appId:M,modeId:b},options:P}}=this;try{let J=W||await this.signToken(),O=await $1().safeParseAsync(K),N=new Headers;N.append("X-Tenant-ID",S),N.append("X-App-ID",M),N.append("X-Mode-ID",b),N.append("Authorization",`Bearer ${J}`),N.append("Content-Type","application/json");let G=await fetch(`${this.#K}/v${P?.version||this.#w}/tenant-app-mode-accounts/authenticate`,{method:"POST",headers:N,body:JSON.stringify({data:Object.freeze({type:!O.success?"plain":"email",identity:K,password:w})})});if(!G.ok)throw await G.json();let{data:H}=await G.json();return Object.freeze({account:H.account,credential:H.credential,token:H.token})}catch(J){if(P?.logs)console.error("[BoolGuard] Authenticate error:",J);throw J}}async verifyToken({token:K}){let{params:{credential:{tenantId:w,appId:W,modeId:S},options:M}}=this;try{let b=this.token||await this.signToken(),P=new Headers;P.append("X-Tenant-ID",w),P.append("X-App-ID",W),P.append("X-Mode-ID",S),P.append("Authorization",`Bearer ${b}`),P.append("Content-Type","application/json");let J=await fetch(`${this.#K}/v${M?.version||this.#w}/tenant-app-mode-accounts/verify`,{method:"POST",headers:P,body:JSON.stringify({data:Object.freeze({token:K})})});if(!J.ok)throw await J.json();let{data:O}=await J.json();return Object.freeze({account:O.account,credential:O.credential})}catch(b){if(M?.logs)console.error("[BoolGuard] Verify token error:",b);throw b}}}var LP=async({credential:K,definition:w,options:W})=>{let S=new Z6({credential:K,definition:w,options:W});if(await S.signToken(),!await S.ping())throw Error("Ping to Bool Guard service failed!");return[h2.guardClient,S]};var qW=z1({authorization:X1().startsWith("Bearer ").min(24).transform((K)=>{let[w,W]=K.split(" ");return Object.freeze({schema:w,token:W})})});class f8{clientInstance;constructor(K){this.clientInstance=K}async start(K,w){let W=await qW.safeParseAsync(w.toJSON());if(!W.success)return K.set(h2.authState,void 0);else{let{authorization:{token:S}}=W.data;try{let{account:M,credential:b}=await this.clientInstance.verifyToken({token:S}),P=Object.freeze({account:M,credential:b});return K.set(h2.authState,P)}catch(M){return console.error(M),K.set(h2.authState,void 0)}}}}h4([D4(0,I6()),D4(1,$K())],f8.prototype,"start",null),f8=h4([HK(),D4(0,UK(h2.guardClient))],f8);export{LP as loader,f8 as Middleware,h2 as Keys,S8 as Interceptor,c4 as Enums,Z6 as Client,W8 as AuthState};
40
+
41
+ //# debugId=61F28FB00689BFB364756E2164756E21