@bool-ts/guard-sdk 1.0.0-beta.2 → 1.0.2-beta.2

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 e5=Object.defineProperty;var m4=(c,K)=>{for(var w in K)e5(c,w,{get:K[w],enumerable:!0,configurable:!0,set:(P)=>K[w]=()=>P})};var Q2=function(c,K,w,P){var h=arguments.length,M=h<3?K:P===null?P=Object.getOwnPropertyDescriptor(K,w):P,S;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")M=Reflect.decorate(c,K,w,P);else for(var O=c.length-1;O>=0;O--)if(S=c[O])M=(h<3?S(M):h>3?S(K,w,M):S(K,w))||M;return h>3&&M&&Object.defineProperty(K,w,M),M},W2=(c,K)=>(w,P)=>K(w,P,c);var Z2={};m4(Z2,{ETokenAudiences:()=>yK});var yK;((K)=>K.SYSTEM="https://api-guard.booljs.com")(yK||={});var Gc={};m4(Gc,{service:()=>T5,guardMetadata:()=>l5,guardClient:()=>n5,authState:()=>p5});var p5=Symbol("__boolGuard::authState"),l5=Symbol("__boolGuard::guardMetadata"),T5=Symbol("__boolGuard::authService"),n5=Symbol("__boolGuard::guardClient");var i5=()=>(c,K)=>{Reflect.defineMetadata(Gc.guardMetadata,void 0,c,K)};var t5=Object.create,{getPrototypeOf:d5,defineProperty:u4,getOwnPropertyNames:s5}=Object,a5=Object.prototype.hasOwnProperty,S4=(c,K,w)=>{w=c!=null?t5(d5(c)):{};let P=K||!c||!c.__esModule?u4(w,"default",{value:c,enumerable:!0}):w;for(let h of s5(c))if(!a5.call(P,h))u4(P,h,{get:()=>c[h],enumerable:!0});return P},_=(c,K)=>()=>(K||c((K={exports:{}}).exports,K),K.exports),c3=(c,K)=>{for(var w in K)u4(c,w,{get:K[w],enumerable:!0,configurable:!0,set:(P)=>K[w]=()=>P})},K3=import.meta.require,e4=_(()=>{/*! *****************************************************************************
2
+ var p5=Object.defineProperty;var m4=(c,K)=>{for(var w in K)p5(c,w,{get:K[w],enumerable:!0,configurable:!0,set:(P)=>K[w]=()=>P})};var Q2=function(c,K,w,P){var h=arguments.length,M=h<3?K:P===null?P=Object.getOwnPropertyDescriptor(K,w):P,S;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")M=Reflect.decorate(c,K,w,P);else for(var O=c.length-1;O>=0;O--)if(S=c[O])M=(h<3?S(M):h>3?S(K,w,M):S(K,w))||M;return h>3&&M&&Object.defineProperty(K,w,M),M},W2=(c,K)=>(w,P)=>K(w,P,c);var Z2={};m4(Z2,{ETokenAudiences:()=>_K});var _K;((K)=>K.SYSTEM="https://api-guard.booljs.com")(_K||={});var Gc={};m4(Gc,{service:()=>n5,guardMetadata:()=>T5,guardClient:()=>i5,authState:()=>l5});var l5=Symbol("__boolGuard::authState"),T5=Symbol("__boolGuard::guardMetadata"),n5=Symbol("__boolGuard::authService"),i5=Symbol("__boolGuard::guardClient");var t5=()=>(c,K)=>{Reflect.defineMetadata(Gc.guardMetadata,void 0,c,K)};var d5=Object.create,{getPrototypeOf:s5,defineProperty:u4,getOwnPropertyNames:a5}=Object,c3=Object.prototype.hasOwnProperty,S4=(c,K,w)=>{w=c!=null?d5(s5(c)):{};let P=K||!c||!c.__esModule?u4(w,"default",{value:c,enumerable:!0}):w;for(let h of a5(c))if(!c3.call(P,h))u4(P,h,{get:()=>c[h],enumerable:!0});return P},_=(c,K)=>()=>(K||c((K={exports:{}}).exports,K),K.exports),K3=(c,K)=>{for(var w in K)u4(c,w,{get:K[w],enumerable:!0,configurable:!0,set:(P)=>K[w]=()=>P})},w3=import.meta.require,e4=_(()=>{/*! *****************************************************************************
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,12 +12,12 @@ 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:G(),h=M(K);if(typeof P.Reflect<"u")h=M(P.Reflect,h);if(w(h,P),typeof P.Reflect>"u")P.Reflect=K;function M(D,B){return function(L,$){if(Object.defineProperty(D,L,{configurable:!0,writable:!0,value:$}),B)B(L,$)}}function S(){try{return Function("return this;")()}catch(D){}}function O(){try{return(0,eval)("(function() { return this; })()")}catch(D){}}function G(){return S()||O()}})(function(w,P){var h=Object.prototype.hasOwnProperty,M=typeof Symbol==="function",S=M&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",O=M&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",G=typeof Object.create==="function",D={__proto__:[]}instanceof Array,B=!G&&!D,L={create:G?function(){return _c(Object.create(null))}:D?function(){return _c({__proto__:null})}:function(){return _c({})},has:B?function(j,Y){return h.call(j,Y)}:function(j,Y){return Y in j},get:B?function(j,Y){return h.call(j,Y)?j[Y]:void 0}:function(j,Y){return j[Y]}},$=Object.getPrototypeOf(Function),q=typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:g4(),J=typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:T2(),z=typeof WeakMap==="function"?WeakMap:k4(),H=M?Symbol.for("@reflect-metadata:registry"):void 0,b=dc(),Q=sc(b);function X(j,Y,v,Z){if(!y(v)){if(!s(j))throw TypeError();if(!d(Y))throw TypeError();if(!d(Z)&&!y(Z)&&!Uc(Z))throw TypeError();if(Uc(Z))Z=void 0;return v=l(v),cc(j,Y,v,Z)}else{if(!s(j))throw TypeError();if(!Mc(Y))throw TypeError();return C(j,Y)}}w("decorate",X);function W(j,Y){function v(Z,m){if(!d(Z))throw TypeError();if(!y(m)&&!Nc(m))throw TypeError();vc(j,Y,Z,m)}return v}w("metadata",W);function V(j,Y,v,Z){if(!d(v))throw TypeError();if(!y(Z))Z=l(Z);return vc(j,Y,v,Z)}w("defineMetadata",V);function o(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);return Oc(j,Y,v)}w("hasMetadata",o);function U(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);return wc(j,Y,v)}w("hasOwnMetadata",U);function r(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);return Dc(j,Y,v)}w("getMetadata",r);function k(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);return Hc(j,Y,v)}w("getOwnMetadata",k);function A(j,Y){if(!d(j))throw TypeError();if(!y(Y))Y=l(Y);return p(j,Y)}w("getMetadataKeys",A);function u(j,Y){if(!d(j))throw TypeError();if(!y(Y))Y=l(Y);return jc(j,Y)}w("getOwnMetadataKeys",u);function n(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);if(!d(Y))throw TypeError();if(!y(v))v=l(v);var Z=J2(Y,v,!1);if(y(Z))return!1;return Z.OrdinaryDeleteMetadata(j,Y,v)}w("deleteMetadata",n);function C(j,Y){for(var v=j.length-1;v>=0;--v){var Z=j[v],m=Z(Y);if(!y(m)&&!Uc(m)){if(!Mc(m))throw TypeError();Y=m}}return Y}function cc(j,Y,v,Z){for(var m=j.length-1;m>=0;--m){var Pc=j[m],I=Pc(Y,v,Z);if(!y(I)&&!Uc(I)){if(!d(I))throw TypeError();Z=I}}return Z}function Oc(j,Y,v){var Z=wc(j,Y,v);if(Z)return!0;var m=zc(Y);if(!Uc(m))return Oc(j,m,v);return!1}function wc(j,Y,v){var Z=J2(Y,v,!1);if(y(Z))return!1;return gc(Z.OrdinaryHasOwnMetadata(j,Y,v))}function Dc(j,Y,v){var Z=wc(j,Y,v);if(Z)return Hc(j,Y,v);var m=zc(Y);if(!Uc(m))return Dc(j,m,v);return}function Hc(j,Y,v){var Z=J2(Y,v,!1);if(y(Z))return;return Z.OrdinaryGetOwnMetadata(j,Y,v)}function vc(j,Y,v,Z){var m=J2(v,Z,!0);m.OrdinaryDefineOwnMetadata(j,Y,v,Z)}function p(j,Y){var v=jc(j,Y),Z=zc(j);if(Z===null)return v;var m=p(Z,Y);if(m.length<=0)return v;if(v.length<=0)return m;var Pc=new J,I=[];for(var N=0,F=v;N<F.length;N++){var R=F[N],x=Pc.has(R);if(!x)Pc.add(R),I.push(R)}for(var g=0,f=m;g<f.length;g++){var R=f[g],x=Pc.has(R);if(!x)Pc.add(R),I.push(R)}return I}function jc(j,Y){var v=J2(j,Y,!1);if(!v)return[];return v.OrdinaryOwnMetadataKeys(j,Y)}function Ec(j){if(j===null)return 1;switch(typeof j){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return j===null?1:6;default:return 6}}function y(j){return j===void 0}function Uc(j){return j===null}function Zc(j){return typeof j==="symbol"}function d(j){return typeof j==="object"?j!==null:typeof j==="function"}function Fc(j,Y){switch(Ec(j)){case 0:return j;case 1:return j;case 2:return j;case 3:return j;case 4:return j;case 5:return j}var v=Y===3?"string":Y===5?"number":"default",Z=bc(j,S);if(Z!==void 0){var m=Z.call(j,v);if(d(m))throw TypeError();return m}return Qc(j,v==="default"?"number":v)}function Qc(j,Y){if(Y==="string"){var v=j.toString;if(T(v)){var Z=v.call(j);if(!d(Z))return Z}var m=j.valueOf;if(T(m)){var Z=m.call(j);if(!d(Z))return Z}}else{var m=j.valueOf;if(T(m)){var Z=m.call(j);if(!d(Z))return Z}var Pc=j.toString;if(T(Pc)){var Z=Pc.call(j);if(!d(Z))return Z}}throw TypeError()}function gc(j){return!!j}function Ac(j){return""+j}function l(j){var Y=Fc(j,3);if(Zc(Y))return Y;return Ac(Y)}function s(j){return Array.isArray?Array.isArray(j):j instanceof Object?j instanceof Array:Object.prototype.toString.call(j)==="[object Array]"}function T(j){return typeof j==="function"}function Mc(j){return typeof j==="function"}function Nc(j){switch(Ec(j)){case 3:return!0;case 4:return!0;default:return!1}}function Xc(j,Y){return j===Y||j!==j&&Y!==Y}function bc(j,Y){var v=j[Y];if(v===void 0||v===null)return;if(!T(v))throw TypeError();return v}function yc(j){var Y=bc(j,O);if(!T(Y))throw TypeError();var v=Y.call(j);if(!d(v))throw TypeError();return v}function Bc(j){return j.value}function $c(j){var Y=j.next();return Y.done?!1:Y}function rc(j){var Y=j.return;if(Y)Y.call(j)}function zc(j){var Y=Object.getPrototypeOf(j);if(typeof j!=="function"||j===$)return Y;if(Y!==$)return Y;var v=j.prototype,Z=v&&Object.getPrototypeOf(v);if(Z==null||Z===Object.prototype)return Y;var m=Z.constructor;if(typeof m!=="function")return Y;if(m===j)return Y;return m}function tc(){var j;if(!y(H)&&typeof P.Reflect<"u"&&!(H in P.Reflect)&&typeof P.Reflect.defineMetadata==="function")j=F4(P.Reflect);var Y,v,Z,m=new z,Pc={registerProvider:I,getProvider:F,setProvider:x};return Pc;function I(g){if(!Object.isExtensible(Pc))throw Error("Cannot add provider to a frozen registry.");switch(!0){case j===g:break;case y(Y):Y=g;break;case Y===g:break;case y(v):v=g;break;case v===g:break;default:if(Z===void 0)Z=new J;Z.add(g);break}}function N(g,f){if(!y(Y)){if(Y.isProviderFor(g,f))return Y;if(!y(v)){if(v.isProviderFor(g,f))return Y;if(!y(Z)){var t=yc(Z);while(!0){var i=$c(t);if(!i)return;var Jc=Bc(i);if(Jc.isProviderFor(g,f))return rc(t),Jc}}}}if(!y(j)&&j.isProviderFor(g,f))return j;return}function F(g,f){var t=m.get(g),i;if(!y(t))i=t.get(f);if(!y(i))return i;if(i=N(g,f),!y(i)){if(y(t))t=new q,m.set(g,t);t.set(f,i)}return i}function R(g){if(y(g))throw TypeError();return Y===g||v===g||!y(Z)&&Z.has(g)}function x(g,f,t){if(!R(t))throw Error("Metadata provider not registered.");var i=F(g,f);if(i!==t){if(!y(i))return!1;var Jc=m.get(g);if(y(Jc))Jc=new q,m.set(g,Jc);Jc.set(f,t)}return!0}}function dc(){var j;if(!y(H)&&d(P.Reflect)&&Object.isExtensible(P.Reflect))j=P.Reflect[H];if(y(j))j=tc();if(!y(H)&&d(P.Reflect)&&Object.isExtensible(P.Reflect))Object.defineProperty(P.Reflect,H,{enumerable:!1,configurable:!1,writable:!1,value:j});return j}function sc(j){var Y=new z,v={isProviderFor:function(R,x){var g=Y.get(R);if(y(g))return!1;return g.has(x)},OrdinaryDefineOwnMetadata:I,OrdinaryHasOwnMetadata:m,OrdinaryGetOwnMetadata:Pc,OrdinaryOwnMetadataKeys:N,OrdinaryDeleteMetadata:F};return b.registerProvider(v),v;function Z(R,x,g){var f=Y.get(R),t=!1;if(y(f)){if(!g)return;f=new q,Y.set(R,f),t=!0}var i=f.get(x);if(y(i)){if(!g)return;if(i=new q,f.set(x,i),!j.setProvider(R,x,v)){if(f.delete(x),t)Y.delete(R);throw Error("Wrong provider for target.")}}return i}function m(R,x,g){var f=Z(x,g,!1);if(y(f))return!1;return gc(f.has(R))}function Pc(R,x,g){var f=Z(x,g,!1);if(y(f))return;return f.get(R)}function I(R,x,g,f){var t=Z(g,f,!0);t.set(R,x)}function N(R,x){var g=[],f=Z(R,x,!1);if(y(f))return g;var t=f.keys(),i=yc(t),Jc=0;while(!0){var U2=$c(i);if(!U2)return g.length=Jc,g;var ac=Bc(U2);try{g[Jc]=ac}catch(Vc){try{rc(i)}finally{throw Vc}}Jc++}}function F(R,x,g){var f=Z(x,g,!1);if(y(f))return!1;if(!f.delete(R))return!1;if(f.size===0){var t=Y.get(x);if(!y(t)){if(t.delete(g),t.size===0)Y.delete(t)}}return!0}}function F4(j){var{defineMetadata:Y,hasOwnMetadata:v,getOwnMetadata:Z,getOwnMetadataKeys:m,deleteMetadata:Pc}=j,I=new z,N={isProviderFor:function(F,R){var x=I.get(F);if(!y(x)&&x.has(R))return!0;if(m(F,R).length){if(y(x))x=new J,I.set(F,x);return x.add(R),!0}return!1},OrdinaryDefineOwnMetadata:Y,OrdinaryHasOwnMetadata:v,OrdinaryGetOwnMetadata:Z,OrdinaryOwnMetadataKeys:m,OrdinaryDeleteMetadata:Pc};return N}function J2(j,Y,v){var Z=b.getProvider(j,Y);if(!y(Z))return Z;if(v){if(b.setProvider(j,Y,Q))return Q;throw Error("Illegal state.")}return}function g4(){var j={},Y=[],v=function(){function N(F,R,x){this._index=0,this._keys=F,this._values=R,this._selector=x}return N.prototype["@@iterator"]=function(){return this},N.prototype[O]=function(){return this},N.prototype.next=function(){var F=this._index;if(F>=0&&F<this._keys.length){var R=this._selector(this._keys[F],this._values[F]);if(F+1>=this._keys.length)this._index=-1,this._keys=Y,this._values=Y;else this._index++;return{value:R,done:!1}}return{value:void 0,done:!0}},N.prototype.throw=function(F){if(this._index>=0)this._index=-1,this._keys=Y,this._values=Y;throw F},N.prototype.return=function(F){if(this._index>=0)this._index=-1,this._keys=Y,this._values=Y;return{value:F,done:!0}},N}(),Z=function(){function N(){this._keys=[],this._values=[],this._cacheKey=j,this._cacheIndex=-2}return Object.defineProperty(N.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),N.prototype.has=function(F){return this._find(F,!1)>=0},N.prototype.get=function(F){var R=this._find(F,!1);return R>=0?this._values[R]:void 0},N.prototype.set=function(F,R){var x=this._find(F,!0);return this._values[x]=R,this},N.prototype.delete=function(F){var R=this._find(F,!1);if(R>=0){var x=this._keys.length;for(var g=R+1;g<x;g++)this._keys[g-1]=this._keys[g],this._values[g-1]=this._values[g];if(this._keys.length--,this._values.length--,Xc(F,this._cacheKey))this._cacheKey=j,this._cacheIndex=-2;return!0}return!1},N.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=j,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,I)},N.prototype["@@iterator"]=function(){return this.entries()},N.prototype[O]=function(){return this.entries()},N.prototype._find=function(F,R){if(!Xc(this._cacheKey,F)){this._cacheIndex=-1;for(var x=0;x<this._keys.length;x++)if(Xc(this._keys[x],F)){this._cacheIndex=x;break}}if(this._cacheIndex<0&&R)this._cacheIndex=this._keys.length,this._keys.push(F),this._values.push(void 0);return this._cacheIndex},N}();return Z;function m(N,F){return N}function Pc(N,F){return F}function I(N,F){return[N,F]}}function T2(){var j=function(){function Y(){this._map=new q}return Object.defineProperty(Y.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),Y.prototype.has=function(v){return this._map.has(v)},Y.prototype.add=function(v){return this._map.set(v,v),this},Y.prototype.delete=function(v){return this._map.delete(v)},Y.prototype.clear=function(){this._map.clear()},Y.prototype.keys=function(){return this._map.keys()},Y.prototype.values=function(){return this._map.keys()},Y.prototype.entries=function(){return this._map.entries()},Y.prototype["@@iterator"]=function(){return this.keys()},Y.prototype[O]=function(){return this.keys()},Y}();return j}function k4(){var j=16,Y=L.create(),v=Z();return function(){function F(){this._key=Z()}return F.prototype.has=function(R){var x=m(R,!1);return x!==void 0?L.has(x,this._key):!1},F.prototype.get=function(R){var x=m(R,!1);return x!==void 0?L.get(x,this._key):void 0},F.prototype.set=function(R,x){var g=m(R,!0);return g[this._key]=x,this},F.prototype.delete=function(R){var x=m(R,!1);return x!==void 0?delete x[this._key]:!1},F.prototype.clear=function(){this._key=Z()},F}();function Z(){var F;do F="@@WeakMap@@"+N();while(L.has(Y,F));return Y[F]=!0,F}function m(F,R){if(!h.call(F,v)){if(!R)return;Object.defineProperty(F,v,{value:L.create()})}return F[v]}function Pc(F,R){for(var x=0;x<R;++x)F[x]=Math.random()*255|0;return F}function I(F){if(typeof Uint8Array==="function"){var R=new Uint8Array(F);if(typeof crypto<"u")crypto.getRandomValues(R);else if(typeof msCrypto<"u")msCrypto.getRandomValues(R);else Pc(R,F);return R}return Pc(Array(F),F)}function N(){var F=I(j);F[6]=F[6]&79|64,F[8]=F[8]&191|128;var R="";for(var x=0;x<j;++x){var g=F[x];if(x===4||x===6||x===8)R+="-";if(g<16)R+="0";R+=g.toString(16).toLowerCase()}return R}}function _c(j){return j.__=void 0,delete j.__,j}})})(c||(c={}))}),V2=_((c,K)=>{K.exports=TypeError}),w3=_((c,K)=>{K.exports=K3("util").inspect}),b4=_((c,K)=>{var w=typeof Map==="function"&&Map.prototype,P=Object.getOwnPropertyDescriptor&&w?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,h=w&&P&&typeof P.get==="function"?P.get:null,M=w&&Map.prototype.forEach,S=typeof Set==="function"&&Set.prototype,O=Object.getOwnPropertyDescriptor&&S?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,G=S&&O&&typeof O.get==="function"?O.get:null,D=S&&Set.prototype.forEach,B=typeof WeakMap==="function"&&WeakMap.prototype,L=B?WeakMap.prototype.has:null,$=typeof WeakSet==="function"&&WeakSet.prototype,q=$?WeakSet.prototype.has:null,J=typeof WeakRef==="function"&&WeakRef.prototype,z=J?WeakRef.prototype.deref:null,H=Boolean.prototype.valueOf,b=Object.prototype.toString,Q=Function.prototype.toString,X=String.prototype.match,W=String.prototype.slice,V=String.prototype.replace,o=String.prototype.toUpperCase,U=String.prototype.toLowerCase,r=RegExp.prototype.test,k=Array.prototype.concat,A=Array.prototype.join,u=Array.prototype.slice,n=Math.floor,C=typeof BigInt==="function"?BigInt.prototype.valueOf:null,cc=Object.getOwnPropertySymbols,Oc=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null,wc=typeof Symbol==="function"&&typeof Symbol.iterator==="object",Dc=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===wc?"object":"symbol")?Symbol.toStringTag:null,Hc=Object.prototype.propertyIsEnumerable,vc=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(I){return I.__proto__}:null);function p(I,N){if(I===1/0||I===-1/0||I!==I||I&&I>-1000&&I<1000||r.call(/e/,N))return N;var F=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof I==="number"){var R=I<0?-n(-I):n(I);if(R!==I){var x=String(R),g=W.call(N,x.length+1);return V.call(x,F,"$&_")+"."+V.call(V.call(g,/([0-9]{3})/g,"$&_"),/_$/,"")}}return V.call(N,F,"$&_")}var jc=w3(),Ec=jc.custom,y=Xc(Ec)?Ec:null,Uc={__proto__:null,double:'"',single:"'"},Zc={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};K.exports=function I(N,F,R,x){var g=F||{};if(Bc(g,"quoteStyle")&&!Bc(Uc,g.quoteStyle))throw TypeError('option "quoteStyle" must be "single" or "double"');if(Bc(g,"maxStringLength")&&(typeof g.maxStringLength==="number"?g.maxStringLength<0&&g.maxStringLength!==1/0:g.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=Bc(g,"customInspect")?g.customInspect:!0;if(typeof f!=="boolean"&&f!=="symbol")throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Bc(g,"indent")&&g.indent!==null&&g.indent!=="\t"&&!(parseInt(g.indent,10)===g.indent&&g.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Bc(g,"numericSeparator")&&typeof g.numericSeparator!=="boolean")throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var t=g.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 T2(N,g);if(typeof N==="number"){if(N===0)return 1/0/N>0?"0":"-0";var i=String(N);return t?p(N,i):i}if(typeof N==="bigint"){var Jc=String(N)+"n";return t?p(N,Jc):Jc}var U2=typeof g.depth>"u"?5:g.depth;if(typeof R>"u")R=0;if(R>=U2&&U2>0&&typeof N==="object")return gc(N)?"[Array]":"[Object]";var ac=Z(g,R);if(typeof x>"u")x=[];else if(zc(x,N)>=0)return"[Circular]";function Vc(Y2,i2,f5){if(i2)x=u.call(x),x.push(i2);if(f5){var CK={depth:g.depth};if(Bc(g,"quoteStyle"))CK.quoteStyle=g.quoteStyle;return I(Y2,CK,R+1,x)}return I(Y2,g,R+1,x)}if(typeof N==="function"&&!l(N)){var xK=rc(N),ZK=Pc(N,Vc);return"[Function"+(xK?": "+xK:" (anonymous)")+"]"+(ZK.length>0?" { "+A.call(ZK,", ")+" }":"")}if(Xc(N)){var AK=wc?V.call(String(N),/^(Symbol\(.*\))_[^)]*$/,"$1"):Oc.call(N);return typeof N==="object"&&!wc?_c(AK):AK}if(g4(N)){var x2="<"+U.call(String(N.nodeName)),R4=N.attributes||[];for(var n2=0;n2<R4.length;n2++)x2+=" "+R4[n2].name+"="+d(Fc(R4[n2].value),"double",g);if(x2+=">",N.childNodes&&N.childNodes.length)x2+="...";return x2+="</"+U.call(String(N.nodeName))+">",x2}if(gc(N)){if(N.length===0)return"[]";var x4=Pc(N,Vc);if(ac&&!v(x4))return"["+m(x4,ac)+"]";return"[ "+A.call(x4,", ")+" ]"}if(s(N)){var Z4=Pc(N,Vc);if(!("cause"in Error.prototype)&&"cause"in N&&!Hc.call(N,"cause"))return"{ ["+String(N)+"] "+A.call(k.call("[cause]: "+Vc(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"&&jc)return jc(N,{depth:U2-R});else if(f!=="symbol"&&typeof N.inspect==="function")return N.inspect()}if(tc(N)){var rK=[];if(M)M.call(N,function(Y2,i2){rK.push(Vc(i2,N,!0)+" => "+Vc(Y2,N))});return Y("Map",h.call(N),rK,ac)}if(F4(N)){var oK=[];if(D)D.call(N,function(Y2){oK.push(Vc(Y2,N))});return Y("Set",G.call(N),oK,ac)}if(dc(N))return j("WeakMap");if(J2(N))return j("WeakSet");if(sc(N))return j("WeakRef");if(Mc(N))return _c(Vc(Number(N)));if(bc(N))return _c(Vc(C.call(N)));if(Nc(N))return _c(H.call(N));if(T(N))return _c(Vc(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)&&!l(N)){var A4=Pc(N,Vc),mK=vc?vc(N)===Object.prototype:N instanceof Object||N.constructor===Object,r4=N instanceof Object?"":"null prototype",uK=!mK&&Dc&&Object(N)===N&&Dc in N?W.call($c(N),8,-1):r4?"Object":"",_5=mK||typeof N.constructor!=="function"?"":N.constructor.name?N.constructor.name+" ":"",o4=_5+(uK||r4?"["+A.call(k.call([],uK||[],r4||[]),": ")+"] ":"");if(A4.length===0)return o4+"{}";if(ac)return o4+"{"+m(A4,ac)+"}";return o4+"{ "+A.call(A4,", ")+" }"}return String(N)};function d(I,N,F){var R=F.quoteStyle||N,x=Uc[R];return x+I+x}function Fc(I){return V.call(String(I),/"/g,"&quot;")}function Qc(I){return!Dc||!(typeof I==="object"&&((Dc in I)||typeof I[Dc]<"u"))}function gc(I){return $c(I)==="[object Array]"&&Qc(I)}function Ac(I){return $c(I)==="[object Date]"&&Qc(I)}function l(I){return $c(I)==="[object RegExp]"&&Qc(I)}function s(I){return $c(I)==="[object Error]"&&Qc(I)}function T(I){return $c(I)==="[object String]"&&Qc(I)}function Mc(I){return $c(I)==="[object Number]"&&Qc(I)}function Nc(I){return $c(I)==="[object Boolean]"&&Qc(I)}function Xc(I){if(wc)return I&&typeof I==="object"&&I instanceof Symbol;if(typeof I==="symbol")return!0;if(!I||typeof I!=="object"||!Oc)return!1;try{return Oc.call(I),!0}catch(N){}return!1}function bc(I){if(!I||typeof I!=="object"||!C)return!1;try{return C.call(I),!0}catch(N){}return!1}var yc=Object.prototype.hasOwnProperty||function(I){return I in this};function Bc(I,N){return yc.call(I,N)}function $c(I){return b.call(I)}function rc(I){if(I.name)return I.name;var N=X.call(Q.call(I),/^function\s*([\w$]+)/);if(N)return N[1];return null}function zc(I,N){if(I.indexOf)return I.indexOf(N);for(var F=0,R=I.length;F<R;F++)if(I[F]===N)return F;return-1}function tc(I){if(!h||!I||typeof I!=="object")return!1;try{h.call(I);try{G.call(I)}catch(N){return!0}return I instanceof Map}catch(N){}return!1}function dc(I){if(!L||!I||typeof I!=="object")return!1;try{L.call(I,L);try{q.call(I,q)}catch(N){return!0}return I instanceof WeakMap}catch(N){}return!1}function sc(I){if(!z||!I||typeof I!=="object")return!1;try{return z.call(I),!0}catch(N){}return!1}function F4(I){if(!G||!I||typeof I!=="object")return!1;try{G.call(I);try{h.call(I)}catch(N){return!0}return I instanceof Set}catch(N){}return!1}function J2(I){if(!q||!I||typeof I!=="object")return!1;try{q.call(I,q);try{L.call(I,L)}catch(N){return!0}return I instanceof WeakSet}catch(N){}return!1}function g4(I){if(!I||typeof I!=="object")return!1;if(typeof HTMLElement<"u"&&I instanceof HTMLElement)return!0;return typeof I.nodeName==="string"&&typeof I.getAttribute==="function"}function T2(I,N){if(I.length>N.maxStringLength){var F=I.length-N.maxStringLength,R="... "+F+" more character"+(F>1?"s":"");return T2(W.call(I,0,N.maxStringLength),N)+R}var x=Zc[N.quoteStyle||"single"];x.lastIndex=0;var g=V.call(V.call(I,x,"\\$1"),/[\x00-\x1f]/g,k4);return d(g,"single",N)}function k4(I){var N=I.charCodeAt(0),F={8:"b",9:"t",10:"n",12:"f",13:"r"}[N];if(F)return"\\"+F;return"\\x"+(N<16?"0":"")+o.call(N.toString(16))}function _c(I){return"Object("+I+")"}function j(I){return I+" { ? }"}function Y(I,N,F,R){var x=R?m(F,R):A.call(F,", ");return I+" ("+N+") {"+x+"}"}function v(I){for(var N=0;N<I.length;N++)if(zc(I[N],`
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:G(),h=M(K);if(typeof P.Reflect<"u")h=M(P.Reflect,h);if(w(h,P),typeof P.Reflect>"u")P.Reflect=K;function M(D,$){return function(L,B){if(Object.defineProperty(D,L,{configurable:!0,writable:!0,value:B}),$)$(L,B)}}function S(){try{return Function("return this;")()}catch(D){}}function O(){try{return(0,eval)("(function() { return this; })()")}catch(D){}}function G(){return S()||O()}})(function(w,P){var h=Object.prototype.hasOwnProperty,M=typeof Symbol==="function",S=M&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",O=M&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",G=typeof Object.create==="function",D={__proto__:[]}instanceof Array,$=!G&&!D,L={create:G?function(){return _c(Object.create(null))}:D?function(){return _c({__proto__:null})}:function(){return _c({})},has:$?function(j,Y){return h.call(j,Y)}:function(j,Y){return Y in j},get:$?function(j,Y){return h.call(j,Y)?j[Y]:void 0}:function(j,Y){return j[Y]}},B=Object.getPrototypeOf(Function),q=typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:g4(),J=typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:T2(),z=typeof WeakMap==="function"?WeakMap:k4(),H=M?Symbol.for("@reflect-metadata:registry"):void 0,b=dc(),Q=sc(b);function X(j,Y,v,Z){if(!y(v)){if(!s(j))throw TypeError();if(!d(Y))throw TypeError();if(!d(Z)&&!y(Z)&&!Uc(Z))throw TypeError();if(Uc(Z))Z=void 0;return v=l(v),cc(j,Y,v,Z)}else{if(!s(j))throw TypeError();if(!Mc(Y))throw TypeError();return C(j,Y)}}w("decorate",X);function W(j,Y){function v(Z,m){if(!d(Z))throw TypeError();if(!y(m)&&!Nc(m))throw TypeError();vc(j,Y,Z,m)}return v}w("metadata",W);function V(j,Y,v,Z){if(!d(v))throw TypeError();if(!y(Z))Z=l(Z);return vc(j,Y,v,Z)}w("defineMetadata",V);function o(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);return Oc(j,Y,v)}w("hasMetadata",o);function U(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);return wc(j,Y,v)}w("hasOwnMetadata",U);function r(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);return Dc(j,Y,v)}w("getMetadata",r);function k(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);return Hc(j,Y,v)}w("getOwnMetadata",k);function A(j,Y){if(!d(j))throw TypeError();if(!y(Y))Y=l(Y);return p(j,Y)}w("getMetadataKeys",A);function u(j,Y){if(!d(j))throw TypeError();if(!y(Y))Y=l(Y);return jc(j,Y)}w("getOwnMetadataKeys",u);function n(j,Y,v){if(!d(Y))throw TypeError();if(!y(v))v=l(v);if(!d(Y))throw TypeError();if(!y(v))v=l(v);var Z=J2(Y,v,!1);if(y(Z))return!1;return Z.OrdinaryDeleteMetadata(j,Y,v)}w("deleteMetadata",n);function C(j,Y){for(var v=j.length-1;v>=0;--v){var Z=j[v],m=Z(Y);if(!y(m)&&!Uc(m)){if(!Mc(m))throw TypeError();Y=m}}return Y}function cc(j,Y,v,Z){for(var m=j.length-1;m>=0;--m){var Pc=j[m],I=Pc(Y,v,Z);if(!y(I)&&!Uc(I)){if(!d(I))throw TypeError();Z=I}}return Z}function Oc(j,Y,v){var Z=wc(j,Y,v);if(Z)return!0;var m=zc(Y);if(!Uc(m))return Oc(j,m,v);return!1}function wc(j,Y,v){var Z=J2(Y,v,!1);if(y(Z))return!1;return gc(Z.OrdinaryHasOwnMetadata(j,Y,v))}function Dc(j,Y,v){var Z=wc(j,Y,v);if(Z)return Hc(j,Y,v);var m=zc(Y);if(!Uc(m))return Dc(j,m,v);return}function Hc(j,Y,v){var Z=J2(Y,v,!1);if(y(Z))return;return Z.OrdinaryGetOwnMetadata(j,Y,v)}function vc(j,Y,v,Z){var m=J2(v,Z,!0);m.OrdinaryDefineOwnMetadata(j,Y,v,Z)}function p(j,Y){var v=jc(j,Y),Z=zc(j);if(Z===null)return v;var m=p(Z,Y);if(m.length<=0)return v;if(v.length<=0)return m;var Pc=new J,I=[];for(var N=0,F=v;N<F.length;N++){var R=F[N],x=Pc.has(R);if(!x)Pc.add(R),I.push(R)}for(var g=0,f=m;g<f.length;g++){var R=f[g],x=Pc.has(R);if(!x)Pc.add(R),I.push(R)}return I}function jc(j,Y){var v=J2(j,Y,!1);if(!v)return[];return v.OrdinaryOwnMetadataKeys(j,Y)}function Ec(j){if(j===null)return 1;switch(typeof j){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return j===null?1:6;default:return 6}}function y(j){return j===void 0}function Uc(j){return j===null}function Zc(j){return typeof j==="symbol"}function d(j){return typeof j==="object"?j!==null:typeof j==="function"}function Fc(j,Y){switch(Ec(j)){case 0:return j;case 1:return j;case 2:return j;case 3:return j;case 4:return j;case 5:return j}var v=Y===3?"string":Y===5?"number":"default",Z=bc(j,S);if(Z!==void 0){var m=Z.call(j,v);if(d(m))throw TypeError();return m}return Qc(j,v==="default"?"number":v)}function Qc(j,Y){if(Y==="string"){var v=j.toString;if(T(v)){var Z=v.call(j);if(!d(Z))return Z}var m=j.valueOf;if(T(m)){var Z=m.call(j);if(!d(Z))return Z}}else{var m=j.valueOf;if(T(m)){var Z=m.call(j);if(!d(Z))return Z}var Pc=j.toString;if(T(Pc)){var Z=Pc.call(j);if(!d(Z))return Z}}throw TypeError()}function gc(j){return!!j}function Ac(j){return""+j}function l(j){var Y=Fc(j,3);if(Zc(Y))return Y;return Ac(Y)}function s(j){return Array.isArray?Array.isArray(j):j instanceof Object?j instanceof Array:Object.prototype.toString.call(j)==="[object Array]"}function T(j){return typeof j==="function"}function Mc(j){return typeof j==="function"}function Nc(j){switch(Ec(j)){case 3:return!0;case 4:return!0;default:return!1}}function Xc(j,Y){return j===Y||j!==j&&Y!==Y}function bc(j,Y){var v=j[Y];if(v===void 0||v===null)return;if(!T(v))throw TypeError();return v}function yc(j){var Y=bc(j,O);if(!T(Y))throw TypeError();var v=Y.call(j);if(!d(v))throw TypeError();return v}function $c(j){return j.value}function Bc(j){var Y=j.next();return Y.done?!1:Y}function rc(j){var Y=j.return;if(Y)Y.call(j)}function zc(j){var Y=Object.getPrototypeOf(j);if(typeof j!=="function"||j===B)return Y;if(Y!==B)return Y;var v=j.prototype,Z=v&&Object.getPrototypeOf(v);if(Z==null||Z===Object.prototype)return Y;var m=Z.constructor;if(typeof m!=="function")return Y;if(m===j)return Y;return m}function tc(){var j;if(!y(H)&&typeof P.Reflect<"u"&&!(H in P.Reflect)&&typeof P.Reflect.defineMetadata==="function")j=F4(P.Reflect);var Y,v,Z,m=new z,Pc={registerProvider:I,getProvider:F,setProvider:x};return Pc;function I(g){if(!Object.isExtensible(Pc))throw Error("Cannot add provider to a frozen registry.");switch(!0){case j===g:break;case y(Y):Y=g;break;case Y===g:break;case y(v):v=g;break;case v===g:break;default:if(Z===void 0)Z=new J;Z.add(g);break}}function N(g,f){if(!y(Y)){if(Y.isProviderFor(g,f))return Y;if(!y(v)){if(v.isProviderFor(g,f))return Y;if(!y(Z)){var t=yc(Z);while(!0){var i=Bc(t);if(!i)return;var Jc=$c(i);if(Jc.isProviderFor(g,f))return rc(t),Jc}}}}if(!y(j)&&j.isProviderFor(g,f))return j;return}function F(g,f){var t=m.get(g),i;if(!y(t))i=t.get(f);if(!y(i))return i;if(i=N(g,f),!y(i)){if(y(t))t=new q,m.set(g,t);t.set(f,i)}return i}function R(g){if(y(g))throw TypeError();return Y===g||v===g||!y(Z)&&Z.has(g)}function x(g,f,t){if(!R(t))throw Error("Metadata provider not registered.");var i=F(g,f);if(i!==t){if(!y(i))return!1;var Jc=m.get(g);if(y(Jc))Jc=new q,m.set(g,Jc);Jc.set(f,t)}return!0}}function dc(){var j;if(!y(H)&&d(P.Reflect)&&Object.isExtensible(P.Reflect))j=P.Reflect[H];if(y(j))j=tc();if(!y(H)&&d(P.Reflect)&&Object.isExtensible(P.Reflect))Object.defineProperty(P.Reflect,H,{enumerable:!1,configurable:!1,writable:!1,value:j});return j}function sc(j){var Y=new z,v={isProviderFor:function(R,x){var g=Y.get(R);if(y(g))return!1;return g.has(x)},OrdinaryDefineOwnMetadata:I,OrdinaryHasOwnMetadata:m,OrdinaryGetOwnMetadata:Pc,OrdinaryOwnMetadataKeys:N,OrdinaryDeleteMetadata:F};return b.registerProvider(v),v;function Z(R,x,g){var f=Y.get(R),t=!1;if(y(f)){if(!g)return;f=new q,Y.set(R,f),t=!0}var i=f.get(x);if(y(i)){if(!g)return;if(i=new q,f.set(x,i),!j.setProvider(R,x,v)){if(f.delete(x),t)Y.delete(R);throw Error("Wrong provider for target.")}}return i}function m(R,x,g){var f=Z(x,g,!1);if(y(f))return!1;return gc(f.has(R))}function Pc(R,x,g){var f=Z(x,g,!1);if(y(f))return;return f.get(R)}function I(R,x,g,f){var t=Z(g,f,!0);t.set(R,x)}function N(R,x){var g=[],f=Z(R,x,!1);if(y(f))return g;var t=f.keys(),i=yc(t),Jc=0;while(!0){var U2=Bc(i);if(!U2)return g.length=Jc,g;var ac=$c(U2);try{g[Jc]=ac}catch(Vc){try{rc(i)}finally{throw Vc}}Jc++}}function F(R,x,g){var f=Z(x,g,!1);if(y(f))return!1;if(!f.delete(R))return!1;if(f.size===0){var t=Y.get(x);if(!y(t)){if(t.delete(g),t.size===0)Y.delete(t)}}return!0}}function F4(j){var{defineMetadata:Y,hasOwnMetadata:v,getOwnMetadata:Z,getOwnMetadataKeys:m,deleteMetadata:Pc}=j,I=new z,N={isProviderFor:function(F,R){var x=I.get(F);if(!y(x)&&x.has(R))return!0;if(m(F,R).length){if(y(x))x=new J,I.set(F,x);return x.add(R),!0}return!1},OrdinaryDefineOwnMetadata:Y,OrdinaryHasOwnMetadata:v,OrdinaryGetOwnMetadata:Z,OrdinaryOwnMetadataKeys:m,OrdinaryDeleteMetadata:Pc};return N}function J2(j,Y,v){var Z=b.getProvider(j,Y);if(!y(Z))return Z;if(v){if(b.setProvider(j,Y,Q))return Q;throw Error("Illegal state.")}return}function g4(){var j={},Y=[],v=function(){function N(F,R,x){this._index=0,this._keys=F,this._values=R,this._selector=x}return N.prototype["@@iterator"]=function(){return this},N.prototype[O]=function(){return this},N.prototype.next=function(){var F=this._index;if(F>=0&&F<this._keys.length){var R=this._selector(this._keys[F],this._values[F]);if(F+1>=this._keys.length)this._index=-1,this._keys=Y,this._values=Y;else this._index++;return{value:R,done:!1}}return{value:void 0,done:!0}},N.prototype.throw=function(F){if(this._index>=0)this._index=-1,this._keys=Y,this._values=Y;throw F},N.prototype.return=function(F){if(this._index>=0)this._index=-1,this._keys=Y,this._values=Y;return{value:F,done:!0}},N}(),Z=function(){function N(){this._keys=[],this._values=[],this._cacheKey=j,this._cacheIndex=-2}return Object.defineProperty(N.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),N.prototype.has=function(F){return this._find(F,!1)>=0},N.prototype.get=function(F){var R=this._find(F,!1);return R>=0?this._values[R]:void 0},N.prototype.set=function(F,R){var x=this._find(F,!0);return this._values[x]=R,this},N.prototype.delete=function(F){var R=this._find(F,!1);if(R>=0){var x=this._keys.length;for(var g=R+1;g<x;g++)this._keys[g-1]=this._keys[g],this._values[g-1]=this._values[g];if(this._keys.length--,this._values.length--,Xc(F,this._cacheKey))this._cacheKey=j,this._cacheIndex=-2;return!0}return!1},N.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=j,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,I)},N.prototype["@@iterator"]=function(){return this.entries()},N.prototype[O]=function(){return this.entries()},N.prototype._find=function(F,R){if(!Xc(this._cacheKey,F)){this._cacheIndex=-1;for(var x=0;x<this._keys.length;x++)if(Xc(this._keys[x],F)){this._cacheIndex=x;break}}if(this._cacheIndex<0&&R)this._cacheIndex=this._keys.length,this._keys.push(F),this._values.push(void 0);return this._cacheIndex},N}();return Z;function m(N,F){return N}function Pc(N,F){return F}function I(N,F){return[N,F]}}function T2(){var j=function(){function Y(){this._map=new q}return Object.defineProperty(Y.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),Y.prototype.has=function(v){return this._map.has(v)},Y.prototype.add=function(v){return this._map.set(v,v),this},Y.prototype.delete=function(v){return this._map.delete(v)},Y.prototype.clear=function(){this._map.clear()},Y.prototype.keys=function(){return this._map.keys()},Y.prototype.values=function(){return this._map.keys()},Y.prototype.entries=function(){return this._map.entries()},Y.prototype["@@iterator"]=function(){return this.keys()},Y.prototype[O]=function(){return this.keys()},Y}();return j}function k4(){var j=16,Y=L.create(),v=Z();return function(){function F(){this._key=Z()}return F.prototype.has=function(R){var x=m(R,!1);return x!==void 0?L.has(x,this._key):!1},F.prototype.get=function(R){var x=m(R,!1);return x!==void 0?L.get(x,this._key):void 0},F.prototype.set=function(R,x){var g=m(R,!0);return g[this._key]=x,this},F.prototype.delete=function(R){var x=m(R,!1);return x!==void 0?delete x[this._key]:!1},F.prototype.clear=function(){this._key=Z()},F}();function Z(){var F;do F="@@WeakMap@@"+N();while(L.has(Y,F));return Y[F]=!0,F}function m(F,R){if(!h.call(F,v)){if(!R)return;Object.defineProperty(F,v,{value:L.create()})}return F[v]}function Pc(F,R){for(var x=0;x<R;++x)F[x]=Math.random()*255|0;return F}function I(F){if(typeof Uint8Array==="function"){var R=new Uint8Array(F);if(typeof crypto<"u")crypto.getRandomValues(R);else if(typeof msCrypto<"u")msCrypto.getRandomValues(R);else Pc(R,F);return R}return Pc(Array(F),F)}function N(){var F=I(j);F[6]=F[6]&79|64,F[8]=F[8]&191|128;var R="";for(var x=0;x<j;++x){var g=F[x];if(x===4||x===6||x===8)R+="-";if(g<16)R+="0";R+=g.toString(16).toLowerCase()}return R}}function _c(j){return j.__=void 0,delete j.__,j}})})(c||(c={}))}),V2=_((c,K)=>{K.exports=TypeError}),P3=_((c,K)=>{K.exports=w3("util").inspect}),b4=_((c,K)=>{var w=typeof Map==="function"&&Map.prototype,P=Object.getOwnPropertyDescriptor&&w?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,h=w&&P&&typeof P.get==="function"?P.get:null,M=w&&Map.prototype.forEach,S=typeof Set==="function"&&Set.prototype,O=Object.getOwnPropertyDescriptor&&S?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,G=S&&O&&typeof O.get==="function"?O.get:null,D=S&&Set.prototype.forEach,$=typeof WeakMap==="function"&&WeakMap.prototype,L=$?WeakMap.prototype.has:null,B=typeof WeakSet==="function"&&WeakSet.prototype,q=B?WeakSet.prototype.has:null,J=typeof WeakRef==="function"&&WeakRef.prototype,z=J?WeakRef.prototype.deref:null,H=Boolean.prototype.valueOf,b=Object.prototype.toString,Q=Function.prototype.toString,X=String.prototype.match,W=String.prototype.slice,V=String.prototype.replace,o=String.prototype.toUpperCase,U=String.prototype.toLowerCase,r=RegExp.prototype.test,k=Array.prototype.concat,A=Array.prototype.join,u=Array.prototype.slice,n=Math.floor,C=typeof BigInt==="function"?BigInt.prototype.valueOf:null,cc=Object.getOwnPropertySymbols,Oc=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null,wc=typeof Symbol==="function"&&typeof Symbol.iterator==="object",Dc=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===wc?"object":"symbol")?Symbol.toStringTag:null,Hc=Object.prototype.propertyIsEnumerable,vc=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(I){return I.__proto__}:null);function p(I,N){if(I===1/0||I===-1/0||I!==I||I&&I>-1000&&I<1000||r.call(/e/,N))return N;var F=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof I==="number"){var R=I<0?-n(-I):n(I);if(R!==I){var x=String(R),g=W.call(N,x.length+1);return V.call(x,F,"$&_")+"."+V.call(V.call(g,/([0-9]{3})/g,"$&_"),/_$/,"")}}return V.call(N,F,"$&_")}var jc=P3(),Ec=jc.custom,y=Xc(Ec)?Ec:null,Uc={__proto__:null,double:'"',single:"'"},Zc={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};K.exports=function I(N,F,R,x){var g=F||{};if($c(g,"quoteStyle")&&!$c(Uc,g.quoteStyle))throw TypeError('option "quoteStyle" must be "single" or "double"');if($c(g,"maxStringLength")&&(typeof g.maxStringLength==="number"?g.maxStringLength<0&&g.maxStringLength!==1/0:g.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=$c(g,"customInspect")?g.customInspect:!0;if(typeof f!=="boolean"&&f!=="symbol")throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if($c(g,"indent")&&g.indent!==null&&g.indent!=="\t"&&!(parseInt(g.indent,10)===g.indent&&g.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if($c(g,"numericSeparator")&&typeof g.numericSeparator!=="boolean")throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var t=g.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 T2(N,g);if(typeof N==="number"){if(N===0)return 1/0/N>0?"0":"-0";var i=String(N);return t?p(N,i):i}if(typeof N==="bigint"){var Jc=String(N)+"n";return t?p(N,Jc):Jc}var U2=typeof g.depth>"u"?5:g.depth;if(typeof R>"u")R=0;if(R>=U2&&U2>0&&typeof N==="object")return gc(N)?"[Array]":"[Object]";var ac=Z(g,R);if(typeof x>"u")x=[];else if(zc(x,N)>=0)return"[Circular]";function Vc(Y2,i2,e5){if(i2)x=u.call(x),x.push(i2);if(e5){var yK={depth:g.depth};if($c(g,"quoteStyle"))yK.quoteStyle=g.quoteStyle;return I(Y2,yK,R+1,x)}return I(Y2,g,R+1,x)}if(typeof N==="function"&&!l(N)){var ZK=rc(N),AK=Pc(N,Vc);return"[Function"+(ZK?": "+ZK:" (anonymous)")+"]"+(AK.length>0?" { "+A.call(AK,", ")+" }":"")}if(Xc(N)){var rK=wc?V.call(String(N),/^(Symbol\(.*\))_[^)]*$/,"$1"):Oc.call(N);return typeof N==="object"&&!wc?_c(rK):rK}if(g4(N)){var x2="<"+U.call(String(N.nodeName)),R4=N.attributes||[];for(var n2=0;n2<R4.length;n2++)x2+=" "+R4[n2].name+"="+d(Fc(R4[n2].value),"double",g);if(x2+=">",N.childNodes&&N.childNodes.length)x2+="...";return x2+="</"+U.call(String(N.nodeName))+">",x2}if(gc(N)){if(N.length===0)return"[]";var x4=Pc(N,Vc);if(ac&&!v(x4))return"["+m(x4,ac)+"]";return"[ "+A.call(x4,", ")+" ]"}if(s(N)){var Z4=Pc(N,Vc);if(!("cause"in Error.prototype)&&"cause"in N&&!Hc.call(N,"cause"))return"{ ["+String(N)+"] "+A.call(k.call("[cause]: "+Vc(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"&&jc)return jc(N,{depth:U2-R});else if(f!=="symbol"&&typeof N.inspect==="function")return N.inspect()}if(tc(N)){var oK=[];if(M)M.call(N,function(Y2,i2){oK.push(Vc(i2,N,!0)+" => "+Vc(Y2,N))});return Y("Map",h.call(N),oK,ac)}if(F4(N)){var mK=[];if(D)D.call(N,function(Y2){mK.push(Vc(Y2,N))});return Y("Set",G.call(N),mK,ac)}if(dc(N))return j("WeakMap");if(J2(N))return j("WeakSet");if(sc(N))return j("WeakRef");if(Mc(N))return _c(Vc(Number(N)));if(bc(N))return _c(Vc(C.call(N)));if(Nc(N))return _c(H.call(N));if(T(N))return _c(Vc(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)&&!l(N)){var A4=Pc(N,Vc),uK=vc?vc(N)===Object.prototype:N instanceof Object||N.constructor===Object,r4=N instanceof Object?"":"null prototype",CK=!uK&&Dc&&Object(N)===N&&Dc in N?W.call(Bc(N),8,-1):r4?"Object":"",f5=uK||typeof N.constructor!=="function"?"":N.constructor.name?N.constructor.name+" ":"",o4=f5+(CK||r4?"["+A.call(k.call([],CK||[],r4||[]),": ")+"] ":"");if(A4.length===0)return o4+"{}";if(ac)return o4+"{"+m(A4,ac)+"}";return o4+"{ "+A.call(A4,", ")+" }"}return String(N)};function d(I,N,F){var R=F.quoteStyle||N,x=Uc[R];return x+I+x}function Fc(I){return V.call(String(I),/"/g,"&quot;")}function Qc(I){return!Dc||!(typeof I==="object"&&((Dc in I)||typeof I[Dc]<"u"))}function gc(I){return Bc(I)==="[object Array]"&&Qc(I)}function Ac(I){return Bc(I)==="[object Date]"&&Qc(I)}function l(I){return Bc(I)==="[object RegExp]"&&Qc(I)}function s(I){return Bc(I)==="[object Error]"&&Qc(I)}function T(I){return Bc(I)==="[object String]"&&Qc(I)}function Mc(I){return Bc(I)==="[object Number]"&&Qc(I)}function Nc(I){return Bc(I)==="[object Boolean]"&&Qc(I)}function Xc(I){if(wc)return I&&typeof I==="object"&&I instanceof Symbol;if(typeof I==="symbol")return!0;if(!I||typeof I!=="object"||!Oc)return!1;try{return Oc.call(I),!0}catch(N){}return!1}function bc(I){if(!I||typeof I!=="object"||!C)return!1;try{return C.call(I),!0}catch(N){}return!1}var yc=Object.prototype.hasOwnProperty||function(I){return I in this};function $c(I,N){return yc.call(I,N)}function Bc(I){return b.call(I)}function rc(I){if(I.name)return I.name;var N=X.call(Q.call(I),/^function\s*([\w$]+)/);if(N)return N[1];return null}function zc(I,N){if(I.indexOf)return I.indexOf(N);for(var F=0,R=I.length;F<R;F++)if(I[F]===N)return F;return-1}function tc(I){if(!h||!I||typeof I!=="object")return!1;try{h.call(I);try{G.call(I)}catch(N){return!0}return I instanceof Map}catch(N){}return!1}function dc(I){if(!L||!I||typeof I!=="object")return!1;try{L.call(I,L);try{q.call(I,q)}catch(N){return!0}return I instanceof WeakMap}catch(N){}return!1}function sc(I){if(!z||!I||typeof I!=="object")return!1;try{return z.call(I),!0}catch(N){}return!1}function F4(I){if(!G||!I||typeof I!=="object")return!1;try{G.call(I);try{h.call(I)}catch(N){return!0}return I instanceof Set}catch(N){}return!1}function J2(I){if(!q||!I||typeof I!=="object")return!1;try{q.call(I,q);try{L.call(I,L)}catch(N){return!0}return I instanceof WeakSet}catch(N){}return!1}function g4(I){if(!I||typeof I!=="object")return!1;if(typeof HTMLElement<"u"&&I instanceof HTMLElement)return!0;return typeof I.nodeName==="string"&&typeof I.getAttribute==="function"}function T2(I,N){if(I.length>N.maxStringLength){var F=I.length-N.maxStringLength,R="... "+F+" more character"+(F>1?"s":"");return T2(W.call(I,0,N.maxStringLength),N)+R}var x=Zc[N.quoteStyle||"single"];x.lastIndex=0;var g=V.call(V.call(I,x,"\\$1"),/[\x00-\x1f]/g,k4);return d(g,"single",N)}function k4(I){var N=I.charCodeAt(0),F={8:"b",9:"t",10:"n",12:"f",13:"r"}[N];if(F)return"\\"+F;return"\\x"+(N<16?"0":"")+o.call(N.toString(16))}function _c(I){return"Object("+I+")"}function j(I){return I+" { ? }"}function Y(I,N,F,R){var x=R?m(F,R):A.call(F,", ");return I+" ("+N+") {"+x+"}"}function v(I){for(var N=0;N<I.length;N++)if(zc(I[N],`
16
16
  `)>=0)return!1;return!0}function Z(I,N){var F;if(I.indent==="\t")F="\t";else if(typeof I.indent==="number"&&I.indent>0)F=A.call(Array(I.indent+1)," ");else return null;return{base:F,prev:A.call(Array(N+1),F)}}function m(I,N){if(I.length===0)return"";var F=`
17
17
  `+N.prev+N.base;return F+A.call(I,","+F)+`
18
- `+N.prev}function Pc(I,N){var F=gc(I),R=[];if(F){R.length=I.length;for(var x=0;x<I.length;x++)R[x]=Bc(I,x)?N(I[x],I):""}var g=typeof cc==="function"?cc(I):[],f;if(wc){f={};for(var t=0;t<g.length;t++)f["$"+g[t]]=g[t]}for(var i in I){if(!Bc(I,i))continue;if(F&&String(Number(i))===i&&i<I.length)continue;if(wc&&f["$"+i]instanceof Symbol)continue;else if(r.call(/[^\w$]/,i))R.push(N(i,I)+": "+N(I[i],I));else R.push(i+": "+N(I[i],I))}if(typeof cc==="function"){for(var Jc=0;Jc<g.length;Jc++)if(Hc.call(I,g[Jc]))R.push("["+N(g[Jc])+"]: "+N(I[g[Jc]],I))}return R}}),P3=_((c,K)=>{var w=b4(),P=V2(),h=function(D,B,L){var $=D,q;for(;(q=$.next)!=null;$=q)if(q.key===B){if($.next=q.next,!L)q.next=D.next,D.next=q;return q}},M=function(D,B){if(!D)return;var L=h(D,B);return L&&L.value},S=function(D,B,L){var $=h(D,B);if($)$.value=L;else D.next={key:B,next:D.next,value:L}},O=function(D,B){if(!D)return!1;return!!h(D,B)},G=function(D,B){if(D)return h(D,B,!0)};K.exports=function(){var D,B={assert:function(L){if(!B.has(L))throw new P("Side channel does not contain "+w(L))},delete:function(L){var $=D&&D.next,q=G(D,L);if(q&&$&&$===q)D=void 0;return!!q},get:function(L){return M(D,L)},has:function(L){return O(D,L)},set:function(L,$){if(!D)D={next:void 0};S(D,L,$)}};return B}}),eK=_((c,K)=>{K.exports=Object}),h3=_((c,K)=>{K.exports=Error}),M3=_((c,K)=>{K.exports=EvalError}),S3=_((c,K)=>{K.exports=RangeError}),b3=_((c,K)=>{K.exports=ReferenceError}),O3=_((c,K)=>{K.exports=SyntaxError}),J3=_((c,K)=>{K.exports=URIError}),W3=_((c,K)=>{K.exports=Math.abs}),N3=_((c,K)=>{K.exports=Math.floor}),I3=_((c,K)=>{K.exports=Math.max}),D3=_((c,K)=>{K.exports=Math.min}),G3=_((c,K)=>{K.exports=Math.pow}),j3=_((c,K)=>{K.exports=Math.round}),X3=_((c,K)=>{K.exports=Number.isNaN||function(w){return w!==w}}),B3=_((c,K)=>{var w=X3();K.exports=function(P){if(w(P)||P===0)return P;return P<0?-1:1}}),$3=_((c,K)=>{K.exports=Object.getOwnPropertyDescriptor}),pK=_((c,K)=>{var w=$3();if(w)try{w([],"length")}catch(P){w=null}K.exports=w}),z3=_((c,K)=>{var w=Object.defineProperty||!1;if(w)try{w({},"a",{value:1})}catch(P){w=!1}K.exports=w}),U3=_((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"),h=Object(P);if(typeof P==="string")return!1;if(Object.prototype.toString.call(P)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(h)!=="[object Symbol]")return!1;var M=42;w[P]=M;for(var S 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 O=Object.getOwnPropertySymbols(w);if(O.length!==1||O[0]!==P)return!1;if(!Object.prototype.propertyIsEnumerable.call(w,P))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var G=Object.getOwnPropertyDescriptor(w,P);if(G.value!==M||G.enumerable!==!0)return!1}return!0}}),Y3=_((c,K)=>{var w=typeof Symbol<"u"&&Symbol,P=U3();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()}}),lK=_((c,K)=>{K.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),TK=_((c,K)=>{var w=eK();K.exports=w.getPrototypeOf||null}),Q3=_((c,K)=>{var w="Function.prototype.bind called on incompatible ",P=Object.prototype.toString,h=Math.max,M="[object Function]",S=function(D,B){var L=[];for(var $=0;$<D.length;$+=1)L[$]=D[$];for(var q=0;q<B.length;q+=1)L[q+D.length]=B[q];return L},O=function(D,B){var L=[];for(var $=B||0,q=0;$<D.length;$+=1,q+=1)L[q]=D[$];return L},G=function(D,B){var L="";for(var $=0;$<D.length;$+=1)if(L+=D[$],$+1<D.length)L+=B;return L};K.exports=function(D){var B=this;if(typeof B!=="function"||P.apply(B)!==M)throw TypeError(w+B);var L=O(arguments,1),$,q=function(){if(this instanceof $){var Q=B.apply(this,S(L,arguments));if(Object(Q)===Q)return Q;return this}return B.apply(D,S(L,arguments))},J=h(0,B.length-L.length),z=[];for(var H=0;H<J;H++)z[H]="$"+H;if($=Function("binder","return function ("+G(z,",")+"){ return binder.apply(this,arguments); }")(q),B.prototype){var b=function(){};b.prototype=B.prototype,$.prototype=new b,b.prototype=null}return $}}),O4=_((c,K)=>{var w=Q3();K.exports=Function.prototype.bind||w}),p4=_((c,K)=>{K.exports=Function.prototype.call}),nK=_((c,K)=>{K.exports=Function.prototype.apply}),V3=_((c,K)=>{K.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),q3=_((c,K)=>{var w=O4(),P=nK(),h=p4(),M=V3();K.exports=M||w.call(h,P)}),iK=_((c,K)=>{var w=O4(),P=V2(),h=p4(),M=q3();K.exports=function(S){if(S.length<1||typeof S[0]!=="function")throw new P("a function is required");return M(w,h,S)}}),L3=_((c,K)=>{var w=iK(),P=pK(),h;try{h=[].__proto__===Array.prototype}catch(G){if(!G||typeof G!=="object"||!("code"in G)||G.code!=="ERR_PROTO_ACCESS")throw G}var M=!!h&&P&&P(Object.prototype,"__proto__"),S=Object,O=S.getPrototypeOf;K.exports=M&&typeof M.get==="function"?w([M.get]):typeof O==="function"?function(G){return O(G==null?G:S(G))}:!1}),H3=_((c,K)=>{var w=lK(),P=TK(),h=L3();K.exports=w?function(M){return w(M)}:P?function(M){if(!M||typeof M!=="object"&&typeof M!=="function")throw TypeError("getProto: not an object");return P(M)}:h?function(M){return h(M)}:null}),v3=_((c,K)=>{var w=Function.prototype.call,P=Object.prototype.hasOwnProperty,h=O4();K.exports=h.call(w,P)}),l4=_((c,K)=>{var w,P=eK(),h=h3(),M=M3(),S=S3(),O=b3(),G=O3(),D=V2(),B=J3(),L=W3(),$=N3(),q=I3(),J=D3(),z=G3(),H=j3(),b=B3(),Q=Function,X=function(l){try{return Q('"use strict"; return ('+l+").constructor;")()}catch(s){}},W=pK(),V=z3(),o=function(){throw new D},U=W?function(){try{return arguments.callee,o}catch(l){try{return W(arguments,"callee").get}catch(s){return o}}}():o,r=Y3()(),k=H3(),A=TK(),u=lK(),n=nK(),C=p4(),cc={},Oc=typeof Uint8Array>"u"||!k?w:k(Uint8Array),wc={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?w:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?w:ArrayBuffer,"%ArrayIteratorPrototype%":r&&k?k([][Symbol.iterator]()):w,"%AsyncFromSyncIteratorPrototype%":w,"%AsyncFunction%":cc,"%AsyncGenerator%":cc,"%AsyncGeneratorFunction%":cc,"%AsyncIteratorPrototype%":cc,"%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%":h,"%eval%":eval,"%EvalError%":M,"%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%":cc,"%Int8Array%":typeof Int8Array>"u"?w:Int8Array,"%Int16Array%":typeof Int16Array>"u"?w:Int16Array,"%Int32Array%":typeof Int32Array>"u"?w:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":r&&k?k(k([][Symbol.iterator]())):w,"%JSON%":typeof JSON==="object"?JSON:w,"%Map%":typeof Map>"u"?w:Map,"%MapIteratorPrototype%":typeof Map>"u"||!r||!k?w:k(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":P,"%Object.getOwnPropertyDescriptor%":W,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?w:Promise,"%Proxy%":typeof Proxy>"u"?w:Proxy,"%RangeError%":S,"%ReferenceError%":O,"%Reflect%":typeof Reflect>"u"?w:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?w:Set,"%SetIteratorPrototype%":typeof Set>"u"||!r||!k?w:k(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?w:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":r&&k?k(""[Symbol.iterator]()):w,"%Symbol%":r?Symbol:w,"%SyntaxError%":G,"%ThrowTypeError%":U,"%TypedArray%":Oc,"%TypeError%":D,"%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%":B,"%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%":n,"%Object.defineProperty%":V,"%Object.getPrototypeOf%":A,"%Math.abs%":L,"%Math.floor%":$,"%Math.max%":q,"%Math.min%":J,"%Math.pow%":z,"%Math.round%":H,"%Math.sign%":b,"%Reflect.getPrototypeOf%":u};if(k)try{null.error}catch(l){Dc=k(k(l)),wc["%Error.prototype%"]=Dc}var Dc,Hc=function l(s){var T;if(s==="%AsyncFunction%")T=X("async function () {}");else if(s==="%GeneratorFunction%")T=X("function* () {}");else if(s==="%AsyncGeneratorFunction%")T=X("async function* () {}");else if(s==="%AsyncGenerator%"){var Mc=l("%AsyncGeneratorFunction%");if(Mc)T=Mc.prototype}else if(s==="%AsyncIteratorPrototype%"){var Nc=l("%AsyncGenerator%");if(Nc&&k)T=k(Nc.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"]},p=O4(),jc=v3(),Ec=p.call(C,Array.prototype.concat),y=p.call(n,Array.prototype.splice),Uc=p.call(C,String.prototype.replace),Zc=p.call(C,String.prototype.slice),d=p.call(C,RegExp.prototype.exec),Fc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Qc=/\\(\\)?/g,gc=function(l){var s=Zc(l,0,1),T=Zc(l,-1);if(s==="%"&&T!=="%")throw new G("invalid intrinsic syntax, expected closing `%`");else if(T==="%"&&s!=="%")throw new G("invalid intrinsic syntax, expected opening `%`");var Mc=[];return Uc(l,Fc,function(Nc,Xc,bc,yc){Mc[Mc.length]=bc?Uc(yc,Qc,"$1"):Xc||Nc}),Mc},Ac=function(l,s){var T=l,Mc;if(jc(vc,T))Mc=vc[T],T="%"+Mc[0]+"%";if(jc(wc,T)){var Nc=wc[T];if(Nc===cc)Nc=Hc(T);if(typeof Nc>"u"&&!s)throw new D("intrinsic "+l+" exists, but is not available. Please file an issue!");return{alias:Mc,name:T,value:Nc}}throw new G("intrinsic "+l+" does not exist!")};K.exports=function(l,s){if(typeof l!=="string"||l.length===0)throw new D("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof s!=="boolean")throw new D('"allowMissing" argument must be a boolean');if(d(/^%?[^%]*%?$/,l)===null)throw new G("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var T=gc(l),Mc=T.length>0?T[0]:"",Nc=Ac("%"+Mc+"%",s),Xc=Nc.name,bc=Nc.value,yc=!1,Bc=Nc.alias;if(Bc)Mc=Bc[0],y(T,Ec([0,1],Bc));for(var $c=1,rc=!0;$c<T.length;$c+=1){var zc=T[$c],tc=Zc(zc,0,1),dc=Zc(zc,-1);if((tc==='"'||tc==="'"||tc==="`"||(dc==='"'||dc==="'"||dc==="`"))&&tc!==dc)throw new G("property names with quotes must have matching quotes");if(zc==="constructor"||!rc)yc=!0;if(Mc+="."+zc,Xc="%"+Mc+"%",jc(wc,Xc))bc=wc[Xc];else if(bc!=null){if(!(zc in bc)){if(!s)throw new D("base intrinsic for "+l+" exists, but the property is not available.");return}if(W&&$c+1>=T.length){var sc=W(bc,zc);if(rc=!!sc,rc&&"get"in sc&&!("originalValue"in sc.get))bc=sc.get;else bc=bc[zc]}else rc=jc(bc,zc),bc=bc[zc];if(rc&&!yc)wc[Xc]=bc}}return bc}}),tK=_((c,K)=>{var w=l4(),P=iK(),h=P([w("%String.prototype.indexOf%")]);K.exports=function(M,S){var O=w(M,!!S);if(typeof O==="function"&&h(M,".prototype.")>-1)return P([O]);return O}}),dK=_((c,K)=>{var w=l4(),P=tK(),h=b4(),M=V2(),S=w("%Map%",!0),O=P("Map.prototype.get",!0),G=P("Map.prototype.set",!0),D=P("Map.prototype.has",!0),B=P("Map.prototype.delete",!0),L=P("Map.prototype.size",!0);K.exports=!!S&&function(){var $,q={assert:function(J){if(!q.has(J))throw new M("Side channel does not contain "+h(J))},delete:function(J){if($){var z=B($,J);if(L($)===0)$=void 0;return z}return!1},get:function(J){if($)return O($,J)},has:function(J){if($)return D($,J);return!1},set:function(J,z){if(!$)$=new S;G($,J,z)}};return q}}),E3=_((c,K)=>{var w=l4(),P=tK(),h=b4(),M=dK(),S=V2(),O=w("%WeakMap%",!0),G=P("WeakMap.prototype.get",!0),D=P("WeakMap.prototype.set",!0),B=P("WeakMap.prototype.has",!0),L=P("WeakMap.prototype.delete",!0);K.exports=O?function(){var $,q,J={assert:function(z){if(!J.has(z))throw new S("Side channel does not contain "+h(z))},delete:function(z){if(O&&z&&(typeof z==="object"||typeof z==="function")){if($)return L($,z)}else if(M){if(q)return q.delete(z)}return!1},get:function(z){if(O&&z&&(typeof z==="object"||typeof z==="function")){if($)return G($,z)}return q&&q.get(z)},has:function(z){if(O&&z&&(typeof z==="object"||typeof z==="function")){if($)return B($,z)}return!!q&&q.has(z)},set:function(z,H){if(O&&z&&(typeof z==="object"||typeof z==="function")){if(!$)$=new O;D($,z,H)}else if(M){if(!q)q=M();q.set(z,H)}}};return J}:M}),F3=_((c,K)=>{var w=V2(),P=b4(),h=P3(),M=dK(),S=E3(),O=S||M||h;K.exports=function(){var G,D={assert:function(B){if(!D.has(B))throw new w("Side channel does not contain "+P(B))},delete:function(B){return!!G&&G.delete(B)},get:function(B){return G&&G.get(B)},has:function(B){return!!G&&G.has(B)},set:function(B,L){if(!G)G=O();G.set(B,L)}};return D}}),T4=_((c,K)=>{var w=String.prototype.replace,P=/%20/g,h={RFC1738:"RFC1738",RFC3986:"RFC3986"};K.exports={default:h.RFC3986,formatters:{RFC1738:function(M){return w.call(M,P,"+")},RFC3986:function(M){return String(M)}},RFC1738:h.RFC1738,RFC3986:h.RFC3986}}),sK=_((c,K)=>{var w=T4(),P=Object.prototype.hasOwnProperty,h=Array.isArray,M=function(){var Q=[];for(var X=0;X<256;++X)Q.push("%"+((X<16?"0":"")+X.toString(16)).toUpperCase());return Q}(),S=function(Q){while(Q.length>1){var X=Q.pop(),W=X.obj[X.prop];if(h(W)){var V=[];for(var o=0;o<W.length;++o)if(typeof W[o]<"u")V.push(W[o]);X.obj[X.prop]=V}}},O=function(Q,X){var W=X&&X.plainObjects?{__proto__:null}:{};for(var V=0;V<Q.length;++V)if(typeof Q[V]<"u")W[V]=Q[V];return W},G=function Q(X,W,V){if(!W)return X;if(typeof W!=="object"&&typeof W!=="function"){if(h(X))X.push(W);else if(X&&typeof X==="object"){if(V&&(V.plainObjects||V.allowPrototypes)||!P.call(Object.prototype,W))X[W]=!0}else return[X,W];return X}if(!X||typeof X!=="object")return[X].concat(W);var o=X;if(h(X)&&!h(W))o=O(X,V);if(h(X)&&h(W))return W.forEach(function(U,r){if(P.call(X,r)){var k=X[r];if(k&&typeof k==="object"&&U&&typeof U==="object")X[r]=Q(k,U,V);else X.push(U)}else X[r]=U}),X;return Object.keys(W).reduce(function(U,r){var k=W[r];if(P.call(U,r))U[r]=Q(U[r],k,V);else U[r]=k;return U},o)},D=function(Q,X){return Object.keys(X).reduce(function(W,V){return W[V]=X[V],W},Q)},B=function(Q,X,W){var V=Q.replace(/\+/g," ");if(W==="iso-8859-1")return V.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(V)}catch(o){return V}},L=1024,$=function(Q,X,W,V,o){if(Q.length===0)return Q;var U=Q;if(typeof Q==="symbol")U=Symbol.prototype.toString.call(Q);else if(typeof Q!=="string")U=String(Q);if(W==="iso-8859-1")return escape(U).replace(/%u[0-9a-f]{4}/gi,function(cc){return"%26%23"+parseInt(cc.slice(2),16)+"%3B"});var r="";for(var k=0;k<U.length;k+=L){var A=U.length>=L?U.slice(k,k+L):U,u=[];for(var n=0;n<A.length;++n){var C=A.charCodeAt(n);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(n);continue}if(C<128){u[u.length]=M[C];continue}if(C<2048){u[u.length]=M[192|C>>6]+M[128|C&63];continue}if(C<55296||C>=57344){u[u.length]=M[224|C>>12]+M[128|C>>6&63]+M[128|C&63];continue}n+=1,C=65536+((C&1023)<<10|A.charCodeAt(n)&1023),u[u.length]=M[240|C>>18]+M[128|C>>12&63]+M[128|C>>6&63]+M[128|C&63]}r+=u.join("")}return r},q=function(Q){var X=[{obj:{o:Q},prop:"o"}],W=[];for(var V=0;V<X.length;++V){var o=X[V],U=o.obj[o.prop],r=Object.keys(U);for(var k=0;k<r.length;++k){var A=r[k],u=U[A];if(typeof u==="object"&&u!==null&&W.indexOf(u)===-1)X.push({obj:U,prop:A}),W.push(u)}}return S(X),Q},J=function(Q){return Object.prototype.toString.call(Q)==="[object RegExp]"},z=function(Q){if(!Q||typeof Q!=="object")return!1;return!!(Q.constructor&&Q.constructor.isBuffer&&Q.constructor.isBuffer(Q))},H=function(Q,X){return[].concat(Q,X)},b=function(Q,X){if(h(Q)){var W=[];for(var V=0;V<Q.length;V+=1)W.push(X(Q[V]));return W}return X(Q)};K.exports={arrayToObject:O,assign:D,combine:H,compact:q,decode:B,encode:$,isBuffer:z,isRegExp:J,maybeMap:b,merge:G}}),g3=_((c,K)=>{var w=F3(),P=sK(),h=T4(),M=Object.prototype.hasOwnProperty,S={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,Q){return b+"["+Q+"]"},repeat:function(b){return b}},O=Array.isArray,G=Array.prototype.push,D=function(b,Q){G.apply(b,O(Q)?Q:[Q])},B=Date.prototype.toISOString,L=h.default,$={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:L,formatter:h.formatters[L],indices:!1,serializeDate:function(b){return B.call(b)},skipNulls:!1,strictNullHandling:!1},q=function(b){return typeof b==="string"||typeof b==="number"||typeof b==="boolean"||typeof b==="symbol"||typeof b==="bigint"},J={},z=function b(Q,X,W,V,o,U,r,k,A,u,n,C,cc,Oc,wc,Dc,Hc,vc){var p=Q,jc=vc,Ec=0,y=!1;while((jc=jc.get(J))!==void 0&&!y){var Uc=jc.get(Q);if(Ec+=1,typeof Uc<"u")if(Uc===Ec)throw RangeError("Cyclic object value");else y=!0;if(typeof jc.get(J)>"u")Ec=0}if(typeof u==="function")p=u(X,p);else if(p instanceof Date)p=cc(p);else if(W==="comma"&&O(p))p=P.maybeMap(p,function(bc){if(bc instanceof Date)return cc(bc);return bc});if(p===null){if(U)return A&&!Dc?A(X,$.encoder,Hc,"key",Oc):X;p=""}if(q(p)||P.isBuffer(p)){if(A){var Zc=Dc?X:A(X,$.encoder,Hc,"key",Oc);return[wc(Zc)+"="+wc(A(p,$.encoder,Hc,"value",Oc))]}return[wc(X)+"="+wc(String(p))]}var d=[];if(typeof p>"u")return d;var Fc;if(W==="comma"&&O(p)){if(Dc&&A)p=P.maybeMap(p,A);Fc=[{value:p.length>0?p.join(",")||null:void 0}]}else if(O(u))Fc=u;else{var Qc=Object.keys(p);Fc=n?Qc.sort(n):Qc}var gc=k?String(X).replace(/\./g,"%2E"):String(X),Ac=V&&O(p)&&p.length===1?gc+"[]":gc;if(o&&O(p)&&p.length===0)return Ac+"[]";for(var l=0;l<Fc.length;++l){var s=Fc[l],T=typeof s==="object"&&s&&typeof s.value<"u"?s.value:p[s];if(r&&T===null)continue;var Mc=C&&k?String(s).replace(/\./g,"%2E"):String(s),Nc=O(p)?typeof W==="function"?W(Ac,Mc):Ac:Ac+(C?"."+Mc:"["+Mc+"]");vc.set(Q,Ec);var Xc=w();Xc.set(J,vc),D(d,b(T,Nc,W,V,o,U,r,k,W==="comma"&&Dc&&O(p)?null:A,u,n,C,cc,Oc,wc,Dc,Hc,Xc))}return d},H=function(b){if(!b)return $;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 Q=b.charset||$.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 X=h.default;if(typeof b.format<"u"){if(!M.call(h.formatters,b.format))throw TypeError("Unknown format option provided.");X=b.format}var W=h.formatters[X],V=$.filter;if(typeof b.filter==="function"||O(b.filter))V=b.filter;var o;if(b.arrayFormat in S)o=b.arrayFormat;else if("indices"in b)o=b.indices?"indices":"repeat";else o=$.arrayFormat;if("commaRoundTrip"in b&&typeof b.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");var U=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:$.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix==="boolean"?b.addQueryPrefix:$.addQueryPrefix,allowDots:U,allowEmptyArrays:typeof b.allowEmptyArrays==="boolean"?!!b.allowEmptyArrays:$.allowEmptyArrays,arrayFormat:o,charset:Q,charsetSentinel:typeof b.charsetSentinel==="boolean"?b.charsetSentinel:$.charsetSentinel,commaRoundTrip:!!b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?$.delimiter:b.delimiter,encode:typeof b.encode==="boolean"?b.encode:$.encode,encodeDotInKeys:typeof b.encodeDotInKeys==="boolean"?b.encodeDotInKeys:$.encodeDotInKeys,encoder:typeof b.encoder==="function"?b.encoder:$.encoder,encodeValuesOnly:typeof b.encodeValuesOnly==="boolean"?b.encodeValuesOnly:$.encodeValuesOnly,filter:V,format:X,formatter:W,serializeDate:typeof b.serializeDate==="function"?b.serializeDate:$.serializeDate,skipNulls:typeof b.skipNulls==="boolean"?b.skipNulls:$.skipNulls,sort:typeof b.sort==="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling==="boolean"?b.strictNullHandling:$.strictNullHandling}};K.exports=function(b,Q){var X=b,W=H(Q),V,o;if(typeof W.filter==="function")o=W.filter,X=o("",X);else if(O(W.filter))o=W.filter,V=o;var U=[];if(typeof X!=="object"||X===null)return"";var r=S[W.arrayFormat],k=r==="comma"&&W.commaRoundTrip;if(!V)V=Object.keys(X);if(W.sort)V.sort(W.sort);var A=w();for(var u=0;u<V.length;++u){var n=V[u],C=X[n];if(W.skipNulls&&C===null)continue;D(U,z(C,n,r,k,W.allowEmptyArrays,W.strictNullHandling,W.skipNulls,W.encodeDotInKeys,W.encode?W.encoder:null,W.filter,W.sort,W.allowDots,W.serializeDate,W.format,W.formatter,W.encodeValuesOnly,W.charset,A))}var cc=U.join(W.delimiter),Oc=W.addQueryPrefix===!0?"?":"";if(W.charsetSentinel)if(W.charset==="iso-8859-1")Oc+="utf8=%26%2310003%3B&";else Oc+="utf8=%E2%9C%93&";return cc.length>0?Oc+cc:""}}),k3=_((c,K)=>{var w=sK(),P=Object.prototype.hasOwnProperty,h=Array.isArray,M={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},S=function(J){return J.replace(/&#(\d+);/g,function(z,H){return String.fromCharCode(parseInt(H,10))})},O=function(J,z,H){if(J&&typeof J==="string"&&z.comma&&J.indexOf(",")>-1)return J.split(",");if(z.throwOnLimitExceeded&&H>=z.arrayLimit)throw RangeError("Array limit exceeded. Only "+z.arrayLimit+" element"+(z.arrayLimit===1?"":"s")+" allowed in an array.");return J},G="utf8=%26%2310003%3B",D="utf8=%E2%9C%93",B=function(J,z){var H={__proto__:null},b=z.ignoreQueryPrefix?J.replace(/^\?/,""):J;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var Q=z.parameterLimit===1/0?void 0:z.parameterLimit,X=b.split(z.delimiter,z.throwOnLimitExceeded?Q+1:Q);if(z.throwOnLimitExceeded&&X.length>Q)throw RangeError("Parameter limit exceeded. Only "+Q+" parameter"+(Q===1?"":"s")+" allowed.");var W=-1,V,o=z.charset;if(z.charsetSentinel){for(V=0;V<X.length;++V)if(X[V].indexOf("utf8=")===0){if(X[V]===D)o="utf-8";else if(X[V]===G)o="iso-8859-1";W=V,V=X.length}}for(V=0;V<X.length;++V){if(V===W)continue;var U=X[V],r=U.indexOf("]="),k=r===-1?U.indexOf("="):r+1,A,u;if(k===-1)A=z.decoder(U,M.decoder,o,"key"),u=z.strictNullHandling?null:"";else A=z.decoder(U.slice(0,k),M.decoder,o,"key"),u=w.maybeMap(O(U.slice(k+1),z,h(H[A])?H[A].length:0),function(C){return z.decoder(C,M.decoder,o,"value")});if(u&&z.interpretNumericEntities&&o==="iso-8859-1")u=S(String(u));if(U.indexOf("[]=")>-1)u=h(u)?[u]:u;var n=P.call(H,A);if(n&&z.duplicates==="combine")H[A]=w.combine(H[A],u);else if(!n||z.duplicates==="last")H[A]=u}return H},L=function(J,z,H,b){var Q=0;if(J.length>0&&J[J.length-1]==="[]"){var X=J.slice(0,-1).join("");Q=Array.isArray(z)&&z[X]?z[X].length:0}var W=b?z:O(z,H,Q);for(var V=J.length-1;V>=0;--V){var o,U=J[V];if(U==="[]"&&H.parseArrays)o=H.allowEmptyArrays&&(W===""||H.strictNullHandling&&W===null)?[]:w.combine([],W);else{o=H.plainObjects?{__proto__:null}:{};var r=U.charAt(0)==="["&&U.charAt(U.length-1)==="]"?U.slice(1,-1):U,k=H.decodeDotInKeys?r.replace(/%2E/g,"."):r,A=parseInt(k,10);if(!H.parseArrays&&k==="")o={0:W};else if(!isNaN(A)&&U!==k&&String(A)===k&&A>=0&&(H.parseArrays&&A<=H.arrayLimit))o=[],o[A]=W;else if(k!=="__proto__")o[k]=W}W=o}return W},$=function(J,z,H,b){if(!J)return;var Q=H.allowDots?J.replace(/\.([^.[]+)/g,"[$1]"):J,X=/(\[[^[\]]*])/,W=/(\[[^[\]]*])/g,V=H.depth>0&&X.exec(Q),o=V?Q.slice(0,V.index):Q,U=[];if(o){if(!H.plainObjects&&P.call(Object.prototype,o)){if(!H.allowPrototypes)return}U.push(o)}var r=0;while(H.depth>0&&(V=W.exec(Q))!==null&&r<H.depth){if(r+=1,!H.plainObjects&&P.call(Object.prototype,V[1].slice(1,-1))){if(!H.allowPrototypes)return}U.push(V[1])}if(V){if(H.strictDepth===!0)throw RangeError("Input depth exceeded depth option of "+H.depth+" and strictDepth is true");U.push("["+Q.slice(V.index)+"]")}return L(U,z,H,b)},q=function(J){if(!J)return M;if(typeof J.allowEmptyArrays<"u"&&typeof J.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof J.decodeDotInKeys<"u"&&typeof J.decodeDotInKeys!=="boolean")throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(J.decoder!==null&&typeof J.decoder<"u"&&typeof J.decoder!=="function")throw TypeError("Decoder has to be a function.");if(typeof J.charset<"u"&&J.charset!=="utf-8"&&J.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof J.throwOnLimitExceeded<"u"&&typeof J.throwOnLimitExceeded!=="boolean")throw TypeError("`throwOnLimitExceeded` option must be a boolean");var z=typeof J.charset>"u"?M.charset:J.charset,H=typeof J.duplicates>"u"?M.duplicates:J.duplicates;if(H!=="combine"&&H!=="first"&&H!=="last")throw TypeError("The duplicates option must be either combine, first, or last");var b=typeof J.allowDots>"u"?J.decodeDotInKeys===!0?!0:M.allowDots:!!J.allowDots;return{allowDots:b,allowEmptyArrays:typeof J.allowEmptyArrays==="boolean"?!!J.allowEmptyArrays:M.allowEmptyArrays,allowPrototypes:typeof J.allowPrototypes==="boolean"?J.allowPrototypes:M.allowPrototypes,allowSparse:typeof J.allowSparse==="boolean"?J.allowSparse:M.allowSparse,arrayLimit:typeof J.arrayLimit==="number"?J.arrayLimit:M.arrayLimit,charset:z,charsetSentinel:typeof J.charsetSentinel==="boolean"?J.charsetSentinel:M.charsetSentinel,comma:typeof J.comma==="boolean"?J.comma:M.comma,decodeDotInKeys:typeof J.decodeDotInKeys==="boolean"?J.decodeDotInKeys:M.decodeDotInKeys,decoder:typeof J.decoder==="function"?J.decoder:M.decoder,delimiter:typeof J.delimiter==="string"||w.isRegExp(J.delimiter)?J.delimiter:M.delimiter,depth:typeof J.depth==="number"||J.depth===!1?+J.depth:M.depth,duplicates:H,ignoreQueryPrefix:J.ignoreQueryPrefix===!0,interpretNumericEntities:typeof J.interpretNumericEntities==="boolean"?J.interpretNumericEntities:M.interpretNumericEntities,parameterLimit:typeof J.parameterLimit==="number"?J.parameterLimit:M.parameterLimit,parseArrays:J.parseArrays!==!1,plainObjects:typeof J.plainObjects==="boolean"?J.plainObjects:M.plainObjects,strictDepth:typeof J.strictDepth==="boolean"?!!J.strictDepth:M.strictDepth,strictNullHandling:typeof J.strictNullHandling==="boolean"?J.strictNullHandling:M.strictNullHandling,throwOnLimitExceeded:typeof J.throwOnLimitExceeded==="boolean"?J.throwOnLimitExceeded:!1}};K.exports=function(J,z){var H=q(z);if(J===""||J===null||typeof J>"u")return H.plainObjects?{__proto__:null}:{};var b=typeof J==="string"?B(J,H):J,Q=H.plainObjects?{__proto__:null}:{},X=Object.keys(b);for(var W=0;W<X.length;++W){var V=X[W],o=$(V,b[V],H,typeof J==="string");Q=w.merge(Q,o,H)}if(H.allowSparse===!0)return Q;return w.compact(Q)}}),R3=_((c,K)=>{var w=g3(),P=k3(),h=T4();K.exports={formats:h,parse:P,stringify:w}}),i1=S4(e4(),1),x3={};c3(x3,{zodSchemaKey:()=>r3,webSocketServerArgsKey:()=>I2,webSocketMessageArgsKey:()=>d2,webSocketKey:()=>h4,webSocketEventKey:()=>o3,webSocketEventArgumentsKey:()=>Z3,webSocketConnectionArgsKey:()=>D2,webSocketCloseReasonArgsKey:()=>P6,webSocketCloseCodeArgsKey:()=>w6,routeModelArgsKey:()=>mc,responseStatusTextArgsKey:()=>M6,responseStatusArgsKey:()=>a2,responseHeadersArgsKey:()=>oc,responseBodyArgsKey:()=>s2,requestHeadersArgsKey:()=>K2,requestHeaderArgsKey:()=>ec,requestBodyArgsKey:()=>G2,requestArgsKey:()=>pc,queryArgsKey:()=>h6,paramsArgsKey:()=>y4,paramArgsKey:()=>j2,moduleKey:()=>t2,middlewareKey:()=>K6,interceptorKey:()=>n4,injectableKey:()=>c6,injectKey:()=>P4,httpServerArgsKey:()=>fc,guardKey:()=>aK,controllerKey:()=>w4,controllerHttpKey:()=>A3,contextArgsKey:()=>w2,containerKey:()=>N2,configKey:()=>C4,argumentsKey:()=>Yc});var Yc=Symbol("__bool:arguments__"),Z3=Symbol("__bool:webSocketEventArguments__"),C4=Symbol("__bool:config__"),w4=Symbol("__bool:controller__"),n4=Symbol("__bool:interceptor__"),aK=Symbol("__bool:guard__"),A3=Symbol("__bool:controller.http__"),P4=Symbol("__bool:inject__"),c6=Symbol("__bool:injectable__"),K6=Symbol("__bool:middleware__"),t2=Symbol("__bool:module__"),N2=Symbol("__bool:container__"),r3=Symbol("__bool:zodSchema__"),h4=Symbol("__bool:webSocket__"),o3=Symbol("__bool:webSocket:event__"),I2=Symbol("__bool:webSocketArguments:server__"),D2=Symbol("__bool:webSocketArguments:connection__"),d2=Symbol("__bool:webSocketArguments:message__"),w6=Symbol("__bool:webSocketArguments:closeCode__"),P6=Symbol("__bool:webSocketArguments:closeReason__"),fc=Symbol("__bool:httpArguments:server__"),K2=Symbol("__bool:httpArguments:requestHeaders__"),ec=Symbol("__bool:httpArguments:requestHeader__"),G2=Symbol("__bool:httpArguments:requestBody__"),y4=Symbol("__bool:httpArguments:params__"),j2=Symbol("__bool:httpArguments:param__"),h6=Symbol("__bool:httpArguments:query__"),pc=Symbol("__bool:httpArguments:request__"),oc=Symbol("__bool:httpArguments:responseHeaders__"),w2=Symbol("__bool:httpArguments:context__"),mc=Symbol("__bool:httpArguments:routeModel__"),s2=Symbol("__bool:httpArguments:responseBody__"),a2=Symbol("__bool:httpArguments:responseStatus__"),M6=Symbol("__bool:httpArguments:responseStatusText__"),S6=(c)=>(K,w,P)=>{if(!w)return;let h=Reflect.getOwnMetadata(Yc,K.constructor,w)||{};h[`argumentIndexes.${P}`]={index:P,type:K2,validationSchema:c},Reflect.defineMetadata(Yc,h,K.constructor,w)};var J4=(c)=>(K,w,P)=>{if(!w)return;let h=Reflect.getOwnMetadata(Yc,K.constructor,w)||{};h[`argumentIndexes.${P}`]={index:P,type:w2,key:c},Reflect.defineMetadata(Yc,h,K.constructor,w)},b6=()=>(c,K,w)=>{if(!K)return;let P=Reflect.getOwnMetadata(Yc,c.constructor,K)||{};P[`argumentIndexes.${w}`]={index:w,type:mc},Reflect.defineMetadata(Yc,P,c.constructor,K)};var O6=(c)=>(K,w,P)=>{let h=Reflect.getMetadata(P4,K)||[];h[P]=c,Reflect.defineMetadata(P4,h,K)};var J6=()=>(c)=>{Reflect.defineMetadata(n4,void 0,c)};var t1=Symbol("__bool:webSocket.upgrade__");var m3=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()?m3[c]:w.trim(),this.data=K}}var u3=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 i4 extends Error{httpCode;message;data;constructor({httpCode:c,data:K,message:w}){super();this.httpCode=c,this.message=!w?.trim()?u3[c]:w.trim(),this.data=K}}var C3=(c,K=new Headers)=>{if(K.set("Content-Type","application/json"),c instanceof P2||c instanceof i4)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})},kc;(function(c){c.year="year",c.month="month",c.day="day",c.hours="hours",c.minutes="minutes",c.seconds="seconds",c.miliseconds="miliseconds"})(kc||(kc={}));var y3=(c,K,w=kc.day)=>{let P=c instanceof Date?c:new Date(c);switch(w){case kc.year:P.setFullYear(P.getFullYear()+K);break;case kc.month:P.setMonth(P.getMonth()+K);break;case kc.day:P.setDate(P.getDate()+K);break;case kc.hours:P.setHours(P.getHours()+K);break;case kc.minutes:P.setMinutes(P.getMinutes()+K);break;case kc.seconds:P.setSeconds(P.getSeconds()+K);break;case kc.miliseconds:P.setMilliseconds(P.getMilliseconds()+K);break}return P},_3=S4(R3(),1),d1=async function(){}.constructor,_K=Object.freeze({black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37,gray:90}),fK=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:h,underline:M}=K,S="";if(h)S+="\x1B[1m";if(M)S+="\x1B[4m";if(w&&_K[w])S+=`\x1B[${_K[w]}m`;if(P&&fK[P])S+=`\x1B[${fK[P]}m`;return`${S}${c}\x1B[0m`},f3=(c)=>{let{headers:K,method:w}=c,P=K.get("upgrade")?.toLowerCase()||"",h=K.get("connection")?.toLowerCase()||"";return w==="GET"&&P?.toLowerCase()==="websocket"&&h?.toLowerCase().includes("upgrade")};class c4{_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 lc{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("/"),h=this._thinAlias(c).split("/");if(!w)return;if(P.length!==h.length)return;let M=Object(),S=this.alias.replace(new RegExp(lc.rootPattern,"g"),lc.innerRootPattern);if(!new RegExp(S).test(this._thinAlias(c)))return;for(let O=0;O<P.length;O++){let G=P[O],D=h[O];if(!new RegExp(lc.rootPattern,"g").test(G)){if(G!==D)return}else{let B=!1;if(G.replace(new RegExp(lc.rootPattern,"g"),(L,$,q)=>{if(q===0)D.replace(new RegExp(lc.innerRootPattern,"g"),(J,z,H)=>{if(H===0)Object.assign(M,{[$]:J});return J});return L}),B)return}continue}return Object.freeze({parameters:M,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 h=Object();for(let M=0;M<w.length;M++){let S=w[M],O=P[M];if(!new RegExp(lc.rootPattern,"g").test(S)){if(S!==O)return!1}else{let G=!1;if(S.replace(new RegExp(lc.rootPattern,"g"),(D,B,L)=>{if(!new RegExp(L,"g").test(O))G=!0;else Object.assign(h,{[B]:O});return""}),G)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,h)=>`${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,h)=>"(.*?)")}return c.replace(w,(P,h,M)=>M)}).join("/")}}var e3=lc;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 e3(`${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 h=P.test(c,K);if(!h)continue;return h}return}}var s1=S4(e4(),1);class K4{_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(![c6,w4,K6,aK,n4,h4].some((h)=>K.includes(h)))throw Error("Missing dependency declaration, please check @Injectable() used on dependency(ies).");let w=(Reflect.getOwnMetadata(P4,c)||[]).map((h)=>this.get(h)),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 W6{error;constructor(c){this.error=c}}var p3=W6;class N6{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 t4{rawAlias;alias;routes=[];constructor(c="/"){this.rawAlias=c,this.alias=t4.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 M4{rawPrefix;prefix;routers=[];constructor(c="/"){this.rawPrefix=c,this.prefix=M4.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,h]of w.entries())c.set(`/${M4.thinPrefix(`${this.prefix}/${P}`)}`,h)}return c}static thinPrefix(c){return c.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class l3{classConstructor;options;#c;#K;#w=new K4;#P=new Map;#M;#S=900;#h;constructor(c,K){if(this.classConstructor=c,this.options=K,this.#K=Reflect.getOwnMetadataKeys(c),!this.#K.includes(N2)&&!this.#K.includes(t2))throw Error(`Can not detect! ${c.name} class is not a container or module.`);this.#S=typeof K.static?.cacheTimeInSeconds!=="number"?900:K.static.cacheTimeInSeconds,this.#M=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.#h=c}async preLaunch(){if(this.#c)return this.#c;let c=!this.#K.includes(N2)?void 0:Reflect.getOwnMetadata(N2,this.classConstructor),K=!this.#K.includes(N2)?[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((S)=>this.moduleResolution({moduleClass:S,options:this.options,extendInjector:!w?this.#w:w.injector})));if([...new Set(P.map((S)=>S.prefix))].length!==P.length)throw Error("Module prefix should be unique.");let h=new Map;for(let S of P){let O=S.webSocketRouterGroup.execute();for(let[G,D]of O.entries())h.set(G,D)}let M=Object.freeze({containerMetadata:c,modulesConverted:K,resolutedContainer:w,resolutedModules:P,webSocketsMap:h});return this.#c=M,M}async listen(){let{allowLogsMethods:c,allowOrigins:K,allowMethods:w,allowHeaders:P,allowCredentials:h,staticOption:M}=this.#M,{resolutedContainer:S,resolutedModules:O,webSocketsMap:G}=await this.preLaunch(),D=Bun.serve({port:this.options.port,fetch:async(B,L)=>{let $=performance.now(),q=new URL(B.url),J=_3.parse(q.searchParams.toString(),this.options.queryParser),z=B.headers.get("origin")||"*",H=B.method.toUpperCase(),b=new Headers,Q=new c4().setOptions({isStatic:!0}).set(fc,L).set(pc,B).set(ec,B.headers).set(oc,b).set(h6,J);try{let X=f3(B),W;if(X){for(let A of O){let u=A.webSocketHttpRouterGroup.find(q.pathname,B.method);if(u){W=Object.freeze({route:u,resolution:A});break}}if(!W)return this.finalizeResponse(new Response(JSON.stringify({httpCode:404,message:"Route not found",data:void 0}),{status:404,statusText:"Not found.",headers:b}));let k=await this.webSocketFetcher({request:B,server:L},{query:J,responseHeaders:b,route:W.route,moduleResolution:W.resolution});return k instanceof Response?k:void 0}if([...!h?[]:[{key:"Access-Control-Allow-Credentials",value:"true"}],{key:"Access-Control-Allow-Origin",value:K.includes("*")?"*":!K.includes(z)?K[0]:z},{key:"Access-Control-Allow-Methods",value:w.join(", ")},{key:"Access-Control-Allow-Headers",value:P.join(", ")}].forEach(({key:k,value:A})=>b.set(k,A)),!w.includes(H))return this.finalizeResponse(new Response(void 0,{status:405,statusText:"Method Not Allowed.",headers:b}));if(B.method.toUpperCase()==="OPTIONS")return this.finalizeResponse(K.includes("*")||K.includes(z)?new Response(void 0,{status:204,statusText:"No Content.",headers:b}):new Response(void 0,{status:417,statusText:"Expectation Failed.",headers:b}));if(M){let{path:k,headers:A}=M,u=`${k}/${q.pathname}`,n=this.#P.get(u);if(!n){let C=Bun.file(u);if(await C.exists()){if(A)for(let[cc,Oc]of Object.entries(A))b.set(cc,Oc);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>n.expiredAt;if(C)this.#P.delete(u);let cc=!C?n.file:Bun.file(u);if(await cc.exists()){if(this.#P.set(u,Object.freeze({expiredAt:y3(new Date,this.#S,kc.seconds),file:cc})),A)for(let[Oc,wc]of Object.entries(A))b.set(Oc,wc);return b.set("Content-Type",cc.type),this.finalizeResponse(new Response(await cc.arrayBuffer(),{status:200,statusText:"SUCCESS",headers:b}))}}}if(S){let{context:k}=await this.httpFetcher({context:Q,resolutedMap:{injector:S.injector,startMiddlewareGroup:S.startMiddlewareGroup,guardGroup:S.guardGroup},options:{isContainer:!0}});Q=k}for(let k of O){let A=k.controllerRouterGroup.find(q.pathname,H);if(A){W=Object.freeze({route:A,resolution:k});break}}if(!W)Q.setOptions({isStatic:!1}).set(a2,404).set(M6,"Not found.").set(s2,{httpCode:404,message:"Route not found",data:void 0});else{let{context:k}=await this.httpFetcher({context:Q,route:W.route,resolutedMap:W.resolution});Q=k}if(S){let{context:k}=await this.httpFetcher({context:Q,resolutedMap:{injector:S.injector,endMiddlewareGroup:S.endMiddlewareGroup},options:{isContainer:!0}});Q=k}let V=Q.get(oc,{isStatic:!0})||new Headers,o=Q.get(s2,{isStatic:!1})||void 0,U=Q.get(a2,{isStatic:!1}),r=Q.get(a2,{isStatic:!1});return this.serializeResponse({status:typeof U!=="number"?void 0:U,statusText:typeof r!=="string"?void 0:r,headers:V,data:o})}catch(X){return this.options.debug&&console.error(X),this.finalizeResponse(C3(X,b))}finally{if(c){let X=performance.now(),W=c2(q.pathname,{color:"blue"}),V=`${Bun.color("yellow","ansi")}${process.pid}`,o=c2(B.method,{color:"yellow",backgroundColor:"blue"}),U=c2(`${B.headers.get("x-forwarded-for")||B.headers.get("x-real-ip")||L.requestIP(B)?.address||"<Unknown>"}`,{color:"yellow"}),r=c2(`${Math.round((X-$+Number.EPSILON)*100)/100}ms`,{color:"yellow",backgroundColor:"blue"});c.includes(B.method.toUpperCase())&&console.info(`PID: ${V} - Method: ${o} - IP: ${U} - ${W} - Time: ${r}`)}}},websocket:{open:(B)=>{let L=`${B.data.pathname}:::open`,$=G.get(L);if(!$)return;let q=$.arguments||{},J=[];for(let[z,H]of Object.entries(q))switch(H.type){case D2:J[H.index]=B;break;case I2:J[H.index]=D;break}$.descriptor.value(...J)},close:(B,L,$)=>{let q=`${B.data.pathname}:::close`,J=G.get(q);if(!J)return;let z=J.arguments||{},H=[];for(let[b,Q]of Object.entries(z))switch(Q.type){case D2:H[Q.index]=B;break;case I2:H[Q.index]=D;break;case w6:H[Q.index]=L;break;case P6:H[Q.index]=$;break}J.descriptor.value(...H)},message:(B,L)=>{let $=`${B.data.pathname}:::message`,q=G.get($);if(!q)return;let J=q.arguments||{},z=[];for(let[H,b]of Object.entries(J))switch(b.type){case D2:z[b.index]=B;break;case d2:z[b.index]=L;break;case I2:z[b.index]=D;break}q.descriptor.value(...z)},drain:(B)=>{let L=`${B.data.pathname}:::drain`,$=G.get(L);if(!$)return;let q=$.arguments||{},J=[];for(let[z,H]of Object.entries(q))switch(H.type){case D2:J[H.index]=B;break;case I2:J[H.index]=D;break}$.descriptor.value(...J)},ping:(B,L)=>{let $=`${B.data.pathname}:::ping`,q=G.get($);if(!q)return;let J=q.arguments||{},z=[];for(let[H,b]of Object.entries(J))switch(b.type){case D2:z[b.index]=B;break;case I2:z[b.index]=D;break;case d2:z[b.index]=L;break}q.descriptor.value(...z)},pong:(B,L)=>{let $=`${B.data.pathname}:::pong`,q=G.get($);if(!q)return;let J=q.arguments||{},z=[];for(let[H,b]of Object.entries(J))switch(b.type){case D2:z[b.index]=B;break;case I2:z[b.index]=D;break;case d2:z[b.index]=L;break}q.descriptor.value(...z)}}})}async containerResolution({containerClass:c,options:K,extendInjector:w}){if(!Reflect.getOwnMetadataKeys(c).includes(N2))throw Error(`${c.name} is not a container.`);let P=new K4(w),h=Reflect.getOwnMetadata(N2,c),{loaders:M,middlewares:S,guards:O,dependencies:G,config:D}=h||{},{config:B}=Object.freeze({config:{...typeof K.config!=="function"?K.config:await K.config(),...typeof D!=="function"?typeof D!=="object"?void 0:("key"in D)&&("value"in D)&&typeof D.key==="symbol"?typeof D.value!=="function"?D.value:await D.value():D:await D()}});if(P.set(D&&"key"in D&&"value"in D&&typeof D.key==="symbol"?D.key:C4,B),M){let J=[];for(let[H,b]of Object.entries(M))J.push(async()=>{try{let Q=await b({config:B});return console.info(`${c2(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${H}] initialized successfully.`),Q}catch(Q){throw console.error(`${c2(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${H}] initialization failed.`),K.debug&&console.error(Q),Q}});let z=await Promise.all(J.map((H)=>H()));for(let[H,b]of z)P.set(H,b)}!G||G.map((J)=>P.get(J));let L=[],$=[];!S||S.forEach((J)=>{let z=P.get(J);if(z.start&&typeof z.start==="function"){let H=Reflect.getOwnMetadata(Yc,J,"start")||{};L.push(Object.freeze({class:J,funcName:"start",func:z.start.bind(z),argumentsMetadata:H}))}if(z.end&&typeof z.end==="function"){let H=Reflect.getOwnMetadata(Yc,J,"end")||{};$.push(Object.freeze({class:J,funcName:"end",func:z.end.bind(z),argumentsMetadata:H}))}});let q=!O?[]:O.map((J)=>{let z=P.get(J),H=Reflect.getOwnMetadata(Yc,J,"enforce")||{};return Object.freeze({class:J,funcName:"enforce",func:z.enforce.bind(z),argumentsMetadata:H})});return Object.freeze({injector:P,startMiddlewareGroup:L,endMiddlewareGroup:$,guardGroup:q})}async moduleResolution({moduleClass:c,options:K,extendInjector:w}){if(!Reflect.getOwnMetadataKeys(c).includes(t2))throw Error(`${c.name} is not a module.`);let P=new K4(w),h=Reflect.getOwnMetadata(t2,c),{loaders:M,middlewares:S,guards:O,interceptors:G,controllers:D,dependencies:B,webSockets:L,prefix:$,config:q}=h||{},J=`${K.prefix||""}/${$||""}`,{config:z}=Object.freeze({config:{...typeof K.config!=="function"?K.config:await K.config(),...typeof q!=="function"?typeof q!=="object"?void 0:("key"in q)&&("value"in q)&&typeof q.key==="symbol"?typeof q.value!=="function"?q.value:await q.value():q:await q()}});if(P.set(q&&"key"in q&&"value"in q&&typeof q.key==="symbol"?q.key:C4,z),M){let r=[];for(let[A,u]of Object.entries(M))r.push(async()=>{try{let n=await u({config:z});return console.info(`${c2(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${A}] initialized successfully.`),n}catch(n){throw console.error(`${c2(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${A}] initialization failed.`),K.debug&&console.error(n),n}});let k=await Promise.all(r.map((A)=>A()));for(let A=0;A<k.length;A++){let[u,n]=k[A];P.set(u,n)}}!B||B.map((r)=>P.get(r));let H=[],b=[];!S||S.forEach((r)=>{let k=P.get(r);if(k.start&&typeof k.start==="function"){let A=Reflect.getOwnMetadata(Yc,r,"start")||{};H.push(Object.freeze({class:r,funcName:"start",func:k.start.bind(k),argumentsMetadata:A}))}if(k.end&&typeof k.end==="function"){let A=Reflect.getOwnMetadata(Yc,r,"end")||{};b.push(Object.freeze({class:r,funcName:"end",func:k.end.bind(k),argumentsMetadata:A}))}});let Q=!O?[]:O.map((r)=>{let k=P.get(r),A=Reflect.getOwnMetadata(Yc,r,"enforce")||{};return Object.freeze({class:r,funcName:"enforce",func:k.enforce.bind(k),argumentsMetadata:A})}),X=[],W=[];!G||G.forEach((r)=>{let k=P.get(r);if(k.open&&typeof k.open==="function"){let A=Reflect.getOwnMetadata(Yc,r,"open")||{};X.push(Object.freeze({class:r,funcName:"open",func:k.open.bind(k),argumentsMetadata:A}))}if(k.close&&typeof k.close==="function"){let A=Reflect.getOwnMetadata(Yc,r,"close")||{};W.push(Object.freeze({class:r,funcName:"close",func:k.close.bind(k),argumentsMetadata:A}))}});let V=new f4;!D||D.forEach((r)=>this.initControllerInstance({controllerConstructor:r,httpRouterGroup:V,injector:P,prefix:J}));let o=new f4,U=new M4;return L&&L.forEach((r)=>this.initWebSocketInstance({webSocketConstructor:r,httpRouterGroup:o,webSocketRouterGroup:U,injector:P,prefix:J})),Object.freeze({prefix:$||"",injector:P,startMiddlewareGroup:H,endMiddlewareGroup:b,guardGroup:Q,openInterceptorGroup:X,closeInterceptorGroup:W,controllerRouterGroup:V,webSocketHttpRouterGroup:o,webSocketRouterGroup:U})}async argumentsResolution(c,K,w,P){if(!this.#h)return c;try{let h=await this.#h.validate(c,K,w,P);if(!(h instanceof p3))return h;throw new P2({httpCode:400,message:`Validation at the [${P.toString()}] method fails at positional argument [${w}].`,data:h.error})}catch(h){if(h instanceof P2)throw h;throw new i4({httpCode:500,message:`Validation at the [${P.toString()}] method error at positional argument [${w}].`,data:!(h instanceof Error)?h:[{message:h.message,code:h.name,cause:h.cause}]})}}initControllerInstance({controllerConstructor:c,httpRouterGroup:K,injector:w,prefix:P}){if(!Reflect.getOwnMetadataKeys(c).includes(w4))throw Error(`${c.name} is not a controller.`);let h=w.get(c);if(!h)throw Error("Can not initialize controller.");let M=Reflect.getOwnMetadata(w4,c)||{prefix:"/",httpMetadata:[]},S=new _4(`/${P||""}/${M.prefix}`);return M.httpMetadata.forEach((O)=>{if(typeof O.descriptor.value!=="function")return;let G=S.route(O.path),D=O.descriptor.value.bind(h),B=Object.freeze({class:c,funcName:O.methodName,func:D,argumentsMetadata:O.argumentsMetadata});switch(O.httpMethod){case"GET":return G.get(B);case"POST":return G.post(B);case"PUT":return G.put(B);case"PATCH":return G.patch(B);case"DELETE":return G.delete(B);case"OPTIONS":return G.options(B)}}),K.add(S)}initWebSocketInstance({injector:c,httpRouterGroup:K,prefix:w,webSocketRouterGroup:P,webSocketConstructor:h}){if(!Reflect.getOwnMetadataKeys(h).includes(h4))throw Error(`${h.name} is not a websocket route.`);let M=c.get(h);if(!M)throw Error("Can not initialize webSocket.");let S=Reflect.getOwnMetadata(h4,h)||{prefix:"/",events:[],http:[]},O=`/${w||""}/${S.prefix}`,G=new _4(O);for(let[B,L]of Object.entries(S.http)){if(typeof L.descriptor?.value!=="function")continue;let $=G.route(L.path),q=L.descriptor.value.bind(M),J=Object.freeze({class:h,funcName:L.methodName,func:q,argumentsMetadata:L.argumentsMetadata});switch(L.httpMethod){case"GET":$.get(J);break;case"POST":$.post(J);break}}K.add(G);let D=new t4(O);for(let[B,L]of Object.entries(S.events)){let $=new N6({eventName:B,metadata:L});D.addRoutes($)}return D.bind(M),P.addRouters(D),Object.freeze({httpRouterGroup:K,webSocketRouterGroup:P})}serializeResponse({status:c,statusText:K,headers:w,data:P}){let h=w.get("Content-Type")||"text/plain";if(h.includes("application/json"))return this.finalizeResponse(new Response(P instanceof ReadableStream?P:JSON.stringify(P),{status:c,statusText:K,headers:w}));if(h.includes("text/plain")||h.includes("text/html"))return this.finalizeResponse(new Response(P instanceof ReadableStream?P:String(P),{status:c,statusText:K,headers:w}));if(h.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(h.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 h={isStatic:!0},M=(!c?new c4:new c4(c)).setOptions(h);if(K)M.set(y4,K.parameters).set(mc,K.model);let S=M.get(fc,h)||void 0,O=M.get(pc,h)||void 0,G=M.get(ec,h)||void 0,D=M.get(oc,h)||void 0,B=M.get(y4,h)||void 0,L=M.get(mc,h)||void 0;if(P){let{startMiddlewareGroup:$,guardGroup:q}=P;if($)for(let J=0;J<$.length;J++){let z=[],{func:H,funcName:b,argumentsMetadata:Q}=$[J];for(let[X,W]of Object.entries(Q))switch(W.type){case w2:z[W.index]=!W.key?M:M.get(W.key,h);break;case pc:z[W.index]=!W.validationSchema?O:await this.argumentsResolution(O,W.validationSchema,W.index,b);break;case G2:z[W.index]=!W.validationSchema?await O?.[W.parser||"json"]():await this.argumentsResolution(await O?.[W.parser||"json"](),W.validationSchema,W.index,b);break;case K2:z[W.index]=!W.validationSchema?G:await this.argumentsResolution(G?.toJSON(),W.validationSchema,W.index,b);break;case ec:z[W.index]=!W.validationSchema?G?.get(W.key)||void 0:await this.argumentsResolution(G?.get(W.key)||void 0,W.validationSchema,W.index,b);break;case j2:z[W.index]=!W.validationSchema?B?.[W.key]||void 0:await this.argumentsResolution(B?.[W.key]||void 0,W.validationSchema,W.index,b);break;case mc:z[W.index]=L;break;case oc:z[W.index]=D;break;case fc:z[W.index]=S;break;default:z[W.index]=!W.validationSchema?!M.has(W.type,h)?void 0:M.get(W.type,h):await this.argumentsResolution(!(W.type in M)?void 0:M.get(W.type,h),W.validationSchema,W.index,b);break}await H(...z)}if(q)for(let J=0;J<q.length;J++){let z=[],{func:H,funcName:b,argumentsMetadata:Q}=q[J];for(let[W,V]of Object.entries(Q))switch(V.type){case pc:z[V.index]=!V.validationSchema?O:await this.argumentsResolution(O,V.validationSchema,V.index,b);break;case G2:z[V.index]=!V.validationSchema?await O?.[V.parser||"json"]():await this.argumentsResolution(await O?.[V.parser||"json"](),V.validationSchema,V.index,b);break;case w2:z[V.index]=!V.key?M:M.get(V.key);break;case K2:z[V.index]=!V.validationSchema?G:await this.argumentsResolution(G?.toJSON(),V.validationSchema,V.index,b);break;case oc:z[V.index]=D;break;case ec:z[V.index]=!V.validationSchema?G?.get(V.key)||void 0:await this.argumentsResolution(G?.get(V.key)||void 0,V.validationSchema,V.index,b);break;case j2:z[V.index]=!V.validationSchema?B?.[V.key]||void 0:await this.argumentsResolution(B?.[V.key],V.validationSchema,V.index,b);break;case mc:z[V.index]=L;break;case fc:z[V.index]=S;break;default:z[V.index]=!V.validationSchema?!M.has(V.type)?void 0:M.get(V.type):await this.argumentsResolution(M.get(V.type),V.validationSchema,V.index,b);break}let X=await H(...z);if(typeof X!=="boolean"||!X)throw new P2({httpCode:401,message:"Unauthorization.",data:void 0})}}if(L&&!w?.isContainer){if(P&&"openInterceptorGroup"in P&&P.openInterceptorGroup){let{openInterceptorGroup:H}=P;for(let b=0;b<H.length;b++){let Q=[],{func:X,funcName:W,argumentsMetadata:V}=H[b];for(let[o,U]of Object.entries(V))switch(U.type){case pc:Q[U.index]=!U.validationSchema?O:await this.argumentsResolution(O,U.validationSchema,U.index,W);break;case G2:Q[U.index]=!U.validationSchema?await O?.[U.parser||"json"]():await this.argumentsResolution(await O?.[U.parser||"json"](),U.validationSchema,U.index,W);break;case w2:Q[U.index]=!U.key?M:M.get(U.key);break;case K2:Q[U.index]=!U.validationSchema?G:await this.argumentsResolution(G?.toJSON(),U.validationSchema,U.index,W);break;case ec:Q[U.index]=!U.validationSchema?G?.get(U.key)||void 0:await this.argumentsResolution(G?.get(U.key)||void 0,U.validationSchema,U.index,W);break;case oc:Q[U.index]=D;break;case j2:Q[U.index]=!U.validationSchema?B?.[U.key]||void 0:await this.argumentsResolution(B?.[U.key]||void 0,U.validationSchema,U.index,W);break;case mc:Q[U.index]=L;break;case fc:Q[U.index]=S;break;default:Q[U.index]=!U.validationSchema?!M.has(U.type)?void 0:M.get(U.type):await this.argumentsResolution(M.get(U.type),U.validationSchema,U.index,W);break}await X(...Q)}}let $=[],{func:q,funcName:J,argumentsMetadata:z}=L;for(let[H,b]of Object.entries(z))switch(b.type){case pc:$[b.index]=!b.validationSchema?O:await this.argumentsResolution(O,b.validationSchema,b.index,J);break;case G2:$[b.index]=!b.validationSchema?await O?.[b.parser||"json"]():await this.argumentsResolution(await O?.[b.parser||"json"](),b.validationSchema,b.index,J);break;case w2:$[b.index]=!b.key?M:M.get(b.key);break;case K2:$[b.index]=!b.validationSchema?G:await this.argumentsResolution(G?.toJSON(),b.validationSchema,b.index,J);break;case ec:$[b.index]=!b.validationSchema?G?.get(b.key)||void 0:await this.argumentsResolution(G?.get(b.key)||void 0,b.validationSchema,b.index,J);break;case oc:$[b.index]=D;break;case j2:$[b.index]=!b.validationSchema?B?.[b.key]||void 0:await this.argumentsResolution(B?.[b.key]||void 0,b.validationSchema,b.index,J);break;case mc:$[b.index]=L;break;case fc:$[b.index]=S;break;default:$[b.index]=!b.validationSchema?!M.has(b.type)?void 0:M.get(b.type):await this.argumentsResolution(M.get(b.type),b.validationSchema,b.index,J);break}if(M.set(s2,await q(...$),{isStatic:!1}),P&&"closeInterceptorGroup"in P&&P.closeInterceptorGroup){let{closeInterceptorGroup:H}=P;for(let b=0;b<H.length;b++){let Q=[],{func:X,funcName:W,argumentsMetadata:V}=H[b];for(let[o,U]of Object.entries(V))switch(U.type){case pc:Q[U.index]=!U.validationSchema?O:await this.argumentsResolution(O,U.validationSchema,U.index,W);break;case G2:Q[U.index]=!U.validationSchema?await O?.[U.parser||"json"]():await this.argumentsResolution(await O?.[U.parser||"json"](),U.validationSchema,U.index,W);break;case w2:Q[U.index]=!U.key?M:M.get(U.key);break;case K2:Q[U.index]=!U.validationSchema?G:await this.argumentsResolution(G?.toJSON(),U.validationSchema,U.index,W);break;case oc:Q[U.index]=M.get(U.type);break;case ec:Q[U.index]=!U.validationSchema?G?.get(U.key)||void 0:await this.argumentsResolution(G?.get(U.key)||void 0,U.validationSchema,U.index,W);break;case j2:Q[U.index]=!U.validationSchema?B?.[U.key]||void 0:await this.argumentsResolution(B?.[U.key]||void 0,U.validationSchema,U.index,W);break;case mc:Q[U.index]=L;break;case fc:Q[U.index]=S;break;default:Q[U.index]=!U.validationSchema?!M.has(U.type)?void 0:M.get(U.type):await this.argumentsResolution(M.get(U.type),U.validationSchema,U.index,W);break}await X(...Q)}}}if(P){let{endMiddlewareGroup:$}=P;if($)for(let q=0;q<$.length;q++){let J=[],{func:z,funcName:H,argumentsMetadata:b}=$[q];for(let[Q,X]of Object.entries(b))switch(X.type){case pc:J[X.index]=!X.validationSchema?O:await this.argumentsResolution(O,X.validationSchema,X.index,H);break;case G2:J[X.index]=!X.validationSchema?await O?.[X.parser||"json"]():await this.argumentsResolution(await O?.[X.parser||"json"](),X.validationSchema,X.index,H);break;case w2:J[X.index]=!X.key?M:M.get(X.key);break;case K2:J[X.index]=!X.validationSchema?G:await this.argumentsResolution(G?.toJSON(),X.validationSchema,X.index,H);break;case oc:J[X.index]=M.get(X.type);break;case ec:J[X.index]=!X.validationSchema?G?.get(X.key)||void 0:await this.argumentsResolution(G?.get(X.key)||void 0,X.validationSchema,X.index,H);break;case j2:J[X.index]=!X.validationSchema?B?.[X.key]||void 0:await this.argumentsResolution(B?.[X.key]||void 0,X.validationSchema,X.index,H);break;case mc:J[X.index]=L;break;case fc:J[X.index]=S;break;default:J[X.index]=!X.validationSchema?!M.has(X.type)?void 0:M.get(X.type):await this.argumentsResolution(!(X.type in M)?void 0:M.get(X.type),X.validationSchema,X.index,H);break}await z(...J)}}return Object.freeze({context:M})}async webSocketFetcher(c,K){let{request:w,server:P}=c,{query:h,responseHeaders:M,route:{model:S}}=K,O=await S.func(...[P,w,h]);if(typeof O!=="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:M}));if(!O)return this.finalizeResponse(new Response(JSON.stringify({httpCode:500,message:"Can not upgrade.",data:void 0}),{status:500,statusText:"Internal server error.",headers:M}));return O}}var a1=S4(e4(),1);var d4=()=>J4(Gc.authState);var T3=()=>(c)=>{Reflect.defineMetadata(Gc.guardMetadata,void 0,c)};class s4{open(c,K){if(Reflect.getOwnMetadataKeys(c.class.prototype,c.funcName).includes(Gc.authState)){if(!K)throw new P2({httpCode:401,message:"Unauthorized",data:void 0});return}if(Reflect.getOwnMetadataKeys(c.class).includes(Gc.authState)){if(!K)throw new P2({httpCode:401,message:"Unauthorized",data:void 0});return}}}Q2([W2(0,b6()),W2(1,d4())],s4.prototype,"open",null),s4=Q2([J6()],s4);var Tc=new TextEncoder,q2=new TextDecoder;function I6(...c){let K=c.reduce((h,{length:M})=>h+M,0),w=new Uint8Array(K),P=0;for(let h of c)w.set(h,P),P+=h.length;return w}function D6(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 G6(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 j6(c){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof c==="string"?c:q2.decode(c),{alphabet:"base64url"});let K=c;if(K instanceof Uint8Array)K=q2.decode(K);K=K.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return G6(K)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function W4(c){let K=c;if(typeof K==="string")K=Tc.encode(K);if(Uint8Array.prototype.toBase64)return K.toBase64({alphabet:"base64url",omitPadding:!0});return D6(K).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class N4 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 Rc extends N4{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class h2 extends N4{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class a4 extends N4{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 cK(c){return parseInt(c.name.slice(4),10)}function t3(c){switch(c){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}function d3(c,K){if(K&&!c.usages.includes(K))throw TypeError(`CryptoKey does not support this operation, its usages must include ${K}.`)}function X6(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(cK(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(cK(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(cK(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=t3(K);if(c.algorithm.namedCurve!==P)throw uc(P,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}d3(c,w)}function B6(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 $6=(c,...K)=>{return B6("Key must be ",c,...K)};function KK(c,K,...w){return B6(`Key for the ${c} algorithm must be `,K,...w)}function wK(c){return c?.[Symbol.toStringTag]==="CryptoKey"}function PK(c){return c?.[Symbol.toStringTag]==="KeyObject"}var hK=(c)=>{return wK(c)||PK(c)};var z6=(...c)=>{let K=c.filter(Boolean);if(K.length===0||K.length===1)return!0;let w;for(let P of K){let h=Object.keys(P);if(!w||w.size===0){w=new Set(h);continue}for(let M of h){if(w.has(M))return!1;w.add(M)}}return!0};function s3(c){return typeof c==="object"&&c!==null}var I4=(c)=>{if(!s3(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 U6=(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 a3(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 Rc('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 Rc('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 Rc('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 Rc('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new Rc('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:K,keyUsages:w}}var Y6=async(c)=>{if(!c.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:K,keyUsages:w}=a3(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 Q6=(c,K,w,P,h)=>{if(h.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((S)=>typeof S!=="string"||S.length===0))throw new c('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let M;if(w!==void 0)M=new Map([...Object.entries(w),...K.entries()]);else M=K;for(let S of P.crit){if(!M.has(S))throw new Rc(`Extension Header Parameter "${S}" is not recognized`);if(h[S]===void 0)throw new c(`Extension Header Parameter "${S}" is missing`);if(M.get(S)&&P[S]===void 0)throw new c(`Extension Header Parameter "${S}" MUST be integrity protected`)}return new Set(P.crit)};function A2(c){return I4(c)&&typeof c.kty==="string"}function V6(c){return c.kty!=="oct"&&(c.kty==="AKP"&&typeof c.priv==="string"||typeof c.d==="string")}function q6(c){return c.kty!=="oct"&&typeof c.d>"u"&&typeof c.priv>"u"}function L6(c){return c.kty==="oct"&&typeof c.k==="string"}var H2,H6=async(c,K,w,P=!1)=>{H2||=new WeakMap;let h=H2.get(c);if(h?.[w])return h[w];let M=await Y6({...K,alg:w});if(P)Object.freeze(c);if(!h)H2.set(c,{[w]:M});else h[w]=M;return M},K0=(c,K)=>{H2||=new WeakMap;let w=H2.get(c);if(w?.[K])return w[K];let P=c.type==="public",h=P?!0:!1,M;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")}M=c.toCryptoKey(c.asymmetricKeyType,h,P?[]:["deriveBits"])}if(c.asymmetricKeyType==="ed25519"){if(K!=="EdDSA"&&K!=="Ed25519")throw TypeError("given KeyObject instance cannot be used for this algorithm");M=c.toCryptoKey(c.asymmetricKeyType,h,[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");M=c.toCryptoKey(c.asymmetricKeyType,h,[P?"verify":"sign"])}}if(c.asymmetricKeyType==="rsa"){let S;switch(K){case"RSA-OAEP":S="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":S="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":S="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":S="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:S},h,P?["encrypt"]:["decrypt"]);M=c.toCryptoKey({name:K.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:S},h,[P?"verify":"sign"])}if(c.asymmetricKeyType==="ec"){let O=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(c.asymmetricKeyDetails?.namedCurve);if(!O)throw TypeError("given KeyObject instance cannot be used for this algorithm");if(K==="ES256"&&O==="P-256")M=c.toCryptoKey({name:"ECDSA",namedCurve:O},h,[P?"verify":"sign"]);if(K==="ES384"&&O==="P-384")M=c.toCryptoKey({name:"ECDSA",namedCurve:O},h,[P?"verify":"sign"]);if(K==="ES512"&&O==="P-521")M=c.toCryptoKey({name:"ECDSA",namedCurve:O},h,[P?"verify":"sign"]);if(K.startsWith("ECDH-ES"))M=c.toCryptoKey({name:"ECDH",namedCurve:O},h,P?[]:["deriveBits"])}if(!M)throw TypeError("given KeyObject instance cannot be used for this algorithm");if(!w)H2.set(c,{[K]:M});else w[K]=M;return M},v6=async(c,K)=>{if(c instanceof Uint8Array)return c;if(wK(c))return c;if(PK(c)){if(c.type==="secret")return c.export();if("toCryptoKey"in c&&typeof c.toCryptoKey==="function")try{return K0(c,K)}catch(P){if(P instanceof TypeError)throw P}let w=c.export({format:"jwk"});return H6(c,w,K)}if(A2(c)){if(c.k)return j6(c.k);return H6(c,c,K,!0)}throw Error("unreachable")};var v2=(c)=>c?.[Symbol.toStringTag],MK=(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},w0=(c,K,w)=>{if(K instanceof Uint8Array)return;if(A2(K)){if(L6(K)&&MK(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(!hK(K))throw TypeError(KK(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"`)},P0=(c,K,w)=>{if(A2(K))switch(w){case"decrypt":case"sign":if(V6(K)&&MK(c,K,w))return;throw TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(q6(K)&&MK(c,K,w))return;throw TypeError("JSON Web Key for this operation be a public JWK")}if(!hK(K))throw TypeError(KK(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}},E6=(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))w0(c,K,w);else P0(c,K,w)};var F6=(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 Rc(`alg ${c} is not supported either by JOSE or your javascript runtime`)}};var g6=async(c,K,w)=>{if(K instanceof Uint8Array){if(!c.startsWith("HS"))throw TypeError($6(K,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",K,{hash:`SHA-${c.slice(-3)}`,name:"HMAC"},!1,[w])}return X6(K,c,w),K};var M2=(c)=>Math.floor(c.getTime()/1000);var h0=/^(\+|\-)? ?(\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=h0.exec(c);if(!K||K[4]&&K[1])throw TypeError("Invalid time period format");let w=parseFloat(K[2]),P=K[3].toLowerCase(),h;switch(P){case"sec":case"secs":case"second":case"seconds":case"s":h=Math.round(w);break;case"minute":case"minutes":case"min":case"mins":case"m":h=Math.round(w*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":h=Math.round(w*3600);break;case"day":case"days":case"d":h=Math.round(w*86400);break;case"week":case"weeks":case"w":h=Math.round(w*604800);break;default:h=Math.round(w*31557600);break}if(K[1]==="-"||K[4]==="ago")return-h;return h};function X2(c,K){if(!Number.isFinite(K))throw TypeError(`Invalid ${c} input`);return K}class SK{#c;constructor(c){if(!I4(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",M2(c));else this.#c.nbf=M2(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",M2(c));else this.#c.exp=M2(new Date)+D4(c)}set iat(c){if(typeof c>"u")this.#c.iat=M2(new Date);else if(c instanceof Date)this.#c.iat=X2("setIssuedAt",M2(c));else if(typeof c==="string")this.#c.iat=X2("setIssuedAt",M2(new Date)+D4(c));else this.#c.iat=X2("setIssuedAt",c)}}var k6=async(c,K,w)=>{let P=await g6(c,K,"sign");U6(c,P);let h=await crypto.subtle.sign(F6(c,P.algorithm),P,w);return new Uint8Array(h)};class bK{#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 h2("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!z6(this.#K,this.#w))throw new h2("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let w={...this.#K,...this.#w},P=Q6(h2,new Map([["b64",!0]]),K?.crit,this.#K,w),h=!0;if(P.has("b64")){if(h=this.#K.b64,typeof h!=="boolean")throw new h2('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}let{alg:M}=w;if(typeof M!=="string"||!M)throw new h2('JWS "alg" (Algorithm) Header Parameter missing or invalid');E6(M,c,"sign");let S=this.#c;if(h)S=Tc.encode(W4(S));let O;if(this.#K)O=Tc.encode(W4(JSON.stringify(this.#K)));else O=Tc.encode("");let G=I6(O,Tc.encode("."),S),D=await v6(c,M),B=await k6(M,D,G),L={signature:W4(B),payload:""};if(h)L.payload=q2.decode(S);if(this.#w)L.header=this.#w;if(this.#K)L.protected=q2.decode(O);return L}}class OK{#c;constructor(c){this.#c=new bK(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 G4{#c;#K;constructor(c={}){this.#K=new SK(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 OK(this.#K.data());if(w.setProtectedHeader(this.#c),Array.isArray(this.#c?.crit)&&this.#c.crit.includes("b64")&&this.#c.b64===!1)throw new a4("JWTs MUST NOT use unencoded payload");return w.sign(c,K)}}var $P=Object.freeze({status:"aborted"});function E(c,K,w){function P(O,G){var D;Object.defineProperty(O,"_zod",{value:O._zod??{},enumerable:!1}),(D=O._zod).traits??(D.traits=new Set),O._zod.traits.add(c),K(O,G);for(let B in S.prototype)if(!(B in O))Object.defineProperty(O,B,{value:S.prototype[B].bind(O)});O._zod.constr=S,O._zod.def=G}let h=w?.Parent??Object;class M extends h{}Object.defineProperty(M,"name",{value:c});function S(O){var G;let D=w?.Parent?new M:this;P(D,O),(G=D._zod).deferred??(G.deferred=[]);for(let B of D._zod.deferred)B();return D}return Object.defineProperty(S,"init",{value:P}),Object.defineProperty(S,Symbol.hasInstance,{value:(O)=>{if(w?.Parent&&O instanceof w.Parent)return!0;return O?._zod?.traits?.has(c)}}),Object.defineProperty(S,"name",{value:c}),S}var zP=Symbol("zod_brand");class nc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class r2 extends Error{constructor(c){super(`Encountered unidirectional transform during encode: ${c}`);this.name="ZodEncodeError"}}var j4={};function ic(c){if(c)Object.assign(j4,c);return j4}var a={};m4(a,{unwrapMessage:()=>o2,uint8ArrayToHex:()=>g0,uint8ArrayToBase64url:()=>E0,uint8ArrayToBase64:()=>y6,stringifyPrimitive:()=>r6,shallowClone:()=>Z6,safeExtend:()=>Q0,required:()=>L0,randomString:()=>j0,propertyKeyTypes:()=>IK,promiseAllObject:()=>G0,primitiveTypes:()=>A6,prefixIssues:()=>y2,pick:()=>z0,partial:()=>q0,optionalKeys:()=>DK,omit:()=>U0,objectClone:()=>N0,numKeys:()=>X0,nullish:()=>u2,normalizeParams:()=>e,mergeDefs:()=>b2,merge:()=>V0,jsonStringifyReplacer:()=>F2,joinValues:()=>W0,issue:()=>g2,isPlainObject:()=>B2,isObject:()=>E2,hexToUint8Array:()=>F0,getSizableOrigin:()=>u6,getParsedType:()=>B0,getLengthableOrigin:()=>_2,getEnumValues:()=>WK,getElementAtPath:()=>D0,floatSafeRemainder:()=>x6,finalizeIssue:()=>Cc,extend:()=>Y0,escapeRegex:()=>$2,esc:()=>X4,defineLazy:()=>Kc,createTransparentProxy:()=>$0,cloneDef:()=>I0,clone:()=>xc,cleanRegex:()=>C2,cleanEnum:()=>H0,captureStackTrace:()=>B4,cached:()=>m2,base64urlToUint8Array:()=>v0,base64ToUint8Array:()=>C6,assignProp:()=>S2,assertNotEqual:()=>S0,assertNever:()=>O0,assertIs:()=>b0,assertEqual:()=>M0,assert:()=>J0,allowsEval:()=>NK,aborted:()=>O2,NUMBER_FORMAT_RANGES:()=>o6,Class:()=>_6,BIGINT_FORMAT_RANGES:()=>m6});function M0(c){return c}function S0(c){return c}function b0(c){}function O0(c){throw Error()}function J0(c){}function WK(c){let K=Object.values(c).filter((P)=>typeof P==="number");return Object.entries(c).filter(([P,h])=>K.indexOf(+P)===-1).map(([P,h])=>h)}function W0(c,K="|"){return c.map((w)=>r6(w)).join(K)}function F2(c,K){if(typeof K==="bigint")return K.toString();return K}function m2(c){return{get value(){{let w=c();return Object.defineProperty(this,"value",{value:w}),w}throw Error("cached value already set")}}}function u2(c){return c===null||c===void 0}function C2(c){let K=c.startsWith("^")?1:0,w=c.endsWith("$")?c.length-1:c.length;return c.slice(K,w)}function x6(c,K){let w=(c.toString().split(".")[1]||"").length,P=K.toString(),h=(P.split(".")[1]||"").length;if(h===0&&/\d?e-\d?/.test(P)){let G=P.match(/\d?e-(\d?)/);if(G?.[1])h=Number.parseInt(G[1])}let M=w>h?w:h,S=Number.parseInt(c.toFixed(M).replace(".","")),O=Number.parseInt(K.toFixed(M).replace(".",""));return S%O/10**M}var R6=Symbol("evaluating");function Kc(c,K,w){let P=void 0;Object.defineProperty(c,K,{get(){if(P===R6)return;if(P===void 0)P=R6,P=w();return P},set(h){Object.defineProperty(c,K,{value:h})},configurable:!0})}function N0(c){return Object.create(Object.getPrototypeOf(c),Object.getOwnPropertyDescriptors(c))}function S2(c,K,w){Object.defineProperty(c,K,{value:w,writable:!0,enumerable:!0,configurable:!0})}function b2(...c){let K={};for(let w of c){let P=Object.getOwnPropertyDescriptors(w);Object.assign(K,P)}return Object.defineProperties({},K)}function I0(c){return b2(c._zod.def)}function D0(c,K){if(!K)return c;return K.reduce((w,P)=>w?.[P],c)}function G0(c){let K=Object.keys(c),w=K.map((P)=>c[P]);return Promise.all(w).then((P)=>{let h={};for(let M=0;M<K.length;M++)h[K[M]]=P[M];return h})}function j0(c=10){let w="";for(let P=0;P<c;P++)w+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return w}function X4(c){return JSON.stringify(c)}var B4="captureStackTrace"in Error?Error.captureStackTrace:(...c)=>{};function E2(c){return typeof c==="object"&&c!==null&&!Array.isArray(c)}var NK=m2(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(c){return!1}});function B2(c){if(E2(c)===!1)return!1;let K=c.constructor;if(K===void 0)return!0;let w=K.prototype;if(E2(w)===!1)return!1;if(Object.prototype.hasOwnProperty.call(w,"isPrototypeOf")===!1)return!1;return!0}function Z6(c){if(B2(c))return{...c};if(Array.isArray(c))return[...c];return c}function X0(c){let K=0;for(let w in c)if(Object.prototype.hasOwnProperty.call(c,w))K++;return K}var B0=(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}`)}},IK=new Set(["string","number","symbol"]),A6=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $2(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 $0(c){let K;return new Proxy({},{get(w,P,h){return K??(K=c()),Reflect.get(K,P,h)},set(w,P,h,M){return K??(K=c()),Reflect.set(K,P,h,M)},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,h){return K??(K=c()),Reflect.defineProperty(K,P,h)}})}function r6(c){if(typeof c==="bigint")return c.toString()+"n";if(typeof c==="string")return`"${c}"`;return`${c}`}function DK(c){return Object.keys(c).filter((K)=>{return c[K]._zod.optin==="optional"&&c[K]._zod.optout==="optional"})}var o6={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]},m6={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function z0(c,K){let w=c._zod.def,P=b2(c._zod.def,{get shape(){let h={};for(let M in K){if(!(M in w.shape))throw Error(`Unrecognized key: "${M}"`);if(!K[M])continue;h[M]=w.shape[M]}return S2(this,"shape",h),h},checks:[]});return xc(c,P)}function U0(c,K){let w=c._zod.def,P=b2(c._zod.def,{get shape(){let h={...c._zod.def.shape};for(let M in K){if(!(M in w.shape))throw Error(`Unrecognized key: "${M}"`);if(!K[M])continue;delete h[M]}return S2(this,"shape",h),h},checks:[]});return xc(c,P)}function Y0(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 h=b2(c._zod.def,{get shape(){let M={...c._zod.def.shape,...K};return S2(this,"shape",M),M},checks:[]});return xc(c,h)}function Q0(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 S2(this,"shape",P),P},checks:c._zod.def.checks};return xc(c,w)}function V0(c,K){let w=b2(c._zod.def,{get shape(){let P={...c._zod.def.shape,...K._zod.def.shape};return S2(this,"shape",P),P},get catchall(){return K._zod.def.catchall},checks:[]});return xc(c,w)}function q0(c,K,w){let P=b2(K._zod.def,{get shape(){let h=K._zod.def.shape,M={...h};if(w)for(let S in w){if(!(S in h))throw Error(`Unrecognized key: "${S}"`);if(!w[S])continue;M[S]=c?new c({type:"optional",innerType:h[S]}):h[S]}else for(let S in h)M[S]=c?new c({type:"optional",innerType:h[S]}):h[S];return S2(this,"shape",M),M},checks:[]});return xc(K,P)}function L0(c,K,w){let P=b2(K._zod.def,{get shape(){let h=K._zod.def.shape,M={...h};if(w)for(let S in w){if(!(S in M))throw Error(`Unrecognized key: "${S}"`);if(!w[S])continue;M[S]=new c({type:"nonoptional",innerType:h[S]})}else for(let S in h)M[S]=new c({type:"nonoptional",innerType:h[S]});return S2(this,"shape",M),M},checks:[]});return xc(K,P)}function O2(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 y2(c,K){return K.map((w)=>{var P;return(P=w).path??(P.path=[]),w.path.unshift(c),w})}function o2(c){return typeof c==="string"?c:c?.message}function Cc(c,K,w){let P={...c,path:c.path??[]};if(!c.message){let h=o2(c.inst?._zod.def?.error?.(c))??o2(K?.error?.(c))??o2(w.customError?.(c))??o2(w.localeError?.(c))??"Invalid input";P.message=h}if(delete P.inst,delete P.continue,!K?.reportInput)delete P.input;return P}function u6(c){if(c instanceof Set)return"set";if(c instanceof Map)return"map";if(c instanceof File)return"file";return"unknown"}function _2(c){if(Array.isArray(c))return"array";if(typeof c==="string")return"string";return"unknown"}function g2(...c){let[K,w,P]=c;if(typeof K==="string")return{message:K,code:"custom",input:w,inst:P};return{...K}}function H0(c){return Object.entries(c).filter(([K,w])=>{return Number.isNaN(Number.parseInt(K,10))}).map((K)=>K[1])}function C6(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 y6(c){let K="";for(let w=0;w<c.length;w++)K+=String.fromCharCode(c[w]);return btoa(K)}function v0(c){let K=c.replace(/-/g,"+").replace(/_/g,"/"),w="=".repeat((4-K.length%4)%4);return C6(K+w)}function E0(c){return y6(c).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function F0(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 g0(c){return Array.from(c).map((K)=>K.toString(16).padStart(2,"0")).join("")}class _6{constructor(...c){}}var f6=(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,F2,2),Object.defineProperty(c,"toString",{value:()=>c.message,enumerable:!1})},$4=E("$ZodError",f6),GK=E("$ZodError",f6,{Parent:Error});function e6(c,K=(w)=>w.message){let w={},P=[];for(let h of c.issues)if(h.path.length>0)w[h.path[0]]=w[h.path[0]]||[],w[h.path[0]].push(K(h));else P.push(K(h));return{formErrors:P,fieldErrors:w}}function p6(c,K){let w=K||function(M){return M.message},P={_errors:[]},h=(M)=>{for(let S of M.issues)if(S.code==="invalid_union"&&S.errors.length)S.errors.map((O)=>h({issues:O}));else if(S.code==="invalid_key")h({issues:S.issues});else if(S.code==="invalid_element")h({issues:S.issues});else if(S.path.length===0)P._errors.push(w(S));else{let O=P,G=0;while(G<S.path.length){let D=S.path[G];if(G!==S.path.length-1)O[D]=O[D]||{_errors:[]};else O[D]=O[D]||{_errors:[]},O[D]._errors.push(w(S));O=O[D],G++}}};return h(c),P}var z4=(c)=>(K,w,P,h)=>{let M=P?Object.assign(P,{async:!1}):{async:!1},S=K._zod.run({value:w,issues:[]},M);if(S instanceof Promise)throw new nc;if(S.issues.length){let O=new(h?.Err??c)(S.issues.map((G)=>Cc(G,M,ic())));throw B4(O,h?.callee),O}return S.value};var U4=(c)=>async(K,w,P,h)=>{let M=P?Object.assign(P,{async:!0}):{async:!0},S=K._zod.run({value:w,issues:[]},M);if(S instanceof Promise)S=await S;if(S.issues.length){let O=new(h?.Err??c)(S.issues.map((G)=>Cc(G,M,ic())));throw B4(O,h?.callee),O}return S.value};var f2=(c)=>(K,w,P)=>{let h=P?{...P,async:!1}:{async:!1},M=K._zod.run({value:w,issues:[]},h);if(M instanceof Promise)throw new nc;return M.issues.length?{success:!1,error:new(c??$4)(M.issues.map((S)=>Cc(S,h,ic())))}:{success:!0,data:M.value}},l6=f2(GK),e2=(c)=>async(K,w,P)=>{let h=P?Object.assign(P,{async:!0}):{async:!0},M=K._zod.run({value:w,issues:[]},h);if(M instanceof Promise)M=await M;return M.issues.length?{success:!1,error:new c(M.issues.map((S)=>Cc(S,h,ic())))}:{success:!0,data:M.value}},T6=e2(GK),n6=(c)=>(K,w,P)=>{let h=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return z4(c)(K,w,h)};var i6=(c)=>(K,w,P)=>{return z4(c)(K,w,P)};var t6=(c)=>async(K,w,P)=>{let h=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return U4(c)(K,w,h)};var d6=(c)=>async(K,w,P)=>{return U4(c)(K,w,P)};var s6=(c)=>(K,w,P)=>{let h=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return f2(c)(K,w,h)};var a6=(c)=>(K,w,P)=>{return f2(c)(K,w,P)};var c8=(c)=>async(K,w,P)=>{let h=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return e2(c)(K,w,h)};var K8=(c)=>async(K,w,P)=>{return e2(c)(K,w,P)};var w8=/^[cC][^\s-]{8,}$/,P8=/^[0-9a-z]+$/,h8=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,M8=/^[0-9a-vA-V]{20}$/,S8=/^[A-Za-z0-9]{27}$/,b8=/^[a-zA-Z0-9_-]{21}$/,O8=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var J8=/^([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})$/,jK=(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 W8=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function N8(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var I8=/^(?:(?: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])$/,D8=/^(([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}|:))$/,G8=/^((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])$/,j8=/^(([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])$/,X8=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,XK=/^[A-Za-z0-9_-]*$/,B8=/^(?=.{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 $8=/^\+(?:[0-9]){6,14}[0-9]$/,z8="(?:(?:\\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])))",U8=new RegExp(`^${z8}$`);function Y8(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 Q8(c){return new RegExp(`^${Y8(c)}$`)}function V8(c){let K=Y8({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(`^${z8}T(?:${P})$`)}var q8=(c)=>{let K=c?`[\\s\\S]{${c?.minimum??0},${c?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${K}$`)};var L8=/^[^A-Z]*$/,H8=/^[^a-z]*$/;var qc=E("$ZodCheck",(c,K)=>{var w;c._zod??(c._zod={}),c._zod.def=K,(w=c._zod).onattach??(w.onattach=[])});var v8=E("$ZodCheckMaxLength",(c,K)=>{var w;qc.init(c,K),(w=c._zod.def).when??(w.when=(P)=>{let h=P.value;return!u2(h)&&h.length!==void 0}),c._zod.onattach.push((P)=>{let h=P._zod.bag.maximum??Number.POSITIVE_INFINITY;if(K.maximum<h)P._zod.bag.maximum=K.maximum}),c._zod.check=(P)=>{let h=P.value;if(h.length<=K.maximum)return;let S=_2(h);P.issues.push({origin:S,code:"too_big",maximum:K.maximum,inclusive:!0,input:h,inst:c,continue:!K.abort})}}),E8=E("$ZodCheckMinLength",(c,K)=>{var w;qc.init(c,K),(w=c._zod.def).when??(w.when=(P)=>{let h=P.value;return!u2(h)&&h.length!==void 0}),c._zod.onattach.push((P)=>{let h=P._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(K.minimum>h)P._zod.bag.minimum=K.minimum}),c._zod.check=(P)=>{let h=P.value;if(h.length>=K.minimum)return;let S=_2(h);P.issues.push({origin:S,code:"too_small",minimum:K.minimum,inclusive:!0,input:h,inst:c,continue:!K.abort})}}),F8=E("$ZodCheckLengthEquals",(c,K)=>{var w;qc.init(c,K),(w=c._zod.def).when??(w.when=(P)=>{let h=P.value;return!u2(h)&&h.length!==void 0}),c._zod.onattach.push((P)=>{let h=P._zod.bag;h.minimum=K.length,h.maximum=K.length,h.length=K.length}),c._zod.check=(P)=>{let h=P.value,M=h.length;if(M===K.length)return;let S=_2(h),O=M>K.length;P.issues.push({origin:S,...O?{code:"too_big",maximum:K.length}:{code:"too_small",minimum:K.length},inclusive:!0,exact:!0,input:P.value,inst:c,continue:!K.abort})}}),p2=E("$ZodCheckStringFormat",(c,K)=>{var w,P;if(qc.init(c,K),c._zod.onattach.push((h)=>{let M=h._zod.bag;if(M.format=K.format,K.pattern)M.patterns??(M.patterns=new Set),M.patterns.add(K.pattern)}),K.pattern)(w=c._zod).check??(w.check=(h)=>{if(K.pattern.lastIndex=0,K.pattern.test(h.value))return;h.issues.push({origin:"string",code:"invalid_format",format:K.format,input:h.value,...K.pattern?{pattern:K.pattern.toString()}:{},inst:c,continue:!K.abort})});else(P=c._zod).check??(P.check=()=>{})}),g8=E("$ZodCheckRegex",(c,K)=>{p2.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})}}),k8=E("$ZodCheckLowerCase",(c,K)=>{K.pattern??(K.pattern=L8),p2.init(c,K)}),R8=E("$ZodCheckUpperCase",(c,K)=>{K.pattern??(K.pattern=H8),p2.init(c,K)}),x8=E("$ZodCheckIncludes",(c,K)=>{qc.init(c,K);let w=$2(K.includes),P=new RegExp(typeof K.position==="number"?`^.{${K.position}}${w}`:w);K.pattern=P,c._zod.onattach.push((h)=>{let M=h._zod.bag;M.patterns??(M.patterns=new Set),M.patterns.add(P)}),c._zod.check=(h)=>{if(h.value.includes(K.includes,K.position))return;h.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:K.includes,input:h.value,inst:c,continue:!K.abort})}}),Z8=E("$ZodCheckStartsWith",(c,K)=>{qc.init(c,K);let w=new RegExp(`^${$2(K.prefix)}.*`);K.pattern??(K.pattern=w),c._zod.onattach.push((P)=>{let h=P._zod.bag;h.patterns??(h.patterns=new Set),h.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})}}),A8=E("$ZodCheckEndsWith",(c,K)=>{qc.init(c,K);let w=new RegExp(`.*${$2(K.suffix)}$`);K.pattern??(K.pattern=w),c._zod.onattach.push((P)=>{let h=P._zod.bag;h.patterns??(h.patterns=new Set),h.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 r8=E("$ZodCheckOverwrite",(c,K)=>{qc.init(c,K),c._zod.check=(w)=>{w.value=K.tx(w.value)}});class BK{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(`
18
+ `+N.prev}function Pc(I,N){var F=gc(I),R=[];if(F){R.length=I.length;for(var x=0;x<I.length;x++)R[x]=$c(I,x)?N(I[x],I):""}var g=typeof cc==="function"?cc(I):[],f;if(wc){f={};for(var t=0;t<g.length;t++)f["$"+g[t]]=g[t]}for(var i in I){if(!$c(I,i))continue;if(F&&String(Number(i))===i&&i<I.length)continue;if(wc&&f["$"+i]instanceof Symbol)continue;else if(r.call(/[^\w$]/,i))R.push(N(i,I)+": "+N(I[i],I));else R.push(i+": "+N(I[i],I))}if(typeof cc==="function"){for(var Jc=0;Jc<g.length;Jc++)if(Hc.call(I,g[Jc]))R.push("["+N(g[Jc])+"]: "+N(I[g[Jc]],I))}return R}}),h3=_((c,K)=>{var w=b4(),P=V2(),h=function(D,$,L){var B=D,q;for(;(q=B.next)!=null;B=q)if(q.key===$){if(B.next=q.next,!L)q.next=D.next,D.next=q;return q}},M=function(D,$){if(!D)return;var L=h(D,$);return L&&L.value},S=function(D,$,L){var B=h(D,$);if(B)B.value=L;else D.next={key:$,next:D.next,value:L}},O=function(D,$){if(!D)return!1;return!!h(D,$)},G=function(D,$){if(D)return h(D,$,!0)};K.exports=function(){var D,$={assert:function(L){if(!$.has(L))throw new P("Side channel does not contain "+w(L))},delete:function(L){var B=D&&D.next,q=G(D,L);if(q&&B&&B===q)D=void 0;return!!q},get:function(L){return M(D,L)},has:function(L){return O(D,L)},set:function(L,B){if(!D)D={next:void 0};S(D,L,B)}};return $}}),pK=_((c,K)=>{K.exports=Object}),M3=_((c,K)=>{K.exports=Error}),S3=_((c,K)=>{K.exports=EvalError}),b3=_((c,K)=>{K.exports=RangeError}),O3=_((c,K)=>{K.exports=ReferenceError}),J3=_((c,K)=>{K.exports=SyntaxError}),W3=_((c,K)=>{K.exports=URIError}),N3=_((c,K)=>{K.exports=Math.abs}),I3=_((c,K)=>{K.exports=Math.floor}),D3=_((c,K)=>{K.exports=Math.max}),G3=_((c,K)=>{K.exports=Math.min}),j3=_((c,K)=>{K.exports=Math.pow}),X3=_((c,K)=>{K.exports=Math.round}),$3=_((c,K)=>{K.exports=Number.isNaN||function(w){return w!==w}}),B3=_((c,K)=>{var w=$3();K.exports=function(P){if(w(P)||P===0)return P;return P<0?-1:1}}),z3=_((c,K)=>{K.exports=Object.getOwnPropertyDescriptor}),lK=_((c,K)=>{var w=z3();if(w)try{w([],"length")}catch(P){w=null}K.exports=w}),U3=_((c,K)=>{var w=Object.defineProperty||!1;if(w)try{w({},"a",{value:1})}catch(P){w=!1}K.exports=w}),Y3=_((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"),h=Object(P);if(typeof P==="string")return!1;if(Object.prototype.toString.call(P)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(h)!=="[object Symbol]")return!1;var M=42;w[P]=M;for(var S 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 O=Object.getOwnPropertySymbols(w);if(O.length!==1||O[0]!==P)return!1;if(!Object.prototype.propertyIsEnumerable.call(w,P))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var G=Object.getOwnPropertyDescriptor(w,P);if(G.value!==M||G.enumerable!==!0)return!1}return!0}}),Q3=_((c,K)=>{var w=typeof Symbol<"u"&&Symbol,P=Y3();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()}}),TK=_((c,K)=>{K.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),nK=_((c,K)=>{var w=pK();K.exports=w.getPrototypeOf||null}),V3=_((c,K)=>{var w="Function.prototype.bind called on incompatible ",P=Object.prototype.toString,h=Math.max,M="[object Function]",S=function(D,$){var L=[];for(var B=0;B<D.length;B+=1)L[B]=D[B];for(var q=0;q<$.length;q+=1)L[q+D.length]=$[q];return L},O=function(D,$){var L=[];for(var B=$||0,q=0;B<D.length;B+=1,q+=1)L[q]=D[B];return L},G=function(D,$){var L="";for(var B=0;B<D.length;B+=1)if(L+=D[B],B+1<D.length)L+=$;return L};K.exports=function(D){var $=this;if(typeof $!=="function"||P.apply($)!==M)throw TypeError(w+$);var L=O(arguments,1),B,q=function(){if(this instanceof B){var Q=$.apply(this,S(L,arguments));if(Object(Q)===Q)return Q;return this}return $.apply(D,S(L,arguments))},J=h(0,$.length-L.length),z=[];for(var H=0;H<J;H++)z[H]="$"+H;if(B=Function("binder","return function ("+G(z,",")+"){ return binder.apply(this,arguments); }")(q),$.prototype){var b=function(){};b.prototype=$.prototype,B.prototype=new b,b.prototype=null}return B}}),O4=_((c,K)=>{var w=V3();K.exports=Function.prototype.bind||w}),p4=_((c,K)=>{K.exports=Function.prototype.call}),iK=_((c,K)=>{K.exports=Function.prototype.apply}),q3=_((c,K)=>{K.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),L3=_((c,K)=>{var w=O4(),P=iK(),h=p4(),M=q3();K.exports=M||w.call(h,P)}),tK=_((c,K)=>{var w=O4(),P=V2(),h=p4(),M=L3();K.exports=function(S){if(S.length<1||typeof S[0]!=="function")throw new P("a function is required");return M(w,h,S)}}),H3=_((c,K)=>{var w=tK(),P=lK(),h;try{h=[].__proto__===Array.prototype}catch(G){if(!G||typeof G!=="object"||!("code"in G)||G.code!=="ERR_PROTO_ACCESS")throw G}var M=!!h&&P&&P(Object.prototype,"__proto__"),S=Object,O=S.getPrototypeOf;K.exports=M&&typeof M.get==="function"?w([M.get]):typeof O==="function"?function(G){return O(G==null?G:S(G))}:!1}),v3=_((c,K)=>{var w=TK(),P=nK(),h=H3();K.exports=w?function(M){return w(M)}:P?function(M){if(!M||typeof M!=="object"&&typeof M!=="function")throw TypeError("getProto: not an object");return P(M)}:h?function(M){return h(M)}:null}),E3=_((c,K)=>{var w=Function.prototype.call,P=Object.prototype.hasOwnProperty,h=O4();K.exports=h.call(w,P)}),l4=_((c,K)=>{var w,P=pK(),h=M3(),M=S3(),S=b3(),O=O3(),G=J3(),D=V2(),$=W3(),L=N3(),B=I3(),q=D3(),J=G3(),z=j3(),H=X3(),b=B3(),Q=Function,X=function(l){try{return Q('"use strict"; return ('+l+").constructor;")()}catch(s){}},W=lK(),V=U3(),o=function(){throw new D},U=W?function(){try{return arguments.callee,o}catch(l){try{return W(arguments,"callee").get}catch(s){return o}}}():o,r=Q3()(),k=v3(),A=nK(),u=TK(),n=iK(),C=p4(),cc={},Oc=typeof Uint8Array>"u"||!k?w:k(Uint8Array),wc={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?w:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?w:ArrayBuffer,"%ArrayIteratorPrototype%":r&&k?k([][Symbol.iterator]()):w,"%AsyncFromSyncIteratorPrototype%":w,"%AsyncFunction%":cc,"%AsyncGenerator%":cc,"%AsyncGeneratorFunction%":cc,"%AsyncIteratorPrototype%":cc,"%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%":h,"%eval%":eval,"%EvalError%":M,"%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%":cc,"%Int8Array%":typeof Int8Array>"u"?w:Int8Array,"%Int16Array%":typeof Int16Array>"u"?w:Int16Array,"%Int32Array%":typeof Int32Array>"u"?w:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":r&&k?k(k([][Symbol.iterator]())):w,"%JSON%":typeof JSON==="object"?JSON:w,"%Map%":typeof Map>"u"?w:Map,"%MapIteratorPrototype%":typeof Map>"u"||!r||!k?w:k(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":P,"%Object.getOwnPropertyDescriptor%":W,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?w:Promise,"%Proxy%":typeof Proxy>"u"?w:Proxy,"%RangeError%":S,"%ReferenceError%":O,"%Reflect%":typeof Reflect>"u"?w:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?w:Set,"%SetIteratorPrototype%":typeof Set>"u"||!r||!k?w:k(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?w:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":r&&k?k(""[Symbol.iterator]()):w,"%Symbol%":r?Symbol:w,"%SyntaxError%":G,"%ThrowTypeError%":U,"%TypedArray%":Oc,"%TypeError%":D,"%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%":$,"%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%":n,"%Object.defineProperty%":V,"%Object.getPrototypeOf%":A,"%Math.abs%":L,"%Math.floor%":B,"%Math.max%":q,"%Math.min%":J,"%Math.pow%":z,"%Math.round%":H,"%Math.sign%":b,"%Reflect.getPrototypeOf%":u};if(k)try{null.error}catch(l){Dc=k(k(l)),wc["%Error.prototype%"]=Dc}var Dc,Hc=function l(s){var T;if(s==="%AsyncFunction%")T=X("async function () {}");else if(s==="%GeneratorFunction%")T=X("function* () {}");else if(s==="%AsyncGeneratorFunction%")T=X("async function* () {}");else if(s==="%AsyncGenerator%"){var Mc=l("%AsyncGeneratorFunction%");if(Mc)T=Mc.prototype}else if(s==="%AsyncIteratorPrototype%"){var Nc=l("%AsyncGenerator%");if(Nc&&k)T=k(Nc.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"]},p=O4(),jc=E3(),Ec=p.call(C,Array.prototype.concat),y=p.call(n,Array.prototype.splice),Uc=p.call(C,String.prototype.replace),Zc=p.call(C,String.prototype.slice),d=p.call(C,RegExp.prototype.exec),Fc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Qc=/\\(\\)?/g,gc=function(l){var s=Zc(l,0,1),T=Zc(l,-1);if(s==="%"&&T!=="%")throw new G("invalid intrinsic syntax, expected closing `%`");else if(T==="%"&&s!=="%")throw new G("invalid intrinsic syntax, expected opening `%`");var Mc=[];return Uc(l,Fc,function(Nc,Xc,bc,yc){Mc[Mc.length]=bc?Uc(yc,Qc,"$1"):Xc||Nc}),Mc},Ac=function(l,s){var T=l,Mc;if(jc(vc,T))Mc=vc[T],T="%"+Mc[0]+"%";if(jc(wc,T)){var Nc=wc[T];if(Nc===cc)Nc=Hc(T);if(typeof Nc>"u"&&!s)throw new D("intrinsic "+l+" exists, but is not available. Please file an issue!");return{alias:Mc,name:T,value:Nc}}throw new G("intrinsic "+l+" does not exist!")};K.exports=function(l,s){if(typeof l!=="string"||l.length===0)throw new D("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof s!=="boolean")throw new D('"allowMissing" argument must be a boolean');if(d(/^%?[^%]*%?$/,l)===null)throw new G("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var T=gc(l),Mc=T.length>0?T[0]:"",Nc=Ac("%"+Mc+"%",s),Xc=Nc.name,bc=Nc.value,yc=!1,$c=Nc.alias;if($c)Mc=$c[0],y(T,Ec([0,1],$c));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 G("property names with quotes must have matching quotes");if(zc==="constructor"||!rc)yc=!0;if(Mc+="."+zc,Xc="%"+Mc+"%",jc(wc,Xc))bc=wc[Xc];else if(bc!=null){if(!(zc in bc)){if(!s)throw new D("base intrinsic for "+l+" exists, but the property is not available.");return}if(W&&Bc+1>=T.length){var sc=W(bc,zc);if(rc=!!sc,rc&&"get"in sc&&!("originalValue"in sc.get))bc=sc.get;else bc=bc[zc]}else rc=jc(bc,zc),bc=bc[zc];if(rc&&!yc)wc[Xc]=bc}}return bc}}),dK=_((c,K)=>{var w=l4(),P=tK(),h=P([w("%String.prototype.indexOf%")]);K.exports=function(M,S){var O=w(M,!!S);if(typeof O==="function"&&h(M,".prototype.")>-1)return P([O]);return O}}),sK=_((c,K)=>{var w=l4(),P=dK(),h=b4(),M=V2(),S=w("%Map%",!0),O=P("Map.prototype.get",!0),G=P("Map.prototype.set",!0),D=P("Map.prototype.has",!0),$=P("Map.prototype.delete",!0),L=P("Map.prototype.size",!0);K.exports=!!S&&function(){var B,q={assert:function(J){if(!q.has(J))throw new M("Side channel does not contain "+h(J))},delete:function(J){if(B){var z=$(B,J);if(L(B)===0)B=void 0;return z}return!1},get:function(J){if(B)return O(B,J)},has:function(J){if(B)return D(B,J);return!1},set:function(J,z){if(!B)B=new S;G(B,J,z)}};return q}}),F3=_((c,K)=>{var w=l4(),P=dK(),h=b4(),M=sK(),S=V2(),O=w("%WeakMap%",!0),G=P("WeakMap.prototype.get",!0),D=P("WeakMap.prototype.set",!0),$=P("WeakMap.prototype.has",!0),L=P("WeakMap.prototype.delete",!0);K.exports=O?function(){var B,q,J={assert:function(z){if(!J.has(z))throw new S("Side channel does not contain "+h(z))},delete:function(z){if(O&&z&&(typeof z==="object"||typeof z==="function")){if(B)return L(B,z)}else if(M){if(q)return q.delete(z)}return!1},get:function(z){if(O&&z&&(typeof z==="object"||typeof z==="function")){if(B)return G(B,z)}return q&&q.get(z)},has:function(z){if(O&&z&&(typeof z==="object"||typeof z==="function")){if(B)return $(B,z)}return!!q&&q.has(z)},set:function(z,H){if(O&&z&&(typeof z==="object"||typeof z==="function")){if(!B)B=new O;D(B,z,H)}else if(M){if(!q)q=M();q.set(z,H)}}};return J}:M}),g3=_((c,K)=>{var w=V2(),P=b4(),h=h3(),M=sK(),S=F3(),O=S||M||h;K.exports=function(){var G,D={assert:function($){if(!D.has($))throw new w("Side channel does not contain "+P($))},delete:function($){return!!G&&G.delete($)},get:function($){return G&&G.get($)},has:function($){return!!G&&G.has($)},set:function($,L){if(!G)G=O();G.set($,L)}};return D}}),T4=_((c,K)=>{var w=String.prototype.replace,P=/%20/g,h={RFC1738:"RFC1738",RFC3986:"RFC3986"};K.exports={default:h.RFC3986,formatters:{RFC1738:function(M){return w.call(M,P,"+")},RFC3986:function(M){return String(M)}},RFC1738:h.RFC1738,RFC3986:h.RFC3986}}),aK=_((c,K)=>{var w=T4(),P=Object.prototype.hasOwnProperty,h=Array.isArray,M=function(){var Q=[];for(var X=0;X<256;++X)Q.push("%"+((X<16?"0":"")+X.toString(16)).toUpperCase());return Q}(),S=function(Q){while(Q.length>1){var X=Q.pop(),W=X.obj[X.prop];if(h(W)){var V=[];for(var o=0;o<W.length;++o)if(typeof W[o]<"u")V.push(W[o]);X.obj[X.prop]=V}}},O=function(Q,X){var W=X&&X.plainObjects?{__proto__:null}:{};for(var V=0;V<Q.length;++V)if(typeof Q[V]<"u")W[V]=Q[V];return W},G=function Q(X,W,V){if(!W)return X;if(typeof W!=="object"&&typeof W!=="function"){if(h(X))X.push(W);else if(X&&typeof X==="object"){if(V&&(V.plainObjects||V.allowPrototypes)||!P.call(Object.prototype,W))X[W]=!0}else return[X,W];return X}if(!X||typeof X!=="object")return[X].concat(W);var o=X;if(h(X)&&!h(W))o=O(X,V);if(h(X)&&h(W))return W.forEach(function(U,r){if(P.call(X,r)){var k=X[r];if(k&&typeof k==="object"&&U&&typeof U==="object")X[r]=Q(k,U,V);else X.push(U)}else X[r]=U}),X;return Object.keys(W).reduce(function(U,r){var k=W[r];if(P.call(U,r))U[r]=Q(U[r],k,V);else U[r]=k;return U},o)},D=function(Q,X){return Object.keys(X).reduce(function(W,V){return W[V]=X[V],W},Q)},$=function(Q,X,W){var V=Q.replace(/\+/g," ");if(W==="iso-8859-1")return V.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(V)}catch(o){return V}},L=1024,B=function(Q,X,W,V,o){if(Q.length===0)return Q;var U=Q;if(typeof Q==="symbol")U=Symbol.prototype.toString.call(Q);else if(typeof Q!=="string")U=String(Q);if(W==="iso-8859-1")return escape(U).replace(/%u[0-9a-f]{4}/gi,function(cc){return"%26%23"+parseInt(cc.slice(2),16)+"%3B"});var r="";for(var k=0;k<U.length;k+=L){var A=U.length>=L?U.slice(k,k+L):U,u=[];for(var n=0;n<A.length;++n){var C=A.charCodeAt(n);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(n);continue}if(C<128){u[u.length]=M[C];continue}if(C<2048){u[u.length]=M[192|C>>6]+M[128|C&63];continue}if(C<55296||C>=57344){u[u.length]=M[224|C>>12]+M[128|C>>6&63]+M[128|C&63];continue}n+=1,C=65536+((C&1023)<<10|A.charCodeAt(n)&1023),u[u.length]=M[240|C>>18]+M[128|C>>12&63]+M[128|C>>6&63]+M[128|C&63]}r+=u.join("")}return r},q=function(Q){var X=[{obj:{o:Q},prop:"o"}],W=[];for(var V=0;V<X.length;++V){var o=X[V],U=o.obj[o.prop],r=Object.keys(U);for(var k=0;k<r.length;++k){var A=r[k],u=U[A];if(typeof u==="object"&&u!==null&&W.indexOf(u)===-1)X.push({obj:U,prop:A}),W.push(u)}}return S(X),Q},J=function(Q){return Object.prototype.toString.call(Q)==="[object RegExp]"},z=function(Q){if(!Q||typeof Q!=="object")return!1;return!!(Q.constructor&&Q.constructor.isBuffer&&Q.constructor.isBuffer(Q))},H=function(Q,X){return[].concat(Q,X)},b=function(Q,X){if(h(Q)){var W=[];for(var V=0;V<Q.length;V+=1)W.push(X(Q[V]));return W}return X(Q)};K.exports={arrayToObject:O,assign:D,combine:H,compact:q,decode:$,encode:B,isBuffer:z,isRegExp:J,maybeMap:b,merge:G}}),k3=_((c,K)=>{var w=g3(),P=aK(),h=T4(),M=Object.prototype.hasOwnProperty,S={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,Q){return b+"["+Q+"]"},repeat:function(b){return b}},O=Array.isArray,G=Array.prototype.push,D=function(b,Q){G.apply(b,O(Q)?Q:[Q])},$=Date.prototype.toISOString,L=h.default,B={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:L,formatter:h.formatters[L],indices:!1,serializeDate:function(b){return $.call(b)},skipNulls:!1,strictNullHandling:!1},q=function(b){return typeof b==="string"||typeof b==="number"||typeof b==="boolean"||typeof b==="symbol"||typeof b==="bigint"},J={},z=function b(Q,X,W,V,o,U,r,k,A,u,n,C,cc,Oc,wc,Dc,Hc,vc){var p=Q,jc=vc,Ec=0,y=!1;while((jc=jc.get(J))!==void 0&&!y){var Uc=jc.get(Q);if(Ec+=1,typeof Uc<"u")if(Uc===Ec)throw RangeError("Cyclic object value");else y=!0;if(typeof jc.get(J)>"u")Ec=0}if(typeof u==="function")p=u(X,p);else if(p instanceof Date)p=cc(p);else if(W==="comma"&&O(p))p=P.maybeMap(p,function(bc){if(bc instanceof Date)return cc(bc);return bc});if(p===null){if(U)return A&&!Dc?A(X,B.encoder,Hc,"key",Oc):X;p=""}if(q(p)||P.isBuffer(p)){if(A){var Zc=Dc?X:A(X,B.encoder,Hc,"key",Oc);return[wc(Zc)+"="+wc(A(p,B.encoder,Hc,"value",Oc))]}return[wc(X)+"="+wc(String(p))]}var d=[];if(typeof p>"u")return d;var Fc;if(W==="comma"&&O(p)){if(Dc&&A)p=P.maybeMap(p,A);Fc=[{value:p.length>0?p.join(",")||null:void 0}]}else if(O(u))Fc=u;else{var Qc=Object.keys(p);Fc=n?Qc.sort(n):Qc}var gc=k?String(X).replace(/\./g,"%2E"):String(X),Ac=V&&O(p)&&p.length===1?gc+"[]":gc;if(o&&O(p)&&p.length===0)return Ac+"[]";for(var l=0;l<Fc.length;++l){var s=Fc[l],T=typeof s==="object"&&s&&typeof s.value<"u"?s.value:p[s];if(r&&T===null)continue;var Mc=C&&k?String(s).replace(/\./g,"%2E"):String(s),Nc=O(p)?typeof W==="function"?W(Ac,Mc):Ac:Ac+(C?"."+Mc:"["+Mc+"]");vc.set(Q,Ec);var Xc=w();Xc.set(J,vc),D(d,b(T,Nc,W,V,o,U,r,k,W==="comma"&&Dc&&O(p)?null:A,u,n,C,cc,Oc,wc,Dc,Hc,Xc))}return d},H=function(b){if(!b)return B;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 Q=b.charset||B.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 X=h.default;if(typeof b.format<"u"){if(!M.call(h.formatters,b.format))throw TypeError("Unknown format option provided.");X=b.format}var W=h.formatters[X],V=B.filter;if(typeof b.filter==="function"||O(b.filter))V=b.filter;var o;if(b.arrayFormat in S)o=b.arrayFormat;else if("indices"in b)o=b.indices?"indices":"repeat";else o=B.arrayFormat;if("commaRoundTrip"in b&&typeof b.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");var U=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:B.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix==="boolean"?b.addQueryPrefix:B.addQueryPrefix,allowDots:U,allowEmptyArrays:typeof b.allowEmptyArrays==="boolean"?!!b.allowEmptyArrays:B.allowEmptyArrays,arrayFormat:o,charset:Q,charsetSentinel:typeof b.charsetSentinel==="boolean"?b.charsetSentinel:B.charsetSentinel,commaRoundTrip:!!b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?B.delimiter:b.delimiter,encode:typeof b.encode==="boolean"?b.encode:B.encode,encodeDotInKeys:typeof b.encodeDotInKeys==="boolean"?b.encodeDotInKeys:B.encodeDotInKeys,encoder:typeof b.encoder==="function"?b.encoder:B.encoder,encodeValuesOnly:typeof b.encodeValuesOnly==="boolean"?b.encodeValuesOnly:B.encodeValuesOnly,filter:V,format:X,formatter:W,serializeDate:typeof b.serializeDate==="function"?b.serializeDate:B.serializeDate,skipNulls:typeof b.skipNulls==="boolean"?b.skipNulls:B.skipNulls,sort:typeof b.sort==="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling==="boolean"?b.strictNullHandling:B.strictNullHandling}};K.exports=function(b,Q){var X=b,W=H(Q),V,o;if(typeof W.filter==="function")o=W.filter,X=o("",X);else if(O(W.filter))o=W.filter,V=o;var U=[];if(typeof X!=="object"||X===null)return"";var r=S[W.arrayFormat],k=r==="comma"&&W.commaRoundTrip;if(!V)V=Object.keys(X);if(W.sort)V.sort(W.sort);var A=w();for(var u=0;u<V.length;++u){var n=V[u],C=X[n];if(W.skipNulls&&C===null)continue;D(U,z(C,n,r,k,W.allowEmptyArrays,W.strictNullHandling,W.skipNulls,W.encodeDotInKeys,W.encode?W.encoder:null,W.filter,W.sort,W.allowDots,W.serializeDate,W.format,W.formatter,W.encodeValuesOnly,W.charset,A))}var cc=U.join(W.delimiter),Oc=W.addQueryPrefix===!0?"?":"";if(W.charsetSentinel)if(W.charset==="iso-8859-1")Oc+="utf8=%26%2310003%3B&";else Oc+="utf8=%E2%9C%93&";return cc.length>0?Oc+cc:""}}),R3=_((c,K)=>{var w=aK(),P=Object.prototype.hasOwnProperty,h=Array.isArray,M={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},S=function(J){return J.replace(/&#(\d+);/g,function(z,H){return String.fromCharCode(parseInt(H,10))})},O=function(J,z,H){if(J&&typeof J==="string"&&z.comma&&J.indexOf(",")>-1)return J.split(",");if(z.throwOnLimitExceeded&&H>=z.arrayLimit)throw RangeError("Array limit exceeded. Only "+z.arrayLimit+" element"+(z.arrayLimit===1?"":"s")+" allowed in an array.");return J},G="utf8=%26%2310003%3B",D="utf8=%E2%9C%93",$=function(J,z){var H={__proto__:null},b=z.ignoreQueryPrefix?J.replace(/^\?/,""):J;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var Q=z.parameterLimit===1/0?void 0:z.parameterLimit,X=b.split(z.delimiter,z.throwOnLimitExceeded?Q+1:Q);if(z.throwOnLimitExceeded&&X.length>Q)throw RangeError("Parameter limit exceeded. Only "+Q+" parameter"+(Q===1?"":"s")+" allowed.");var W=-1,V,o=z.charset;if(z.charsetSentinel){for(V=0;V<X.length;++V)if(X[V].indexOf("utf8=")===0){if(X[V]===D)o="utf-8";else if(X[V]===G)o="iso-8859-1";W=V,V=X.length}}for(V=0;V<X.length;++V){if(V===W)continue;var U=X[V],r=U.indexOf("]="),k=r===-1?U.indexOf("="):r+1,A,u;if(k===-1)A=z.decoder(U,M.decoder,o,"key"),u=z.strictNullHandling?null:"";else A=z.decoder(U.slice(0,k),M.decoder,o,"key"),u=w.maybeMap(O(U.slice(k+1),z,h(H[A])?H[A].length:0),function(C){return z.decoder(C,M.decoder,o,"value")});if(u&&z.interpretNumericEntities&&o==="iso-8859-1")u=S(String(u));if(U.indexOf("[]=")>-1)u=h(u)?[u]:u;var n=P.call(H,A);if(n&&z.duplicates==="combine")H[A]=w.combine(H[A],u);else if(!n||z.duplicates==="last")H[A]=u}return H},L=function(J,z,H,b){var Q=0;if(J.length>0&&J[J.length-1]==="[]"){var X=J.slice(0,-1).join("");Q=Array.isArray(z)&&z[X]?z[X].length:0}var W=b?z:O(z,H,Q);for(var V=J.length-1;V>=0;--V){var o,U=J[V];if(U==="[]"&&H.parseArrays)o=H.allowEmptyArrays&&(W===""||H.strictNullHandling&&W===null)?[]:w.combine([],W);else{o=H.plainObjects?{__proto__:null}:{};var r=U.charAt(0)==="["&&U.charAt(U.length-1)==="]"?U.slice(1,-1):U,k=H.decodeDotInKeys?r.replace(/%2E/g,"."):r,A=parseInt(k,10);if(!H.parseArrays&&k==="")o={0:W};else if(!isNaN(A)&&U!==k&&String(A)===k&&A>=0&&(H.parseArrays&&A<=H.arrayLimit))o=[],o[A]=W;else if(k!=="__proto__")o[k]=W}W=o}return W},B=function(J,z,H,b){if(!J)return;var Q=H.allowDots?J.replace(/\.([^.[]+)/g,"[$1]"):J,X=/(\[[^[\]]*])/,W=/(\[[^[\]]*])/g,V=H.depth>0&&X.exec(Q),o=V?Q.slice(0,V.index):Q,U=[];if(o){if(!H.plainObjects&&P.call(Object.prototype,o)){if(!H.allowPrototypes)return}U.push(o)}var r=0;while(H.depth>0&&(V=W.exec(Q))!==null&&r<H.depth){if(r+=1,!H.plainObjects&&P.call(Object.prototype,V[1].slice(1,-1))){if(!H.allowPrototypes)return}U.push(V[1])}if(V){if(H.strictDepth===!0)throw RangeError("Input depth exceeded depth option of "+H.depth+" and strictDepth is true");U.push("["+Q.slice(V.index)+"]")}return L(U,z,H,b)},q=function(J){if(!J)return M;if(typeof J.allowEmptyArrays<"u"&&typeof J.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof J.decodeDotInKeys<"u"&&typeof J.decodeDotInKeys!=="boolean")throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(J.decoder!==null&&typeof J.decoder<"u"&&typeof J.decoder!=="function")throw TypeError("Decoder has to be a function.");if(typeof J.charset<"u"&&J.charset!=="utf-8"&&J.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof J.throwOnLimitExceeded<"u"&&typeof J.throwOnLimitExceeded!=="boolean")throw TypeError("`throwOnLimitExceeded` option must be a boolean");var z=typeof J.charset>"u"?M.charset:J.charset,H=typeof J.duplicates>"u"?M.duplicates:J.duplicates;if(H!=="combine"&&H!=="first"&&H!=="last")throw TypeError("The duplicates option must be either combine, first, or last");var b=typeof J.allowDots>"u"?J.decodeDotInKeys===!0?!0:M.allowDots:!!J.allowDots;return{allowDots:b,allowEmptyArrays:typeof J.allowEmptyArrays==="boolean"?!!J.allowEmptyArrays:M.allowEmptyArrays,allowPrototypes:typeof J.allowPrototypes==="boolean"?J.allowPrototypes:M.allowPrototypes,allowSparse:typeof J.allowSparse==="boolean"?J.allowSparse:M.allowSparse,arrayLimit:typeof J.arrayLimit==="number"?J.arrayLimit:M.arrayLimit,charset:z,charsetSentinel:typeof J.charsetSentinel==="boolean"?J.charsetSentinel:M.charsetSentinel,comma:typeof J.comma==="boolean"?J.comma:M.comma,decodeDotInKeys:typeof J.decodeDotInKeys==="boolean"?J.decodeDotInKeys:M.decodeDotInKeys,decoder:typeof J.decoder==="function"?J.decoder:M.decoder,delimiter:typeof J.delimiter==="string"||w.isRegExp(J.delimiter)?J.delimiter:M.delimiter,depth:typeof J.depth==="number"||J.depth===!1?+J.depth:M.depth,duplicates:H,ignoreQueryPrefix:J.ignoreQueryPrefix===!0,interpretNumericEntities:typeof J.interpretNumericEntities==="boolean"?J.interpretNumericEntities:M.interpretNumericEntities,parameterLimit:typeof J.parameterLimit==="number"?J.parameterLimit:M.parameterLimit,parseArrays:J.parseArrays!==!1,plainObjects:typeof J.plainObjects==="boolean"?J.plainObjects:M.plainObjects,strictDepth:typeof J.strictDepth==="boolean"?!!J.strictDepth:M.strictDepth,strictNullHandling:typeof J.strictNullHandling==="boolean"?J.strictNullHandling:M.strictNullHandling,throwOnLimitExceeded:typeof J.throwOnLimitExceeded==="boolean"?J.throwOnLimitExceeded:!1}};K.exports=function(J,z){var H=q(z);if(J===""||J===null||typeof J>"u")return H.plainObjects?{__proto__:null}:{};var b=typeof J==="string"?$(J,H):J,Q=H.plainObjects?{__proto__:null}:{},X=Object.keys(b);for(var W=0;W<X.length;++W){var V=X[W],o=B(V,b[V],H,typeof J==="string");Q=w.merge(Q,o,H)}if(H.allowSparse===!0)return Q;return w.compact(Q)}}),x3=_((c,K)=>{var w=k3(),P=R3(),h=T4();K.exports={formats:h,parse:P,stringify:w}}),t1=S4(e4(),1),Z3={};K3(Z3,{zodSchemaKey:()=>o3,webSocketServerArgsKey:()=>I2,webSocketMessageArgsKey:()=>d2,webSocketKey:()=>h4,webSocketEventKey:()=>m3,webSocketEventArgumentsKey:()=>A3,webSocketConnectionArgsKey:()=>D2,webSocketCloseReasonArgsKey:()=>P6,webSocketCloseCodeArgsKey:()=>w6,routeModelArgsKey:()=>mc,responseStatusTextArgsKey:()=>M6,responseStatusArgsKey:()=>a2,responseHeadersArgsKey:()=>oc,responseBodyArgsKey:()=>s2,requestHeadersArgsKey:()=>K2,requestHeaderArgsKey:()=>ec,requestBodyArgsKey:()=>G2,requestArgsKey:()=>pc,queryArgsKey:()=>h6,paramsArgsKey:()=>y4,paramArgsKey:()=>j2,moduleKey:()=>t2,middlewareKey:()=>i4,interceptorKey:()=>n4,injectableKey:()=>K6,injectKey:()=>P4,httpServerArgsKey:()=>fc,guardKey:()=>c6,controllerKey:()=>w4,controllerHttpKey:()=>r3,contextArgsKey:()=>w2,containerKey:()=>N2,configKey:()=>C4,argumentsKey:()=>Yc});var Yc=Symbol("__bool:arguments__"),A3=Symbol("__bool:webSocketEventArguments__"),C4=Symbol("__bool:config__"),w4=Symbol("__bool:controller__"),n4=Symbol("__bool:interceptor__"),c6=Symbol("__bool:guard__"),r3=Symbol("__bool:controller.http__"),P4=Symbol("__bool:inject__"),K6=Symbol("__bool:injectable__"),i4=Symbol("__bool:middleware__"),t2=Symbol("__bool:module__"),N2=Symbol("__bool:container__"),o3=Symbol("__bool:zodSchema__"),h4=Symbol("__bool:webSocket__"),m3=Symbol("__bool:webSocket:event__"),I2=Symbol("__bool:webSocketArguments:server__"),D2=Symbol("__bool:webSocketArguments:connection__"),d2=Symbol("__bool:webSocketArguments:message__"),w6=Symbol("__bool:webSocketArguments:closeCode__"),P6=Symbol("__bool:webSocketArguments:closeReason__"),fc=Symbol("__bool:httpArguments:server__"),K2=Symbol("__bool:httpArguments:requestHeaders__"),ec=Symbol("__bool:httpArguments:requestHeader__"),G2=Symbol("__bool:httpArguments:requestBody__"),y4=Symbol("__bool:httpArguments:params__"),j2=Symbol("__bool:httpArguments:param__"),h6=Symbol("__bool:httpArguments:query__"),pc=Symbol("__bool:httpArguments:request__"),oc=Symbol("__bool:httpArguments:responseHeaders__"),w2=Symbol("__bool:httpArguments:context__"),mc=Symbol("__bool:httpArguments:routeModel__"),s2=Symbol("__bool:httpArguments:responseBody__"),a2=Symbol("__bool:httpArguments:responseStatus__"),M6=Symbol("__bool:httpArguments:responseStatusText__"),S6=(c)=>(K,w,P)=>{if(!w)return;let h=Reflect.getOwnMetadata(Yc,K.constructor,w)||{};h[`argumentIndexes.${P}`]={index:P,type:K2,validationSchema:c},Reflect.defineMetadata(Yc,h,K.constructor,w)};var J4=(c)=>(K,w,P)=>{if(!w)return;let h=Reflect.getOwnMetadata(Yc,K.constructor,w)||{};h[`argumentIndexes.${P}`]={index:P,type:w2,key:c},Reflect.defineMetadata(Yc,h,K.constructor,w)},b6=()=>(c,K,w)=>{if(!K)return;let P=Reflect.getOwnMetadata(Yc,c.constructor,K)||{};P[`argumentIndexes.${w}`]={index:w,type:mc},Reflect.defineMetadata(Yc,P,c.constructor,K)};var O6=(c)=>(K,w,P)=>{let h=Reflect.getMetadata(P4,K)||[];h[P]=c,Reflect.defineMetadata(P4,h,K)};var J6=()=>(c)=>{Reflect.defineMetadata(n4,void 0,c)},W6=()=>(c)=>{Reflect.defineMetadata(i4,void 0,c)};var d1=Symbol("__bool:webSocket.upgrade__");var u3=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()?u3[c]:w.trim(),this.data=K}}var C3=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()?C3[c]:w.trim(),this.data=K}}var y3=(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})},kc;(function(c){c.year="year",c.month="month",c.day="day",c.hours="hours",c.minutes="minutes",c.seconds="seconds",c.miliseconds="miliseconds"})(kc||(kc={}));var _3=(c,K,w=kc.day)=>{let P=c instanceof Date?c:new Date(c);switch(w){case kc.year:P.setFullYear(P.getFullYear()+K);break;case kc.month:P.setMonth(P.getMonth()+K);break;case kc.day:P.setDate(P.getDate()+K);break;case kc.hours:P.setHours(P.getHours()+K);break;case kc.minutes:P.setMinutes(P.getMinutes()+K);break;case kc.seconds:P.setSeconds(P.getSeconds()+K);break;case kc.miliseconds:P.setMilliseconds(P.getMilliseconds()+K);break}return P},f3=S4(x3(),1),s1=async function(){}.constructor,fK=Object.freeze({black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37,gray:90}),eK=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:h,underline:M}=K,S="";if(h)S+="\x1B[1m";if(M)S+="\x1B[4m";if(w&&fK[w])S+=`\x1B[${fK[w]}m`;if(P&&eK[P])S+=`\x1B[${eK[P]}m`;return`${S}${c}\x1B[0m`},e3=(c)=>{let{headers:K,method:w}=c,P=K.get("upgrade")?.toLowerCase()||"",h=K.get("connection")?.toLowerCase()||"";return w==="GET"&&P?.toLowerCase()==="websocket"&&h?.toLowerCase().includes("upgrade")};class c4{_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 lc{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("/"),h=this._thinAlias(c).split("/");if(!w)return;if(P.length!==h.length)return;let M=Object(),S=this.alias.replace(new RegExp(lc.rootPattern,"g"),lc.innerRootPattern);if(!new RegExp(S).test(this._thinAlias(c)))return;for(let O=0;O<P.length;O++){let G=P[O],D=h[O];if(!new RegExp(lc.rootPattern,"g").test(G)){if(G!==D)return}else{let $=!1;if(G.replace(new RegExp(lc.rootPattern,"g"),(L,B,q)=>{if(q===0)D.replace(new RegExp(lc.innerRootPattern,"g"),(J,z,H)=>{if(H===0)Object.assign(M,{[B]:J});return J});return L}),$)return}continue}return Object.freeze({parameters:M,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 h=Object();for(let M=0;M<w.length;M++){let S=w[M],O=P[M];if(!new RegExp(lc.rootPattern,"g").test(S)){if(S!==O)return!1}else{let G=!1;if(S.replace(new RegExp(lc.rootPattern,"g"),(D,$,L)=>{if(!new RegExp(L,"g").test(O))G=!0;else Object.assign(h,{[$]:O});return""}),G)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,h)=>`${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,h)=>"(.*?)")}return c.replace(w,(P,h,M)=>M)}).join("/")}}var p3=lc;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 p3(`${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 h=P.test(c,K);if(!h)continue;return h}return}}var a1=S4(e4(),1);class K4{_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(![K6,w4,i4,c6,n4,h4].some((h)=>K.includes(h)))throw Error("Missing dependency declaration, please check @Injectable() used on dependency(ies).");let w=(Reflect.getOwnMetadata(P4,c)||[]).map((h)=>this.get(h)),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 N6{error;constructor(c){this.error=c}}var l3=N6;class I6{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 M4{rawPrefix;prefix;routers=[];constructor(c="/"){this.rawPrefix=c,this.prefix=M4.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,h]of w.entries())c.set(`/${M4.thinPrefix(`${this.prefix}/${P}`)}`,h)}return c}static thinPrefix(c){return c.replace(new RegExp("[/]{2,}","g"),"/").replace(new RegExp("^[/]|[/]$","g"),"")}}class T3{classConstructor;options;#c;#K;#w=new K4;#P=new Map;#M;#S=900;#h;constructor(c,K){if(this.classConstructor=c,this.options=K,this.#K=Reflect.getOwnMetadataKeys(c),!this.#K.includes(N2)&&!this.#K.includes(t2))throw Error(`Can not detect! ${c.name} class is not a container or module.`);this.#S=typeof K.static?.cacheTimeInSeconds!=="number"?900:K.static.cacheTimeInSeconds,this.#M=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.#h=c}async preLaunch(){if(this.#c)return this.#c;let c=!this.#K.includes(N2)?void 0:Reflect.getOwnMetadata(N2,this.classConstructor),K=!this.#K.includes(N2)?[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((S)=>this.moduleResolution({moduleClass:S,options:this.options,extendInjector:!w?this.#w:w.injector})));if([...new Set(P.map((S)=>S.prefix))].length!==P.length)throw Error("Module prefix should be unique.");let h=new Map;for(let S of P){let O=S.webSocketRouterGroup.execute();for(let[G,D]of O.entries())h.set(G,D)}let M=Object.freeze({containerMetadata:c,modulesConverted:K,resolutedContainer:w,resolutedModules:P,webSocketsMap:h});return this.#c=M,M}async listen(){let{allowLogsMethods:c,allowOrigins:K,allowMethods:w,allowHeaders:P,allowCredentials:h,staticOption:M}=this.#M,{resolutedContainer:S,resolutedModules:O,webSocketsMap:G}=await this.preLaunch(),D=Bun.serve({port:this.options.port,fetch:async($,L)=>{let B=performance.now(),q=new URL($.url),J=f3.parse(q.searchParams.toString(),this.options.queryParser),z=$.headers.get("origin")||"*",H=$.method.toUpperCase(),b=new Headers,Q=new c4().setOptions({isStatic:!0}).set(fc,L).set(pc,$).set(ec,$.headers).set(oc,b).set(h6,J);try{let X=e3($),W;if(X){for(let A of O){let u=A.webSocketHttpRouterGroup.find(q.pathname,$.method);if(u){W=Object.freeze({route:u,resolution:A});break}}if(!W)return this.finalizeResponse(new Response(JSON.stringify({httpCode:404,message:"Route not found",data:void 0}),{status:404,statusText:"Not found.",headers:b}));let k=await this.webSocketFetcher({request:$,server:L},{query:J,responseHeaders:b,route:W.route,moduleResolution:W.resolution});return k instanceof Response?k:void 0}if([...!h?[]:[{key:"Access-Control-Allow-Credentials",value:"true"}],{key:"Access-Control-Allow-Origin",value:K.includes("*")?"*":!K.includes(z)?K[0]:z},{key:"Access-Control-Allow-Methods",value:w.join(", ")},{key:"Access-Control-Allow-Headers",value:P.join(", ")}].forEach(({key:k,value:A})=>b.set(k,A)),!w.includes(H))return this.finalizeResponse(new Response(void 0,{status:405,statusText:"Method Not Allowed.",headers:b}));if($.method.toUpperCase()==="OPTIONS")return this.finalizeResponse(K.includes("*")||K.includes(z)?new Response(void 0,{status:204,statusText:"No Content.",headers:b}):new Response(void 0,{status:417,statusText:"Expectation Failed.",headers:b}));if(M){let{path:k,headers:A}=M,u=`${k}/${q.pathname}`,n=this.#P.get(u);if(!n){let C=Bun.file(u);if(await C.exists()){if(A)for(let[cc,Oc]of Object.entries(A))b.set(cc,Oc);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>n.expiredAt;if(C)this.#P.delete(u);let cc=!C?n.file:Bun.file(u);if(await cc.exists()){if(this.#P.set(u,Object.freeze({expiredAt:_3(new Date,this.#S,kc.seconds),file:cc})),A)for(let[Oc,wc]of Object.entries(A))b.set(Oc,wc);return b.set("Content-Type",cc.type),this.finalizeResponse(new Response(await cc.arrayBuffer(),{status:200,statusText:"SUCCESS",headers:b}))}}}if(S){let{context:k}=await this.httpFetcher({context:Q,resolutedMap:{injector:S.injector,startMiddlewareGroup:S.startMiddlewareGroup,guardGroup:S.guardGroup},options:{isContainer:!0}});Q=k}for(let k of O){let A=k.controllerRouterGroup.find(q.pathname,H);if(A){W=Object.freeze({route:A,resolution:k});break}}if(!W)Q.setOptions({isStatic:!1}).set(a2,404).set(M6,"Not found.").set(s2,{httpCode:404,message:"Route not found",data:void 0});else{let{context:k}=await this.httpFetcher({context:Q,route:W.route,resolutedMap:W.resolution});Q=k}if(S){let{context:k}=await this.httpFetcher({context:Q,resolutedMap:{injector:S.injector,endMiddlewareGroup:S.endMiddlewareGroup},options:{isContainer:!0}});Q=k}let V=Q.get(oc,{isStatic:!0})||new Headers,o=Q.get(s2,{isStatic:!1})||void 0,U=Q.get(a2,{isStatic:!1}),r=Q.get(a2,{isStatic:!1});return this.serializeResponse({status:typeof U!=="number"?void 0:U,statusText:typeof r!=="string"?void 0:r,headers:V,data:o})}catch(X){return this.options.debug&&console.error(X),this.finalizeResponse(y3(X,b))}finally{if(c){let X=performance.now(),W=c2(q.pathname,{color:"blue"}),V=`${Bun.color("yellow","ansi")}${process.pid}`,o=c2($.method,{color:"yellow",backgroundColor:"blue"}),U=c2(`${$.headers.get("x-forwarded-for")||$.headers.get("x-real-ip")||L.requestIP($)?.address||"<Unknown>"}`,{color:"yellow"}),r=c2(`${Math.round((X-B+Number.EPSILON)*100)/100}ms`,{color:"yellow",backgroundColor:"blue"});c.includes($.method.toUpperCase())&&console.info(`PID: ${V} - Method: ${o} - IP: ${U} - ${W} - Time: ${r}`)}}},websocket:{open:($)=>{let L=`${$.data.pathname}:::open`,B=G.get(L);if(!B)return;let q=B.arguments||{},J=[];for(let[z,H]of Object.entries(q))switch(H.type){case D2:J[H.index]=$;break;case I2:J[H.index]=D;break}B.descriptor.value(...J)},close:($,L,B)=>{let q=`${$.data.pathname}:::close`,J=G.get(q);if(!J)return;let z=J.arguments||{},H=[];for(let[b,Q]of Object.entries(z))switch(Q.type){case D2:H[Q.index]=$;break;case I2:H[Q.index]=D;break;case w6:H[Q.index]=L;break;case P6:H[Q.index]=B;break}J.descriptor.value(...H)},message:($,L)=>{let B=`${$.data.pathname}:::message`,q=G.get(B);if(!q)return;let J=q.arguments||{},z=[];for(let[H,b]of Object.entries(J))switch(b.type){case D2:z[b.index]=$;break;case d2:z[b.index]=L;break;case I2:z[b.index]=D;break}q.descriptor.value(...z)},drain:($)=>{let L=`${$.data.pathname}:::drain`,B=G.get(L);if(!B)return;let q=B.arguments||{},J=[];for(let[z,H]of Object.entries(q))switch(H.type){case D2:J[H.index]=$;break;case I2:J[H.index]=D;break}B.descriptor.value(...J)},ping:($,L)=>{let B=`${$.data.pathname}:::ping`,q=G.get(B);if(!q)return;let J=q.arguments||{},z=[];for(let[H,b]of Object.entries(J))switch(b.type){case D2:z[b.index]=$;break;case I2:z[b.index]=D;break;case d2:z[b.index]=L;break}q.descriptor.value(...z)},pong:($,L)=>{let B=`${$.data.pathname}:::pong`,q=G.get(B);if(!q)return;let J=q.arguments||{},z=[];for(let[H,b]of Object.entries(J))switch(b.type){case D2:z[b.index]=$;break;case I2:z[b.index]=D;break;case d2:z[b.index]=L;break}q.descriptor.value(...z)}}})}async containerResolution({containerClass:c,options:K,extendInjector:w}){if(!Reflect.getOwnMetadataKeys(c).includes(N2))throw Error(`${c.name} is not a container.`);let P=new K4(w),h=Reflect.getOwnMetadata(N2,c),{loaders:M,middlewares:S,guards:O,dependencies:G,config:D}=h||{},{config:$}=Object.freeze({config:{...typeof K.config!=="function"?K.config:await K.config(),...typeof D!=="function"?typeof D!=="object"?void 0:("key"in D)&&("value"in D)&&typeof D.key==="symbol"?typeof D.value!=="function"?D.value:await D.value():D:await D()}});if(P.set(D&&"key"in D&&"value"in D&&typeof D.key==="symbol"?D.key:C4,$),M){let J=[];for(let[H,b]of Object.entries(M))J.push(async()=>{try{let Q=await b({config:$});return console.info(`${c2(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${H}] initialized successfully.`),Q}catch(Q){throw console.error(`${c2(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${H}] initialization failed.`),K.debug&&console.error(Q),Q}});let z=await Promise.all(J.map((H)=>H()));for(let[H,b]of z)P.set(H,b)}!G||G.map((J)=>P.get(J));let L=[],B=[];!S||S.forEach((J)=>{let z=P.get(J);if(z.start&&typeof z.start==="function"){let H=Reflect.getOwnMetadata(Yc,J,"start")||{};L.push(Object.freeze({class:J,funcName:"start",func:z.start.bind(z),argumentsMetadata:H}))}if(z.end&&typeof z.end==="function"){let H=Reflect.getOwnMetadata(Yc,J,"end")||{};B.push(Object.freeze({class:J,funcName:"end",func:z.end.bind(z),argumentsMetadata:H}))}});let q=!O?[]:O.map((J)=>{let z=P.get(J),H=Reflect.getOwnMetadata(Yc,J,"enforce")||{};return Object.freeze({class:J,funcName:"enforce",func:z.enforce.bind(z),argumentsMetadata:H})});return Object.freeze({injector:P,startMiddlewareGroup:L,endMiddlewareGroup:B,guardGroup:q})}async moduleResolution({moduleClass:c,options:K,extendInjector:w}){if(!Reflect.getOwnMetadataKeys(c).includes(t2))throw Error(`${c.name} is not a module.`);let P=new K4(w),h=Reflect.getOwnMetadata(t2,c),{loaders:M,middlewares:S,guards:O,interceptors:G,controllers:D,dependencies:$,webSockets:L,prefix:B,config:q}=h||{},J=`${K.prefix||""}/${B||""}`,{config:z}=Object.freeze({config:{...typeof K.config!=="function"?K.config:await K.config(),...typeof q!=="function"?typeof q!=="object"?void 0:("key"in q)&&("value"in q)&&typeof q.key==="symbol"?typeof q.value!=="function"?q.value:await q.value():q:await q()}});if(P.set(q&&"key"in q&&"value"in q&&typeof q.key==="symbol"?q.key:C4,z),M){let r=[];for(let[A,u]of Object.entries(M))r.push(async()=>{try{let n=await u({config:z});return console.info(`${c2(" INFO ",{color:"white",backgroundColor:"blue",bold:!0})} Loader [${A}] initialized successfully.`),n}catch(n){throw console.error(`${c2(" WARN ",{color:"yellow",backgroundColor:"red",bold:!0})} Loader [${A}] initialization failed.`),K.debug&&console.error(n),n}});let k=await Promise.all(r.map((A)=>A()));for(let A=0;A<k.length;A++){let[u,n]=k[A];P.set(u,n)}}!$||$.map((r)=>P.get(r));let H=[],b=[];!S||S.forEach((r)=>{let k=P.get(r);if(k.start&&typeof k.start==="function"){let A=Reflect.getOwnMetadata(Yc,r,"start")||{};H.push(Object.freeze({class:r,funcName:"start",func:k.start.bind(k),argumentsMetadata:A}))}if(k.end&&typeof k.end==="function"){let A=Reflect.getOwnMetadata(Yc,r,"end")||{};b.push(Object.freeze({class:r,funcName:"end",func:k.end.bind(k),argumentsMetadata:A}))}});let Q=!O?[]:O.map((r)=>{let k=P.get(r),A=Reflect.getOwnMetadata(Yc,r,"enforce")||{};return Object.freeze({class:r,funcName:"enforce",func:k.enforce.bind(k),argumentsMetadata:A})}),X=[],W=[];!G||G.forEach((r)=>{let k=P.get(r);if(k.open&&typeof k.open==="function"){let A=Reflect.getOwnMetadata(Yc,r,"open")||{};X.push(Object.freeze({class:r,funcName:"open",func:k.open.bind(k),argumentsMetadata:A}))}if(k.close&&typeof k.close==="function"){let A=Reflect.getOwnMetadata(Yc,r,"close")||{};W.push(Object.freeze({class:r,funcName:"close",func:k.close.bind(k),argumentsMetadata:A}))}});let V=new f4;!D||D.forEach((r)=>this.initControllerInstance({controllerConstructor:r,httpRouterGroup:V,injector:P,prefix:J}));let o=new f4,U=new M4;return L&&L.forEach((r)=>this.initWebSocketInstance({webSocketConstructor:r,httpRouterGroup:o,webSocketRouterGroup:U,injector:P,prefix:J})),Object.freeze({prefix:B||"",injector:P,startMiddlewareGroup:H,endMiddlewareGroup:b,guardGroup:Q,openInterceptorGroup:X,closeInterceptorGroup:W,controllerRouterGroup:V,webSocketHttpRouterGroup:o,webSocketRouterGroup:U})}async argumentsResolution(c,K,w,P){if(!this.#h)return c;try{let h=await this.#h.validate(c,K,w,P);if(!(h instanceof l3))return h;throw new P2({httpCode:400,message:`Validation at the [${P.toString()}] method fails at positional argument [${w}].`,data:h.error})}catch(h){if(h instanceof P2)throw h;throw new t4({httpCode:500,message:`Validation at the [${P.toString()}] method error at positional argument [${w}].`,data:!(h instanceof Error)?h:[{message:h.message,code:h.name,cause:h.cause}]})}}initControllerInstance({controllerConstructor:c,httpRouterGroup:K,injector:w,prefix:P}){if(!Reflect.getOwnMetadataKeys(c).includes(w4))throw Error(`${c.name} is not a controller.`);let h=w.get(c);if(!h)throw Error("Can not initialize controller.");let M=Reflect.getOwnMetadata(w4,c)||{prefix:"/",httpMetadata:[]},S=new _4(`/${P||""}/${M.prefix}`);return M.httpMetadata.forEach((O)=>{if(typeof O.descriptor.value!=="function")return;let G=S.route(O.path),D=O.descriptor.value.bind(h),$=Object.freeze({class:c,funcName:O.methodName,func:D,argumentsMetadata:O.argumentsMetadata});switch(O.httpMethod){case"GET":return G.get($);case"POST":return G.post($);case"PUT":return G.put($);case"PATCH":return G.patch($);case"DELETE":return G.delete($);case"OPTIONS":return G.options($)}}),K.add(S)}initWebSocketInstance({injector:c,httpRouterGroup:K,prefix:w,webSocketRouterGroup:P,webSocketConstructor:h}){if(!Reflect.getOwnMetadataKeys(h).includes(h4))throw Error(`${h.name} is not a websocket route.`);let M=c.get(h);if(!M)throw Error("Can not initialize webSocket.");let S=Reflect.getOwnMetadata(h4,h)||{prefix:"/",events:[],http:[]},O=`/${w||""}/${S.prefix}`,G=new _4(O);for(let[$,L]of Object.entries(S.http)){if(typeof L.descriptor?.value!=="function")continue;let B=G.route(L.path),q=L.descriptor.value.bind(M),J=Object.freeze({class:h,funcName:L.methodName,func:q,argumentsMetadata:L.argumentsMetadata});switch(L.httpMethod){case"GET":B.get(J);break;case"POST":B.post(J);break}}K.add(G);let D=new d4(O);for(let[$,L]of Object.entries(S.events)){let B=new I6({eventName:$,metadata:L});D.addRoutes(B)}return D.bind(M),P.addRouters(D),Object.freeze({httpRouterGroup:K,webSocketRouterGroup:P})}serializeResponse({status:c,statusText:K,headers:w,data:P}){let h=w.get("Content-Type")||"text/plain";if(h.includes("application/json"))return this.finalizeResponse(new Response(P instanceof ReadableStream?P:JSON.stringify(P),{status:c,statusText:K,headers:w}));if(h.includes("text/plain")||h.includes("text/html"))return this.finalizeResponse(new Response(P instanceof ReadableStream?P:String(P),{status:c,statusText:K,headers:w}));if(h.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(h.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 h={isStatic:!0},M=(!c?new c4:new c4(c)).setOptions(h);if(K)M.set(y4,K.parameters).set(mc,K.model);let S=M.get(fc,h)||void 0,O=M.get(pc,h)||void 0,G=M.get(ec,h)||void 0,D=M.get(oc,h)||void 0,$=M.get(y4,h)||void 0,L=M.get(mc,h)||void 0;if(P){let{startMiddlewareGroup:B,guardGroup:q}=P;if(B)for(let J=0;J<B.length;J++){let z=[],{func:H,funcName:b,argumentsMetadata:Q}=B[J];for(let[X,W]of Object.entries(Q))switch(W.type){case w2:z[W.index]=!W.key?M:M.get(W.key,h);break;case pc:z[W.index]=!W.validationSchema?O:await this.argumentsResolution(O,W.validationSchema,W.index,b);break;case G2:z[W.index]=!W.validationSchema?await O?.[W.parser||"json"]():await this.argumentsResolution(await O?.[W.parser||"json"](),W.validationSchema,W.index,b);break;case K2:z[W.index]=!W.validationSchema?G:await this.argumentsResolution(G?.toJSON(),W.validationSchema,W.index,b);break;case ec:z[W.index]=!W.validationSchema?G?.get(W.key)||void 0:await this.argumentsResolution(G?.get(W.key)||void 0,W.validationSchema,W.index,b);break;case j2:z[W.index]=!W.validationSchema?$?.[W.key]||void 0:await this.argumentsResolution($?.[W.key]||void 0,W.validationSchema,W.index,b);break;case mc:z[W.index]=L;break;case oc:z[W.index]=D;break;case fc:z[W.index]=S;break;default:z[W.index]=!W.validationSchema?!M.has(W.type,h)?void 0:M.get(W.type,h):await this.argumentsResolution(!(W.type in M)?void 0:M.get(W.type,h),W.validationSchema,W.index,b);break}await H(...z)}if(q)for(let J=0;J<q.length;J++){let z=[],{func:H,funcName:b,argumentsMetadata:Q}=q[J];for(let[W,V]of Object.entries(Q))switch(V.type){case pc:z[V.index]=!V.validationSchema?O:await this.argumentsResolution(O,V.validationSchema,V.index,b);break;case G2:z[V.index]=!V.validationSchema?await O?.[V.parser||"json"]():await this.argumentsResolution(await O?.[V.parser||"json"](),V.validationSchema,V.index,b);break;case w2:z[V.index]=!V.key?M:M.get(V.key);break;case K2:z[V.index]=!V.validationSchema?G:await this.argumentsResolution(G?.toJSON(),V.validationSchema,V.index,b);break;case oc:z[V.index]=D;break;case ec:z[V.index]=!V.validationSchema?G?.get(V.key)||void 0:await this.argumentsResolution(G?.get(V.key)||void 0,V.validationSchema,V.index,b);break;case j2:z[V.index]=!V.validationSchema?$?.[V.key]||void 0:await this.argumentsResolution($?.[V.key],V.validationSchema,V.index,b);break;case mc:z[V.index]=L;break;case fc:z[V.index]=S;break;default:z[V.index]=!V.validationSchema?!M.has(V.type)?void 0:M.get(V.type):await this.argumentsResolution(M.get(V.type),V.validationSchema,V.index,b);break}let X=await H(...z);if(typeof X!=="boolean"||!X)throw new P2({httpCode:401,message:"Unauthorization.",data:void 0})}}if(L&&!w?.isContainer){if(P&&"openInterceptorGroup"in P&&P.openInterceptorGroup){let{openInterceptorGroup:H}=P;for(let b=0;b<H.length;b++){let Q=[],{func:X,funcName:W,argumentsMetadata:V}=H[b];for(let[o,U]of Object.entries(V))switch(U.type){case pc:Q[U.index]=!U.validationSchema?O:await this.argumentsResolution(O,U.validationSchema,U.index,W);break;case G2:Q[U.index]=!U.validationSchema?await O?.[U.parser||"json"]():await this.argumentsResolution(await O?.[U.parser||"json"](),U.validationSchema,U.index,W);break;case w2:Q[U.index]=!U.key?M:M.get(U.key);break;case K2:Q[U.index]=!U.validationSchema?G:await this.argumentsResolution(G?.toJSON(),U.validationSchema,U.index,W);break;case ec:Q[U.index]=!U.validationSchema?G?.get(U.key)||void 0:await this.argumentsResolution(G?.get(U.key)||void 0,U.validationSchema,U.index,W);break;case oc:Q[U.index]=D;break;case j2:Q[U.index]=!U.validationSchema?$?.[U.key]||void 0:await this.argumentsResolution($?.[U.key]||void 0,U.validationSchema,U.index,W);break;case mc:Q[U.index]=L;break;case fc:Q[U.index]=S;break;default:Q[U.index]=!U.validationSchema?!M.has(U.type)?void 0:M.get(U.type):await this.argumentsResolution(M.get(U.type),U.validationSchema,U.index,W);break}await X(...Q)}}let B=[],{func:q,funcName:J,argumentsMetadata:z}=L;for(let[H,b]of Object.entries(z))switch(b.type){case pc:B[b.index]=!b.validationSchema?O:await this.argumentsResolution(O,b.validationSchema,b.index,J);break;case G2:B[b.index]=!b.validationSchema?await O?.[b.parser||"json"]():await this.argumentsResolution(await O?.[b.parser||"json"](),b.validationSchema,b.index,J);break;case w2:B[b.index]=!b.key?M:M.get(b.key);break;case K2:B[b.index]=!b.validationSchema?G:await this.argumentsResolution(G?.toJSON(),b.validationSchema,b.index,J);break;case ec:B[b.index]=!b.validationSchema?G?.get(b.key)||void 0:await this.argumentsResolution(G?.get(b.key)||void 0,b.validationSchema,b.index,J);break;case oc:B[b.index]=D;break;case j2:B[b.index]=!b.validationSchema?$?.[b.key]||void 0:await this.argumentsResolution($?.[b.key]||void 0,b.validationSchema,b.index,J);break;case mc:B[b.index]=L;break;case fc:B[b.index]=S;break;default:B[b.index]=!b.validationSchema?!M.has(b.type)?void 0:M.get(b.type):await this.argumentsResolution(M.get(b.type),b.validationSchema,b.index,J);break}if(M.set(s2,await q(...B),{isStatic:!1}),P&&"closeInterceptorGroup"in P&&P.closeInterceptorGroup){let{closeInterceptorGroup:H}=P;for(let b=0;b<H.length;b++){let Q=[],{func:X,funcName:W,argumentsMetadata:V}=H[b];for(let[o,U]of Object.entries(V))switch(U.type){case pc:Q[U.index]=!U.validationSchema?O:await this.argumentsResolution(O,U.validationSchema,U.index,W);break;case G2:Q[U.index]=!U.validationSchema?await O?.[U.parser||"json"]():await this.argumentsResolution(await O?.[U.parser||"json"](),U.validationSchema,U.index,W);break;case w2:Q[U.index]=!U.key?M:M.get(U.key);break;case K2:Q[U.index]=!U.validationSchema?G:await this.argumentsResolution(G?.toJSON(),U.validationSchema,U.index,W);break;case oc:Q[U.index]=M.get(U.type);break;case ec:Q[U.index]=!U.validationSchema?G?.get(U.key)||void 0:await this.argumentsResolution(G?.get(U.key)||void 0,U.validationSchema,U.index,W);break;case j2:Q[U.index]=!U.validationSchema?$?.[U.key]||void 0:await this.argumentsResolution($?.[U.key]||void 0,U.validationSchema,U.index,W);break;case mc:Q[U.index]=L;break;case fc:Q[U.index]=S;break;default:Q[U.index]=!U.validationSchema?!M.has(U.type)?void 0:M.get(U.type):await this.argumentsResolution(M.get(U.type),U.validationSchema,U.index,W);break}await X(...Q)}}}if(P){let{endMiddlewareGroup:B}=P;if(B)for(let q=0;q<B.length;q++){let J=[],{func:z,funcName:H,argumentsMetadata:b}=B[q];for(let[Q,X]of Object.entries(b))switch(X.type){case pc:J[X.index]=!X.validationSchema?O:await this.argumentsResolution(O,X.validationSchema,X.index,H);break;case G2:J[X.index]=!X.validationSchema?await O?.[X.parser||"json"]():await this.argumentsResolution(await O?.[X.parser||"json"](),X.validationSchema,X.index,H);break;case w2:J[X.index]=!X.key?M:M.get(X.key);break;case K2:J[X.index]=!X.validationSchema?G:await this.argumentsResolution(G?.toJSON(),X.validationSchema,X.index,H);break;case oc:J[X.index]=M.get(X.type);break;case ec:J[X.index]=!X.validationSchema?G?.get(X.key)||void 0:await this.argumentsResolution(G?.get(X.key)||void 0,X.validationSchema,X.index,H);break;case j2:J[X.index]=!X.validationSchema?$?.[X.key]||void 0:await this.argumentsResolution($?.[X.key]||void 0,X.validationSchema,X.index,H);break;case mc:J[X.index]=L;break;case fc:J[X.index]=S;break;default:J[X.index]=!X.validationSchema?!M.has(X.type)?void 0:M.get(X.type):await this.argumentsResolution(!(X.type in M)?void 0:M.get(X.type),X.validationSchema,X.index,H);break}await z(...J)}}return Object.freeze({context:M})}async webSocketFetcher(c,K){let{request:w,server:P}=c,{query:h,responseHeaders:M,route:{model:S}}=K,O=await S.func(...[P,w,h]);if(typeof O!=="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:M}));if(!O)return this.finalizeResponse(new Response(JSON.stringify({httpCode:500,message:"Can not upgrade.",data:void 0}),{status:500,statusText:"Internal server error.",headers:M}));return O}}var c9=S4(e4(),1);var s4=()=>J4(Gc.authState);var n3=()=>(c)=>{Reflect.defineMetadata(Gc.guardMetadata,void 0,c)};class a4{open(c,K){if(Reflect.getOwnMetadataKeys(c.class.prototype,c.funcName).includes(Gc.authState)){if(!K)throw new P2({httpCode:401,message:"Unauthorized",data:void 0});return}if(Reflect.getOwnMetadataKeys(c.class).includes(Gc.authState)){if(!K)throw new P2({httpCode:401,message:"Unauthorized",data:void 0});return}}}Q2([W2(0,b6()),W2(1,s4())],a4.prototype,"open",null),a4=Q2([J6()],a4);var Tc=new TextEncoder,q2=new TextDecoder;function D6(...c){let K=c.reduce((h,{length:M})=>h+M,0),w=new Uint8Array(K),P=0;for(let h of c)w.set(h,P),P+=h.length;return w}function G6(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 j6(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 X6(c){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof c==="string"?c:q2.decode(c),{alphabet:"base64url"});let K=c;if(K instanceof Uint8Array)K=q2.decode(K);K=K.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return j6(K)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function W4(c){let K=c;if(typeof K==="string")K=Tc.encode(K);if(Uint8Array.prototype.toBase64)return K.toBase64({alphabet:"base64url",omitPadding:!0});return G6(K).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class N4 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 Rc extends N4{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class h2 extends N4{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class cK extends N4{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 KK(c){return parseInt(c.name.slice(4),10)}function d3(c){switch(c){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}function s3(c,K){if(K&&!c.usages.includes(K))throw TypeError(`CryptoKey does not support this operation, its usages must include ${K}.`)}function $6(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(KK(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(KK(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(KK(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=d3(K);if(c.algorithm.namedCurve!==P)throw uc(P,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}s3(c,w)}function B6(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 z6=(c,...K)=>{return B6("Key must be ",c,...K)};function wK(c,K,...w){return B6(`Key for the ${c} algorithm must be `,K,...w)}function PK(c){return c?.[Symbol.toStringTag]==="CryptoKey"}function hK(c){return c?.[Symbol.toStringTag]==="KeyObject"}var MK=(c)=>{return PK(c)||hK(c)};var U6=(...c)=>{let K=c.filter(Boolean);if(K.length===0||K.length===1)return!0;let w;for(let P of K){let h=Object.keys(P);if(!w||w.size===0){w=new Set(h);continue}for(let M of h){if(w.has(M))return!1;w.add(M)}}return!0};function a3(c){return typeof c==="object"&&c!==null}var I4=(c)=>{if(!a3(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 Y6=(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 c0(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 Rc('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 Rc('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 Rc('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 Rc('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new Rc('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:K,keyUsages:w}}var Q6=async(c)=>{if(!c.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:K,keyUsages:w}=c0(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 V6=(c,K,w,P,h)=>{if(h.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((S)=>typeof S!=="string"||S.length===0))throw new c('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let M;if(w!==void 0)M=new Map([...Object.entries(w),...K.entries()]);else M=K;for(let S of P.crit){if(!M.has(S))throw new Rc(`Extension Header Parameter "${S}" is not recognized`);if(h[S]===void 0)throw new c(`Extension Header Parameter "${S}" is missing`);if(M.get(S)&&P[S]===void 0)throw new c(`Extension Header Parameter "${S}" MUST be integrity protected`)}return new Set(P.crit)};function A2(c){return I4(c)&&typeof c.kty==="string"}function q6(c){return c.kty!=="oct"&&(c.kty==="AKP"&&typeof c.priv==="string"||typeof c.d==="string")}function L6(c){return c.kty!=="oct"&&typeof c.d>"u"&&typeof c.priv>"u"}function H6(c){return c.kty==="oct"&&typeof c.k==="string"}var H2,v6=async(c,K,w,P=!1)=>{H2||=new WeakMap;let h=H2.get(c);if(h?.[w])return h[w];let M=await Q6({...K,alg:w});if(P)Object.freeze(c);if(!h)H2.set(c,{[w]:M});else h[w]=M;return M},w0=(c,K)=>{H2||=new WeakMap;let w=H2.get(c);if(w?.[K])return w[K];let P=c.type==="public",h=P?!0:!1,M;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")}M=c.toCryptoKey(c.asymmetricKeyType,h,P?[]:["deriveBits"])}if(c.asymmetricKeyType==="ed25519"){if(K!=="EdDSA"&&K!=="Ed25519")throw TypeError("given KeyObject instance cannot be used for this algorithm");M=c.toCryptoKey(c.asymmetricKeyType,h,[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");M=c.toCryptoKey(c.asymmetricKeyType,h,[P?"verify":"sign"])}}if(c.asymmetricKeyType==="rsa"){let S;switch(K){case"RSA-OAEP":S="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":S="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":S="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":S="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:S},h,P?["encrypt"]:["decrypt"]);M=c.toCryptoKey({name:K.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:S},h,[P?"verify":"sign"])}if(c.asymmetricKeyType==="ec"){let O=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(c.asymmetricKeyDetails?.namedCurve);if(!O)throw TypeError("given KeyObject instance cannot be used for this algorithm");if(K==="ES256"&&O==="P-256")M=c.toCryptoKey({name:"ECDSA",namedCurve:O},h,[P?"verify":"sign"]);if(K==="ES384"&&O==="P-384")M=c.toCryptoKey({name:"ECDSA",namedCurve:O},h,[P?"verify":"sign"]);if(K==="ES512"&&O==="P-521")M=c.toCryptoKey({name:"ECDSA",namedCurve:O},h,[P?"verify":"sign"]);if(K.startsWith("ECDH-ES"))M=c.toCryptoKey({name:"ECDH",namedCurve:O},h,P?[]:["deriveBits"])}if(!M)throw TypeError("given KeyObject instance cannot be used for this algorithm");if(!w)H2.set(c,{[K]:M});else w[K]=M;return M},E6=async(c,K)=>{if(c instanceof Uint8Array)return c;if(PK(c))return c;if(hK(c)){if(c.type==="secret")return c.export();if("toCryptoKey"in c&&typeof c.toCryptoKey==="function")try{return w0(c,K)}catch(P){if(P instanceof TypeError)throw P}let w=c.export({format:"jwk"});return v6(c,w,K)}if(A2(c)){if(c.k)return X6(c.k);return v6(c,c,K,!0)}throw Error("unreachable")};var v2=(c)=>c?.[Symbol.toStringTag],SK=(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},P0=(c,K,w)=>{if(K instanceof Uint8Array)return;if(A2(K)){if(H6(K)&&SK(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(!MK(K))throw TypeError(wK(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"`)},h0=(c,K,w)=>{if(A2(K))switch(w){case"decrypt":case"sign":if(q6(K)&&SK(c,K,w))return;throw TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(L6(K)&&SK(c,K,w))return;throw TypeError("JSON Web Key for this operation be a public JWK")}if(!MK(K))throw TypeError(wK(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}},F6=(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))P0(c,K,w);else h0(c,K,w)};var g6=(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 Rc(`alg ${c} is not supported either by JOSE or your javascript runtime`)}};var k6=async(c,K,w)=>{if(K instanceof Uint8Array){if(!c.startsWith("HS"))throw TypeError(z6(K,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",K,{hash:`SHA-${c.slice(-3)}`,name:"HMAC"},!1,[w])}return $6(K,c,w),K};var M2=(c)=>Math.floor(c.getTime()/1000);var M0=/^(\+|\-)? ?(\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=M0.exec(c);if(!K||K[4]&&K[1])throw TypeError("Invalid time period format");let w=parseFloat(K[2]),P=K[3].toLowerCase(),h;switch(P){case"sec":case"secs":case"second":case"seconds":case"s":h=Math.round(w);break;case"minute":case"minutes":case"min":case"mins":case"m":h=Math.round(w*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":h=Math.round(w*3600);break;case"day":case"days":case"d":h=Math.round(w*86400);break;case"week":case"weeks":case"w":h=Math.round(w*604800);break;default:h=Math.round(w*31557600);break}if(K[1]==="-"||K[4]==="ago")return-h;return h};function X2(c,K){if(!Number.isFinite(K))throw TypeError(`Invalid ${c} input`);return K}class bK{#c;constructor(c){if(!I4(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",M2(c));else this.#c.nbf=M2(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",M2(c));else this.#c.exp=M2(new Date)+D4(c)}set iat(c){if(typeof c>"u")this.#c.iat=M2(new Date);else if(c instanceof Date)this.#c.iat=X2("setIssuedAt",M2(c));else if(typeof c==="string")this.#c.iat=X2("setIssuedAt",M2(new Date)+D4(c));else this.#c.iat=X2("setIssuedAt",c)}}var R6=async(c,K,w)=>{let P=await k6(c,K,"sign");Y6(c,P);let h=await crypto.subtle.sign(g6(c,P.algorithm),P,w);return new Uint8Array(h)};class OK{#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 h2("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!U6(this.#K,this.#w))throw new h2("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let w={...this.#K,...this.#w},P=V6(h2,new Map([["b64",!0]]),K?.crit,this.#K,w),h=!0;if(P.has("b64")){if(h=this.#K.b64,typeof h!=="boolean")throw new h2('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}let{alg:M}=w;if(typeof M!=="string"||!M)throw new h2('JWS "alg" (Algorithm) Header Parameter missing or invalid');F6(M,c,"sign");let S=this.#c;if(h)S=Tc.encode(W4(S));let O;if(this.#K)O=Tc.encode(W4(JSON.stringify(this.#K)));else O=Tc.encode("");let G=D6(O,Tc.encode("."),S),D=await E6(c,M),$=await R6(M,D,G),L={signature:W4($),payload:""};if(h)L.payload=q2.decode(S);if(this.#w)L.header=this.#w;if(this.#K)L.protected=q2.decode(O);return L}}class JK{#c;constructor(c){this.#c=new OK(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 G4{#c;#K;constructor(c={}){this.#K=new bK(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 JK(this.#K.data());if(w.setProtectedHeader(this.#c),Array.isArray(this.#c?.crit)&&this.#c.crit.includes("b64")&&this.#c.b64===!1)throw new cK("JWTs MUST NOT use unencoded payload");return w.sign(c,K)}}var zP=Object.freeze({status:"aborted"});function E(c,K,w){function P(O,G){var D;Object.defineProperty(O,"_zod",{value:O._zod??{},enumerable:!1}),(D=O._zod).traits??(D.traits=new Set),O._zod.traits.add(c),K(O,G);for(let $ in S.prototype)if(!($ in O))Object.defineProperty(O,$,{value:S.prototype[$].bind(O)});O._zod.constr=S,O._zod.def=G}let h=w?.Parent??Object;class M extends h{}Object.defineProperty(M,"name",{value:c});function S(O){var G;let D=w?.Parent?new M:this;P(D,O),(G=D._zod).deferred??(G.deferred=[]);for(let $ of D._zod.deferred)$();return D}return Object.defineProperty(S,"init",{value:P}),Object.defineProperty(S,Symbol.hasInstance,{value:(O)=>{if(w?.Parent&&O instanceof w.Parent)return!0;return O?._zod?.traits?.has(c)}}),Object.defineProperty(S,"name",{value:c}),S}var UP=Symbol("zod_brand");class nc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class r2 extends Error{constructor(c){super(`Encountered unidirectional transform during encode: ${c}`);this.name="ZodEncodeError"}}var j4={};function ic(c){if(c)Object.assign(j4,c);return j4}var a={};m4(a,{unwrapMessage:()=>o2,uint8ArrayToHex:()=>k0,uint8ArrayToBase64url:()=>F0,uint8ArrayToBase64:()=>_6,stringifyPrimitive:()=>o6,shallowClone:()=>A6,safeExtend:()=>V0,required:()=>H0,randomString:()=>X0,propertyKeyTypes:()=>DK,promiseAllObject:()=>j0,primitiveTypes:()=>r6,prefixIssues:()=>y2,pick:()=>U0,partial:()=>L0,optionalKeys:()=>GK,omit:()=>Y0,objectClone:()=>I0,numKeys:()=>$0,nullish:()=>u2,normalizeParams:()=>e,mergeDefs:()=>b2,merge:()=>q0,jsonStringifyReplacer:()=>F2,joinValues:()=>N0,issue:()=>g2,isPlainObject:()=>$2,isObject:()=>E2,hexToUint8Array:()=>g0,getSizableOrigin:()=>C6,getParsedType:()=>B0,getLengthableOrigin:()=>_2,getEnumValues:()=>NK,getElementAtPath:()=>G0,floatSafeRemainder:()=>Z6,finalizeIssue:()=>Cc,extend:()=>Q0,escapeRegex:()=>B2,esc:()=>X4,defineLazy:()=>Kc,createTransparentProxy:()=>z0,cloneDef:()=>D0,clone:()=>xc,cleanRegex:()=>C2,cleanEnum:()=>v0,captureStackTrace:()=>$4,cached:()=>m2,base64urlToUint8Array:()=>E0,base64ToUint8Array:()=>y6,assignProp:()=>S2,assertNotEqual:()=>b0,assertNever:()=>J0,assertIs:()=>O0,assertEqual:()=>S0,assert:()=>W0,allowsEval:()=>IK,aborted:()=>O2,NUMBER_FORMAT_RANGES:()=>m6,Class:()=>f6,BIGINT_FORMAT_RANGES:()=>u6});function S0(c){return c}function b0(c){return c}function O0(c){}function J0(c){throw Error()}function W0(c){}function NK(c){let K=Object.values(c).filter((P)=>typeof P==="number");return Object.entries(c).filter(([P,h])=>K.indexOf(+P)===-1).map(([P,h])=>h)}function N0(c,K="|"){return c.map((w)=>o6(w)).join(K)}function F2(c,K){if(typeof K==="bigint")return K.toString();return K}function m2(c){return{get value(){{let w=c();return Object.defineProperty(this,"value",{value:w}),w}throw Error("cached value already set")}}}function u2(c){return c===null||c===void 0}function C2(c){let K=c.startsWith("^")?1:0,w=c.endsWith("$")?c.length-1:c.length;return c.slice(K,w)}function Z6(c,K){let w=(c.toString().split(".")[1]||"").length,P=K.toString(),h=(P.split(".")[1]||"").length;if(h===0&&/\d?e-\d?/.test(P)){let G=P.match(/\d?e-(\d?)/);if(G?.[1])h=Number.parseInt(G[1])}let M=w>h?w:h,S=Number.parseInt(c.toFixed(M).replace(".","")),O=Number.parseInt(K.toFixed(M).replace(".",""));return S%O/10**M}var x6=Symbol("evaluating");function Kc(c,K,w){let P=void 0;Object.defineProperty(c,K,{get(){if(P===x6)return;if(P===void 0)P=x6,P=w();return P},set(h){Object.defineProperty(c,K,{value:h})},configurable:!0})}function I0(c){return Object.create(Object.getPrototypeOf(c),Object.getOwnPropertyDescriptors(c))}function S2(c,K,w){Object.defineProperty(c,K,{value:w,writable:!0,enumerable:!0,configurable:!0})}function b2(...c){let K={};for(let w of c){let P=Object.getOwnPropertyDescriptors(w);Object.assign(K,P)}return Object.defineProperties({},K)}function D0(c){return b2(c._zod.def)}function G0(c,K){if(!K)return c;return K.reduce((w,P)=>w?.[P],c)}function j0(c){let K=Object.keys(c),w=K.map((P)=>c[P]);return Promise.all(w).then((P)=>{let h={};for(let M=0;M<K.length;M++)h[K[M]]=P[M];return h})}function X0(c=10){let w="";for(let P=0;P<c;P++)w+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return w}function X4(c){return JSON.stringify(c)}var $4="captureStackTrace"in Error?Error.captureStackTrace:(...c)=>{};function E2(c){return typeof c==="object"&&c!==null&&!Array.isArray(c)}var IK=m2(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(c){return!1}});function $2(c){if(E2(c)===!1)return!1;let K=c.constructor;if(K===void 0)return!0;let w=K.prototype;if(E2(w)===!1)return!1;if(Object.prototype.hasOwnProperty.call(w,"isPrototypeOf")===!1)return!1;return!0}function A6(c){if($2(c))return{...c};if(Array.isArray(c))return[...c];return c}function $0(c){let K=0;for(let w in c)if(Object.prototype.hasOwnProperty.call(c,w))K++;return K}var B0=(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}`)}},DK=new Set(["string","number","symbol"]),r6=new Set(["string","number","bigint","boolean","symbol","undefined"]);function B2(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 z0(c){let K;return new Proxy({},{get(w,P,h){return K??(K=c()),Reflect.get(K,P,h)},set(w,P,h,M){return K??(K=c()),Reflect.set(K,P,h,M)},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,h){return K??(K=c()),Reflect.defineProperty(K,P,h)}})}function o6(c){if(typeof c==="bigint")return c.toString()+"n";if(typeof c==="string")return`"${c}"`;return`${c}`}function GK(c){return Object.keys(c).filter((K)=>{return c[K]._zod.optin==="optional"&&c[K]._zod.optout==="optional"})}var m6={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]},u6={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function U0(c,K){let w=c._zod.def,P=b2(c._zod.def,{get shape(){let h={};for(let M in K){if(!(M in w.shape))throw Error(`Unrecognized key: "${M}"`);if(!K[M])continue;h[M]=w.shape[M]}return S2(this,"shape",h),h},checks:[]});return xc(c,P)}function Y0(c,K){let w=c._zod.def,P=b2(c._zod.def,{get shape(){let h={...c._zod.def.shape};for(let M in K){if(!(M in w.shape))throw Error(`Unrecognized key: "${M}"`);if(!K[M])continue;delete h[M]}return S2(this,"shape",h),h},checks:[]});return xc(c,P)}function Q0(c,K){if(!$2(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 h=b2(c._zod.def,{get shape(){let M={...c._zod.def.shape,...K};return S2(this,"shape",M),M},checks:[]});return xc(c,h)}function V0(c,K){if(!$2(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 S2(this,"shape",P),P},checks:c._zod.def.checks};return xc(c,w)}function q0(c,K){let w=b2(c._zod.def,{get shape(){let P={...c._zod.def.shape,...K._zod.def.shape};return S2(this,"shape",P),P},get catchall(){return K._zod.def.catchall},checks:[]});return xc(c,w)}function L0(c,K,w){let P=b2(K._zod.def,{get shape(){let h=K._zod.def.shape,M={...h};if(w)for(let S in w){if(!(S in h))throw Error(`Unrecognized key: "${S}"`);if(!w[S])continue;M[S]=c?new c({type:"optional",innerType:h[S]}):h[S]}else for(let S in h)M[S]=c?new c({type:"optional",innerType:h[S]}):h[S];return S2(this,"shape",M),M},checks:[]});return xc(K,P)}function H0(c,K,w){let P=b2(K._zod.def,{get shape(){let h=K._zod.def.shape,M={...h};if(w)for(let S in w){if(!(S in M))throw Error(`Unrecognized key: "${S}"`);if(!w[S])continue;M[S]=new c({type:"nonoptional",innerType:h[S]})}else for(let S in h)M[S]=new c({type:"nonoptional",innerType:h[S]});return S2(this,"shape",M),M},checks:[]});return xc(K,P)}function O2(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 y2(c,K){return K.map((w)=>{var P;return(P=w).path??(P.path=[]),w.path.unshift(c),w})}function o2(c){return typeof c==="string"?c:c?.message}function Cc(c,K,w){let P={...c,path:c.path??[]};if(!c.message){let h=o2(c.inst?._zod.def?.error?.(c))??o2(K?.error?.(c))??o2(w.customError?.(c))??o2(w.localeError?.(c))??"Invalid input";P.message=h}if(delete P.inst,delete P.continue,!K?.reportInput)delete P.input;return P}function C6(c){if(c instanceof Set)return"set";if(c instanceof Map)return"map";if(c instanceof File)return"file";return"unknown"}function _2(c){if(Array.isArray(c))return"array";if(typeof c==="string")return"string";return"unknown"}function g2(...c){let[K,w,P]=c;if(typeof K==="string")return{message:K,code:"custom",input:w,inst:P};return{...K}}function v0(c){return Object.entries(c).filter(([K,w])=>{return Number.isNaN(Number.parseInt(K,10))}).map((K)=>K[1])}function y6(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 _6(c){let K="";for(let w=0;w<c.length;w++)K+=String.fromCharCode(c[w]);return btoa(K)}function E0(c){let K=c.replace(/-/g,"+").replace(/_/g,"/"),w="=".repeat((4-K.length%4)%4);return y6(K+w)}function F0(c){return _6(c).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function g0(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 k0(c){return Array.from(c).map((K)=>K.toString(16).padStart(2,"0")).join("")}class f6{constructor(...c){}}var e6=(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,F2,2),Object.defineProperty(c,"toString",{value:()=>c.message,enumerable:!1})},B4=E("$ZodError",e6),jK=E("$ZodError",e6,{Parent:Error});function p6(c,K=(w)=>w.message){let w={},P=[];for(let h of c.issues)if(h.path.length>0)w[h.path[0]]=w[h.path[0]]||[],w[h.path[0]].push(K(h));else P.push(K(h));return{formErrors:P,fieldErrors:w}}function l6(c,K){let w=K||function(M){return M.message},P={_errors:[]},h=(M)=>{for(let S of M.issues)if(S.code==="invalid_union"&&S.errors.length)S.errors.map((O)=>h({issues:O}));else if(S.code==="invalid_key")h({issues:S.issues});else if(S.code==="invalid_element")h({issues:S.issues});else if(S.path.length===0)P._errors.push(w(S));else{let O=P,G=0;while(G<S.path.length){let D=S.path[G];if(G!==S.path.length-1)O[D]=O[D]||{_errors:[]};else O[D]=O[D]||{_errors:[]},O[D]._errors.push(w(S));O=O[D],G++}}};return h(c),P}var z4=(c)=>(K,w,P,h)=>{let M=P?Object.assign(P,{async:!1}):{async:!1},S=K._zod.run({value:w,issues:[]},M);if(S instanceof Promise)throw new nc;if(S.issues.length){let O=new(h?.Err??c)(S.issues.map((G)=>Cc(G,M,ic())));throw $4(O,h?.callee),O}return S.value};var U4=(c)=>async(K,w,P,h)=>{let M=P?Object.assign(P,{async:!0}):{async:!0},S=K._zod.run({value:w,issues:[]},M);if(S instanceof Promise)S=await S;if(S.issues.length){let O=new(h?.Err??c)(S.issues.map((G)=>Cc(G,M,ic())));throw $4(O,h?.callee),O}return S.value};var f2=(c)=>(K,w,P)=>{let h=P?{...P,async:!1}:{async:!1},M=K._zod.run({value:w,issues:[]},h);if(M instanceof Promise)throw new nc;return M.issues.length?{success:!1,error:new(c??B4)(M.issues.map((S)=>Cc(S,h,ic())))}:{success:!0,data:M.value}},T6=f2(jK),e2=(c)=>async(K,w,P)=>{let h=P?Object.assign(P,{async:!0}):{async:!0},M=K._zod.run({value:w,issues:[]},h);if(M instanceof Promise)M=await M;return M.issues.length?{success:!1,error:new c(M.issues.map((S)=>Cc(S,h,ic())))}:{success:!0,data:M.value}},n6=e2(jK),i6=(c)=>(K,w,P)=>{let h=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return z4(c)(K,w,h)};var t6=(c)=>(K,w,P)=>{return z4(c)(K,w,P)};var d6=(c)=>async(K,w,P)=>{let h=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return U4(c)(K,w,h)};var s6=(c)=>async(K,w,P)=>{return U4(c)(K,w,P)};var a6=(c)=>(K,w,P)=>{let h=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return f2(c)(K,w,h)};var c8=(c)=>(K,w,P)=>{return f2(c)(K,w,P)};var K8=(c)=>async(K,w,P)=>{let h=P?Object.assign(P,{direction:"backward"}):{direction:"backward"};return e2(c)(K,w,h)};var w8=(c)=>async(K,w,P)=>{return e2(c)(K,w,P)};var P8=/^[cC][^\s-]{8,}$/,h8=/^[0-9a-z]+$/,M8=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,S8=/^[0-9a-vA-V]{20}$/,b8=/^[A-Za-z0-9]{27}$/,O8=/^[a-zA-Z0-9_-]{21}$/,J8=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var W8=/^([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})$/,XK=(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 N8=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function I8(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var D8=/^(?:(?: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])$/,G8=/^(([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}|:))$/,j8=/^((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])$/,X8=/^(([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])$/,$8=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$K=/^[A-Za-z0-9_-]*$/,B8=/^(?=.{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 z8=/^\+(?:[0-9]){6,14}[0-9]$/,U8="(?:(?:\\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])))",Y8=new RegExp(`^${U8}$`);function Q8(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 V8(c){return new RegExp(`^${Q8(c)}$`)}function q8(c){let K=Q8({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(`^${U8}T(?:${P})$`)}var L8=(c)=>{let K=c?`[\\s\\S]{${c?.minimum??0},${c?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${K}$`)};var H8=/^[^A-Z]*$/,v8=/^[^a-z]*$/;var qc=E("$ZodCheck",(c,K)=>{var w;c._zod??(c._zod={}),c._zod.def=K,(w=c._zod).onattach??(w.onattach=[])});var E8=E("$ZodCheckMaxLength",(c,K)=>{var w;qc.init(c,K),(w=c._zod.def).when??(w.when=(P)=>{let h=P.value;return!u2(h)&&h.length!==void 0}),c._zod.onattach.push((P)=>{let h=P._zod.bag.maximum??Number.POSITIVE_INFINITY;if(K.maximum<h)P._zod.bag.maximum=K.maximum}),c._zod.check=(P)=>{let h=P.value;if(h.length<=K.maximum)return;let S=_2(h);P.issues.push({origin:S,code:"too_big",maximum:K.maximum,inclusive:!0,input:h,inst:c,continue:!K.abort})}}),F8=E("$ZodCheckMinLength",(c,K)=>{var w;qc.init(c,K),(w=c._zod.def).when??(w.when=(P)=>{let h=P.value;return!u2(h)&&h.length!==void 0}),c._zod.onattach.push((P)=>{let h=P._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(K.minimum>h)P._zod.bag.minimum=K.minimum}),c._zod.check=(P)=>{let h=P.value;if(h.length>=K.minimum)return;let S=_2(h);P.issues.push({origin:S,code:"too_small",minimum:K.minimum,inclusive:!0,input:h,inst:c,continue:!K.abort})}}),g8=E("$ZodCheckLengthEquals",(c,K)=>{var w;qc.init(c,K),(w=c._zod.def).when??(w.when=(P)=>{let h=P.value;return!u2(h)&&h.length!==void 0}),c._zod.onattach.push((P)=>{let h=P._zod.bag;h.minimum=K.length,h.maximum=K.length,h.length=K.length}),c._zod.check=(P)=>{let h=P.value,M=h.length;if(M===K.length)return;let S=_2(h),O=M>K.length;P.issues.push({origin:S,...O?{code:"too_big",maximum:K.length}:{code:"too_small",minimum:K.length},inclusive:!0,exact:!0,input:P.value,inst:c,continue:!K.abort})}}),p2=E("$ZodCheckStringFormat",(c,K)=>{var w,P;if(qc.init(c,K),c._zod.onattach.push((h)=>{let M=h._zod.bag;if(M.format=K.format,K.pattern)M.patterns??(M.patterns=new Set),M.patterns.add(K.pattern)}),K.pattern)(w=c._zod).check??(w.check=(h)=>{if(K.pattern.lastIndex=0,K.pattern.test(h.value))return;h.issues.push({origin:"string",code:"invalid_format",format:K.format,input:h.value,...K.pattern?{pattern:K.pattern.toString()}:{},inst:c,continue:!K.abort})});else(P=c._zod).check??(P.check=()=>{})}),k8=E("$ZodCheckRegex",(c,K)=>{p2.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})}}),R8=E("$ZodCheckLowerCase",(c,K)=>{K.pattern??(K.pattern=H8),p2.init(c,K)}),x8=E("$ZodCheckUpperCase",(c,K)=>{K.pattern??(K.pattern=v8),p2.init(c,K)}),Z8=E("$ZodCheckIncludes",(c,K)=>{qc.init(c,K);let w=B2(K.includes),P=new RegExp(typeof K.position==="number"?`^.{${K.position}}${w}`:w);K.pattern=P,c._zod.onattach.push((h)=>{let M=h._zod.bag;M.patterns??(M.patterns=new Set),M.patterns.add(P)}),c._zod.check=(h)=>{if(h.value.includes(K.includes,K.position))return;h.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:K.includes,input:h.value,inst:c,continue:!K.abort})}}),A8=E("$ZodCheckStartsWith",(c,K)=>{qc.init(c,K);let w=new RegExp(`^${B2(K.prefix)}.*`);K.pattern??(K.pattern=w),c._zod.onattach.push((P)=>{let h=P._zod.bag;h.patterns??(h.patterns=new Set),h.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})}}),r8=E("$ZodCheckEndsWith",(c,K)=>{qc.init(c,K);let w=new RegExp(`.*${B2(K.suffix)}$`);K.pattern??(K.pattern=w),c._zod.onattach.push((P)=>{let h=P._zod.bag;h.patterns??(h.patterns=new Set),h.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 o8=E("$ZodCheckOverwrite",(c,K)=>{qc.init(c,K),c._zod.check=(w)=>{w.value=K.tx(w.value)}});class BK{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
19
  `).filter((M)=>M),P=Math.min(...w.map((M)=>M.length-M.trimStart().length)),h=w.map((M)=>M.slice(P)).map((M)=>" ".repeat(this.indent*2)+M);for(let M of h)this.content.push(M)}compile(){let c=Function,K=this?.args,P=[...(this?.content??[""]).map((h)=>` ${h}`)];return new c(...K,P.join(`
20
- `))}}var m8={major:4,minor:1,patch:9};var Wc=E("$ZodType",(c,K)=>{var w;c??(c={}),c._zod.def=K,c._zod.bag=c._zod.bag||{},c._zod.version=m8;let P=[...c._zod.def.checks??[]];if(c._zod.traits.has("$ZodCheck"))P.unshift(c);for(let h of P)for(let M of h._zod.onattach)M(c);if(P.length===0)(w=c._zod).deferred??(w.deferred=[]),c._zod.deferred?.push(()=>{c._zod.run=c._zod.parse});else{let h=(S,O,G)=>{let D=O2(S),B;for(let L of O){if(L._zod.def.when){if(!L._zod.def.when(S))continue}else if(D)continue;let $=S.issues.length,q=L._zod.check(S);if(q instanceof Promise&&G?.async===!1)throw new nc;if(B||q instanceof Promise)B=(B??Promise.resolve()).then(async()=>{if(await q,S.issues.length===$)return;if(!D)D=O2(S,$)});else{if(S.issues.length===$)continue;if(!D)D=O2(S,$)}}if(B)return B.then(()=>{return S});return S},M=(S,O,G)=>{if(O2(S))return S.aborted=!0,S;let D=h(O,P,G);if(D instanceof Promise){if(G.async===!1)throw new nc;return D.then((B)=>c._zod.parse(B,G))}return c._zod.parse(D,G)};c._zod.run=(S,O)=>{if(O.skipChecks)return c._zod.parse(S,O);if(O.direction==="backward"){let D=c._zod.parse({value:S.value,issues:[]},{...O,skipChecks:!0});if(D instanceof Promise)return D.then((B)=>{return M(B,S,O)});return M(D,S,O)}let G=c._zod.parse(S,O);if(G instanceof Promise){if(O.async===!1)throw new nc;return G.then((D)=>h(D,P,O))}return h(G,P,O)}}c["~standard"]={validate:(h)=>{try{let M=l6(c,h);return M.success?{value:M.data}:{issues:M.error?.issues}}catch(M){return T6(c,h).then((S)=>S.success?{value:S.data}:{issues:S.error?.issues})}},vendor:"zod",version:1}}),q4=E("$ZodString",(c,K)=>{Wc.init(c,K),c._zod.pattern=[...c?._zod.bag?.patterns??[]].pop()??q8(c._zod.bag),c._zod.parse=(w,P)=>{if(K.coerce)try{w.value=String(w.value)}catch(h){}if(typeof w.value==="string")return w;return w.issues.push({expected:"string",code:"invalid_type",input:w.value,inst:c}),w}}),hc=E("$ZodStringFormat",(c,K)=>{p2.init(c,K),q4.init(c,K)}),T8=E("$ZodGUID",(c,K)=>{K.pattern??(K.pattern=J8),hc.init(c,K)}),n8=E("$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=jK(P))}else K.pattern??(K.pattern=jK());hc.init(c,K)}),i8=E("$ZodEmail",(c,K)=>{K.pattern??(K.pattern=W8),hc.init(c,K)}),t8=E("$ZodURL",(c,K)=>{hc.init(c,K),c._zod.check=(w)=>{try{let P=w.value.trim(),h=new URL(P);if(K.hostname){if(K.hostname.lastIndex=0,!K.hostname.test(h.hostname))w.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:B8.source,input:w.value,inst:c,continue:!K.abort})}if(K.protocol){if(K.protocol.lastIndex=0,!K.protocol.test(h.protocol.endsWith(":")?h.protocol.slice(0,-1):h.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=h.href;else w.value=P;return}catch(P){w.issues.push({code:"invalid_format",format:"url",input:w.value,inst:c,continue:!K.abort})}}}),d8=E("$ZodEmoji",(c,K)=>{K.pattern??(K.pattern=N8()),hc.init(c,K)}),s8=E("$ZodNanoID",(c,K)=>{K.pattern??(K.pattern=b8),hc.init(c,K)}),a8=E("$ZodCUID",(c,K)=>{K.pattern??(K.pattern=w8),hc.init(c,K)}),cw=E("$ZodCUID2",(c,K)=>{K.pattern??(K.pattern=P8),hc.init(c,K)}),Kw=E("$ZodULID",(c,K)=>{K.pattern??(K.pattern=h8),hc.init(c,K)}),ww=E("$ZodXID",(c,K)=>{K.pattern??(K.pattern=M8),hc.init(c,K)}),Pw=E("$ZodKSUID",(c,K)=>{K.pattern??(K.pattern=S8),hc.init(c,K)}),hw=E("$ZodISODateTime",(c,K)=>{K.pattern??(K.pattern=V8(K)),hc.init(c,K)}),Mw=E("$ZodISODate",(c,K)=>{K.pattern??(K.pattern=U8),hc.init(c,K)}),Sw=E("$ZodISOTime",(c,K)=>{K.pattern??(K.pattern=Q8(K)),hc.init(c,K)}),bw=E("$ZodISODuration",(c,K)=>{K.pattern??(K.pattern=O8),hc.init(c,K)}),Ow=E("$ZodIPv4",(c,K)=>{K.pattern??(K.pattern=I8),hc.init(c,K),c._zod.onattach.push((w)=>{let P=w._zod.bag;P.format="ipv4"})}),Jw=E("$ZodIPv6",(c,K)=>{K.pattern??(K.pattern=D8),hc.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})}}}),Ww=E("$ZodCIDRv4",(c,K)=>{K.pattern??(K.pattern=G8),hc.init(c,K)}),Nw=E("$ZodCIDRv6",(c,K)=>{K.pattern??(K.pattern=j8),hc.init(c,K),c._zod.check=(w)=>{let P=w.value.split("/");try{if(P.length!==2)throw Error();let[h,M]=P;if(!M)throw Error();let S=Number(M);if(`${S}`!==M)throw Error();if(S<0||S>128)throw Error();new URL(`http://[${h}]`)}catch{w.issues.push({code:"invalid_format",format:"cidrv6",input:w.value,inst:c,continue:!K.abort})}}});function Iw(c){if(c==="")return!0;if(c.length%4!==0)return!1;try{return atob(c),!0}catch{return!1}}var Dw=E("$ZodBase64",(c,K)=>{K.pattern??(K.pattern=X8),hc.init(c,K),c._zod.onattach.push((w)=>{w._zod.bag.contentEncoding="base64"}),c._zod.check=(w)=>{if(Iw(w.value))return;w.issues.push({code:"invalid_format",format:"base64",input:w.value,inst:c,continue:!K.abort})}});function R0(c){if(!XK.test(c))return!1;let K=c.replace(/[-_]/g,(P)=>P==="-"?"+":"/"),w=K.padEnd(Math.ceil(K.length/4)*4,"=");return Iw(w)}var Gw=E("$ZodBase64URL",(c,K)=>{K.pattern??(K.pattern=XK),hc.init(c,K),c._zod.onattach.push((w)=>{w._zod.bag.contentEncoding="base64url"}),c._zod.check=(w)=>{if(R0(w.value))return;w.issues.push({code:"invalid_format",format:"base64url",input:w.value,inst:c,continue:!K.abort})}}),jw=E("$ZodE164",(c,K)=>{K.pattern??(K.pattern=$8),hc.init(c,K)});function x0(c,K=null){try{let w=c.split(".");if(w.length!==3)return!1;let[P]=w;if(!P)return!1;let h=JSON.parse(atob(P));if("typ"in h&&h?.typ!=="JWT")return!1;if(!h.alg)return!1;if(K&&(!("alg"in h)||h.alg!==K))return!1;return!0}catch{return!1}}var Xw=E("$ZodJWT",(c,K)=>{hc.init(c,K),c._zod.check=(w)=>{if(x0(w.value,K.alg))return;w.issues.push({code:"invalid_format",format:"jwt",input:w.value,inst:c,continue:!K.abort})}});var Bw=E("$ZodUnknown",(c,K)=>{Wc.init(c,K),c._zod.parse=(w)=>w}),$w=E("$ZodNever",(c,K)=>{Wc.init(c,K),c._zod.parse=(w,P)=>{return w.issues.push({expected:"never",code:"invalid_type",input:w.value,inst:c}),w}});function u8(c,K,w){if(c.issues.length)K.issues.push(...y2(w,c.issues));K.value[w]=c.value}var zw=E("$ZodArray",(c,K)=>{Wc.init(c,K),c._zod.parse=(w,P)=>{let h=w.value;if(!Array.isArray(h))return w.issues.push({expected:"array",code:"invalid_type",input:h,inst:c}),w;w.value=Array(h.length);let M=[];for(let S=0;S<h.length;S++){let O=h[S],G=K.element._zod.run({value:O,issues:[]},P);if(G instanceof Promise)M.push(G.then((D)=>u8(D,w,S)));else u8(G,w,S)}if(M.length)return Promise.all(M).then(()=>w);return w}});function V4(c,K,w,P){if(c.issues.length)K.issues.push(...y2(w,c.issues));if(c.value===void 0){if(w in P)K.value[w]=void 0}else K.value[w]=c.value}function Uw(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=DK(c.shape);return{...c,keys:K,keySet:new Set(K),numKeys:K.length,optionalKeys:new Set(w)}}function Yw(c,K,w,P,h,M){let S=[],O=h.keySet,G=h.catchall._zod,D=G.def.type;for(let B of Object.keys(K)){if(O.has(B))continue;if(D==="never"){S.push(B);continue}let L=G.run({value:K[B],issues:[]},P);if(L instanceof Promise)c.push(L.then(($)=>V4($,w,B,K)));else V4(L,w,B,K)}if(S.length)w.issues.push({code:"unrecognized_keys",keys:S,input:K,inst:M});if(!c.length)return w;return Promise.all(c).then(()=>{return w})}var Z0=E("$ZodObject",(c,K)=>{Wc.init(c,K);let w=m2(()=>Uw(K));Kc(c._zod,"propValues",()=>{let S=K.shape,O={};for(let G in S){let D=S[G]._zod;if(D.values){O[G]??(O[G]=new Set);for(let B of D.values)O[G].add(B)}}return O});let P=E2,h=K.catchall,M;c._zod.parse=(S,O)=>{M??(M=w.value);let G=S.value;if(!P(G))return S.issues.push({expected:"object",code:"invalid_type",input:G,inst:c}),S;S.value={};let D=[],B=M.shape;for(let L of M.keys){let q=B[L]._zod.run({value:G[L],issues:[]},O);if(q instanceof Promise)D.push(q.then((J)=>V4(J,S,L,G)));else V4(q,S,L,G)}if(!h)return D.length?Promise.all(D).then(()=>S):S;return Yw(D,G,S,O,w.value,c)}}),Qw=E("$ZodObjectJIT",(c,K)=>{Z0.init(c,K);let w=c._zod.parse,P=m2(()=>Uw(K)),h=($)=>{let q=new BK(["shape","payload","ctx"]),J=P.value,z=(X)=>{let W=X4(X);return`shape[${W}]._zod.run({ value: input[${W}], issues: [] }, ctx)`};q.write("const input = payload.value;");let H=Object.create(null),b=0;for(let X of J.keys)H[X]=`key_${b++}`;q.write("const newResult = {};");for(let X of J.keys){let W=H[X],V=X4(X);q.write(`const ${W} = ${z(X)};`),q.write(`
20
+ `))}}var u8={major:4,minor:1,patch:9};var Wc=E("$ZodType",(c,K)=>{var w;c??(c={}),c._zod.def=K,c._zod.bag=c._zod.bag||{},c._zod.version=u8;let P=[...c._zod.def.checks??[]];if(c._zod.traits.has("$ZodCheck"))P.unshift(c);for(let h of P)for(let M of h._zod.onattach)M(c);if(P.length===0)(w=c._zod).deferred??(w.deferred=[]),c._zod.deferred?.push(()=>{c._zod.run=c._zod.parse});else{let h=(S,O,G)=>{let D=O2(S),$;for(let L of O){if(L._zod.def.when){if(!L._zod.def.when(S))continue}else if(D)continue;let B=S.issues.length,q=L._zod.check(S);if(q instanceof Promise&&G?.async===!1)throw new nc;if($||q instanceof Promise)$=($??Promise.resolve()).then(async()=>{if(await q,S.issues.length===B)return;if(!D)D=O2(S,B)});else{if(S.issues.length===B)continue;if(!D)D=O2(S,B)}}if($)return $.then(()=>{return S});return S},M=(S,O,G)=>{if(O2(S))return S.aborted=!0,S;let D=h(O,P,G);if(D instanceof Promise){if(G.async===!1)throw new nc;return D.then(($)=>c._zod.parse($,G))}return c._zod.parse(D,G)};c._zod.run=(S,O)=>{if(O.skipChecks)return c._zod.parse(S,O);if(O.direction==="backward"){let D=c._zod.parse({value:S.value,issues:[]},{...O,skipChecks:!0});if(D instanceof Promise)return D.then(($)=>{return M($,S,O)});return M(D,S,O)}let G=c._zod.parse(S,O);if(G instanceof Promise){if(O.async===!1)throw new nc;return G.then((D)=>h(D,P,O))}return h(G,P,O)}}c["~standard"]={validate:(h)=>{try{let M=T6(c,h);return M.success?{value:M.data}:{issues:M.error?.issues}}catch(M){return n6(c,h).then((S)=>S.success?{value:S.data}:{issues:S.error?.issues})}},vendor:"zod",version:1}}),q4=E("$ZodString",(c,K)=>{Wc.init(c,K),c._zod.pattern=[...c?._zod.bag?.patterns??[]].pop()??L8(c._zod.bag),c._zod.parse=(w,P)=>{if(K.coerce)try{w.value=String(w.value)}catch(h){}if(typeof w.value==="string")return w;return w.issues.push({expected:"string",code:"invalid_type",input:w.value,inst:c}),w}}),hc=E("$ZodStringFormat",(c,K)=>{p2.init(c,K),q4.init(c,K)}),n8=E("$ZodGUID",(c,K)=>{K.pattern??(K.pattern=W8),hc.init(c,K)}),i8=E("$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=XK(P))}else K.pattern??(K.pattern=XK());hc.init(c,K)}),t8=E("$ZodEmail",(c,K)=>{K.pattern??(K.pattern=N8),hc.init(c,K)}),d8=E("$ZodURL",(c,K)=>{hc.init(c,K),c._zod.check=(w)=>{try{let P=w.value.trim(),h=new URL(P);if(K.hostname){if(K.hostname.lastIndex=0,!K.hostname.test(h.hostname))w.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:B8.source,input:w.value,inst:c,continue:!K.abort})}if(K.protocol){if(K.protocol.lastIndex=0,!K.protocol.test(h.protocol.endsWith(":")?h.protocol.slice(0,-1):h.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=h.href;else w.value=P;return}catch(P){w.issues.push({code:"invalid_format",format:"url",input:w.value,inst:c,continue:!K.abort})}}}),s8=E("$ZodEmoji",(c,K)=>{K.pattern??(K.pattern=I8()),hc.init(c,K)}),a8=E("$ZodNanoID",(c,K)=>{K.pattern??(K.pattern=O8),hc.init(c,K)}),cw=E("$ZodCUID",(c,K)=>{K.pattern??(K.pattern=P8),hc.init(c,K)}),Kw=E("$ZodCUID2",(c,K)=>{K.pattern??(K.pattern=h8),hc.init(c,K)}),ww=E("$ZodULID",(c,K)=>{K.pattern??(K.pattern=M8),hc.init(c,K)}),Pw=E("$ZodXID",(c,K)=>{K.pattern??(K.pattern=S8),hc.init(c,K)}),hw=E("$ZodKSUID",(c,K)=>{K.pattern??(K.pattern=b8),hc.init(c,K)}),Mw=E("$ZodISODateTime",(c,K)=>{K.pattern??(K.pattern=q8(K)),hc.init(c,K)}),Sw=E("$ZodISODate",(c,K)=>{K.pattern??(K.pattern=Y8),hc.init(c,K)}),bw=E("$ZodISOTime",(c,K)=>{K.pattern??(K.pattern=V8(K)),hc.init(c,K)}),Ow=E("$ZodISODuration",(c,K)=>{K.pattern??(K.pattern=J8),hc.init(c,K)}),Jw=E("$ZodIPv4",(c,K)=>{K.pattern??(K.pattern=D8),hc.init(c,K),c._zod.onattach.push((w)=>{let P=w._zod.bag;P.format="ipv4"})}),Ww=E("$ZodIPv6",(c,K)=>{K.pattern??(K.pattern=G8),hc.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})}}}),Nw=E("$ZodCIDRv4",(c,K)=>{K.pattern??(K.pattern=j8),hc.init(c,K)}),Iw=E("$ZodCIDRv6",(c,K)=>{K.pattern??(K.pattern=X8),hc.init(c,K),c._zod.check=(w)=>{let P=w.value.split("/");try{if(P.length!==2)throw Error();let[h,M]=P;if(!M)throw Error();let S=Number(M);if(`${S}`!==M)throw Error();if(S<0||S>128)throw Error();new URL(`http://[${h}]`)}catch{w.issues.push({code:"invalid_format",format:"cidrv6",input:w.value,inst:c,continue:!K.abort})}}});function Dw(c){if(c==="")return!0;if(c.length%4!==0)return!1;try{return atob(c),!0}catch{return!1}}var Gw=E("$ZodBase64",(c,K)=>{K.pattern??(K.pattern=$8),hc.init(c,K),c._zod.onattach.push((w)=>{w._zod.bag.contentEncoding="base64"}),c._zod.check=(w)=>{if(Dw(w.value))return;w.issues.push({code:"invalid_format",format:"base64",input:w.value,inst:c,continue:!K.abort})}});function x0(c){if(!$K.test(c))return!1;let K=c.replace(/[-_]/g,(P)=>P==="-"?"+":"/"),w=K.padEnd(Math.ceil(K.length/4)*4,"=");return Dw(w)}var jw=E("$ZodBase64URL",(c,K)=>{K.pattern??(K.pattern=$K),hc.init(c,K),c._zod.onattach.push((w)=>{w._zod.bag.contentEncoding="base64url"}),c._zod.check=(w)=>{if(x0(w.value))return;w.issues.push({code:"invalid_format",format:"base64url",input:w.value,inst:c,continue:!K.abort})}}),Xw=E("$ZodE164",(c,K)=>{K.pattern??(K.pattern=z8),hc.init(c,K)});function Z0(c,K=null){try{let w=c.split(".");if(w.length!==3)return!1;let[P]=w;if(!P)return!1;let h=JSON.parse(atob(P));if("typ"in h&&h?.typ!=="JWT")return!1;if(!h.alg)return!1;if(K&&(!("alg"in h)||h.alg!==K))return!1;return!0}catch{return!1}}var $w=E("$ZodJWT",(c,K)=>{hc.init(c,K),c._zod.check=(w)=>{if(Z0(w.value,K.alg))return;w.issues.push({code:"invalid_format",format:"jwt",input:w.value,inst:c,continue:!K.abort})}});var Bw=E("$ZodUnknown",(c,K)=>{Wc.init(c,K),c._zod.parse=(w)=>w}),zw=E("$ZodNever",(c,K)=>{Wc.init(c,K),c._zod.parse=(w,P)=>{return w.issues.push({expected:"never",code:"invalid_type",input:w.value,inst:c}),w}});function C8(c,K,w){if(c.issues.length)K.issues.push(...y2(w,c.issues));K.value[w]=c.value}var Uw=E("$ZodArray",(c,K)=>{Wc.init(c,K),c._zod.parse=(w,P)=>{let h=w.value;if(!Array.isArray(h))return w.issues.push({expected:"array",code:"invalid_type",input:h,inst:c}),w;w.value=Array(h.length);let M=[];for(let S=0;S<h.length;S++){let O=h[S],G=K.element._zod.run({value:O,issues:[]},P);if(G instanceof Promise)M.push(G.then((D)=>C8(D,w,S)));else C8(G,w,S)}if(M.length)return Promise.all(M).then(()=>w);return w}});function V4(c,K,w,P){if(c.issues.length)K.issues.push(...y2(w,c.issues));if(c.value===void 0){if(w in P)K.value[w]=void 0}else K.value[w]=c.value}function Yw(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=GK(c.shape);return{...c,keys:K,keySet:new Set(K),numKeys:K.length,optionalKeys:new Set(w)}}function Qw(c,K,w,P,h,M){let S=[],O=h.keySet,G=h.catchall._zod,D=G.def.type;for(let $ of Object.keys(K)){if(O.has($))continue;if(D==="never"){S.push($);continue}let L=G.run({value:K[$],issues:[]},P);if(L instanceof Promise)c.push(L.then((B)=>V4(B,w,$,K)));else V4(L,w,$,K)}if(S.length)w.issues.push({code:"unrecognized_keys",keys:S,input:K,inst:M});if(!c.length)return w;return Promise.all(c).then(()=>{return w})}var A0=E("$ZodObject",(c,K)=>{Wc.init(c,K);let w=m2(()=>Yw(K));Kc(c._zod,"propValues",()=>{let S=K.shape,O={};for(let G in S){let D=S[G]._zod;if(D.values){O[G]??(O[G]=new Set);for(let $ of D.values)O[G].add($)}}return O});let P=E2,h=K.catchall,M;c._zod.parse=(S,O)=>{M??(M=w.value);let G=S.value;if(!P(G))return S.issues.push({expected:"object",code:"invalid_type",input:G,inst:c}),S;S.value={};let D=[],$=M.shape;for(let L of M.keys){let q=$[L]._zod.run({value:G[L],issues:[]},O);if(q instanceof Promise)D.push(q.then((J)=>V4(J,S,L,G)));else V4(q,S,L,G)}if(!h)return D.length?Promise.all(D).then(()=>S):S;return Qw(D,G,S,O,w.value,c)}}),Vw=E("$ZodObjectJIT",(c,K)=>{A0.init(c,K);let w=c._zod.parse,P=m2(()=>Yw(K)),h=(B)=>{let q=new BK(["shape","payload","ctx"]),J=P.value,z=(X)=>{let W=X4(X);return`shape[${W}]._zod.run({ value: input[${W}], issues: [] }, ctx)`};q.write("const input = payload.value;");let H=Object.create(null),b=0;for(let X of J.keys)H[X]=`key_${b++}`;q.write("const newResult = {};");for(let X of J.keys){let W=H[X],V=X4(X);q.write(`const ${W} = ${z(X)};`),q.write(`
21
21
  if (${W}.issues.length) {
22
22
  payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
23
23
  ...iss,
@@ -34,6 +34,6 @@ and limitations under the License.
34
34
  newResult[${V}] = ${W}.value;
35
35
  }
36
36
 
37
- `)}q.write("payload.value = newResult;"),q.write("return payload;");let Q=q.compile();return(X,W)=>Q($,X,W)},M,S=E2,O=!j4.jitless,D=O&&NK.value,B=K.catchall,L;c._zod.parse=($,q)=>{L??(L=P.value);let J=$.value;if(!S(J))return $.issues.push({expected:"object",code:"invalid_type",input:J,inst:c}),$;if(O&&D&&q?.async===!1&&q.jitless!==!0){if(!M)M=h(K.shape);if($=M($,q),!B)return $;return Yw([],J,$,q,L,c)}return w($,q)}});function C8(c,K,w,P){for(let M of c)if(M.issues.length===0)return K.value=M.value,K;let h=c.filter((M)=>!O2(M));if(h.length===1)return K.value=h[0].value,h[0];return K.issues.push({code:"invalid_union",input:K.value,inst:w,errors:c.map((M)=>M.issues.map((S)=>Cc(S,P,ic())))}),K}var Vw=E("$ZodUnion",(c,K)=>{Wc.init(c,K),Kc(c._zod,"optin",()=>K.options.some((h)=>h._zod.optin==="optional")?"optional":void 0),Kc(c._zod,"optout",()=>K.options.some((h)=>h._zod.optout==="optional")?"optional":void 0),Kc(c._zod,"values",()=>{if(K.options.every((h)=>h._zod.values))return new Set(K.options.flatMap((h)=>Array.from(h._zod.values)));return}),Kc(c._zod,"pattern",()=>{if(K.options.every((h)=>h._zod.pattern)){let h=K.options.map((M)=>M._zod.pattern);return new RegExp(`^(${h.map((M)=>C2(M.source)).join("|")})$`)}return});let w=K.options.length===1,P=K.options[0]._zod.run;c._zod.parse=(h,M)=>{if(w)return P(h,M);let S=!1,O=[];for(let G of K.options){let D=G._zod.run({value:h.value,issues:[]},M);if(D instanceof Promise)O.push(D),S=!0;else{if(D.issues.length===0)return D;O.push(D)}}if(!S)return C8(O,h,c,M);return Promise.all(O).then((G)=>{return C8(G,h,c,M)})}});var qw=E("$ZodIntersection",(c,K)=>{Wc.init(c,K),c._zod.parse=(w,P)=>{let h=w.value,M=K.left._zod.run({value:h,issues:[]},P),S=K.right._zod.run({value:h,issues:[]},P);if(M instanceof Promise||S instanceof Promise)return Promise.all([M,S]).then(([G,D])=>{return y8(w,G,D)});return y8(w,M,S)}});function $K(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((M)=>w.indexOf(M)!==-1),h={...c,...K};for(let M of P){let S=$K(c[M],K[M]);if(!S.valid)return{valid:!1,mergeErrorPath:[M,...S.mergeErrorPath]};h[M]=S.data}return{valid:!0,data:h}}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 h=c[P],M=K[P],S=$K(h,M);if(!S.valid)return{valid:!1,mergeErrorPath:[P,...S.mergeErrorPath]};w.push(S.data)}return{valid:!0,data:w}}return{valid:!1,mergeErrorPath:[]}}function y8(c,K,w){if(K.issues.length)c.issues.push(...K.issues);if(w.issues.length)c.issues.push(...w.issues);if(O2(c))return c;let P=$K(K.value,w.value);if(!P.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(P.mergeErrorPath)}`);return c.value=P.data,c}var Lw=E("$ZodEnum",(c,K)=>{Wc.init(c,K);let w=WK(K.entries),P=new Set(w);c._zod.values=P,c._zod.pattern=new RegExp(`^(${w.filter((h)=>IK.has(typeof h)).map((h)=>typeof h==="string"?$2(h):h.toString()).join("|")})$`),c._zod.parse=(h,M)=>{let S=h.value;if(P.has(S))return h;return h.issues.push({code:"invalid_value",values:w,input:S,inst:c}),h}});var Hw=E("$ZodTransform",(c,K)=>{Wc.init(c,K),c._zod.parse=(w,P)=>{if(P.direction==="backward")throw new r2(c.constructor.name);let h=K.transform(w.value,w);if(P.async)return(h instanceof Promise?h:Promise.resolve(h)).then((S)=>{return w.value=S,w});if(h instanceof Promise)throw new nc;return w.value=h,w}});function _8(c,K){if(c.issues.length&&K===void 0)return{issues:[],value:void 0};return c}var vw=E("$ZodOptional",(c,K)=>{Wc.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(`^(${C2(w.source)})?$`):void 0}),c._zod.parse=(w,P)=>{if(K.innerType._zod.optin==="optional"){let h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>_8(M,w.value));return _8(h,w.value)}if(w.value===void 0)return w;return K.innerType._zod.run(w,P)}}),Ew=E("$ZodNullable",(c,K)=>{Wc.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(`^(${C2(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)}}),Fw=E("$ZodDefault",(c,K)=>{Wc.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 h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>f8(M,K));return f8(h,K)}});function f8(c,K){if(c.value===void 0)c.value=K.defaultValue;return c}var gw=E("$ZodPrefault",(c,K)=>{Wc.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)}}),kw=E("$ZodNonOptional",(c,K)=>{Wc.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 h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>e8(M,c));return e8(h,c)}});function e8(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 Rw=E("$ZodCatch",(c,K)=>{Wc.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 h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>{if(w.value=M.value,M.issues.length)w.value=K.catchValue({...w,error:{issues:M.issues.map((S)=>Cc(S,P,ic()))},input:w.value}),w.issues=[];return w});if(w.value=h.value,h.issues.length)w.value=K.catchValue({...w,error:{issues:h.issues.map((M)=>Cc(M,P,ic()))},input:w.value}),w.issues=[];return w}});var xw=E("$ZodPipe",(c,K)=>{Wc.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 M=K.out._zod.run(w,P);if(M instanceof Promise)return M.then((S)=>Q4(S,K.in,P));return Q4(M,K.in,P)}let h=K.in._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>Q4(M,K.out,P));return Q4(h,K.out,P)}});function Q4(c,K,w){if(c.issues.length)return c.aborted=!0,c;return K._zod.run({value:c.value,issues:c.issues},w)}var Zw=E("$ZodReadonly",(c,K)=>{Wc.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 h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then(p8);return p8(h)}});function p8(c){return c.value=Object.freeze(c.value),c}var Aw=E("$ZodCustom",(c,K)=>{qc.init(c,K),Wc.init(c,K),c._zod.parse=(w,P)=>{return w},c._zod.check=(w)=>{let P=w.value,h=K.fn(P);if(h instanceof Promise)return h.then((M)=>l8(M,w,P,c));l8(h,w,P,c);return}});function l8(c,K,w,P){if(!c){let h={code:"custom",input:w,inst:P,path:[...P._zod.def.path??[]],continue:!P._zod.def.abort};if(P._zod.def.params)h.params=P._zod.def.params;K.issues.push(g2(h))}}var uP=Symbol("ZodOutput"),CP=Symbol("ZodInput");class rw{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 A0(){return new rw}var l2=A0();function ow(c,K){return new c({type:"string",...e(K)})}function zK(c,K){return new c({type:"string",format:"email",check:"string_format",abort:!1,...e(K)})}function UK(c,K){return new c({type:"string",format:"guid",check:"string_format",abort:!1,...e(K)})}function mw(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,...e(K)})}function uw(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...e(K)})}function Cw(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...e(K)})}function yw(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...e(K)})}function _w(c,K){return new c({type:"string",format:"url",check:"string_format",abort:!1,...e(K)})}function fw(c,K){return new c({type:"string",format:"emoji",check:"string_format",abort:!1,...e(K)})}function ew(c,K){return new c({type:"string",format:"nanoid",check:"string_format",abort:!1,...e(K)})}function pw(c,K){return new c({type:"string",format:"cuid",check:"string_format",abort:!1,...e(K)})}function lw(c,K){return new c({type:"string",format:"cuid2",check:"string_format",abort:!1,...e(K)})}function Tw(c,K){return new c({type:"string",format:"ulid",check:"string_format",abort:!1,...e(K)})}function nw(c,K){return new c({type:"string",format:"xid",check:"string_format",abort:!1,...e(K)})}function iw(c,K){return new c({type:"string",format:"ksuid",check:"string_format",abort:!1,...e(K)})}function tw(c,K){return new c({type:"string",format:"ipv4",check:"string_format",abort:!1,...e(K)})}function dw(c,K){return new c({type:"string",format:"ipv6",check:"string_format",abort:!1,...e(K)})}function sw(c,K){return new c({type:"string",format:"cidrv4",check:"string_format",abort:!1,...e(K)})}function aw(c,K){return new c({type:"string",format:"cidrv6",check:"string_format",abort:!1,...e(K)})}function c5(c,K){return new c({type:"string",format:"base64",check:"string_format",abort:!1,...e(K)})}function K5(c,K){return new c({type:"string",format:"base64url",check:"string_format",abort:!1,...e(K)})}function w5(c,K){return new c({type:"string",format:"e164",check:"string_format",abort:!1,...e(K)})}function P5(c,K){return new c({type:"string",format:"jwt",check:"string_format",abort:!1,...e(K)})}function h5(c,K){return new c({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...e(K)})}function M5(c,K){return new c({type:"string",format:"date",check:"string_format",...e(K)})}function S5(c,K){return new c({type:"string",format:"time",check:"string_format",precision:null,...e(K)})}function b5(c,K){return new c({type:"string",format:"duration",check:"string_format",...e(K)})}function O5(c){return new c({type:"unknown"})}function J5(c,K){return new c({type:"never",...e(K)})}function L4(c,K){return new v8({check:"max_length",...e(K),maximum:c})}function k2(c,K){return new E8({check:"min_length",...e(K),minimum:c})}function H4(c,K){return new F8({check:"length_equals",...e(K),length:c})}function YK(c,K){return new g8({check:"string_format",format:"regex",...e(K),pattern:c})}function QK(c){return new k8({check:"string_format",format:"lowercase",...e(c)})}function VK(c){return new R8({check:"string_format",format:"uppercase",...e(c)})}function qK(c,K){return new x8({check:"string_format",format:"includes",...e(K),includes:c})}function LK(c,K){return new Z8({check:"string_format",format:"starts_with",...e(K),prefix:c})}function HK(c,K){return new A8({check:"string_format",format:"ends_with",...e(K),suffix:c})}function z2(c){return new r8({check:"overwrite",tx:c})}function vK(c){return z2((K)=>K.normalize(c))}function EK(){return z2((c)=>c.trim())}function FK(){return z2((c)=>c.toLowerCase())}function gK(){return z2((c)=>c.toUpperCase())}function W5(c,K,w){return new c({type:"array",element:K,...e(w)})}function N5(c,K,w){return new c({type:"custom",check:"custom",fn:K,...e(w)})}function I5(c){let K=r0((w)=>{return w.addIssue=(P)=>{if(typeof P==="string")w.issues.push(g2(P,w.value,K._zod.def));else{let h=P;if(h.fatal)h.continue=!1;h.code??(h.code="custom"),h.input??(h.input=w.value),h.inst??(h.inst=K),h.continue??(h.continue=!K._zod.def.abort),w.issues.push(g2(h))}},c(w.value,w)});return K}function r0(c,K){let w=new qc({check:"custom",...e(K)});return w._zod.check=c,w}var T0=E("ZodISODateTime",(c,K)=>{hw.init(c,K),Sc.init(c,K)});function D5(c){return h5(T0,c)}var n0=E("ZodISODate",(c,K)=>{Mw.init(c,K),Sc.init(c,K)});function G5(c){return M5(n0,c)}var i0=E("ZodISOTime",(c,K)=>{Sw.init(c,K),Sc.init(c,K)});function j5(c){return S5(i0,c)}var t0=E("ZodISODuration",(c,K)=>{bw.init(c,K),Sc.init(c,K)});function X5(c){return b5(t0,c)}var B5=(c,K)=>{$4.init(c,K),c.name="ZodError",Object.defineProperties(c,{format:{value:(w)=>p6(c,w)},flatten:{value:(w)=>e6(c,w)},addIssue:{value:(w)=>{c.issues.push(w),c.message=JSON.stringify(c.issues,F2,2)}},addIssues:{value:(w)=>{c.issues.push(...w),c.message=JSON.stringify(c.issues,F2,2)}},isEmpty:{get(){return c.issues.length===0}}})},Xh=E("ZodError",B5),Lc=E("ZodError",B5,{Parent:Error});var $5=z4(Lc),z5=U4(Lc),U5=f2(Lc),Y5=e2(Lc),Q5=n6(Lc),V5=i6(Lc),q5=t6(Lc),L5=d6(Lc),H5=s6(Lc),v5=a6(Lc),E5=c8(Lc),F5=K8(Lc);var Ic=E("ZodType",(c,K)=>{return Wc.init(c,K),c.def=K,c.type=K.type,Object.defineProperty(c,"_def",{value:K}),c.check=(...w)=>{return c.clone({...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)=>$5(c,w,P,{callee:c.parse}),c.safeParse=(w,P)=>U5(c,w,P),c.parseAsync=async(w,P)=>z5(c,w,P,{callee:c.parseAsync}),c.safeParseAsync=async(w,P)=>Y5(c,w,P),c.spa=c.safeParseAsync,c.encode=(w,P)=>Q5(c,w,P),c.decode=(w,P)=>V5(c,w,P),c.encodeAsync=async(w,P)=>q5(c,w,P),c.decodeAsync=async(w,P)=>L5(c,w,P),c.safeEncode=(w,P)=>H5(c,w,P),c.safeDecode=(w,P)=>v5(c,w,P),c.safeEncodeAsync=async(w,P)=>E5(c,w,P),c.safeDecodeAsync=async(w,P)=>F5(c,w,P),c.refine=(w,P)=>c.check(_1(w,P)),c.superRefine=(w)=>c.check(f1(w)),c.overwrite=(w)=>c.check(z2(w)),c.optional=()=>R5(c),c.nullable=()=>x5(c),c.nullish=()=>R5(x5(c)),c.nonoptional=(w)=>A1(c,w),c.array=()=>Y1(c),c.or=(w)=>q1([c,w]),c.and=(w)=>H1(c,w),c.transform=(w)=>Z5(c,F1(w)),c.default=(w)=>R1(c,w),c.prefault=(w)=>Z1(c,w),c.catch=(w)=>o1(c,w),c.pipe=(w)=>Z5(c,w),c.readonly=()=>C1(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}),A5=E("_ZodString",(c,K)=>{q4.init(c,K),Ic.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(YK(...P)),c.includes=(...P)=>c.check(qK(...P)),c.startsWith=(...P)=>c.check(LK(...P)),c.endsWith=(...P)=>c.check(HK(...P)),c.min=(...P)=>c.check(k2(...P)),c.max=(...P)=>c.check(L4(...P)),c.length=(...P)=>c.check(H4(...P)),c.nonempty=(...P)=>c.check(k2(1,...P)),c.lowercase=(P)=>c.check(QK(P)),c.uppercase=(P)=>c.check(VK(P)),c.trim=()=>c.check(EK()),c.normalize=(...P)=>c.check(vK(...P)),c.toLowerCase=()=>c.check(FK()),c.toUpperCase=()=>c.check(gK())}),c1=E("ZodString",(c,K)=>{q4.init(c,K),A5.init(c,K),c.email=(w)=>c.check(zK(o5,w)),c.url=(w)=>c.check(_w(K1,w)),c.jwt=(w)=>c.check(P5(X1,w)),c.emoji=(w)=>c.check(fw(w1,w)),c.guid=(w)=>c.check(UK(g5,w)),c.uuid=(w)=>c.check(mw(E4,w)),c.uuidv4=(w)=>c.check(uw(E4,w)),c.uuidv6=(w)=>c.check(Cw(E4,w)),c.uuidv7=(w)=>c.check(yw(E4,w)),c.nanoid=(w)=>c.check(ew(P1,w)),c.guid=(w)=>c.check(UK(g5,w)),c.cuid=(w)=>c.check(pw(h1,w)),c.cuid2=(w)=>c.check(lw(M1,w)),c.ulid=(w)=>c.check(Tw(S1,w)),c.base64=(w)=>c.check(c5(D1,w)),c.base64url=(w)=>c.check(K5(G1,w)),c.xid=(w)=>c.check(nw(b1,w)),c.ksuid=(w)=>c.check(iw(O1,w)),c.ipv4=(w)=>c.check(tw(J1,w)),c.ipv6=(w)=>c.check(dw(W1,w)),c.cidrv4=(w)=>c.check(sw(N1,w)),c.cidrv6=(w)=>c.check(aw(I1,w)),c.e164=(w)=>c.check(w5(j1,w)),c.datetime=(w)=>c.check(D5(w)),c.date=(w)=>c.check(G5(w)),c.time=(w)=>c.check(j5(w)),c.duration=(w)=>c.check(X5(w))});function r5(c){return ow(c1,c)}var Sc=E("ZodStringFormat",(c,K)=>{hc.init(c,K),A5.init(c,K)}),o5=E("ZodEmail",(c,K)=>{i8.init(c,K),Sc.init(c,K)});function m5(c){return zK(o5,c)}var g5=E("ZodGUID",(c,K)=>{T8.init(c,K),Sc.init(c,K)});var E4=E("ZodUUID",(c,K)=>{n8.init(c,K),Sc.init(c,K)});var K1=E("ZodURL",(c,K)=>{t8.init(c,K),Sc.init(c,K)});var w1=E("ZodEmoji",(c,K)=>{d8.init(c,K),Sc.init(c,K)});var P1=E("ZodNanoID",(c,K)=>{s8.init(c,K),Sc.init(c,K)});var h1=E("ZodCUID",(c,K)=>{a8.init(c,K),Sc.init(c,K)});var M1=E("ZodCUID2",(c,K)=>{cw.init(c,K),Sc.init(c,K)});var S1=E("ZodULID",(c,K)=>{Kw.init(c,K),Sc.init(c,K)});var b1=E("ZodXID",(c,K)=>{ww.init(c,K),Sc.init(c,K)});var O1=E("ZodKSUID",(c,K)=>{Pw.init(c,K),Sc.init(c,K)});var J1=E("ZodIPv4",(c,K)=>{Ow.init(c,K),Sc.init(c,K)});var W1=E("ZodIPv6",(c,K)=>{Jw.init(c,K),Sc.init(c,K)});var N1=E("ZodCIDRv4",(c,K)=>{Ww.init(c,K),Sc.init(c,K)});var I1=E("ZodCIDRv6",(c,K)=>{Nw.init(c,K),Sc.init(c,K)});var D1=E("ZodBase64",(c,K)=>{Dw.init(c,K),Sc.init(c,K)});var G1=E("ZodBase64URL",(c,K)=>{Gw.init(c,K),Sc.init(c,K)});var j1=E("ZodE164",(c,K)=>{jw.init(c,K),Sc.init(c,K)});var X1=E("ZodJWT",(c,K)=>{Xw.init(c,K),Sc.init(c,K)});var B1=E("ZodUnknown",(c,K)=>{Bw.init(c,K),Ic.init(c,K)});function k5(){return O5(B1)}var $1=E("ZodNever",(c,K)=>{$w.init(c,K),Ic.init(c,K)});function z1(c){return J5($1,c)}var U1=E("ZodArray",(c,K)=>{zw.init(c,K),Ic.init(c,K),c.element=K.element,c.min=(w,P)=>c.check(k2(w,P)),c.nonempty=(w)=>c.check(k2(1,w)),c.max=(w,P)=>c.check(L4(w,P)),c.length=(w,P)=>c.check(H4(w,P)),c.unwrap=()=>c.element});function Y1(c,K){return W5(U1,c,K)}var Q1=E("ZodObject",(c,K)=>{Qw.init(c,K),Ic.init(c,K),a.defineLazy(c,"shape",()=>K.shape),c.keyof=()=>v1(Object.keys(c._zod.def.shape)),c.catchall=(w)=>c.clone({...c._zod.def,catchall:w}),c.passthrough=()=>c.clone({...c._zod.def,catchall:k5()}),c.loose=()=>c.clone({...c._zod.def,catchall:k5()}),c.strict=()=>c.clone({...c._zod.def,catchall:z1()}),c.strip=()=>c.clone({...c._zod.def,catchall:void 0}),c.extend=(w)=>{return a.extend(c,w)},c.safeExtend=(w)=>{return a.safeExtend(c,w)},c.merge=(w)=>a.merge(c,w),c.pick=(w)=>a.pick(c,w),c.omit=(w)=>a.omit(c,w),c.partial=(...w)=>a.partial(C5,c,w[0]),c.required=(...w)=>a.required(y5,c,w[0])});function u5(c,K){let w={type:"object",get shape(){return a.assignProp(this,"shape",c?a.objectClone(c):{}),this.shape},...a.normalizeParams(K)};return new Q1(w)}var V1=E("ZodUnion",(c,K)=>{Vw.init(c,K),Ic.init(c,K),c.options=K.options});function q1(c,K){return new V1({type:"union",options:c,...a.normalizeParams(K)})}var L1=E("ZodIntersection",(c,K)=>{qw.init(c,K),Ic.init(c,K)});function H1(c,K){return new L1({type:"intersection",left:c,right:K})}var kK=E("ZodEnum",(c,K)=>{Lw.init(c,K),Ic.init(c,K),c.enum=K.entries,c.options=Object.values(K.entries);let w=new Set(Object.keys(K.entries));c.extract=(P,h)=>{let M={};for(let S of P)if(w.has(S))M[S]=K.entries[S];else throw Error(`Key ${S} not found in enum`);return new kK({...K,checks:[],...a.normalizeParams(h),entries:M})},c.exclude=(P,h)=>{let M={...K.entries};for(let S of P)if(w.has(S))delete M[S];else throw Error(`Key ${S} not found in enum`);return new kK({...K,checks:[],...a.normalizeParams(h),entries:M})}});function v1(c,K){let w=Array.isArray(c)?Object.fromEntries(c.map((P)=>[P,P])):c;return new kK({type:"enum",entries:w,...a.normalizeParams(K)})}var E1=E("ZodTransform",(c,K)=>{Hw.init(c,K),Ic.init(c,K),c._zod.parse=(w,P)=>{if(P.direction==="backward")throw new r2(c.constructor.name);w.addIssue=(M)=>{if(typeof M==="string")w.issues.push(a.issue(M,w.value,K));else{let S=M;if(S.fatal)S.continue=!1;S.code??(S.code="custom"),S.input??(S.input=w.value),S.inst??(S.inst=c),w.issues.push(a.issue(S))}};let h=K.transform(w.value,w);if(h instanceof Promise)return h.then((M)=>{return w.value=M,w});return w.value=h,w}});function F1(c){return new E1({type:"transform",transform:c})}var C5=E("ZodOptional",(c,K)=>{vw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function R5(c){return new C5({type:"optional",innerType:c})}var g1=E("ZodNullable",(c,K)=>{Ew.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function x5(c){return new g1({type:"nullable",innerType:c})}var k1=E("ZodDefault",(c,K)=>{Fw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType,c.removeDefault=c.unwrap});function R1(c,K){return new k1({type:"default",innerType:c,get defaultValue(){return typeof K==="function"?K():a.shallowClone(K)}})}var x1=E("ZodPrefault",(c,K)=>{gw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function Z1(c,K){return new x1({type:"prefault",innerType:c,get defaultValue(){return typeof K==="function"?K():a.shallowClone(K)}})}var y5=E("ZodNonOptional",(c,K)=>{kw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function A1(c,K){return new y5({type:"nonoptional",innerType:c,...a.normalizeParams(K)})}var r1=E("ZodCatch",(c,K)=>{Rw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType,c.removeCatch=c.unwrap});function o1(c,K){return new r1({type:"catch",innerType:c,catchValue:typeof K==="function"?K:()=>K})}var m1=E("ZodPipe",(c,K)=>{xw.init(c,K),Ic.init(c,K),c.in=K.in,c.out=K.out});function Z5(c,K){return new m1({type:"pipe",in:c,out:K})}var u1=E("ZodReadonly",(c,K)=>{Zw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function C1(c){return new u1({type:"readonly",innerType:c})}var y1=E("ZodCustom",(c,K)=>{Aw.init(c,K),Ic.init(c,K)});function _1(c,K={}){return N5(y1,c,K)}function f1(c){return I5(c)}class R2{configs;options;#c=Z2.ETokenAudiences.SYSTEM;token;constructor(c,K){this.configs=c;this.options=K}async signToken(){try{let c=new Uint8Array(Buffer.from(this.configs.secretKey,"base64")),K=await crypto.subtle.importKey("raw",c,{name:"HMAC",hash:"SHA-512"},!1,["sign","verify"]),w=await new G4({tenantId:this.configs.tenantId,appId:this.configs.appId,modeId:this.configs.modeId,iss:this.configs.tenantId,aud:Z2.ETokenAudiences.SYSTEM}).setProtectedHeader({alg:"HS512"}).sign(K);return this.token=w,w}catch(c){if(this.options?.logs)console.error("[BoolGuard] Sign token error:",c);throw c}}async ping(){try{let c=this.token||await this.signToken(),K=new Headers;K.append("X-Tenant-ID",this.configs.tenantId),K.append("X-App-ID",this.configs.appId),K.append("X-Mode-ID",this.configs.modeId),K.append("Authorization",`Bearer ${c}`);let w=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-modes/ping`,{method:"GET",headers:K});if(!w.ok)throw await w.json();return w.ok}catch(c){if(this.options?.logs)console.error("[BoolGuard] Ping error:",c);return!1}}async createPlainAccount({identity:c,password:K,metadata:w}){try{let P=this.token||await this.signToken(),h=new Headers;h.append("X-Tenant-ID",this.configs.tenantId),h.append("X-App-ID",this.configs.appId),h.append("X-Mode-ID",this.configs.modeId),h.append("Authorization",`Bearer ${P}`),h.append("Content-Type","application/json");let M=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-mode-accounts`,{method:"POST",headers:h,body:JSON.stringify({data:{type:"plain",identity:c,password:K,metadata:w}})});if(!M.ok)throw await M.json();let{data:S}=await M.json();return Object.freeze({account:S.account,credential:S.credential})}catch(P){if(this.options?.logs)console.error("[BoolGuard] Create plain account error:",P);throw P}}async createEmailAccount({identity:c,password:K,metadata:w}){try{let P=this.token||await this.signToken(),h=new Headers;h.append("X-Tenant-ID",this.configs.tenantId),h.append("X-App-ID",this.configs.appId),h.append("X-Mode-ID",this.configs.modeId),h.append("Authorization",`Bearer ${P}`),h.append("Content-Type","application/json");let M=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-mode-accounts`,{method:"POST",headers:h,body:JSON.stringify({data:{type:"email",identity:c,password:K,metadata:w}})});if(!M.ok)throw await M.json();let{data:S}=await M.json();return Object.freeze({account:S.account,credential:S.credential})}catch(P){if(this.options?.logs)console.error("[BoolGuard] Create email account error:",P);throw P}}async authenticate({identity:c,password:K}){try{let w=this.token||await this.signToken(),P=await m5().safeParseAsync(c),h=new Headers;h.append("X-Tenant-ID",this.configs.tenantId),h.append("X-App-ID",this.configs.appId),h.append("X-Mode-ID",this.configs.modeId),h.append("Authorization",`Bearer ${w}`),h.append("Content-Type","application/json");let M=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-mode-accounts/authenticate`,{method:"POST",headers:h,body:JSON.stringify({data:{type:!P.success?"plain":"email",identity:c,password:K}})});if(!M.ok)throw await M.json();let{data:S}=await M.json();return Object.freeze({account:S.account,credential:S.credential,token:S.token})}catch(w){if(this.options?.logs)console.error("[BoolGuard] Authenticate error:",w);throw w}}async verifyToken({token:c}){try{let K=this.token||await this.signToken(),w=new Headers;w.append("X-Tenant-ID",this.configs.tenantId),w.append("X-App-ID",this.configs.appId),w.append("X-Mode-ID",this.configs.modeId),w.append("Authorization",`Bearer ${K}`),w.append("Content-Type","application/json");let P=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-mode-accounts/verify`,{method:"POST",headers:w,body:JSON.stringify({data:{token:c}})});if(!P.ok)throw await P.json();let{data:h}=await P.json();return Object.freeze({account:h.account,credential:h.credential})}catch(K){if(this.options?.logs)console.error("[BoolGuard] Verify token error:",K);throw K}}}var zM=async(c,K)=>{let w=new R2(c,K);if(await w.signToken(),!await w.ping())throw Error("Ping to Bool Guard service failed!");return[Gc.guardClient,w]};var e1=u5({authorization:r5().startsWith("Bearer ").min(24).transform((c)=>{let[K,w]=c.split(" ");return Object.freeze({schema:K,token:w})})});class RK{clientInstance;constructor(c){this.clientInstance=c}async start(c,K){let w=await e1.safeParseAsync(K.toJSON());if(!w.success)return c.set(Gc.authState,void 0);else{let{authorization:{token:P}}=w.data;try{let{account:h,credential:M}=await this.clientInstance.verifyToken({token:P}),S=Object.freeze({account:h,credential:M});return c.set(Gc.authState,S)}catch(h){return console.error(h),c.set(Gc.authState,void 0)}}}}Q2([W2(0,J4()),W2(1,S6())],RK.prototype,"start",null),RK=Q2([W2(0,O6(R2))],RK);export{zM as loader,RK as Middleware,Gc as Keys,s4 as Interceptor,Z2 as Enums,T3 as ControllerGuard,R2 as Client,d4 as AuthState,i5 as ActionGuard};
37
+ `)}q.write("payload.value = newResult;"),q.write("return payload;");let Q=q.compile();return(X,W)=>Q(B,X,W)},M,S=E2,O=!j4.jitless,D=O&&IK.value,$=K.catchall,L;c._zod.parse=(B,q)=>{L??(L=P.value);let J=B.value;if(!S(J))return B.issues.push({expected:"object",code:"invalid_type",input:J,inst:c}),B;if(O&&D&&q?.async===!1&&q.jitless!==!0){if(!M)M=h(K.shape);if(B=M(B,q),!$)return B;return Qw([],J,B,q,L,c)}return w(B,q)}});function y8(c,K,w,P){for(let M of c)if(M.issues.length===0)return K.value=M.value,K;let h=c.filter((M)=>!O2(M));if(h.length===1)return K.value=h[0].value,h[0];return K.issues.push({code:"invalid_union",input:K.value,inst:w,errors:c.map((M)=>M.issues.map((S)=>Cc(S,P,ic())))}),K}var qw=E("$ZodUnion",(c,K)=>{Wc.init(c,K),Kc(c._zod,"optin",()=>K.options.some((h)=>h._zod.optin==="optional")?"optional":void 0),Kc(c._zod,"optout",()=>K.options.some((h)=>h._zod.optout==="optional")?"optional":void 0),Kc(c._zod,"values",()=>{if(K.options.every((h)=>h._zod.values))return new Set(K.options.flatMap((h)=>Array.from(h._zod.values)));return}),Kc(c._zod,"pattern",()=>{if(K.options.every((h)=>h._zod.pattern)){let h=K.options.map((M)=>M._zod.pattern);return new RegExp(`^(${h.map((M)=>C2(M.source)).join("|")})$`)}return});let w=K.options.length===1,P=K.options[0]._zod.run;c._zod.parse=(h,M)=>{if(w)return P(h,M);let S=!1,O=[];for(let G of K.options){let D=G._zod.run({value:h.value,issues:[]},M);if(D instanceof Promise)O.push(D),S=!0;else{if(D.issues.length===0)return D;O.push(D)}}if(!S)return y8(O,h,c,M);return Promise.all(O).then((G)=>{return y8(G,h,c,M)})}});var Lw=E("$ZodIntersection",(c,K)=>{Wc.init(c,K),c._zod.parse=(w,P)=>{let h=w.value,M=K.left._zod.run({value:h,issues:[]},P),S=K.right._zod.run({value:h,issues:[]},P);if(M instanceof Promise||S instanceof Promise)return Promise.all([M,S]).then(([G,D])=>{return _8(w,G,D)});return _8(w,M,S)}});function zK(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($2(c)&&$2(K)){let w=Object.keys(K),P=Object.keys(c).filter((M)=>w.indexOf(M)!==-1),h={...c,...K};for(let M of P){let S=zK(c[M],K[M]);if(!S.valid)return{valid:!1,mergeErrorPath:[M,...S.mergeErrorPath]};h[M]=S.data}return{valid:!0,data:h}}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 h=c[P],M=K[P],S=zK(h,M);if(!S.valid)return{valid:!1,mergeErrorPath:[P,...S.mergeErrorPath]};w.push(S.data)}return{valid:!0,data:w}}return{valid:!1,mergeErrorPath:[]}}function _8(c,K,w){if(K.issues.length)c.issues.push(...K.issues);if(w.issues.length)c.issues.push(...w.issues);if(O2(c))return c;let P=zK(K.value,w.value);if(!P.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(P.mergeErrorPath)}`);return c.value=P.data,c}var Hw=E("$ZodEnum",(c,K)=>{Wc.init(c,K);let w=NK(K.entries),P=new Set(w);c._zod.values=P,c._zod.pattern=new RegExp(`^(${w.filter((h)=>DK.has(typeof h)).map((h)=>typeof h==="string"?B2(h):h.toString()).join("|")})$`),c._zod.parse=(h,M)=>{let S=h.value;if(P.has(S))return h;return h.issues.push({code:"invalid_value",values:w,input:S,inst:c}),h}});var vw=E("$ZodTransform",(c,K)=>{Wc.init(c,K),c._zod.parse=(w,P)=>{if(P.direction==="backward")throw new r2(c.constructor.name);let h=K.transform(w.value,w);if(P.async)return(h instanceof Promise?h:Promise.resolve(h)).then((S)=>{return w.value=S,w});if(h instanceof Promise)throw new nc;return w.value=h,w}});function f8(c,K){if(c.issues.length&&K===void 0)return{issues:[],value:void 0};return c}var Ew=E("$ZodOptional",(c,K)=>{Wc.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(`^(${C2(w.source)})?$`):void 0}),c._zod.parse=(w,P)=>{if(K.innerType._zod.optin==="optional"){let h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>f8(M,w.value));return f8(h,w.value)}if(w.value===void 0)return w;return K.innerType._zod.run(w,P)}}),Fw=E("$ZodNullable",(c,K)=>{Wc.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(`^(${C2(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)}}),gw=E("$ZodDefault",(c,K)=>{Wc.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 h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>e8(M,K));return e8(h,K)}});function e8(c,K){if(c.value===void 0)c.value=K.defaultValue;return c}var kw=E("$ZodPrefault",(c,K)=>{Wc.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)}}),Rw=E("$ZodNonOptional",(c,K)=>{Wc.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 h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>p8(M,c));return p8(h,c)}});function p8(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 xw=E("$ZodCatch",(c,K)=>{Wc.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 h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>{if(w.value=M.value,M.issues.length)w.value=K.catchValue({...w,error:{issues:M.issues.map((S)=>Cc(S,P,ic()))},input:w.value}),w.issues=[];return w});if(w.value=h.value,h.issues.length)w.value=K.catchValue({...w,error:{issues:h.issues.map((M)=>Cc(M,P,ic()))},input:w.value}),w.issues=[];return w}});var Zw=E("$ZodPipe",(c,K)=>{Wc.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 M=K.out._zod.run(w,P);if(M instanceof Promise)return M.then((S)=>Q4(S,K.in,P));return Q4(M,K.in,P)}let h=K.in._zod.run(w,P);if(h instanceof Promise)return h.then((M)=>Q4(M,K.out,P));return Q4(h,K.out,P)}});function Q4(c,K,w){if(c.issues.length)return c.aborted=!0,c;return K._zod.run({value:c.value,issues:c.issues},w)}var Aw=E("$ZodReadonly",(c,K)=>{Wc.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 h=K.innerType._zod.run(w,P);if(h instanceof Promise)return h.then(l8);return l8(h)}});function l8(c){return c.value=Object.freeze(c.value),c}var rw=E("$ZodCustom",(c,K)=>{qc.init(c,K),Wc.init(c,K),c._zod.parse=(w,P)=>{return w},c._zod.check=(w)=>{let P=w.value,h=K.fn(P);if(h instanceof Promise)return h.then((M)=>T8(M,w,P,c));T8(h,w,P,c);return}});function T8(c,K,w,P){if(!c){let h={code:"custom",input:w,inst:P,path:[...P._zod.def.path??[]],continue:!P._zod.def.abort};if(P._zod.def.params)h.params=P._zod.def.params;K.issues.push(g2(h))}}var CP=Symbol("ZodOutput"),yP=Symbol("ZodInput");class ow{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 r0(){return new ow}var l2=r0();function mw(c,K){return new c({type:"string",...e(K)})}function UK(c,K){return new c({type:"string",format:"email",check:"string_format",abort:!1,...e(K)})}function YK(c,K){return new c({type:"string",format:"guid",check:"string_format",abort:!1,...e(K)})}function uw(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,...e(K)})}function Cw(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...e(K)})}function yw(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...e(K)})}function _w(c,K){return new c({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...e(K)})}function fw(c,K){return new c({type:"string",format:"url",check:"string_format",abort:!1,...e(K)})}function ew(c,K){return new c({type:"string",format:"emoji",check:"string_format",abort:!1,...e(K)})}function pw(c,K){return new c({type:"string",format:"nanoid",check:"string_format",abort:!1,...e(K)})}function lw(c,K){return new c({type:"string",format:"cuid",check:"string_format",abort:!1,...e(K)})}function Tw(c,K){return new c({type:"string",format:"cuid2",check:"string_format",abort:!1,...e(K)})}function nw(c,K){return new c({type:"string",format:"ulid",check:"string_format",abort:!1,...e(K)})}function iw(c,K){return new c({type:"string",format:"xid",check:"string_format",abort:!1,...e(K)})}function tw(c,K){return new c({type:"string",format:"ksuid",check:"string_format",abort:!1,...e(K)})}function dw(c,K){return new c({type:"string",format:"ipv4",check:"string_format",abort:!1,...e(K)})}function sw(c,K){return new c({type:"string",format:"ipv6",check:"string_format",abort:!1,...e(K)})}function aw(c,K){return new c({type:"string",format:"cidrv4",check:"string_format",abort:!1,...e(K)})}function c5(c,K){return new c({type:"string",format:"cidrv6",check:"string_format",abort:!1,...e(K)})}function K5(c,K){return new c({type:"string",format:"base64",check:"string_format",abort:!1,...e(K)})}function w5(c,K){return new c({type:"string",format:"base64url",check:"string_format",abort:!1,...e(K)})}function P5(c,K){return new c({type:"string",format:"e164",check:"string_format",abort:!1,...e(K)})}function h5(c,K){return new c({type:"string",format:"jwt",check:"string_format",abort:!1,...e(K)})}function M5(c,K){return new c({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...e(K)})}function S5(c,K){return new c({type:"string",format:"date",check:"string_format",...e(K)})}function b5(c,K){return new c({type:"string",format:"time",check:"string_format",precision:null,...e(K)})}function O5(c,K){return new c({type:"string",format:"duration",check:"string_format",...e(K)})}function J5(c){return new c({type:"unknown"})}function W5(c,K){return new c({type:"never",...e(K)})}function L4(c,K){return new E8({check:"max_length",...e(K),maximum:c})}function k2(c,K){return new F8({check:"min_length",...e(K),minimum:c})}function H4(c,K){return new g8({check:"length_equals",...e(K),length:c})}function QK(c,K){return new k8({check:"string_format",format:"regex",...e(K),pattern:c})}function VK(c){return new R8({check:"string_format",format:"lowercase",...e(c)})}function qK(c){return new x8({check:"string_format",format:"uppercase",...e(c)})}function LK(c,K){return new Z8({check:"string_format",format:"includes",...e(K),includes:c})}function HK(c,K){return new A8({check:"string_format",format:"starts_with",...e(K),prefix:c})}function vK(c,K){return new r8({check:"string_format",format:"ends_with",...e(K),suffix:c})}function z2(c){return new o8({check:"overwrite",tx:c})}function EK(c){return z2((K)=>K.normalize(c))}function FK(){return z2((c)=>c.trim())}function gK(){return z2((c)=>c.toLowerCase())}function kK(){return z2((c)=>c.toUpperCase())}function N5(c,K,w){return new c({type:"array",element:K,...e(w)})}function I5(c,K,w){return new c({type:"custom",check:"custom",fn:K,...e(w)})}function D5(c){let K=o0((w)=>{return w.addIssue=(P)=>{if(typeof P==="string")w.issues.push(g2(P,w.value,K._zod.def));else{let h=P;if(h.fatal)h.continue=!1;h.code??(h.code="custom"),h.input??(h.input=w.value),h.inst??(h.inst=K),h.continue??(h.continue=!K._zod.def.abort),w.issues.push(g2(h))}},c(w.value,w)});return K}function o0(c,K){let w=new qc({check:"custom",...e(K)});return w._zod.check=c,w}var n0=E("ZodISODateTime",(c,K)=>{Mw.init(c,K),Sc.init(c,K)});function G5(c){return M5(n0,c)}var i0=E("ZodISODate",(c,K)=>{Sw.init(c,K),Sc.init(c,K)});function j5(c){return S5(i0,c)}var t0=E("ZodISOTime",(c,K)=>{bw.init(c,K),Sc.init(c,K)});function X5(c){return b5(t0,c)}var d0=E("ZodISODuration",(c,K)=>{Ow.init(c,K),Sc.init(c,K)});function $5(c){return O5(d0,c)}var B5=(c,K)=>{B4.init(c,K),c.name="ZodError",Object.defineProperties(c,{format:{value:(w)=>l6(c,w)},flatten:{value:(w)=>p6(c,w)},addIssue:{value:(w)=>{c.issues.push(w),c.message=JSON.stringify(c.issues,F2,2)}},addIssues:{value:(w)=>{c.issues.push(...w),c.message=JSON.stringify(c.issues,F2,2)}},isEmpty:{get(){return c.issues.length===0}}})},$h=E("ZodError",B5),Lc=E("ZodError",B5,{Parent:Error});var z5=z4(Lc),U5=U4(Lc),Y5=f2(Lc),Q5=e2(Lc),V5=i6(Lc),q5=t6(Lc),L5=d6(Lc),H5=s6(Lc),v5=a6(Lc),E5=c8(Lc),F5=K8(Lc),g5=w8(Lc);var Ic=E("ZodType",(c,K)=>{return Wc.init(c,K),c.def=K,c.type=K.type,Object.defineProperty(c,"_def",{value:K}),c.check=(...w)=>{return c.clone({...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)=>z5(c,w,P,{callee:c.parse}),c.safeParse=(w,P)=>Y5(c,w,P),c.parseAsync=async(w,P)=>U5(c,w,P,{callee:c.parseAsync}),c.safeParseAsync=async(w,P)=>Q5(c,w,P),c.spa=c.safeParseAsync,c.encode=(w,P)=>V5(c,w,P),c.decode=(w,P)=>q5(c,w,P),c.encodeAsync=async(w,P)=>L5(c,w,P),c.decodeAsync=async(w,P)=>H5(c,w,P),c.safeEncode=(w,P)=>v5(c,w,P),c.safeDecode=(w,P)=>E5(c,w,P),c.safeEncodeAsync=async(w,P)=>F5(c,w,P),c.safeDecodeAsync=async(w,P)=>g5(c,w,P),c.refine=(w,P)=>c.check(f1(w,P)),c.superRefine=(w)=>c.check(e1(w)),c.overwrite=(w)=>c.check(z2(w)),c.optional=()=>x5(c),c.nullable=()=>Z5(c),c.nullish=()=>x5(Z5(c)),c.nonoptional=(w)=>r1(c,w),c.array=()=>Q1(c),c.or=(w)=>L1([c,w]),c.and=(w)=>v1(c,w),c.transform=(w)=>A5(c,g1(w)),c.default=(w)=>x1(c,w),c.prefault=(w)=>A1(c,w),c.catch=(w)=>m1(c,w),c.pipe=(w)=>A5(c,w),c.readonly=()=>y1(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}),r5=E("_ZodString",(c,K)=>{q4.init(c,K),Ic.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(QK(...P)),c.includes=(...P)=>c.check(LK(...P)),c.startsWith=(...P)=>c.check(HK(...P)),c.endsWith=(...P)=>c.check(vK(...P)),c.min=(...P)=>c.check(k2(...P)),c.max=(...P)=>c.check(L4(...P)),c.length=(...P)=>c.check(H4(...P)),c.nonempty=(...P)=>c.check(k2(1,...P)),c.lowercase=(P)=>c.check(VK(P)),c.uppercase=(P)=>c.check(qK(P)),c.trim=()=>c.check(FK()),c.normalize=(...P)=>c.check(EK(...P)),c.toLowerCase=()=>c.check(gK()),c.toUpperCase=()=>c.check(kK())}),K1=E("ZodString",(c,K)=>{q4.init(c,K),r5.init(c,K),c.email=(w)=>c.check(UK(m5,w)),c.url=(w)=>c.check(fw(w1,w)),c.jwt=(w)=>c.check(h5($1,w)),c.emoji=(w)=>c.check(ew(P1,w)),c.guid=(w)=>c.check(YK(k5,w)),c.uuid=(w)=>c.check(uw(E4,w)),c.uuidv4=(w)=>c.check(Cw(E4,w)),c.uuidv6=(w)=>c.check(yw(E4,w)),c.uuidv7=(w)=>c.check(_w(E4,w)),c.nanoid=(w)=>c.check(pw(h1,w)),c.guid=(w)=>c.check(YK(k5,w)),c.cuid=(w)=>c.check(lw(M1,w)),c.cuid2=(w)=>c.check(Tw(S1,w)),c.ulid=(w)=>c.check(nw(b1,w)),c.base64=(w)=>c.check(K5(G1,w)),c.base64url=(w)=>c.check(w5(j1,w)),c.xid=(w)=>c.check(iw(O1,w)),c.ksuid=(w)=>c.check(tw(J1,w)),c.ipv4=(w)=>c.check(dw(W1,w)),c.ipv6=(w)=>c.check(sw(N1,w)),c.cidrv4=(w)=>c.check(aw(I1,w)),c.cidrv6=(w)=>c.check(c5(D1,w)),c.e164=(w)=>c.check(P5(X1,w)),c.datetime=(w)=>c.check(G5(w)),c.date=(w)=>c.check(j5(w)),c.time=(w)=>c.check(X5(w)),c.duration=(w)=>c.check($5(w))});function o5(c){return mw(K1,c)}var Sc=E("ZodStringFormat",(c,K)=>{hc.init(c,K),r5.init(c,K)}),m5=E("ZodEmail",(c,K)=>{t8.init(c,K),Sc.init(c,K)});function u5(c){return UK(m5,c)}var k5=E("ZodGUID",(c,K)=>{n8.init(c,K),Sc.init(c,K)});var E4=E("ZodUUID",(c,K)=>{i8.init(c,K),Sc.init(c,K)});var w1=E("ZodURL",(c,K)=>{d8.init(c,K),Sc.init(c,K)});var P1=E("ZodEmoji",(c,K)=>{s8.init(c,K),Sc.init(c,K)});var h1=E("ZodNanoID",(c,K)=>{a8.init(c,K),Sc.init(c,K)});var M1=E("ZodCUID",(c,K)=>{cw.init(c,K),Sc.init(c,K)});var S1=E("ZodCUID2",(c,K)=>{Kw.init(c,K),Sc.init(c,K)});var b1=E("ZodULID",(c,K)=>{ww.init(c,K),Sc.init(c,K)});var O1=E("ZodXID",(c,K)=>{Pw.init(c,K),Sc.init(c,K)});var J1=E("ZodKSUID",(c,K)=>{hw.init(c,K),Sc.init(c,K)});var W1=E("ZodIPv4",(c,K)=>{Jw.init(c,K),Sc.init(c,K)});var N1=E("ZodIPv6",(c,K)=>{Ww.init(c,K),Sc.init(c,K)});var I1=E("ZodCIDRv4",(c,K)=>{Nw.init(c,K),Sc.init(c,K)});var D1=E("ZodCIDRv6",(c,K)=>{Iw.init(c,K),Sc.init(c,K)});var G1=E("ZodBase64",(c,K)=>{Gw.init(c,K),Sc.init(c,K)});var j1=E("ZodBase64URL",(c,K)=>{jw.init(c,K),Sc.init(c,K)});var X1=E("ZodE164",(c,K)=>{Xw.init(c,K),Sc.init(c,K)});var $1=E("ZodJWT",(c,K)=>{$w.init(c,K),Sc.init(c,K)});var B1=E("ZodUnknown",(c,K)=>{Bw.init(c,K),Ic.init(c,K)});function R5(){return J5(B1)}var z1=E("ZodNever",(c,K)=>{zw.init(c,K),Ic.init(c,K)});function U1(c){return W5(z1,c)}var Y1=E("ZodArray",(c,K)=>{Uw.init(c,K),Ic.init(c,K),c.element=K.element,c.min=(w,P)=>c.check(k2(w,P)),c.nonempty=(w)=>c.check(k2(1,w)),c.max=(w,P)=>c.check(L4(w,P)),c.length=(w,P)=>c.check(H4(w,P)),c.unwrap=()=>c.element});function Q1(c,K){return N5(Y1,c,K)}var V1=E("ZodObject",(c,K)=>{Vw.init(c,K),Ic.init(c,K),a.defineLazy(c,"shape",()=>K.shape),c.keyof=()=>E1(Object.keys(c._zod.def.shape)),c.catchall=(w)=>c.clone({...c._zod.def,catchall:w}),c.passthrough=()=>c.clone({...c._zod.def,catchall:R5()}),c.loose=()=>c.clone({...c._zod.def,catchall:R5()}),c.strict=()=>c.clone({...c._zod.def,catchall:U1()}),c.strip=()=>c.clone({...c._zod.def,catchall:void 0}),c.extend=(w)=>{return a.extend(c,w)},c.safeExtend=(w)=>{return a.safeExtend(c,w)},c.merge=(w)=>a.merge(c,w),c.pick=(w)=>a.pick(c,w),c.omit=(w)=>a.omit(c,w),c.partial=(...w)=>a.partial(y5,c,w[0]),c.required=(...w)=>a.required(_5,c,w[0])});function C5(c,K){let w={type:"object",get shape(){return a.assignProp(this,"shape",c?a.objectClone(c):{}),this.shape},...a.normalizeParams(K)};return new V1(w)}var q1=E("ZodUnion",(c,K)=>{qw.init(c,K),Ic.init(c,K),c.options=K.options});function L1(c,K){return new q1({type:"union",options:c,...a.normalizeParams(K)})}var H1=E("ZodIntersection",(c,K)=>{Lw.init(c,K),Ic.init(c,K)});function v1(c,K){return new H1({type:"intersection",left:c,right:K})}var RK=E("ZodEnum",(c,K)=>{Hw.init(c,K),Ic.init(c,K),c.enum=K.entries,c.options=Object.values(K.entries);let w=new Set(Object.keys(K.entries));c.extract=(P,h)=>{let M={};for(let S of P)if(w.has(S))M[S]=K.entries[S];else throw Error(`Key ${S} not found in enum`);return new RK({...K,checks:[],...a.normalizeParams(h),entries:M})},c.exclude=(P,h)=>{let M={...K.entries};for(let S of P)if(w.has(S))delete M[S];else throw Error(`Key ${S} not found in enum`);return new RK({...K,checks:[],...a.normalizeParams(h),entries:M})}});function E1(c,K){let w=Array.isArray(c)?Object.fromEntries(c.map((P)=>[P,P])):c;return new RK({type:"enum",entries:w,...a.normalizeParams(K)})}var F1=E("ZodTransform",(c,K)=>{vw.init(c,K),Ic.init(c,K),c._zod.parse=(w,P)=>{if(P.direction==="backward")throw new r2(c.constructor.name);w.addIssue=(M)=>{if(typeof M==="string")w.issues.push(a.issue(M,w.value,K));else{let S=M;if(S.fatal)S.continue=!1;S.code??(S.code="custom"),S.input??(S.input=w.value),S.inst??(S.inst=c),w.issues.push(a.issue(S))}};let h=K.transform(w.value,w);if(h instanceof Promise)return h.then((M)=>{return w.value=M,w});return w.value=h,w}});function g1(c){return new F1({type:"transform",transform:c})}var y5=E("ZodOptional",(c,K)=>{Ew.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function x5(c){return new y5({type:"optional",innerType:c})}var k1=E("ZodNullable",(c,K)=>{Fw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function Z5(c){return new k1({type:"nullable",innerType:c})}var R1=E("ZodDefault",(c,K)=>{gw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType,c.removeDefault=c.unwrap});function x1(c,K){return new R1({type:"default",innerType:c,get defaultValue(){return typeof K==="function"?K():a.shallowClone(K)}})}var Z1=E("ZodPrefault",(c,K)=>{kw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function A1(c,K){return new Z1({type:"prefault",innerType:c,get defaultValue(){return typeof K==="function"?K():a.shallowClone(K)}})}var _5=E("ZodNonOptional",(c,K)=>{Rw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function r1(c,K){return new _5({type:"nonoptional",innerType:c,...a.normalizeParams(K)})}var o1=E("ZodCatch",(c,K)=>{xw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType,c.removeCatch=c.unwrap});function m1(c,K){return new o1({type:"catch",innerType:c,catchValue:typeof K==="function"?K:()=>K})}var u1=E("ZodPipe",(c,K)=>{Zw.init(c,K),Ic.init(c,K),c.in=K.in,c.out=K.out});function A5(c,K){return new u1({type:"pipe",in:c,out:K})}var C1=E("ZodReadonly",(c,K)=>{Aw.init(c,K),Ic.init(c,K),c.unwrap=()=>c._zod.def.innerType});function y1(c){return new C1({type:"readonly",innerType:c})}var _1=E("ZodCustom",(c,K)=>{rw.init(c,K),Ic.init(c,K)});function f1(c,K={}){return I5(_1,c,K)}function e1(c){return D5(c)}class R2{configs;options;#c=Z2.ETokenAudiences.SYSTEM;token;constructor(c,K){this.configs=c;this.options=K}async signToken(){try{let c=new Uint8Array(Buffer.from(this.configs.secretKey,"base64")),K=await crypto.subtle.importKey("raw",c,{name:"HMAC",hash:"SHA-512"},!1,["sign","verify"]),w=await new G4({tenantId:this.configs.tenantId,appId:this.configs.appId,modeId:this.configs.modeId,iss:this.configs.tenantId,aud:Z2.ETokenAudiences.SYSTEM}).setProtectedHeader({alg:"HS512"}).sign(K);return this.token=w,w}catch(c){if(this.options?.logs)console.error("[BoolGuard] Sign token error:",c);throw c}}async ping(){try{let c=this.token||await this.signToken(),K=new Headers;K.append("X-Tenant-ID",this.configs.tenantId),K.append("X-App-ID",this.configs.appId),K.append("X-Mode-ID",this.configs.modeId),K.append("Authorization",`Bearer ${c}`);let w=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-modes/ping`,{method:"GET",headers:K});if(!w.ok)throw await w.json();return w.ok}catch(c){if(this.options?.logs)console.error("[BoolGuard] Ping error:",c);return!1}}async createPlainAccount({identity:c,password:K,metadata:w}){try{let P=this.token||await this.signToken(),h=new Headers;h.append("X-Tenant-ID",this.configs.tenantId),h.append("X-App-ID",this.configs.appId),h.append("X-Mode-ID",this.configs.modeId),h.append("Authorization",`Bearer ${P}`),h.append("Content-Type","application/json");let M=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-mode-accounts`,{method:"POST",headers:h,body:JSON.stringify({data:{type:"plain",identity:c,password:K,metadata:w}})});if(!M.ok)throw await M.json();let{data:S}=await M.json();return Object.freeze({account:S.account,credential:S.credential})}catch(P){if(this.options?.logs)console.error("[BoolGuard] Create plain account error:",P);throw P}}async createEmailAccount({identity:c,password:K,metadata:w}){try{let P=this.token||await this.signToken(),h=new Headers;h.append("X-Tenant-ID",this.configs.tenantId),h.append("X-App-ID",this.configs.appId),h.append("X-Mode-ID",this.configs.modeId),h.append("Authorization",`Bearer ${P}`),h.append("Content-Type","application/json");let M=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-mode-accounts`,{method:"POST",headers:h,body:JSON.stringify({data:{type:"email",identity:c,password:K,metadata:w}})});if(!M.ok)throw await M.json();let{data:S}=await M.json();return Object.freeze({account:S.account,credential:S.credential})}catch(P){if(this.options?.logs)console.error("[BoolGuard] Create email account error:",P);throw P}}async authenticate({identity:c,password:K}){try{let w=this.token||await this.signToken(),P=await u5().safeParseAsync(c),h=new Headers;h.append("X-Tenant-ID",this.configs.tenantId),h.append("X-App-ID",this.configs.appId),h.append("X-Mode-ID",this.configs.modeId),h.append("Authorization",`Bearer ${w}`),h.append("Content-Type","application/json");let M=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-mode-accounts/authenticate`,{method:"POST",headers:h,body:JSON.stringify({data:{type:!P.success?"plain":"email",identity:c,password:K}})});if(!M.ok)throw await M.json();let{data:S}=await M.json();return Object.freeze({account:S.account,credential:S.credential,token:S.token})}catch(w){if(this.options?.logs)console.error("[BoolGuard] Authenticate error:",w);throw w}}async verifyToken({token:c}){try{let K=this.token||await this.signToken(),w=new Headers;w.append("X-Tenant-ID",this.configs.tenantId),w.append("X-App-ID",this.configs.appId),w.append("X-Mode-ID",this.configs.modeId),w.append("Authorization",`Bearer ${K}`),w.append("Content-Type","application/json");let P=await fetch(`${this.#c}/v${this.options?.version}/tenant-app-mode-accounts/verify`,{method:"POST",headers:w,body:JSON.stringify({data:{token:c}})});if(!P.ok)throw await P.json();let{data:h}=await P.json();return Object.freeze({account:h.account,credential:h.credential})}catch(K){if(this.options?.logs)console.error("[BoolGuard] Verify token error:",K);throw K}}}var UM=async(c,K)=>{let w=new R2(c,K);if(await w.signToken(),!await w.ping())throw Error("Ping to Bool Guard service failed!");return[Gc.guardClient,w]};var p1=C5({authorization:o5().startsWith("Bearer ").min(24).transform((c)=>{let[K,w]=c.split(" ");return Object.freeze({schema:K,token:w})})});class xK{clientInstance;constructor(c){this.clientInstance=c}async start(c,K){let w=await p1.safeParseAsync(K.toJSON());if(!w.success)return c.set(Gc.authState,void 0);else{let{authorization:{token:P}}=w.data;try{let{account:h,credential:M}=await this.clientInstance.verifyToken({token:P}),S=Object.freeze({account:h,credential:M});return c.set(Gc.authState,S)}catch(h){return console.error(h),c.set(Gc.authState,void 0)}}}}Q2([W2(0,J4()),W2(1,S6())],xK.prototype,"start",null),xK=Q2([W6(),W2(0,O6(R2))],xK);export{UM as loader,xK as Middleware,Gc as Keys,a4 as Interceptor,Z2 as Enums,n3 as ControllerGuard,R2 as Client,s4 as AuthState,t5 as ActionGuard};
38
38
 
39
- //# debugId=0DA43F0172A4F71964756E2164756E21
39
+ //# debugId=F398FAC4309FC37864756E2164756E21