tempest.games 0.1.35 → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,74 +1,74 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var Pl=Object.create;var{getPrototypeOf:tl,defineProperty:vf,getOwnPropertyNames:rl}=Object;var gl=Object.prototype.hasOwnProperty;var $f=(n,i,o)=>{o=n!=null?Pl(tl(n)):{};let c=i||!n||!n.__esModule?vf(o,"default",{value:n,enumerable:!0}):o;for(let p of rl(n))if(!gl.call(c,p))vf(c,p,{get:()=>n[p],enumerable:!0});return c};var h=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var dl=(n,i)=>{for(var o in i)vf(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var Kn=import.meta.require;var xJ=h((pJ)=>{Object.defineProperty(pJ,"__esModule",{value:!0});class ro extends Error{}class nw extends ro{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class iw extends ro{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class ow extends ro{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class Hc extends ro{}class qf extends ro{constructor(n){super(`Invalid unit ${n}`)}}class wi extends ro{}class Vo extends ro{constructor(){super("Zone is an abstract class")}}var b="numeric",mo="short",Di="long",Om={year:b,month:b,day:b},cw={year:b,month:mo,day:b},mS={year:b,month:mo,day:b,weekday:mo},pw={year:b,month:Di,day:b},xw={year:b,month:Di,day:b,weekday:Di},mw={hour:b,minute:b},aw={hour:b,minute:b,second:b},fw={hour:b,minute:b,second:b,timeZoneName:mo},vw={hour:b,minute:b,second:b,timeZoneName:Di},$w={hour:b,minute:b,hourCycle:"h23"},ww={hour:b,minute:b,second:b,hourCycle:"h23"},Jw={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:mo},Aw={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:Di},Tw={year:b,month:b,day:b,hour:b,minute:b},Fw={year:b,month:b,day:b,hour:b,minute:b,second:b},Rw={year:b,month:mo,day:b,hour:b,minute:b},lw={year:b,month:mo,day:b,hour:b,minute:b,second:b},aS={year:b,month:mo,day:b,weekday:mo,hour:b,minute:b},Sw={year:b,month:Di,day:b,hour:b,minute:b,timeZoneName:mo},Xw={year:b,month:Di,day:b,hour:b,minute:b,second:b,timeZoneName:mo},Kw={year:b,month:Di,day:b,weekday:Di,hour:b,minute:b,timeZoneName:Di},Ww={year:b,month:Di,day:b,weekday:Di,hour:b,minute:b,second:b,timeZoneName:Di};class Qc{get type(){throw new Vo}get name(){throw new Vo}get ianaName(){return this.name}get isUniversal(){throw new Vo}offsetName(n,i){throw new Vo}formatOffset(n,i){throw new Vo}offset(n){throw new Vo}equals(n){throw new Vo}get isValid(){throw new Vo}}var Bf=null;class Sx extends Qc{static get instance(){if(Bf===null)Bf=new Sx;return Bf}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return Bw(n,i,o)}formatOffset(n,i){return Rx(this.offset(n),i)}offset(n){return-new Date(n).getTimezoneOffset()}equals(n){return n.type==="system"}get isValid(){return!0}}var Hm={};function fS(n){if(!Hm[n])Hm[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"});return Hm[n]}var vS={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function $S(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,x,m,a,f,v,$]=c;return[m,p,x,a,f,v,$]}function wS(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:x,value:m}=o[p],a=vS[x];if(x==="era")c[a]=m;else if(!nn(a))c[a]=parseInt(m,10)}return c}var Km={};class Wo extends Qc{static create(n){if(!Km[n])Km[n]=new Wo(n);return Km[n]}static resetCache(){Km={},Hm={}}static isValidSpecifier(n){return this.isValidZone(n)}static isValidZone(n){if(!n)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:n}).format(),!0}catch(i){return!1}}constructor(n){super();this.zoneName=n,this.valid=Wo.isValidZone(n)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return Bw(n,i,o,this.name)}formatOffset(n,i){return Rx(this.offset(n),i)}offset(n){let i=new Date(n);if(isNaN(i))return NaN;let o=fS(this.name),[c,p,x,m,a,f,v]=o.formatToParts?wS(o,i):$S(o,i);if(m==="BC")c=-Math.abs(c)+1;let w=bm({year:c,month:p,day:x,hour:a===24?0:a,minute:f,second:v,millisecond:0}),J=+i,l=J%1000;return J-=l>=0?l:1000+l,(w-J)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var M1={};function JS(n,i={}){let o=JSON.stringify([n,i]),c=M1[o];if(!c)c=new Intl.ListFormat(n,i),M1[o]=c;return c}var Cf={};function If(n,i={}){let o=JSON.stringify([n,i]),c=Cf[o];if(!c)c=new Intl.DateTimeFormat(n,i),Cf[o]=c;return c}var yf={};function AS(n,i={}){let o=JSON.stringify([n,i]),c=yf[o];if(!c)c=new Intl.NumberFormat(n,i),yf[o]=c;return c}var kf={};function TS(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),x=kf[p];if(!x)x=new Intl.RelativeTimeFormat(n,i),kf[p]=x;return x}var Tx=null;function FS(){if(Tx)return Tx;else return Tx=new Intl.DateTimeFormat().resolvedOptions().locale,Tx}var H1={};function RS(n){let i=H1[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,H1[n]=i}return i}function lS(n){let i=n.indexOf("-x-");if(i!==-1)n=n.substring(0,i);let o=n.indexOf("-u-");if(o===-1)return[n];else{let c,p;try{c=If(n).resolvedOptions(),p=n}catch(a){let f=n.substring(0,o);c=If(f).resolvedOptions(),p=f}let{numberingSystem:x,calendar:m}=c;return[p,x,m]}}function SS(n,i,o){if(o||i){if(!n.includes("-u-"))n+="-u";if(o)n+=`-ca-${o}`;if(i)n+=`-nu-${i}`;return n}else return n}function XS(n){let i=[];for(let o=1;o<=12;o++){let c=e.utc(2009,o,1);i.push(n(c))}return i}function KS(n){let i=[];for(let o=1;o<=7;o++){let c=e.utc(2016,11,13+o);i.push(n(c))}return i}function Wm(n,i,o,c){let p=n.listingMode();if(p==="error")return null;else if(p==="en")return o(i);else return c(i)}function WS(n){if(n.numberingSystem&&n.numberingSystem!=="latn")return!1;else return n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class Gw{constructor(n,i,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;let{padTo:c,floor:p,...x}=o;if(!i||Object.keys(x).length>0){let m={useGrouping:!1,...o};if(o.padTo>0)m.minimumIntegerDigits=o.padTo;this.inf=AS(n,m)}}format(n){if(this.inf){let i=this.floor?Math.floor(n):n;return this.inf.format(i)}else{let i=this.floor?Math.floor(n):ef(n,3);return tn(i,this.padTo)}}}class Yw{constructor(n,i,o){this.opts=o,this.originalZone=void 0;let c=void 0;if(this.opts.timeZone)this.dt=n;else if(n.zone.type==="fixed"){let x=-1*(n.offset/60),m=x>=0?`Etc/GMT+${x}`:`Etc/GMT${x}`;if(n.offset!==0&&Wo.create(m).valid)c=m,this.dt=n;else c="UTC",this.dt=n.offset===0?n:n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone}else if(n.zone.type==="system")this.dt=n;else if(n.zone.type==="iana")this.dt=n,c=n.zone.name;else c="UTC",this.dt=n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone;let p={...this.opts};p.timeZone=p.timeZone||c,this.dtf=If(i,p)}format(){if(this.originalZone)return this.formatToParts().map(({value:n})=>n).join("");return this.dtf.format(this.dt.toJSDate())}formatToParts(){let n=this.dtf.formatToParts(this.dt.toJSDate());if(this.originalZone)return n.map((i)=>{if(i.type==="timeZoneName"){let o=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...i,value:o}}else return i});return n}resolvedOptions(){return this.dtf.resolvedOptions()}}class Mw{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&Vw())this.rtf=TS(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return yS(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var GS={firstDay:1,minimalDays:4,weekend:[6,7]};class Wn{static fromOpts(n){return Wn.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let x=n||un.defaultLocale,m=x||(p?"en-US":FS()),a=i||un.defaultNumberingSystem,f=o||un.defaultOutputCalendar,v=Zf(c)||un.defaultWeekSettings;return new Wn(m,a,f,v,x)}static resetCache(){Tx=null,Cf={},yf={},kf={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return Wn.create(n,i,o,c)}constructor(n,i,o,c,p){let[x,m,a]=lS(n);this.locale=x,this.numberingSystem=i||m||null,this.outputCalendar=o||a||null,this.weekSettings=c,this.intl=SS(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=p,this.fastNumbersCached=null}get fastNumbers(){if(this.fastNumbersCached==null)this.fastNumbersCached=WS(this);return this.fastNumbersCached}listingMode(){let n=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return n&&i?"en":"intl"}clone(n){if(!n||Object.getOwnPropertyNames(n).length===0)return this;else return Wn.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,Zf(n.weekSettings)||this.weekSettings,n.defaultToEN||!1)}redefaultToEN(n={}){return this.clone({...n,defaultToEN:!0})}redefaultToSystem(n={}){return this.clone({...n,defaultToEN:!1})}months(n,i=!1){return Wm(this,n,Dw,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=XS((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Wm(this,n,Nw,()=>{let o=i?{weekday:n,year:"numeric",month:"long",day:"numeric"}:{weekday:n},c=i?"format":"standalone";if(!this.weekdaysCache[c][n])this.weekdaysCache[c][n]=KS((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Wm(this,void 0,()=>hw,()=>{if(!this.meridiemCache){let n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[e.utc(2016,11,13,9),e.utc(2016,11,13,19)].map((i)=>this.extract(i,n,"dayperiod"))}return this.meridiemCache})}eras(n){return Wm(this,n,Cw,()=>{let i={era:n};if(!this.eraCache[n])this.eraCache[n]=[e.utc(-40,1,1),e.utc(2017,1,1)].map((o)=>this.extract(o,i,"era"));return this.eraCache[n]})}extract(n,i,o){let c=this.dtFormatter(n,i),p=c.formatToParts(),x=p.find((m)=>m.type.toLowerCase()===o);return x?x.value:null}numberFormatter(n={}){return new Gw(this.intl,n.forceSimple||this.fastNumbers,n)}dtFormatter(n,i={}){return new Yw(n,this.intl,i)}relFormatter(n={}){return new Mw(this.intl,this.isEnglish(),n)}listFormatter(n={}){return JS(this.intl,n)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){if(this.weekSettings)return this.weekSettings;else if(!_w())return GS;else return RS(this.locale)}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(n){return this.locale===n.locale&&this.numberingSystem===n.numberingSystem&&this.outputCalendar===n.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}var bf=null;class Ki extends Qc{static get utcInstance(){if(bf===null)bf=new Ki(0);return bf}static instance(n){return n===0?Ki.utcInstance:new Ki(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Ki(jm(i[1],i[2]))}return null}constructor(n){super();this.fixed=n}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Rx(this.fixed,"narrow")}`}get ianaName(){if(this.fixed===0)return"Etc/UTC";else return`Etc/GMT${Rx(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(n,i){return Rx(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(n){return n.type==="fixed"&&n.fixed===this.fixed}get isValid(){return!0}}class Pf extends Qc{constructor(n){super();this.zoneName=n}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Po(n,i){if(nn(n)||n===null)return i;else if(n instanceof Qc)return n;else if(ES(n)){let o=n.toLowerCase();if(o==="default")return i;else if(o==="local"||o==="system")return Sx.instance;else if(o==="utc"||o==="gmt")return Ki.utcInstance;else return Ki.parseSpecifier(o)||Wo.create(n)}else if(to(n))return Ki.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new Pf(n)}var tf={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},z1={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},YS=tf.hanidec.replace(/[\[|\]]/g,"").split("");function MS(n){let i=parseInt(n,10);if(isNaN(i)){i="";for(let o=0;o<n.length;o++){let c=n.charCodeAt(o);if(n[o].search(tf.hanidec)!==-1)i+=YS.indexOf(n[o]);else for(let p in z1){let[x,m]=z1[p];if(c>=x&&c<=m)i+=c-x}}return parseInt(i,10)}else return i}var ap={};function HS(){ap={}}function po({numberingSystem:n},i=""){let o=n||"latn";if(!ap[o])ap[o]={};if(!ap[o][i])ap[o][i]=new RegExp(`${tf[o]}${i}`);return ap[o][i]}var Q1=()=>Date.now(),E1="system",O1=null,U1=null,V1=null,_1=60,B1,b1=null;class un{static get now(){return Q1}static set now(n){Q1=n}static set defaultZone(n){E1=n}static get defaultZone(){return Po(E1,Sx.instance)}static get defaultLocale(){return O1}static set defaultLocale(n){O1=n}static get defaultNumberingSystem(){return U1}static set defaultNumberingSystem(n){U1=n}static get defaultOutputCalendar(){return V1}static set defaultOutputCalendar(n){V1=n}static get defaultWeekSettings(){return b1}static set defaultWeekSettings(n){b1=Zf(n)}static get twoDigitCutoffYear(){return _1}static set twoDigitCutoffYear(n){_1=n%100}static get throwOnInvalid(){return B1}static set throwOnInvalid(n){B1=n}static resetCaches(){Wn.resetCache(),Wo.resetCache(),e.resetCache(),HS()}}class qi{constructor(n,i){this.reason=n,this.explanation=i}toMessage(){if(this.explanation)return`${this.reason}: ${this.explanation}`;else return this.reason}}var Hw=[0,31,59,90,120,151,181,212,243,273,304,334],zw=[0,31,60,91,121,152,182,213,244,274,305,335];function Pi(n,i){return new qi("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function rf(n,i,o){let c=new Date(Date.UTC(n,i-1,o));if(n<100&&n>=0)c.setUTCFullYear(c.getUTCFullYear()-1900);let p=c.getUTCDay();return p===0?7:p}function Qw(n,i,o){return o+(Xx(n)?zw:Hw)[i-1]}function Ew(n,i){let o=Xx(n)?zw:Hw,c=o.findIndex((x)=>x<i),p=i-o[c];return{month:c+1,day:p}}function gf(n,i){return(n-i+7)%7+1}function Um(n,i=4,o=1){let{year:c,month:p,day:x}=n,m=Qw(c,p,x),a=gf(rf(c,p,x),o),f=Math.floor((m-a+14-i)/7),v;if(f<1)v=c-1,f=lx(v,i,o);else if(f>lx(c,i,o))v=c+1,f=1;else v=c;return{weekYear:v,weekNumber:f,weekday:a,...Dm(n)}}function j1(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:x}=n,m=gf(rf(c,1,i),o),a=vp(c),f=p*7+x-m-7+i,v;if(f<1)v=c-1,f+=vp(v);else if(f>a)v=c+1,f-=vp(c);else v=c;let{month:$,day:w}=Ew(v,f);return{year:v,month:$,day:w,...Dm(n)}}function jf(n){let{year:i,month:o,day:c}=n,p=Qw(i,o,c);return{year:i,ordinal:p,...Dm(n)}}function D1(n){let{year:i,ordinal:o}=n,{month:c,day:p}=Ew(i,o);return{year:i,month:c,day:p,...Dm(n)}}function L1(n,i){if(!nn(n.localWeekday)||!nn(n.localWeekNumber)||!nn(n.localWeekYear)){if(!nn(n.weekday)||!nn(n.weekNumber)||!nn(n.weekYear))throw new Hc("Cannot mix locale-based week fields with ISO-based week fields");if(!nn(n.localWeekday))n.weekday=n.localWeekday;if(!nn(n.localWeekNumber))n.weekNumber=n.localWeekNumber;if(!nn(n.localWeekYear))n.weekYear=n.localWeekYear;return delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:i.getMinDaysInFirstWeek(),startOfWeek:i.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function zS(n,i=4,o=1){let c=Bm(n.weekYear),p=ti(n.weekNumber,1,lx(n.weekYear,i,o)),x=ti(n.weekday,1,7);if(!c)return Pi("weekYear",n.weekYear);else if(!p)return Pi("week",n.weekNumber);else if(!x)return Pi("weekday",n.weekday);else return!1}function QS(n){let i=Bm(n.year),o=ti(n.ordinal,1,vp(n.year));if(!i)return Pi("year",n.year);else if(!o)return Pi("ordinal",n.ordinal);else return!1}function Ow(n){let i=Bm(n.year),o=ti(n.month,1,12),c=ti(n.day,1,Vm(n.year,n.month));if(!i)return Pi("year",n.year);else if(!o)return Pi("month",n.month);else if(!c)return Pi("day",n.day);else return!1}function Uw(n){let{hour:i,minute:o,second:c,millisecond:p}=n,x=ti(i,0,23)||i===24&&o===0&&c===0&&p===0,m=ti(o,0,59),a=ti(c,0,59),f=ti(p,0,999);if(!x)return Pi("hour",i);else if(!m)return Pi("minute",o);else if(!a)return Pi("second",c);else if(!f)return Pi("millisecond",p);else return!1}function nn(n){return typeof n==="undefined"}function to(n){return typeof n==="number"}function Bm(n){return typeof n==="number"&&n%1===0}function ES(n){return typeof n==="string"}function OS(n){return Object.prototype.toString.call(n)==="[object Date]"}function Vw(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function _w(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function US(n){return Array.isArray(n)?n:[n]}function u1(n,i,o){if(n.length===0)return;return n.reduce((c,p)=>{let x=[i(p),p];if(!c)return x;else if(o(c[0],x[0])===c[0])return c;else return x},null)[1]}function VS(n,i){return i.reduce((o,c)=>{return o[c]=n[c],o},{})}function wp(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function Zf(n){if(n==null)return null;else if(typeof n!=="object")throw new wi("Week settings must be an object");else{if(!ti(n.firstDay,1,7)||!ti(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some((i)=>!ti(i,1,7)))throw new wi("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}}function ti(n,i,o){return Bm(n)&&n>=i&&n<=o}function _S(n,i){return n-i*Math.floor(n/i)}function tn(n,i=2){let o=n<0,c;if(o)c="-"+(""+-n).padStart(i,"0");else c=(""+n).padStart(i,"0");return c}function qo(n){if(nn(n)||n===null||n==="")return;else return parseInt(n,10)}function Yc(n){if(nn(n)||n===null||n==="")return;else return parseFloat(n)}function df(n){if(nn(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function ef(n,i,o=!1){let c=10**i;return(o?Math.trunc:Math.round)(n*c)/c}function Xx(n){return n%4===0&&(n%100!==0||n%400===0)}function vp(n){return Xx(n)?366:365}function Vm(n,i){let o=_S(i-1,12)+1,c=n+(i-o)/12;if(o===2)return Xx(c)?29:28;else return[31,null,31,30,31,30,31,31,30,31,30,31][o-1]}function bm(n){let i=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);if(n.year<100&&n.year>=0)i=new Date(i),i.setUTCFullYear(n.year,n.month-1,n.day);return+i}function N1(n,i,o){return-gf(rf(n,1,i),o)+i-1}function lx(n,i=4,o=1){let c=N1(n,i,o),p=N1(n+1,i,o);return(vp(n)-c+p)/7}function sf(n){if(n>99)return n;else return n>un.twoDigitCutoffYear?1900+n:2000+n}function Bw(n,i,o,c=null){let p=new Date(n),x={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(c)x.timeZone=c;let m={timeZoneName:i,...x},a=new Intl.DateTimeFormat(o,m).formatToParts(p).find((f)=>f.type.toLowerCase()==="timezonename");return a?a.value:null}function jm(n,i){let o=parseInt(n,10);if(Number.isNaN(o))o=0;let c=parseInt(i,10)||0,p=o<0||Object.is(o,-0)?-c:c;return o*60+p}function bw(n){let i=Number(n);if(typeof n==="boolean"||n===""||Number.isNaN(i))throw new wi(`Invalid unit value ${n}`);return i}function _m(n,i){let o={};for(let c in n)if(wp(n,c)){let p=n[c];if(p===void 0||p===null)continue;o[i(c)]=bw(p)}return o}function Rx(n,i){let o=Math.trunc(Math.abs(n/60)),c=Math.trunc(Math.abs(n%60)),p=n>=0?"+":"-";switch(i){case"short":return`${p}${tn(o,2)}:${tn(c,2)}`;case"narrow":return`${p}${o}${c>0?`:${c}`:""}`;case"techie":return`${p}${tn(o,2)}${tn(c,2)}`;default:throw new RangeError(`Value format ${i} is out of range for property format`)}}function Dm(n){return VS(n,["hour","minute","second","millisecond"])}var BS=["January","February","March","April","May","June","July","August","September","October","November","December"],jw=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],bS=["J","F","M","A","M","J","J","A","S","O","N","D"];function Dw(n){switch(n){case"narrow":return[...bS];case"short":return[...jw];case"long":return[...BS];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Lw=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],uw=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],jS=["M","T","W","T","F","S","S"];function Nw(n){switch(n){case"narrow":return[...jS];case"short":return[...uw];case"long":return[...Lw];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var hw=["AM","PM"],DS=["Before Christ","Anno Domini"],LS=["BC","AD"],uS=["B","A"];function Cw(n){switch(n){case"narrow":return[...uS];case"short":return[...LS];case"long":return[...DS];default:return null}}function NS(n){return hw[n.hour<12?0:1]}function hS(n,i){return Nw(i)[n.weekday-1]}function CS(n,i){return Dw(i)[n.month-1]}function IS(n,i){return Cw(i)[n.year<0?0:1]}function yS(n,i,o="always",c=!1){let p={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},x=["hours","minutes","seconds"].indexOf(n)===-1;if(o==="auto"&&x){let w=n==="days";switch(i){case 1:return w?"tomorrow":`next ${p[n][0]}`;case-1:return w?"yesterday":`last ${p[n][0]}`;case 0:return w?"today":`this ${p[n][0]}`}}let m=Object.is(i,-0)||i<0,a=Math.abs(i),f=a===1,v=p[n],$=c?f?v[1]:v[2]||v[1]:f?p[n][0]:n;return m?`${a} ${$} ago`:`in ${a} ${$}`}function h1(n,i){let o="";for(let c of n)if(c.literal)o+=c.val;else o+=i(c.val);return o}var kS={D:Om,DD:cw,DDD:pw,DDDD:xw,t:mw,tt:aw,ttt:fw,tttt:vw,T:$w,TT:ww,TTT:Jw,TTTT:Aw,f:Tw,ff:Rw,fff:Sw,ffff:Kw,F:Fw,FF:lw,FFF:Xw,FFFF:Ww};class Xi{static create(n,i={}){return new Xi(n,i)}static parseFormat(n){let i=null,o="",c=!1,p=[];for(let x=0;x<n.length;x++){let m=n.charAt(x);if(m==="'"){if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});i=null,o="",c=!c}else if(c)o+=m;else if(m===i)o+=m;else{if(o.length>0)p.push({literal:/^\s+$/.test(o),val:o});o=m,i=m}}if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});return p}static macroTokenToFormatOpts(n){return kS[n]}constructor(n,i){this.opts=i,this.loc=n,this.systemLoc=null}formatWithSystemDefault(n,i){if(this.systemLoc===null)this.systemLoc=this.loc.redefaultToSystem();return this.systemLoc.dtFormatter(n,{...this.opts,...i}).format()}dtFormatter(n,i={}){return this.loc.dtFormatter(n,{...this.opts,...i})}formatDateTime(n,i){return this.dtFormatter(n,i).format()}formatDateTimeParts(n,i){return this.dtFormatter(n,i).formatToParts()}formatInterval(n,i){return this.dtFormatter(n.start,i).dtf.formatRange(n.start.toJSDate(),n.end.toJSDate())}resolvedOptions(n,i){return this.dtFormatter(n,i).resolvedOptions()}num(n,i=0){if(this.opts.forceSimple)return tn(n,i);let o={...this.opts};if(i>0)o.padTo=i;return this.loc.numberFormatter(o).format(n)}formatDateTimeFromString(n,i){let o=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",p=(J,l)=>this.loc.extract(n,J,l),x=(J)=>{if(n.isOffsetFixed&&n.offset===0&&J.allowZ)return"Z";return n.isValid?n.zone.formatOffset(n.ts,J.format):""},m=()=>o?NS(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(J,l)=>o?CS(n,J):p(l?{month:J}:{month:J,day:"numeric"},"month"),f=(J,l)=>o?hS(n,J):p(l?{weekday:J}:{weekday:J,month:"long",day:"numeric"},"weekday"),v=(J)=>{let l=Xi.macroTokenToFormatOpts(J);if(l)return this.formatWithSystemDefault(n,l);else return J},$=(J)=>o?IS(n,J):p({era:J},"era"),w=(J)=>{switch(J){case"S":return this.num(n.millisecond);case"u":case"SSS":return this.num(n.millisecond,3);case"s":return this.num(n.second);case"ss":return this.num(n.second,2);case"uu":return this.num(Math.floor(n.millisecond/10),2);case"uuu":return this.num(Math.floor(n.millisecond/100));case"m":return this.num(n.minute);case"mm":return this.num(n.minute,2);case"h":return this.num(n.hour%12===0?12:n.hour%12);case"hh":return this.num(n.hour%12===0?12:n.hour%12,2);case"H":return this.num(n.hour);case"HH":return this.num(n.hour,2);case"Z":return x({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return x({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return x({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return n.zone.offsetName(n.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return n.zone.offsetName(n.ts,{format:"long",locale:this.loc.locale});case"z":return n.zoneName;case"a":return m();case"d":return c?p({day:"numeric"},"day"):this.num(n.day);case"dd":return c?p({day:"2-digit"},"day"):this.num(n.day,2);case"c":return this.num(n.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return c?p({month:"numeric",day:"numeric"},"month"):this.num(n.month);case"LL":return c?p({month:"2-digit",day:"numeric"},"month"):this.num(n.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return c?p({month:"numeric"},"month"):this.num(n.month);case"MM":return c?p({month:"2-digit"},"month"):this.num(n.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return c?p({year:"numeric"},"year"):this.num(n.year);case"yy":return c?p({year:"2-digit"},"year"):this.num(n.year.toString().slice(-2),2);case"yyyy":return c?p({year:"numeric"},"year"):this.num(n.year,4);case"yyyyyy":return c?p({year:"numeric"},"year"):this.num(n.year,6);case"G":return $("short");case"GG":return $("long");case"GGGGG":return $("narrow");case"kk":return this.num(n.weekYear.toString().slice(-2),2);case"kkkk":return this.num(n.weekYear,4);case"W":return this.num(n.weekNumber);case"WW":return this.num(n.weekNumber,2);case"n":return this.num(n.localWeekNumber);case"nn":return this.num(n.localWeekNumber,2);case"ii":return this.num(n.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(n.localWeekYear,4);case"o":return this.num(n.ordinal);case"ooo":return this.num(n.ordinal,3);case"q":return this.num(n.quarter);case"qq":return this.num(n.quarter,2);case"X":return this.num(Math.floor(n.ts/1000));case"x":return this.num(n.ts);default:return v(J)}};return h1(Xi.parseFormat(i),w)}formatDurationFromString(n,i){let o=(a)=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},c=(a)=>(f)=>{let v=o(f);if(v)return this.num(a.get(v),f.length);else return f},p=Xi.parseFormat(i),x=p.reduce((a,{literal:f,val:v})=>f?a:a.concat(v),[]),m=n.shiftTo(...x.map(o).filter((a)=>a));return h1(p,c(m))}}var Iw=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Jp(...n){let i=n.reduce((o,c)=>o+c.source,"");return RegExp(`^${i}$`)}function Ap(...n){return(i)=>n.reduce(([o,c,p],x)=>{let[m,a,f]=x(i,p);return[{...o,...m},a||c,f]},[{},null,1]).slice(0,2)}function Tp(n,...i){if(n==null)return[null,null];for(let[o,c]of i){let p=o.exec(n);if(p)return c(p)}return[null,null]}function yw(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=qo(i[o+p]);return[c,null,o+p]}}var kw=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ZS=`(?:${kw.source}?(?:\\[(${Iw.source})\\])?)?`,nv=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Zw=RegExp(`${nv.source}${ZS}`),iv=RegExp(`(?:T${Zw.source})?`),sS=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,qS=/(\d{4})-?W(\d\d)(?:-?(\d))?/,PS=/(\d{4})-?(\d{3})/,tS=yw("weekYear","weekNumber","weekDay"),rS=yw("year","ordinal"),gS=/(\d{4})-(\d\d)-(\d\d)/,sw=RegExp(`${nv.source} ?(?:${kw.source}|(${Iw.source}))?`),dS=RegExp(`(?: ${sw.source})?`);function $p(n,i,o){let c=n[i];return nn(c)?o:qo(c)}function eS(n,i){return[{year:$p(n,i),month:$p(n,i+1,1),day:$p(n,i+2,1)},null,i+3]}function Fp(n,i){return[{hours:$p(n,i,0),minutes:$p(n,i+1,0),seconds:$p(n,i+2,0),milliseconds:df(n[i+3])},null,i+4]}function Kx(n,i){let o=!n[i]&&!n[i+1],c=jm(n[i+1],n[i+2]),p=o?null:Ki.instance(c);return[{},p,i+3]}function Wx(n,i){let o=n[i]?Wo.create(n[i]):null;return[{},o,i+1]}var n3=RegExp(`^T?${nv.source}$`),i3=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function o3(n){let[i,o,c,p,x,m,a,f,v]=n,$=i[0]==="-",w=f&&f[0]==="-",J=(l,S=!1)=>l!==void 0&&(S||l&&$)?-l:l;return[{years:J(Yc(o)),months:J(Yc(c)),weeks:J(Yc(p)),days:J(Yc(x)),hours:J(Yc(m)),minutes:J(Yc(a)),seconds:J(Yc(f),f==="-0"),milliseconds:J(df(v),w)}]}var c3={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ov(n,i,o,c,p,x,m){let a={year:i.length===2?sf(qo(i)):qo(i),month:jw.indexOf(o)+1,day:qo(c),hour:qo(p),minute:qo(x)};if(m)a.second=qo(m);if(n)a.weekday=n.length>3?Lw.indexOf(n)+1:uw.indexOf(n)+1;return a}var p3=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function x3(n){let[,i,o,c,p,x,m,a,f,v,$,w]=n,J=ov(i,p,c,o,x,m,a),l;if(f)l=c3[f];else if(v)l=0;else l=jm($,w);return[J,new Ki(l)]}function m3(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var a3=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,f3=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,v3=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function C1(n){let[,i,o,c,p,x,m,a]=n;return[ov(i,p,c,o,x,m,a),Ki.utcInstance]}function $3(n){let[,i,o,c,p,x,m,a]=n;return[ov(i,a,o,c,p,x,m),Ki.utcInstance]}var w3=Jp(sS,iv),J3=Jp(qS,iv),A3=Jp(PS,iv),T3=Jp(Zw),qw=Ap(eS,Fp,Kx,Wx),F3=Ap(tS,Fp,Kx,Wx),R3=Ap(rS,Fp,Kx,Wx),l3=Ap(Fp,Kx,Wx);function S3(n){return Tp(n,[w3,qw],[J3,F3],[A3,R3],[T3,l3])}function X3(n){return Tp(m3(n),[p3,x3])}function K3(n){return Tp(n,[a3,C1],[f3,C1],[v3,$3])}function W3(n){return Tp(n,[i3,o3])}var G3=Ap(Fp);function Y3(n){return Tp(n,[n3,G3])}var M3=Jp(gS,dS),H3=Jp(sw),z3=Ap(Fp,Kx,Wx);function Q3(n){return Tp(n,[M3,qw],[H3,z3])}var I1="Invalid Duration",Pw={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:604800000},days:{hours:24,minutes:1440,seconds:86400,milliseconds:86400000},hours:{minutes:60,seconds:3600,milliseconds:3600000},minutes:{seconds:60,milliseconds:60000},seconds:{milliseconds:1000}},E3={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536000,milliseconds:31536000000},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:7862400000},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592000,milliseconds:2592000000},...Pw},si=365.2425,pp=30.436875,O3={years:{quarters:4,months:12,weeks:si/7,days:si,hours:si*24,minutes:si*24*60,seconds:si*24*60*60,milliseconds:si*24*60*60*1000},quarters:{months:3,weeks:si/28,days:si/4,hours:si*24/4,minutes:si*24*60/4,seconds:si*24*60*60/4,milliseconds:si*24*60*60*1000/4},months:{weeks:pp/7,days:pp,hours:pp*24,minutes:pp*24*60,seconds:pp*24*60*60,milliseconds:pp*24*60*60*1000},...Pw},zc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],U3=zc.slice(0).reverse();function so(n,i,o=!1){let c={values:o?i.values:{...n.values,...i.values||{}},loc:n.loc.clone(i.loc),conversionAccuracy:i.conversionAccuracy||n.conversionAccuracy,matrix:i.matrix||n.matrix};return new An(c)}function tw(n,i){var o;let c=(o=i.milliseconds)!=null?o:0;for(let p of U3.slice(1))if(i[p])c+=i[p]*n[p].milliseconds;return c}function y1(n,i){let o=tw(n,i)<0?-1:1;zc.reduceRight((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]*o,m=n[p][c],a=Math.floor(x/m);i[p]+=a*o,i[c]-=a*m*o}return p}else return c},null),zc.reduce((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]%1;i[c]-=x,i[p]+=x*n[c][p]}return p}else return c},null)}function V3(n){let i={};for(let[o,c]of Object.entries(n))if(c!==0)i[o]=c;return i}class An{constructor(n){let i=n.conversionAccuracy==="longterm"||!1,o=i?O3:E3;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||Wn.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=n.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(n,i){return An.fromObject({milliseconds:n},i)}static fromObject(n,i={}){if(n==null||typeof n!=="object")throw new wi(`Duration.fromObject: argument expected to be an object, got ${n===null?"null":typeof n}`);return new An({values:_m(n,An.normalizeUnit),loc:Wn.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(to(n))return An.fromMillis(n);else if(An.isDuration(n))return n;else if(typeof n==="object")return An.fromObject(n);else throw new wi(`Unknown duration argument ${n} of type ${typeof n}`)}static fromISO(n,i){let[o]=W3(n);if(o)return An.fromObject(o,i);else return An.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static fromISOTime(n,i){let[o]=Y3(n);if(o)return An.fromObject(o,i);else return An.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the Duration is invalid");let o=n instanceof qi?n:new qi(n,i);if(un.throwOnInvalid)throw new ow(o);else return new An({invalid:o})}static normalizeUnit(n){let i={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[n?n.toLowerCase():n];if(!i)throw new qf(n);return i}static isDuration(n){return n&&n.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(n,i={}){let o={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?Xi.create(this.loc,o).formatDurationFromString(this,n):I1}toHuman(n={}){if(!this.isValid)return I1;let i=zc.map((o)=>{let c=this.values[o];if(nn(c))return null;return this.loc.numberFormatter({style:"unit",unitDisplay:"long",...n,unit:o.slice(0,-1)}).format(c)}).filter((o)=>o);return this.loc.listFormatter({type:"conjunction",style:n.listStyle||"narrow",...n}).format(i)}toObject(){if(!this.isValid)return{};return{...this.values}}toISO(){if(!this.isValid)return null;let n="P";if(this.years!==0)n+=this.years+"Y";if(this.months!==0||this.quarters!==0)n+=this.months+this.quarters*3+"M";if(this.weeks!==0)n+=this.weeks+"W";if(this.days!==0)n+=this.days+"D";if(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)n+="T";if(this.hours!==0)n+=this.hours+"H";if(this.minutes!==0)n+=this.minutes+"M";if(this.seconds!==0||this.milliseconds!==0)n+=ef(this.seconds+this.milliseconds/1000,3)+"S";if(n==="P")n+="T0S";return n}toISOTime(n={}){if(!this.isValid)return null;let i=this.toMillis();if(i<0||i>=86400000)return null;return n={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...n,includeOffset:!1},e.fromMillis(i,{zone:"UTC"}).toISOTime(n)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Duration { values: ${JSON.stringify(this.values)} }`;else return`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){if(!this.isValid)return NaN;return tw(this.matrix,this.values)}valueOf(){return this.toMillis()}plus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n),o={};for(let c of zc)if(wp(i.values,c)||wp(this.values,c))o[c]=i.get(c)+this.get(c);return so(this,{values:o},!0)}minus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n);return this.plus(i.negate())}mapUnits(n){if(!this.isValid)return this;let i={};for(let o of Object.keys(this.values))i[o]=bw(n(this.values[o],o));return so(this,{values:i},!0)}get(n){return this[An.normalizeUnit(n)]}set(n){if(!this.isValid)return this;let i={...this.values,..._m(n,An.normalizeUnit)};return so(this,{values:i})}reconfigure({locale:n,numberingSystem:i,conversionAccuracy:o,matrix:c}={}){let x={loc:this.loc.clone({locale:n,numberingSystem:i}),matrix:c,conversionAccuracy:o};return so(this,x)}as(n){return this.isValid?this.shiftTo(n).get(n):NaN}normalize(){if(!this.isValid)return this;let n=this.toObject();return y1(this.matrix,n),so(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=V3(this.normalize().shiftToAll().toObject());return so(this,{values:n},!0)}shiftTo(...n){if(!this.isValid)return this;if(n.length===0)return this;n=n.map((x)=>An.normalizeUnit(x));let i={},o={},c=this.toObject(),p;for(let x of zc)if(n.indexOf(x)>=0){p=x;let m=0;for(let f in o)m+=this.matrix[f][x]*o[f],o[f]=0;if(to(c[x]))m+=c[x];let a=Math.trunc(m);i[x]=a,o[x]=(m*1000-a*1000)/1000}else if(to(c[x]))o[x]=c[x];for(let x in o)if(o[x]!==0)i[p]+=x===p?o[x]:o[x]/this.matrix[p][x];return y1(this.matrix,i),so(this,{values:i},!0)}shiftToAll(){if(!this.isValid)return this;return this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds")}negate(){if(!this.isValid)return this;let n={};for(let i of Object.keys(this.values))n[i]=this.values[i]===0?0:-this.values[i];return so(this,{values:n},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(n){if(!this.isValid||!n.isValid)return!1;if(!this.loc.equals(n.loc))return!1;function i(o,c){if(o===void 0||o===0)return c===void 0||c===0;return o===c}for(let o of zc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var xp="Invalid Interval";function _3(n,i){if(!n||!n.isValid)return hn.invalid("missing or invalid start");else if(!i||!i.isValid)return hn.invalid("missing or invalid end");else if(i<n)return hn.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${i.toISO()}`);else return null}class hn{constructor(n){this.s=n.start,this.e=n.end,this.invalid=n.invalid||null,this.isLuxonInterval=!0}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the Interval is invalid");let o=n instanceof qi?n:new qi(n,i);if(un.throwOnInvalid)throw new iw(o);else return new hn({invalid:o})}static fromDateTimes(n,i){let o=Ax(n),c=Ax(i),p=_3(o,c);if(p==null)return new hn({start:o,end:c});else return p}static after(n,i){let o=An.fromDurationLike(i),c=Ax(n);return hn.fromDateTimes(c,c.plus(o))}static before(n,i){let o=An.fromDurationLike(i),c=Ax(n);return hn.fromDateTimes(c.minus(o),c)}static fromISO(n,i){let[o,c]=(n||"").split("/",2);if(o&&c){let p,x;try{p=e.fromISO(o,i),x=p.isValid}catch(f){x=!1}let m,a;try{m=e.fromISO(c,i),a=m.isValid}catch(f){a=!1}if(x&&a)return hn.fromDateTimes(p,m);if(x){let f=An.fromISO(c,i);if(f.isValid)return hn.after(p,f)}else if(a){let f=An.fromISO(o,i);if(f.isValid)return hn.before(m,f)}}return hn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static isInterval(n){return n&&n.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(n="milliseconds"){return this.isValid?this.toDuration(...[n]).get(n):NaN}count(n="milliseconds",i){if(!this.isValid)return NaN;let o=this.start.startOf(n,i),c;if(i!=null&&i.useLocaleWeeks)c=this.end.reconfigure({locale:o.locale});else c=this.end;return c=c.startOf(n,i),Math.floor(c.diff(o,n).get(n))+(c.valueOf()!==this.end.valueOf())}hasSame(n){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,n):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(n){if(!this.isValid)return!1;return this.s>n}isBefore(n){if(!this.isValid)return!1;return this.e<=n}contains(n){if(!this.isValid)return!1;return this.s<=n&&this.e>n}set({start:n,end:i}={}){if(!this.isValid)return this;return hn.fromDateTimes(n||this.s,i||this.e)}splitAt(...n){if(!this.isValid)return[];let i=n.map(Ax).filter((x)=>this.contains(x)).sort((x,m)=>x.toMillis()-m.toMillis()),o=[],{s:c}=this,p=0;while(c<this.e){let x=i[p]||this.e,m=+x>+this.e?this.e:x;o.push(hn.fromDateTimes(c,m)),c=m,p+=1}return o}splitBy(n){let i=An.fromDurationLike(n);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:o}=this,c=1,p,x=[];while(o<this.e){let m=this.start.plus(i.mapUnits((a)=>a*c));p=+m>+this.e?this.e:m,x.push(hn.fromDateTimes(o,p)),o=p,c+=1}return x}divideEqually(n){if(!this.isValid)return[];return this.splitBy(this.length()/n).slice(0,n)}overlaps(n){return this.e>n.s&&this.s<n.e}abutsStart(n){if(!this.isValid)return!1;return+this.e===+n.s}abutsEnd(n){if(!this.isValid)return!1;return+n.e===+this.s}engulfs(n){if(!this.isValid)return!1;return this.s<=n.s&&this.e>=n.e}equals(n){if(!this.isValid||!n.isValid)return!1;return this.s.equals(n.s)&&this.e.equals(n.e)}intersection(n){if(!this.isValid)return this;let i=this.s>n.s?this.s:n.s,o=this.e<n.e?this.e:n.e;if(i>=o)return null;else return hn.fromDateTimes(i,o)}union(n){if(!this.isValid)return this;let i=this.s<n.s?this.s:n.s,o=this.e>n.e?this.e:n.e;return hn.fromDateTimes(i,o)}static merge(n){let[i,o]=n.sort((c,p)=>c.s-p.s).reduce(([c,p],x)=>{if(!p)return[c,x];else if(p.overlaps(x)||p.abutsStart(x))return[c,p.union(x)];else return[c.concat([p]),x]},[[],null]);if(o)i.push(o);return i}static xor(n){let i=null,o=0,c=[],p=n.map((a)=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),x=Array.prototype.concat(...p),m=x.sort((a,f)=>a.time-f.time);for(let a of m)if(o+=a.type==="s"?1:-1,o===1)i=a.time;else{if(i&&+i!==+a.time)c.push(hn.fromDateTimes(i,a.time));i=null}return hn.merge(c)}difference(...n){return hn.xor([this].concat(n)).map((i)=>this.intersection(i)).filter((i)=>i&&!i.isEmpty())}toString(){if(!this.isValid)return xp;return`[${this.s.toISO()} \u2013 ${this.e.toISO()})`}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;else return`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(n=Om,i={}){return this.isValid?Xi.create(this.s.loc.clone(i),n).formatInterval(this):xp}toISO(n){if(!this.isValid)return xp;return`${this.s.toISO(n)}/${this.e.toISO(n)}`}toISODate(){if(!this.isValid)return xp;return`${this.s.toISODate()}/${this.e.toISODate()}`}toISOTime(n){if(!this.isValid)return xp;return`${this.s.toISOTime(n)}/${this.e.toISOTime(n)}`}toFormat(n,{separator:i=" \u2013 "}={}){if(!this.isValid)return xp;return`${this.s.toFormat(n)}${i}${this.e.toFormat(n)}`}toDuration(n,i){if(!this.isValid)return An.invalid(this.invalidReason);return this.e.diff(this.s,n,i)}mapEndpoints(n){return hn.fromDateTimes(n(this.s),n(this.e))}}class fp{static hasDST(n=un.defaultZone){let i=e.now().setZone(n).set({month:12});return!n.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(n){return Wo.isValidZone(n)}static normalizeZone(n){return Po(n,un.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||Wn.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||Wn.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||Wn.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Wn.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Wn.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Wn.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Wn.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return Wn.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return Wn.create(i,null,"gregory").eras(n)}static features(){return{relative:Vw(),localeWeek:_w()}}}function k1(n,i){let o=(p)=>p.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),c=o(i)-o(n);return Math.floor(An.fromMillis(c).as("days"))}function B3(n,i,o){let c=[["years",(f,v)=>v.year-f.year],["quarters",(f,v)=>v.quarter-f.quarter+(v.year-f.year)*4],["months",(f,v)=>v.month-f.month+(v.year-f.year)*12],["weeks",(f,v)=>{let $=k1(f,v);return($-$%7)/7}],["days",k1]],p={},x=n,m,a;for(let[f,v]of c)if(o.indexOf(f)>=0)if(m=f,p[f]=v(n,i),a=x.plus(p),a>i){if(p[f]--,n=x.plus(p),n>i)a=n,p[f]--,n=x.plus(p)}else n=a;return[n,p,a,m]}function b3(n,i,o,c){let[p,x,m,a]=B3(n,i,o),f=i-p,v=o.filter((w)=>["hours","minutes","seconds","milliseconds"].indexOf(w)>=0);if(v.length===0){if(m<i)m=p.plus({[a]:1});if(m!==p)x[a]=(x[a]||0)+f/(m-p)}let $=An.fromObject(x,c);if(v.length>0)return An.fromMillis(f,c).shiftTo(...v).plus($);else return $}var j3="missing Intl.DateTimeFormat.formatToParts support";function Sn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(MS(o))}}var D3=String.fromCharCode(160),rw=`[ ${D3}]`,gw=new RegExp(rw,"g");function L3(n){return n.replace(/\./g,"\\.?").replace(gw,rw)}function Z1(n){return n.replace(/\./g,"").replace(gw," ").toLowerCase()}function xo(n,i){if(n===null)return null;else return{regex:RegExp(n.map(L3).join("|")),deser:([o])=>n.findIndex((c)=>Z1(o)===Z1(c))+i}}function s1(n,i){return{regex:n,deser:([,o,c])=>jm(o,c),groups:i}}function Gm(n){return{regex:n,deser:([i])=>i}}function u3(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function N3(n,i){let o=po(i),c=po(i,"{2}"),p=po(i,"{3}"),x=po(i,"{4}"),m=po(i,"{6}"),a=po(i,"{1,2}"),f=po(i,"{1,3}"),v=po(i,"{1,6}"),$=po(i,"{1,9}"),w=po(i,"{2,4}"),J=po(i,"{4,6}"),l=(K)=>({regex:RegExp(u3(K.val)),deser:([Y])=>Y,literal:!0}),R=((K)=>{if(n.literal)return l(K);switch(K.val){case"G":return xo(i.eras("short"),0);case"GG":return xo(i.eras("long"),0);case"y":return Sn(v);case"yy":return Sn(w,sf);case"yyyy":return Sn(x);case"yyyyy":return Sn(J);case"yyyyyy":return Sn(m);case"M":return Sn(a);case"MM":return Sn(c);case"MMM":return xo(i.months("short",!0),1);case"MMMM":return xo(i.months("long",!0),1);case"L":return Sn(a);case"LL":return Sn(c);case"LLL":return xo(i.months("short",!1),1);case"LLLL":return xo(i.months("long",!1),1);case"d":return Sn(a);case"dd":return Sn(c);case"o":return Sn(f);case"ooo":return Sn(p);case"HH":return Sn(c);case"H":return Sn(a);case"hh":return Sn(c);case"h":return Sn(a);case"mm":return Sn(c);case"m":return Sn(a);case"q":return Sn(a);case"qq":return Sn(c);case"s":return Sn(a);case"ss":return Sn(c);case"S":return Sn(f);case"SSS":return Sn(p);case"u":return Gm($);case"uu":return Gm(a);case"uuu":return Sn(o);case"a":return xo(i.meridiems(),0);case"kkkk":return Sn(x);case"kk":return Sn(w,sf);case"W":return Sn(a);case"WW":return Sn(c);case"E":case"c":return Sn(o);case"EEE":return xo(i.weekdays("short",!1),1);case"EEEE":return xo(i.weekdays("long",!1),1);case"ccc":return xo(i.weekdays("short",!0),1);case"cccc":return xo(i.weekdays("long",!0),1);case"Z":case"ZZ":return s1(new RegExp(`([+-]${a.source})(?::(${c.source}))?`),2);case"ZZZ":return s1(new RegExp(`([+-]${a.source})(${c.source})?`),2);case"z":return Gm(/[a-z_+-/]{1,256}?/i);case" ":return Gm(/[^\S\n\r]/);default:return l(K)}})(n)||{invalidReason:j3};return R.token=n,R}var h3={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function C3(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let f=/^\s+$/.test(p);return{literal:!f,val:f?" ":p}}let x=i[c],m=c;if(c==="hour")if(i.hour12!=null)m=i.hour12?"hour12":"hour24";else if(i.hourCycle!=null)if(i.hourCycle==="h11"||i.hourCycle==="h12")m="hour12";else m="hour24";else m=o.hour12?"hour12":"hour24";let a=h3[m];if(typeof a==="object")a=a[x];if(a)return{literal:!1,val:a};return}function I3(n){return[`^${n.map((o)=>o.regex).reduce((o,c)=>`${o}(${c.source})`,"")}$`,n]}function y3(n,i,o){let c=n.match(i);if(c){let p={},x=1;for(let m in o)if(wp(o,m)){let a=o[m],f=a.groups?a.groups+1:1;if(!a.literal&&a.token)p[a.token.val[0]]=a.deser(c.slice(x,x+f));x+=f}return[c,p]}else return[c,{}]}function k3(n){let i=(x)=>{switch(x){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},o=null,c;if(!nn(n.z))o=Wo.create(n.z);if(!nn(n.Z)){if(!o)o=new Ki(n.Z);c=n.Z}if(!nn(n.q))n.M=(n.q-1)*3+1;if(!nn(n.h)){if(n.h<12&&n.a===1)n.h+=12;else if(n.h===12&&n.a===0)n.h=0}if(n.G===0&&n.y)n.y=-n.y;if(!nn(n.u))n.S=df(n.u);return[Object.keys(n).reduce((x,m)=>{let a=i(m);if(a)x[a]=n[m];return x},{}),o,c]}var Df=null;function Z3(){if(!Df)Df=e.fromMillis(1555555555555);return Df}function s3(n,i){if(n.literal)return n;let o=Xi.macroTokenToFormatOpts(n.val),c=nJ(o,i);if(c==null||c.includes(void 0))return n;return c}function dw(n,i){return Array.prototype.concat(...n.map((o)=>s3(o,i)))}class cv{constructor(n,i){if(this.locale=n,this.format=i,this.tokens=dw(Xi.parseFormat(i),n),this.units=this.tokens.map((o)=>N3(o,n)),this.disqualifyingUnit=this.units.find((o)=>o.invalidReason),!this.disqualifyingUnit){let[o,c]=I3(this.units);this.regex=RegExp(o,"i"),this.handlers=c}}explainFromTokens(n){if(!this.isValid)return{input:n,tokens:this.tokens,invalidReason:this.invalidReason};else{let[i,o]=y3(n,this.regex,this.handlers),[c,p,x]=o?k3(o):[null,null,void 0];if(wp(o,"a")&&wp(o,"H"))throw new Hc("Can't include meridiem when specifying 24-hour format");return{input:n,tokens:this.tokens,regex:this.regex,rawMatches:i,matches:o,result:c,zone:p,specificOffset:x}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function ew(n,i,o){return new cv(n,o).explainFromTokens(i)}function q3(n,i,o){let{result:c,zone:p,specificOffset:x,invalidReason:m}=ew(n,i,o);return[c,p,x,m]}function nJ(n,i){if(!n)return null;let c=Xi.create(i,n).dtFormatter(Z3()),p=c.formatToParts(),x=c.resolvedOptions();return p.map((m)=>C3(m,n,x))}var Lf="Invalid DateTime",q1=8640000000000000;function Fx(n){return new qi("unsupported zone",`the zone "${n.name}" is not supported`)}function uf(n){if(n.weekData===null)n.weekData=Um(n.c);return n.weekData}function Nf(n){if(n.localWeekData===null)n.localWeekData=Um(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek());return n.localWeekData}function Mc(n,i){let o={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new e({...o,...i,old:o})}function iJ(n,i,o){let c=n-i*60*1000,p=o.offset(c);if(i===p)return[c,i];c-=(p-i)*60*1000;let x=o.offset(c);if(p===x)return[c,p];return[n-Math.min(p,x)*60*1000,Math.max(p,x)]}function Ym(n,i){n+=i*60*1000;let o=new Date(n);return{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate(),hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds()}}function zm(n,i,o){return iJ(bm(n),i,o)}function P1(n,i){let o=n.o,c=n.c.year+Math.trunc(i.years),p=n.c.month+Math.trunc(i.months)+Math.trunc(i.quarters)*3,x={...n.c,year:c,month:p,day:Math.min(n.c.day,Vm(c,p))+Math.trunc(i.days)+Math.trunc(i.weeks)*7},m=An.fromObject({years:i.years-Math.trunc(i.years),quarters:i.quarters-Math.trunc(i.quarters),months:i.months-Math.trunc(i.months),weeks:i.weeks-Math.trunc(i.weeks),days:i.days-Math.trunc(i.days),hours:i.hours,minutes:i.minutes,seconds:i.seconds,milliseconds:i.milliseconds}).as("milliseconds"),a=bm(x),[f,v]=iJ(a,o,n.zone);if(m!==0)f+=m,v=n.zone.offset(f);return{ts:f,o:v}}function mp(n,i,o,c,p,x){let{setZone:m,zone:a}=o;if(n&&Object.keys(n).length!==0||i){let f=i||a,v=e.fromObject(n,{...o,zone:f,specificOffset:x});return m?v:v.setZone(a)}else return e.invalid(new qi("unparsable",`the input "${p}" can't be parsed as ${c}`))}function Mm(n,i,o=!0){return n.isValid?Xi.create(Wn.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function hf(n,i){let o=n.c.year>9999||n.c.year<0,c="";if(o&&n.c.year>=0)c+="+";if(c+=tn(n.c.year,o?6:4),i)c+="-",c+=tn(n.c.month),c+="-",c+=tn(n.c.day);else c+=tn(n.c.month),c+=tn(n.c.day);return c}function t1(n,i,o,c,p,x){let m=tn(n.c.hour);if(i){if(m+=":",m+=tn(n.c.minute),n.c.millisecond!==0||n.c.second!==0||!o)m+=":"}else m+=tn(n.c.minute);if(n.c.millisecond!==0||n.c.second!==0||!o){if(m+=tn(n.c.second),n.c.millisecond!==0||!c)m+=".",m+=tn(n.c.millisecond,3)}if(p)if(n.isOffsetFixed&&n.offset===0&&!x)m+="Z";else if(n.o<0)m+="-",m+=tn(Math.trunc(-n.o/60)),m+=":",m+=tn(Math.trunc(-n.o%60));else m+="+",m+=tn(Math.trunc(n.o/60)),m+=":",m+=tn(Math.trunc(n.o%60));if(x)m+="["+n.zone.ianaName+"]";return m}var oJ={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},P3={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},t3={ordinal:1,hour:0,minute:0,second:0,millisecond:0},cJ=["year","month","day","hour","minute","second","millisecond"],r3=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],g3=["year","ordinal","hour","minute","second","millisecond"];function d3(n){let i={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!i)throw new qf(n);return i}function r1(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return d3(n)}}function e3(n){if(!Em[n]){if(Qm===void 0)Qm=un.now();Em[n]=n.offset(Qm)}return Em[n]}function g1(n,i){let o=Po(i.zone,un.defaultZone);if(!o.isValid)return e.invalid(Fx(o));let c=Wn.fromObject(i),p,x;if(!nn(n.year)){for(let f of cJ)if(nn(n[f]))n[f]=oJ[f];let m=Ow(n)||Uw(n);if(m)return e.invalid(m);let a=e3(o);[p,x]=zm(n,a,o)}else p=un.now();return new e({ts:p,zone:o,loc:c,o:x})}function d1(n,i,o){let c=nn(o.round)?!0:o.round,p=(m,a)=>{return m=ef(m,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(m,a)},x=(m)=>{if(o.calendary)if(!i.hasSame(n,m))return i.startOf(m).diff(n.startOf(m),m).get(m);else return 0;else return i.diff(n,m).get(m)};if(o.unit)return p(x(o.unit),o.unit);for(let m of o.units){let a=x(m);if(Math.abs(a)>=1)return p(a,m)}return p(n>i?-0:0,o.units[o.units.length-1])}function e1(n){let i={},o;if(n.length>0&&typeof n[n.length-1]==="object")i=n[n.length-1],o=Array.from(n).slice(0,n.length-1);else o=Array.from(n);return[i,o]}var Qm,Em={};class e{constructor(n){let i=n.zone||un.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new qi("invalid input"):null)||(!i.isValid?Fx(i):null);this.ts=nn(n.ts)?un.now():n.ts;let c=null,p=null;if(!o)if(n.old&&n.old.ts===this.ts&&n.old.zone.equals(i))[c,p]=[n.old.c,n.old.o];else{let m=to(n.o)&&!n.old?n.o:i.offset(this.ts);c=Ym(this.ts,m),o=Number.isNaN(c.year)?new qi("invalid input"):null,c=o?null:c,p=o?null:m}this._zone=i,this.loc=n.loc||Wn.create(),this.invalid=o,this.weekData=null,this.localWeekData=null,this.c=c,this.o=p,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[n,i]=e1(arguments),[o,c,p,x,m,a,f]=i;return g1({year:o,month:c,day:p,hour:x,minute:m,second:a,millisecond:f},n)}static utc(){let[n,i]=e1(arguments),[o,c,p,x,m,a,f]=i;return n.zone=Ki.utcInstance,g1({year:o,month:c,day:p,hour:x,minute:m,second:a,millisecond:f},n)}static fromJSDate(n,i={}){let o=OS(n)?n.valueOf():NaN;if(Number.isNaN(o))return e.invalid("invalid input");let c=Po(i.zone,un.defaultZone);if(!c.isValid)return e.invalid(Fx(c));return new e({ts:o,zone:c,loc:Wn.fromObject(i)})}static fromMillis(n,i={}){if(!to(n))throw new wi(`fromMillis requires a numerical input, but received a ${typeof n} with value ${n}`);else if(n<-q1||n>q1)return e.invalid("Timestamp out of range");else return new e({ts:n,zone:Po(i.zone,un.defaultZone),loc:Wn.fromObject(i)})}static fromSeconds(n,i={}){if(!to(n))throw new wi("fromSeconds requires a numerical input");else return new e({ts:n*1000,zone:Po(i.zone,un.defaultZone),loc:Wn.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=Po(i.zone,un.defaultZone);if(!o.isValid)return e.invalid(Fx(o));let c=Wn.fromObject(i),p=_m(n,r1),{minDaysInFirstWeek:x,startOfWeek:m}=L1(p,c),a=un.now(),f=!nn(i.specificOffset)?i.specificOffset:o.offset(a),v=!nn(p.ordinal),$=!nn(p.year),w=!nn(p.month)||!nn(p.day),J=$||w,l=p.weekYear||p.weekNumber;if((J||v)&&l)throw new Hc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&v)throw new Hc("Can't mix ordinal dates with month/day");let S=l||p.weekday&&!J,R,K,Y=Ym(a,f);if(S)R=r3,K=P3,Y=Um(Y,x,m);else if(v)R=g3,K=t3,Y=jf(Y);else R=cJ,K=oJ;let M=!1;for(let y of R){let H=p[y];if(!nn(H))M=!0;else if(M)p[y]=K[y];else p[y]=Y[y]}let I=S?zS(p,x,m):v?QS(p):Ow(p),G=I||Uw(p);if(G)return e.invalid(G);let z=S?j1(p,x,m):v?D1(p):p,[E,Q]=zm(z,f,o),B=new e({ts:E,zone:o,o:Q,loc:c});if(p.weekday&&J&&n.weekday!==B.weekday)return e.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${B.toISO()}`);if(!B.isValid)return e.invalid(B.invalid);return B}static fromISO(n,i={}){let[o,c]=S3(n);return mp(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=X3(n);return mp(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=K3(n);return mp(o,c,i,"HTTP",i)}static fromFormat(n,i,o={}){if(nn(n)||nn(i))throw new wi("fromFormat requires an input string and a format");let{locale:c=null,numberingSystem:p=null}=o,x=Wn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[m,a,f,v]=q3(x,n,i);if(v)return e.invalid(v);else return mp(m,a,o,`format ${i}`,n,f)}static fromString(n,i,o={}){return e.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=Q3(n);return mp(o,c,i,"SQL",n)}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the DateTime is invalid");let o=n instanceof qi?n:new qi(n,i);if(un.throwOnInvalid)throw new nw(o);else return new e({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=nJ(n,Wn.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return dw(Xi.parseFormat(n),Wn.fromObject(i)).map((c)=>c.val).join("")}static resetCache(){Qm=void 0,Em={}}get(n){return this[n]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?uf(this).weekYear:NaN}get weekNumber(){return this.isValid?uf(this).weekNumber:NaN}get weekday(){return this.isValid?uf(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Nf(this).weekday:NaN}get localWeekNumber(){return this.isValid?Nf(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Nf(this).weekYear:NaN}get ordinal(){return this.isValid?jf(this.c).ordinal:NaN}get monthShort(){return this.isValid?fp.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?fp.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?fp.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?fp.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"short",locale:this.locale});else return null}get offsetNameLong(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"long",locale:this.locale});else return null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){if(this.isOffsetFixed)return!1;else return this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let n=86400000,i=60000,o=bm(this.c),c=this.zone.offset(o-n),p=this.zone.offset(o+n),x=this.zone.offset(o-c*i),m=this.zone.offset(o-p*i);if(x===m)return[this];let a=o-x*i,f=o-m*i,v=Ym(a,x),$=Ym(f,m);if(v.hour===$.hour&&v.minute===$.minute&&v.second===$.second&&v.millisecond===$.millisecond)return[Mc(this,{ts:a}),Mc(this,{ts:f})];return[this]}get isInLeapYear(){return Xx(this.year)}get daysInMonth(){return Vm(this.year,this.month)}get daysInYear(){return this.isValid?vp(this.year):NaN}get weeksInWeekYear(){return this.isValid?lx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?lx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(n={}){let{locale:i,numberingSystem:o,calendar:c}=Xi.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Ki.instance(n),i)}toLocal(){return this.setZone(un.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=Po(n,un.defaultZone),n.equals(this.zone))return this;else if(!n.isValid)return e.invalid(Fx(n));else{let c=this.ts;if(i||o){let p=n.offset(this.ts),x=this.toObject();[c]=zm(x,p,n)}return Mc(this,{ts:c,zone:n})}}reconfigure({locale:n,numberingSystem:i,outputCalendar:o}={}){let c=this.loc.clone({locale:n,numberingSystem:i,outputCalendar:o});return Mc(this,{loc:c})}setLocale(n){return this.reconfigure({locale:n})}set(n){if(!this.isValid)return this;let i=_m(n,r1),{minDaysInFirstWeek:o,startOfWeek:c}=L1(i,this.loc),p=!nn(i.weekYear)||!nn(i.weekNumber)||!nn(i.weekday),x=!nn(i.ordinal),m=!nn(i.year),a=!nn(i.month)||!nn(i.day),f=m||a,v=i.weekYear||i.weekNumber;if((f||x)&&v)throw new Hc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&x)throw new Hc("Can't mix ordinal dates with month/day");let $;if(p)$=j1({...Um(this.c,o,c),...i},o,c);else if(!nn(i.ordinal))$=D1({...jf(this.c),...i});else if($={...this.toObject(),...i},nn(i.day))$.day=Math.min(Vm($.year,$.month),$.day);let[w,J]=zm($,this.o,this.zone);return Mc(this,{ts:w,o:J})}plus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n);return Mc(this,P1(this,i))}minus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n).negate();return Mc(this,P1(this,i))}startOf(n,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;let o={},c=An.normalizeUnit(n);switch(c){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(c==="weeks")if(i){let p=this.loc.getStartOfWeek(),{weekday:x}=this;if(x<p)o.weekNumber=this.weekNumber-1;o.weekday=p}else o.weekday=1;if(c==="quarters"){let p=Math.ceil(this.month/3);o.month=(p-1)*3+1}return this.set(o)}endOf(n,i){return this.isValid?this.plus({[n]:1}).startOf(n,i).minus(1):this}toFormat(n,i={}){return this.isValid?Xi.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):Lf}toLocaleString(n=Om,i={}){return this.isValid?Xi.create(this.loc.clone(i),n).formatDateTime(this):Lf}toLocaleParts(n={}){return this.isValid?Xi.create(this.loc.clone(n),n).formatDateTimeParts(this):[]}toISO({format:n="extended",suppressSeconds:i=!1,suppressMilliseconds:o=!1,includeOffset:c=!0,extendedZone:p=!1}={}){if(!this.isValid)return null;let x=n==="extended",m=hf(this,x);return m+="T",m+=t1(this,x,i,o,c,p),m}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return hf(this,n==="extended")}toISOWeekDate(){return Mm(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:n=!1,suppressSeconds:i=!1,includeOffset:o=!0,includePrefix:c=!1,extendedZone:p=!1,format:x="extended"}={}){if(!this.isValid)return null;return(c?"T":"")+t1(this,x==="extended",i,n,o,p)}toRFC2822(){return Mm(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mm(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){if(!this.isValid)return null;return hf(this,!0)}toSQLTime({includeOffset:n=!0,includeZone:i=!1,includeOffsetSpace:o=!0}={}){let c="HH:mm:ss.SSS";if(i||n){if(o)c+=" ";if(i)c+="z";else if(n)c+="ZZ"}return Mm(this,c,!0)}toSQL(n={}){if(!this.isValid)return null;return`${this.toSQLDate()} ${this.toSQLTime(n)}`}toString(){return this.isValid?this.toISO():Lf}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;else return`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1000:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1000):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(n={}){if(!this.isValid)return{};let i={...this.c};if(n.includeConfig)i.outputCalendar=this.outputCalendar,i.numberingSystem=this.loc.numberingSystem,i.locale=this.loc.locale;return i}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(n,i="milliseconds",o={}){if(!this.isValid||!n.isValid)return An.invalid("created by diffing an invalid DateTime");let c={locale:this.locale,numberingSystem:this.numberingSystem,...o},p=US(i).map(An.normalizeUnit),x=n.valueOf()>this.valueOf(),m=x?this:n,a=x?n:this,f=b3(m,a,p,c);return x?f.negate():f}diffNow(n="milliseconds",i={}){return this.diff(e.now(),n,i)}until(n){return this.isValid?hn.fromDateTimes(this,n):this}hasSame(n,i,o){if(!this.isValid)return!1;let c=n.valueOf(),p=this.setZone(n.zone,{keepLocalTime:!0});return p.startOf(i,o)<=c&&c<=p.endOf(i,o)}equals(n){return this.isValid&&n.isValid&&this.valueOf()===n.valueOf()&&this.zone.equals(n.zone)&&this.loc.equals(n.loc)}toRelative(n={}){if(!this.isValid)return null;let i=n.base||e.fromObject({},{zone:this.zone}),o=n.padding?this<i?-n.padding:n.padding:0,c=["years","months","days","hours","minutes","seconds"],p=n.unit;if(Array.isArray(n.unit))c=n.unit,p=void 0;return d1(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return d1(n.base||e.fromObject({},{zone:this.zone}),this,{...n,numeric:"auto",units:["years","months","days"],calendary:!0})}static min(...n){if(!n.every(e.isDateTime))throw new wi("min requires all arguments be DateTimes");return u1(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(e.isDateTime))throw new wi("max requires all arguments be DateTimes");return u1(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,x=Wn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return ew(x,n,i)}static fromStringExplain(n,i,o={}){return e.fromFormatExplain(n,i,o)}static buildFormatParser(n,i={}){let{locale:o=null,numberingSystem:c=null}=i,p=Wn.fromOpts({locale:o,numberingSystem:c,defaultToEN:!0});return new cv(p,n)}static fromFormatParser(n,i,o={}){if(nn(n)||nn(i))throw new wi("fromFormatParser requires an input string and a format parser");let{locale:c=null,numberingSystem:p=null}=o,x=Wn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});if(!x.equals(i.locale))throw new wi(`fromFormatParser called with a locale of ${x}, but the format parser was created for ${i.locale}`);let{result:m,zone:a,specificOffset:f,invalidReason:v}=i.explainFromTokens(n);if(v)return e.invalid(v);else return mp(m,a,o,`format ${i.format}`,n,f)}static get DATE_SHORT(){return Om}static get DATE_MED(){return cw}static get DATE_MED_WITH_WEEKDAY(){return mS}static get DATE_FULL(){return pw}static get DATE_HUGE(){return xw}static get TIME_SIMPLE(){return mw}static get TIME_WITH_SECONDS(){return aw}static get TIME_WITH_SHORT_OFFSET(){return fw}static get TIME_WITH_LONG_OFFSET(){return vw}static get TIME_24_SIMPLE(){return $w}static get TIME_24_WITH_SECONDS(){return ww}static get TIME_24_WITH_SHORT_OFFSET(){return Jw}static get TIME_24_WITH_LONG_OFFSET(){return Aw}static get DATETIME_SHORT(){return Tw}static get DATETIME_SHORT_WITH_SECONDS(){return Fw}static get DATETIME_MED(){return Rw}static get DATETIME_MED_WITH_SECONDS(){return lw}static get DATETIME_MED_WITH_WEEKDAY(){return aS}static get DATETIME_FULL(){return Sw}static get DATETIME_FULL_WITH_SECONDS(){return Xw}static get DATETIME_HUGE(){return Kw}static get DATETIME_HUGE_WITH_SECONDS(){return Ww}}function Ax(n){if(e.isDateTime(n))return n;else if(n&&n.valueOf&&to(n.valueOf()))return e.fromJSDate(n);else if(n&&typeof n==="object")return e.fromObject(n);else throw new wi(`Unknown datetime argument: ${n}, of type ${typeof n}`)}var n7="3.5.0";pJ.DateTime=e;pJ.Duration=An;pJ.FixedOffsetZone=Ki;pJ.IANAZone=Wo;pJ.Info=fp;pJ.Interval=hn;pJ.InvalidZone=Pf;pJ.Settings=un;pJ.SystemZone=Sx;pJ.VERSION=n7;pJ.Zone=Qc});var $J=h((mJ)=>{Object.defineProperty(mJ,"__esModule",{value:!0});mJ.RE_RANGE=mJ.RE_WILDCARDS=mJ.PRESETS=mJ.TIME_UNITS_LEN=mJ.TIME_UNITS=mJ.TIME_UNITS_MAP=mJ.ALIASES=mJ.PARSE_DEFAULTS=mJ.CONSTRAINTS=void 0;mJ.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});mJ.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});mJ.ALIASES=Object.freeze({jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12,sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6});mJ.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});mJ.TIME_UNITS=Object.freeze(Object.values(mJ.TIME_UNITS_MAP));mJ.TIME_UNITS_LEN=mJ.TIME_UNITS.length;mJ.PRESETS=Object.freeze({"@yearly":"0 0 0 1 1 *","@monthly":"0 0 0 1 * *","@weekly":"0 0 0 * * 0","@daily":"0 0 0 * * *","@hourly":"0 0 * * * *","@minutely":"0 * * * * *","@secondly":"* * * * * *","@weekdays":"0 0 0 * * 1-5","@weekends":"0 0 0 * * 0,6"});mJ.RE_WILDCARDS=/\*/g;mJ.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var xv=h((JJ)=>{Object.defineProperty(JJ,"__esModule",{value:!0});JJ.ExclusiveParametersError=JJ.CronError=void 0;class pv extends Error{}JJ.CronError=pv;class wJ extends pv{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}JJ.ExclusiveParametersError=wJ});var Lm=h((TJ)=>{Object.defineProperty(TJ,"__esModule",{value:!0});TJ.CronTime=void 0;var Go=xJ(),Wi=$J(),Gi=xv();class mv{constructor(n,i,o){if(this.realDate=!1,this.second={},this.minute={},this.hour={},this.dayOfMonth={},this.month={},this.dayOfWeek={},i!=null&&o!=null)throw new Gi.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!Go.DateTime.fromObject({},{zone:i}).isValid)throw new Gi.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(n instanceof Date||n instanceof Go.DateTime)this.source=n instanceof Date?Go.DateTime.fromJSDate(n):n,this.realDate=!0;else this.source=n,this._parse(this.source)}static validateCronExpression(n){try{return new mv(n),{valid:!0}}catch(i){return{valid:!1,error:i}}}_getWeekDay(n){return n.weekday===7?0:n.weekday}sendAt(n){let i=this.realDate&&this.source instanceof Go.DateTime?this.source:Go.DateTime.local();if(this.timeZone)i=i.setZone(this.timeZone);if(this.utcOffset!==void 0){let o=this.utcOffset<0?"-":"+",c=Math.trunc(this.utcOffset/60),p=String(Math.abs(c)).padStart(2,"0"),x=Math.abs(this.utcOffset-c*60),m=String(x).padStart(2,"0"),a=`UTC${o}${p}:${m}`;if(i=i.setZone(a),!i.isValid)throw new Gi.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(Go.DateTime.local()>i)throw new Gi.CronError("WARNING: Date in past. Will never be fired.");return i}if(n===void 0||isNaN(n)||n<0)return this.getNextDateFrom(i);else{let o=[];for(;n>0;n--)i=this.getNextDateFrom(i),o.push(i);return o}}getTimeout(){return Math.max(-1,this.sendAt().toMillis()-Go.DateTime.local().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return Wi.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o;if(n instanceof Date)n=Go.DateTime.fromJSDate(n);let c=n,p=n.toMillis();if(i)c=c.setZone(i);if(!this.realDate){if(c.millisecond>0)c=c.set({millisecond:0,second:c.second+1})}if(!c.isValid)throw new Gi.CronError("ERROR: You specified an invalid date.");let x=Go.DateTime.now().plus({years:8});while(!0){let m=c.toMillis()-n.toMillis();if(c>x)throw new Gi.CronError(`Something went wrong. No execution date was found in the next 8 years.
3
+ var n3=Object.create;var{getPrototypeOf:i3,defineProperty:$f,getOwnPropertyNames:o3}=Object;var c3=Object.prototype.hasOwnProperty;var wf=(n,i,o)=>{o=n!=null?n3(i3(n)):{};let c=i||!n||!n.__esModule?$f(o,"default",{value:n,enumerable:!0}):o;for(let p of o3(n))if(!c3.call(c,p))$f(c,p,{get:()=>n[p],enumerable:!0});return c};var C=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var p3=(n,i)=>{for(var o in i)$f(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var Kn=import.meta.require;var aJ=C((mJ)=>{Object.defineProperty(mJ,"__esModule",{value:!0});class ro extends Error{}class iw extends ro{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class ow extends ro{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class cw extends ro{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class Hc extends ro{}class Pf extends ro{constructor(n){super(`Invalid unit ${n}`)}}class wi extends ro{}class Vo extends ro{constructor(){super("Zone is an abstract class")}}var u="numeric",ao="short",ji="long",Um={year:u,month:u,day:u},pw={year:u,month:ao,day:u},J3={year:u,month:ao,day:u,weekday:ao},xw={year:u,month:ji,day:u},mw={year:u,month:ji,day:u,weekday:ji},aw={hour:u,minute:u},fw={hour:u,minute:u,second:u},vw={hour:u,minute:u,second:u,timeZoneName:ao},$w={hour:u,minute:u,second:u,timeZoneName:ji},ww={hour:u,minute:u,hourCycle:"h23"},Jw={hour:u,minute:u,second:u,hourCycle:"h23"},Aw={hour:u,minute:u,second:u,hourCycle:"h23",timeZoneName:ao},Fw={hour:u,minute:u,second:u,hourCycle:"h23",timeZoneName:ji},Tw={year:u,month:u,day:u,hour:u,minute:u},Rw={year:u,month:u,day:u,hour:u,minute:u,second:u},Sw={year:u,month:ao,day:u,hour:u,minute:u},Xw={year:u,month:ao,day:u,hour:u,minute:u,second:u},A3={year:u,month:ao,day:u,weekday:ao,hour:u,minute:u},Ww={year:u,month:ji,day:u,hour:u,minute:u,timeZoneName:ao},Kw={year:u,month:ji,day:u,hour:u,minute:u,second:u,timeZoneName:ao},lw={year:u,month:ji,day:u,weekday:ji,hour:u,minute:u,timeZoneName:ji},Gw={year:u,month:ji,day:u,weekday:ji,hour:u,minute:u,second:u,timeZoneName:ji};class Qc{get type(){throw new Vo}get name(){throw new Vo}get ianaName(){return this.name}get isUniversal(){throw new Vo}offsetName(n,i){throw new Vo}formatOffset(n,i){throw new Vo}offset(n){throw new Vo}equals(n){throw new Vo}get isValid(){throw new Vo}}var uf=null;class Wx extends Qc{static get instance(){if(uf===null)uf=new Wx;return uf}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return Bw(n,i,o)}formatOffset(n,i){return Sx(this.offset(n),i)}offset(n){return-new Date(n).getTimezoneOffset()}equals(n){return n.type==="system"}get isValid(){return!0}}var zm={};function F3(n){if(!zm[n])zm[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"});return zm[n]}var T3={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function R3(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,x,m,a,f,v,$]=c;return[m,p,x,a,f,v,$]}function S3(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:x,value:m}=o[p],a=T3[x];if(x==="era")c[a]=m;else if(!nn(a))c[a]=parseInt(m,10)}return c}var lm={};class Go extends Qc{static create(n){if(!lm[n])lm[n]=new Go(n);return lm[n]}static resetCache(){lm={},zm={}}static isValidSpecifier(n){return this.isValidZone(n)}static isValidZone(n){if(!n)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:n}).format(),!0}catch(i){return!1}}constructor(n){super();this.zoneName=n,this.valid=Go.isValidZone(n)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return Bw(n,i,o,this.name)}formatOffset(n,i){return Sx(this.offset(n),i)}offset(n){let i=new Date(n);if(isNaN(i))return NaN;let o=F3(this.name),[c,p,x,m,a,f,v]=o.formatToParts?S3(o,i):R3(o,i);if(m==="BC")c=-Math.abs(c)+1;let w=Bm({year:c,month:p,day:x,hour:a===24?0:a,minute:f,second:v,millisecond:0}),J=+i,S=J%1000;return J-=S>=0?S:1000+S,(w-J)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var H1={};function X3(n,i={}){let o=JSON.stringify([n,i]),c=H1[o];if(!c)c=new Intl.ListFormat(n,i),H1[o]=c;return c}var If={};function yf(n,i={}){let o=JSON.stringify([n,i]),c=If[o];if(!c)c=new Intl.DateTimeFormat(n,i),If[o]=c;return c}var kf={};function W3(n,i={}){let o=JSON.stringify([n,i]),c=kf[o];if(!c)c=new Intl.NumberFormat(n,i),kf[o]=c;return c}var Zf={};function K3(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),x=Zf[p];if(!x)x=new Intl.RelativeTimeFormat(n,i),Zf[p]=x;return x}var Fx=null;function l3(){if(Fx)return Fx;else return Fx=new Intl.DateTimeFormat().resolvedOptions().locale,Fx}var Qm={};function Mw(n){if(!Qm[n])Qm[n]=new Intl.DateTimeFormat(n).resolvedOptions();return Qm[n]}var z1={};function G3(n){let i=z1[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,z1[n]=i}return i}function M3(n){let i=n.indexOf("-x-");if(i!==-1)n=n.substring(0,i);let o=n.indexOf("-u-");if(o===-1)return[n];else{let c,p;try{c=yf(n).resolvedOptions(),p=n}catch(a){let f=n.substring(0,o);c=yf(f).resolvedOptions(),p=f}let{numberingSystem:x,calendar:m}=c;return[p,x,m]}}function Y3(n,i,o){if(o||i){if(!n.includes("-u-"))n+="-u";if(o)n+=`-ca-${o}`;if(i)n+=`-nu-${i}`;return n}else return n}function H3(n){let i=[];for(let o=1;o<=12;o++){let c=e.utc(2009,o,1);i.push(n(c))}return i}function z3(n){let i=[];for(let o=1;o<=7;o++){let c=e.utc(2016,11,13+o);i.push(n(c))}return i}function Gm(n,i,o,c){let p=n.listingMode();if(p==="error")return null;else if(p==="en")return o(i);else return c(i)}function Q3(n){if(n.numberingSystem&&n.numberingSystem!=="latn")return!1;else return n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||Mw(n.locale).numberingSystem==="latn"}class Yw{constructor(n,i,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;let{padTo:c,floor:p,...x}=o;if(!i||Object.keys(x).length>0){let m={useGrouping:!1,...o};if(o.padTo>0)m.minimumIntegerDigits=o.padTo;this.inf=W3(n,m)}}format(n){if(this.inf){let i=this.floor?Math.floor(n):n;return this.inf.format(i)}else{let i=this.floor?Math.floor(n):nv(n,3);return tn(i,this.padTo)}}}class Hw{constructor(n,i,o){this.opts=o,this.originalZone=void 0;let c=void 0;if(this.opts.timeZone)this.dt=n;else if(n.zone.type==="fixed"){let x=-1*(n.offset/60),m=x>=0?`Etc/GMT+${x}`:`Etc/GMT${x}`;if(n.offset!==0&&Go.create(m).valid)c=m,this.dt=n;else c="UTC",this.dt=n.offset===0?n:n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone}else if(n.zone.type==="system")this.dt=n;else if(n.zone.type==="iana")this.dt=n,c=n.zone.name;else c="UTC",this.dt=n.setZone("UTC").plus({minutes:n.offset}),this.originalZone=n.zone;let p={...this.opts};p.timeZone=p.timeZone||c,this.dtf=yf(i,p)}format(){if(this.originalZone)return this.formatToParts().map(({value:n})=>n).join("");return this.dtf.format(this.dt.toJSDate())}formatToParts(){let n=this.dtf.formatToParts(this.dt.toJSDate());if(this.originalZone)return n.map((i)=>{if(i.type==="timeZoneName"){let o=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...i,value:o}}else return i});return n}resolvedOptions(){return this.dtf.resolvedOptions()}}class zw{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&bw())this.rtf=K3(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return t3(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var E3={firstDay:1,minimalDays:4,weekend:[6,7]};class ln{static fromOpts(n){return ln.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let x=n||Ln.defaultLocale,m=x||(p?"en-US":l3()),a=i||Ln.defaultNumberingSystem,f=o||Ln.defaultOutputCalendar,v=qf(c)||Ln.defaultWeekSettings;return new ln(m,a,f,v,x)}static resetCache(){Fx=null,If={},kf={},Zf={},Qm={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return ln.create(n,i,o,c)}constructor(n,i,o,c,p){let[x,m,a]=M3(n);this.locale=x,this.numberingSystem=i||m||null,this.outputCalendar=o||a||null,this.weekSettings=c,this.intl=Y3(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=p,this.fastNumbersCached=null}get fastNumbers(){if(this.fastNumbersCached==null)this.fastNumbersCached=Q3(this);return this.fastNumbersCached}listingMode(){let n=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return n&&i?"en":"intl"}clone(n){if(!n||Object.getOwnPropertyNames(n).length===0)return this;else return ln.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,qf(n.weekSettings)||this.weekSettings,n.defaultToEN||!1)}redefaultToEN(n={}){return this.clone({...n,defaultToEN:!0})}redefaultToSystem(n={}){return this.clone({...n,defaultToEN:!1})}months(n,i=!1){return Gm(this,n,Lw,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=H3((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Gm(this,n,Cw,()=>{let o=i?{weekday:n,year:"numeric",month:"long",day:"numeric"}:{weekday:n},c=i?"format":"standalone";if(!this.weekdaysCache[c][n])this.weekdaysCache[c][n]=z3((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Gm(this,void 0,()=>Iw,()=>{if(!this.meridiemCache){let n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[e.utc(2016,11,13,9),e.utc(2016,11,13,19)].map((i)=>this.extract(i,n,"dayperiod"))}return this.meridiemCache})}eras(n){return Gm(this,n,yw,()=>{let i={era:n};if(!this.eraCache[n])this.eraCache[n]=[e.utc(-40,1,1),e.utc(2017,1,1)].map((o)=>this.extract(o,i,"era"));return this.eraCache[n]})}extract(n,i,o){let c=this.dtFormatter(n,i),p=c.formatToParts(),x=p.find((m)=>m.type.toLowerCase()===o);return x?x.value:null}numberFormatter(n={}){return new Yw(this.intl,n.forceSimple||this.fastNumbers,n)}dtFormatter(n,i={}){return new Hw(n,this.intl,i)}relFormatter(n={}){return new zw(this.intl,this.isEnglish(),n)}listFormatter(n={}){return X3(this.intl,n)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Mw(this.intl).locale.startsWith("en-us")}getWeekSettings(){if(this.weekSettings)return this.weekSettings;else if(!uw())return E3;else return G3(this.locale)}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(n){return this.locale===n.locale&&this.numberingSystem===n.numberingSystem&&this.outputCalendar===n.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}var Bf=null;class Ki extends Qc{static get utcInstance(){if(Bf===null)Bf=new Ki(0);return Bf}static instance(n){return n===0?Ki.utcInstance:new Ki(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Ki(jm(i[1],i[2]))}return null}constructor(n){super();this.fixed=n}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Sx(this.fixed,"narrow")}`}get ianaName(){if(this.fixed===0)return"Etc/UTC";else return`Etc/GMT${Sx(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(n,i){return Sx(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(n){return n.type==="fixed"&&n.fixed===this.fixed}get isValid(){return!0}}class tf extends Qc{constructor(n){super();this.zoneName=n}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Po(n,i){if(nn(n)||n===null)return i;else if(n instanceof Qc)return n;else if(u3(n)){let o=n.toLowerCase();if(o==="default")return i;else if(o==="local"||o==="system")return Wx.instance;else if(o==="utc"||o==="gmt")return Ki.utcInstance;else return Ki.parseSpecifier(o)||Go.create(n)}else if(to(n))return Ki.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new tf(n)}var rf={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},Q1={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},O3=rf.hanidec.replace(/[\[|\]]/g,"").split("");function U3(n){let i=parseInt(n,10);if(isNaN(i)){i="";for(let o=0;o<n.length;o++){let c=n.charCodeAt(o);if(n[o].search(rf.hanidec)!==-1)i+=O3.indexOf(n[o]);else for(let p in Q1){let[x,m]=Q1[p];if(c>=x&&c<=m)i+=c-x}}return parseInt(i,10)}else return i}var ap={};function V3(){ap={}}function xo({numberingSystem:n},i=""){let o=n||"latn";if(!ap[o])ap[o]={};if(!ap[o][i])ap[o][i]=new RegExp(`${rf[o]}${i}`);return ap[o][i]}var E1=()=>Date.now(),O1="system",U1=null,V1=null,_1=null,b1=60,u1,B1=null;class Ln{static get now(){return E1}static set now(n){E1=n}static set defaultZone(n){O1=n}static get defaultZone(){return Po(O1,Wx.instance)}static get defaultLocale(){return U1}static set defaultLocale(n){U1=n}static get defaultNumberingSystem(){return V1}static set defaultNumberingSystem(n){V1=n}static get defaultOutputCalendar(){return _1}static set defaultOutputCalendar(n){_1=n}static get defaultWeekSettings(){return B1}static set defaultWeekSettings(n){B1=qf(n)}static get twoDigitCutoffYear(){return b1}static set twoDigitCutoffYear(n){b1=n%100}static get throwOnInvalid(){return u1}static set throwOnInvalid(n){u1=n}static resetCaches(){ln.resetCache(),Go.resetCache(),e.resetCache(),V3()}}class Pi{constructor(n,i){this.reason=n,this.explanation=i}toMessage(){if(this.explanation)return`${this.reason}: ${this.explanation}`;else return this.reason}}var Qw=[0,31,59,90,120,151,181,212,243,273,304,334],Ew=[0,31,60,91,121,152,182,213,244,274,305,335];function ti(n,i){return new Pi("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function df(n,i,o){let c=new Date(Date.UTC(n,i-1,o));if(n<100&&n>=0)c.setUTCFullYear(c.getUTCFullYear()-1900);let p=c.getUTCDay();return p===0?7:p}function Ow(n,i,o){return o+(Kx(n)?Ew:Qw)[i-1]}function Uw(n,i){let o=Kx(n)?Ew:Qw,c=o.findIndex((x)=>x<i),p=i-o[c];return{month:c+1,day:p}}function gf(n,i){return(n-i+7)%7+1}function Vm(n,i=4,o=1){let{year:c,month:p,day:x}=n,m=Ow(c,p,x),a=gf(df(c,p,x),o),f=Math.floor((m-a+14-i)/7),v;if(f<1)v=c-1,f=Xx(v,i,o);else if(f>Xx(c,i,o))v=c+1,f=1;else v=c;return{weekYear:v,weekNumber:f,weekday:a,...Dm(n)}}function j1(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:x}=n,m=gf(df(c,1,i),o),a=vp(c),f=p*7+x-m-7+i,v;if(f<1)v=c-1,f+=vp(v);else if(f>a)v=c+1,f-=vp(c);else v=c;let{month:$,day:w}=Uw(v,f);return{year:v,month:$,day:w,...Dm(n)}}function jf(n){let{year:i,month:o,day:c}=n,p=Ow(i,o,c);return{year:i,ordinal:p,...Dm(n)}}function D1(n){let{year:i,ordinal:o}=n,{month:c,day:p}=Uw(i,o);return{year:i,month:c,day:p,...Dm(n)}}function L1(n,i){if(!nn(n.localWeekday)||!nn(n.localWeekNumber)||!nn(n.localWeekYear)){if(!nn(n.weekday)||!nn(n.weekNumber)||!nn(n.weekYear))throw new Hc("Cannot mix locale-based week fields with ISO-based week fields");if(!nn(n.localWeekday))n.weekday=n.localWeekday;if(!nn(n.localWeekNumber))n.weekNumber=n.localWeekNumber;if(!nn(n.localWeekYear))n.weekYear=n.localWeekYear;return delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:i.getMinDaysInFirstWeek(),startOfWeek:i.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function _3(n,i=4,o=1){let c=um(n.weekYear),p=ri(n.weekNumber,1,Xx(n.weekYear,i,o)),x=ri(n.weekday,1,7);if(!c)return ti("weekYear",n.weekYear);else if(!p)return ti("week",n.weekNumber);else if(!x)return ti("weekday",n.weekday);else return!1}function b3(n){let i=um(n.year),o=ri(n.ordinal,1,vp(n.year));if(!i)return ti("year",n.year);else if(!o)return ti("ordinal",n.ordinal);else return!1}function Vw(n){let i=um(n.year),o=ri(n.month,1,12),c=ri(n.day,1,_m(n.year,n.month));if(!i)return ti("year",n.year);else if(!o)return ti("month",n.month);else if(!c)return ti("day",n.day);else return!1}function _w(n){let{hour:i,minute:o,second:c,millisecond:p}=n,x=ri(i,0,23)||i===24&&o===0&&c===0&&p===0,m=ri(o,0,59),a=ri(c,0,59),f=ri(p,0,999);if(!x)return ti("hour",i);else if(!m)return ti("minute",o);else if(!a)return ti("second",c);else if(!f)return ti("millisecond",p);else return!1}function nn(n){return typeof n==="undefined"}function to(n){return typeof n==="number"}function um(n){return typeof n==="number"&&n%1===0}function u3(n){return typeof n==="string"}function B3(n){return Object.prototype.toString.call(n)==="[object Date]"}function bw(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function uw(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function j3(n){return Array.isArray(n)?n:[n]}function N1(n,i,o){if(n.length===0)return;return n.reduce((c,p)=>{let x=[i(p),p];if(!c)return x;else if(o(c[0],x[0])===c[0])return c;else return x},null)[1]}function D3(n,i){return i.reduce((o,c)=>{return o[c]=n[c],o},{})}function wp(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function qf(n){if(n==null)return null;else if(typeof n!=="object")throw new wi("Week settings must be an object");else{if(!ri(n.firstDay,1,7)||!ri(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some((i)=>!ri(i,1,7)))throw new wi("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}}function ri(n,i,o){return um(n)&&n>=i&&n<=o}function L3(n,i){return n-i*Math.floor(n/i)}function tn(n,i=2){let o=n<0,c;if(o)c="-"+(""+-n).padStart(i,"0");else c=(""+n).padStart(i,"0");return c}function so(n){if(nn(n)||n===null||n==="")return;else return parseInt(n,10)}function Mc(n){if(nn(n)||n===null||n==="")return;else return parseFloat(n)}function ef(n){if(nn(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function nv(n,i,o=!1){let c=10**i;return(o?Math.trunc:Math.round)(n*c)/c}function Kx(n){return n%4===0&&(n%100!==0||n%400===0)}function vp(n){return Kx(n)?366:365}function _m(n,i){let o=L3(i-1,12)+1,c=n+(i-o)/12;if(o===2)return Kx(c)?29:28;else return[31,null,31,30,31,30,31,31,30,31,30,31][o-1]}function Bm(n){let i=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);if(n.year<100&&n.year>=0)i=new Date(i),i.setUTCFullYear(n.year,n.month-1,n.day);return+i}function h1(n,i,o){return-gf(df(n,1,i),o)+i-1}function Xx(n,i=4,o=1){let c=h1(n,i,o),p=h1(n+1,i,o);return(vp(n)-c+p)/7}function sf(n){if(n>99)return n;else return n>Ln.twoDigitCutoffYear?1900+n:2000+n}function Bw(n,i,o,c=null){let p=new Date(n),x={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};if(c)x.timeZone=c;let m={timeZoneName:i,...x},a=new Intl.DateTimeFormat(o,m).formatToParts(p).find((f)=>f.type.toLowerCase()==="timezonename");return a?a.value:null}function jm(n,i){let o=parseInt(n,10);if(Number.isNaN(o))o=0;let c=parseInt(i,10)||0,p=o<0||Object.is(o,-0)?-c:c;return o*60+p}function jw(n){let i=Number(n);if(typeof n==="boolean"||n===""||Number.isNaN(i))throw new wi(`Invalid unit value ${n}`);return i}function bm(n,i){let o={};for(let c in n)if(wp(n,c)){let p=n[c];if(p===void 0||p===null)continue;o[i(c)]=jw(p)}return o}function Sx(n,i){let o=Math.trunc(Math.abs(n/60)),c=Math.trunc(Math.abs(n%60)),p=n>=0?"+":"-";switch(i){case"short":return`${p}${tn(o,2)}:${tn(c,2)}`;case"narrow":return`${p}${o}${c>0?`:${c}`:""}`;case"techie":return`${p}${tn(o,2)}${tn(c,2)}`;default:throw new RangeError(`Value format ${i} is out of range for property format`)}}function Dm(n){return D3(n,["hour","minute","second","millisecond"])}var N3=["January","February","March","April","May","June","July","August","September","October","November","December"],Dw=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],h3=["J","F","M","A","M","J","J","A","S","O","N","D"];function Lw(n){switch(n){case"narrow":return[...h3];case"short":return[...Dw];case"long":return[...N3];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Nw=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],hw=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],C3=["M","T","W","T","F","S","S"];function Cw(n){switch(n){case"narrow":return[...C3];case"short":return[...hw];case"long":return[...Nw];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Iw=["AM","PM"],I3=["Before Christ","Anno Domini"],y3=["BC","AD"],k3=["B","A"];function yw(n){switch(n){case"narrow":return[...k3];case"short":return[...y3];case"long":return[...I3];default:return null}}function Z3(n){return Iw[n.hour<12?0:1]}function q3(n,i){return Cw(i)[n.weekday-1]}function s3(n,i){return Lw(i)[n.month-1]}function P3(n,i){return yw(i)[n.year<0?0:1]}function t3(n,i,o="always",c=!1){let p={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},x=["hours","minutes","seconds"].indexOf(n)===-1;if(o==="auto"&&x){let w=n==="days";switch(i){case 1:return w?"tomorrow":`next ${p[n][0]}`;case-1:return w?"yesterday":`last ${p[n][0]}`;case 0:return w?"today":`this ${p[n][0]}`}}let m=Object.is(i,-0)||i<0,a=Math.abs(i),f=a===1,v=p[n],$=c?f?v[1]:v[2]||v[1]:f?p[n][0]:n;return m?`${a} ${$} ago`:`in ${a} ${$}`}function C1(n,i){let o="";for(let c of n)if(c.literal)o+=c.val;else o+=i(c.val);return o}var r3={D:Um,DD:pw,DDD:xw,DDDD:mw,t:aw,tt:fw,ttt:vw,tttt:$w,T:ww,TT:Jw,TTT:Aw,TTTT:Fw,f:Tw,ff:Sw,fff:Ww,ffff:lw,F:Rw,FF:Xw,FFF:Kw,FFFF:Gw};class Wi{static create(n,i={}){return new Wi(n,i)}static parseFormat(n){let i=null,o="",c=!1,p=[];for(let x=0;x<n.length;x++){let m=n.charAt(x);if(m==="'"){if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});i=null,o="",c=!c}else if(c)o+=m;else if(m===i)o+=m;else{if(o.length>0)p.push({literal:/^\s+$/.test(o),val:o});o=m,i=m}}if(o.length>0)p.push({literal:c||/^\s+$/.test(o),val:o});return p}static macroTokenToFormatOpts(n){return r3[n]}constructor(n,i){this.opts=i,this.loc=n,this.systemLoc=null}formatWithSystemDefault(n,i){if(this.systemLoc===null)this.systemLoc=this.loc.redefaultToSystem();return this.systemLoc.dtFormatter(n,{...this.opts,...i}).format()}dtFormatter(n,i={}){return this.loc.dtFormatter(n,{...this.opts,...i})}formatDateTime(n,i){return this.dtFormatter(n,i).format()}formatDateTimeParts(n,i){return this.dtFormatter(n,i).formatToParts()}formatInterval(n,i){return this.dtFormatter(n.start,i).dtf.formatRange(n.start.toJSDate(),n.end.toJSDate())}resolvedOptions(n,i){return this.dtFormatter(n,i).resolvedOptions()}num(n,i=0){if(this.opts.forceSimple)return tn(n,i);let o={...this.opts};if(i>0)o.padTo=i;return this.loc.numberFormatter(o).format(n)}formatDateTimeFromString(n,i){let o=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",p=(J,S)=>this.loc.extract(n,J,S),x=(J)=>{if(n.isOffsetFixed&&n.offset===0&&J.allowZ)return"Z";return n.isValid?n.zone.formatOffset(n.ts,J.format):""},m=()=>o?Z3(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(J,S)=>o?s3(n,J):p(S?{month:J}:{month:J,day:"numeric"},"month"),f=(J,S)=>o?q3(n,J):p(S?{weekday:J}:{weekday:J,month:"long",day:"numeric"},"weekday"),v=(J)=>{let S=Wi.macroTokenToFormatOpts(J);if(S)return this.formatWithSystemDefault(n,S);else return J},$=(J)=>o?P3(n,J):p({era:J},"era"),w=(J)=>{switch(J){case"S":return this.num(n.millisecond);case"u":case"SSS":return this.num(n.millisecond,3);case"s":return this.num(n.second);case"ss":return this.num(n.second,2);case"uu":return this.num(Math.floor(n.millisecond/10),2);case"uuu":return this.num(Math.floor(n.millisecond/100));case"m":return this.num(n.minute);case"mm":return this.num(n.minute,2);case"h":return this.num(n.hour%12===0?12:n.hour%12);case"hh":return this.num(n.hour%12===0?12:n.hour%12,2);case"H":return this.num(n.hour);case"HH":return this.num(n.hour,2);case"Z":return x({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return x({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return x({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return n.zone.offsetName(n.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return n.zone.offsetName(n.ts,{format:"long",locale:this.loc.locale});case"z":return n.zoneName;case"a":return m();case"d":return c?p({day:"numeric"},"day"):this.num(n.day);case"dd":return c?p({day:"2-digit"},"day"):this.num(n.day,2);case"c":return this.num(n.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return c?p({month:"numeric",day:"numeric"},"month"):this.num(n.month);case"LL":return c?p({month:"2-digit",day:"numeric"},"month"):this.num(n.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return c?p({month:"numeric"},"month"):this.num(n.month);case"MM":return c?p({month:"2-digit"},"month"):this.num(n.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return c?p({year:"numeric"},"year"):this.num(n.year);case"yy":return c?p({year:"2-digit"},"year"):this.num(n.year.toString().slice(-2),2);case"yyyy":return c?p({year:"numeric"},"year"):this.num(n.year,4);case"yyyyyy":return c?p({year:"numeric"},"year"):this.num(n.year,6);case"G":return $("short");case"GG":return $("long");case"GGGGG":return $("narrow");case"kk":return this.num(n.weekYear.toString().slice(-2),2);case"kkkk":return this.num(n.weekYear,4);case"W":return this.num(n.weekNumber);case"WW":return this.num(n.weekNumber,2);case"n":return this.num(n.localWeekNumber);case"nn":return this.num(n.localWeekNumber,2);case"ii":return this.num(n.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(n.localWeekYear,4);case"o":return this.num(n.ordinal);case"ooo":return this.num(n.ordinal,3);case"q":return this.num(n.quarter);case"qq":return this.num(n.quarter,2);case"X":return this.num(Math.floor(n.ts/1000));case"x":return this.num(n.ts);default:return v(J)}};return C1(Wi.parseFormat(i),w)}formatDurationFromString(n,i){let o=(a)=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},c=(a)=>(f)=>{let v=o(f);if(v)return this.num(a.get(v),f.length);else return f},p=Wi.parseFormat(i),x=p.reduce((a,{literal:f,val:v})=>f?a:a.concat(v),[]),m=n.shiftTo(...x.map(o).filter((a)=>a));return C1(p,c(m))}}var kw=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Jp(...n){let i=n.reduce((o,c)=>o+c.source,"");return RegExp(`^${i}$`)}function Ap(...n){return(i)=>n.reduce(([o,c,p],x)=>{let[m,a,f]=x(i,p);return[{...o,...m},a||c,f]},[{},null,1]).slice(0,2)}function Fp(n,...i){if(n==null)return[null,null];for(let[o,c]of i){let p=o.exec(n);if(p)return c(p)}return[null,null]}function Zw(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=so(i[o+p]);return[c,null,o+p]}}var qw=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,d3=`(?:${qw.source}?(?:\\[(${kw.source})\\])?)?`,iv=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,sw=RegExp(`${iv.source}${d3}`),ov=RegExp(`(?:T${sw.source})?`),g3=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,e3=/(\d{4})-?W(\d\d)(?:-?(\d))?/,n7=/(\d{4})-?(\d{3})/,i7=Zw("weekYear","weekNumber","weekDay"),o7=Zw("year","ordinal"),c7=/(\d{4})-(\d\d)-(\d\d)/,Pw=RegExp(`${iv.source} ?(?:${qw.source}|(${kw.source}))?`),p7=RegExp(`(?: ${Pw.source})?`);function $p(n,i,o){let c=n[i];return nn(c)?o:so(c)}function x7(n,i){return[{year:$p(n,i),month:$p(n,i+1,1),day:$p(n,i+2,1)},null,i+3]}function Tp(n,i){return[{hours:$p(n,i,0),minutes:$p(n,i+1,0),seconds:$p(n,i+2,0),milliseconds:ef(n[i+3])},null,i+4]}function lx(n,i){let o=!n[i]&&!n[i+1],c=jm(n[i+1],n[i+2]),p=o?null:Ki.instance(c);return[{},p,i+3]}function Gx(n,i){let o=n[i]?Go.create(n[i]):null;return[{},o,i+1]}var m7=RegExp(`^T?${iv.source}$`),a7=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function f7(n){let[i,o,c,p,x,m,a,f,v]=n,$=i[0]==="-",w=f&&f[0]==="-",J=(S,X=!1)=>S!==void 0&&(X||S&&$)?-S:S;return[{years:J(Mc(o)),months:J(Mc(c)),weeks:J(Mc(p)),days:J(Mc(x)),hours:J(Mc(m)),minutes:J(Mc(a)),seconds:J(Mc(f),f==="-0"),milliseconds:J(ef(v),w)}]}var v7={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function cv(n,i,o,c,p,x,m){let a={year:i.length===2?sf(so(i)):so(i),month:Dw.indexOf(o)+1,day:so(c),hour:so(p),minute:so(x)};if(m)a.second=so(m);if(n)a.weekday=n.length>3?Nw.indexOf(n)+1:hw.indexOf(n)+1;return a}var $7=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function w7(n){let[,i,o,c,p,x,m,a,f,v,$,w]=n,J=cv(i,p,c,o,x,m,a),S;if(f)S=v7[f];else if(v)S=0;else S=jm($,w);return[J,new Ki(S)]}function J7(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var A7=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,F7=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,T7=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function I1(n){let[,i,o,c,p,x,m,a]=n;return[cv(i,p,c,o,x,m,a),Ki.utcInstance]}function R7(n){let[,i,o,c,p,x,m,a]=n;return[cv(i,a,o,c,p,x,m),Ki.utcInstance]}var S7=Jp(g3,ov),X7=Jp(e3,ov),W7=Jp(n7,ov),K7=Jp(sw),tw=Ap(x7,Tp,lx,Gx),l7=Ap(i7,Tp,lx,Gx),G7=Ap(o7,Tp,lx,Gx),M7=Ap(Tp,lx,Gx);function Y7(n){return Fp(n,[S7,tw],[X7,l7],[W7,G7],[K7,M7])}function H7(n){return Fp(J7(n),[$7,w7])}function z7(n){return Fp(n,[A7,I1],[F7,I1],[T7,R7])}function Q7(n){return Fp(n,[a7,f7])}var E7=Ap(Tp);function O7(n){return Fp(n,[m7,E7])}var U7=Jp(c7,p7),V7=Jp(Pw),_7=Ap(Tp,lx,Gx);function b7(n){return Fp(n,[U7,tw],[V7,_7])}var y1="Invalid Duration",rw={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:604800000},days:{hours:24,minutes:1440,seconds:86400,milliseconds:86400000},hours:{minutes:60,seconds:3600,milliseconds:3600000},minutes:{seconds:60,milliseconds:60000},seconds:{milliseconds:1000}},u7={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536000,milliseconds:31536000000},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:7862400000},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592000,milliseconds:2592000000},...rw},si=365.2425,pp=30.436875,B7={years:{quarters:4,months:12,weeks:si/7,days:si,hours:si*24,minutes:si*24*60,seconds:si*24*60*60,milliseconds:si*24*60*60*1000},quarters:{months:3,weeks:si/28,days:si/4,hours:si*24/4,minutes:si*24*60/4,seconds:si*24*60*60/4,milliseconds:si*24*60*60*1000/4},months:{weeks:pp/7,days:pp,hours:pp*24,minutes:pp*24*60,seconds:pp*24*60*60,milliseconds:pp*24*60*60*1000},...rw},zc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],j7=zc.slice(0).reverse();function qo(n,i,o=!1){let c={values:o?i.values:{...n.values,...i.values||{}},loc:n.loc.clone(i.loc),conversionAccuracy:i.conversionAccuracy||n.conversionAccuracy,matrix:i.matrix||n.matrix};return new An(c)}function dw(n,i){var o;let c=(o=i.milliseconds)!=null?o:0;for(let p of j7.slice(1))if(i[p])c+=i[p]*n[p].milliseconds;return c}function k1(n,i){let o=dw(n,i)<0?-1:1;zc.reduceRight((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]*o,m=n[p][c],a=Math.floor(x/m);i[p]+=a*o,i[c]-=a*m*o}return p}else return c},null),zc.reduce((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]%1;i[c]-=x,i[p]+=x*n[c][p]}return p}else return c},null)}function D7(n){let i={};for(let[o,c]of Object.entries(n))if(c!==0)i[o]=c;return i}class An{constructor(n){let i=n.conversionAccuracy==="longterm"||!1,o=i?B7:u7;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||ln.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=n.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(n,i){return An.fromObject({milliseconds:n},i)}static fromObject(n,i={}){if(n==null||typeof n!=="object")throw new wi(`Duration.fromObject: argument expected to be an object, got ${n===null?"null":typeof n}`);return new An({values:bm(n,An.normalizeUnit),loc:ln.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(to(n))return An.fromMillis(n);else if(An.isDuration(n))return n;else if(typeof n==="object")return An.fromObject(n);else throw new wi(`Unknown duration argument ${n} of type ${typeof n}`)}static fromISO(n,i){let[o]=Q7(n);if(o)return An.fromObject(o,i);else return An.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static fromISOTime(n,i){let[o]=O7(n);if(o)return An.fromObject(o,i);else return An.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the Duration is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Ln.throwOnInvalid)throw new cw(o);else return new An({invalid:o})}static normalizeUnit(n){let i={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[n?n.toLowerCase():n];if(!i)throw new Pf(n);return i}static isDuration(n){return n&&n.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(n,i={}){let o={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?Wi.create(this.loc,o).formatDurationFromString(this,n):y1}toHuman(n={}){if(!this.isValid)return y1;let i=zc.map((o)=>{let c=this.values[o];if(nn(c))return null;return this.loc.numberFormatter({style:"unit",unitDisplay:"long",...n,unit:o.slice(0,-1)}).format(c)}).filter((o)=>o);return this.loc.listFormatter({type:"conjunction",style:n.listStyle||"narrow",...n}).format(i)}toObject(){if(!this.isValid)return{};return{...this.values}}toISO(){if(!this.isValid)return null;let n="P";if(this.years!==0)n+=this.years+"Y";if(this.months!==0||this.quarters!==0)n+=this.months+this.quarters*3+"M";if(this.weeks!==0)n+=this.weeks+"W";if(this.days!==0)n+=this.days+"D";if(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)n+="T";if(this.hours!==0)n+=this.hours+"H";if(this.minutes!==0)n+=this.minutes+"M";if(this.seconds!==0||this.milliseconds!==0)n+=nv(this.seconds+this.milliseconds/1000,3)+"S";if(n==="P")n+="T0S";return n}toISOTime(n={}){if(!this.isValid)return null;let i=this.toMillis();if(i<0||i>=86400000)return null;return n={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...n,includeOffset:!1},e.fromMillis(i,{zone:"UTC"}).toISOTime(n)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Duration { values: ${JSON.stringify(this.values)} }`;else return`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){if(!this.isValid)return NaN;return dw(this.matrix,this.values)}valueOf(){return this.toMillis()}plus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n),o={};for(let c of zc)if(wp(i.values,c)||wp(this.values,c))o[c]=i.get(c)+this.get(c);return qo(this,{values:o},!0)}minus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n);return this.plus(i.negate())}mapUnits(n){if(!this.isValid)return this;let i={};for(let o of Object.keys(this.values))i[o]=jw(n(this.values[o],o));return qo(this,{values:i},!0)}get(n){return this[An.normalizeUnit(n)]}set(n){if(!this.isValid)return this;let i={...this.values,...bm(n,An.normalizeUnit)};return qo(this,{values:i})}reconfigure({locale:n,numberingSystem:i,conversionAccuracy:o,matrix:c}={}){let x={loc:this.loc.clone({locale:n,numberingSystem:i}),matrix:c,conversionAccuracy:o};return qo(this,x)}as(n){return this.isValid?this.shiftTo(n).get(n):NaN}normalize(){if(!this.isValid)return this;let n=this.toObject();return k1(this.matrix,n),qo(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=D7(this.normalize().shiftToAll().toObject());return qo(this,{values:n},!0)}shiftTo(...n){if(!this.isValid)return this;if(n.length===0)return this;n=n.map((x)=>An.normalizeUnit(x));let i={},o={},c=this.toObject(),p;for(let x of zc)if(n.indexOf(x)>=0){p=x;let m=0;for(let f in o)m+=this.matrix[f][x]*o[f],o[f]=0;if(to(c[x]))m+=c[x];let a=Math.trunc(m);i[x]=a,o[x]=(m*1000-a*1000)/1000}else if(to(c[x]))o[x]=c[x];for(let x in o)if(o[x]!==0)i[p]+=x===p?o[x]:o[x]/this.matrix[p][x];return k1(this.matrix,i),qo(this,{values:i},!0)}shiftToAll(){if(!this.isValid)return this;return this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds")}negate(){if(!this.isValid)return this;let n={};for(let i of Object.keys(this.values))n[i]=this.values[i]===0?0:-this.values[i];return qo(this,{values:n},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(n){if(!this.isValid||!n.isValid)return!1;if(!this.loc.equals(n.loc))return!1;function i(o,c){if(o===void 0||o===0)return c===void 0||c===0;return o===c}for(let o of zc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var xp="Invalid Interval";function L7(n,i){if(!n||!n.isValid)return hn.invalid("missing or invalid start");else if(!i||!i.isValid)return hn.invalid("missing or invalid end");else if(i<n)return hn.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${i.toISO()}`);else return null}class hn{constructor(n){this.s=n.start,this.e=n.end,this.invalid=n.invalid||null,this.isLuxonInterval=!0}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the Interval is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Ln.throwOnInvalid)throw new ow(o);else return new hn({invalid:o})}static fromDateTimes(n,i){let o=Ax(n),c=Ax(i),p=L7(o,c);if(p==null)return new hn({start:o,end:c});else return p}static after(n,i){let o=An.fromDurationLike(i),c=Ax(n);return hn.fromDateTimes(c,c.plus(o))}static before(n,i){let o=An.fromDurationLike(i),c=Ax(n);return hn.fromDateTimes(c.minus(o),c)}static fromISO(n,i){let[o,c]=(n||"").split("/",2);if(o&&c){let p,x;try{p=e.fromISO(o,i),x=p.isValid}catch(f){x=!1}let m,a;try{m=e.fromISO(c,i),a=m.isValid}catch(f){a=!1}if(x&&a)return hn.fromDateTimes(p,m);if(x){let f=An.fromISO(c,i);if(f.isValid)return hn.after(p,f)}else if(a){let f=An.fromISO(o,i);if(f.isValid)return hn.before(m,f)}}return hn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static isInterval(n){return n&&n.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid?this.e?this.e.minus(1):null:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(n="milliseconds"){return this.isValid?this.toDuration(...[n]).get(n):NaN}count(n="milliseconds",i){if(!this.isValid)return NaN;let o=this.start.startOf(n,i),c;if(i!=null&&i.useLocaleWeeks)c=this.end.reconfigure({locale:o.locale});else c=this.end;return c=c.startOf(n,i),Math.floor(c.diff(o,n).get(n))+(c.valueOf()!==this.end.valueOf())}hasSame(n){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,n):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(n){if(!this.isValid)return!1;return this.s>n}isBefore(n){if(!this.isValid)return!1;return this.e<=n}contains(n){if(!this.isValid)return!1;return this.s<=n&&this.e>n}set({start:n,end:i}={}){if(!this.isValid)return this;return hn.fromDateTimes(n||this.s,i||this.e)}splitAt(...n){if(!this.isValid)return[];let i=n.map(Ax).filter((x)=>this.contains(x)).sort((x,m)=>x.toMillis()-m.toMillis()),o=[],{s:c}=this,p=0;while(c<this.e){let x=i[p]||this.e,m=+x>+this.e?this.e:x;o.push(hn.fromDateTimes(c,m)),c=m,p+=1}return o}splitBy(n){let i=An.fromDurationLike(n);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:o}=this,c=1,p,x=[];while(o<this.e){let m=this.start.plus(i.mapUnits((a)=>a*c));p=+m>+this.e?this.e:m,x.push(hn.fromDateTimes(o,p)),o=p,c+=1}return x}divideEqually(n){if(!this.isValid)return[];return this.splitBy(this.length()/n).slice(0,n)}overlaps(n){return this.e>n.s&&this.s<n.e}abutsStart(n){if(!this.isValid)return!1;return+this.e===+n.s}abutsEnd(n){if(!this.isValid)return!1;return+n.e===+this.s}engulfs(n){if(!this.isValid)return!1;return this.s<=n.s&&this.e>=n.e}equals(n){if(!this.isValid||!n.isValid)return!1;return this.s.equals(n.s)&&this.e.equals(n.e)}intersection(n){if(!this.isValid)return this;let i=this.s>n.s?this.s:n.s,o=this.e<n.e?this.e:n.e;if(i>=o)return null;else return hn.fromDateTimes(i,o)}union(n){if(!this.isValid)return this;let i=this.s<n.s?this.s:n.s,o=this.e>n.e?this.e:n.e;return hn.fromDateTimes(i,o)}static merge(n){let[i,o]=n.sort((c,p)=>c.s-p.s).reduce(([c,p],x)=>{if(!p)return[c,x];else if(p.overlaps(x)||p.abutsStart(x))return[c,p.union(x)];else return[c.concat([p]),x]},[[],null]);if(o)i.push(o);return i}static xor(n){let i=null,o=0,c=[],p=n.map((a)=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),x=Array.prototype.concat(...p),m=x.sort((a,f)=>a.time-f.time);for(let a of m)if(o+=a.type==="s"?1:-1,o===1)i=a.time;else{if(i&&+i!==+a.time)c.push(hn.fromDateTimes(i,a.time));i=null}return hn.merge(c)}difference(...n){return hn.xor([this].concat(n)).map((i)=>this.intersection(i)).filter((i)=>i&&!i.isEmpty())}toString(){if(!this.isValid)return xp;return`[${this.s.toISO()} \u2013 ${this.e.toISO()})`}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;else return`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(n=Um,i={}){return this.isValid?Wi.create(this.s.loc.clone(i),n).formatInterval(this):xp}toISO(n){if(!this.isValid)return xp;return`${this.s.toISO(n)}/${this.e.toISO(n)}`}toISODate(){if(!this.isValid)return xp;return`${this.s.toISODate()}/${this.e.toISODate()}`}toISOTime(n){if(!this.isValid)return xp;return`${this.s.toISOTime(n)}/${this.e.toISOTime(n)}`}toFormat(n,{separator:i=" \u2013 "}={}){if(!this.isValid)return xp;return`${this.s.toFormat(n)}${i}${this.e.toFormat(n)}`}toDuration(n,i){if(!this.isValid)return An.invalid(this.invalidReason);return this.e.diff(this.s,n,i)}mapEndpoints(n){return hn.fromDateTimes(n(this.s),n(this.e))}}class fp{static hasDST(n=Ln.defaultZone){let i=e.now().setZone(n).set({month:12});return!n.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(n){return Go.isValidZone(n)}static normalizeZone(n){return Po(n,Ln.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||ln.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||ln.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||ln.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||ln.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||ln.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||ln.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||ln.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return ln.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return ln.create(i,null,"gregory").eras(n)}static features(){return{relative:bw(),localeWeek:uw()}}}function Z1(n,i){let o=(p)=>p.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),c=o(i)-o(n);return Math.floor(An.fromMillis(c).as("days"))}function N7(n,i,o){let c=[["years",(f,v)=>v.year-f.year],["quarters",(f,v)=>v.quarter-f.quarter+(v.year-f.year)*4],["months",(f,v)=>v.month-f.month+(v.year-f.year)*12],["weeks",(f,v)=>{let $=Z1(f,v);return($-$%7)/7}],["days",Z1]],p={},x=n,m,a;for(let[f,v]of c)if(o.indexOf(f)>=0)if(m=f,p[f]=v(n,i),a=x.plus(p),a>i){if(p[f]--,n=x.plus(p),n>i)a=n,p[f]--,n=x.plus(p)}else n=a;return[n,p,a,m]}function h7(n,i,o,c){let[p,x,m,a]=N7(n,i,o),f=i-p,v=o.filter((w)=>["hours","minutes","seconds","milliseconds"].indexOf(w)>=0);if(v.length===0){if(m<i)m=p.plus({[a]:1});if(m!==p)x[a]=(x[a]||0)+f/(m-p)}let $=An.fromObject(x,c);if(v.length>0)return An.fromMillis(f,c).shiftTo(...v).plus($);else return $}var C7="missing Intl.DateTimeFormat.formatToParts support";function Xn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(U3(o))}}var I7=String.fromCharCode(160),gw=`[ ${I7}]`,ew=new RegExp(gw,"g");function y7(n){return n.replace(/\./g,"\\.?").replace(ew,gw)}function q1(n){return n.replace(/\./g,"").replace(ew," ").toLowerCase()}function mo(n,i){if(n===null)return null;else return{regex:RegExp(n.map(y7).join("|")),deser:([o])=>n.findIndex((c)=>q1(o)===q1(c))+i}}function s1(n,i){return{regex:n,deser:([,o,c])=>jm(o,c),groups:i}}function Mm(n){return{regex:n,deser:([i])=>i}}function k7(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Z7(n,i){let o=xo(i),c=xo(i,"{2}"),p=xo(i,"{3}"),x=xo(i,"{4}"),m=xo(i,"{6}"),a=xo(i,"{1,2}"),f=xo(i,"{1,3}"),v=xo(i,"{1,6}"),$=xo(i,"{1,9}"),w=xo(i,"{2,4}"),J=xo(i,"{4,6}"),S=(K)=>({regex:RegExp(k7(K.val)),deser:([M])=>M,literal:!0}),R=((K)=>{if(n.literal)return S(K);switch(K.val){case"G":return mo(i.eras("short"),0);case"GG":return mo(i.eras("long"),0);case"y":return Xn(v);case"yy":return Xn(w,sf);case"yyyy":return Xn(x);case"yyyyy":return Xn(J);case"yyyyyy":return Xn(m);case"M":return Xn(a);case"MM":return Xn(c);case"MMM":return mo(i.months("short",!0),1);case"MMMM":return mo(i.months("long",!0),1);case"L":return Xn(a);case"LL":return Xn(c);case"LLL":return mo(i.months("short",!1),1);case"LLLL":return mo(i.months("long",!1),1);case"d":return Xn(a);case"dd":return Xn(c);case"o":return Xn(f);case"ooo":return Xn(p);case"HH":return Xn(c);case"H":return Xn(a);case"hh":return Xn(c);case"h":return Xn(a);case"mm":return Xn(c);case"m":return Xn(a);case"q":return Xn(a);case"qq":return Xn(c);case"s":return Xn(a);case"ss":return Xn(c);case"S":return Xn(f);case"SSS":return Xn(p);case"u":return Mm($);case"uu":return Mm(a);case"uuu":return Xn(o);case"a":return mo(i.meridiems(),0);case"kkkk":return Xn(x);case"kk":return Xn(w,sf);case"W":return Xn(a);case"WW":return Xn(c);case"E":case"c":return Xn(o);case"EEE":return mo(i.weekdays("short",!1),1);case"EEEE":return mo(i.weekdays("long",!1),1);case"ccc":return mo(i.weekdays("short",!0),1);case"cccc":return mo(i.weekdays("long",!0),1);case"Z":case"ZZ":return s1(new RegExp(`([+-]${a.source})(?::(${c.source}))?`),2);case"ZZZ":return s1(new RegExp(`([+-]${a.source})(${c.source})?`),2);case"z":return Mm(/[a-z_+-/]{1,256}?/i);case" ":return Mm(/[^\S\n\r]/);default:return S(K)}})(n)||{invalidReason:C7};return R.token=n,R}var q7={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function s7(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let f=/^\s+$/.test(p);return{literal:!f,val:f?" ":p}}let x=i[c],m=c;if(c==="hour")if(i.hour12!=null)m=i.hour12?"hour12":"hour24";else if(i.hourCycle!=null)if(i.hourCycle==="h11"||i.hourCycle==="h12")m="hour12";else m="hour24";else m=o.hour12?"hour12":"hour24";let a=q7[m];if(typeof a==="object")a=a[x];if(a)return{literal:!1,val:a};return}function P7(n){return[`^${n.map((o)=>o.regex).reduce((o,c)=>`${o}(${c.source})`,"")}$`,n]}function t7(n,i,o){let c=n.match(i);if(c){let p={},x=1;for(let m in o)if(wp(o,m)){let a=o[m],f=a.groups?a.groups+1:1;if(!a.literal&&a.token)p[a.token.val[0]]=a.deser(c.slice(x,x+f));x+=f}return[c,p]}else return[c,{}]}function r7(n){let i=(x)=>{switch(x){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},o=null,c;if(!nn(n.z))o=Go.create(n.z);if(!nn(n.Z)){if(!o)o=new Ki(n.Z);c=n.Z}if(!nn(n.q))n.M=(n.q-1)*3+1;if(!nn(n.h)){if(n.h<12&&n.a===1)n.h+=12;else if(n.h===12&&n.a===0)n.h=0}if(n.G===0&&n.y)n.y=-n.y;if(!nn(n.u))n.S=ef(n.u);return[Object.keys(n).reduce((x,m)=>{let a=i(m);if(a)x[a]=n[m];return x},{}),o,c]}var Df=null;function d7(){if(!Df)Df=e.fromMillis(1555555555555);return Df}function g7(n,i){if(n.literal)return n;let o=Wi.macroTokenToFormatOpts(n.val),c=oJ(o,i);if(c==null||c.includes(void 0))return n;return c}function nJ(n,i){return Array.prototype.concat(...n.map((o)=>g7(o,i)))}class pv{constructor(n,i){if(this.locale=n,this.format=i,this.tokens=nJ(Wi.parseFormat(i),n),this.units=this.tokens.map((o)=>Z7(o,n)),this.disqualifyingUnit=this.units.find((o)=>o.invalidReason),!this.disqualifyingUnit){let[o,c]=P7(this.units);this.regex=RegExp(o,"i"),this.handlers=c}}explainFromTokens(n){if(!this.isValid)return{input:n,tokens:this.tokens,invalidReason:this.invalidReason};else{let[i,o]=t7(n,this.regex,this.handlers),[c,p,x]=o?r7(o):[null,null,void 0];if(wp(o,"a")&&wp(o,"H"))throw new Hc("Can't include meridiem when specifying 24-hour format");return{input:n,tokens:this.tokens,regex:this.regex,rawMatches:i,matches:o,result:c,zone:p,specificOffset:x}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function iJ(n,i,o){return new pv(n,o).explainFromTokens(i)}function e7(n,i,o){let{result:c,zone:p,specificOffset:x,invalidReason:m}=iJ(n,i,o);return[c,p,x,m]}function oJ(n,i){if(!n)return null;let c=Wi.create(i,n).dtFormatter(d7()),p=c.formatToParts(),x=c.resolvedOptions();return p.map((m)=>s7(m,n,x))}var Lf="Invalid DateTime",P1=8640000000000000;function Tx(n){return new Pi("unsupported zone",`the zone "${n.name}" is not supported`)}function Nf(n){if(n.weekData===null)n.weekData=Vm(n.c);return n.weekData}function hf(n){if(n.localWeekData===null)n.localWeekData=Vm(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek());return n.localWeekData}function Yc(n,i){let o={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new e({...o,...i,old:o})}function cJ(n,i,o){let c=n-i*60*1000,p=o.offset(c);if(i===p)return[c,i];c-=(p-i)*60*1000;let x=o.offset(c);if(p===x)return[c,p];return[n-Math.min(p,x)*60*1000,Math.max(p,x)]}function Ym(n,i){n+=i*60*1000;let o=new Date(n);return{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate(),hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds()}}function Em(n,i,o){return cJ(Bm(n),i,o)}function t1(n,i){let o=n.o,c=n.c.year+Math.trunc(i.years),p=n.c.month+Math.trunc(i.months)+Math.trunc(i.quarters)*3,x={...n.c,year:c,month:p,day:Math.min(n.c.day,_m(c,p))+Math.trunc(i.days)+Math.trunc(i.weeks)*7},m=An.fromObject({years:i.years-Math.trunc(i.years),quarters:i.quarters-Math.trunc(i.quarters),months:i.months-Math.trunc(i.months),weeks:i.weeks-Math.trunc(i.weeks),days:i.days-Math.trunc(i.days),hours:i.hours,minutes:i.minutes,seconds:i.seconds,milliseconds:i.milliseconds}).as("milliseconds"),a=Bm(x),[f,v]=cJ(a,o,n.zone);if(m!==0)f+=m,v=n.zone.offset(f);return{ts:f,o:v}}function mp(n,i,o,c,p,x){let{setZone:m,zone:a}=o;if(n&&Object.keys(n).length!==0||i){let f=i||a,v=e.fromObject(n,{...o,zone:f,specificOffset:x});return m?v:v.setZone(a)}else return e.invalid(new Pi("unparsable",`the input "${p}" can't be parsed as ${c}`))}function Hm(n,i,o=!0){return n.isValid?Wi.create(ln.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function Cf(n,i){let o=n.c.year>9999||n.c.year<0,c="";if(o&&n.c.year>=0)c+="+";if(c+=tn(n.c.year,o?6:4),i)c+="-",c+=tn(n.c.month),c+="-",c+=tn(n.c.day);else c+=tn(n.c.month),c+=tn(n.c.day);return c}function r1(n,i,o,c,p,x){let m=tn(n.c.hour);if(i){if(m+=":",m+=tn(n.c.minute),n.c.millisecond!==0||n.c.second!==0||!o)m+=":"}else m+=tn(n.c.minute);if(n.c.millisecond!==0||n.c.second!==0||!o){if(m+=tn(n.c.second),n.c.millisecond!==0||!c)m+=".",m+=tn(n.c.millisecond,3)}if(p)if(n.isOffsetFixed&&n.offset===0&&!x)m+="Z";else if(n.o<0)m+="-",m+=tn(Math.trunc(-n.o/60)),m+=":",m+=tn(Math.trunc(-n.o%60));else m+="+",m+=tn(Math.trunc(n.o/60)),m+=":",m+=tn(Math.trunc(n.o%60));if(x)m+="["+n.zone.ianaName+"]";return m}var pJ={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},nX={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},iX={ordinal:1,hour:0,minute:0,second:0,millisecond:0},xJ=["year","month","day","hour","minute","second","millisecond"],oX=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],cX=["year","ordinal","hour","minute","second","millisecond"];function pX(n){let i={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!i)throw new Pf(n);return i}function d1(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return pX(n)}}function xX(n){if(Rx===void 0)Rx=Ln.now();if(n.type!=="iana")return n.offset(Rx);let i=n.name;if(!Om[i])Om[i]=n.offset(Rx);return Om[i]}function g1(n,i){let o=Po(i.zone,Ln.defaultZone);if(!o.isValid)return e.invalid(Tx(o));let c=ln.fromObject(i),p,x;if(!nn(n.year)){for(let f of xJ)if(nn(n[f]))n[f]=pJ[f];let m=Vw(n)||_w(n);if(m)return e.invalid(m);let a=xX(o);[p,x]=Em(n,a,o)}else p=Ln.now();return new e({ts:p,zone:o,loc:c,o:x})}function e1(n,i,o){let c=nn(o.round)?!0:o.round,p=(m,a)=>{return m=nv(m,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(m,a)},x=(m)=>{if(o.calendary)if(!i.hasSame(n,m))return i.startOf(m).diff(n.startOf(m),m).get(m);else return 0;else return i.diff(n,m).get(m)};if(o.unit)return p(x(o.unit),o.unit);for(let m of o.units){let a=x(m);if(Math.abs(a)>=1)return p(a,m)}return p(n>i?-0:0,o.units[o.units.length-1])}function nw(n){let i={},o;if(n.length>0&&typeof n[n.length-1]==="object")i=n[n.length-1],o=Array.from(n).slice(0,n.length-1);else o=Array.from(n);return[i,o]}var Rx,Om={};class e{constructor(n){let i=n.zone||Ln.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new Pi("invalid input"):null)||(!i.isValid?Tx(i):null);this.ts=nn(n.ts)?Ln.now():n.ts;let c=null,p=null;if(!o)if(n.old&&n.old.ts===this.ts&&n.old.zone.equals(i))[c,p]=[n.old.c,n.old.o];else{let m=to(n.o)&&!n.old?n.o:i.offset(this.ts);c=Ym(this.ts,m),o=Number.isNaN(c.year)?new Pi("invalid input"):null,c=o?null:c,p=o?null:m}this._zone=i,this.loc=n.loc||ln.create(),this.invalid=o,this.weekData=null,this.localWeekData=null,this.c=c,this.o=p,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[n,i]=nw(arguments),[o,c,p,x,m,a,f]=i;return g1({year:o,month:c,day:p,hour:x,minute:m,second:a,millisecond:f},n)}static utc(){let[n,i]=nw(arguments),[o,c,p,x,m,a,f]=i;return n.zone=Ki.utcInstance,g1({year:o,month:c,day:p,hour:x,minute:m,second:a,millisecond:f},n)}static fromJSDate(n,i={}){let o=B3(n)?n.valueOf():NaN;if(Number.isNaN(o))return e.invalid("invalid input");let c=Po(i.zone,Ln.defaultZone);if(!c.isValid)return e.invalid(Tx(c));return new e({ts:o,zone:c,loc:ln.fromObject(i)})}static fromMillis(n,i={}){if(!to(n))throw new wi(`fromMillis requires a numerical input, but received a ${typeof n} with value ${n}`);else if(n<-P1||n>P1)return e.invalid("Timestamp out of range");else return new e({ts:n,zone:Po(i.zone,Ln.defaultZone),loc:ln.fromObject(i)})}static fromSeconds(n,i={}){if(!to(n))throw new wi("fromSeconds requires a numerical input");else return new e({ts:n*1000,zone:Po(i.zone,Ln.defaultZone),loc:ln.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=Po(i.zone,Ln.defaultZone);if(!o.isValid)return e.invalid(Tx(o));let c=ln.fromObject(i),p=bm(n,d1),{minDaysInFirstWeek:x,startOfWeek:m}=L1(p,c),a=Ln.now(),f=!nn(i.specificOffset)?i.specificOffset:o.offset(a),v=!nn(p.ordinal),$=!nn(p.year),w=!nn(p.month)||!nn(p.day),J=$||w,S=p.weekYear||p.weekNumber;if((J||v)&&S)throw new Hc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&v)throw new Hc("Can't mix ordinal dates with month/day");let X=S||p.weekday&&!J,R,K,M=Ym(a,f);if(X)R=oX,K=nX,M=Vm(M,x,m);else if(v)R=cX,K=iX,M=jf(M);else R=xJ,K=pJ;let Y=!1;for(let y of R){let H=p[y];if(!nn(H))Y=!0;else if(Y)p[y]=K[y];else p[y]=M[y]}let I=X?_3(p,x,m):v?b3(p):Vw(p),G=I||_w(p);if(G)return e.invalid(G);let z=X?j1(p,x,m):v?D1(p):p,[E,Q]=Em(z,f,o),b=new e({ts:E,zone:o,o:Q,loc:c});if(p.weekday&&J&&n.weekday!==b.weekday)return e.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${b.toISO()}`);if(!b.isValid)return e.invalid(b.invalid);return b}static fromISO(n,i={}){let[o,c]=Y7(n);return mp(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=H7(n);return mp(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=z7(n);return mp(o,c,i,"HTTP",i)}static fromFormat(n,i,o={}){if(nn(n)||nn(i))throw new wi("fromFormat requires an input string and a format");let{locale:c=null,numberingSystem:p=null}=o,x=ln.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[m,a,f,v]=e7(x,n,i);if(v)return e.invalid(v);else return mp(m,a,o,`format ${i}`,n,f)}static fromString(n,i,o={}){return e.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=b7(n);return mp(o,c,i,"SQL",n)}static invalid(n,i=null){if(!n)throw new wi("need to specify a reason the DateTime is invalid");let o=n instanceof Pi?n:new Pi(n,i);if(Ln.throwOnInvalid)throw new iw(o);else return new e({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=oJ(n,ln.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return nJ(Wi.parseFormat(n),ln.fromObject(i)).map((c)=>c.val).join("")}static resetCache(){Rx=void 0,Om={}}get(n){return this[n]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Nf(this).weekYear:NaN}get weekNumber(){return this.isValid?Nf(this).weekNumber:NaN}get weekday(){return this.isValid?Nf(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?hf(this).weekday:NaN}get localWeekNumber(){return this.isValid?hf(this).weekNumber:NaN}get localWeekYear(){return this.isValid?hf(this).weekYear:NaN}get ordinal(){return this.isValid?jf(this.c).ordinal:NaN}get monthShort(){return this.isValid?fp.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?fp.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?fp.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?fp.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"short",locale:this.locale});else return null}get offsetNameLong(){if(this.isValid)return this.zone.offsetName(this.ts,{format:"long",locale:this.locale});else return null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){if(this.isOffsetFixed)return!1;else return this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let n=86400000,i=60000,o=Bm(this.c),c=this.zone.offset(o-n),p=this.zone.offset(o+n),x=this.zone.offset(o-c*i),m=this.zone.offset(o-p*i);if(x===m)return[this];let a=o-x*i,f=o-m*i,v=Ym(a,x),$=Ym(f,m);if(v.hour===$.hour&&v.minute===$.minute&&v.second===$.second&&v.millisecond===$.millisecond)return[Yc(this,{ts:a}),Yc(this,{ts:f})];return[this]}get isInLeapYear(){return Kx(this.year)}get daysInMonth(){return _m(this.year,this.month)}get daysInYear(){return this.isValid?vp(this.year):NaN}get weeksInWeekYear(){return this.isValid?Xx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Xx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(n={}){let{locale:i,numberingSystem:o,calendar:c}=Wi.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Ki.instance(n),i)}toLocal(){return this.setZone(Ln.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=Po(n,Ln.defaultZone),n.equals(this.zone))return this;else if(!n.isValid)return e.invalid(Tx(n));else{let c=this.ts;if(i||o){let p=n.offset(this.ts),x=this.toObject();[c]=Em(x,p,n)}return Yc(this,{ts:c,zone:n})}}reconfigure({locale:n,numberingSystem:i,outputCalendar:o}={}){let c=this.loc.clone({locale:n,numberingSystem:i,outputCalendar:o});return Yc(this,{loc:c})}setLocale(n){return this.reconfigure({locale:n})}set(n){if(!this.isValid)return this;let i=bm(n,d1),{minDaysInFirstWeek:o,startOfWeek:c}=L1(i,this.loc),p=!nn(i.weekYear)||!nn(i.weekNumber)||!nn(i.weekday),x=!nn(i.ordinal),m=!nn(i.year),a=!nn(i.month)||!nn(i.day),f=m||a,v=i.weekYear||i.weekNumber;if((f||x)&&v)throw new Hc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&x)throw new Hc("Can't mix ordinal dates with month/day");let $;if(p)$=j1({...Vm(this.c,o,c),...i},o,c);else if(!nn(i.ordinal))$=D1({...jf(this.c),...i});else if($={...this.toObject(),...i},nn(i.day))$.day=Math.min(_m($.year,$.month),$.day);let[w,J]=Em($,this.o,this.zone);return Yc(this,{ts:w,o:J})}plus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n);return Yc(this,t1(this,i))}minus(n){if(!this.isValid)return this;let i=An.fromDurationLike(n).negate();return Yc(this,t1(this,i))}startOf(n,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;let o={},c=An.normalizeUnit(n);switch(c){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(c==="weeks")if(i){let p=this.loc.getStartOfWeek(),{weekday:x}=this;if(x<p)o.weekNumber=this.weekNumber-1;o.weekday=p}else o.weekday=1;if(c==="quarters"){let p=Math.ceil(this.month/3);o.month=(p-1)*3+1}return this.set(o)}endOf(n,i){return this.isValid?this.plus({[n]:1}).startOf(n,i).minus(1):this}toFormat(n,i={}){return this.isValid?Wi.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):Lf}toLocaleString(n=Um,i={}){return this.isValid?Wi.create(this.loc.clone(i),n).formatDateTime(this):Lf}toLocaleParts(n={}){return this.isValid?Wi.create(this.loc.clone(n),n).formatDateTimeParts(this):[]}toISO({format:n="extended",suppressSeconds:i=!1,suppressMilliseconds:o=!1,includeOffset:c=!0,extendedZone:p=!1}={}){if(!this.isValid)return null;let x=n==="extended",m=Cf(this,x);return m+="T",m+=r1(this,x,i,o,c,p),m}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return Cf(this,n==="extended")}toISOWeekDate(){return Hm(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:n=!1,suppressSeconds:i=!1,includeOffset:o=!0,includePrefix:c=!1,extendedZone:p=!1,format:x="extended"}={}){if(!this.isValid)return null;return(c?"T":"")+r1(this,x==="extended",i,n,o,p)}toRFC2822(){return Hm(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Hm(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){if(!this.isValid)return null;return Cf(this,!0)}toSQLTime({includeOffset:n=!0,includeZone:i=!1,includeOffsetSpace:o=!0}={}){let c="HH:mm:ss.SSS";if(i||n){if(o)c+=" ";if(i)c+="z";else if(n)c+="ZZ"}return Hm(this,c,!0)}toSQL(n={}){if(!this.isValid)return null;return`${this.toSQLDate()} ${this.toSQLTime(n)}`}toString(){return this.isValid?this.toISO():Lf}[Symbol.for("nodejs.util.inspect.custom")](){if(this.isValid)return`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;else return`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1000:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1000):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(n={}){if(!this.isValid)return{};let i={...this.c};if(n.includeConfig)i.outputCalendar=this.outputCalendar,i.numberingSystem=this.loc.numberingSystem,i.locale=this.loc.locale;return i}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(n,i="milliseconds",o={}){if(!this.isValid||!n.isValid)return An.invalid("created by diffing an invalid DateTime");let c={locale:this.locale,numberingSystem:this.numberingSystem,...o},p=j3(i).map(An.normalizeUnit),x=n.valueOf()>this.valueOf(),m=x?this:n,a=x?n:this,f=h7(m,a,p,c);return x?f.negate():f}diffNow(n="milliseconds",i={}){return this.diff(e.now(),n,i)}until(n){return this.isValid?hn.fromDateTimes(this,n):this}hasSame(n,i,o){if(!this.isValid)return!1;let c=n.valueOf(),p=this.setZone(n.zone,{keepLocalTime:!0});return p.startOf(i,o)<=c&&c<=p.endOf(i,o)}equals(n){return this.isValid&&n.isValid&&this.valueOf()===n.valueOf()&&this.zone.equals(n.zone)&&this.loc.equals(n.loc)}toRelative(n={}){if(!this.isValid)return null;let i=n.base||e.fromObject({},{zone:this.zone}),o=n.padding?this<i?-n.padding:n.padding:0,c=["years","months","days","hours","minutes","seconds"],p=n.unit;if(Array.isArray(n.unit))c=n.unit,p=void 0;return e1(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return e1(n.base||e.fromObject({},{zone:this.zone}),this,{...n,numeric:"auto",units:["years","months","days"],calendary:!0})}static min(...n){if(!n.every(e.isDateTime))throw new wi("min requires all arguments be DateTimes");return N1(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(e.isDateTime))throw new wi("max requires all arguments be DateTimes");return N1(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,x=ln.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return iJ(x,n,i)}static fromStringExplain(n,i,o={}){return e.fromFormatExplain(n,i,o)}static buildFormatParser(n,i={}){let{locale:o=null,numberingSystem:c=null}=i,p=ln.fromOpts({locale:o,numberingSystem:c,defaultToEN:!0});return new pv(p,n)}static fromFormatParser(n,i,o={}){if(nn(n)||nn(i))throw new wi("fromFormatParser requires an input string and a format parser");let{locale:c=null,numberingSystem:p=null}=o,x=ln.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});if(!x.equals(i.locale))throw new wi(`fromFormatParser called with a locale of ${x}, but the format parser was created for ${i.locale}`);let{result:m,zone:a,specificOffset:f,invalidReason:v}=i.explainFromTokens(n);if(v)return e.invalid(v);else return mp(m,a,o,`format ${i.format}`,n,f)}static get DATE_SHORT(){return Um}static get DATE_MED(){return pw}static get DATE_MED_WITH_WEEKDAY(){return J3}static get DATE_FULL(){return xw}static get DATE_HUGE(){return mw}static get TIME_SIMPLE(){return aw}static get TIME_WITH_SECONDS(){return fw}static get TIME_WITH_SHORT_OFFSET(){return vw}static get TIME_WITH_LONG_OFFSET(){return $w}static get TIME_24_SIMPLE(){return ww}static get TIME_24_WITH_SECONDS(){return Jw}static get TIME_24_WITH_SHORT_OFFSET(){return Aw}static get TIME_24_WITH_LONG_OFFSET(){return Fw}static get DATETIME_SHORT(){return Tw}static get DATETIME_SHORT_WITH_SECONDS(){return Rw}static get DATETIME_MED(){return Sw}static get DATETIME_MED_WITH_SECONDS(){return Xw}static get DATETIME_MED_WITH_WEEKDAY(){return A3}static get DATETIME_FULL(){return Ww}static get DATETIME_FULL_WITH_SECONDS(){return Kw}static get DATETIME_HUGE(){return lw}static get DATETIME_HUGE_WITH_SECONDS(){return Gw}}function Ax(n){if(e.isDateTime(n))return n;else if(n&&n.valueOf&&to(n.valueOf()))return e.fromJSDate(n);else if(n&&typeof n==="object")return e.fromObject(n);else throw new wi(`Unknown datetime argument: ${n}, of type ${typeof n}`)}var mX="3.6.0";mJ.DateTime=e;mJ.Duration=An;mJ.FixedOffsetZone=Ki;mJ.IANAZone=Go;mJ.Info=fp;mJ.Interval=hn;mJ.InvalidZone=tf;mJ.Settings=Ln;mJ.SystemZone=Wx;mJ.VERSION=mX;mJ.Zone=Qc});var JJ=C((fJ)=>{Object.defineProperty(fJ,"__esModule",{value:!0});fJ.RE_RANGE=fJ.RE_WILDCARDS=fJ.PRESETS=fJ.TIME_UNITS_LEN=fJ.TIME_UNITS=fJ.TIME_UNITS_MAP=fJ.ALIASES=fJ.PARSE_DEFAULTS=fJ.CONSTRAINTS=void 0;fJ.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});fJ.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});fJ.ALIASES=Object.freeze({jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12,sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6});fJ.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});fJ.TIME_UNITS=Object.freeze(Object.values(fJ.TIME_UNITS_MAP));fJ.TIME_UNITS_LEN=fJ.TIME_UNITS.length;fJ.PRESETS=Object.freeze({"@yearly":"0 0 0 1 1 *","@monthly":"0 0 0 1 * *","@weekly":"0 0 0 * * 0","@daily":"0 0 0 * * *","@hourly":"0 0 * * * *","@minutely":"0 * * * * *","@secondly":"* * * * * *","@weekdays":"0 0 0 * * 1-5","@weekends":"0 0 0 * * 0,6"});fJ.RE_WILDCARDS=/\*/g;fJ.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var mv=C((FJ)=>{Object.defineProperty(FJ,"__esModule",{value:!0});FJ.ExclusiveParametersError=FJ.CronError=void 0;class xv extends Error{}FJ.CronError=xv;class AJ extends xv{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}FJ.ExclusiveParametersError=AJ});var Lm=C((RJ)=>{Object.defineProperty(RJ,"__esModule",{value:!0});RJ.CronTime=void 0;var Di=aJ(),li=JJ(),_i=mv();class av{constructor(n,i,o){if(this.realDate=!1,this.second={},this.minute={},this.hour={},this.dayOfMonth={},this.month={},this.dayOfWeek={},i!=null&&o!=null)throw new _i.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!Di.DateTime.fromObject({},{zone:i}).isValid)throw new _i.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(i==null&&o==null){let c=Intl.DateTimeFormat().resolvedOptions().timeZone;this.timeZone=c}if(n instanceof Date||n instanceof Di.DateTime)this.source=n instanceof Date?Di.DateTime.fromJSDate(n):n,this.realDate=!0;else this.source=n,this._parse(this.source)}static validateCronExpression(n){try{return new av(n),{valid:!0}}catch(i){return{valid:!1,error:i}}}_getWeekDay(n){return n.weekday===7?0:n.weekday}sendAt(n){let i=this.realDate&&this.source instanceof Di.DateTime?this.source:Di.DateTime.utc();if(this.timeZone)i=i.setZone(this.timeZone);if(this.utcOffset!==void 0){let o=this.utcOffset<0?"-":"+",c=Math.trunc(this.utcOffset/60),p=String(Math.abs(c)).padStart(2,"0"),x=Math.abs(this.utcOffset-c*60),m=String(x).padStart(2,"0"),a=`UTC${o}${p}:${m}`;if(i=i.setZone(a),!i.isValid)throw new _i.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(Di.DateTime.local()>i)throw new _i.CronError("WARNING: Date in past. Will never be fired.");return i}if(n===void 0||isNaN(n)||n<0)return this.getNextDateFrom(i);else{let o=[];for(;n>0;n--)i=this.getNextDateFrom(i),o.push(i);return o}}getTimeout(){return Math.max(-1,this.sendAt().toMillis()-Di.DateTime.utc().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return li.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o,c;if(n instanceof Date)n=Di.DateTime.fromJSDate(n);if(i)n=n.setZone(i);else i=(o=n.zone.zoneName)!==null&&o!==void 0?o:n.zone.fixed;let p=Di.DateTime.fromFormat(`${n.year}-${n.month}-${n.day} ${n.hour}:${n.minute}:${n.second}`,"yyyy-M-d H:m:s",{zone:"UTC"}),x=p.toMillis();if(!this.realDate){if(p.millisecond>0)p=p.set({millisecond:0,second:p.second+1})}if(!p.isValid)throw new _i.CronError("ERROR: You specified an invalid date.");let m=Di.DateTime.now().plus({years:8});while(!0){if(p>m)throw new _i.CronError(`Something went wrong. No execution date was found in the next 8 years.
4
4
  Please provide the following string if you would like to help debug:
5
- Time Zone: ${(o=i===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:'""'} - Cron String: ${this.source.toString()} - UTC offset: ${c.offset} - current Date: ${Go.DateTime.local().toString()}`);if(!(c.month in this.month)&&Object.keys(this.month).length!==12){if(c=c.plus({months:1}),c=c.set({day:1,hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[a,f]=this._findPreviousDSTJump(c);if(c=f,a)break}continue}if(!(c.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31&&!((this._getWeekDay(c)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7)){if(c=c.plus({days:1}),c=c.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[a,f]=this._findPreviousDSTJump(c);if(c=f,a)break}continue}if(!(this._getWeekDay(c)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7&&!((c.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31)){if(c=c.plus({days:1}),c=c.set({hour:0,minute:0,second:0}),this._forwardDSTJump(0,0,c)){let[a,f]=this._findPreviousDSTJump(c);if(c=f,a)break}continue}if(!(c.hour in this.hour)&&Object.keys(this.hour).length!==24){let a=c.hour===23&&m>86400000?0:c.hour+1,f=c.minute;if(c=c.set({hour:a}),c=c.set({minute:0,second:0}),this._forwardDSTJump(a,f,c)){let[v,$]=this._findPreviousDSTJump(c);if(c=$,v)break}continue}if(!(c.minute in this.minute)&&Object.keys(this.minute).length!==60){let a=c.minute===59&&m>3600000?0:c.minute+1,f=c.hour+(a===60?1:0);if(c=c.set({minute:a}),c=c.set({second:0}),this._forwardDSTJump(f,a,c)){let[v,$]=this._findPreviousDSTJump(c);if(c=$,v)break}continue}if(!(c.second in this.second)&&Object.keys(this.second).length!==60){let a=c.second===59&&m>60000?0:c.second+1,f=c.minute+(a===60?1:0),v=c.hour+(f===60?1:0);if(c=c.set({second:a}),this._forwardDSTJump(v,f,c)){let[$,w]=this._findPreviousDSTJump(c);if(c=w,$)break}continue}if(c.toMillis()===p){let a=c.second+1,f=c.minute+(a===60?1:0),v=c.hour+(f===60?1:0);if(c=c.set({second:a}),this._forwardDSTJump(v,f,c)){let[$,w]=this._findPreviousDSTJump(c);if(c=w,$)break}continue}break}return c}_findPreviousDSTJump(n){var i;let o,c,p,x,m=n,a=1440,f=0;do{if(++f>a)throw new Gi.CronError(`ERROR: This DST checking related function assumes the input DateTime (${(i=n.toISO())!==null&&i!==void 0?i:n.toMillis()}) is within 24 hours of a DST jump.`);if(o=m.minute-1,c=m.hour,o<0)o+=60,c=(c+24-1)%24;m=m.minus({minute:1}),p=m.minute,x=m.hour}while(o===p&&c===x);let v=m.plus({minute:1}).set({second:0,millisecond:0}),$=v.minus({second:1});if(n.month in this.month&&n.day in this.dayOfMonth&&this._getWeekDay(n)in this.dayOfWeek)return[this._checkTimeInSkippedRange($,v),v];return[!1,v]}_checkTimeInSkippedRange(n,i){let o=(n.minute+1)%60,c=(n.hour+(o===0?1:0))%24,p=i.hour-c+1,x=o===0&&i.minute===0;if(p===2&&x)return c in this.hour;else if(p===1)return c in this.hour&&this._checkTimeInSkippedRangeSingleHour(o,i.minute);else return this._checkTimeInSkippedRangeMultiHour(c,o,i.hour,i.minute)}_checkTimeInSkippedRangeSingleHour(n,i){for(let o=n;o<i;++o)if(o in this.minute)return!0;return i in this.minute&&0 in this.second}_checkTimeInSkippedRangeMultiHour(n,i,o,c){if(n>=o)throw new Gi.CronError(`ERROR: This DST checking related function assumes the forward jump starting hour (${n}) is less than the end hour (${o})`);let p=Array.from({length:60-i},(f,v)=>i+v),x=Array.from({length:c},(f,v)=>v),m=Array.from({length:60},(f,v)=>v),a=(f)=>{if(f===n)return p;else if(f===o)return x;else return m};for(let f=n;f<=o;++f){if(!(f in this.hour))continue;let v=a(f);for(let $ of v)if($ in this.minute)return!0}return o in this.hour&&c in this.minute&&0 in this.second}_forwardDSTJump(n,i,o){let{hour:c,minute:p}=o,x=n%24<c,m=i%60<p;return x||m}_wcOrAll(n){if(this._hasAll(n))return"*";let i=[];for(let o in this[n])i.push(o);return i.join(",")}_hasAll(n){let i=Wi.CONSTRAINTS[n],o=i[0],c=n===Wi.TIME_UNITS_MAP.DAY_OF_WEEK?i[1]-1:i[1];for(let p=o,x=c;p<x;p++)if(!(p in this[n]))return!1;return!0}_parse(n){var i;if(n=n.toLowerCase(),Object.keys(Wi.PRESETS).includes(n))n=Wi.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(Wi.ALIASES).includes(p))return Wi.ALIASES[p].toString();throw new Gi.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<Wi.TIME_UNITS_LEN-1)throw new Gi.CronError("Too few fields");if(o.length>Wi.TIME_UNITS_LEN)throw new Gi.CronError("Too many fields");let c=o.length;for(let p of Wi.TIME_UNITS){let x=Wi.TIME_UNITS.indexOf(p),m=(i=o[x-(Wi.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:Wi.PARSE_DEFAULTS[p];this._parseField(m,p)}}_parseField(n,i){let o=this[i],c,p=Wi.CONSTRAINTS[i],x=p[0],m=p[1];n.split(",").forEach((v)=>{let $=v.indexOf("*");if($!==-1&&$!==0)throw new Gi.CronError(`Field (${v}) has an invalid wildcard expression`)}),n=n.replace(Wi.RE_WILDCARDS,`${x}-${m}`);let f=n.split(",");for(let v of f){let $=[...v.matchAll(Wi.RE_RANGE)][0];if(($===null||$===void 0?void 0:$[1])!==void 0){let[,w,J,l]=$,S=parseInt(w,10),R=J!==void 0?parseInt(J,10):void 0,K=l!==void 0,Y=parseInt(l!==null&&l!==void 0?l:"1",10);if(Y===0)throw new Gi.CronError(`Field (${i}) has a step of zero`);if(R!==void 0&&S>R)throw new Gi.CronError(`Field (${i}) has an invalid range`);if(S<x||R!==void 0&&R>m||R===void 0&&S>m)throw new Gi.CronError(`Field value (${n}) is out of range`);if(S=Math.min(Math.max(x,~~Math.abs(S)),m),R!==void 0)R=Math.min(m,~~Math.abs(R));else R=K?m:S;c=S;do o[c]=!0,c+=Y;while(c<=R);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new Gi.CronError(`Field (${i}) cannot be parsed`)}}}TJ.CronTime=mv});var lJ=h((Rp)=>{var um=Rp&&Rp.__awaiter||function(n,i,o,c){function p(x){return x instanceof o?x:new o(function(m){m(x)})}return new(o||(o=Promise))(function(x,m){function a($){try{v(c.next($))}catch(w){m(w)}}function f($){try{v(c.throw($))}catch(w){m(w)}}function v($){$.done?x($.value):p($.value).then(a,f)}v((c=c.apply(n,i||[])).next())})};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.CronJob=void 0;var RJ=Kn("child_process"),av=xv(),Nm=Lm();class Gx{get isActive(){return this._isActive}get isCallbackRunning(){return this._isCallbackRunning}constructor(n,i,o,c,p,x,m,a,f,v,$){if(this.unrefTimeout=!1,this.lastExecution=null,this.runOnce=!1,this.waitForCompletion=!1,this._isActive=!1,this._isCallbackRunning=!1,this._callbacks=[],this.context=x!==null&&x!==void 0?x:this,this.waitForCompletion=Boolean(v),this.errorHandler=$,p!=null&&a!=null)throw new av.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new Nm.CronTime(n,p,null);else if(a!=null)this.cronTime=new Nm.CronTime(n,null,a);else this.cronTime=new Nm.CronTime(n,p,a);if(f!=null)this.unrefTimeout=f;if(o!=null)this.onComplete=this._fnWrap(o);if(this.cronTime.realDate)this.runOnce=!0;if(this.addCallback(this._fnWrap(i)),m)this.lastExecution=new Date,this.fireOnTick();if(c)this.start()}static from(n){if(n.timeZone!=null&&n.utcOffset!=null)throw new av.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new Gx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else if(n.utcOffset!=null)return new Gx(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else return new Gx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler)}_fnWrap(n){var i,o;switch(typeof n){case"function":return n;case"string":{let[c,...p]=n.split(" ");return RJ.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return RJ.spawn.bind(void 0,n.command,(i=n.args)!==null&&i!==void 0?i:[],(o=n.options)!==null&&o!==void 0?o:{})}}addCallback(n){if(typeof n==="function")this._callbacks.push(n)}setTime(n){if(!(n instanceof Nm.CronTime))throw new av.CronError("time must be an instance of CronTime.");let i=this._isActive;if(this.stop(),this.cronTime=n,n.realDate)this.runOnce=!0;if(i)this.start()}nextDate(){return this.cronTime.sendAt()}fireOnTick(){return um(this,void 0,void 0,function*(){if(this.waitForCompletion&&this._isCallbackRunning)return;this._isCallbackRunning=!0;try{for(let n of this._callbacks){let i=n.call(this.context,this.onComplete);if(this.waitForCompletion)yield i}}catch(n){if(this.errorHandler!=null)this.errorHandler(n);else console.error("[Cron] error in callback",n)}finally{this._isCallbackRunning=!1}})}nextDates(n){return this.cronTime.sendAt(n!==null&&n!==void 0?n:0)}start(){if(this._isActive)return;let n=2147483647,i=this.cronTime.getTimeout(),o=0,c,p=(m)=>{if(c=Date.now(),this._timeout=setTimeout(x,m),this.unrefTimeout&&typeof this._timeout.unref==="function")this._timeout.unref()},x=()=>{let m=c+i-Date.now();if(m>0){let a=this.cronTime.getTimeout();if(a>m)a=m;o+=a}if(o){if(o>n)o-=n,i=n;else i=o,o=0;p(i)}else{if(this.lastExecution=new Date,this._isActive=!1,!this.runOnce)this.start();this.fireOnTick()}};if(i>=0){if(this._isActive=!0,i>n)o=i-n,i=n;p(i)}else this.stop()}lastDate(){return this.lastExecution}_executeOnComplete(){return um(this,void 0,void 0,function*(){if(typeof this.onComplete!=="function")return;try{yield this.onComplete.call(this.context)}catch(n){console.error("[Cron] error in onComplete callback:",n)}})}_waitForJobCompletion(){return um(this,void 0,void 0,function*(){while(this._isCallbackRunning)yield new Promise((n)=>setTimeout(n,100))})}stop(){if(this._timeout)clearTimeout(this._timeout);if(this._isActive=!1,!this.waitForCompletion){this._executeOnComplete();return}Promise.resolve().then(()=>um(this,void 0,void 0,function*(){yield this._waitForJobCompletion(),yield this._executeOnComplete()}))}}Rp.CronJob=Gx});var vv=h((hm)=>{Object.defineProperty(hm,"__esModule",{value:!0});hm.validateCronExpression=hm.timeout=hm.sendAt=hm.CronTime=hm.CronJob=void 0;var fv=Lm(),X7=lJ();Object.defineProperty(hm,"CronJob",{enumerable:!0,get:function(){return X7.CronJob}});var K7=Lm();Object.defineProperty(hm,"CronTime",{enumerable:!0,get:function(){return K7.CronTime}});var W7=(n)=>new fv.CronTime(n).sendAt();hm.sendAt=W7;var G7=(n)=>new fv.CronTime(n).getTimeout();hm.timeout=G7;hm.validateCronExpression=fv.CronTime.validateCronExpression});var fF=h((VL,Ev)=>{Ev.exports=aF;Ev.exports.preferredCharsets=aF;var B7=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function b7(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=j7(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function j7(n,i){var o=B7.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var a=x[m].trim().split("=");if(a[0]==="q"){p=parseFloat(a[1]);break}}}return{charset:c,q:p,i}}function D7(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=L7(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function L7(n,i,o){var c=0;if(i.charset.toLowerCase()===n.toLowerCase())c|=1;else if(i.charset!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function aF(n,i){var o=b7(n===void 0?"*":n||"");if(!i)return o.filter(mF).sort(xF).map(u7);var c=i.map(function p(x,m){return D7(x,o,m)});return c.filter(mF).sort(xF).map(function p(x){return i[c.indexOf(x)]})}function xF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function u7(n){return n.charset}function mF(n){return n.q>0}});var AF=h((_L,Ov)=>{Ov.exports=JF;Ov.exports.preferredEncodings=JF;var N7=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function h7(n){var i=n.split(","),o=!1,c=1;for(var p=0,x=0;p<i.length;p++){var m=C7(i[p].trim(),p);if(m)i[x++]=m,o=o||wF("identity",m),c=Math.min(c,m.q||1)}if(!o)i[x++]={encoding:"identity",q:c,i:p};return i.length=x,i}function C7(n,i){var o=N7.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var a=x[m].trim().split("=");if(a[0]==="q"){p=parseFloat(a[1]);break}}}return{encoding:c,q:p,i}}function I7(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=wF(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function wF(n,i,o){var c=0;if(i.encoding.toLowerCase()===n.toLowerCase())c|=1;else if(i.encoding!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function JF(n,i){var o=h7(n||"");if(!i)return o.filter($F).sort(vF).map(y7);var c=i.map(function p(x,m){return I7(x,o,m)});return c.filter($F).sort(vF).map(function p(x){return i[c.indexOf(x)]})}function vF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function y7(n){return n.encoding}function $F(n){return n.q>0}});var SF=h((BL,Uv)=>{Uv.exports=lF;Uv.exports.preferredLanguages=lF;var k7=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function Z7(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=RF(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function RF(n,i){var o=k7.exec(n);if(!o)return null;var c=o[1],p=o[2],x=c;if(p)x+="-"+p;var m=1;if(o[3]){var a=o[3].split(";");for(var f=0;f<a.length;f++){var v=a[f].split("=");if(v[0]==="q")m=parseFloat(v[1])}}return{prefix:c,suffix:p,q:m,i,full:x}}function s7(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=q7(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function q7(n,i,o){var c=RF(n);if(!c)return null;var p=0;if(i.full.toLowerCase()===c.full.toLowerCase())p|=4;else if(i.prefix.toLowerCase()===c.full.toLowerCase())p|=2;else if(i.full.toLowerCase()===c.prefix.toLowerCase())p|=1;else if(i.full!=="*")return null;return{i:o,o:i.i,q:i.q,s:p}}function lF(n,i){var o=Z7(n===void 0?"*":n||"");if(!i)return o.filter(FF).sort(TF).map(P7);var c=i.map(function p(x,m){return s7(x,o,m)});return c.filter(FF).sort(TF).map(function p(x){return i[c.indexOf(x)]})}function TF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function P7(n){return n.full}function FF(n){return n.q>0}});var MF=h((bL,Vv)=>{Vv.exports=GF;Vv.exports.preferredMediaTypes=GF;var t7=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function r7(n){var i=iX(n);for(var o=0,c=0;o<i.length;o++){var p=WF(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function WF(n,i){var o=t7.exec(n);if(!o)return null;var c=Object.create(null),p=1,x=o[2],m=o[1];if(o[3]){var a=oX(o[3]).map(nX);for(var f=0;f<a.length;f++){var v=a[f],$=v[0].toLowerCase(),w=v[1],J=w&&w[0]==='"'&&w[w.length-1]==='"'?w.substr(1,w.length-2):w;if($==="q"){p=parseFloat(J);break}c[$]=J}}return{type:m,subtype:x,params:c,q:p,i}}function g7(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=d7(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function d7(n,i,o){var c=WF(n),p=0;if(!c)return null;if(i.type.toLowerCase()==c.type.toLowerCase())p|=4;else if(i.type!="*")return null;if(i.subtype.toLowerCase()==c.subtype.toLowerCase())p|=2;else if(i.subtype!="*")return null;var x=Object.keys(i.params);if(x.length>0)if(x.every(function(m){return i.params[m]=="*"||(i.params[m]||"").toLowerCase()==(c.params[m]||"").toLowerCase()}))p|=1;else return null;return{i:o,o:i.i,q:i.q,s:p}}function GF(n,i){var o=r7(n===void 0?"*/*":n||"");if(!i)return o.filter(KF).sort(XF).map(e7);var c=i.map(function p(x,m){return g7(x,o,m)});return c.filter(KF).sort(XF).map(function p(x){return i[c.indexOf(x)]})}function XF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function e7(n){return n.type+"/"+n.subtype}function KF(n){return n.q>0}function YF(n){var i=0,o=0;while((o=n.indexOf('"',o))!==-1)i++,o++;return i}function nX(n){var i=n.indexOf("="),o,c;if(i===-1)o=n;else o=n.substr(0,i),c=n.substr(i+1);return[o,c]}function iX(n){var i=n.split(",");for(var o=1,c=0;o<i.length;o++)if(YF(i[c])%2==0)i[++c]=i[o];else i[c]+=","+i[o];return i.length=c+1,i}function oX(n){var i=n.split(";");for(var o=1,c=0;o<i.length;o++)if(YF(i[c])%2==0)i[++c]=i[o];else i[c]+=";"+i[o];i.length=c+1;for(var o=0;o<i.length;o++)i[o]=i[o].trim();return i}});var HF=h((jL,_v)=>{/*!
5
+ Time Zone: ${(c=i===null||i===void 0?void 0:i.toString())!==null&&c!==void 0?c:'""'} - Cron String: ${this.source.toString()} - UTC offset: ${p.offset} - current Date: ${Di.DateTime.local().toString()}`);if(!(p.month in this.month)&&Object.keys(this.month).length!==12){p=p.plus({month:1}),p=p.set({day:1,hour:0,minute:0,second:0});continue}if(!(p.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31&&!((this._getWeekDay(p)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7)||!(this._getWeekDay(p)in this.dayOfWeek)&&Object.keys(this.dayOfWeek).length!==7&&!((p.day in this.dayOfMonth)&&Object.keys(this.dayOfMonth).length!==31)){p=p.plus({days:1}),p=p.set({hour:0,minute:0,second:0});continue}if(!(p.hour in this.hour)&&Object.keys(this.hour).length!==24){p=p.plus({hour:1}),p=p.set({minute:0,second:0});continue}if(!(p.minute in this.minute)&&Object.keys(this.minute).length!==60){p=p.plus({minute:1}),p=p.set({second:0});continue}if(p.toMillis()===x||!(p.second in this.second)&&Object.keys(this.second).length!==60){p=p.plus({second:1});continue}break}let{hour:a,minute:f}=p;p=Di.DateTime.fromFormat(`${p.year}-${p.month}-${p.day} ${p.hour}:${p.minute}:${p.second}`,"yyyy-M-d H:m:s",{zone:i});let v=Di.DateTime.fromFormat(`${p.year}-1-1 0:0:0`,"yyyy-M-d H:m:s",{zone:i});if((a!==p.hour||f!==p.minute)&&v.offset!==p.offset){while(p.minus({minute:1}).offset!==v.offset)p=p.minus({minute:1});return p}let $=p.minus({hour:1}),w=p.minus({hour:2});if(($.hour===p.hour||w.hour===$.hour)&&$>n)p=$;let J=p.minus({minute:30});if((J.minute===p.minute||$.minute===J.minute)&&J>n)p=J;return p}_wcOrAll(n){if(this._hasAll(n))return"*";let i=[];for(let o in this[n])i.push(o);return i.join(",")}_hasAll(n){let i=li.CONSTRAINTS[n],o=i[0],c=n===li.TIME_UNITS_MAP.DAY_OF_WEEK?i[1]-1:i[1];for(let p=o,x=c;p<x;p++)if(!(p in this[n]))return!1;return!0}_parse(n){var i;if(n=n.toLowerCase(),Object.keys(li.PRESETS).includes(n))n=li.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(li.ALIASES).includes(p))return li.ALIASES[p].toString();throw new _i.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<li.TIME_UNITS_LEN-1)throw new _i.CronError("Too few fields");if(o.length>li.TIME_UNITS_LEN)throw new _i.CronError("Too many fields");let c=o.length;for(let p of li.TIME_UNITS){let x=li.TIME_UNITS.indexOf(p),m=(i=o[x-(li.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:li.PARSE_DEFAULTS[p];this._parseField(m,p)}}_parseField(n,i){let o=this[i],c,p=li.CONSTRAINTS[i],x=p[0],m=p[1];n.split(",").forEach((v)=>{let $=v.indexOf("*");if($!==-1&&$!==0)throw new _i.CronError(`Field (${v}) has an invalid wildcard expression`)}),n=n.replace(li.RE_WILDCARDS,`${x}-${m}`);let f=n.split(",");for(let v of f){let $=[...v.matchAll(li.RE_RANGE)][0];if(($===null||$===void 0?void 0:$[1])!==void 0){let[,w,J,S]=$,X=parseInt(w,10),R=J!==void 0?parseInt(J,10):void 0,K=S!==void 0,M=parseInt(S!==null&&S!==void 0?S:"1",10);if(M===0)throw new _i.CronError(`Field (${i}) has a step of zero`);if(R!==void 0&&X>R)throw new _i.CronError(`Field (${i}) has an invalid range`);if(X<x||R!==void 0&&R>m||R===void 0&&X>m)throw new _i.CronError(`Field value (${n}) is out of range`);if(X=Math.min(Math.max(x,~~Math.abs(X)),m),R!==void 0)R=Math.min(m,~~Math.abs(R));else R=K?m:X;c=X;do o[c]=!0,c+=M;while(c<=R);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new _i.CronError(`Field (${i}) cannot be parsed`)}}}RJ.CronTime=av});var WJ=C((Rp)=>{var Nm=Rp&&Rp.__awaiter||function(n,i,o,c){function p(x){return x instanceof o?x:new o(function(m){m(x)})}return new(o||(o=Promise))(function(x,m){function a($){try{v(c.next($))}catch(w){m(w)}}function f($){try{v(c.throw($))}catch(w){m(w)}}function v($){$.done?x($.value):p($.value).then(a,f)}v((c=c.apply(n,i||[])).next())})};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.CronJob=void 0;var XJ=Kn("node:child_process"),fv=mv(),hm=Lm();class Mx{get isActive(){return this._isActive}get isCallbackRunning(){return this._isCallbackRunning}constructor(n,i,o,c,p,x,m,a,f,v,$){if(this.unrefTimeout=!1,this.lastExecution=null,this.runOnce=!1,this.waitForCompletion=!1,this._isActive=!1,this._isCallbackRunning=!1,this._callbacks=[],this.context=x!==null&&x!==void 0?x:this,this.waitForCompletion=Boolean(v),this.errorHandler=$,p!=null&&a!=null)throw new fv.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new hm.CronTime(n,p,null);else if(a!=null)this.cronTime=new hm.CronTime(n,null,a);else this.cronTime=new hm.CronTime(n,p,a);if(f!=null)this.unrefTimeout=f;if(o!=null)this.onComplete=this._fnWrap(o);if(this.cronTime.realDate)this.runOnce=!0;if(this.addCallback(this._fnWrap(i)),m)this.lastExecution=new Date,this.fireOnTick();if(c)this.start()}static from(n){if(n.timeZone!=null&&n.utcOffset!=null)throw new fv.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new Mx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else if(n.utcOffset!=null)return new Mx(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else return new Mx(n.cronTime,n.onTick,n.onComplete,n.start,n.timeZone,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler)}_fnWrap(n){var i,o;switch(typeof n){case"function":return n;case"string":{let[c,...p]=n.split(" ");return XJ.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return XJ.spawn.bind(void 0,n.command,(i=n.args)!==null&&i!==void 0?i:[],(o=n.options)!==null&&o!==void 0?o:{})}}addCallback(n){if(typeof n==="function")this._callbacks.push(n)}setTime(n){if(!(n instanceof hm.CronTime))throw new fv.CronError("time must be an instance of CronTime.");let i=this._isActive;if(this.stop(),this.cronTime=n,n.realDate)this.runOnce=!0;if(i)this.start()}nextDate(){return this.cronTime.sendAt()}fireOnTick(){return Nm(this,void 0,void 0,function*(){if(this.waitForCompletion&&this._isCallbackRunning)return;this._isCallbackRunning=!0;try{for(let n of this._callbacks){let i=n.call(this.context,this.onComplete);if(this.waitForCompletion)yield i}}catch(n){if(this.errorHandler!=null)this.errorHandler(n);else console.error("[Cron] error in callback",n)}finally{this._isCallbackRunning=!1}})}nextDates(n){return this.cronTime.sendAt(n!==null&&n!==void 0?n:0)}start(){if(this._isActive)return;let n=2147483647,i=this.cronTime.getTimeout(),o=0,c,p=(m)=>{if(c=Date.now(),this._timeout=setTimeout(x,m),this.unrefTimeout&&typeof this._timeout.unref==="function")this._timeout.unref()},x=()=>{let m=c+i-Date.now();if(m>0){let a=this.cronTime.getTimeout();if(a>m)a=m;o+=a}if(o){if(o>n)o-=n,i=n;else i=o,o=0;p(i)}else{if(this.lastExecution=new Date,this._isActive=!1,!this.runOnce)this.start();this.fireOnTick()}};if(i>=0){if(this._isActive=!0,i>n)o=i-n,i=n;p(i)}else this.stop()}lastDate(){return this.lastExecution}_executeOnComplete(){return Nm(this,void 0,void 0,function*(){if(typeof this.onComplete!=="function")return;try{yield this.onComplete.call(this.context)}catch(n){console.error("[Cron] error in onComplete callback:",n)}})}_waitForJobCompletion(){return Nm(this,void 0,void 0,function*(){while(this._isCallbackRunning)yield new Promise((n)=>setTimeout(n,100))})}stop(){if(this._timeout)clearTimeout(this._timeout);if(this._isActive=!1,!this.waitForCompletion){this._executeOnComplete();return}Promise.resolve().then(()=>Nm(this,void 0,void 0,function*(){yield this._waitForJobCompletion(),yield this._executeOnComplete()}))}}Rp.CronJob=Mx});var $v=C((Cm)=>{Object.defineProperty(Cm,"__esModule",{value:!0});Cm.validateCronExpression=Cm.timeout=Cm.sendAt=Cm.CronTime=Cm.CronJob=void 0;var vv=Lm(),HX=WJ();Object.defineProperty(Cm,"CronJob",{enumerable:!0,get:function(){return HX.CronJob}});var zX=Lm();Object.defineProperty(Cm,"CronTime",{enumerable:!0,get:function(){return zX.CronTime}});var QX=(n)=>new vv.CronTime(n).sendAt();Cm.sendAt=QX;var EX=(n)=>new vv.CronTime(n).getTimeout();Cm.timeout=EX;Cm.validateCronExpression=vv.CronTime.validateCronExpression});var FT=C((DD,Ov)=>{Ov.exports=AT;Ov.exports.preferredCharsets=AT;var NX=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function hX(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=CX(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function CX(n,i){var o=NX.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var a=x[m].trim().split("=");if(a[0]==="q"){p=parseFloat(a[1]);break}}}return{charset:c,q:p,i}}function IX(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=yX(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function yX(n,i,o){var c=0;if(i.charset.toLowerCase()===n.toLowerCase())c|=1;else if(i.charset!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function AT(n,i){var o=hX(n===void 0?"*":n||"");if(!i)return o.filter(JT).sort(wT).map(kX);var c=i.map(function p(x,m){return IX(x,o,m)});return c.filter(JT).sort(wT).map(function p(x){return i[c.indexOf(x)]})}function wT(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function kX(n){return n.charset}function JT(n){return n.q>0}});var WT=C((LD,Uv)=>{Uv.exports=XT;Uv.exports.preferredEncodings=XT;var ZX=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function qX(n){var i=n.split(","),o=!1,c=1;for(var p=0,x=0;p<i.length;p++){var m=sX(i[p].trim(),p);if(m)i[x++]=m,o=o||ST("identity",m),c=Math.min(c,m.q||1)}if(!o)i[x++]={encoding:"identity",q:c,i:p};return i.length=x,i}function sX(n,i){var o=ZX.exec(n);if(!o)return null;var c=o[1],p=1;if(o[2]){var x=o[2].split(";");for(var m=0;m<x.length;m++){var a=x[m].trim().split("=");if(a[0]==="q"){p=parseFloat(a[1]);break}}}return{encoding:c,q:p,i}}function PX(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=ST(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function ST(n,i,o){var c=0;if(i.encoding.toLowerCase()===n.toLowerCase())c|=1;else if(i.encoding!=="*")return null;return{i:o,o:i.i,q:i.q,s:c}}function XT(n,i){var o=qX(n||"");if(!i)return o.filter(RT).sort(TT).map(tX);var c=i.map(function p(x,m){return PX(x,o,m)});return c.filter(RT).sort(TT).map(function p(x){return i[c.indexOf(x)]})}function TT(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function tX(n){return n.encoding}function RT(n){return n.q>0}});var YT=C((ND,Vv)=>{Vv.exports=MT;Vv.exports.preferredLanguages=MT;var rX=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function dX(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=GT(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function GT(n,i){var o=rX.exec(n);if(!o)return null;var c=o[1],p=o[2],x=c;if(p)x+="-"+p;var m=1;if(o[3]){var a=o[3].split(";");for(var f=0;f<a.length;f++){var v=a[f].split("=");if(v[0]==="q")m=parseFloat(v[1])}}return{prefix:c,suffix:p,q:m,i,full:x}}function gX(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=eX(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function eX(n,i,o){var c=GT(n);if(!c)return null;var p=0;if(i.full.toLowerCase()===c.full.toLowerCase())p|=4;else if(i.prefix.toLowerCase()===c.full.toLowerCase())p|=2;else if(i.full.toLowerCase()===c.prefix.toLowerCase())p|=1;else if(i.full!=="*")return null;return{i:o,o:i.i,q:i.q,s:p}}function MT(n,i){var o=dX(n===void 0?"*":n||"");if(!i)return o.filter(lT).sort(KT).map(nW);var c=i.map(function p(x,m){return gX(x,o,m)});return c.filter(lT).sort(KT).map(function p(x){return i[c.indexOf(x)]})}function KT(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function nW(n){return n.full}function lT(n){return n.q>0}});var UT=C((hD,_v)=>{_v.exports=ET;_v.exports.preferredMediaTypes=ET;var iW=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function oW(n){var i=aW(n);for(var o=0,c=0;o<i.length;o++){var p=QT(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function QT(n,i){var o=iW.exec(n);if(!o)return null;var c=Object.create(null),p=1,x=o[2],m=o[1];if(o[3]){var a=fW(o[3]).map(mW);for(var f=0;f<a.length;f++){var v=a[f],$=v[0].toLowerCase(),w=v[1],J=w&&w[0]==='"'&&w[w.length-1]==='"'?w.substr(1,w.length-2):w;if($==="q"){p=parseFloat(J);break}c[$]=J}}return{type:m,subtype:x,params:c,q:p,i}}function cW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=pW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function pW(n,i,o){var c=QT(n),p=0;if(!c)return null;if(i.type.toLowerCase()==c.type.toLowerCase())p|=4;else if(i.type!="*")return null;if(i.subtype.toLowerCase()==c.subtype.toLowerCase())p|=2;else if(i.subtype!="*")return null;var x=Object.keys(i.params);if(x.length>0)if(x.every(function(m){return i.params[m]=="*"||(i.params[m]||"").toLowerCase()==(c.params[m]||"").toLowerCase()}))p|=1;else return null;return{i:o,o:i.i,q:i.q,s:p}}function ET(n,i){var o=oW(n===void 0?"*/*":n||"");if(!i)return o.filter(zT).sort(HT).map(xW);var c=i.map(function p(x,m){return cW(x,o,m)});return c.filter(zT).sort(HT).map(function p(x){return i[c.indexOf(x)]})}function HT(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function xW(n){return n.type+"/"+n.subtype}function zT(n){return n.q>0}function OT(n){var i=0,o=0;while((o=n.indexOf('"',o))!==-1)i++,o++;return i}function mW(n){var i=n.indexOf("="),o,c;if(i===-1)o=n;else o=n.substr(0,i),c=n.substr(i+1);return[o,c]}function aW(n){var i=n.split(",");for(var o=1,c=0;o<i.length;o++)if(OT(i[c])%2==0)i[++c]=i[o];else i[c]+=","+i[o];return i.length=c+1,i}function fW(n){var i=n.split(";");for(var o=1,c=0;o<i.length;o++)if(OT(i[c])%2==0)i[++c]=i[o];else i[c]+=";"+i[o];i.length=c+1;for(var o=0;o<i.length;o++)i[o]=i[o].trim();return i}});var VT=C((CD,bv)=>{/*!
6
6
  * negotiator
7
7
  * Copyright(c) 2012 Federico Romero
8
8
  * Copyright(c) 2012-2014 Isaac Z. Schlueter
9
9
  * Copyright(c) 2015 Douglas Christopher Wilson
10
10
  * MIT Licensed
11
- */var cX=fF(),pX=AF(),xX=SF(),mX=MF();_v.exports=Hn;_v.exports.Negotiator=Hn;function Hn(n){if(!(this instanceof Hn))return new Hn(n);this.request=n}Hn.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};Hn.prototype.charsets=function n(i){return cX(this.request.headers["accept-charset"],i)};Hn.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};Hn.prototype.encodings=function n(i){return pX(this.request.headers["accept-encoding"],i)};Hn.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};Hn.prototype.languages=function n(i){return xX(this.request.headers["accept-language"],i)};Hn.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};Hn.prototype.mediaTypes=function n(i){return mX(this.request.headers.accept,i)};Hn.prototype.preferredCharset=Hn.prototype.charset;Hn.prototype.preferredCharsets=Hn.prototype.charsets;Hn.prototype.preferredEncoding=Hn.prototype.encoding;Hn.prototype.preferredEncodings=Hn.prototype.encodings;Hn.prototype.preferredLanguage=Hn.prototype.language;Hn.prototype.preferredLanguages=Hn.prototype.languages;Hn.prototype.preferredMediaType=Hn.prototype.mediaType;Hn.prototype.preferredMediaTypes=Hn.prototype.mediaTypes});var zF=h((DL,aX)=>{aX.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var EF=h((LL,QF)=>{/*!
11
+ */var vW=FT(),$W=WT(),wW=YT(),JW=UT();bv.exports=Hn;bv.exports.Negotiator=Hn;function Hn(n){if(!(this instanceof Hn))return new Hn(n);this.request=n}Hn.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};Hn.prototype.charsets=function n(i){return vW(this.request.headers["accept-charset"],i)};Hn.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};Hn.prototype.encodings=function n(i){return $W(this.request.headers["accept-encoding"],i)};Hn.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};Hn.prototype.languages=function n(i){return wW(this.request.headers["accept-language"],i)};Hn.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};Hn.prototype.mediaTypes=function n(i){return JW(this.request.headers.accept,i)};Hn.prototype.preferredCharset=Hn.prototype.charset;Hn.prototype.preferredCharsets=Hn.prototype.charsets;Hn.prototype.preferredEncoding=Hn.prototype.encoding;Hn.prototype.preferredEncodings=Hn.prototype.encodings;Hn.prototype.preferredLanguage=Hn.prototype.language;Hn.prototype.preferredLanguages=Hn.prototype.languages;Hn.prototype.preferredMediaType=Hn.prototype.mediaType;Hn.prototype.preferredMediaTypes=Hn.prototype.mediaTypes});var _T=C((ID,AW)=>{AW.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var uT=C((yD,bT)=>{/*!
12
12
  * mime-db
13
13
  * Copyright(c) 2014 Jonathan Ong
14
14
  * Copyright(c) 2015-2022 Douglas Christopher Wilson
15
15
  * MIT Licensed
16
- */QF.exports=zF()});var BF=h((TX)=>{/*!
16
+ */bT.exports=_T()});var NT=C((KW)=>{/*!
17
17
  * mime-types
18
18
  * Copyright(c) 2014 Jonathan Ong
19
19
  * Copyright(c) 2015 Douglas Christopher Wilson
20
20
  * MIT Licensed
21
- */var aa=EF(),fX=Kn("path").extname,OF=/^\s*([^;\s]*)(?:;|\s|$)/,vX=/^text\//i;TX.charset=UF;TX.charsets={lookup:UF};TX.contentType=$X;TX.extension=wX;TX.extensions=Object.create(null);TX.lookup=JX;TX.types=Object.create(null);AX(TX.extensions,TX.types);function UF(n){if(!n||typeof n!=="string")return!1;var i=OF.exec(n),o=i&&aa[i[1].toLowerCase()];if(o&&o.charset)return o.charset;if(i&&vX.test(i[1]))return"UTF-8";return!1}function $X(n){if(!n||typeof n!=="string")return!1;var i=n.indexOf("/")===-1?TX.lookup(n):n;if(!i)return!1;if(i.indexOf("charset")===-1){var o=TX.charset(i);if(o)i+="; charset="+o.toLowerCase()}return i}function wX(n){if(!n||typeof n!=="string")return!1;var i=OF.exec(n),o=i&&TX.extensions[i[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]}function JX(n){if(!n||typeof n!=="string")return!1;var i=fX("x."+n).toLowerCase().substr(1);if(!i)return!1;return TX.types[i]||!1}function AX(n,i){var o=["nginx","apache",void 0,"iana"];Object.keys(aa).forEach(function c(p){var x=aa[p],m=x.extensions;if(!m||!m.length)return;n[p]=m;for(var a=0;a<m.length;a++){var f=m[a];if(i[f]){var v=o.indexOf(aa[i[f]].source),$=o.indexOf(x.source);if(i[f]!=="application/octet-stream"&&(v>$||v===$&&i[f].substr(0,12)==="application/"))continue}i[f]=p}})}});var fa=h((NL,bF)=>{/*!
21
+ */var fa=uT(),FW=Kn("node:path").extname,BT=/^\s*([^;\s]*)(?:;|\s|$)/,TW=/^text\//i;KW.charset=jT;KW.charsets={lookup:jT};KW.contentType=RW;KW.extension=SW;KW.extensions=Object.create(null);KW.lookup=XW;KW.types=Object.create(null);WW(KW.extensions,KW.types);function jT(n){if(!n||typeof n!=="string")return!1;var i=BT.exec(n),o=i&&fa[i[1].toLowerCase()];if(o&&o.charset)return o.charset;if(i&&TW.test(i[1]))return"UTF-8";return!1}function RW(n){if(!n||typeof n!=="string")return!1;var i=n.indexOf("/")===-1?KW.lookup(n):n;if(!i)return!1;if(i.indexOf("charset")===-1){var o=KW.charset(i);if(o)i+="; charset="+o.toLowerCase()}return i}function SW(n){if(!n||typeof n!=="string")return!1;var i=BT.exec(n),o=i&&KW.extensions[i[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]}function XW(n){if(!n||typeof n!=="string")return!1;var i=FW("x."+n).toLowerCase().substr(1);if(!i)return!1;return KW.types[i]||!1}function WW(n,i){var o=["nginx","apache",void 0,"iana"];Object.keys(fa).forEach(function c(p){var x=fa[p],m=x.extensions;if(!m||!m.length)return;n[p]=m;for(var a=0;a<m.length;a++){var f=m[a];if(i[f]){var v=o.indexOf(fa[i[f]].source),$=o.indexOf(x.source);if(i[f]!=="application/octet-stream"&&(v>$||v===$&&i[f].substr(0,12)==="application/"))continue}i[f]=p}})}});var va=C((ZD,hT)=>{/*!
22
22
  * accepts
23
23
  * Copyright(c) 2014 Jonathan Ong
24
24
  * Copyright(c) 2015 Douglas Christopher Wilson
25
25
  * MIT Licensed
26
- */var SX=HF(),XX=BF();bF.exports=Ni;function Ni(n){if(!(this instanceof Ni))return new Ni(n);this.headers=n.headers,this.negotiator=new SX(n)}Ni.prototype.type=Ni.prototype.types=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return i[0];var c=i.map(KX),p=this.negotiator.mediaTypes(c.filter(WX)),x=p[0];return x?i[c.indexOf(x)]:!1};Ni.prototype.encoding=Ni.prototype.encodings=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.encodings();return this.negotiator.encodings(i)[0]||!1};Ni.prototype.charset=Ni.prototype.charsets=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.charsets();return this.negotiator.charsets(i)[0]||!1};Ni.prototype.lang=Ni.prototype.langs=Ni.prototype.language=Ni.prototype.languages=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.languages();return this.negotiator.languages(i)[0]||!1};function KX(n){return n.indexOf("/")===-1?XX.lookup(n):n}function WX(n){return typeof n==="string"}});var Dv=h((jF,DF)=>{/*!
26
+ */var YW=VT(),HW=NT();hT.exports=hi;function hi(n){if(!(this instanceof hi))return new hi(n);this.headers=n.headers,this.negotiator=new YW(n)}hi.prototype.type=hi.prototype.types=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return i[0];var c=i.map(zW),p=this.negotiator.mediaTypes(c.filter(QW)),x=p[0];return x?i[c.indexOf(x)]:!1};hi.prototype.encoding=hi.prototype.encodings=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.encodings();return this.negotiator.encodings(i)[0]||!1};hi.prototype.charset=hi.prototype.charsets=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.charsets();return this.negotiator.charsets(i)[0]||!1};hi.prototype.lang=hi.prototype.langs=hi.prototype.language=hi.prototype.languages=function(n){var i=n;if(i&&!Array.isArray(i)){i=new Array(arguments.length);for(var o=0;o<i.length;o++)i[o]=arguments[o]}if(!i||i.length===0)return this.negotiator.languages();return this.negotiator.languages(i)[0]||!1};function zW(n){return n.indexOf("/")===-1?HW.lookup(n):n}function QW(n){return typeof n==="string"}});var Dv=C((CT,IT)=>{/*!
27
27
  * base64id v0.1.0
28
- */var _x=Kn("crypto"),jv=function(){};jv.prototype.getRandomBytes=function(n){var i=4096,o=this;if(n=n||12,n>i)return _x.randomBytes(n);var c=parseInt(i/n),p=parseInt(c*0.85);if(!p)return _x.randomBytes(n);if(this.bytesBufferIndex==null)this.bytesBufferIndex=-1;if(this.bytesBufferIndex==c)this.bytesBuffer=null,this.bytesBufferIndex=-1;if(this.bytesBufferIndex==-1||this.bytesBufferIndex>p){if(!this.isGeneratingBytes)this.isGeneratingBytes=!0,_x.randomBytes(i,function(m,a){o.bytesBuffer=a,o.bytesBufferIndex=0,o.isGeneratingBytes=!1});if(this.bytesBufferIndex==-1)return _x.randomBytes(n)}var x=this.bytesBuffer.slice(n*this.bytesBufferIndex,n*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,x};jv.prototype.generateId=function(){var n=Buffer.alloc(15);if(!n.writeInt32BE)return Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString();if(this.sequenceNumber=this.sequenceNumber+1|0,n.writeInt32BE(this.sequenceNumber,11),_x.randomBytes)this.getRandomBytes(12).copy(n);else[0,4,8].forEach(function(i){n.writeInt32BE(Math.random()*Math.pow(2,32)|0,i)});return n.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")};jF=DF.exports=new jv});var va=h((uF)=>{Object.defineProperty(uF,"__esModule",{value:!0});uF.ERROR_PACKET=uF.PACKET_TYPES_REVERSE=uF.PACKET_TYPES=void 0;var Ho=Object.create(null);uF.PACKET_TYPES=Ho;Ho.open="0";Ho.close="1";Ho.ping="2";Ho.pong="3";Ho.message="4";Ho.upgrade="5";Ho.noop="6";var LF=Object.create(null);uF.PACKET_TYPES_REVERSE=LF;Object.keys(Ho).forEach((n)=>{LF[Ho[n]]=n});var GX={type:"error",data:"parser error"};uF.ERROR_PACKET=GX});var IF=h((CF)=>{Object.defineProperty(CF,"__esModule",{value:!0});CF.encodePacket=void 0;CF.encodePacketToBinary=QX;var HX=va(),zX=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+hF(i,!0).toString("base64"));return c(HX.PACKET_TYPES[n]+(i||""))};CF.encodePacket=zX;var hF=(n,i)=>{if(Buffer.isBuffer(n)||n instanceof Uint8Array&&!i)return n;else if(n instanceof ArrayBuffer)return Buffer.from(n);else return Buffer.from(n.buffer,n.byteOffset,n.byteLength)},Lv;function QX(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(hF(n.data,!1));CF.encodePacket(n,!0,(o)=>{if(!Lv)Lv=new TextEncoder;i(Lv.encode(o))})}});var sF=h((kF)=>{Object.defineProperty(kF,"__esModule",{value:!0});kF.decodePacket=void 0;var $a=va(),OX=(n,i)=>{if(typeof n!=="string")return{type:"message",data:yF(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:yF(c,i)}}if(!$a.PACKET_TYPES_REVERSE[o])return $a.ERROR_PACKET;return n.length>1?{type:$a.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:$a.PACKET_TYPES_REVERSE[o]}};kF.decodePacket=OX;var yF=(n,i)=>{switch(i){case"arraybuffer":if(n instanceof ArrayBuffer)return n;else if(Buffer.isBuffer(n))return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);else return n.buffer;case"nodebuffer":default:if(Buffer.isBuffer(n))return n;else return Buffer.from(n)}}});var Bx=h((Aa)=>{Object.defineProperty(Aa,"__esModule",{value:!0});Aa.decodePayload=Aa.decodePacket=Aa.encodePayload=Aa.encodePacket=Aa.protocol=void 0;Aa.createPacketEncoderStream=_X;Aa.createPacketDecoderStream=BX;var hv=IF();Object.defineProperty(Aa,"encodePacket",{enumerable:!0,get:function(){return hv.encodePacket}});var Cv=sF();Object.defineProperty(Aa,"decodePacket",{enumerable:!0,get:function(){return Cv.decodePacket}});var qF=va(),PF=String.fromCharCode(30),UX=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((x,m)=>{hv.encodePacket(x,!1,(a)=>{if(c[m]=a,++p===o)i(c.join(PF))})})};Aa.encodePayload=UX;var VX=(n,i)=>{let o=n.split(PF),c=[];for(let p=0;p<o.length;p++){let x=Cv.decodePacket(o[p],i);if(c.push(x),x.type==="error")break}return c};Aa.decodePayload=VX;function _X(){return new TransformStream({transform(n,i){hv.encodePacketToBinary(n,(o)=>{let c=o.length,p;if(c<126)p=new Uint8Array(1),new DataView(p.buffer).setUint8(0,c);else if(c<65536){p=new Uint8Array(3);let x=new DataView(p.buffer);x.setUint8(0,126),x.setUint16(1,c)}else{p=new Uint8Array(9);let x=new DataView(p.buffer);x.setUint8(0,127),x.setBigUint64(1,BigInt(c))}if(n.data&&typeof n.data!=="string")p[0]|=128;i.enqueue(p),i.enqueue(o)})}})}var Nv;function wa(n){return n.reduce((i,o)=>i+o.length,0)}function Ja(n,i){if(n[0].length===i)return n.shift();let o=new Uint8Array(i),c=0;for(let p=0;p<i;p++)if(o[p]=n[0][c++],c===n[0].length)n.shift(),c=0;if(n.length&&c<n[0].length)n[0]=n[0].slice(c);return o}function BX(n,i){if(!Nv)Nv=new TextDecoder;let o=[],c=0,p=-1,x=!1;return new TransformStream({transform(m,a){o.push(m);while(!0){if(c===0){if(wa(o)<1)break;let f=Ja(o,1);if(x=(f[0]&128)===128,p=f[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(wa(o)<2)break;let f=Ja(o,2);p=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),c=3}else if(c===2){if(wa(o)<8)break;let f=Ja(o,8),v=new DataView(f.buffer,f.byteOffset,f.length),$=v.getUint32(0);if($>Math.pow(2,21)-1){a.enqueue(qF.ERROR_PACKET);break}p=$*Math.pow(2,32)+v.getUint32(4),c=3}else{if(wa(o)<p)break;let f=Ja(o,p);a.enqueue(Cv.decodePacket(x?f:Nv.decode(f),i)),c=0}if(p===0||p>n){a.enqueue(qF.ERROR_PACKET);break}}}})}Aa.protocol=4});var eF=h((sL,dF)=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var oc=String.fromCharCode;function rF(n){var i=[],o=0,c=n.length,p,x;while(o<c)if(p=n.charCodeAt(o++),p>=55296&&p<=56319&&o<c)if(x=n.charCodeAt(o++),(x&64512)==56320)i.push(((p&1023)<<10)+(x&1023)+65536);else i.push(p),o--;else i.push(p);return i}function uX(n){var i=n.length,o=-1,c,p="";while(++o<i){if(c=n[o],c>65535)c-=65536,p+=oc(c>>>10&1023|55296),c=56320|c&1023;p+=oc(c)}return p}function gF(n,i){if(n>=55296&&n<=57343){if(i)throw Error("Lone surrogate U+"+n.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Iv(n,i){return oc(n>>i&63|128)}function NX(n,i){if((n&4294967168)==0)return oc(n);var o="";if((n&4294965248)==0)o=oc(n>>6&31|192);else if((n&4294901760)==0){if(!gF(n,i))n=65533;o=oc(n>>12&15|224),o+=Iv(n,6)}else if((n&4292870144)==0)o=oc(n>>18&7|240),o+=Iv(n,12),o+=Iv(n,6);return o+=oc(n&63|128),o}function hX(n,i){i=i||{};var o=i.strict!==!1,c=rF(n),p=c.length,x=-1,m,a="";while(++x<p)m=c[x],a+=NX(m,o);return a}function Sp(){if(cc>=Fa)throw Error("Invalid byte index");var n=Ta[cc]&255;if(cc++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function CX(n){var i,o,c,p,x;if(cc>Fa)throw Error("Invalid byte index");if(cc==Fa)return!1;if(i=Ta[cc]&255,cc++,(i&128)==0)return i;if((i&224)==192)if(o=Sp(),x=(i&31)<<6|o,x>=128)return x;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Sp(),c=Sp(),x=(i&15)<<12|o<<6|c,x>=2048)return gF(x,n)?x:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Sp(),c=Sp(),p=Sp(),x=(i&7)<<18|o<<12|c<<6|p,x>=65536&&x<=1114111)return x}throw Error("Invalid UTF-8 detected")}var Ta,Fa,cc;function IX(n,i){i=i||{};var o=i.strict!==!1;Ta=rF(n),Fa=Ta.length,cc=0;var c=[],p;while((p=CX(o))!==!1)c.push(p);return uX(c)}dF.exports={version:"2.1.2",encode:hX,decode:IX}});var f4=h((a4)=>{Object.defineProperty(a4,"__esModule",{value:!0});a4.packets=a4.protocol=void 0;a4.encodePacket=yv;a4.encodeBase64Packet=o4;a4.decodePacket=kv;a4.decodeBase64Packet=c4;a4.encodePayload=sX;a4.decodePayload=PX;a4.encodePayloadAsBinary=x4;a4.decodePayloadAsBinary=m4;var i4=eF();a4.protocol=3;var yX=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};a4.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Xp=Object.keys(a4.packets),vo={type:"error",data:"parser error"},kX=Buffer.concat([]);function yv(n,i,o,c){if(typeof i==="function")c=i,i=null;if(typeof o==="function")c=o,o=null;if(Buffer.isBuffer(n.data))return n4(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return n4({type:n.type,data:Zv(n.data)},i,c);var p=a4.packets[n.type];if(n.data!==void 0)p+=o?i4.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function n4(n,i,o){if(!i)return o4(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=a4.packets[n.type],o(Buffer.concat([p,c]))}function o4(n,i){var o=Buffer.isBuffer(n.data)?n.data:Zv(n.data),c="b"+a4.packets[n.type];return c+=o.toString("base64"),i(c)}function kv(n,i,o){if(n===void 0)return vo;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return c4(n.slice(1),i);if(o){if(n=ZX(n),n===!1)return vo}if(Number(c)!=c||!Xp[c])return vo;if(n.length>1)return{type:Xp[c],data:n.slice(1)};else return{type:Xp[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Xp[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=Zv(n);return c=n[0],{type:Xp[c],data:n.slice(1)}}function ZX(n){try{n=i4.decode(n,{strict:!1})}catch(i){return!1}return n}function c4(n,i){var o=Xp[n.charAt(0)],c=Buffer.from(n.slice(1),"base64");if(i==="arraybuffer"){var p=new Uint8Array(c.length);for(var x=0;x<p.length;x++)p[x]=c[x];c=p.buffer}return{type:o,data:c}}function sX(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&yX(n))return x4(n,o);if(!n.length)return o("0:");function c(p,x){yv(p,i,!1,function(m){x(null,qX(m))})}p4(n,c,function(p,x){return o(x.join(""))})}function qX(n){return n.length+":"+n}function p4(n,i,o){let c=new Array(n.length),p=0;for(let x=0;x<n.length;x++)i(n[x],(m,a)=>{if(c[x]=a,++p===n.length)o(null,c)})}function PX(n,i,o){if(typeof n!=="string")return m4(n,i,o);if(typeof i==="function")o=i,i=null;if(n==="")return o(vo,0,1);var c="",p,x,m;for(var a=0,f=n.length;a<f;a++){var v=n.charAt(a);if(v!==":"){c+=v;continue}if(c===""||c!=(p=Number(c)))return o(vo,0,1);if(x=n.slice(a+1,a+1+p),c!=x.length)return o(vo,0,1);if(x.length){if(m=kv(x,i,!1),vo.type===m.type&&vo.data===m.data)return o(vo,0,1);var $=o(m,a+p,f);if($===!1)return}a+=p,c=""}if(c!=="")return o(vo,0,1)}function tX(n){var i="";for(var o=0,c=n.length;o<c;o++)i+=String.fromCharCode(n[o]);return i}function rX(n){var i=Buffer.allocUnsafe(n.length);for(var o=0,c=n.length;o<c;o++)i.writeUInt8(n.charCodeAt(o),o);return i}function Zv(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function x4(n,i){if(!n.length)return i(kX);p4(n,gX,function(o,c){return i(Buffer.concat(c))})}function gX(n,i){function o(c){var p=""+c.length,x;if(typeof c==="string"){x=Buffer.allocUnsafe(p.length+2),x[0]=0;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);return x[x.length-1]=255,i(null,Buffer.concat([x,rX(c)]))}x=Buffer.allocUnsafe(p.length+2),x[0]=1;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);x[x.length-1]=255,i(null,Buffer.concat([x,c]))}yv(n,!0,!0,o)}function m4(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],x;while(c.length>0){var m="",a=c[0]===0;for(x=1;;x++){if(c[x]===255)break;if(m.length>310)return o(vo,0,1);m+=""+c[x]}c=c.slice(m.length+1);var f=parseInt(m,10),v=c.slice(1,f+1);if(a)v=tX(v);p.push(v),c=c.slice(f+1)}var $=p.length;for(x=0;x<$;x++){var w=p[x];o(kv(w,i,!0),x,$)}}});var $4=h((PL,v4)=>{var Wp=1000,Gp=Wp*60,Yp=Gp*60,Uc=Yp*24,aK=Uc*7,fK=Uc*365.25;v4.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return vK(n);else if(o==="number"&&isFinite(n))return i.long?wK(n):$K(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function vK(n){if(n=String(n),n.length>100)return;var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!i)return;var o=parseFloat(i[1]),c=(i[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return o*fK;case"weeks":case"week":case"w":return o*aK;case"days":case"day":case"d":return o*Uc;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Yp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Gp;case"seconds":case"second":case"secs":case"sec":case"s":return o*Wp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function $K(n){var i=Math.abs(n);if(i>=Uc)return Math.round(n/Uc)+"d";if(i>=Yp)return Math.round(n/Yp)+"h";if(i>=Gp)return Math.round(n/Gp)+"m";if(i>=Wp)return Math.round(n/Wp)+"s";return n+"ms"}function wK(n){var i=Math.abs(n);if(i>=Uc)return Ra(n,i,Uc,"day");if(i>=Yp)return Ra(n,i,Yp,"hour");if(i>=Gp)return Ra(n,i,Gp,"minute");if(i>=Wp)return Ra(n,i,Wp,"second");return n+" ms"}function Ra(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var sv=h((tL,w4)=>{function JK(n){o.debug=o,o.default=o,o.coerce=f,o.disable=x,o.enable=p,o.enabled=m,o.humanize=$4(),o.destroy=v,Object.keys(n).forEach(($)=>{o[$]=n[$]}),o.names=[],o.skips=[],o.formatters={};function i($){let w=0;for(let J=0;J<$.length;J++)w=(w<<5)-w+$.charCodeAt(J),w|=0;return o.colors[Math.abs(w)%o.colors.length]}o.selectColor=i;function o($){let w,J=null,l,S;function R(...K){if(!R.enabled)return;let Y=R,M=Number(new Date),I=M-(w||M);if(Y.diff=I,Y.prev=w,Y.curr=M,w=M,K[0]=o.coerce(K[0]),typeof K[0]!=="string")K.unshift("%O");let G=0;K[0]=K[0].replace(/%([a-zA-Z%])/g,(E,Q)=>{if(E==="%%")return"%";G++;let B=o.formatters[Q];if(typeof B==="function"){let y=K[G];E=B.call(Y,y),K.splice(G,1),G--}return E}),o.formatArgs.call(Y,K),(Y.log||o.log).apply(Y,K)}if(R.namespace=$,R.useColors=o.useColors(),R.color=o.selectColor($),R.extend=c,R.destroy=o.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(J!==null)return J;if(l!==o.namespaces)l=o.namespaces,S=o.enabled($);return S},set:(K)=>{J=K}}),typeof o.init==="function")o.init(R);return R}function c($,w){let J=o(this.namespace+(typeof w==="undefined"?":":w)+$);return J.log=this.log,J}function p($){o.save($),o.namespaces=$,o.names=[],o.skips=[];let w,J=(typeof $==="string"?$:"").split(/[\s,]+/),l=J.length;for(w=0;w<l;w++){if(!J[w])continue;if($=J[w].replace(/\*/g,".*?"),$[0]==="-")o.skips.push(new RegExp("^"+$.slice(1)+"$"));else o.names.push(new RegExp("^"+$+"$"))}}function x(){let $=[...o.names.map(a),...o.skips.map(a).map((w)=>"-"+w)].join(",");return o.enable(""),$}function m($){if($[$.length-1]==="*")return!0;let w,J;for(w=0,J=o.skips.length;w<J;w++)if(o.skips[w].test($))return!1;for(w=0,J=o.names.length;w<J;w++)if(o.names[w].test($))return!0;return!1}function a($){return $.toString().substring(2,$.toString().length-2).replace(/\.\*\?$/,"*")}function f($){if($ instanceof Error)return $.stack||$.message;return $}function v(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}w4.exports=JK});var A4=h((J4,Sa)=>{J4.formatArgs=TK;J4.save=FK;J4.load=RK;J4.useColors=AK;J4.storage=lK();J4.destroy=(()=>{let n=!1;return()=>{if(!n)n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();J4.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function AK(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function TK(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Sa.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;n.splice(1,0,i,"color: inherit");let o=0,c=0;n[0].replace(/%[a-zA-Z%]/g,(p)=>{if(p==="%%")return;if(o++,p==="%c")c=o}),n.splice(c,0,i)}J4.log=console.debug||console.log||(()=>{});function FK(n){try{if(n)J4.storage.setItem("debug",n);else J4.storage.removeItem("debug")}catch(i){}}function RK(){let n;try{n=J4.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function lK(){try{return localStorage}catch(n){}}Sa.exports=sv()(J4);var{formatters:SK}=Sa.exports;SK.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var F4=h((gL,T4)=>{T4.exports=(n,i=process.argv)=>{let o=n.startsWith("-")?"":n.length===1?"-":"--",c=i.indexOf(o+n),p=i.indexOf("--");return c!==-1&&(p===-1||c<p)}});var S4=h((dL,l4)=>{var zK=Kn("os"),R4=Kn("tty"),gi=F4(),{env:ai}=process,Xa;if(gi("no-color")||gi("no-colors")||gi("color=false")||gi("color=never"))Xa=0;else if(gi("color")||gi("colors")||gi("color=true")||gi("color=always"))Xa=1;function QK(){if("FORCE_COLOR"in ai){if(ai.FORCE_COLOR==="true")return 1;if(ai.FORCE_COLOR==="false")return 0;return ai.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ai.FORCE_COLOR,10),3)}}function EK(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function OK(n,{streamIsTTY:i,sniffFlags:o=!0}={}){let c=QK();if(c!==void 0)Xa=c;let p=o?Xa:c;if(p===0)return 0;if(o){if(gi("color=16m")||gi("color=full")||gi("color=truecolor"))return 3;if(gi("color=256"))return 2}if(n&&!i&&p===void 0)return 0;let x=p||0;if(ai.TERM==="dumb")return x;if(process.platform==="win32"){let m=zK.release().split(".");if(Number(m[0])>=10&&Number(m[2])>=10586)return Number(m[2])>=14931?3:2;return 1}if("CI"in ai){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((m)=>(m in ai))||ai.CI_NAME==="codeship")return 1;return x}if("TEAMCITY_VERSION"in ai)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ai.TEAMCITY_VERSION)?1:0;if(ai.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ai){let m=Number.parseInt((ai.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ai.TERM_PROGRAM){case"iTerm.app":return m>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(ai.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ai.TERM))return 1;if("COLORTERM"in ai)return 1;return x}function qv(n,i={}){let o=OK(n,{streamIsTTY:n&&n.isTTY,...i});return EK(o)}l4.exports={supportsColor:qv,stdout:qv({isTTY:R4.isatty(1)}),stderr:qv({isTTY:R4.isatty(2)})}});var G4=h((K4,Wa)=>{var UK=Kn("tty"),Ka=Kn("util");K4.init=LK;K4.log=bK;K4.formatArgs=_K;K4.save=jK;K4.load=DK;K4.useColors=VK;K4.destroy=Ka.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");K4.colors=[6,2,3,4,5,1];try{let n=S4();if(n&&(n.stderr||n).level>=2)K4.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(n){}K4.inspectOpts=Object.keys(process.env).filter((n)=>{return/^debug_/i.test(n)}).reduce((n,i)=>{let o=i.substring(6).toLowerCase().replace(/_([a-z])/g,(p,x)=>{return x.toUpperCase()}),c=process.env[i];if(/^(yes|on|true|enabled)$/i.test(c))c=!0;else if(/^(no|off|false|disabled)$/i.test(c))c=!1;else if(c==="null")c=null;else c=Number(c);return n[o]=c,n},{});function VK(){return"colors"in K4.inspectOpts?Boolean(K4.inspectOpts.colors):UK.isatty(process.stderr.fd)}function _K(n){let{namespace:i,useColors:o}=this;if(o){let c=this.color,p="\x1B[3"+(c<8?c:"8;5;"+c),x=` ${p};1m${i} \x1B[0m`;n[0]=x+n[0].split(`
28
+ */var bx=Kn("node:crypto"),jv=function(){};jv.prototype.getRandomBytes=function(n){var i=4096,o=this;if(n=n||12,n>i)return bx.randomBytes(n);var c=parseInt(i/n),p=parseInt(c*0.85);if(!p)return bx.randomBytes(n);if(this.bytesBufferIndex==null)this.bytesBufferIndex=-1;if(this.bytesBufferIndex==c)this.bytesBuffer=null,this.bytesBufferIndex=-1;if(this.bytesBufferIndex==-1||this.bytesBufferIndex>p){if(!this.isGeneratingBytes)this.isGeneratingBytes=!0,bx.randomBytes(i,function(m,a){o.bytesBuffer=a,o.bytesBufferIndex=0,o.isGeneratingBytes=!1});if(this.bytesBufferIndex==-1)return bx.randomBytes(n)}var x=this.bytesBuffer.slice(n*this.bytesBufferIndex,n*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,x};jv.prototype.generateId=function(){var n=Buffer.alloc(15);if(!n.writeInt32BE)return Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString();if(this.sequenceNumber=this.sequenceNumber+1|0,n.writeInt32BE(this.sequenceNumber,11),bx.randomBytes)this.getRandomBytes(12).copy(n);else[0,4,8].forEach(function(i){n.writeInt32BE(Math.random()*Math.pow(2,32)|0,i)});return n.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")};CT=IT.exports=new jv});var $a=C((kT)=>{Object.defineProperty(kT,"__esModule",{value:!0});kT.ERROR_PACKET=kT.PACKET_TYPES_REVERSE=kT.PACKET_TYPES=void 0;var Ho=Object.create(null);kT.PACKET_TYPES=Ho;Ho.open="0";Ho.close="1";Ho.ping="2";Ho.pong="3";Ho.message="4";Ho.upgrade="5";Ho.noop="6";var yT=Object.create(null);kT.PACKET_TYPES_REVERSE=yT;Object.keys(Ho).forEach((n)=>{yT[Ho[n]]=n});var EW={type:"error",data:"parser error"};kT.ERROR_PACKET=EW});var PT=C((sT)=>{Object.defineProperty(sT,"__esModule",{value:!0});sT.encodePacket=void 0;sT.encodePacketToBinary=bW;var VW=$a(),_W=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+qT(i,!0).toString("base64"));return c(VW.PACKET_TYPES[n]+(i||""))};sT.encodePacket=_W;var qT=(n,i)=>{if(Buffer.isBuffer(n)||n instanceof Uint8Array&&!i)return n;else if(n instanceof ArrayBuffer)return Buffer.from(n);else return Buffer.from(n.buffer,n.byteOffset,n.byteLength)},Lv;function bW(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(qT(n.data,!1));sT.encodePacket(n,!0,(o)=>{if(!Lv)Lv=new TextEncoder;i(Lv.encode(o))})}});var gT=C((rT)=>{Object.defineProperty(rT,"__esModule",{value:!0});rT.decodePacket=void 0;var wa=$a(),BW=(n,i)=>{if(typeof n!=="string")return{type:"message",data:tT(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:tT(c,i)}}if(!wa.PACKET_TYPES_REVERSE[o])return wa.ERROR_PACKET;return n.length>1?{type:wa.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:wa.PACKET_TYPES_REVERSE[o]}};rT.decodePacket=BW;var tT=(n,i)=>{switch(i){case"arraybuffer":if(n instanceof ArrayBuffer)return n;else if(Buffer.isBuffer(n))return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);else return n.buffer;case"nodebuffer":default:if(Buffer.isBuffer(n))return n;else return Buffer.from(n)}}});var ux=C((Fa)=>{Object.defineProperty(Fa,"__esModule",{value:!0});Fa.decodePayload=Fa.decodePacket=Fa.encodePayload=Fa.encodePacket=Fa.protocol=void 0;Fa.createPacketEncoderStream=LW;Fa.createPacketDecoderStream=NW;var Cv=PT();Object.defineProperty(Fa,"encodePacket",{enumerable:!0,get:function(){return Cv.encodePacket}});var Iv=gT();Object.defineProperty(Fa,"decodePacket",{enumerable:!0,get:function(){return Iv.decodePacket}});var eT=$a(),n4=String.fromCharCode(30),jW=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((x,m)=>{Cv.encodePacket(x,!1,(a)=>{if(c[m]=a,++p===o)i(c.join(n4))})})};Fa.encodePayload=jW;var DW=(n,i)=>{let o=n.split(n4),c=[];for(let p=0;p<o.length;p++){let x=Iv.decodePacket(o[p],i);if(c.push(x),x.type==="error")break}return c};Fa.decodePayload=DW;function LW(){return new TransformStream({transform(n,i){Cv.encodePacketToBinary(n,(o)=>{let c=o.length,p;if(c<126)p=new Uint8Array(1),new DataView(p.buffer).setUint8(0,c);else if(c<65536){p=new Uint8Array(3);let x=new DataView(p.buffer);x.setUint8(0,126),x.setUint16(1,c)}else{p=new Uint8Array(9);let x=new DataView(p.buffer);x.setUint8(0,127),x.setBigUint64(1,BigInt(c))}if(n.data&&typeof n.data!=="string")p[0]|=128;i.enqueue(p),i.enqueue(o)})}})}var hv;function Ja(n){return n.reduce((i,o)=>i+o.length,0)}function Aa(n,i){if(n[0].length===i)return n.shift();let o=new Uint8Array(i),c=0;for(let p=0;p<i;p++)if(o[p]=n[0][c++],c===n[0].length)n.shift(),c=0;if(n.length&&c<n[0].length)n[0]=n[0].slice(c);return o}function NW(n,i){if(!hv)hv=new TextDecoder;let o=[],c=0,p=-1,x=!1;return new TransformStream({transform(m,a){o.push(m);while(!0){if(c===0){if(Ja(o)<1)break;let f=Aa(o,1);if(x=(f[0]&128)===128,p=f[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(Ja(o)<2)break;let f=Aa(o,2);p=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),c=3}else if(c===2){if(Ja(o)<8)break;let f=Aa(o,8),v=new DataView(f.buffer,f.byteOffset,f.length),$=v.getUint32(0);if($>Math.pow(2,21)-1){a.enqueue(eT.ERROR_PACKET);break}p=$*Math.pow(2,32)+v.getUint32(4),c=3}else{if(Ja(o)<p)break;let f=Aa(o,p);a.enqueue(Iv.decodePacket(x?f:hv.decode(f),i)),c=0}if(p===0||p>n){a.enqueue(eT.ERROR_PACKET);break}}}})}Fa.protocol=4});var x4=C((gD,p4)=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var oc=String.fromCharCode;function o4(n){var i=[],o=0,c=n.length,p,x;while(o<c)if(p=n.charCodeAt(o++),p>=55296&&p<=56319&&o<c)if(x=n.charCodeAt(o++),(x&64512)==56320)i.push(((p&1023)<<10)+(x&1023)+65536);else i.push(p),o--;else i.push(p);return i}function kW(n){var i=n.length,o=-1,c,p="";while(++o<i){if(c=n[o],c>65535)c-=65536,p+=oc(c>>>10&1023|55296),c=56320|c&1023;p+=oc(c)}return p}function c4(n,i){if(n>=55296&&n<=57343){if(i)throw Error("Lone surrogate U+"+n.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function yv(n,i){return oc(n>>i&63|128)}function ZW(n,i){if((n&4294967168)==0)return oc(n);var o="";if((n&4294965248)==0)o=oc(n>>6&31|192);else if((n&4294901760)==0){if(!c4(n,i))n=65533;o=oc(n>>12&15|224),o+=yv(n,6)}else if((n&4292870144)==0)o=oc(n>>18&7|240),o+=yv(n,12),o+=yv(n,6);return o+=oc(n&63|128),o}function qW(n,i){i=i||{};var o=i.strict!==!1,c=o4(n),p=c.length,x=-1,m,a="";while(++x<p)m=c[x],a+=ZW(m,o);return a}function Xp(){if(cc>=Ra)throw Error("Invalid byte index");var n=Ta[cc]&255;if(cc++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function sW(n){var i,o,c,p,x;if(cc>Ra)throw Error("Invalid byte index");if(cc==Ra)return!1;if(i=Ta[cc]&255,cc++,(i&128)==0)return i;if((i&224)==192)if(o=Xp(),x=(i&31)<<6|o,x>=128)return x;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Xp(),c=Xp(),x=(i&15)<<12|o<<6|c,x>=2048)return c4(x,n)?x:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Xp(),c=Xp(),p=Xp(),x=(i&7)<<18|o<<12|c<<6|p,x>=65536&&x<=1114111)return x}throw Error("Invalid UTF-8 detected")}var Ta,Ra,cc;function PW(n,i){i=i||{};var o=i.strict!==!1;Ta=o4(n),Ra=Ta.length,cc=0;var c=[],p;while((p=sW(o))!==!1)c.push(p);return kW(c)}p4.exports={version:"2.1.2",encode:qW,decode:PW}});var F4=C((A4)=>{Object.defineProperty(A4,"__esModule",{value:!0});A4.packets=A4.protocol=void 0;A4.encodePacket=kv;A4.encodeBase64Packet=f4;A4.decodePacket=Zv;A4.decodeBase64Packet=v4;A4.encodePayload=gW;A4.decodePayload=nK;A4.encodePayloadAsBinary=w4;A4.decodePayloadAsBinary=J4;var a4=x4();A4.protocol=3;var tW=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};A4.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Wp=Object.keys(A4.packets),$o={type:"error",data:"parser error"},rW=Buffer.concat([]);function kv(n,i,o,c){if(typeof i==="function")c=i,i=null;if(typeof o==="function")c=o,o=null;if(Buffer.isBuffer(n.data))return m4(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return m4({type:n.type,data:qv(n.data)},i,c);var p=A4.packets[n.type];if(n.data!==void 0)p+=o?a4.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function m4(n,i,o){if(!i)return f4(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=A4.packets[n.type],o(Buffer.concat([p,c]))}function f4(n,i){var o=Buffer.isBuffer(n.data)?n.data:qv(n.data),c="b"+A4.packets[n.type];return c+=o.toString("base64"),i(c)}function Zv(n,i,o){if(n===void 0)return $o;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return v4(n.slice(1),i);if(o){if(n=dW(n),n===!1)return $o}if(Number(c)!=c||!Wp[c])return $o;if(n.length>1)return{type:Wp[c],data:n.slice(1)};else return{type:Wp[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Wp[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=qv(n);return c=n[0],{type:Wp[c],data:n.slice(1)}}function dW(n){try{n=a4.decode(n,{strict:!1})}catch(i){return!1}return n}function v4(n,i){var o=Wp[n.charAt(0)],c=Buffer.from(n.slice(1),"base64");if(i==="arraybuffer"){var p=new Uint8Array(c.length);for(var x=0;x<p.length;x++)p[x]=c[x];c=p.buffer}return{type:o,data:c}}function gW(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&tW(n))return w4(n,o);if(!n.length)return o("0:");function c(p,x){kv(p,i,!1,function(m){x(null,eW(m))})}$4(n,c,function(p,x){return o(x.join(""))})}function eW(n){return n.length+":"+n}function $4(n,i,o){let c=new Array(n.length),p=0;for(let x=0;x<n.length;x++)i(n[x],(m,a)=>{if(c[x]=a,++p===n.length)o(null,c)})}function nK(n,i,o){if(typeof n!=="string")return J4(n,i,o);if(typeof i==="function")o=i,i=null;if(n==="")return o($o,0,1);var c="",p,x,m;for(var a=0,f=n.length;a<f;a++){var v=n.charAt(a);if(v!==":"){c+=v;continue}if(c===""||c!=(p=Number(c)))return o($o,0,1);if(x=n.slice(a+1,a+1+p),c!=x.length)return o($o,0,1);if(x.length){if(m=Zv(x,i,!1),$o.type===m.type&&$o.data===m.data)return o($o,0,1);var $=o(m,a+p,f);if($===!1)return}a+=p,c=""}if(c!=="")return o($o,0,1)}function iK(n){var i="";for(var o=0,c=n.length;o<c;o++)i+=String.fromCharCode(n[o]);return i}function oK(n){var i=Buffer.allocUnsafe(n.length);for(var o=0,c=n.length;o<c;o++)i.writeUInt8(n.charCodeAt(o),o);return i}function qv(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function w4(n,i){if(!n.length)return i(rW);$4(n,cK,function(o,c){return i(Buffer.concat(c))})}function cK(n,i){function o(c){var p=""+c.length,x;if(typeof c==="string"){x=Buffer.allocUnsafe(p.length+2),x[0]=0;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);return x[x.length-1]=255,i(null,Buffer.concat([x,oK(c)]))}x=Buffer.allocUnsafe(p.length+2),x[0]=1;for(var m=0;m<p.length;m++)x[m+1]=parseInt(p[m],10);x[x.length-1]=255,i(null,Buffer.concat([x,c]))}kv(n,!0,!0,o)}function J4(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],x;while(c.length>0){var m="",a=c[0]===0;for(x=1;;x++){if(c[x]===255)break;if(m.length>310)return o($o,0,1);m+=""+c[x]}c=c.slice(m.length+1);var f=parseInt(m,10),v=c.slice(1,f+1);if(a)v=iK(v);p.push(v),c=c.slice(f+1)}var $=p.length;for(x=0;x<$;x++){var w=p[x];o(Zv(w,i,!0),x,$)}}});var R4=C((nL,T4)=>{var lp=1000,Gp=lp*60,Mp=Gp*60,Uc=Mp*24,AK=Uc*7,FK=Uc*365.25;T4.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return TK(n);else if(o==="number"&&isFinite(n))return i.long?SK(n):RK(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function TK(n){if(n=String(n),n.length>100)return;var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!i)return;var o=parseFloat(i[1]),c=(i[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return o*FK;case"weeks":case"week":case"w":return o*AK;case"days":case"day":case"d":return o*Uc;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Mp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Gp;case"seconds":case"second":case"secs":case"sec":case"s":return o*lp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function RK(n){var i=Math.abs(n);if(i>=Uc)return Math.round(n/Uc)+"d";if(i>=Mp)return Math.round(n/Mp)+"h";if(i>=Gp)return Math.round(n/Gp)+"m";if(i>=lp)return Math.round(n/lp)+"s";return n+"ms"}function SK(n){var i=Math.abs(n);if(i>=Uc)return Sa(n,i,Uc,"day");if(i>=Mp)return Sa(n,i,Mp,"hour");if(i>=Gp)return Sa(n,i,Gp,"minute");if(i>=lp)return Sa(n,i,lp,"second");return n+" ms"}function Sa(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var sv=C((iL,S4)=>{function XK(n){o.debug=o,o.default=o,o.coerce=f,o.disable=x,o.enable=p,o.enabled=m,o.humanize=R4(),o.destroy=v,Object.keys(n).forEach(($)=>{o[$]=n[$]}),o.names=[],o.skips=[],o.formatters={};function i($){let w=0;for(let J=0;J<$.length;J++)w=(w<<5)-w+$.charCodeAt(J),w|=0;return o.colors[Math.abs(w)%o.colors.length]}o.selectColor=i;function o($){let w,J=null,S,X;function R(...K){if(!R.enabled)return;let M=R,Y=Number(new Date),I=Y-(w||Y);if(M.diff=I,M.prev=w,M.curr=Y,w=Y,K[0]=o.coerce(K[0]),typeof K[0]!=="string")K.unshift("%O");let G=0;K[0]=K[0].replace(/%([a-zA-Z%])/g,(E,Q)=>{if(E==="%%")return"%";G++;let b=o.formatters[Q];if(typeof b==="function"){let y=K[G];E=b.call(M,y),K.splice(G,1),G--}return E}),o.formatArgs.call(M,K),(M.log||o.log).apply(M,K)}if(R.namespace=$,R.useColors=o.useColors(),R.color=o.selectColor($),R.extend=c,R.destroy=o.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(J!==null)return J;if(S!==o.namespaces)S=o.namespaces,X=o.enabled($);return X},set:(K)=>{J=K}}),typeof o.init==="function")o.init(R);return R}function c($,w){let J=o(this.namespace+(typeof w==="undefined"?":":w)+$);return J.log=this.log,J}function p($){o.save($),o.namespaces=$,o.names=[],o.skips=[];let w,J=(typeof $==="string"?$:"").split(/[\s,]+/),S=J.length;for(w=0;w<S;w++){if(!J[w])continue;if($=J[w].replace(/\*/g,".*?"),$[0]==="-")o.skips.push(new RegExp("^"+$.slice(1)+"$"));else o.names.push(new RegExp("^"+$+"$"))}}function x(){let $=[...o.names.map(a),...o.skips.map(a).map((w)=>"-"+w)].join(",");return o.enable(""),$}function m($){if($[$.length-1]==="*")return!0;let w,J;for(w=0,J=o.skips.length;w<J;w++)if(o.skips[w].test($))return!1;for(w=0,J=o.names.length;w<J;w++)if(o.names[w].test($))return!0;return!1}function a($){return $.toString().substring(2,$.toString().length-2).replace(/\.\*\?$/,"*")}function f($){if($ instanceof Error)return $.stack||$.message;return $}function v(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}S4.exports=XK});var W4=C((X4,Wa)=>{X4.formatArgs=KK;X4.save=lK;X4.load=GK;X4.useColors=WK;X4.storage=MK();X4.destroy=(()=>{let n=!1;return()=>{if(!n)n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();X4.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function WK(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function KK(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Wa.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;n.splice(1,0,i,"color: inherit");let o=0,c=0;n[0].replace(/%[a-zA-Z%]/g,(p)=>{if(p==="%%")return;if(o++,p==="%c")c=o}),n.splice(c,0,i)}X4.log=console.debug||console.log||(()=>{});function lK(n){try{if(n)X4.storage.setItem("debug",n);else X4.storage.removeItem("debug")}catch(i){}}function GK(){let n;try{n=X4.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function MK(){try{return localStorage}catch(n){}}Wa.exports=sv()(X4);var{formatters:YK}=Wa.exports;YK.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var l4=C((cL,K4)=>{K4.exports=(n,i=process.argv)=>{let o=n.startsWith("-")?"":n.length===1?"-":"--",c=i.indexOf(o+n),p=i.indexOf("--");return c!==-1&&(p===-1||c<p)}});var Y4=C((pL,M4)=>{var _K=Kn("node:os"),G4=Kn("node:tty"),gi=l4(),{env:ai}=process,Ka;if(gi("no-color")||gi("no-colors")||gi("color=false")||gi("color=never"))Ka=0;else if(gi("color")||gi("colors")||gi("color=true")||gi("color=always"))Ka=1;function bK(){if("FORCE_COLOR"in ai){if(ai.FORCE_COLOR==="true")return 1;if(ai.FORCE_COLOR==="false")return 0;return ai.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ai.FORCE_COLOR,10),3)}}function uK(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function BK(n,{streamIsTTY:i,sniffFlags:o=!0}={}){let c=bK();if(c!==void 0)Ka=c;let p=o?Ka:c;if(p===0)return 0;if(o){if(gi("color=16m")||gi("color=full")||gi("color=truecolor"))return 3;if(gi("color=256"))return 2}if(n&&!i&&p===void 0)return 0;let x=p||0;if(ai.TERM==="dumb")return x;if(process.platform==="win32"){let m=_K.release().split(".");if(Number(m[0])>=10&&Number(m[2])>=10586)return Number(m[2])>=14931?3:2;return 1}if("CI"in ai){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((m)=>(m in ai))||ai.CI_NAME==="codeship")return 1;return x}if("TEAMCITY_VERSION"in ai)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ai.TEAMCITY_VERSION)?1:0;if(ai.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ai){let m=Number.parseInt((ai.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ai.TERM_PROGRAM){case"iTerm.app":return m>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(ai.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ai.TERM))return 1;if("COLORTERM"in ai)return 1;return x}function Pv(n,i={}){let o=BK(n,{streamIsTTY:n&&n.isTTY,...i});return uK(o)}M4.exports={supportsColor:Pv,stdout:Pv({isTTY:G4.isatty(1)}),stderr:Pv({isTTY:G4.isatty(2)})}});var E4=C((z4,Ga)=>{var jK=Kn("node:tty"),la=Kn("node:util");z4.init=yK;z4.log=hK;z4.formatArgs=LK;z4.save=CK;z4.load=IK;z4.useColors=DK;z4.destroy=la.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");z4.colors=[6,2,3,4,5,1];try{let n=Y4();if(n&&(n.stderr||n).level>=2)z4.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(n){}z4.inspectOpts=Object.keys(process.env).filter((n)=>{return/^debug_/i.test(n)}).reduce((n,i)=>{let o=i.substring(6).toLowerCase().replace(/_([a-z])/g,(p,x)=>{return x.toUpperCase()}),c=process.env[i];if(/^(yes|on|true|enabled)$/i.test(c))c=!0;else if(/^(no|off|false|disabled)$/i.test(c))c=!1;else if(c==="null")c=null;else c=Number(c);return n[o]=c,n},{});function DK(){return"colors"in z4.inspectOpts?Boolean(z4.inspectOpts.colors):jK.isatty(process.stderr.fd)}function LK(n){let{namespace:i,useColors:o}=this;if(o){let c=this.color,p="\x1B[3"+(c<8?c:"8;5;"+c),x=` ${p};1m${i} \x1B[0m`;n[0]=x+n[0].split(`
29
29
  `).join(`
30
- `+x),n.push(p+"m+"+Wa.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=BK()+i+" "+n[0]}function BK(){if(K4.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function bK(...n){return process.stderr.write(Ka.formatWithOptions(K4.inspectOpts,...n)+`
31
- `)}function jK(n){if(n)process.env.DEBUG=n;else delete process.env.DEBUG}function DK(){return process.env.DEBUG}function LK(n){n.inspectOpts={};let i=Object.keys(K4.inspectOpts);for(let o=0;o<i.length;o++)n.inspectOpts[i[o]]=K4.inspectOpts[i[o]]}Wa.exports=sv()(K4);var{formatters:X4}=Wa.exports;X4.o=function(n){return this.inspectOpts.colors=this.useColors,Ka.inspect(n,this.inspectOpts).split(`
32
- `).map((i)=>i.trim()).join(" ")};X4.O=function(n){return this.inspectOpts.colors=this.useColors,Ka.inspect(n,this.inspectOpts)}});var fi=h((nu,Pv)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)Pv.exports=A4();else Pv.exports=G4()});var _c=h((H4)=>{Object.defineProperty(H4,"__esModule",{value:!0});H4.Transport=void 0;var ZK=Kn("events"),sK=Bx(),qK=f4(),PK=fi(),Y4=PK.default("engine:transport");function tK(){}class M4 extends ZK.EventEmitter{get readyState(){return this._readyState}set readyState(n){Y4("readyState updated from %s to %s (%s)",this._readyState,n,this.name),this._readyState=n}constructor(n){super();this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=n._query.EIO==="4"?4:3,this.parser=this.protocol===4?sK:qK,this.supportsBinary=!(n._query&&n._query.b64)}discard(){this.discarded=!0}onRequest(n){}close(n){if(this.readyState==="closed"||this.readyState==="closing")return;this.readyState="closing",this.doClose(n||tK)}onError(n,i){if(this.listeners("error").length){let o=new Error(n);o.type="TransportError",o.description=i,this.emit("error",o)}else Y4("ignored transport error %s (%s)",n,i)}onPacket(n){this.emit("packet",n)}onData(n){this.onPacket(this.parser.decodePacket(n))}onClose(){this.readyState="closed",this.emit("close")}}H4.Transport=M4});var tv=h((O4)=>{Object.defineProperty(O4,"__esModule",{value:!0});O4.Polling=void 0;var rK=_c(),Q4=Kn("zlib"),gK=fa(),dK=fi(),hi=dK.default("engine:polling"),eK={gzip:Q4.createGzip,deflate:Q4.createDeflate};class E4 extends rK.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.method==="GET")this.onPollRequest(n,i);else if(n.method==="POST")this.onDataRequest(n,i);else i.writeHead(500),i.end()}onPollRequest(n,i){if(this.req){hi("request overlap"),this.onError("overlap from client"),i.writeHead(400),i.end();return}hi("setting request"),this.req=n,this.res=i;let o=()=>{this.onError("poll connection closed prematurely")},c=()=>{n.removeListener("close",o),this.req=this.res=null};if(n.cleanup=c,n.on("close",o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)hi("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeHead(400),i.end();return}let o=n.headers["content-type"]==="application/octet-stream";if(o&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let c=o?Buffer.concat([]):"",p=()=>{n.removeListener("data",m),n.removeListener("end",a),n.removeListener("close",x),this.dataReq=this.dataRes=c=null},x=()=>{p(),this.onError("data request connection closed prematurely")},m=(f)=>{let v;if(o)c=Buffer.concat([c,f]),v=c.length;else c+=f,v=Buffer.byteLength(c);if(v>this.maxHttpBufferSize)i.writeHead(413).end(),p()},a=()=>{this.onData(c);let f={"Content-Type":"text/html","Content-Length":"2"};i.writeHead(200,this.headers(n,f)),i.end("ok"),p()};if(n.on("close",x),!o)n.setEncoding("utf8");n.on("data",m),n.on("end",a)}onData(n){hi('received "%s"',n);let i=(o)=>{if(o.type==="close")return hi("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)hi("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){hi('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(v)=>{x["Content-Length"]=typeof v==="string"?Buffer.byteLength(v):v.length,this.res.writeHead(200,this.headers(this.req,x)),this.res.end(v),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let f=gK(this.req).encodings(["gzip","deflate"]);if(!f){m(n);return}this.compress(n,f,(v,$)=>{if(v){this.res.writeHead(500),this.res.end(),o(v);return}x["Content-Encoding"]=f,m($)})}compress(n,i,o){hi("compressing");let c=[],p=0;eK[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){hi("closing");let i;if(this.dataReq)hi("aborting ongoing data request"),this.dataReq.destroy();let o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)hi("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)hi("transport discarded - closing right away"),o();else hi("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i={}){let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}O4.Polling=E4});var b4=h((_4)=>{Object.defineProperty(_4,"__esModule",{value:!0});_4.JSONP=void 0;var nW=tv(),iW=Kn("querystring"),oW=/\\\\n/g,cW=/(\\)?\\n/g;class V4 extends nW.Polling{constructor(n){super(n);this.head="___eio["+(n._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(n){if(n=iW.parse(n).d,typeof n==="string")n=n.replace(cW,function(i,o){return o?i:`
33
- `}),super.onData(n.replace(oW,"\\n"))}doWrite(n,i,o){let c=JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");n=this.head+c+this.foot,super.doWrite(n,i,o)}}_4.JSONP=V4});var N4=h((L4)=>{Object.defineProperty(L4,"__esModule",{value:!0});L4.WebSocket=void 0;var pW=_c(),xW=fi(),j4=xW.default("engine:ws");class D4 extends pW.Transport{constructor(n){super(n);this._doSend=(i)=>{this.socket.send(i,this._onSent)},this._doSendLast=(i)=>{this.socket.send(i,this._onSentLast)},this._onSent=(i)=>{if(i)this.onError("write error",i.stack)},this._onSentLast=(i)=>{if(i)this.onError("write error",i.stack);else this.emit("drain"),this.writable=!0,this.emit("ready")},this.socket=n.websocket,this.socket.on("message",(i,o)=>{let c=o?i:i.toString();j4('received "%s"',c),super.onData(c)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length;if(this._canSendPreEncodedFrame(o))this.socket._sender.sendFrame(o.options.wsPreEncodedFrame,c?this._onSentLast:this._onSent);else this.parser.encodePacket(o,this.supportsBinary,c?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(n){var i,o,c;return!this.perMessageDeflate&&typeof((o=(i=this.socket)===null||i===void 0?void 0:i._sender)===null||o===void 0?void 0:o.sendFrame)==="function"&&((c=n.options)===null||c===void 0?void 0:c.wsPreEncodedFrame)!==void 0}doClose(n){j4("closing"),this.socket.close(),n&&n()}}L4.WebSocket=D4});var rv=h((C4)=>{Object.defineProperty(C4,"__esModule",{value:!0});C4.WebTransport=void 0;var mW=_c(),aW=fi(),fW=Bx(),Mp=aW.default("engine:webtransport");class h4 extends mW.Transport{constructor(n,i,o){super({_query:{EIO:"4"}});this.session=n;let c=fW.createPacketEncoderStream();c.readable.pipeTo(i.writable).catch(()=>{Mp("the stream was closed")}),this.writer=c.writable.getWriter(),(async()=>{try{while(!0){let{value:p,done:x}=await o.read();if(x){Mp("session is closed");break}Mp("received chunk: %o",p),this.onPacket(p)}}catch(p){Mp("error while reading: %s",p.message)}})(),n.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(n){this.writable=!1;try{for(let i=0;i<n.length;i++){let o=n[i];await this.writer.write(o)}}catch(i){Mp("error while writing: %s",i.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(n){Mp("closing WebTransport session"),this.session.close(),n&&n()}}C4.WebTransport=h4});var gv=h((k4)=>{Object.defineProperty(k4,"__esModule",{value:!0});var vW=tv(),$W=b4(),wW=N4(),JW=rv();k4.default={polling:y4,websocket:wW.WebSocket,webtransport:JW.WebTransport};function y4(n){if(typeof n._query.j==="string")return new $W.JSONP(n);else return new vW.Polling(n)}y4.upgradesTo=["websocket","webtransport"]});var dv=h((s4)=>{Object.defineProperty(s4,"__esModule",{value:!0});s4.Socket=void 0;var TW=Kn("events"),FW=fi(),bo=Kn("timers"),Zn=FW.default("engine:socket");class Z4 extends TW.EventEmitter{get readyState(){return this._readyState}set readyState(n){Zn("readyState updated from %s to %s",this._readyState,n),this._readyState=n}constructor(n,i,o,c,p){super();if(this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=n,this.server=i,this.request=c,this.protocol=p,c)if(c.websocket&&c.websocket._socket)this.remoteAddress=c.websocket._socket.remoteAddress;else this.remoteAddress=c.connection.remoteAddress;this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(o),this.onOpen()}onOpen(){if(this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket)this.sendPacket("message",this.server.opts.initialPacket);if(this.emit("open"),this.protocol===3)this.resetPingTimeout();else this.schedulePing()}onPacket(n){if(this.readyState!=="open")return Zn("packet received with closed socket");switch(Zn(`received packet ${n.type}`),this.emit("packet",n),n.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Zn("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Zn("got pong"),bo.clearTimeout(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",n.data),this.emit("message",n.data);break}}onError(n){Zn("transport error"),this.onClose("transport error",n)}schedulePing(){this.pingIntervalTimer=bo.setTimeout(()=>{Zn("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){bo.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=bo.setTimeout(()=>{if(this.readyState==="closed")return;this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(n){let i=this.onError.bind(this),o=()=>this.flush(),c=this.onPacket.bind(this),p=this.onDrain.bind(this),x=this.onClose.bind(this,"transport close");this.transport=n,this.transport.once("error",i),this.transport.on("ready",o),this.transport.on("packet",c),this.transport.on("drain",p),this.transport.once("close",x),this.cleanupFn.push(function(){n.removeListener("error",i),n.removeListener("ready",o),n.removeListener("packet",c),n.removeListener("drain",p),n.removeListener("close",x)})}onDrain(){if(this.sentCallbackFn.length>0){Zn("executing batch send callback");let n=this.sentCallbackFn.shift();if(n)for(let i=0;i<n.length;i++)n[i](this.transport)}}_maybeUpgrade(n){Zn('might upgrade socket transport from "%s" to "%s"',this.transport.name,n.name),this.upgrading=!0;let i=bo.setTimeout(()=>{if(Zn("client did not complete upgrade - closing transport"),x(),n.readyState==="open")n.close()},this.server.opts.upgradeTimeout),o,c=(v)=>{if(v.type==="ping"&&v.data==="probe")Zn("got probe ping packet, sending pong"),n.send([{type:"pong",data:"probe"}]),this.emit("upgrading",n),clearInterval(o),o=setInterval(p,100);else if(v.type==="upgrade"&&this.readyState!=="closed"){if(Zn("got upgrade packet - upgrading"),x(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(n),this.emit("upgrade",n),this.flush(),this.readyState==="closing")n.close(()=>{this.onClose("forced close")})}else x(),n.close()},p=()=>{if(this.transport.name==="polling"&&this.transport.writable)Zn("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}])},x=()=>{this.upgrading=!1,clearInterval(o),bo.clearTimeout(i),n.removeListener("packet",c),n.removeListener("close",a),n.removeListener("error",m),this.removeListener("close",f)},m=(v)=>{Zn("client did not complete upgrade - %s",v),x(),n.close(),n=null},a=()=>{m("transport closed")},f=()=>{m("socket closed")};n.on("packet",c),n.once("close",a),n.once("error",m),this.once("close",f)}clearTransport(){let n,i=this.cleanupFn.length;for(let o=0;o<i;o++)n=this.cleanupFn.shift(),n();this.transport.on("error",function(){Zn("error triggered by discarded transport")}),this.transport.close(),bo.clearTimeout(this.pingTimeoutTimer)}onClose(n,i){if(this.readyState!=="closed")this.readyState="closed",bo.clearTimeout(this.pingIntervalTimer),bo.clearTimeout(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",n,i)}send(n,i,o){return this.sendPacket("message",n,i,o),this}write(n,i,o){return this.sendPacket("message",n,i,o),this}sendPacket(n,i,o={},c){if(typeof o==="function")c=o,o={};if(this.readyState!=="closing"&&this.readyState!=="closed"){Zn('sending packet "%s" (%s)',n,i),o.compress=o.compress!==!1;let p={type:n,options:o};if(i)p.data=i;if(this.emit("packetCreate",p),this.writeBuffer.push(p),typeof c==="function")this.packetsFn.push(c);this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Zn("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let n=this.writeBuffer;if(this.writeBuffer=[],this.packetsFn.length)this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[];else this.sentCallbackFn.push(null);this.transport.send(n),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let n=[],i=this.server.upgrades(this.transport.name);for(let o=0;o<i.length;++o){let c=i[o];if(this.server.opts.transports.indexOf(c)!==-1)n.push(c)}return n}close(n){if(n&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(n);if(this.readyState!=="open")return;if(this.readyState="closing",this.writeBuffer.length){Zn("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Zn("all packets have been sent, closing the transport"),this.closeTransport(n)});return}Zn("the buffer is empty, closing the transport right away"),this.closeTransport(n)}closeTransport(n){if(Zn("closing the transport (discard? %s)",!!n),n)this.transport.discard();this.transport.close(this.onClose.bind(this,"forced close"))}}s4.Socket=Z4});var r4=h((QW)=>{/*!
30
+ `+x),n.push(p+"m+"+Ga.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=NK()+i+" "+n[0]}function NK(){if(z4.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function hK(...n){return process.stderr.write(la.formatWithOptions(z4.inspectOpts,...n)+`
31
+ `)}function CK(n){if(n)process.env.DEBUG=n;else delete process.env.DEBUG}function IK(){return process.env.DEBUG}function yK(n){n.inspectOpts={};let i=Object.keys(z4.inspectOpts);for(let o=0;o<i.length;o++)n.inspectOpts[i[o]]=z4.inspectOpts[i[o]]}Ga.exports=sv()(z4);var{formatters:H4}=Ga.exports;H4.o=function(n){return this.inspectOpts.colors=this.useColors,la.inspect(n,this.inspectOpts).split(`
32
+ `).map((i)=>i.trim()).join(" ")};H4.O=function(n){return this.inspectOpts.colors=this.useColors,la.inspect(n,this.inspectOpts)}});var fi=C((mL,tv)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)tv.exports=W4();else tv.exports=E4()});var _c=C((V4)=>{Object.defineProperty(V4,"__esModule",{value:!0});V4.Transport=void 0;var dK=Kn("node:events"),gK=ux(),eK=F4(),n5=fi(),O4=n5.default("engine:transport");function i5(){}class U4 extends dK.EventEmitter{get readyState(){return this._readyState}set readyState(n){O4("readyState updated from %s to %s (%s)",this._readyState,n,this.name),this._readyState=n}constructor(n){super();this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=n._query.EIO==="4"?4:3,this.parser=this.protocol===4?gK:eK,this.supportsBinary=!(n._query&&n._query.b64)}discard(){this.discarded=!0}onRequest(n){}close(n){if(this.readyState==="closed"||this.readyState==="closing")return;this.readyState="closing",this.doClose(n||i5)}onError(n,i){if(this.listeners("error").length){let o=new Error(n);o.type="TransportError",o.description=i,this.emit("error",o)}else O4("ignored transport error %s (%s)",n,i)}onPacket(n){this.emit("packet",n)}onData(n){this.onPacket(this.parser.decodePacket(n))}onClose(){this.readyState="closed",this.emit("close")}}V4.Transport=U4});var rv=C((B4)=>{Object.defineProperty(B4,"__esModule",{value:!0});B4.Polling=void 0;var o5=_c(),b4=Kn("node:zlib"),c5=va(),p5=fi(),Ci=p5.default("engine:polling"),x5={gzip:b4.createGzip,deflate:b4.createDeflate};class u4 extends o5.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.method==="GET")this.onPollRequest(n,i);else if(n.method==="POST")this.onDataRequest(n,i);else i.writeHead(500),i.end()}onPollRequest(n,i){if(this.req){Ci("request overlap"),this.onError("overlap from client"),i.writeHead(400),i.end();return}Ci("setting request"),this.req=n,this.res=i;let o=()=>{this.onError("poll connection closed prematurely")},c=()=>{n.removeListener("close",o),this.req=this.res=null};if(n.cleanup=c,n.on("close",o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)Ci("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeHead(400),i.end();return}let o=n.headers["content-type"]==="application/octet-stream";if(o&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let c=o?Buffer.concat([]):"",p=()=>{n.removeListener("data",m),n.removeListener("end",a),n.removeListener("close",x),this.dataReq=this.dataRes=c=null},x=()=>{p(),this.onError("data request connection closed prematurely")},m=(f)=>{let v;if(o)c=Buffer.concat([c,f]),v=c.length;else c+=f,v=Buffer.byteLength(c);if(v>this.maxHttpBufferSize)i.writeHead(413).end(),p()},a=()=>{this.onData(c);let f={"Content-Type":"text/html","Content-Length":"2"};i.writeHead(200,this.headers(n,f)),i.end("ok"),p()};if(n.on("close",x),!o)n.setEncoding("utf8");n.on("data",m),n.on("end",a)}onData(n){Ci('received "%s"',n);let i=(o)=>{if(o.type==="close")return Ci("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)Ci("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){Ci('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(v)=>{x["Content-Length"]=typeof v==="string"?Buffer.byteLength(v):v.length,this.res.writeHead(200,this.headers(this.req,x)),this.res.end(v),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let f=c5(this.req).encodings(["gzip","deflate"]);if(!f){m(n);return}this.compress(n,f,(v,$)=>{if(v){this.res.writeHead(500),this.res.end(),o(v);return}x["Content-Encoding"]=f,m($)})}compress(n,i,o){Ci("compressing");let c=[],p=0;x5[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){Ci("closing");let i;if(this.dataReq)Ci("aborting ongoing data request"),this.dataReq.destroy();let o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)Ci("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)Ci("transport discarded - closing right away"),o();else Ci("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i={}){let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}B4.Polling=u4});var h4=C((L4)=>{Object.defineProperty(L4,"__esModule",{value:!0});L4.JSONP=void 0;var m5=rv(),a5=Kn("node:querystring"),f5=/\\\\n/g,v5=/(\\)?\\n/g;class D4 extends m5.Polling{constructor(n){super(n);this.head="___eio["+(n._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(n){if(n=a5.parse(n).d,typeof n==="string")n=n.replace(v5,function(i,o){return o?i:`
33
+ `}),super.onData(n.replace(f5,"\\n"))}doWrite(n,i,o){let c=JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");n=this.head+c+this.foot,super.doWrite(n,i,o)}}L4.JSONP=D4});var Z4=C((y4)=>{Object.defineProperty(y4,"__esModule",{value:!0});y4.WebSocket=void 0;var $5=_c(),w5=fi(),C4=w5.default("engine:ws");class I4 extends $5.Transport{constructor(n){super(n);this._doSend=(i)=>{this.socket.send(i,this._onSent)},this._doSendLast=(i)=>{this.socket.send(i,this._onSentLast)},this._onSent=(i)=>{if(i)this.onError("write error",i.stack)},this._onSentLast=(i)=>{if(i)this.onError("write error",i.stack);else this.emit("drain"),this.writable=!0,this.emit("ready")},this.socket=n.websocket,this.socket.on("message",(i,o)=>{let c=o?i:i.toString();C4('received "%s"',c),super.onData(c)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length;if(this._canSendPreEncodedFrame(o))this.socket._sender.sendFrame(o.options.wsPreEncodedFrame,c?this._onSentLast:this._onSent);else this.parser.encodePacket(o,this.supportsBinary,c?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(n){var i,o,c;return!this.perMessageDeflate&&typeof((o=(i=this.socket)===null||i===void 0?void 0:i._sender)===null||o===void 0?void 0:o.sendFrame)==="function"&&((c=n.options)===null||c===void 0?void 0:c.wsPreEncodedFrame)!==void 0}doClose(n){C4("closing"),this.socket.close(),n&&n()}}y4.WebSocket=I4});var dv=C((s4)=>{Object.defineProperty(s4,"__esModule",{value:!0});s4.WebTransport=void 0;var J5=_c(),A5=fi(),F5=ux(),Yp=A5.default("engine:webtransport");class q4 extends J5.Transport{constructor(n,i,o){super({_query:{EIO:"4"}});this.session=n;let c=F5.createPacketEncoderStream();c.readable.pipeTo(i.writable).catch(()=>{Yp("the stream was closed")}),this.writer=c.writable.getWriter(),(async()=>{try{while(!0){let{value:p,done:x}=await o.read();if(x){Yp("session is closed");break}Yp("received chunk: %o",p),this.onPacket(p)}}catch(p){Yp("error while reading: %s",p.message)}})(),n.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(n){this.writable=!1;try{for(let i=0;i<n.length;i++){let o=n[i];await this.writer.write(o)}}catch(i){Yp("error while writing: %s",i.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(n){Yp("closing WebTransport session"),this.session.close(),n&&n()}}s4.WebTransport=q4});var gv=C((r4)=>{Object.defineProperty(r4,"__esModule",{value:!0});var T5=rv(),R5=h4(),S5=Z4(),X5=dv();r4.default={polling:t4,websocket:S5.WebSocket,webtransport:X5.WebTransport};function t4(n){if(typeof n._query.j==="string")return new R5.JSONP(n);else return new T5.Polling(n)}t4.upgradesTo=["websocket","webtransport"]});var ev=C((g4)=>{Object.defineProperty(g4,"__esModule",{value:!0});g4.Socket=void 0;var K5=Kn("node:events"),l5=fi(),uo=Kn("node:timers"),Zn=l5.default("engine:socket");class d4 extends K5.EventEmitter{get readyState(){return this._readyState}set readyState(n){Zn("readyState updated from %s to %s",this._readyState,n),this._readyState=n}constructor(n,i,o,c,p){super();if(this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=n,this.server=i,this.request=c,this.protocol=p,c)if(c.websocket&&c.websocket._socket)this.remoteAddress=c.websocket._socket.remoteAddress;else this.remoteAddress=c.connection.remoteAddress;this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(o),this.onOpen()}onOpen(){if(this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket)this.sendPacket("message",this.server.opts.initialPacket);if(this.emit("open"),this.protocol===3)this.resetPingTimeout();else this.schedulePing()}onPacket(n){if(this.readyState!=="open")return Zn("packet received with closed socket");switch(Zn(`received packet ${n.type}`),this.emit("packet",n),n.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Zn("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Zn("got pong"),uo.clearTimeout(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",n.data),this.emit("message",n.data);break}}onError(n){Zn("transport error"),this.onClose("transport error",n)}schedulePing(){this.pingIntervalTimer=uo.setTimeout(()=>{Zn("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){uo.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=uo.setTimeout(()=>{if(this.readyState==="closed")return;this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(n){let i=this.onError.bind(this),o=()=>this.flush(),c=this.onPacket.bind(this),p=this.onDrain.bind(this),x=this.onClose.bind(this,"transport close");this.transport=n,this.transport.once("error",i),this.transport.on("ready",o),this.transport.on("packet",c),this.transport.on("drain",p),this.transport.once("close",x),this.cleanupFn.push(function(){n.removeListener("error",i),n.removeListener("ready",o),n.removeListener("packet",c),n.removeListener("drain",p),n.removeListener("close",x)})}onDrain(){if(this.sentCallbackFn.length>0){Zn("executing batch send callback");let n=this.sentCallbackFn.shift();if(n)for(let i=0;i<n.length;i++)n[i](this.transport)}}_maybeUpgrade(n){Zn('might upgrade socket transport from "%s" to "%s"',this.transport.name,n.name),this.upgrading=!0;let i=uo.setTimeout(()=>{if(Zn("client did not complete upgrade - closing transport"),x(),n.readyState==="open")n.close()},this.server.opts.upgradeTimeout),o,c=(v)=>{if(v.type==="ping"&&v.data==="probe")Zn("got probe ping packet, sending pong"),n.send([{type:"pong",data:"probe"}]),this.emit("upgrading",n),clearInterval(o),o=setInterval(p,100);else if(v.type==="upgrade"&&this.readyState!=="closed"){if(Zn("got upgrade packet - upgrading"),x(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(n),this.emit("upgrade",n),this.flush(),this.readyState==="closing")n.close(()=>{this.onClose("forced close")})}else x(),n.close()},p=()=>{if(this.transport.name==="polling"&&this.transport.writable)Zn("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}])},x=()=>{this.upgrading=!1,clearInterval(o),uo.clearTimeout(i),n.removeListener("packet",c),n.removeListener("close",a),n.removeListener("error",m),this.removeListener("close",f)},m=(v)=>{Zn("client did not complete upgrade - %s",v),x(),n.close(),n=null},a=()=>{m("transport closed")},f=()=>{m("socket closed")};n.on("packet",c),n.once("close",a),n.once("error",m),this.once("close",f)}clearTransport(){let n,i=this.cleanupFn.length;for(let o=0;o<i;o++)n=this.cleanupFn.shift(),n();this.transport.on("error",function(){Zn("error triggered by discarded transport")}),this.transport.close(),uo.clearTimeout(this.pingTimeoutTimer)}onClose(n,i){if(this.readyState!=="closed")this.readyState="closed",uo.clearTimeout(this.pingIntervalTimer),uo.clearTimeout(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",n,i)}send(n,i,o){return this.sendPacket("message",n,i,o),this}write(n,i,o){return this.sendPacket("message",n,i,o),this}sendPacket(n,i,o={},c){if(typeof o==="function")c=o,o={};if(this.readyState!=="closing"&&this.readyState!=="closed"){Zn('sending packet "%s" (%s)',n,i),o.compress=o.compress!==!1;let p={type:n,options:o};if(i)p.data=i;if(this.emit("packetCreate",p),this.writeBuffer.push(p),typeof c==="function")this.packetsFn.push(c);this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Zn("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let n=this.writeBuffer;if(this.writeBuffer=[],this.packetsFn.length)this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[];else this.sentCallbackFn.push(null);this.transport.send(n),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let n=[],i=this.server.upgrades(this.transport.name);for(let o=0;o<i.length;++o){let c=i[o];if(this.server.opts.transports.indexOf(c)!==-1)n.push(c)}return n}close(n){if(n&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(n);if(this.readyState!=="open")return;if(this.readyState="closing",this.writeBuffer.length){Zn("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Zn("all packets have been sent, closing the transport"),this.closeTransport(n)});return}Zn("the buffer is empty, closing the transport right away"),this.closeTransport(n)}closeTransport(n){if(Zn("closing the transport (discard? %s)",!!n),n)this.transport.discard();this.transport.close(this.onClose.bind(this,"forced close"))}}g4.Socket=d4});var o8=C((b5)=>{/*!
34
34
  * cookie
35
35
  * Copyright(c) 2012-2014 Roman Shtylman
36
36
  * Copyright(c) 2015 Douglas Christopher Wilson
37
37
  * MIT Licensed
38
- */QW.parse=GW;QW.serialize=YW;var RW=Object.prototype.toString,lW=Object.prototype.hasOwnProperty,SW=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,XW=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,KW=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,WW=/^[\u0020-\u003A\u003D-\u007E]*$/;function GW(n,i){if(typeof n!=="string")throw new TypeError("argument str must be a string");var o={},c=n.length;if(c<2)return o;var p=i&&i.decode||MW,x=0,m=0,a=0;do{if(m=n.indexOf("=",x),m===-1)break;if(a=n.indexOf(";",x),a===-1)a=c;else if(m>a){x=n.lastIndexOf(";",m-1)+1;continue}var f=P4(n,x,m),v=t4(n,m,f),$=n.slice(f,v);if(!lW.call(o,$)){var w=P4(n,m+1,a),J=t4(n,a,w);if(n.charCodeAt(w)===34&&n.charCodeAt(J-1)===34)w++,J--;var l=n.slice(w,J);o[$]=zW(l,p)}x=a+1}while(x<c);return o}function P4(n,i,o){do{var c=n.charCodeAt(i);if(c!==32&&c!==9)return i}while(++i<o);return o}function t4(n,i,o){while(i>o){var c=n.charCodeAt(--i);if(c!==32&&c!==9)return i+1}return o}function YW(n,i,o){var c=o&&o.encode||encodeURIComponent;if(typeof c!=="function")throw new TypeError("option encode is invalid");if(!SW.test(n))throw new TypeError("argument name is invalid");var p=c(i);if(!XW.test(p))throw new TypeError("argument val is invalid");var x=n+"="+p;if(!o)return x;if(o.maxAge!=null){var m=Math.floor(o.maxAge);if(!isFinite(m))throw new TypeError("option maxAge is invalid");x+="; Max-Age="+m}if(o.domain){if(!KW.test(o.domain))throw new TypeError("option domain is invalid");x+="; Domain="+o.domain}if(o.path){if(!WW.test(o.path))throw new TypeError("option path is invalid");x+="; Path="+o.path}if(o.expires){var a=o.expires;if(!HW(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");x+="; Expires="+a.toUTCString()}if(o.httpOnly)x+="; HttpOnly";if(o.secure)x+="; Secure";if(o.partitioned)x+="; Partitioned";if(o.priority){var f=typeof o.priority==="string"?o.priority.toLowerCase():o.priority;switch(f){case"low":x+="; Priority=Low";break;case"medium":x+="; Priority=Medium";break;case"high":x+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){var v=typeof o.sameSite==="string"?o.sameSite.toLowerCase():o.sameSite;switch(v){case!0:x+="; SameSite=Strict";break;case"lax":x+="; SameSite=Lax";break;case"strict":x+="; SameSite=Strict";break;case"none":x+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return x}function MW(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function HW(n){return RW.call(n)==="[object Date]"}function zW(n,i){try{return i(n)}catch(o){return n}}});var e4=h((vu,d4)=>{var g4=Object.getOwnPropertySymbols,UW=Object.prototype.hasOwnProperty,VW=Object.prototype.propertyIsEnumerable;function _W(n){if(n===null||n===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function BW(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;var i={};for(var o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(x){return i[x]});if(c.join("")!=="0123456789")return!1;var p={};if("abcdefghijklmnopqrst".split("").forEach(function(x){p[x]=x}),Object.keys(Object.assign({},p)).join("")!=="abcdefghijklmnopqrst")return!1;return!0}catch(x){return!1}}d4.exports=BW()?Object.assign:function(n,i){var o,c=_W(n),p;for(var x=1;x<arguments.length;x++){o=Object(arguments[x]);for(var m in o)if(UW.call(o,m))c[m]=o[m];if(g4){p=g4(o);for(var a=0;a<p.length;a++)if(VW.call(o,p[a]))c[p[a]]=o[p[a]]}}return c}});var o8=h(($u,ev)=>{/*!
38
+ */b5.parse=E5;b5.serialize=O5;var G5=Object.prototype.toString,M5=Object.prototype.hasOwnProperty,Y5=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,H5=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,z5=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Q5=/^[\u0020-\u003A\u003D-\u007E]*$/;function E5(n,i){if(typeof n!=="string")throw new TypeError("argument str must be a string");var o={},c=n.length;if(c<2)return o;var p=i&&i.decode||U5,x=0,m=0,a=0;do{if(m=n.indexOf("=",x),m===-1)break;if(a=n.indexOf(";",x),a===-1)a=c;else if(m>a){x=n.lastIndexOf(";",m-1)+1;continue}var f=n8(n,x,m),v=i8(n,m,f),$=n.slice(f,v);if(!M5.call(o,$)){var w=n8(n,m+1,a),J=i8(n,a,w);if(n.charCodeAt(w)===34&&n.charCodeAt(J-1)===34)w++,J--;var S=n.slice(w,J);o[$]=_5(S,p)}x=a+1}while(x<c);return o}function n8(n,i,o){do{var c=n.charCodeAt(i);if(c!==32&&c!==9)return i}while(++i<o);return o}function i8(n,i,o){while(i>o){var c=n.charCodeAt(--i);if(c!==32&&c!==9)return i+1}return o}function O5(n,i,o){var c=o&&o.encode||encodeURIComponent;if(typeof c!=="function")throw new TypeError("option encode is invalid");if(!Y5.test(n))throw new TypeError("argument name is invalid");var p=c(i);if(!H5.test(p))throw new TypeError("argument val is invalid");var x=n+"="+p;if(!o)return x;if(o.maxAge!=null){var m=Math.floor(o.maxAge);if(!isFinite(m))throw new TypeError("option maxAge is invalid");x+="; Max-Age="+m}if(o.domain){if(!z5.test(o.domain))throw new TypeError("option domain is invalid");x+="; Domain="+o.domain}if(o.path){if(!Q5.test(o.path))throw new TypeError("option path is invalid");x+="; Path="+o.path}if(o.expires){var a=o.expires;if(!V5(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");x+="; Expires="+a.toUTCString()}if(o.httpOnly)x+="; HttpOnly";if(o.secure)x+="; Secure";if(o.partitioned)x+="; Partitioned";if(o.priority){var f=typeof o.priority==="string"?o.priority.toLowerCase():o.priority;switch(f){case"low":x+="; Priority=Low";break;case"medium":x+="; Priority=Medium";break;case"high":x+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){var v=typeof o.sameSite==="string"?o.sameSite.toLowerCase():o.sameSite;switch(v){case!0:x+="; SameSite=Strict";break;case"lax":x+="; SameSite=Lax";break;case"strict":x+="; SameSite=Strict";break;case"none":x+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return x}function U5(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function V5(n){return G5.call(n)==="[object Date]"}function _5(n,i){try{return i(n)}catch(o){return n}}});var x8=C((TL,p8)=>{var c8=Object.getOwnPropertySymbols,j5=Object.prototype.hasOwnProperty,D5=Object.prototype.propertyIsEnumerable;function L5(n){if(n===null||n===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function N5(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;var i={};for(var o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(x){return i[x]});if(c.join("")!=="0123456789")return!1;var p={};if("abcdefghijklmnopqrst".split("").forEach(function(x){p[x]=x}),Object.keys(Object.assign({},p)).join("")!=="abcdefghijklmnopqrst")return!1;return!0}catch(x){return!1}}p8.exports=N5()?Object.assign:function(n,i){var o,c=L5(n),p;for(var x=1;x<arguments.length;x++){o=Object(arguments[x]);for(var m in o)if(j5.call(o,m))c[m]=o[m];if(c8){p=c8(o);for(var a=0;a<p.length;a++)if(D5.call(o,p[a]))c[p[a]]=o[p[a]]}}return c}});var f8=C((RL,n$)=>{/*!
39
39
  * vary
40
40
  * Copyright(c) 2014-2017 Douglas Christopher Wilson
41
41
  * MIT Licensed
42
- */ev.exports=jW;ev.exports.append=i8;var bW=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function i8(n,i){if(typeof n!=="string")throw new TypeError("header argument is required");if(!i)throw new TypeError("field argument is required");var o=!Array.isArray(i)?n8(String(i)):i;for(var c=0;c<o.length;c++)if(!bW.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,x=n8(n.toLowerCase());if(o.indexOf("*")!==-1||x.indexOf("*")!==-1)return"*";for(var m=0;m<o.length;m++){var a=o[m].toLowerCase();if(x.indexOf(a)===-1)x.push(a),p=p?p+", "+o[m]:o[m]}return p}function n8(n){var i=0,o=[],c=0;for(var p=0,x=n.length;p<x;p++)switch(n.charCodeAt(p)){case 32:if(c===i)c=i=p+1;break;case 44:o.push(n.substring(c,i)),c=i=p+1;break;default:i=p+1;break}return o.push(n.substring(c,i)),o}function jW(n,i){if(!n||!n.getHeader||!n.setHeader)throw new TypeError("res argument is required");var o=n.getHeader("Vary")||"",c=Array.isArray(o)?o.join(", "):String(o);if(o=i8(c,i))n.setHeader("Vary",o)}});var n$=h((wu,c8)=>{(function(){var n=e4(),i=o8(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(S){return typeof S==="string"||S instanceof String}function p(S,R){if(Array.isArray(R)){for(var K=0;K<R.length;++K)if(p(S,R[K]))return!0;return!1}else if(c(R))return S===R;else if(R instanceof RegExp)return R.test(S);else return!!R}function x(S,R){var K=R.headers.origin,Y=[],M;if(!S.origin||S.origin==="*")Y.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(S.origin))Y.push([{key:"Access-Control-Allow-Origin",value:S.origin}]),Y.push([{key:"Vary",value:"Origin"}]);else M=p(K,S.origin),Y.push([{key:"Access-Control-Allow-Origin",value:M?K:!1}]),Y.push([{key:"Vary",value:"Origin"}]);return Y}function m(S){var R=S.methods;if(R.join)R=S.methods.join(",");return{key:"Access-Control-Allow-Methods",value:R}}function a(S){if(S.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function f(S,R){var K=S.allowedHeaders||S.headers,Y=[];if(!K)K=R.headers["access-control-request-headers"],Y.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(K.join)K=K.join(",");if(K&&K.length)Y.push([{key:"Access-Control-Allow-Headers",value:K}]);return Y}function v(S){var R=S.exposedHeaders;if(!R)return null;else if(R.join)R=R.join(",");if(R&&R.length)return{key:"Access-Control-Expose-Headers",value:R};return null}function $(S){var R=(typeof S.maxAge==="number"||S.maxAge)&&S.maxAge.toString();if(R&&R.length)return{key:"Access-Control-Max-Age",value:R};return null}function w(S,R){for(var K=0,Y=S.length;K<Y;K++){var M=S[K];if(M){if(Array.isArray(M))w(M,R);else if(M.key==="Vary"&&M.value)i(R,M.value);else if(M.value)R.setHeader(M.key,M.value)}}}function J(S,R,K,Y){var M=[],I=R.method&&R.method.toUpperCase&&R.method.toUpperCase();if(I==="OPTIONS")if(M.push(x(S,R)),M.push(a(S,R)),M.push(m(S,R)),M.push(f(S,R)),M.push($(S,R)),M.push(v(S,R)),w(M,K),S.preflightContinue)Y();else K.statusCode=S.optionsSuccessStatus,K.setHeader("Content-Length","0"),K.end();else M.push(x(S,R)),M.push(a(S,R)),M.push(v(S,R)),w(M,K),Y()}function l(S){var R=null;if(typeof S==="function")R=S;else R=function(K,Y){Y(null,S)};return function K(Y,M,I){R(Y,function(G,z){if(G)I(G);else{var E=n({},o,z),Q=null;if(E.origin&&typeof E.origin==="function")Q=E.origin;else if(E.origin)Q=function(B,y){y(null,E.origin)};if(Q)Q(Y.headers.origin,function(B,y){if(B||!y)I(B);else E.origin=y,J(E,Y,M,I)});else I()}})}}c8.exports=l})()});var i$=h(($8)=>{Object.defineProperty($8,"__esModule",{value:!0});$8.Server=$8.BaseServer=void 0;var DW=Kn("querystring"),LW=Kn("url"),p8=Dv(),Ga=gv(),uW=Kn("events"),x8=dv(),NW=fi(),hW=r4(),CW=Kn("ws"),m8=rv(),IW=Bx(),xn=NW.default("engine"),Hp=Symbol("responseHeaders");function yW(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class jx extends uW.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:CW.Server,pingTimeout:20000,pingInterval:25000,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},n),n.cookie)this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:n.cookie.path!==!1,sameSite:"lax"},n.cookie);if(this.opts.cors)this.use(n$()(this.opts.cors));if(n.perMessageDeflate)this.opts.perMessageDeflate=Object.assign({threshold:1024},n.perMessageDeflate);this.init()}_computePath(n){let i=(n.path||"/engine.io").replace(/\/$/,"");if(n.addTrailingSlash!==!1)i+="/";return i}upgrades(n){if(!this.opts.allowUpgrades)return[];return Ga.default[n].upgradesTo||[]}verify(n,i,o){let c=n._query.transport;if(!~this.opts.transports.indexOf(c)||c==="webtransport")return xn('unknown transport "%s"',c),o(zn.errors.UNKNOWN_TRANSPORT,{transport:c});if(kW(n.headers.origin)){let m=n.headers.origin;return n.headers.origin=null,xn("origin header invalid"),o(zn.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:m})}let x=n._query.sid;if(x){if(!this.clients.hasOwnProperty(x))return xn('unknown sid "%s"',x),o(zn.errors.UNKNOWN_SID,{sid:x});let m=this.clients[x].transport.name;if(!i&&m!==c)return xn("bad request: unexpected transport without upgrade"),o(zn.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:c,previousTransport:m})}else{if(n.method!=="GET")return o(zn.errors.BAD_HANDSHAKE_METHOD,{method:n.method});if(c==="websocket"&&!i)return xn("invalid transport upgrade"),o(zn.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(m,a)=>{if(!a)return o(zn.errors.FORBIDDEN,{message:m});o()})}o()}use(n){this.middlewares.push(n)}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return xn("no middleware to apply, skipping"),o();let c=(p)=>{xn("applying middleware n\xB0%d",p+1),this.middlewares[p](n,i,(x)=>{if(x)return o(x);if(p+1<this.middlewares.length)c(p+1);else o()})};c(0)}close(){xn("closing all open clients");for(let n in this.clients)if(this.clients.hasOwnProperty(n))this.clients[n].close(!0);return this.cleanup(),this}generateId(n){return p8.generateId()}async handshake(n,i,o){let c=i._query.EIO==="4"?4:3;if(c===3&&!this.opts.allowEIO3){xn("unsupported protocol version"),this.emit("connection_error",{req:i,code:zn.errors.UNSUPPORTED_PROTOCOL_VERSION,message:zn.errorMessages[zn.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:c}}),o(zn.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let p;try{p=await this.generateId(i)}catch(a){xn("error while generating an id"),this.emit("connection_error",{req:i,code:zn.errors.BAD_REQUEST,message:zn.errorMessages[zn.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:a}}),o(zn.errors.BAD_REQUEST);return}xn('handshaking client "%s"',p);try{var x=this.createTransport(n,i);if(n==="polling")x.maxHttpBufferSize=this.opts.maxHttpBufferSize,x.httpCompression=this.opts.httpCompression;else if(n==="websocket")x.perMessageDeflate=this.opts.perMessageDeflate}catch(a){xn('error handshaking to transport "%s"',n),this.emit("connection_error",{req:i,code:zn.errors.BAD_REQUEST,message:zn.errorMessages[zn.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:a}}),o(zn.errors.BAD_REQUEST);return}let m=new x8.Socket(p,this,x,i,c);return x.on("headers",(a,f)=>{if(!f._query.sid){if(this.opts.cookie)a["Set-Cookie"]=[hW.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",a,f)}this.emit("headers",a,f)}),x.onRequest(i),this.clients[p]=m,this.clientsCount++,m.once("close",()=>{delete this.clients[p],this.clientsCount--}),this.emit("connection",m),x}async onWebTransportSession(n){let i=setTimeout(()=>{xn("the client failed to establish a bidirectional stream in the given period"),n.close()},this.opts.upgradeTimeout),c=await n.incomingBidirectionalStreams.getReader().read();if(c.done){xn("session is closed");return}let p=c.value,x=IW.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),m=p.readable.pipeThrough(x).getReader(),{value:a,done:f}=await m.read();if(f){xn("stream is closed");return}if(clearTimeout(i),a.type!=="open")return xn("invalid WebTransport handshake"),n.close();if(a.data===void 0){let w=new m8.WebTransport(n,p,m),J=p8.generateId();xn('handshaking client "%s" (WebTransport)',J);let l=new x8.Socket(J,this,w,null,4);this.clients[J]=l,this.clientsCount++,l.once("close",()=>{delete this.clients[J],this.clientsCount--}),this.emit("connection",l);return}let v=yW(a.data);if(!v)return xn("invalid WebTransport handshake"),n.close();let $=this.clients[v];if(!$)xn("upgrade attempt for closed client"),n.close();else if($.upgrading)xn("transport has already been trying to upgrade"),n.close();else if($.upgraded)xn("transport had already been upgraded"),n.close();else{xn("upgrading existing transport");let w=new m8.WebTransport(n,p,m);$._maybeUpgrade(w)}}}$8.BaseServer=jx;jx.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};jx.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class v8{constructor(n,i){this.req=n,this.socket=i,n[Hp]={}}setHeader(n,i){this.req[Hp][n]=i}getHeader(n){return this.req[Hp][n]}removeHeader(n){delete this.req[Hp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class zn extends jx{init(){if(!~this.opts.transports.indexOf("websocket"))return;if(this.ws)this.ws.close();if(this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on==="function")this.ws.on("headers",(n,i)=>{let o=i[Hp]||{};if(delete i[Hp],!i._query.sid)this.emit("initial_headers",o,i);this.emit("headers",o,i),xn("writing headers: %j",o),Object.keys(o).forEach((p)=>{n.push(`${p}: ${o[p]}`)})})}cleanup(){if(this.ws)xn("closing webSocketServer"),this.ws.close()}prepare(n){if(!n._query)n._query=~n.url.indexOf("?")?DW.parse(LW.parse(n.url).query):{}}createTransport(n,i){return new Ga.default[n](i)}handleRequest(n,i){xn('handling "%s" http request "%s"',n.method,n.url),this.prepare(n),n.res=i;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:n,code:c,message:zn.errorMessages[c],context:p}),a8(i,c,p);return}if(n._query.sid)xn("setting new request for existing client"),this.clients[n._query.sid].transport.onRequest(n);else{let x=(m,a)=>a8(i,m,a);this.handshake(n._query.transport,n,x)}};this._applyMiddlewares(n,i,(c)=>{if(c)o(zn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!1,o)})}handleUpgrade(n,i,o){this.prepare(n);let c=new v8(n,i),p=(x,m)=>{if(x!==void 0){this.emit("connection_error",{req:n,code:x,message:zn.errorMessages[x],context:m}),f8(i,x,m);return}let a=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,a,(f)=>{this.onWebSocket(n,i,f)})};this._applyMiddlewares(n,c,(x)=>{if(x)p(zn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),Ga.default[n._query.transport]!==void 0&&!Ga.default[n._query.transport].prototype.handlesUpgrades){xn("transport doesnt handle upgraded requests"),o.close();return}let c=n._query.sid;if(n.websocket=o,c){let x=this.clients[c];if(!x)xn("upgrade attempt for closed client"),o.close();else if(x.upgrading)xn("transport has already been trying to upgrade"),o.close();else if(x.upgraded)xn("transport had already been upgraded"),o.close();else{xn("upgrading existing transport"),o.removeListener("error",p);let m=this.createTransport(n._query.transport,n);m.perMessageDeflate=this.opts.perMessageDeflate,x._maybeUpgrade(m)}}else{let x=(m,a)=>f8(i,m,a);this.handshake(n._query.transport,n,x)}function p(){xn("websocket error before upgrade")}}attach(n,i={}){let o=this._computePath(i),c=i.destroyUpgradeTimeout||1000;function p(m){return o===m.url.slice(0,o.length)}let x=n.listeners("request").slice(0);if(n.removeAllListeners("request"),n.on("close",this.close.bind(this)),n.on("listening",this.init.bind(this)),n.on("request",(m,a)=>{if(p(m))xn('intercepting request for path "%s"',o),this.handleRequest(m,a);else{let f=0,v=x.length;for(;f<v;f++)x[f].call(n,m,a)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(m,a,f)=>{if(p(m))this.handleUpgrade(m,a,f);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(a.writable&&a.bytesWritten<=0)return a.on("error",(v)=>{xn("error while destroying upgrade: %s",v.message)}),a.end()},c)})}}$8.Server=zn;function a8(n,i,o){let c=i===zn.errors.FORBIDDEN?403:400,p=o&&o.message?o.message:zn.errorMessages[i];n.writeHead(c,{"Content-Type":"application/json"}),n.end(JSON.stringify({code:i,message:p}))}function f8(n,i,o={}){if(n.on("error",()=>{xn("ignoring error from closed connection")}),n.writable){let c=o.message||zn.errorMessages[i],p=Buffer.byteLength(c);n.write(`HTTP/1.1 400 Bad Request\r
42
+ */n$.exports=C5;n$.exports.append=a8;var h5=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function a8(n,i){if(typeof n!=="string")throw new TypeError("header argument is required");if(!i)throw new TypeError("field argument is required");var o=!Array.isArray(i)?m8(String(i)):i;for(var c=0;c<o.length;c++)if(!h5.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,x=m8(n.toLowerCase());if(o.indexOf("*")!==-1||x.indexOf("*")!==-1)return"*";for(var m=0;m<o.length;m++){var a=o[m].toLowerCase();if(x.indexOf(a)===-1)x.push(a),p=p?p+", "+o[m]:o[m]}return p}function m8(n){var i=0,o=[],c=0;for(var p=0,x=n.length;p<x;p++)switch(n.charCodeAt(p)){case 32:if(c===i)c=i=p+1;break;case 44:o.push(n.substring(c,i)),c=i=p+1;break;default:i=p+1;break}return o.push(n.substring(c,i)),o}function C5(n,i){if(!n||!n.getHeader||!n.setHeader)throw new TypeError("res argument is required");var o=n.getHeader("Vary")||"",c=Array.isArray(o)?o.join(", "):String(o);if(o=a8(c,i))n.setHeader("Vary",o)}});var i$=C((SL,v8)=>{(function(){var n=x8(),i=f8(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(X){return typeof X==="string"||X instanceof String}function p(X,R){if(Array.isArray(R)){for(var K=0;K<R.length;++K)if(p(X,R[K]))return!0;return!1}else if(c(R))return X===R;else if(R instanceof RegExp)return R.test(X);else return!!R}function x(X,R){var K=R.headers.origin,M=[],Y;if(!X.origin||X.origin==="*")M.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(X.origin))M.push([{key:"Access-Control-Allow-Origin",value:X.origin}]),M.push([{key:"Vary",value:"Origin"}]);else Y=p(K,X.origin),M.push([{key:"Access-Control-Allow-Origin",value:Y?K:!1}]),M.push([{key:"Vary",value:"Origin"}]);return M}function m(X){var R=X.methods;if(R.join)R=X.methods.join(",");return{key:"Access-Control-Allow-Methods",value:R}}function a(X){if(X.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function f(X,R){var K=X.allowedHeaders||X.headers,M=[];if(!K)K=R.headers["access-control-request-headers"],M.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(K.join)K=K.join(",");if(K&&K.length)M.push([{key:"Access-Control-Allow-Headers",value:K}]);return M}function v(X){var R=X.exposedHeaders;if(!R)return null;else if(R.join)R=R.join(",");if(R&&R.length)return{key:"Access-Control-Expose-Headers",value:R};return null}function $(X){var R=(typeof X.maxAge==="number"||X.maxAge)&&X.maxAge.toString();if(R&&R.length)return{key:"Access-Control-Max-Age",value:R};return null}function w(X,R){for(var K=0,M=X.length;K<M;K++){var Y=X[K];if(Y){if(Array.isArray(Y))w(Y,R);else if(Y.key==="Vary"&&Y.value)i(R,Y.value);else if(Y.value)R.setHeader(Y.key,Y.value)}}}function J(X,R,K,M){var Y=[],I=R.method&&R.method.toUpperCase&&R.method.toUpperCase();if(I==="OPTIONS")if(Y.push(x(X,R)),Y.push(a(X,R)),Y.push(m(X,R)),Y.push(f(X,R)),Y.push($(X,R)),Y.push(v(X,R)),w(Y,K),X.preflightContinue)M();else K.statusCode=X.optionsSuccessStatus,K.setHeader("Content-Length","0"),K.end();else Y.push(x(X,R)),Y.push(a(X,R)),Y.push(v(X,R)),w(Y,K),M()}function S(X){var R=null;if(typeof X==="function")R=X;else R=function(K,M){M(null,X)};return function K(M,Y,I){R(M,function(G,z){if(G)I(G);else{var E=n({},o,z),Q=null;if(E.origin&&typeof E.origin==="function")Q=E.origin;else if(E.origin)Q=function(b,y){y(null,E.origin)};if(Q)Q(M.headers.origin,function(b,y){if(b||!y)I(b);else E.origin=y,J(E,M,Y,I)});else I()}})}}v8.exports=S})()});var o$=C((R8)=>{Object.defineProperty(R8,"__esModule",{value:!0});R8.Server=R8.BaseServer=void 0;var I5=Kn("node:querystring"),y5=Kn("node:url"),$8=Dv(),Ma=gv(),k5=Kn("node:events"),w8=ev(),Z5=fi(),q5=o8(),s5=Kn("ws"),J8=dv(),P5=ux(),xn=Z5.default("engine"),Hp=Symbol("responseHeaders");function t5(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class jx extends k5.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:s5.Server,pingTimeout:20000,pingInterval:25000,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},n),n.cookie)this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:n.cookie.path!==!1,sameSite:"lax"},n.cookie);if(this.opts.cors)this.use(i$()(this.opts.cors));if(n.perMessageDeflate)this.opts.perMessageDeflate=Object.assign({threshold:1024},n.perMessageDeflate);this.init()}_computePath(n){let i=(n.path||"/engine.io").replace(/\/$/,"");if(n.addTrailingSlash!==!1)i+="/";return i}upgrades(n){if(!this.opts.allowUpgrades)return[];return Ma.default[n].upgradesTo||[]}verify(n,i,o){let c=n._query.transport;if(!~this.opts.transports.indexOf(c)||c==="webtransport")return xn('unknown transport "%s"',c),o(zn.errors.UNKNOWN_TRANSPORT,{transport:c});if(r5(n.headers.origin)){let m=n.headers.origin;return n.headers.origin=null,xn("origin header invalid"),o(zn.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:m})}let x=n._query.sid;if(x){if(!this.clients.hasOwnProperty(x))return xn('unknown sid "%s"',x),o(zn.errors.UNKNOWN_SID,{sid:x});let m=this.clients[x].transport.name;if(!i&&m!==c)return xn("bad request: unexpected transport without upgrade"),o(zn.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:c,previousTransport:m})}else{if(n.method!=="GET")return o(zn.errors.BAD_HANDSHAKE_METHOD,{method:n.method});if(c==="websocket"&&!i)return xn("invalid transport upgrade"),o(zn.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(m,a)=>{if(!a)return o(zn.errors.FORBIDDEN,{message:m});o()})}o()}use(n){this.middlewares.push(n)}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return xn("no middleware to apply, skipping"),o();let c=(p)=>{xn("applying middleware n\xB0%d",p+1),this.middlewares[p](n,i,(x)=>{if(x)return o(x);if(p+1<this.middlewares.length)c(p+1);else o()})};c(0)}close(){xn("closing all open clients");for(let n in this.clients)if(this.clients.hasOwnProperty(n))this.clients[n].close(!0);return this.cleanup(),this}generateId(n){return $8.generateId()}async handshake(n,i,o){let c=i._query.EIO==="4"?4:3;if(c===3&&!this.opts.allowEIO3){xn("unsupported protocol version"),this.emit("connection_error",{req:i,code:zn.errors.UNSUPPORTED_PROTOCOL_VERSION,message:zn.errorMessages[zn.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:c}}),o(zn.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let p;try{p=await this.generateId(i)}catch(a){xn("error while generating an id"),this.emit("connection_error",{req:i,code:zn.errors.BAD_REQUEST,message:zn.errorMessages[zn.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:a}}),o(zn.errors.BAD_REQUEST);return}xn('handshaking client "%s"',p);try{var x=this.createTransport(n,i);if(n==="polling")x.maxHttpBufferSize=this.opts.maxHttpBufferSize,x.httpCompression=this.opts.httpCompression;else if(n==="websocket")x.perMessageDeflate=this.opts.perMessageDeflate}catch(a){xn('error handshaking to transport "%s"',n),this.emit("connection_error",{req:i,code:zn.errors.BAD_REQUEST,message:zn.errorMessages[zn.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:a}}),o(zn.errors.BAD_REQUEST);return}let m=new w8.Socket(p,this,x,i,c);return x.on("headers",(a,f)=>{if(!f._query.sid){if(this.opts.cookie)a["Set-Cookie"]=[q5.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",a,f)}this.emit("headers",a,f)}),x.onRequest(i),this.clients[p]=m,this.clientsCount++,m.once("close",()=>{delete this.clients[p],this.clientsCount--}),this.emit("connection",m),x}async onWebTransportSession(n){let i=setTimeout(()=>{xn("the client failed to establish a bidirectional stream in the given period"),n.close()},this.opts.upgradeTimeout),c=await n.incomingBidirectionalStreams.getReader().read();if(c.done){xn("session is closed");return}let p=c.value,x=P5.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),m=p.readable.pipeThrough(x).getReader(),{value:a,done:f}=await m.read();if(f){xn("stream is closed");return}if(clearTimeout(i),a.type!=="open")return xn("invalid WebTransport handshake"),n.close();if(a.data===void 0){let w=new J8.WebTransport(n,p,m),J=$8.generateId();xn('handshaking client "%s" (WebTransport)',J);let S=new w8.Socket(J,this,w,null,4);this.clients[J]=S,this.clientsCount++,S.once("close",()=>{delete this.clients[J],this.clientsCount--}),this.emit("connection",S);return}let v=t5(a.data);if(!v)return xn("invalid WebTransport handshake"),n.close();let $=this.clients[v];if(!$)xn("upgrade attempt for closed client"),n.close();else if($.upgrading)xn("transport has already been trying to upgrade"),n.close();else if($.upgraded)xn("transport had already been upgraded"),n.close();else{xn("upgrading existing transport");let w=new J8.WebTransport(n,p,m);$._maybeUpgrade(w)}}}R8.BaseServer=jx;jx.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};jx.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class T8{constructor(n,i){this.req=n,this.socket=i,n[Hp]={}}setHeader(n,i){this.req[Hp][n]=i}getHeader(n){return this.req[Hp][n]}removeHeader(n){delete this.req[Hp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class zn extends jx{init(){if(!~this.opts.transports.indexOf("websocket"))return;if(this.ws)this.ws.close();if(this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),typeof this.ws.on==="function")this.ws.on("headers",(n,i)=>{let o=i[Hp]||{};if(delete i[Hp],!i._query.sid)this.emit("initial_headers",o,i);this.emit("headers",o,i),xn("writing headers: %j",o),Object.keys(o).forEach((p)=>{n.push(`${p}: ${o[p]}`)})})}cleanup(){if(this.ws)xn("closing webSocketServer"),this.ws.close()}prepare(n){if(!n._query)n._query=~n.url.indexOf("?")?I5.parse(y5.parse(n.url).query):{}}createTransport(n,i){return new Ma.default[n](i)}handleRequest(n,i){xn('handling "%s" http request "%s"',n.method,n.url),this.prepare(n),n.res=i;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:n,code:c,message:zn.errorMessages[c],context:p}),A8(i,c,p);return}if(n._query.sid)xn("setting new request for existing client"),this.clients[n._query.sid].transport.onRequest(n);else{let x=(m,a)=>A8(i,m,a);this.handshake(n._query.transport,n,x)}};this._applyMiddlewares(n,i,(c)=>{if(c)o(zn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!1,o)})}handleUpgrade(n,i,o){this.prepare(n);let c=new T8(n,i),p=(x,m)=>{if(x!==void 0){this.emit("connection_error",{req:n,code:x,message:zn.errorMessages[x],context:m}),F8(i,x,m);return}let a=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,a,(f)=>{this.onWebSocket(n,i,f)})};this._applyMiddlewares(n,c,(x)=>{if(x)p(zn.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),Ma.default[n._query.transport]!==void 0&&!Ma.default[n._query.transport].prototype.handlesUpgrades){xn("transport doesnt handle upgraded requests"),o.close();return}let c=n._query.sid;if(n.websocket=o,c){let x=this.clients[c];if(!x)xn("upgrade attempt for closed client"),o.close();else if(x.upgrading)xn("transport has already been trying to upgrade"),o.close();else if(x.upgraded)xn("transport had already been upgraded"),o.close();else{xn("upgrading existing transport"),o.removeListener("error",p);let m=this.createTransport(n._query.transport,n);m.perMessageDeflate=this.opts.perMessageDeflate,x._maybeUpgrade(m)}}else{let x=(m,a)=>F8(i,m,a);this.handshake(n._query.transport,n,x)}function p(){xn("websocket error before upgrade")}}attach(n,i={}){let o=this._computePath(i),c=i.destroyUpgradeTimeout||1000;function p(m){return o===m.url.slice(0,o.length)}let x=n.listeners("request").slice(0);if(n.removeAllListeners("request"),n.on("close",this.close.bind(this)),n.on("listening",this.init.bind(this)),n.on("request",(m,a)=>{if(p(m))xn('intercepting request for path "%s"',o),this.handleRequest(m,a);else{let f=0,v=x.length;for(;f<v;f++)x[f].call(n,m,a)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(m,a,f)=>{if(p(m))this.handleUpgrade(m,a,f);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(a.writable&&a.bytesWritten<=0)return a.on("error",(v)=>{xn("error while destroying upgrade: %s",v.message)}),a.end()},c)})}}R8.Server=zn;function A8(n,i,o){let c=i===zn.errors.FORBIDDEN?403:400,p=o&&o.message?o.message:zn.errorMessages[i];n.writeHead(c,{"Content-Type":"application/json"}),n.end(JSON.stringify({code:i,message:p}))}function F8(n,i,o={}){if(n.on("error",()=>{xn("ignoring error from closed connection")}),n.writable){let c=o.message||zn.errorMessages[i],p=Buffer.byteLength(c);n.write(`HTTP/1.1 400 Bad Request\r
43
43
  Connection: close\r
44
44
  Content-type: text/html\r
45
45
  Content-Length: `+p+`\r
46
46
  \r
47
- `+c)}n.destroy()}var bx=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function kW(n){if(n+="",n.length<1)return!1;if(!bx[n.charCodeAt(0)])return xn('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!bx[n.charCodeAt(1)])return xn('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!bx[n.charCodeAt(2)])return xn('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!bx[n.charCodeAt(3)])return xn('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!bx[n.charCodeAt(i)])return xn('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var R8=h((T8)=>{Object.defineProperty(T8,"__esModule",{value:!0});T8.Polling=void 0;var sW=_c(),J8=Kn("zlib"),qW=fa(),PW=fi(),di=PW.default("engine:polling"),tW={gzip:J8.createGzip,deflate:J8.createDeflate};class A8 extends sW.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.getMethod()==="get")this.onPollRequest(n,i);else if(n.getMethod()==="post")this.onDataRequest(n,i);else i.writeStatus("500 Internal Server Error"),i.end()}onPollRequest(n,i){if(this.req){di("request overlap"),this.onError("overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}di("setting request"),this.req=n,this.res=i;let o=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},c=()=>{this.req=this.res=null};if(n.cleanup=c,i.onAborted(o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)di("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}let o=Number(n.headers["content-length"]);if(!o){this.onError("content-length header required"),i.writeStatus("411 Length Required").end();return}if(o>this.maxHttpBufferSize){this.onError("payload too large"),i.writeStatus("413 Payload Too Large").end();return}if(n.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let p,x=0,m={"Content-Type":"text/html"};this.headers(n,m);for(let f in m)i.writeHeader(f,String(m[f]));let a=(f)=>{this.onData(f.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((f,v)=>{let $=x+f.byteLength;if($>o){this.onError("content-length mismatch"),i.close();return}if(!p){if(v){a(Buffer.from(f));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(f).copy(p,x),v){if($!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}a(p);return}x=$})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(n){di('received "%s"',n);let i=(o)=>{if(o.type==="close")return di("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)di("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){di('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(v)=>{this.headers(this.req,x),this.res.cork(()=>{Object.keys(x).forEach(($)=>{this.res.writeHeader($,String(x[$]))}),this.res.end(v)}),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let f=qW(this.req).encodings(["gzip","deflate"]);if(!f){m(n);return}this.compress(n,f,(v,$)=>{if(v){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o(v);return}x["Content-Encoding"]=f,m($)})}compress(n,i,o){di("compressing");let c=[],p=0;tW[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){di("closing");let i,o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)di("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)di("transport discarded - closing right away"),o();else di("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i){i=i||{};let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}T8.Polling=A8});var W8=h((X8)=>{Object.defineProperty(X8,"__esModule",{value:!0});X8.WebSocket=void 0;var rW=_c(),gW=fi(),l8=gW.default("engine:ws");class S8 extends rW.Transport{constructor(n){super(n);this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length,p=(x)=>{let m=typeof x!=="string",a=this.perMessageDeflate&&Buffer.byteLength(x)>this.perMessageDeflate.threshold;if(l8('writing "%s"',x),this.socket.send(x,m,a),c)this.emit("drain"),this.writable=!0,this.emit("ready")};if(o.options&&typeof o.options.wsPreEncoded==="string")p(o.options.wsPreEncoded);else this.parser.encodePacket(o,this.supportsBinary,p)}}doClose(n){l8("closing"),n&&n(),this.socket.end()}}X8.WebSocket=S8});var Y8=h((G8)=>{Object.defineProperty(G8,"__esModule",{value:!0});var dW=R8(),eW=W8();G8.default={polling:dW.Polling,websocket:eW.WebSocket}});var E8=h((z8)=>{Object.defineProperty(z8,"__esModule",{value:!0});z8.uServer=void 0;var i5=fi(),Bc=i$(),o5=Y8(),pc=i5.default("engine:uws");class M8 extends Bc.BaseServer{init(){}cleanup(){}prepare(n,i){n.method=n.getMethod().toUpperCase(),n.url=n.getUrl();let o=new URLSearchParams(n.getQuery());n._query=Object.fromEntries(o.entries()),n.headers={},n.forEach((c,p)=>{n.headers[c]=p}),n.connection={remoteAddress:Buffer.from(i.getRemoteAddressAsText()).toString()},i.onAborted(()=>{pc("response has been aborted")})}createTransport(n,i){return new o5.default[n](i)}attach(n,i={}){let o=this._computePath(i);n.any(o,this.handleRequest.bind(this)).ws(o,{compression:i.compression,idleTimeout:i.idleTimeout,maxBackpressure:i.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:(c)=>{let p=c.getUserData().transport;p.socket=c,p.writable=!0,p.emit("ready")},message:(c,p,x)=>{c.getUserData().transport.onData(x?p:Buffer.from(p).toString())},close:(c,p,x)=>{c.getUserData().transport.onClose(p,x)}})}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return o();n.res=new H8(i),super._applyMiddlewares(n,n.res,(c)=>{n.res.writeHead(),o(c)})}handleRequest(n,i){pc('handling "%s" http request "%s"',i.getMethod(),i.getUrl()),this.prepare(i,n),i.res=n;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:i,code:c,message:Bc.Server.errorMessages[c],context:p}),this.abortRequest(i.res,c,p);return}if(i._query.sid)pc("setting new request for existing client"),this.clients[i._query.sid].transport.onRequest(i);else{let x=(m,a)=>this.abortRequest(n,m,a);this.handshake(i._query.transport,i,x)}};this._applyMiddlewares(i,n,(c)=>{if(c)o(Bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!1,o)})}handleUpgrade(n,i,o){pc("on upgrade"),this.prepare(i,n),i.res=n;let c=async(p,x)=>{if(p!==void 0){this.emit("connection_error",{req:i,code:p,message:Bc.Server.errorMessages[p],context:x}),this.abortRequest(n,p,x);return}let m=i._query.sid,a;if(m){let f=this.clients[m];if(!f)return pc("upgrade attempt for closed client"),n.close();else if(f.upgrading)return pc("transport has already been trying to upgrade"),n.close();else if(f.upgraded)return pc("transport had already been upgraded"),n.close();else pc("upgrading existing transport"),a=this.createTransport(i._query.transport,i),f._maybeUpgrade(a)}else if(a=await this.handshake(i._query.transport,i,(f,v)=>this.abortRequest(n,f,v)),!a)return;i.res.writeStatus("101 Switching Protocols"),n.upgrade({transport:a},i.getHeader("sec-websocket-key"),i.getHeader("sec-websocket-protocol"),i.getHeader("sec-websocket-extensions"),o)};this._applyMiddlewares(i,n,(p)=>{if(p)c(Bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!0,c)})}abortRequest(n,i,o){let c=i===Bc.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",p=o&&o.message?o.message:Bc.Server.errorMessages[i];n.writeStatus(c),n.writeHeader("Content-Type","application/json"),n.end(JSON.stringify({code:i,message:p}))}}z8.uServer=M8;class H8{constructor(n){this.res=n,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(n){if(!n)return;this.writeStatus(n===200?"200 OK":"204 No Content")}writeHead(n){this.statusCode=n}setHeader(n,i){if(Array.isArray(i))i.forEach((o)=>{this.writeHeader(n,o)});else this.writeHeader(n,i)}removeHeader(){}getHeader(){}writeStatus(n){if(this.isAborted)return;return this.res.writeStatus(n),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(n,i){if(this.isAborted)return;if(n==="Content-Length")return;if(this.statusWritten)this.res.writeHeader(n,i);else this.headers.push([n,i])}writeBufferedHeaders(){this.headers.forEach(([n,i])=>{this.res.writeHeader(n,i)})}end(n){if(this.isAborted)return;this.res.cork(()=>{if(!this.statusWritten)this.writeBufferedHeaders();this.res.end(n)})}onData(n){if(this.isAborted)return;this.res.onData(n)}onAborted(n){if(this.isAborted)return;this.res.onAborted(()=>{this.isAborted=!0,n()})}cork(n){if(this.isAborted)return;this.res.cork(n)}}});var B8=h((zp)=>{Object.defineProperty(zp,"__esModule",{value:!0});zp.protocol=zp.Transport=zp.Socket=zp.uServer=zp.parser=zp.transports=zp.Server=void 0;zp.listen=f5;zp.attach=V8;var c5=Kn("http"),O8=i$();Object.defineProperty(zp,"Server",{enumerable:!0,get:function(){return O8.Server}});var p5=gv();zp.transports=p5.default;var U8=Bx();zp.parser=U8;var x5=E8();Object.defineProperty(zp,"uServer",{enumerable:!0,get:function(){return x5.uServer}});var m5=dv();Object.defineProperty(zp,"Socket",{enumerable:!0,get:function(){return m5.Socket}});var a5=_c();Object.defineProperty(zp,"Transport",{enumerable:!0,get:function(){return a5.Transport}});zp.protocol=U8.protocol;function f5(n,i,o){if(typeof i==="function")o=i,i={};let c=c5.createServer(function(x,m){m.writeHead(501),m.end("Not Implemented")}),p=V8(c,i);return p.httpServer=c,c.listen(n,o),p}function V8(n,i){let o=new O8.Server(i);return o.attach(n,i),o}});var b8=h((T5)=>{T5.Emitter=Oi;function Oi(n){if(n)return A5(n)}function A5(n){for(var i in Oi.prototype)n[i]=Oi.prototype[i];return n}Oi.prototype.on=Oi.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};Oi.prototype.once=function(n,i){function o(){this.off(n,o),i.apply(this,arguments)}return o.fn=i,this.on(n,o),this};Oi.prototype.off=Oi.prototype.removeListener=Oi.prototype.removeAllListeners=Oi.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+n];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;var c;for(var p=0;p<o.length;p++)if(c=o[p],c===i||c.fn===i){o.splice(p,1);break}if(o.length===0)delete this._callbacks["$"+n];return this};Oi.prototype.emit=function(n){this._callbacks=this._callbacks||{};var i=new Array(arguments.length-1),o=this._callbacks["$"+n];for(var c=1;c<arguments.length;c++)i[c-1]=arguments[c];if(o){o=o.slice(0);for(var c=0,p=o.length;c<p;++c)o[c].apply(this,i)}return this};Oi.prototype.emitReserved=Oi.prototype.emit;Oi.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Oi.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var o$=h((L8)=>{Object.defineProperty(L8,"__esModule",{value:!0});L8.hasBinary=L8.isBinary=void 0;var R5=typeof ArrayBuffer==="function",l5=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},j8=Object.prototype.toString,S5=typeof Blob==="function"||typeof Blob!=="undefined"&&j8.call(Blob)==="[object BlobConstructor]",X5=typeof File==="function"||typeof File!=="undefined"&&j8.call(File)==="[object FileConstructor]";function D8(n){return R5&&(n instanceof ArrayBuffer||l5(n))||S5&&n instanceof Blob||X5&&n instanceof File}L8.isBinary=D8;function Ya(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Ya(n[o]))return!0;return!1}if(D8(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Ya(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Ya(n[o]))return!0;return!1}L8.hasBinary=Ya});var C8=h((N8)=>{Object.defineProperty(N8,"__esModule",{value:!0});N8.reconstructPacket=N8.deconstructPacket=void 0;var W5=o$();function G5(n){let i=[],o=n.data,c=n;return c.data=c$(o,i),c.attachments=i.length,{packet:c,buffers:i}}N8.deconstructPacket=G5;function c$(n,i){if(!n)return n;if(W5.isBinary(n)){let o={_placeholder:!0,num:i.length};return i.push(n),o}else if(Array.isArray(n)){let o=new Array(n.length);for(let c=0;c<n.length;c++)o[c]=c$(n[c],i);return o}else if(typeof n==="object"&&!(n instanceof Date)){let o={};for(let c in n)if(Object.prototype.hasOwnProperty.call(n,c))o[c]=c$(n[c],i);return o}return n}function Y5(n,i){return n.data=p$(n.data,i),delete n.attachments,n}N8.reconstructPacket=Y5;function p$(n,i){if(!n)return n;if(n&&n._placeholder===!0)if(typeof n.num==="number"&&n.num>=0&&n.num<i.length)return i[n.num];else throw new Error("illegal attachments");else if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o]=p$(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=p$(n[o],i)}return n}});var Dx=h((P8)=>{Object.defineProperty(P8,"__esModule",{value:!0});P8.Decoder=P8.Encoder=P8.PacketType=P8.protocol=void 0;var H5=b8(),k8=C8(),Z8=o$(),z5=fi(),x$=z5.default("socket.io-parser"),Q5=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];P8.protocol=5;var yn;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(yn=P8.PacketType||(P8.PacketType={}));class s8{constructor(n){this.replacer=n}encode(n){if(x$("encoding packet %j",n),n.type===yn.EVENT||n.type===yn.ACK){if(Z8.hasBinary(n))return this.encodeAsBinary({type:n.type===yn.EVENT?yn.BINARY_EVENT:yn.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id})}return[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;if(n.type===yn.BINARY_EVENT||n.type===yn.BINARY_ACK)i+=n.attachments+"-";if(n.nsp&&n.nsp!=="/")i+=n.nsp+",";if(n.id!=null)i+=n.id;if(n.data!=null)i+=JSON.stringify(n.data,this.replacer);return x$("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=k8.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}P8.Encoder=s8;function I8(n){return Object.prototype.toString.call(n)==="[object Object]"}class m$ extends H5.Emitter{constructor(n){super();this.reviver=n}add(n){let i;if(typeof n==="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);let o=i.type===yn.BINARY_EVENT;if(o||i.type===yn.BINARY_ACK){if(i.type=o?yn.EVENT:yn.ACK,this.reconstructor=new q8(i),i.attachments===0)super.emitReserved("decoded",i)}else super.emitReserved("decoded",i)}else if(Z8.isBinary(n)||n.base64){if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");else if(i=this.reconstructor.takeBinaryData(n),i)this.reconstructor=null,super.emitReserved("decoded",i)}else throw new Error("Unknown type: "+n)}decodeString(n){let i=0,o={type:Number(n.charAt(0))};if(yn[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===yn.BINARY_EVENT||o.type===yn.BINARY_ACK){let p=i+1;while(n.charAt(++i)!=="-"&&i!=n.length);let x=n.substring(p,i);if(x!=Number(x)||n.charAt(i)!=="-")throw new Error("Illegal attachments");o.attachments=Number(x)}if(n.charAt(i+1)==="/"){let p=i+1;while(++i){if(n.charAt(i)===",")break;if(i===n.length)break}o.nsp=n.substring(p,i)}else o.nsp="/";let c=n.charAt(i+1);if(c!==""&&Number(c)==c){let p=i+1;while(++i){let x=n.charAt(i);if(x==null||Number(x)!=x){--i;break}if(i===n.length)break}o.id=Number(n.substring(p,i+1))}if(n.charAt(++i)){let p=this.tryParse(n.substr(i));if(m$.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return x$("decoded %s as %j",n,o),o}tryParse(n){try{return JSON.parse(n,this.reviver)}catch(i){return!1}}static isPayloadValid(n,i){switch(n){case yn.CONNECT:return I8(i);case yn.DISCONNECT:return i===void 0;case yn.CONNECT_ERROR:return typeof i==="string"||I8(i);case yn.EVENT:case yn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&Q5.indexOf(i[0])===-1);case yn.ACK:case yn.BINARY_ACK:return Array.isArray(i)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}P8.Decoder=m$;class q8{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){let i=k8.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var e8=h((g8)=>{Object.defineProperty(g8,"__esModule",{value:!0});g8.Client=void 0;var Ma=Dx(),U5=fi(),V5=Kn("url"),$o=U5("socket.io:client");class r8{constructor(n,i){this.sockets=new Map,this.nsps=new Map,this.server=n,this.conn=i,this.encoder=n.encoder,this.decoder=new n._parser.Decoder,this.id=i.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{if(this.nsps.size===0)$o("no namespace joined yet, close the client"),this.close();else $o("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(n,i={}){if(this.server._nsps.has(n))return $o("connecting to namespace %s",n),this.doConnect(n,i);this.server._checkNamespace(n,i,(o)=>{if(o)this.doConnect(n,i);else $o("creation of namespace %s was denied",n),this._packet({type:Ma.PacketType.CONNECT_ERROR,nsp:n,data:{message:"Invalid namespace"}})})}doConnect(n,i){let o=this.server.of(n);o._add(this,i,(c)=>{if(this.sockets.set(c.id,c),this.nsps.set(o.name,c),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0})}_disconnect(){for(let n of this.sockets.values())n.disconnect();this.sockets.clear(),this.close()}_remove(n){if(this.sockets.has(n.id)){let i=this.sockets.get(n.id).nsp.name;this.sockets.delete(n.id),this.nsps.delete(i)}else $o("ignoring remove for %s",n.id)}close(){if(this.conn.readyState==="open")$o("forcing transport close"),this.conn.close(),this.onclose("forced server close")}_packet(n,i={}){if(this.conn.readyState!=="open"){$o("ignoring packet write %j",n);return}let o=i.preEncoded?n:this.encoder.encode(n);this.writeToEngine(o,i)}writeToEngine(n,i){if(i.volatile&&!this.conn.transport.writable){$o("volatile packet is discarded since the transport is not currently writable");return}let o=Array.isArray(n)?n:[n];for(let c of o)this.conn.write(c,i)}ondata(n){try{this.decoder.add(n)}catch(i){$o("invalid packet format"),this.onerror(i)}}ondecoded(n){let i,o;if(this.conn.protocol===3){let p=V5.parse(n.nsp,!0);i=p.pathname,o=p.query}else i=n.nsp,o=n.data;let c=this.nsps.get(i);if(!c&&n.type===Ma.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==Ma.PacketType.CONNECT&&n.type!==Ma.PacketType.CONNECT_ERROR)process.nextTick(function(){c._onpacket(n)});else $o("invalid state (packet type: %s)",n.type),this.close()}onerror(n){for(let i of this.sockets.values())i._onerror(n);this.conn.close()}onclose(n,i){$o("client close with reason %s",n),this.destroy();for(let o of this.sockets.values())o._onclose(n,i);this.sockets.clear(),this.decoder.destroy()}destroy(){if(this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0}}g8.Client=r8});var Ha=h((i6)=>{Object.defineProperty(i6,"__esModule",{value:!0});i6.StrictEventEmitter=void 0;var _5=Kn("events");class n6 extends _5.EventEmitter{on(n,i){return super.on(n,i)}once(n,i){return super.once(n,i)}emit(n,...i){return super.emit(n,...i)}emitReserved(n,...i){return super.emit(n,...i)}emitUntyped(n,...i){return super.emit(n,...i)}listeners(n){return super.listeners(n)}}i6.StrictEventEmitter=n6});var a$=h((c6)=>{Object.defineProperty(c6,"__esModule",{value:!0});c6.RESERVED_EVENTS=void 0;c6.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var v$=h((x6)=>{Object.defineProperty(x6,"__esModule",{value:!0});x6.RemoteSocket=x6.BroadcastOperator=void 0;var B5=a$(),b5=Dx();class jo{constructor(n,i=new Set,o=new Set,c={}){this.adapter=n,this.rooms=i,this.exceptRooms=o,this.flags=c}to(n){let i=new Set(this.rooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new jo(this.adapter,i,this.exceptRooms,this.flags)}in(n){return this.to(n)}except(n){let i=new Set(this.exceptRooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new jo(this.adapter,this.rooms,i,this.flags)}compress(n){let i=Object.assign({},this.flags,{compress:n});return new jo(this.adapter,this.rooms,this.exceptRooms,i)}get volatile(){let n=Object.assign({},this.flags,{volatile:!0});return new jo(this.adapter,this.rooms,this.exceptRooms,n)}get local(){let n=Object.assign({},this.flags,{local:!0});return new jo(this.adapter,this.rooms,this.exceptRooms,n)}timeout(n){let i=Object.assign({},this.flags,{timeout:n});return new jo(this.adapter,this.rooms,this.exceptRooms,i)}emit(n,...i){if(B5.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:b5.PacketType.EVENT,data:o};if(typeof o[o.length-1]!=="function")return this.adapter.broadcast(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let x=o.pop(),m=!1,a=[],f=setTimeout(()=>{m=!0,x.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:a])},this.flags.timeout),v=-1,$=0,w=0,J=()=>{if(!m&&v===$&&a.length===w)clearTimeout(f),x.apply(this,[null,this.flags.expectSingleResponse?a[0]:a])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(l)=>{w+=l,$++,J()},(l)=>{a.push(l),J()}),this.adapter.serverCount().then((l)=>{v=l,J()}),!0}emitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),this.emit(n,...i)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then((n)=>{return n.map((i)=>{if(i.server)return i;else return new f$(this.adapter,i)})})}socketsJoin(n){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}socketsLeave(n){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}disconnectSockets(n=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},n)}}x6.BroadcastOperator=jo;class f${constructor(n,i){this.id=i.id,this.handshake=i.handshake,this.rooms=new Set(i.rooms),this.data=i.data,this.operator=new jo(n,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(n){return this.operator.timeout(n)}emit(n,...i){return this.operator.emit(n,...i)}join(n){return this.operator.socketsJoin(n)}leave(n){return this.operator.socketsLeave(n)}disconnect(n=!1){return this.operator.disconnectSockets(n),this}}x6.RemoteSocket=f$});var $$=h((Qp)=>{var v6=Qp&&Qp.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Qp,"__esModule",{value:!0});Qp.Socket=void 0;var ei=Dx(),D5=v6(fi()),L5=Ha(),a6=v6(Dv()),u5=v$(),N5=a$(),Yi=D5.default("socket.io:socket"),h5=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function f6(){}class $6 extends L5.StrictEventEmitter{constructor(n,i,o,c){super();if(this.nsp=n,this.client=i,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=n.server,this.adapter=this.nsp.adapter,c)this.id=c.sid,this.pid=c.pid,c.rooms.forEach((p)=>this.join(p)),this.data=c.data,c.missedPackets.forEach((p)=>{this.packet({type:ei.PacketType.EVENT,data:p})}),this.recovered=!0;else{if(i.conn.protocol===3)this.id=n.name!=="/"?n.name+"#"+i.id:i.id;else this.id=a6.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=a6.default.generateId()}this.handshake=this.buildHandshake(o),this.on("error",f6)}buildHandshake(n){var i,o,c,p;return{headers:((i=this.request)===null||i===void 0?void 0:i.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!((o=this.request)===null||o===void 0?void 0:o.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(c=this.request)===null||c===void 0?void 0:c.url,query:((p=this.request)===null||p===void 0?void 0:p._query)||{},auth:n}}emit(n,...i){if(N5.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:ei.PacketType.EVENT,data:o};if(typeof o[o.length-1]==="function"){let x=this.nsp._ids++;Yi("emitting packet with ack id %d",x),this.registerAckCallback(x,o.pop()),c.id=x}let p=Object.assign({},this.flags);if(this.flags={},this.nsp.server.opts.connectionStateRecovery)this.adapter.broadcast(c,{rooms:new Set([this.id]),except:new Set,flags:p});else this.notifyOutgoingListeners(c),this.packet(c,p);return!0}emitWithAck(n,...i){let o=this.flags.timeout!==void 0;return new Promise((c,p)=>{i.push((x,m)=>{if(o)return x?p(x):c(m);else return c(x)}),this.emit(n,...i)})}registerAckCallback(n,i){let o=this.flags.timeout;if(o===void 0){this.acks.set(n,i);return}let c=setTimeout(()=>{Yi("event with ack id %d has timed out after %d ms",n,o),this.acks.delete(n),i.call(this,new Error("operation has timed out"))},o);this.acks.set(n,(...p)=>{clearTimeout(c),i.apply(this,[null,...p])})}to(n){return this.newBroadcastOperator().to(n)}in(n){return this.newBroadcastOperator().in(n)}except(n){return this.newBroadcastOperator().except(n)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}packet(n,i={}){n.nsp=this.nsp.name,i.compress=i.compress!==!1,this.client._packet(n,i)}join(n){return Yi("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return Yi("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(Yi("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3)this.packet({type:ei.PacketType.CONNECT});else this.packet({type:ei.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(n){switch(Yi("got packet %j",n),n.type){case ei.PacketType.EVENT:this.onevent(n);break;case ei.PacketType.BINARY_EVENT:this.onevent(n);break;case ei.PacketType.ACK:this.onack(n);break;case ei.PacketType.BINARY_ACK:this.onack(n);break;case ei.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(n){let i=n.data||[];if(Yi("emitting event %j",i),n.id!=null)Yi("attaching ack callback to event"),i.push(this.ack(n.id));if(this._anyListeners&&this._anyListeners.length){let o=this._anyListeners.slice();for(let c of o)c.apply(this,i)}this.dispatch(i)}ack(n){let i=this,o=!1;return function(){if(o)return;let c=Array.prototype.slice.call(arguments);Yi("sending ack %j",c),i.packet({id:n,type:ei.PacketType.ACK,data:c}),o=!0}}onack(n){let i=this.acks.get(n.id);if(typeof i=="function")Yi("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else Yi("bad ack %s",n.id)}ondisconnect(){Yi("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(Yi("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&h5.has(n))Yi("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data});this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",n,i);return}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=f6}_error(n){this.packet({type:ei.PacketType.CONNECT_ERROR,data:n})}disconnect(n=!1){if(!this.connected)return this;if(n)this.client._disconnect();else this.packet({type:ei.PacketType.DISCONNECT}),this._onclose("server namespace disconnect");return this}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(n){return this.flags.timeout=n,this}dispatch(n){Yi("dispatching an event %j",n),this.run(n,(i)=>{process.nextTick(()=>{if(i)return this._onerror(i);if(this.connected)super.emitUntyped.apply(this,n);else Yi("ignore packet received after disconnection")})})}use(n){return this.fns.push(n),this}run(n,i){if(!this.fns.length)return i();let o=this.fns.slice(0);function c(p){o[p](n,(x)=>{if(x)return i(x);if(!o[p+1])return i();c(p+1)})}c(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){let i=this._anyListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){let i=this._anyOutgoingListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let o of i)o.apply(this,n.data)}}newBroadcastOperator(){let n=Object.assign({},this.flags);return this.flags={},new u5.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}Qp.Socket=$6});var w$=h((Do)=>{var C5=Do&&Do.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Do,"__esModule",{value:!0});Do.Namespace=Do.RESERVED_EVENTS=void 0;var w6=$$(),I5=Ha(),y5=C5(fi()),Ci=v$(),Lx=y5.default("socket.io:namespace");Do.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class J6 extends I5.StrictEventEmitter{constructor(n,i){super();this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=n,this.name=i,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this)}use(n){return this._fns.push(n),this}run(n,i){if(!this._fns.length)return i();let o=this._fns.slice(0);function c(p){o[p](n,(x)=>{if(x)return i(x);if(!o[p+1])return i();c(p+1)})}c(0)}to(n){return new Ci.BroadcastOperator(this.adapter).to(n)}in(n){return new Ci.BroadcastOperator(this.adapter).in(n)}except(n){return new Ci.BroadcastOperator(this.adapter).except(n)}async _add(n,i,o){var c;Lx("adding socket to nsp %s",this.name);let p=await this._createSocket(n,i);if(this._preConnectSockets.set(p.id,p),((c=this.server.opts.connectionStateRecovery)===null||c===void 0?void 0:c.skipMiddlewares)&&p.recovered&&n.conn.readyState==="open")return this._doConnect(p,o);this.run(p,(x)=>{process.nextTick(()=>{if(n.conn.readyState!=="open"){Lx("next called after client was closed - ignoring socket"),p._cleanup();return}if(x)if(Lx("middleware error, sending CONNECT_ERROR packet to the client"),p._cleanup(),n.conn.protocol===3)return p._error(x.data||x.message);else return p._error({message:x.message,data:x.data});this._doConnect(p,o)})})}async _createSocket(n,i){let{pid:o,offset:c}=i;if(this.server.opts.connectionStateRecovery&&typeof o==="string"&&typeof c==="string"){let p;try{p=await this.adapter.restoreSession(o,c)}catch(x){Lx("error while restoring session: %s",x)}if(p)return Lx("connection state recovered for sid %s",p.sid),new w6.Socket(this,n,i,p)}return new w6.Socket(this,n,i)}_doConnect(n,i){if(this._preConnectSockets.delete(n.id),this.sockets.set(n.id,n),n._onconnect(),i)i(n);this.emitReserved("connect",n),this.emitReserved("connection",n)}_remove(n){this.sockets.delete(n.id)||this._preConnectSockets.delete(n.id)}emit(n,...i){return new Ci.BroadcastOperator(this.adapter).emit(n,...i)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}serverSideEmit(n,...i){if(Do.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);return i.unshift(n),this.adapter.serverSideEmit(i),!0}serverSideEmitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),this.serverSideEmit(n,...i)})}_onServerSideEmit(n){super.emitUntyped.apply(this,n)}allSockets(){return new Ci.BroadcastOperator(this.adapter).allSockets()}compress(n){return new Ci.BroadcastOperator(this.adapter).compress(n)}get volatile(){return new Ci.BroadcastOperator(this.adapter).volatile}get local(){return new Ci.BroadcastOperator(this.adapter).local}timeout(n){return new Ci.BroadcastOperator(this.adapter).timeout(n)}fetchSockets(){return new Ci.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(n){return new Ci.BroadcastOperator(this.adapter).socketsJoin(n)}socketsLeave(n){return new Ci.BroadcastOperator(this.adapter).socketsLeave(n)}disconnectSockets(n=!1){return new Ci.BroadcastOperator(this.adapter).disconnectSockets(n)}}Do.Namespace=J6});var X6=h((l6)=>{Object.defineProperty(l6,"__esModule",{value:!0});l6.yeast=l6.decode=l6.encode=void 0;var F6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),za=64,R6={},A6=0,xc=0,T6;function J$(n){let i="";do i=F6[n%za]+i,n=Math.floor(n/za);while(n>0);return i}l6.encode=J$;function k5(n){let i=0;for(xc=0;xc<n.length;xc++)i=i*za+R6[n.charAt(xc)];return i}l6.decode=k5;function Z5(){let n=J$(+new Date);if(n!==T6)return A6=0,T6=n;return n+"."+J$(A6++)}l6.yeast=Z5;for(;xc<za;xc++)R6[F6[xc]]=xc});var F$=h((W6)=>{var A$;Object.defineProperty(W6,"__esModule",{value:!0});W6.SessionAwareAdapter=W6.Adapter=void 0;var P5=Kn("events"),t5=X6(),Qa=Kn("ws"),r5=typeof((A$=Qa===null||Qa===void 0?void 0:Qa.Sender)===null||A$===void 0?void 0:A$.frame)==="function";class T$ extends P5.EventEmitter{constructor(n){super();this.nsp=n,this.rooms=new Map,this.sids=new Map,this.encoder=n.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(n,i){if(!this.sids.has(n))this.sids.set(n,new Set);for(let o of i){if(this.sids.get(n).add(o),!this.rooms.has(o))this.rooms.set(o,new Set),this.emit("create-room",o);if(!this.rooms.get(o).has(n))this.rooms.get(o).add(n),this.emit("join-room",o,n)}}del(n,i){if(this.sids.has(n))this.sids.get(n).delete(i);this._del(i,n)}_del(n,i){let o=this.rooms.get(n);if(o!=null){if(o.delete(i))this.emit("leave-room",n,i);if(o.size===0&&this.rooms.delete(n))this.emit("delete-room",n)}}delAll(n){if(!this.sids.has(n))return;for(let i of this.sids.get(n))this._del(i,n);this.sids.delete(n)}broadcast(n,i){let o=i.flags||{},c={preEncoded:!0,volatile:o.volatile,compress:o.compress};n.nsp=this.nsp.name;let p=this._encode(n,c);this.apply(i,(x)=>{if(typeof x.notifyOutgoingListeners==="function")x.notifyOutgoingListeners(n);x.client.writeToEngine(p,c)})}broadcastWithAck(n,i,o,c){let p=i.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};n.nsp=this.nsp.name,n.id=this.nsp._ids++;let m=this._encode(n,x),a=0;this.apply(i,(f)=>{if(a++,f.acks.set(n.id,c),typeof f.notifyOutgoingListeners==="function")f.notifyOutgoingListeners(n);f.client.writeToEngine(m,x)}),o(a)}_encode(n,i){let o=this.encoder.encode(n);if(r5&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=Qa.Sender.frame(c,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return o}sockets(n){let i=new Set;return this.apply({rooms:n},(o)=>{i.add(o.id)}),Promise.resolve(i)}socketRooms(n){return this.sids.get(n)}fetchSockets(n){let i=[];return this.apply(n,(o)=>{i.push(o)}),Promise.resolve(i)}addSockets(n,i){this.apply(n,(o)=>{o.join(i)})}delSockets(n,i){this.apply(n,(o)=>{i.forEach((c)=>o.leave(c))})}disconnectSockets(n,i){this.apply(n,(o)=>{o.disconnect(i)})}apply(n,i){let o=n.rooms,c=this.computeExceptSids(n.except);if(o.size){let p=new Set;for(let x of o){if(!this.rooms.has(x))continue;for(let m of this.rooms.get(x)){if(p.has(m)||c.has(m))continue;let a=this.nsp.sockets.get(m);if(a)i(a),p.add(m)}}}else for(let[p]of this.sids){if(c.has(p))continue;let x=this.nsp.sockets.get(p);if(x)i(x)}}computeExceptSids(n){let i=new Set;if(n&&n.size>0){for(let o of n)if(this.rooms.has(o))this.rooms.get(o).forEach((c)=>i.add(c))}return i}serverSideEmit(n){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(n){}restoreSession(n,i){return null}}W6.Adapter=T$;class K6 extends T${constructor(n){super(n);this.nsp=n,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=n.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let o=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((c,p)=>{if(c.disconnectedAt<o)this.sessions.delete(p)});for(let c=this.packets.length-1;c>=0;c--)if(this.packets[c].emittedAt<o){this.packets.splice(0,c+1);break}},60000).unref()}persistSession(n){n.disconnectedAt=Date.now(),this.sessions.set(n.pid,n)}restoreSession(n,i){let o=this.sessions.get(n);if(!o)return null;if(o.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(n),null;let p=this.packets.findIndex((m)=>m.id===i);if(p===-1)return null;let x=[];for(let m=p+1;m<this.packets.length;m++){let a=this.packets[m];if(g5(o.rooms,a.opts))x.push(a.data)}return Promise.resolve(Object.assign(Object.assign({},o),{missedPackets:x}))}broadcast(n,i){var o;let c=n.type===2,p=n.id===void 0,x=((o=i.flags)===null||o===void 0?void 0:o.volatile)===void 0;if(c&&p&&x){let m=t5.yeast();n.data.push(m),this.packets.push({id:m,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}W6.SessionAwareAdapter=K6;function g5(n,i){let o=i.rooms.size===0||n.some((p)=>i.rooms.has(p)),c=n.every((p)=>!i.except.has(p));return o&&c}});var M6=h((wo)=>{var e5=wo&&wo.__rest||function(n,i){var o={};for(var c in n)if(Object.prototype.hasOwnProperty.call(n,c)&&i.indexOf(c)<0)o[c]=n[c];if(n!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var p=0,c=Object.getOwnPropertySymbols(n);p<c.length;p++)if(i.indexOf(c[p])<0&&Object.prototype.propertyIsEnumerable.call(n,c[p]))o[c[p]]=n[c[p]]}return o};Object.defineProperty(wo,"__esModule",{value:!0});wo.ClusterAdapterWithHeartbeat=wo.ClusterAdapter=wo.MessageType=void 0;var n9=F$(),i9=fi(),o9=Kn("crypto"),sn=i9.debug("socket.io-adapter"),c9="emitter",Ea=5000;function Op(){return o9.randomBytes(8).toString("hex")}var on;(function(n){n[n.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",n[n.HEARTBEAT=2]="HEARTBEAT",n[n.BROADCAST=3]="BROADCAST",n[n.SOCKETS_JOIN=4]="SOCKETS_JOIN",n[n.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",n[n.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",n[n.FETCH_SOCKETS=7]="FETCH_SOCKETS",n[n.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",n[n.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",n[n.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",n[n.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",n[n.BROADCAST_ACK=12]="BROADCAST_ACK",n[n.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(on=wo.MessageType||(wo.MessageType={}));function bc(n){return{rooms:[...n.rooms],except:[...n.except],flags:n.flags}}function Ep(n){return{rooms:new Set(n.rooms),except:new Set(n.except),flags:n.flags}}class R$ extends n9.Adapter{constructor(n){super(n);this.requests=new Map,this.ackRequests=new Map,this.uid=Op()}onMessage(n,i){if(n.uid===this.uid)return sn("[%s] ignore message from self",this.uid);switch(sn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case on.BROADCAST:{if(n.data.requestId!==void 0)super.broadcastWithAck(n.data.packet,Ep(n.data.opts),(c)=>{sn("[%s] waiting for %d client acknowledgements",this.uid,c),this.publishResponse(n.uid,{type:on.BROADCAST_CLIENT_COUNT,data:{requestId:n.data.requestId,clientCount:c}})},(c)=>{sn("[%s] received acknowledgement with value %j",this.uid,c),this.publishResponse(n.uid,{type:on.BROADCAST_ACK,data:{requestId:n.data.requestId,packet:c}})});else{let c=n.data.packet,p=Ep(n.data.opts);this.addOffsetIfNecessary(c,p,i),super.broadcast(c,p)}break}case on.SOCKETS_JOIN:super.addSockets(Ep(n.data.opts),n.data.rooms);break;case on.SOCKETS_LEAVE:super.delSockets(Ep(n.data.opts),n.data.rooms);break;case on.DISCONNECT_SOCKETS:super.disconnectSockets(Ep(n.data.opts),n.data.close);break;case on.FETCH_SOCKETS:{sn("[%s] calling fetchSockets with opts %j",this.uid,n.data.opts),super.fetchSockets(Ep(n.data.opts)).then((o)=>{this.publishResponse(n.uid,{type:on.FETCH_SOCKETS_RESPONSE,data:{requestId:n.data.requestId,sockets:o.map((c)=>{let p=c.handshake,{sessionStore:x}=p,m=e5(p,["sessionStore"]);return{id:c.id,handshake:m,rooms:[...c.rooms],data:c.data}})}})});break}case on.SERVER_SIDE_EMIT:{let o=n.data.packet;if(n.data.requestId===void 0){this.nsp._onServerSideEmit(o);return}let p=!1,x=(m)=>{if(p)return;p=!0,sn("[%s] calling acknowledgement with %j",this.uid,m),this.publishResponse(n.uid,{type:on.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:n.data.requestId,packet:m}})};this.nsp._onServerSideEmit([...o,x]);break}case on.BROADCAST_CLIENT_COUNT:case on.BROADCAST_ACK:case on.FETCH_SOCKETS_RESPONSE:case on.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(n);break;default:sn("[%s] unknown message type: %s",this.uid,n.type)}}onResponse(n){var i,o;let c=n.data.requestId;switch(sn("[%s] received response %s to request %s",this.uid,n.type,c),n.type){case on.BROADCAST_CLIENT_COUNT:{(i=this.ackRequests.get(c))===null||i===void 0||i.clientCountCallback(n.data.clientCount);break}case on.BROADCAST_ACK:{(o=this.ackRequests.get(c))===null||o===void 0||o.ack(n.data.packet);break}case on.FETCH_SOCKETS_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,n.data.sockets.forEach((x)=>p.responses.push(x)),p.current===p.expected)clearTimeout(p.timeout),p.resolve(p.responses),this.requests.delete(c);break}case on.SERVER_SIDE_EMIT_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,p.responses.push(n.data.packet),p.current===p.expected)clearTimeout(p.timeout),p.resolve(null,p.responses),this.requests.delete(c);break}default:sn("[%s] unknown response type: %s",this.uid,n.type)}}async broadcast(n,i){var o;if(!((o=i.flags)===null||o===void 0?void 0:o.local))try{let p=await this.publishAndReturnOffset({type:on.BROADCAST,data:{packet:n,opts:bc(i)}});this.addOffsetIfNecessary(n,i,p)}catch(p){return sn("[%s] error while broadcasting message: %s",this.uid,p.message)}super.broadcast(n,i)}addOffsetIfNecessary(n,i,o){var c;if(!this.nsp.server.opts.connectionStateRecovery)return;let p=n.type===2,x=n.id===void 0,m=((c=i.flags)===null||c===void 0?void 0:c.volatile)===void 0;if(p&&x&&m)n.data.push(o)}broadcastWithAck(n,i,o,c){var p;if(!((p=i===null||i===void 0?void 0:i.flags)===null||p===void 0?void 0:p.local)){let m=Op();this.ackRequests.set(m,{clientCountCallback:o,ack:c}),this.publish({type:on.BROADCAST,data:{packet:n,requestId:m,opts:bc(i)}}),setTimeout(()=>{this.ackRequests.delete(m)},i.flags.timeout)}super.broadcastWithAck(n,i,o,c)}async addSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.SOCKETS_JOIN,data:{opts:bc(n),rooms:i}})}catch(p){sn("[%s] error while publishing message: %s",this.uid,p.message)}super.addSockets(n,i)}async delSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.SOCKETS_LEAVE,data:{opts:bc(n),rooms:i}})}catch(p){sn("[%s] error while publishing message: %s",this.uid,p.message)}super.delSockets(n,i)}async disconnectSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.DISCONNECT_SOCKETS,data:{opts:bc(n),close:i}})}catch(p){sn("[%s] error while publishing message: %s",this.uid,p.message)}super.disconnectSockets(n,i)}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets(n),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let x=Op();return new Promise((m,a)=>{let f=setTimeout(()=>{let $=this.requests.get(x);if($)a(new Error(`timeout reached: only ${$.current} responses received out of ${$.expected}`)),this.requests.delete(x)},n.flags.timeout||Ea),v={type:on.FETCH_SOCKETS,resolve:m,timeout:f,current:0,expected:p,responses:o};this.requests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:bc(n),requestId:x}})})}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:on.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=await this.serverCount()-1;if(sn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),x=setTimeout(()=>{let a=this.requests.get(p);if(a)o(new Error(`timeout reached: only ${a.current} responses received out of ${a.expected}`),a.responses),this.requests.delete(p)},Ea),m={type:on.SERVER_SIDE_EMIT,resolve:o,timeout:x,current:0,expected:c,responses:[]};this.requests.set(p,m),this.publish({type:on.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}publish(n){this.publishAndReturnOffset(n).catch((i)=>{sn("[%s] error while publishing message: %s",this.uid,i)})}publishAndReturnOffset(n){return n.uid=this.uid,n.nsp=this.nsp.name,this.doPublish(n)}publishResponse(n,i){i.uid=this.uid,i.nsp=this.nsp.name,this.doPublishResponse(n,i).catch((o)=>{sn("[%s] error while publishing response: %s",this.uid,o)})}}wo.ClusterAdapter=R$;class Y6 extends R${constructor(n,i){super(n);this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5000,heartbeatTimeout:1e4},i),this.cleanupTimer=setInterval(()=>{let o=Date.now();this.nodesMap.forEach((c,p)=>{if(o-c>this._opts.heartbeatTimeout)sn("[%s] node %s seems down",this.uid,p),this.removeNode(p)})},1000)}init(){this.publish({type:on.INITIAL_HEARTBEAT})}scheduleHeartbeat(){if(this.heartbeatTimer)this.heartbeatTimer.refresh();else this.heartbeatTimer=setTimeout(()=>{this.publish({type:on.HEARTBEAT})},this._opts.heartbeatInterval)}close(){if(this.publish({type:on.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer)clearInterval(this.cleanupTimer)}onMessage(n,i){if(n.uid===this.uid)return sn("[%s] ignore message from self",this.uid);if(n.uid&&n.uid!==c9)this.nodesMap.set(n.uid,Date.now());switch(sn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case on.INITIAL_HEARTBEAT:this.publish({type:on.HEARTBEAT});break;case on.HEARTBEAT:break;case on.ADAPTER_CLOSE:this.removeNode(n.uid);break;default:super.onMessage(n,i)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(n){return this.scheduleHeartbeat(),super.publish(n)}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:on.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=this.nodesMap.size;if(sn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),x=setTimeout(()=>{let a=this.customRequests.get(p);if(a)o(new Error(`timeout reached: missing ${a.missingUids.size} responses`),a.responses),this.customRequests.delete(p)},Ea),m={type:on.SERVER_SIDE_EMIT,resolve:o,timeout:x,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(p,m),this.publish({type:on.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets({rooms:n.rooms,except:n.except,flags:{local:!0}}),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let x=Op();return new Promise((m,a)=>{let f=setTimeout(()=>{let $=this.customRequests.get(x);if($)a(new Error(`timeout reached: missing ${$.missingUids.size} responses`)),this.customRequests.delete(x)},n.flags.timeout||Ea),v={type:on.FETCH_SOCKETS,resolve:m,timeout:f,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:bc(n),requestId:x}})})}onResponse(n){let i=n.data.requestId;switch(sn("[%s] received response %s to request %s",this.uid,n.type,i),n.type){case on.FETCH_SOCKETS_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(n.data.sockets.forEach((c)=>o.responses.push(c)),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(o.responses),this.customRequests.delete(i);break}case on.SERVER_SIDE_EMIT_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(o.responses.push(n.data.packet),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(null,o.responses),this.customRequests.delete(i);break}default:super.onResponse(n)}}removeNode(n){this.customRequests.forEach((i,o)=>{if(i.missingUids.delete(n),i.missingUids.size===0){if(clearTimeout(i.timeout),i.type===on.FETCH_SOCKETS)i.resolve(i.responses);else if(i.type===on.SERVER_SIDE_EMIT)i.resolve(null,i.responses);this.customRequests.delete(o)}}),this.nodesMap.delete(n)}}wo.ClusterAdapterWithHeartbeat=Y6});var Oa=h((jc)=>{Object.defineProperty(jc,"__esModule",{value:!0});jc.MessageType=jc.ClusterAdapterWithHeartbeat=jc.ClusterAdapter=jc.SessionAwareAdapter=jc.Adapter=void 0;var H6=F$();Object.defineProperty(jc,"Adapter",{enumerable:!0,get:function(){return H6.Adapter}});Object.defineProperty(jc,"SessionAwareAdapter",{enumerable:!0,get:function(){return H6.SessionAwareAdapter}});var l$=M6();Object.defineProperty(jc,"ClusterAdapter",{enumerable:!0,get:function(){return l$.ClusterAdapter}});Object.defineProperty(jc,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return l$.ClusterAdapterWithHeartbeat}});Object.defineProperty(jc,"MessageType",{enumerable:!0,get:function(){return l$.MessageType}})});var O6=h((Up)=>{var x9=Up&&Up.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Up,"__esModule",{value:!0});Up.ParentNamespace=void 0;var z6=w$(),m9=Oa(),a9=x9(fi()),Q6=a9.default("socket.io:parent-namespace");class Ua extends z6.Namespace{constructor(n){super(n,"/_"+Ua.count++);this.children=new Set}_initAdapter(){this.adapter=new E6(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){Q6("creating child namespace %s",n);let i=new z6.Namespace(this.server,n);if(this._fns.forEach((o)=>i.use(o)),this.listeners("connect").forEach((o)=>i.on("connect",o)),this.listeners("connection").forEach((o)=>i.on("connection",o)),this.children.add(i),this.server._opts.cleanupEmptyChildNamespaces){let o=i._remove;i._remove=(c)=>{if(o.call(i,c),i.sockets.size===0)Q6("closing child namespace %s",n),i.adapter.close(),this.server._nsps.delete(i.name),this.children.delete(i)}}return this.server._nsps.set(n,i),this.server.sockets.emitReserved("new_namespace",i),i}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}}Up.ParentNamespace=Ua;Ua.count=0;class E6 extends m9.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var j6=h((Lc)=>{var f9=Lc&&Lc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Lc,"__esModule",{value:!0});Lc.patchAdapter=$9;Lc.restoreAdapter=w9;Lc.serveFile=A9;var Dc=Oa(),U6=Kn("fs"),v9=f9(fi()),Va=v9.default("socket.io:adapter-uws"),S$="\x1F",{addAll:_6,del:B6,broadcast:b6}=Dc.Adapter.prototype;function $9(n){Dc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);_6.call(this,i,o);let p=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(!p)return;if(p.conn.transport.name==="websocket"){V6(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let x=this.sids.get(i);if(x)V6(this.nsp.name,p,c,x)})},Dc.Adapter.prototype.del=function(i,o){B6.call(this,i,o);let c=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(c&&c.conn.transport.name==="websocket"){let p=c.conn.id,x=c.conn.transport.socket,m=`${this.nsp.name}${S$}${o}`;Va("unsubscribe connection %s from topic %s",p,m),x.unsubscribe(m)}},Dc.Adapter.prototype.broadcast=function(i,o){if(!(o.rooms.size<=1&&o.except.size===0)){b6.call(this,i,o);return}let p=o.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};i.nsp=this.nsp.name;let m=this.encoder.encode(i),a=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${S$}${o.rooms.keys().next().value}`;Va("fast publish to %s",a),m.forEach((f)=>{let v=typeof f!=="string";n.publish(a,v?f:"4"+f,v)}),this.apply(o,(f)=>{if(f.conn.transport.name!=="websocket")f.client.writeToEngine(m,x)})}}function V6(n,i,o,c){let p=i.conn.id,x=i.conn.transport.socket;if(o)Va("subscribe connection %s to topic %s",p,n),x.subscribe(n);c.forEach((m)=>{let a=`${n}${S$}${m}`;Va("subscribe connection %s to topic %s",p,a),x.subscribe(a)})}function w9(){Dc.Adapter.prototype.addAll=_6,Dc.Adapter.prototype.del=B6,Dc.Adapter.prototype.broadcast=b6}var J9=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function A9(n,i){let{size:o}=U6.statSync(i),c=U6.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),x=(a)=>{throw p(),a},m=(a)=>{let f=J9(a);n.cork(()=>{let v=n.getWriteOffset(),[$,w]=n.tryEnd(f,o);if(!w&&!$)c.pause(),n.onWritable((J)=>{let[l,S]=n.tryEnd(f.slice(J-v),o);if(!S&&l)c.resume();return l})})};n.onAborted(p),c.on("data",m).on("error",x).on("end",p)}});var D6=h((Iu,T9)=>{T9.exports={name:"socket.io",version:"4.8.1",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --require ts-node/register --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.3.2","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var Z6=h((Mi,ux)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.1/node_modules/socket.io/dist",F9=Mi&&Mi.__createBinding||(Object.create?function(n,i,o,c){if(c===void 0)c=o;var p=Object.getOwnPropertyDescriptor(i,o);if(!p||("get"in p?!i.__esModule:p.writable||p.configurable))p={enumerable:!0,get:function(){return i[o]}};Object.defineProperty(n,c,p)}:function(n,i,o,c){if(c===void 0)c=o;n[c]=i[o]}),R9=Mi&&Mi.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),l9=Mi&&Mi.__importStar||function(n){if(n&&n.__esModule)return n;var i={};if(n!=null){for(var o in n)if(o!=="default"&&Object.prototype.hasOwnProperty.call(n,o))F9(i,n,o)}return R9(i,n),i},y6=Mi&&Mi.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.Namespace=Mi.Socket=Mi.Server=void 0;var S9=Kn("http"),X9=Kn("fs"),X$=Kn("zlib"),K9=fa(),_a=Kn("stream"),L6=Kn("path"),u6=B8(),W9=e8(),N6=Kn("events"),W$=w$();Object.defineProperty(Mi,"Namespace",{enumerable:!0,get:function(){return W$.Namespace}});var G9=O6(),h6=Oa(),Y9=l9(Dx()),M9=y6(fi()),k6=$$();Object.defineProperty(Mi,"Socket",{enumerable:!0,get:function(){return k6.Socket}});var H9=Ha(),K$=j6(),z9=y6(n$()),ji=M9.default("socket.io:server"),C6=D6().version,I6=/\.map/;class Vp extends H9.StrictEventEmitter{constructor(n,i={}){super();if(this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof n==="object"&&n instanceof Object&&!n.listen)i=n,n=void 0;if(this.path(i.path||"/socket.io"),this.connectTimeout(i.connectTimeout||45000),this.serveClient(i.serveClient!==!1),this._parser=i.parser||Y9,this.encoder=new this._parser.Encoder,this.opts=i,i.connectionStateRecovery)i.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120000,skipMiddlewares:!0},i.connectionStateRecovery),this.adapter(i.adapter||h6.SessionAwareAdapter);else this.adapter(i.adapter||h6.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=z9.default(this.opts.cors)}get _opts(){return this.opts}serveClient(n){if(!arguments.length)return this._serveClient;return this._serveClient=n,this}_checkNamespace(n,i,o){if(this.parentNsps.size===0)return o(!1);let c=this.parentNsps.keys(),p=()=>{let x=c.next();if(x.done)return o(!1);x.value(n,i,(m,a)=>{if(m||!a)return p();if(this._nsps.has(n))return ji("dynamic namespace %s already exists",n),o(this._nsps.get(n));let f=this.parentNsps.get(x.value).createChild(n);ji("dynamic namespace %s was created",n),o(f)})};p()}path(n){if(!arguments.length)return this._path;this._path=n.replace(/\/$/,"");let i=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+i+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(n){if(n===void 0)return this._connectTimeout;return this._connectTimeout=n,this}adapter(n){if(!arguments.length)return this._adapter;this._adapter=n;for(let i of this._nsps.values())i._initAdapter();return this}listen(n,i={}){return this.attach(n,i)}attach(n,i={}){if(typeof n=="function")throw new Error("You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.");if(Number(n)==n)n=Number(n);if(typeof n=="number"){ji("creating http server and binding to %d",n);let o=n;n=S9.createServer((c,p)=>{p.writeHead(404),p.end()}),n.listen(o)}return Object.assign(i,this.opts),i.path=i.path||this._path,this.initEngine(n,i),this}attachApp(n,i={}){Object.assign(i,this.opts),i.path=i.path||this._path,ji("creating uWebSockets.js-based engine with opts %j",i);let o=new u6.uServer(i);if(o.attach(n,i),this.bind(o),this._serveClient)n.get(`${this._path}/*`,(c,p)=>{if(!this.clientPathRegex.test(p.getUrl())){p.setYield(!0);return}let x=p.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),m=I6.test(x),a=m?"map":"source",f='"'+C6+'"',v="W/"+f,$=p.getHeader("if-none-match");if($){if(f===$||v===$){ji("serve client %s 304",a),c.writeStatus("304 Not Modified"),c.end();return}}ji("serve client %s",a),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(m?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",f);let w=L6.join(__dirname,"../client-dist/",x);K$.serveFile(c,w)});K$.patchAdapter(n)}initEngine(n,i){if(ji("creating engine.io instance with opts %j",i),this.eio=u6.attach(n,i),this._serveClient)this.attachServe(n);this.httpServer=n,this.bind(this.eio)}attachServe(n){ji("attaching client serving req handler");let i=n.listeners("request").slice(0);n.removeAllListeners("request"),n.on("request",(o,c)=>{if(this.clientPathRegex.test(o.url))if(this._corsMiddleware)this._corsMiddleware(o,c,()=>{this.serve(o,c)});else this.serve(o,c);else for(let p=0;p<i.length;p++)i[p].call(n,o,c)})}serve(n,i){let o=n.url.replace(this._path,"").replace(/\?.*$/,""),c=I6.test(o),p=c?"map":"source",x='"'+C6+'"',m="W/"+x,a=n.headers["if-none-match"];if(a){if(x===a||m===a){ji("serve client %s 304",p),i.writeHead(304),i.end();return}}ji("serve client %s",p),i.setHeader("Cache-Control","public, max-age=0"),i.setHeader("Content-Type","application/"+(c?"json":"javascript")+"; charset=utf-8"),i.setHeader("ETag",x),Vp.sendFile(o,n,i)}static sendFile(n,i,o){let c=X9.createReadStream(L6.join(__dirname,"../client-dist/",n)),p=K9(i).encodings(["br","gzip","deflate"]),x=(m)=>{if(m)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),_a.pipeline(c,X$.createBrotliCompress(),o,x);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),_a.pipeline(c,X$.createGzip(),o,x);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),_a.pipeline(c,X$.createDeflate(),o,x);break;default:o.writeHead(200),_a.pipeline(c,o,x)}}bind(n){return this.engine=n,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(n){ji("incoming connection with id %s",n.id);let i=new W9.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new G9.ParentNamespace(this);if(ji("initializing parent namespace %s",c.name),typeof n==="function")this.parentNsps.set(n,c);else this.parentNsps.set((p,x,m)=>m(null,n.test(p)),c),this.parentNamespacesFromRegExp.set(n,c);if(i)c.on("connect",i);return c}if(String(n)[0]!=="/")n="/"+n;let o=this._nsps.get(n);if(!o){for(let[c,p]of this.parentNamespacesFromRegExp)if(c.test(n))return ji("attaching namespace %s to parent namespace %s",n,c),p.createChild(n);if(ji("initializing namespace %s",n),o=new W$.Namespace(this,n),this._nsps.set(n,o),n!=="/")this.sockets.emitReserved("new_namespace",o)}if(i)o.on("connect",i);return o}async close(n){if(await Promise.allSettled([...this._nsps.values()].map(async(i)=>{i.sockets.forEach((o)=>{o._onclose("server shutting down")}),await i.adapter.close()})),this.engine.close(),K$.restoreAdapter(),this.httpServer)this.httpServer.close(n);else n&&n()}use(n){return this.sockets.use(n),this}to(n){return this.sockets.to(n)}in(n){return this.sockets.in(n)}except(n){return this.sockets.except(n)}send(...n){return this.sockets.emit("message",...n),this}write(...n){return this.sockets.emit("message",...n),this}serverSideEmit(n,...i){return this.sockets.serverSideEmit(n,...i)}serverSideEmitWithAck(n,...i){return this.sockets.serverSideEmitWithAck(n,...i)}allSockets(){return this.sockets.allSockets()}compress(n){return this.sockets.compress(n)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(n){return this.sockets.timeout(n)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(n){return this.sockets.socketsJoin(n)}socketsLeave(n){return this.sockets.socketsLeave(n)}disconnectSockets(n=!1){return this.sockets.disconnectSockets(n)}}Mi.Server=Vp;var Q9=Object.keys(N6.EventEmitter.prototype).filter(function(n){return typeof N6.EventEmitter.prototype[n]==="function"});Q9.forEach(function(n){Vp.prototype[n]=function(){return this.sockets[n].apply(this.sockets,arguments)}});ux.exports=(n,i)=>new Vp(n,i);ux.exports.Server=Vp;ux.exports.Namespace=W$.Namespace;ux.exports.Socket=k6.Socket});import{createHash as dR}from"crypto";import{createServer as ZY}from"http";import{createServer as sY}from"https";function mm(n=Math.random){return n().toString(36).slice(2)}class cx extends Promise{fate;resolve;reject;done=!1;constructor(n){let i,o;super((c,p)=>{i=c,o=p});this.resolve=i,this.reject=o,this.use(n instanceof Promise?n:new Promise(n))}pass(n,i){if(n===this.fate)this.resolve(i),this.done=!0}fail(n,i){if(n===this.fate)this.reject(i),this.done=!0}use(n){if(n instanceof Promise){let i=n;this.fate=i,i.then((o)=>{this.pass(i,o)},(o)=>{this.fail(i,o)})}else this.resolve(n),this.fate=void 0}}function Y0(n){return Object.entries(n)}var M0=(n,i,o=d.STORE)=>{return wf(o,{key:`${n.key}:JSON`,get:({get:c})=>i.toJson(c(n)),set:({set:c},p)=>{c(n,i.fromJson(p))}})};function D(n){while(n.child!==null)n=n.child;return n}class $n{Subscriber;subscribers=new Map;subscribe(n,i){return this.subscribers.set(n,i),()=>{this.unsubscribe(n)}}unsubscribe(n){this.subscribers.delete(n)}next(n){let i=this.subscribers.values();for(let o of i)o(n)}}class Jf extends $n{state;constructor(n){super();this.state=n}next(n){this.state=n,super.next(n)}}function Jc(n,i,o){let c={key:i.key,type:"atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","atom_family",i.key,`Overwriting an existing ${Xo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=D(n),l=i.default,S={key:w,default:l instanceof Function?l(f):l};if(i.effects)S.effects=i.effects(f);let R=Ac(J,S,$);return x.next({type:"state_creation",token:R}),R},c,{subject:x,install:(f)=>Jc(f,i),internalRoles:o});return n.families.set(i.key,a),n.defaults.set(i.key,i.default),c}function H0(n,i){if("mutable"in i)return px(n,i);return Jc(n,i)}function Io(n,i,o){let c={key:i.key,type:"readonly_selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","readonly_selector_family",i.key,`Overwriting an existing ${Xo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=D(n),l=xx(J,{key:w,get:i.get(f)},$);return x.next({type:"state_creation",token:l}),l},c,{internalRoles:o,subject:x,install:(f)=>Io(f,i),default:(f)=>{return i.get(f)({get:(...$)=>Gn(n,...$),find:(...$)=>t(n,...$),json:($)=>ni(n,$)})}});return n.families.set(i.key,a),c}function z0(n,i){if("set"in i)return mx(n,i);return Io(n,i)}class am{_buffer;_index=0;constructor(n){let i;if(typeof n==="number")i=n;else i=n.length;this._buffer=Array.from({length:i})}get buffer(){return this._buffer}get index(){return this._index}add(n){this._buffer[this._index]=n,this._index=(this._index+1)%this._buffer.length}copy(){let n=new am([...this._buffer]);return n._index=this._index,n}}var el={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function Q0(n,i){let o=wn(i),c=`${n.key}(${o})`,p=el[n.type],x={key:c,type:p};return Object.assign(x,{family:{key:n.key,subKey:o}}),Object.assign(x,{counterfeit:!0}),x}function Ko(n){let i={key:n.key,type:n.type};if("family"in n)i.family=n.family;return i}class ii{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(n,i)=>`${n}:${i}`;warn;getRelatedKeys(n){return this.relations.get(n)}addRelation(n,i){let o=this.relations.get(n),c=this.relations.get(i);if(o)o.add(i);else o=new Set([i]),this.relations.set(n,o);if(c)c.add(n);else c=new Set([n]),this.relations.set(i,c)}deleteRelation(n,i){let o=this.relations.get(n);if(o){if(o.delete(i),o.size===0)this.relations.delete(n);let c=this.relations.get(i);if(c){if(c.delete(n),c.size===0)this.relations.delete(i)}}}replaceRelationsUnsafely(n,i){this.relations.set(n,new Set(i));for(let o of i){let c=new Set().add(n);this.relations.set(o,c)}}replaceRelationsSafely(n,i){let o=this.relations.get(n),c=this.isAType?.(n)?n:void 0,p=c===void 0?n:void 0;if(o)for(let x of o){c??=x,p??=x;let m=this.relations.get(x);if(m){if(m.size===1)this.relations.delete(x);else m.delete(n);this.contents.delete(this.makeContentKey(c,p))}}this.relations.set(n,new Set(i));for(let x of i){let m=this.relations.get(x);if(m)m.add(n);else m=new Set().add(n),this.relations.set(x,m)}}getContentInternal(n){return this.contents.get(n)}setContent(n,i){this.contents.set(n,i)}deleteContent(n){this.contents.delete(n)}constructor(n,i){if(this.a=n.between[0],this.b=n.between[1],this.cardinality=n.cardinality,!i?.externalStore)this.relations=new Map(n.relations?.map(([o,c])=>[o,new Set(c)])),this.contents=new Map(n.contents);if(this.isAType=i?.isAType??null,this.isBType=i?.isBType??null,this.isContent=i?.isContent??null,i?.makeContentKey)this.makeContentKey=i.makeContentKey;if(i?.externalStore){let o=i.externalStore;if(this.has=(c,p)=>o.has(c,p),this.addRelation=(c,p)=>{o.addRelation(c,p)},this.deleteRelation=(c,p)=>{o.deleteRelation(c,p)},this.replaceRelationsSafely=(c,p)=>{o.replaceRelationsSafely(c,p)},this.replaceRelationsUnsafely=(c,p)=>{o.replaceRelationsUnsafely(c,p)},this.getRelatedKeys=(c)=>o.getRelatedKeys(c),o.getContent)this.getContentInternal=(c)=>{return o.getContent(c)},this.setContent=(c,p)=>{o.setContent(c,p)},this.deleteContent=(c)=>{o.deleteContent(c)};for(let[c,p]of n.relations??[]){let x=this.isAType?.(c)?c:void 0,m=x===void 0?c:void 0;for(let a of p)x??=a,m??=a,this.addRelation(x,m)}for(let[c,p]of n.contents??[])this.setContent(c,p)}if(i?.warn)this.warn=i.warn}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([n,i])=>[n,[...i]]),contents:[...this.contents.entries()]}}set(...n){let i,o,c;switch(n.length){case 1:{let p=n[0];i=p[this.a],o=p[this.b],c=void 0;break}case 2:{let p=n[0];if(typeof p==="string")[i,o]=n;else i=p[this.a],o=p[this.b],c=n[1];break}default:{i=n[0],o=n[1],c=n[2];break}}switch(this.cardinality){case"1:1":{let p=this.getRelatedKey(i);if(p&&p!==o)this.delete(i,p)}case"1:n":{let p=this.getRelatedKey(o);if(p&&p!==i)this.delete(p,o)}break;case"n:n":}if(c){let p=this.makeContentKey(i,o);this.setContent(p,c)}return this.addRelation(i,o),this}delete(n,i){i=typeof i==="string"?i:n[this.b];let o=typeof n==="string"?n:n[this.a];if(o===void 0&&typeof i==="string"){let c=this.getRelatedKeys(i);if(c)for(let p of c)this.delete(p,i)}if(typeof o==="string"&&i===void 0){let c=this.getRelatedKeys(o);if(c)for(let p of c)this.delete(o,p)}if(typeof o==="string"&&typeof i==="string"){this.deleteRelation(o,i);let c=this.makeContentKey(o,i);this.deleteContent(c)}return this}getRelatedKey(n){let i=this.getRelatedKeys(n);if(i){if(i.size>1)this.warn?.(`${i.size} related keys were found for key "${n}": (${[...i].map((c)=>`"${c}"`).join(", ")}). Only one related key was expected.`);let o;for(let c of i){o=c;break}return o}}replaceRelations(n,i,o){let c=!Array.isArray(i),p=c?Object.keys(i):i;if(o?.reckless)this.replaceRelationsUnsafely(n,p);else this.replaceRelationsSafely(n,p);if(c)for(let x of p){let m=this.makeContentKey(n,x),a=i[x];this.setContent(m,a)}return this}getContent(n,i){let o=this.makeContentKey(n,i);return this.getContentInternal(o)}getRelationEntries(n){let i=n[this.a],o=n[this.b];if(i!==void 0&&o===void 0){let c=this.getRelatedKeys(i);if(c)return[...c].map((p)=>{return[p,this.getContent(i,p)]})}if(i===void 0&&o!==void 0){let c=this.getRelatedKeys(o);if(c)return[...c].map((p)=>{return[p,this.getContent(p,o)]})}return[]}has(n,i){if(i)return this.getRelatedKeys(n)?.has(i)??!1;return this.relations.has(n)}}function $i(n){return"epoch"in n.transactionMeta}function Yn(n){return"phase"in n.transactionMeta}var E0=(n)=>{let i=D(n);if(!Yn(i)){n.logger.warn("\uD83D\uDC1E","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.logger.info("\uD83E\uDE82","transaction",i.transactionMeta.update.key,"Aborting transaction"),i.parent.child=null};function Mn(n){return n[0].toUpperCase()+n.slice(1)}function Xo(n){return n.type.split("_").map(Mn).join(" ")}class Tc extends Error{constructor(n,i){super(`${Xo(n)} ${wn(n.key)} not found in store "${i.config.name}".`)}}function gc(n,i,o){return(...c)=>{let p=Fn(n,i);if(p)return p.run(c,o);throw new Tc(i,n)}}var fm=(n)=>(i)=>n instanceof Function?n(i):n;var yo=(n,i)=>{if(n.valueMap.has(i.key))return n.logger.info("\uD83D\uDCD6",i.type,i.key,"reading cached value"),O0(i,n);switch(i.type){case"selector":case"readonly_selector":return n.logger.info("\uD83E\uDDEE",i.type,i.key,"computing value"),i.get();case"atom":case"mutable_atom":{let o=i.default,c;if(o instanceof Function)c=o();else c=o;return n.logger.info("\uD83D\uDC81","atom",i.key,"could not find cached value; using default",c),c}}};var U0=(n,i)=>{if(n.operation.open){let o=performance.now();return n.logger.info("\u2757",i.type,i.key,`deferring setState at T-${o} until setState for "${n.operation.token.key}" is done`),o}n.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:i},n.logger.info("\u2B55",i.type,i.key,`operation start in store "${n.config.name}"${!Yn(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},V0=(n)=>{if(n.operation.open)n.logger.info("\uD83D\uDD34",n.operation.token.type,n.operation.token.key,`operation done in store "${n.config.name}"`);n.operation={open:!1},n.on.operationClose.next(n.operation)},_0=(n,i)=>{if(!n.operation.open)return n.logger.error("\uD83D\uDC1E","unknown",i,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0;return n.operation.done.has(i)},dc=(n,i)=>{if(!n.operation.open){n.logger.error("\uD83D\uDC1E","unknown",i,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}n.operation.done.add(i)};var B0=(n,i,o)=>{switch(i.type){case"mutable_atom":n.logger.info("\uD83D\uDCE2",i.type,i.key,"is now (",o.newValue,") subscribers:",i.subject.subscribers);break;case"atom":case"selector":case"readonly_selector":n.logger.info("\uD83D\uDCE2",i.type,i.key,"went (",o.oldValue,"->",o.newValue,") subscribers:",i.subject.subscribers)}i.subject.next(o)};var Af=(n,i)=>{let o=D(n),c=o.selectorAtoms.getRelatedKeys(i.key);if(o.logger.info("\uD83E\uDDF9",i.type,i.key,c?`evicting ${c.size} states downstream:`:"no downstream states",c??"to evict"),c){if(o.operation.open)o.logger.info("\uD83E\uDDF9",i.type,i.key,`[ ${[...o.operation.done].join(", ")} ] already done`);for(let p of c){if(_0(o,p))continue;b0(p,o),dc(o,p)}}};var j0=(n,i,o)=>{let c=yo(n,i),p=c;if(i.type==="mutable_atom"&&Yn(n)){let{parent:m}=n;p=ax(n,i,m)}if(p=fm(o)(p),n.logger.info("\uD83D\uDCDD","atom",i.key,"set to",p),p=ki(n,i.key,p,i.subject),L0(n,i.key))u0(n,i.key);dc(n,i.key),Af(n,i);let x={oldValue:c,newValue:p};if(!Yn(n)){B0(n,i,x);return}if(n.on.transactionApplying.state===null){let{key:m}=i;if(D0(x.newValue))return;let a={type:"atom_update",key:m,...x};if(i.family)a.family=i.family;n.transactionMeta.update.updates.push(a),n.logger.info("\uD83D\uDCC1","atom",m,"stowed (",x.oldValue,"->",x.newValue,")")}else if(i.key.startsWith("*")){let m=i.key.slice(1),a=n.atoms.get(m),f=n.valueMap.get(m);if(a.type==="mutable_atom"&&Yn(n)){let{parent:$}=n;f=ax(n,a,$)}if(f.do(x.newValue)===null)Af(n,a)}};var vm=(n,i,o)=>{switch(i.type){case"atom":case"mutable_atom":j0(n,i,o);break;case"selector":i.set(o);break}};function N0(n,i){if(i.family){let o=n.families.get(i.family.key);if(o)return o}}function On(n,...i){let o,c,p,x;if(i.length===2){if(o=i[0],x=i[1],c=N0(n,o)??null,c)p=o.family?xi(o.family.subKey):null,o=t(n,c,p)}else c=i[0],p=i[1],x=i[2],o=t(n,c,p);if("counterfeit"in o&&"family"in o){let f=o.family.subKey,v=n.disposalTraces.buffer.find(($)=>$?.key===f);n.logger.error("\u274C",o.type,o.key,`could not be set because it was not found in the store "${n.config.name}".`,v?`This state was previously disposed:
48
- ${v.trace}`:"No previous disposal trace was found.");return}let m=U0(n,o);if(m){let f=n.on.operationClose.subscribe(`waiting to set "${o.key}" at T-${m}`,()=>{f(),n.logger.info("\uD83D\uDFE2",o.type,o.key,`resuming deferred setState from T-${m}`),On(n,o,x)});return}let a=Fn(n,o);vm(n,a,x),V0(n)}function $m(n,i,o){let{key:c,newValue:p,oldValue:x}=i,m=n==="newValue"?p:x,a={key:c,type:"atom"};if(i.family)Object.assign(a,{family:i.family});On(o,a,m)}function h0(n){let{stack:i}=n;if(i)return`
47
+ `+c)}n.destroy()}var Bx=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function r5(n){if(n+="",n.length<1)return!1;if(!Bx[n.charCodeAt(0)])return xn('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!Bx[n.charCodeAt(1)])return xn('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!Bx[n.charCodeAt(2)])return xn('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!Bx[n.charCodeAt(3)])return xn('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!Bx[n.charCodeAt(i)])return xn('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var G8=C((K8)=>{Object.defineProperty(K8,"__esModule",{value:!0});K8.Polling=void 0;var g5=_c(),X8=Kn("node:zlib"),e5=va(),nl=fi(),ei=nl.default("engine:polling"),il={gzip:X8.createGzip,deflate:X8.createDeflate};class W8 extends g5.Transport{constructor(n){super(n);this.closeTimeout=30000}get name(){return"polling"}onRequest(n){let i=n.res;if(n.res=null,n.getMethod()==="get")this.onPollRequest(n,i);else if(n.getMethod()==="post")this.onDataRequest(n,i);else i.writeStatus("500 Internal Server Error"),i.end()}onPollRequest(n,i){if(this.req){ei("request overlap"),this.onError("overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}ei("setting request"),this.req=n,this.res=i;let o=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},c=()=>{this.req=this.res=null};if(n.cleanup=c,i.onAborted(o),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose)ei("triggering empty send to append close packet"),this.send([{type:"noop"}])}onDataRequest(n,i){if(this.dataReq){this.onError("data request overlap from client"),i.writeStatus("500 Internal Server Error"),i.end();return}let o=Number(n.headers["content-length"]);if(!o){this.onError("content-length header required"),i.writeStatus("411 Length Required").end();return}if(o>this.maxHttpBufferSize){this.onError("payload too large"),i.writeStatus("413 Payload Too Large").end();return}if(n.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=n,this.dataRes=i;let p,x=0,m={"Content-Type":"text/html"};this.headers(n,m);for(let f in m)i.writeHeader(f,String(m[f]));let a=(f)=>{this.onData(f.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((f,v)=>{let $=x+f.byteLength;if($>o){this.onError("content-length mismatch"),i.close();return}if(!p){if(v){a(Buffer.from(f));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(f).copy(p,x),v){if($!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}a(p);return}x=$})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(n){ei('received "%s"',n);let i=(o)=>{if(o.type==="close")return ei("got xhr close packet"),this.onClose(),!1;this.onPacket(o)};if(this.protocol===3)this.parser.decodePayload(n,i);else this.parser.decodePayload(n).forEach(i)}onClose(){if(this.writable)this.send([{type:"noop"}]);super.onClose()}send(n){if(this.writable=!1,this.shouldClose)ei("appending close packet to payload"),n.push({type:"close"}),this.shouldClose(),this.shouldClose=null;let i=(o)=>{let c=n.some((p)=>{return p.options&&p.options.compress});this.write(o,{compress:c})};if(this.protocol===3)this.parser.encodePayload(n,this.supportsBinary,i);else this.parser.encodePayload(n,i)}write(n,i){ei('writing "%s"',n),this.doWrite(n,i,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(n,i,o){let c=typeof n==="string",x={"Content-Type":c?"text/plain; charset=UTF-8":"application/octet-stream"},m=(v)=>{this.headers(this.req,x),this.res.cork(()=>{Object.keys(x).forEach(($)=>{this.res.writeHeader($,String(x[$]))}),this.res.end(v)}),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let f=e5(this.req).encodings(["gzip","deflate"]);if(!f){m(n);return}this.compress(n,f,(v,$)=>{if(v){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o(v);return}x["Content-Encoding"]=f,m($)})}compress(n,i,o){ei("compressing");let c=[],p=0;il[i](this.httpCompression).on("error",o).on("data",function(x){c.push(x),p+=x.length}).on("end",function(){o(null,Buffer.concat(c,p))}).end(n)}doClose(n){ei("closing");let i,o=()=>{clearTimeout(i),n(),this.onClose()};if(this.writable)ei("transport writable - closing right away"),this.send([{type:"close"}]),o();else if(this.discarded)ei("transport discarded - closing right away"),o();else ei("transport not writable - buffering orderly close"),this.shouldClose=o,i=setTimeout(o,this.closeTimeout)}headers(n,i){i=i||{};let o=n.headers["user-agent"];if(o&&(~o.indexOf(";MSIE")||~o.indexOf("Trident/")))i["X-XSS-Protection"]="0";return i["cache-control"]="no-store",this.emit("headers",i,n),i}}K8.Polling=W8});var Q8=C((H8)=>{Object.defineProperty(H8,"__esModule",{value:!0});H8.WebSocket=void 0;var ol=_c(),cl=fi(),M8=cl.default("engine:ws");class Y8 extends ol.Transport{constructor(n){super(n);this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(n){this.writable=!1;for(let i=0;i<n.length;i++){let o=n[i],c=i+1===n.length,p=(x)=>{let m=typeof x!=="string",a=this.perMessageDeflate&&Buffer.byteLength(x)>this.perMessageDeflate.threshold;if(M8('writing "%s"',x),this.socket.send(x,m,a),c)this.emit("drain"),this.writable=!0,this.emit("ready")};if(o.options&&typeof o.options.wsPreEncoded==="string")p(o.options.wsPreEncoded);else this.parser.encodePacket(o,this.supportsBinary,p)}}doClose(n){M8("closing"),n&&n(),this.socket.end()}}H8.WebSocket=Y8});var O8=C((E8)=>{Object.defineProperty(E8,"__esModule",{value:!0});var pl=G8(),xl=Q8();E8.default={polling:pl.Polling,websocket:xl.WebSocket}});var u8=C((_8)=>{Object.defineProperty(_8,"__esModule",{value:!0});_8.uServer=void 0;var al=fi(),bc=o$(),fl=O8(),pc=al.default("engine:uws");class U8 extends bc.BaseServer{init(){}cleanup(){}prepare(n,i){n.method=n.getMethod().toUpperCase(),n.url=n.getUrl();let o=new URLSearchParams(n.getQuery());n._query=Object.fromEntries(o.entries()),n.headers={},n.forEach((c,p)=>{n.headers[c]=p}),n.connection={remoteAddress:Buffer.from(i.getRemoteAddressAsText()).toString()},i.onAborted(()=>{pc("response has been aborted")})}createTransport(n,i){return new fl.default[n](i)}attach(n,i={}){let o=this._computePath(i);n.any(o,this.handleRequest.bind(this)).ws(o,{compression:i.compression,idleTimeout:i.idleTimeout,maxBackpressure:i.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:(c)=>{let p=c.getUserData().transport;p.socket=c,p.writable=!0,p.emit("ready")},message:(c,p,x)=>{c.getUserData().transport.onData(x?p:Buffer.from(p).toString())},close:(c,p,x)=>{c.getUserData().transport.onClose(p,x)}})}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return o();n.res=new V8(i),super._applyMiddlewares(n,n.res,(c)=>{n.res.writeHead(),o(c)})}handleRequest(n,i){pc('handling "%s" http request "%s"',i.getMethod(),i.getUrl()),this.prepare(i,n),i.res=n;let o=(c,p)=>{if(c!==void 0){this.emit("connection_error",{req:i,code:c,message:bc.Server.errorMessages[c],context:p}),this.abortRequest(i.res,c,p);return}if(i._query.sid)pc("setting new request for existing client"),this.clients[i._query.sid].transport.onRequest(i);else{let x=(m,a)=>this.abortRequest(n,m,a);this.handshake(i._query.transport,i,x)}};this._applyMiddlewares(i,n,(c)=>{if(c)o(bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!1,o)})}handleUpgrade(n,i,o){pc("on upgrade"),this.prepare(i,n),i.res=n;let c=async(p,x)=>{if(p!==void 0){this.emit("connection_error",{req:i,code:p,message:bc.Server.errorMessages[p],context:x}),this.abortRequest(n,p,x);return}let m=i._query.sid,a;if(m){let f=this.clients[m];if(!f)return pc("upgrade attempt for closed client"),n.close();else if(f.upgrading)return pc("transport has already been trying to upgrade"),n.close();else if(f.upgraded)return pc("transport had already been upgraded"),n.close();else pc("upgrading existing transport"),a=this.createTransport(i._query.transport,i),f._maybeUpgrade(a)}else if(a=await this.handshake(i._query.transport,i,(f,v)=>this.abortRequest(n,f,v)),!a)return;i.res.writeStatus("101 Switching Protocols"),n.upgrade({transport:a},i.getHeader("sec-websocket-key"),i.getHeader("sec-websocket-protocol"),i.getHeader("sec-websocket-extensions"),o)};this._applyMiddlewares(i,n,(p)=>{if(p)c(bc.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!0,c)})}abortRequest(n,i,o){let c=i===bc.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",p=o&&o.message?o.message:bc.Server.errorMessages[i];n.writeStatus(c),n.writeHeader("Content-Type","application/json"),n.end(JSON.stringify({code:i,message:p}))}}_8.uServer=U8;class V8{constructor(n){this.res=n,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(n){if(!n)return;this.writeStatus(n===200?"200 OK":"204 No Content")}writeHead(n){this.statusCode=n}setHeader(n,i){if(Array.isArray(i))i.forEach((o)=>{this.writeHeader(n,o)});else this.writeHeader(n,i)}removeHeader(){}getHeader(){}writeStatus(n){if(this.isAborted)return;return this.res.writeStatus(n),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(n,i){if(this.isAborted)return;if(n==="Content-Length")return;if(this.statusWritten)this.res.writeHeader(n,i);else this.headers.push([n,i])}writeBufferedHeaders(){this.headers.forEach(([n,i])=>{this.res.writeHeader(n,i)})}end(n){if(this.isAborted)return;this.res.cork(()=>{if(!this.statusWritten)this.writeBufferedHeaders();this.res.end(n)})}onData(n){if(this.isAborted)return;this.res.onData(n)}onAborted(n){if(this.isAborted)return;this.res.onAborted(()=>{this.isAborted=!0,n()})}cork(n){if(this.isAborted)return;this.res.cork(n)}}});var N8=C((zp)=>{Object.defineProperty(zp,"__esModule",{value:!0});zp.protocol=zp.Transport=zp.Socket=zp.uServer=zp.parser=zp.transports=zp.Server=void 0;zp.listen=Fl;zp.attach=D8;var vl=Kn("node:http"),B8=o$();Object.defineProperty(zp,"Server",{enumerable:!0,get:function(){return B8.Server}});var $l=gv();zp.transports=$l.default;var j8=ux();zp.parser=j8;var wl=u8();Object.defineProperty(zp,"uServer",{enumerable:!0,get:function(){return wl.uServer}});var Jl=ev();Object.defineProperty(zp,"Socket",{enumerable:!0,get:function(){return Jl.Socket}});var Al=_c();Object.defineProperty(zp,"Transport",{enumerable:!0,get:function(){return Al.Transport}});zp.protocol=j8.protocol;function Fl(n,i,o){if(typeof i==="function")o=i,i={};let c=vl.createServer(function(x,m){m.writeHead(501),m.end("Not Implemented")}),p=D8(c,i);return p.httpServer=c,c.listen(n,o),p}function D8(n,i){let o=new B8.Server(i);return o.attach(n,i),o}});var h8=C((Kl)=>{Kl.Emitter=Ei;function Ei(n){if(n)return Wl(n)}function Wl(n){for(var i in Ei.prototype)n[i]=Ei.prototype[i];return n}Ei.prototype.on=Ei.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};Ei.prototype.once=function(n,i){function o(){this.off(n,o),i.apply(this,arguments)}return o.fn=i,this.on(n,o),this};Ei.prototype.off=Ei.prototype.removeListener=Ei.prototype.removeAllListeners=Ei.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+n];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;var c;for(var p=0;p<o.length;p++)if(c=o[p],c===i||c.fn===i){o.splice(p,1);break}if(o.length===0)delete this._callbacks["$"+n];return this};Ei.prototype.emit=function(n){this._callbacks=this._callbacks||{};var i=new Array(arguments.length-1),o=this._callbacks["$"+n];for(var c=1;c<arguments.length;c++)i[c-1]=arguments[c];if(o){o=o.slice(0);for(var c=0,p=o.length;c<p;++c)o[c].apply(this,i)}return this};Ei.prototype.emitReserved=Ei.prototype.emit;Ei.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Ei.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var c$=C((y8)=>{Object.defineProperty(y8,"__esModule",{value:!0});y8.hasBinary=y8.isBinary=void 0;var Gl=typeof ArrayBuffer==="function",Ml=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},C8=Object.prototype.toString,Yl=typeof Blob==="function"||typeof Blob!=="undefined"&&C8.call(Blob)==="[object BlobConstructor]",Hl=typeof File==="function"||typeof File!=="undefined"&&C8.call(File)==="[object FileConstructor]";function I8(n){return Gl&&(n instanceof ArrayBuffer||Ml(n))||Yl&&n instanceof Blob||Hl&&n instanceof File}y8.isBinary=I8;function Ya(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Ya(n[o]))return!0;return!1}if(I8(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Ya(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Ya(n[o]))return!0;return!1}y8.hasBinary=Ya});var s8=C((Z8)=>{Object.defineProperty(Z8,"__esModule",{value:!0});Z8.reconstructPacket=Z8.deconstructPacket=void 0;var Ql=c$();function El(n){let i=[],o=n.data,c=n;return c.data=p$(o,i),c.attachments=i.length,{packet:c,buffers:i}}Z8.deconstructPacket=El;function p$(n,i){if(!n)return n;if(Ql.isBinary(n)){let o={_placeholder:!0,num:i.length};return i.push(n),o}else if(Array.isArray(n)){let o=new Array(n.length);for(let c=0;c<n.length;c++)o[c]=p$(n[c],i);return o}else if(typeof n==="object"&&!(n instanceof Date)){let o={};for(let c in n)if(Object.prototype.hasOwnProperty.call(n,c))o[c]=p$(n[c],i);return o}return n}function Ol(n,i){return n.data=x$(n.data,i),delete n.attachments,n}Z8.reconstructPacket=Ol;function x$(n,i){if(!n)return n;if(n&&n._placeholder===!0)if(typeof n.num==="number"&&n.num>=0&&n.num<i.length)return i[n.num];else throw new Error("illegal attachments");else if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o]=x$(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=x$(n[o],i)}return n}});var Dx=C((n6)=>{Object.defineProperty(n6,"__esModule",{value:!0});n6.Decoder=n6.Encoder=n6.PacketType=n6.protocol=void 0;var Vl=h8(),r8=s8(),d8=c$(),_l=fi(),m$=_l.default("socket.io-parser"),bl=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];n6.protocol=5;var yn;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(yn=n6.PacketType||(n6.PacketType={}));class g8{constructor(n){this.replacer=n}encode(n){if(m$("encoding packet %j",n),n.type===yn.EVENT||n.type===yn.ACK){if(d8.hasBinary(n))return this.encodeAsBinary({type:n.type===yn.EVENT?yn.BINARY_EVENT:yn.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id})}return[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;if(n.type===yn.BINARY_EVENT||n.type===yn.BINARY_ACK)i+=n.attachments+"-";if(n.nsp&&n.nsp!=="/")i+=n.nsp+",";if(n.id!=null)i+=n.id;if(n.data!=null)i+=JSON.stringify(n.data,this.replacer);return m$("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=r8.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}n6.Encoder=g8;function P8(n){return Object.prototype.toString.call(n)==="[object Object]"}class a$ extends Vl.Emitter{constructor(n){super();this.reviver=n}add(n){let i;if(typeof n==="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);let o=i.type===yn.BINARY_EVENT;if(o||i.type===yn.BINARY_ACK){if(i.type=o?yn.EVENT:yn.ACK,this.reconstructor=new e8(i),i.attachments===0)super.emitReserved("decoded",i)}else super.emitReserved("decoded",i)}else if(d8.isBinary(n)||n.base64){if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");else if(i=this.reconstructor.takeBinaryData(n),i)this.reconstructor=null,super.emitReserved("decoded",i)}else throw new Error("Unknown type: "+n)}decodeString(n){let i=0,o={type:Number(n.charAt(0))};if(yn[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===yn.BINARY_EVENT||o.type===yn.BINARY_ACK){let p=i+1;while(n.charAt(++i)!=="-"&&i!=n.length);let x=n.substring(p,i);if(x!=Number(x)||n.charAt(i)!=="-")throw new Error("Illegal attachments");o.attachments=Number(x)}if(n.charAt(i+1)==="/"){let p=i+1;while(++i){if(n.charAt(i)===",")break;if(i===n.length)break}o.nsp=n.substring(p,i)}else o.nsp="/";let c=n.charAt(i+1);if(c!==""&&Number(c)==c){let p=i+1;while(++i){let x=n.charAt(i);if(x==null||Number(x)!=x){--i;break}if(i===n.length)break}o.id=Number(n.substring(p,i+1))}if(n.charAt(++i)){let p=this.tryParse(n.substr(i));if(a$.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return m$("decoded %s as %j",n,o),o}tryParse(n){try{return JSON.parse(n,this.reviver)}catch(i){return!1}}static isPayloadValid(n,i){switch(n){case yn.CONNECT:return P8(i);case yn.DISCONNECT:return i===void 0;case yn.CONNECT_ERROR:return typeof i==="string"||P8(i);case yn.EVENT:case yn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&bl.indexOf(i[0])===-1);case yn.ACK:case yn.BINARY_ACK:return Array.isArray(i)}}destroy(){if(this.reconstructor)this.reconstructor.finishedReconstruction(),this.reconstructor=null}}n6.Decoder=a$;class e8{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){let i=r8.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var x6=C((c6)=>{Object.defineProperty(c6,"__esModule",{value:!0});c6.Client=void 0;var Ha=Dx(),jl=fi(),Dl=Kn("node:url"),wo=jl("socket.io:client");class o6{constructor(n,i){this.sockets=new Map,this.nsps=new Map,this.server=n,this.conn=i,this.encoder=n.encoder,this.decoder=new n._parser.Decoder,this.id=i.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout(()=>{if(this.nsps.size===0)wo("no namespace joined yet, close the client"),this.close();else wo("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(n,i={}){if(this.server._nsps.has(n))return wo("connecting to namespace %s",n),this.doConnect(n,i);this.server._checkNamespace(n,i,(o)=>{if(o)this.doConnect(n,i);else wo("creation of namespace %s was denied",n),this._packet({type:Ha.PacketType.CONNECT_ERROR,nsp:n,data:{message:"Invalid namespace"}})})}doConnect(n,i){let o=this.server.of(n);o._add(this,i,(c)=>{if(this.sockets.set(c.id,c),this.nsps.set(o.name,c),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0})}_disconnect(){for(let n of this.sockets.values())n.disconnect();this.sockets.clear(),this.close()}_remove(n){if(this.sockets.has(n.id)){let i=this.sockets.get(n.id).nsp.name;this.sockets.delete(n.id),this.nsps.delete(i)}else wo("ignoring remove for %s",n.id)}close(){if(this.conn.readyState==="open")wo("forcing transport close"),this.conn.close(),this.onclose("forced server close")}_packet(n,i={}){if(this.conn.readyState!=="open"){wo("ignoring packet write %j",n);return}let o=i.preEncoded?n:this.encoder.encode(n);this.writeToEngine(o,i)}writeToEngine(n,i){if(i.volatile&&!this.conn.transport.writable){wo("volatile packet is discarded since the transport is not currently writable");return}let o=Array.isArray(n)?n:[n];for(let c of o)this.conn.write(c,i)}ondata(n){try{this.decoder.add(n)}catch(i){wo("invalid packet format"),this.onerror(i)}}ondecoded(n){let i,o;if(this.conn.protocol===3){let p=Dl.parse(n.nsp,!0);i=p.pathname,o=p.query}else i=n.nsp,o=n.data;let c=this.nsps.get(i);if(!c&&n.type===Ha.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==Ha.PacketType.CONNECT&&n.type!==Ha.PacketType.CONNECT_ERROR)process.nextTick(function(){c._onpacket(n)});else wo("invalid state (packet type: %s)",n.type),this.close()}onerror(n){for(let i of this.sockets.values())i._onerror(n);this.conn.close()}onclose(n,i){wo("client close with reason %s",n),this.destroy();for(let o of this.sockets.values())o._onclose(n,i);this.sockets.clear(),this.decoder.destroy()}destroy(){if(this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout)clearTimeout(this.connectTimeout),this.connectTimeout=void 0}}c6.Client=o6});var za=C((a6)=>{Object.defineProperty(a6,"__esModule",{value:!0});a6.StrictEventEmitter=void 0;var Ll=Kn("node:events");class m6 extends Ll.EventEmitter{on(n,i){return super.on(n,i)}once(n,i){return super.once(n,i)}emit(n,...i){return super.emit(n,...i)}emitReserved(n,...i){return super.emit(n,...i)}emitUntyped(n,...i){return super.emit(n,...i)}listeners(n){return super.listeners(n)}}a6.StrictEventEmitter=m6});var f$=C((v6)=>{Object.defineProperty(v6,"__esModule",{value:!0});v6.RESERVED_EVENTS=void 0;v6.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var $$=C((w6)=>{Object.defineProperty(w6,"__esModule",{value:!0});w6.RemoteSocket=w6.BroadcastOperator=void 0;var Nl=f$(),hl=Dx();class Bo{constructor(n,i=new Set,o=new Set,c={}){this.adapter=n,this.rooms=i,this.exceptRooms=o,this.flags=c}to(n){let i=new Set(this.rooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new Bo(this.adapter,i,this.exceptRooms,this.flags)}in(n){return this.to(n)}except(n){let i=new Set(this.exceptRooms);if(Array.isArray(n))n.forEach((o)=>i.add(o));else i.add(n);return new Bo(this.adapter,this.rooms,i,this.flags)}compress(n){let i=Object.assign({},this.flags,{compress:n});return new Bo(this.adapter,this.rooms,this.exceptRooms,i)}get volatile(){let n=Object.assign({},this.flags,{volatile:!0});return new Bo(this.adapter,this.rooms,this.exceptRooms,n)}get local(){let n=Object.assign({},this.flags,{local:!0});return new Bo(this.adapter,this.rooms,this.exceptRooms,n)}timeout(n){let i=Object.assign({},this.flags,{timeout:n});return new Bo(this.adapter,this.rooms,this.exceptRooms,i)}emit(n,...i){if(Nl.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:hl.PacketType.EVENT,data:o};if(typeof o[o.length-1]!=="function")return this.adapter.broadcast(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let x=o.pop(),m=!1,a=[],f=setTimeout(()=>{m=!0,x.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:a])},this.flags.timeout),v=-1,$=0,w=0,J=()=>{if(!m&&v===$&&a.length===w)clearTimeout(f),x.apply(this,[null,this.flags.expectSingleResponse?a[0]:a])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(S)=>{w+=S,$++,J()},(S)=>{a.push(S),J()}),this.adapter.serverCount().then((S)=>{v=S,J()}),!0}emitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),this.emit(n,...i)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then((n)=>{return n.map((i)=>{if(i.server)return i;else return new v$(this.adapter,i)})})}socketsJoin(n){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}socketsLeave(n){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(n)?n:[n])}disconnectSockets(n=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},n)}}w6.BroadcastOperator=Bo;class v${constructor(n,i){this.id=i.id,this.handshake=i.handshake,this.rooms=new Set(i.rooms),this.data=i.data,this.operator=new Bo(n,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(n){return this.operator.timeout(n)}emit(n,...i){return this.operator.emit(n,...i)}join(n){return this.operator.socketsJoin(n)}leave(n){return this.operator.socketsLeave(n)}disconnect(n=!1){return this.operator.disconnectSockets(n),this}}w6.RemoteSocket=v$});var w$=C((Qp)=>{var T6=Qp&&Qp.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Qp,"__esModule",{value:!0});Qp.Socket=void 0;var no=Dx(),Il=T6(fi()),yl=za(),A6=T6(Dv()),kl=$$(),Zl=f$(),Gi=Il.default("socket.io:socket"),ql=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function F6(){}class R6 extends yl.StrictEventEmitter{constructor(n,i,o,c){super();if(this.nsp=n,this.client=i,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=n.server,this.adapter=this.nsp.adapter,c)this.id=c.sid,this.pid=c.pid,c.rooms.forEach((p)=>this.join(p)),this.data=c.data,c.missedPackets.forEach((p)=>{this.packet({type:no.PacketType.EVENT,data:p})}),this.recovered=!0;else{if(i.conn.protocol===3)this.id=n.name!=="/"?n.name+"#"+i.id:i.id;else this.id=A6.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=A6.default.generateId()}this.handshake=this.buildHandshake(o),this.on("error",F6)}buildHandshake(n){var i,o,c,p;return{headers:((i=this.request)===null||i===void 0?void 0:i.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!((o=this.request)===null||o===void 0?void 0:o.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(c=this.request)===null||c===void 0?void 0:c.url,query:((p=this.request)===null||p===void 0?void 0:p._query)||{},auth:n}}emit(n,...i){if(Zl.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:no.PacketType.EVENT,data:o};if(typeof o[o.length-1]==="function"){let x=this.nsp._ids++;Gi("emitting packet with ack id %d",x),this.registerAckCallback(x,o.pop()),c.id=x}let p=Object.assign({},this.flags);if(this.flags={},this.nsp.server.opts.connectionStateRecovery)this.adapter.broadcast(c,{rooms:new Set([this.id]),except:new Set,flags:p});else this.notifyOutgoingListeners(c),this.packet(c,p);return!0}emitWithAck(n,...i){let o=this.flags.timeout!==void 0;return new Promise((c,p)=>{i.push((x,m)=>{if(o)return x?p(x):c(m);else return c(x)}),this.emit(n,...i)})}registerAckCallback(n,i){let o=this.flags.timeout;if(o===void 0){this.acks.set(n,i);return}let c=setTimeout(()=>{Gi("event with ack id %d has timed out after %d ms",n,o),this.acks.delete(n),i.call(this,new Error("operation has timed out"))},o);this.acks.set(n,(...p)=>{clearTimeout(c),i.apply(this,[null,...p])})}to(n){return this.newBroadcastOperator().to(n)}in(n){return this.newBroadcastOperator().in(n)}except(n){return this.newBroadcastOperator().except(n)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}packet(n,i={}){n.nsp=this.nsp.name,i.compress=i.compress!==!1,this.client._packet(n,i)}join(n){return Gi("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return Gi("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(Gi("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3)this.packet({type:no.PacketType.CONNECT});else this.packet({type:no.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(n){switch(Gi("got packet %j",n),n.type){case no.PacketType.EVENT:this.onevent(n);break;case no.PacketType.BINARY_EVENT:this.onevent(n);break;case no.PacketType.ACK:this.onack(n);break;case no.PacketType.BINARY_ACK:this.onack(n);break;case no.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(n){let i=n.data||[];if(Gi("emitting event %j",i),n.id!=null)Gi("attaching ack callback to event"),i.push(this.ack(n.id));if(this._anyListeners&&this._anyListeners.length){let o=this._anyListeners.slice();for(let c of o)c.apply(this,i)}this.dispatch(i)}ack(n){let i=this,o=!1;return function(){if(o)return;let c=Array.prototype.slice.call(arguments);Gi("sending ack %j",c),i.packet({id:n,type:no.PacketType.ACK,data:c}),o=!0}}onack(n){let i=this.acks.get(n.id);if(typeof i=="function")Gi("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else Gi("bad ack %s",n.id)}ondisconnect(){Gi("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(Gi("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&ql.has(n))Gi("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data});this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",n,i);return}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=F6}_error(n){this.packet({type:no.PacketType.CONNECT_ERROR,data:n})}disconnect(n=!1){if(!this.connected)return this;if(n)this.client._disconnect();else this.packet({type:no.PacketType.DISCONNECT}),this._onclose("server namespace disconnect");return this}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(n){return this.flags.timeout=n,this}dispatch(n){Gi("dispatching an event %j",n),this.run(n,(i)=>{process.nextTick(()=>{if(i)return this._onerror(i);if(this.connected)super.emitUntyped.apply(this,n);else Gi("ignore packet received after disconnection")})})}use(n){return this.fns.push(n),this}run(n,i){if(!this.fns.length)return i();let o=this.fns.slice(0);function c(p){o[p](n,(x)=>{if(x)return i(x);if(!o[p+1])return i();c(p+1)})}c(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){let i=this._anyListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){let i=this._anyOutgoingListeners;for(let o=0;o<i.length;o++)if(n===i[o])return i.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let o of i)o.apply(this,n.data)}}newBroadcastOperator(){let n=Object.assign({},this.flags);return this.flags={},new kl.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}Qp.Socket=R6});var J$=C((jo)=>{var sl=jo&&jo.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(jo,"__esModule",{value:!0});jo.Namespace=jo.RESERVED_EVENTS=void 0;var S6=w$(),Pl=za(),tl=sl(fi()),Ii=$$(),Lx=tl.default("socket.io:namespace");jo.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class X6 extends Pl.StrictEventEmitter{constructor(n,i){super();this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=n,this.name=i,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this)}use(n){return this._fns.push(n),this}run(n,i){if(!this._fns.length)return i();let o=this._fns.slice(0);function c(p){o[p](n,(x)=>{if(x)return i(x);if(!o[p+1])return i();c(p+1)})}c(0)}to(n){return new Ii.BroadcastOperator(this.adapter).to(n)}in(n){return new Ii.BroadcastOperator(this.adapter).in(n)}except(n){return new Ii.BroadcastOperator(this.adapter).except(n)}async _add(n,i,o){var c;Lx("adding socket to nsp %s",this.name);let p=await this._createSocket(n,i);if(this._preConnectSockets.set(p.id,p),((c=this.server.opts.connectionStateRecovery)===null||c===void 0?void 0:c.skipMiddlewares)&&p.recovered&&n.conn.readyState==="open")return this._doConnect(p,o);this.run(p,(x)=>{process.nextTick(()=>{if(n.conn.readyState!=="open"){Lx("next called after client was closed - ignoring socket"),p._cleanup();return}if(x)if(Lx("middleware error, sending CONNECT_ERROR packet to the client"),p._cleanup(),n.conn.protocol===3)return p._error(x.data||x.message);else return p._error({message:x.message,data:x.data});this._doConnect(p,o)})})}async _createSocket(n,i){let{pid:o,offset:c}=i;if(this.server.opts.connectionStateRecovery&&typeof o==="string"&&typeof c==="string"){let p;try{p=await this.adapter.restoreSession(o,c)}catch(x){Lx("error while restoring session: %s",x)}if(p)return Lx("connection state recovered for sid %s",p.sid),new S6.Socket(this,n,i,p)}return new S6.Socket(this,n,i)}_doConnect(n,i){if(this._preConnectSockets.delete(n.id),this.sockets.set(n.id,n),n._onconnect(),i)i(n);this.emitReserved("connect",n),this.emitReserved("connection",n)}_remove(n){this.sockets.delete(n.id)||this._preConnectSockets.delete(n.id)}emit(n,...i){return new Ii.BroadcastOperator(this.adapter).emit(n,...i)}send(...n){return this.emit("message",...n),this}write(...n){return this.emit("message",...n),this}serverSideEmit(n,...i){if(jo.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);return i.unshift(n),this.adapter.serverSideEmit(i),!0}serverSideEmitWithAck(n,...i){return new Promise((o,c)=>{i.push((p,x)=>{if(p)return p.responses=x,c(p);else return o(x)}),this.serverSideEmit(n,...i)})}_onServerSideEmit(n){super.emitUntyped.apply(this,n)}allSockets(){return new Ii.BroadcastOperator(this.adapter).allSockets()}compress(n){return new Ii.BroadcastOperator(this.adapter).compress(n)}get volatile(){return new Ii.BroadcastOperator(this.adapter).volatile}get local(){return new Ii.BroadcastOperator(this.adapter).local}timeout(n){return new Ii.BroadcastOperator(this.adapter).timeout(n)}fetchSockets(){return new Ii.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(n){return new Ii.BroadcastOperator(this.adapter).socketsJoin(n)}socketsLeave(n){return new Ii.BroadcastOperator(this.adapter).socketsLeave(n)}disconnectSockets(n=!1){return new Ii.BroadcastOperator(this.adapter).disconnectSockets(n)}}jo.Namespace=X6});var H6=C((M6)=>{Object.defineProperty(M6,"__esModule",{value:!0});M6.yeast=M6.decode=M6.encode=void 0;var l6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Qa=64,G6={},W6=0,xc=0,K6;function A$(n){let i="";do i=l6[n%Qa]+i,n=Math.floor(n/Qa);while(n>0);return i}M6.encode=A$;function rl(n){let i=0;for(xc=0;xc<n.length;xc++)i=i*Qa+G6[n.charAt(xc)];return i}M6.decode=rl;function dl(){let n=A$(+new Date);if(n!==K6)return W6=0,K6=n;return n+"."+A$(W6++)}M6.yeast=dl;for(;xc<Qa;xc++)G6[l6[xc]]=xc});var R$=C((Q6)=>{var F$;Object.defineProperty(Q6,"__esModule",{value:!0});Q6.SessionAwareAdapter=Q6.Adapter=void 0;var n9=Kn("node:events"),i9=H6(),Ea=Kn("ws"),o9=typeof((F$=Ea===null||Ea===void 0?void 0:Ea.Sender)===null||F$===void 0?void 0:F$.frame)==="function";class T$ extends n9.EventEmitter{constructor(n){super();this.nsp=n,this.rooms=new Map,this.sids=new Map,this.encoder=n.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(n,i){if(!this.sids.has(n))this.sids.set(n,new Set);for(let o of i){if(this.sids.get(n).add(o),!this.rooms.has(o))this.rooms.set(o,new Set),this.emit("create-room",o);if(!this.rooms.get(o).has(n))this.rooms.get(o).add(n),this.emit("join-room",o,n)}}del(n,i){if(this.sids.has(n))this.sids.get(n).delete(i);this._del(i,n)}_del(n,i){let o=this.rooms.get(n);if(o!=null){if(o.delete(i))this.emit("leave-room",n,i);if(o.size===0&&this.rooms.delete(n))this.emit("delete-room",n)}}delAll(n){if(!this.sids.has(n))return;for(let i of this.sids.get(n))this._del(i,n);this.sids.delete(n)}broadcast(n,i){let o=i.flags||{},c={preEncoded:!0,volatile:o.volatile,compress:o.compress};n.nsp=this.nsp.name;let p=this._encode(n,c);this.apply(i,(x)=>{if(typeof x.notifyOutgoingListeners==="function")x.notifyOutgoingListeners(n);x.client.writeToEngine(p,c)})}broadcastWithAck(n,i,o,c){let p=i.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};n.nsp=this.nsp.name,n.id=this.nsp._ids++;let m=this._encode(n,x),a=0;this.apply(i,(f)=>{if(a++,f.acks.set(n.id,c),typeof f.notifyOutgoingListeners==="function")f.notifyOutgoingListeners(n);f.client.writeToEngine(m,x)}),o(a)}_encode(n,i){let o=this.encoder.encode(n);if(o9&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=Ea.Sender.frame(c,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return o}sockets(n){let i=new Set;return this.apply({rooms:n},(o)=>{i.add(o.id)}),Promise.resolve(i)}socketRooms(n){return this.sids.get(n)}fetchSockets(n){let i=[];return this.apply(n,(o)=>{i.push(o)}),Promise.resolve(i)}addSockets(n,i){this.apply(n,(o)=>{o.join(i)})}delSockets(n,i){this.apply(n,(o)=>{i.forEach((c)=>o.leave(c))})}disconnectSockets(n,i){this.apply(n,(o)=>{o.disconnect(i)})}apply(n,i){let o=n.rooms,c=this.computeExceptSids(n.except);if(o.size){let p=new Set;for(let x of o){if(!this.rooms.has(x))continue;for(let m of this.rooms.get(x)){if(p.has(m)||c.has(m))continue;let a=this.nsp.sockets.get(m);if(a)i(a),p.add(m)}}}else for(let[p]of this.sids){if(c.has(p))continue;let x=this.nsp.sockets.get(p);if(x)i(x)}}computeExceptSids(n){let i=new Set;if(n&&n.size>0){for(let o of n)if(this.rooms.has(o))this.rooms.get(o).forEach((c)=>i.add(c))}return i}serverSideEmit(n){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(n){}restoreSession(n,i){return null}}Q6.Adapter=T$;class z6 extends T${constructor(n){super(n);this.nsp=n,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=n.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let o=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((c,p)=>{if(c.disconnectedAt<o)this.sessions.delete(p)});for(let c=this.packets.length-1;c>=0;c--)if(this.packets[c].emittedAt<o){this.packets.splice(0,c+1);break}},60000).unref()}persistSession(n){n.disconnectedAt=Date.now(),this.sessions.set(n.pid,n)}restoreSession(n,i){let o=this.sessions.get(n);if(!o)return null;if(o.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(n),null;let p=this.packets.findIndex((m)=>m.id===i);if(p===-1)return null;let x=[];for(let m=p+1;m<this.packets.length;m++){let a=this.packets[m];if(c9(o.rooms,a.opts))x.push(a.data)}return Promise.resolve(Object.assign(Object.assign({},o),{missedPackets:x}))}broadcast(n,i){var o;let c=n.type===2,p=n.id===void 0,x=((o=i.flags)===null||o===void 0?void 0:o.volatile)===void 0;if(c&&p&&x){let m=i9.yeast();n.data.push(m),this.packets.push({id:m,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}Q6.SessionAwareAdapter=z6;function c9(n,i){let o=i.rooms.size===0||n.some((p)=>i.rooms.has(p)),c=n.every((p)=>!i.except.has(p));return o&&c}});var U6=C((Jo)=>{var x9=Jo&&Jo.__rest||function(n,i){var o={};for(var c in n)if(Object.prototype.hasOwnProperty.call(n,c)&&i.indexOf(c)<0)o[c]=n[c];if(n!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var p=0,c=Object.getOwnPropertySymbols(n);p<c.length;p++)if(i.indexOf(c[p])<0&&Object.prototype.propertyIsEnumerable.call(n,c[p]))o[c[p]]=n[c[p]]}return o};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.ClusterAdapterWithHeartbeat=Jo.ClusterAdapter=Jo.MessageType=void 0;var m9=R$(),a9=fi(),f9=Kn("node:crypto"),qn=a9.debug("socket.io-adapter"),v9="emitter",Oa=5000;function Op(){return f9.randomBytes(8).toString("hex")}var on;(function(n){n[n.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",n[n.HEARTBEAT=2]="HEARTBEAT",n[n.BROADCAST=3]="BROADCAST",n[n.SOCKETS_JOIN=4]="SOCKETS_JOIN",n[n.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",n[n.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",n[n.FETCH_SOCKETS=7]="FETCH_SOCKETS",n[n.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",n[n.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",n[n.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",n[n.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",n[n.BROADCAST_ACK=12]="BROADCAST_ACK",n[n.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(on=Jo.MessageType||(Jo.MessageType={}));function uc(n){return{rooms:[...n.rooms],except:[...n.except],flags:n.flags}}function Ep(n){return{rooms:new Set(n.rooms),except:new Set(n.except),flags:n.flags}}class S$ extends m9.Adapter{constructor(n){super(n);this.requests=new Map,this.ackRequests=new Map,this.uid=Op()}onMessage(n,i){if(n.uid===this.uid)return qn("[%s] ignore message from self",this.uid);switch(qn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case on.BROADCAST:{if(n.data.requestId!==void 0)super.broadcastWithAck(n.data.packet,Ep(n.data.opts),(c)=>{qn("[%s] waiting for %d client acknowledgements",this.uid,c),this.publishResponse(n.uid,{type:on.BROADCAST_CLIENT_COUNT,data:{requestId:n.data.requestId,clientCount:c}})},(c)=>{qn("[%s] received acknowledgement with value %j",this.uid,c),this.publishResponse(n.uid,{type:on.BROADCAST_ACK,data:{requestId:n.data.requestId,packet:c}})});else{let c=n.data.packet,p=Ep(n.data.opts);this.addOffsetIfNecessary(c,p,i),super.broadcast(c,p)}break}case on.SOCKETS_JOIN:super.addSockets(Ep(n.data.opts),n.data.rooms);break;case on.SOCKETS_LEAVE:super.delSockets(Ep(n.data.opts),n.data.rooms);break;case on.DISCONNECT_SOCKETS:super.disconnectSockets(Ep(n.data.opts),n.data.close);break;case on.FETCH_SOCKETS:{qn("[%s] calling fetchSockets with opts %j",this.uid,n.data.opts),super.fetchSockets(Ep(n.data.opts)).then((o)=>{this.publishResponse(n.uid,{type:on.FETCH_SOCKETS_RESPONSE,data:{requestId:n.data.requestId,sockets:o.map((c)=>{let p=c.handshake,{sessionStore:x}=p,m=x9(p,["sessionStore"]);return{id:c.id,handshake:m,rooms:[...c.rooms],data:c.data}})}})});break}case on.SERVER_SIDE_EMIT:{let o=n.data.packet;if(n.data.requestId===void 0){this.nsp._onServerSideEmit(o);return}let p=!1,x=(m)=>{if(p)return;p=!0,qn("[%s] calling acknowledgement with %j",this.uid,m),this.publishResponse(n.uid,{type:on.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:n.data.requestId,packet:m}})};this.nsp._onServerSideEmit([...o,x]);break}case on.BROADCAST_CLIENT_COUNT:case on.BROADCAST_ACK:case on.FETCH_SOCKETS_RESPONSE:case on.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(n);break;default:qn("[%s] unknown message type: %s",this.uid,n.type)}}onResponse(n){var i,o;let c=n.data.requestId;switch(qn("[%s] received response %s to request %s",this.uid,n.type,c),n.type){case on.BROADCAST_CLIENT_COUNT:{(i=this.ackRequests.get(c))===null||i===void 0||i.clientCountCallback(n.data.clientCount);break}case on.BROADCAST_ACK:{(o=this.ackRequests.get(c))===null||o===void 0||o.ack(n.data.packet);break}case on.FETCH_SOCKETS_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,n.data.sockets.forEach((x)=>p.responses.push(x)),p.current===p.expected)clearTimeout(p.timeout),p.resolve(p.responses),this.requests.delete(c);break}case on.SERVER_SIDE_EMIT_RESPONSE:{let p=this.requests.get(c);if(!p)return;if(p.current++,p.responses.push(n.data.packet),p.current===p.expected)clearTimeout(p.timeout),p.resolve(null,p.responses),this.requests.delete(c);break}default:qn("[%s] unknown response type: %s",this.uid,n.type)}}async broadcast(n,i){var o;if(!((o=i.flags)===null||o===void 0?void 0:o.local))try{let p=await this.publishAndReturnOffset({type:on.BROADCAST,data:{packet:n,opts:uc(i)}});this.addOffsetIfNecessary(n,i,p)}catch(p){return qn("[%s] error while broadcasting message: %s",this.uid,p.message)}super.broadcast(n,i)}addOffsetIfNecessary(n,i,o){var c;if(!this.nsp.server.opts.connectionStateRecovery)return;let p=n.type===2,x=n.id===void 0,m=((c=i.flags)===null||c===void 0?void 0:c.volatile)===void 0;if(p&&x&&m)n.data.push(o)}broadcastWithAck(n,i,o,c){var p;if(!((p=i===null||i===void 0?void 0:i.flags)===null||p===void 0?void 0:p.local)){let m=Op();this.ackRequests.set(m,{clientCountCallback:o,ack:c}),this.publish({type:on.BROADCAST,data:{packet:n,requestId:m,opts:uc(i)}}),setTimeout(()=>{this.ackRequests.delete(m)},i.flags.timeout)}super.broadcastWithAck(n,i,o,c)}async addSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.SOCKETS_JOIN,data:{opts:uc(n),rooms:i}})}catch(p){qn("[%s] error while publishing message: %s",this.uid,p.message)}super.addSockets(n,i)}async delSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.SOCKETS_LEAVE,data:{opts:uc(n),rooms:i}})}catch(p){qn("[%s] error while publishing message: %s",this.uid,p.message)}super.delSockets(n,i)}async disconnectSockets(n,i){var o;if(!((o=n.flags)===null||o===void 0?void 0:o.local))try{await this.publishAndReturnOffset({type:on.DISCONNECT_SOCKETS,data:{opts:uc(n),close:i}})}catch(p){qn("[%s] error while publishing message: %s",this.uid,p.message)}super.disconnectSockets(n,i)}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets(n),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let x=Op();return new Promise((m,a)=>{let f=setTimeout(()=>{let $=this.requests.get(x);if($)a(new Error(`timeout reached: only ${$.current} responses received out of ${$.expected}`)),this.requests.delete(x)},n.flags.timeout||Oa),v={type:on.FETCH_SOCKETS,resolve:m,timeout:f,current:0,expected:p,responses:o};this.requests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:uc(n),requestId:x}})})}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:on.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=await this.serverCount()-1;if(qn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),x=setTimeout(()=>{let a=this.requests.get(p);if(a)o(new Error(`timeout reached: only ${a.current} responses received out of ${a.expected}`),a.responses),this.requests.delete(p)},Oa),m={type:on.SERVER_SIDE_EMIT,resolve:o,timeout:x,current:0,expected:c,responses:[]};this.requests.set(p,m),this.publish({type:on.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}publish(n){this.publishAndReturnOffset(n).catch((i)=>{qn("[%s] error while publishing message: %s",this.uid,i)})}publishAndReturnOffset(n){return n.uid=this.uid,n.nsp=this.nsp.name,this.doPublish(n)}publishResponse(n,i){i.uid=this.uid,i.nsp=this.nsp.name,this.doPublishResponse(n,i).catch((o)=>{qn("[%s] error while publishing response: %s",this.uid,o)})}}Jo.ClusterAdapter=S$;class O6 extends S${constructor(n,i){super(n);this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5000,heartbeatTimeout:1e4},i),this.cleanupTimer=setInterval(()=>{let o=Date.now();this.nodesMap.forEach((c,p)=>{if(o-c>this._opts.heartbeatTimeout)qn("[%s] node %s seems down",this.uid,p),this.removeNode(p)})},1000)}init(){this.publish({type:on.INITIAL_HEARTBEAT})}scheduleHeartbeat(){if(this.heartbeatTimer)this.heartbeatTimer.refresh();else this.heartbeatTimer=setTimeout(()=>{this.publish({type:on.HEARTBEAT})},this._opts.heartbeatInterval)}close(){if(this.publish({type:on.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer)clearInterval(this.cleanupTimer)}onMessage(n,i){if(n.uid===this.uid)return qn("[%s] ignore message from self",this.uid);if(n.uid&&n.uid!==v9)this.nodesMap.set(n.uid,Date.now());switch(qn("[%s] new event of type %d from %s",this.uid,n.type,n.uid),n.type){case on.INITIAL_HEARTBEAT:this.publish({type:on.HEARTBEAT});break;case on.HEARTBEAT:break;case on.ADAPTER_CLOSE:this.removeNode(n.uid);break;default:super.onMessage(n,i)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(n){return this.scheduleHeartbeat(),super.publish(n)}async serverSideEmit(n){if(typeof n[n.length-1]!=="function")return this.publish({type:on.SERVER_SIDE_EMIT,data:{packet:n}});let o=n.pop(),c=this.nodesMap.size;if(qn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Op(),x=setTimeout(()=>{let a=this.customRequests.get(p);if(a)o(new Error(`timeout reached: missing ${a.missingUids.size} responses`),a.responses),this.customRequests.delete(p)},Oa),m={type:on.SERVER_SIDE_EMIT,resolve:o,timeout:x,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(p,m),this.publish({type:on.SERVER_SIDE_EMIT,data:{requestId:p,packet:n}})}async fetchSockets(n){var i;let[o,c]=await Promise.all([super.fetchSockets({rooms:n.rooms,except:n.except,flags:{local:!0}}),this.serverCount()]),p=c-1;if(((i=n.flags)===null||i===void 0?void 0:i.local)||p<=0)return o;let x=Op();return new Promise((m,a)=>{let f=setTimeout(()=>{let $=this.customRequests.get(x);if($)a(new Error(`timeout reached: missing ${$.missingUids.size} responses`)),this.customRequests.delete(x)},n.flags.timeout||Oa),v={type:on.FETCH_SOCKETS,resolve:m,timeout:f,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:uc(n),requestId:x}})})}onResponse(n){let i=n.data.requestId;switch(qn("[%s] received response %s to request %s",this.uid,n.type,i),n.type){case on.FETCH_SOCKETS_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(n.data.sockets.forEach((c)=>o.responses.push(c)),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(o.responses),this.customRequests.delete(i);break}case on.SERVER_SIDE_EMIT_RESPONSE:{let o=this.customRequests.get(i);if(!o)return;if(o.responses.push(n.data.packet),o.missingUids.delete(n.uid),o.missingUids.size===0)clearTimeout(o.timeout),o.resolve(null,o.responses),this.customRequests.delete(i);break}default:super.onResponse(n)}}removeNode(n){this.customRequests.forEach((i,o)=>{if(i.missingUids.delete(n),i.missingUids.size===0){if(clearTimeout(i.timeout),i.type===on.FETCH_SOCKETS)i.resolve(i.responses);else if(i.type===on.SERVER_SIDE_EMIT)i.resolve(null,i.responses);this.customRequests.delete(o)}}),this.nodesMap.delete(n)}}Jo.ClusterAdapterWithHeartbeat=O6});var Ua=C((Bc)=>{Object.defineProperty(Bc,"__esModule",{value:!0});Bc.MessageType=Bc.ClusterAdapterWithHeartbeat=Bc.ClusterAdapter=Bc.SessionAwareAdapter=Bc.Adapter=void 0;var V6=R$();Object.defineProperty(Bc,"Adapter",{enumerable:!0,get:function(){return V6.Adapter}});Object.defineProperty(Bc,"SessionAwareAdapter",{enumerable:!0,get:function(){return V6.SessionAwareAdapter}});var X$=U6();Object.defineProperty(Bc,"ClusterAdapter",{enumerable:!0,get:function(){return X$.ClusterAdapter}});Object.defineProperty(Bc,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return X$.ClusterAdapterWithHeartbeat}});Object.defineProperty(Bc,"MessageType",{enumerable:!0,get:function(){return X$.MessageType}})});var B6=C((Up)=>{var w9=Up&&Up.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Up,"__esModule",{value:!0});Up.ParentNamespace=void 0;var _6=J$(),J9=Ua(),A9=w9(fi()),b6=A9.default("socket.io:parent-namespace");class Va extends _6.Namespace{constructor(n){super(n,"/_"+Va.count++);this.children=new Set}_initAdapter(){this.adapter=new u6(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){b6("creating child namespace %s",n);let i=new _6.Namespace(this.server,n);if(this._fns.forEach((o)=>i.use(o)),this.listeners("connect").forEach((o)=>i.on("connect",o)),this.listeners("connection").forEach((o)=>i.on("connection",o)),this.children.add(i),this.server._opts.cleanupEmptyChildNamespaces){let o=i._remove;i._remove=(c)=>{if(o.call(i,c),i.sockets.size===0)b6("closing child namespace %s",n),i.adapter.close(),this.server._nsps.delete(i.name),this.children.delete(i)}}return this.server._nsps.set(n,i),this.server.sockets.emitReserved("new_namespace",i),i}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}}Up.ParentNamespace=Va;Va.count=0;class u6 extends J9.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var C6=C((Dc)=>{var F9=Dc&&Dc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.patchAdapter=R9;Dc.restoreAdapter=S9;Dc.serveFile=W9;var jc=Ua(),j6=Kn("node:fs"),T9=F9(fi()),_a=T9.default("socket.io:adapter-uws"),W$="\x1F",{addAll:L6,del:N6,broadcast:h6}=jc.Adapter.prototype;function R9(n){jc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);L6.call(this,i,o);let p=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(!p)return;if(p.conn.transport.name==="websocket"){D6(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let x=this.sids.get(i);if(x)D6(this.nsp.name,p,c,x)})},jc.Adapter.prototype.del=function(i,o){N6.call(this,i,o);let c=this.nsp.sockets.get(i)||this.nsp._preConnectSockets.get(i);if(c&&c.conn.transport.name==="websocket"){let p=c.conn.id,x=c.conn.transport.socket,m=`${this.nsp.name}${W$}${o}`;_a("unsubscribe connection %s from topic %s",p,m),x.unsubscribe(m)}},jc.Adapter.prototype.broadcast=function(i,o){if(!(o.rooms.size<=1&&o.except.size===0)){h6.call(this,i,o);return}let p=o.flags||{},x={preEncoded:!0,volatile:p.volatile,compress:p.compress};i.nsp=this.nsp.name;let m=this.encoder.encode(i),a=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${W$}${o.rooms.keys().next().value}`;_a("fast publish to %s",a),m.forEach((f)=>{let v=typeof f!=="string";n.publish(a,v?f:"4"+f,v)}),this.apply(o,(f)=>{if(f.conn.transport.name!=="websocket")f.client.writeToEngine(m,x)})}}function D6(n,i,o,c){let p=i.conn.id,x=i.conn.transport.socket;if(o)_a("subscribe connection %s to topic %s",p,n),x.subscribe(n);c.forEach((m)=>{let a=`${n}${W$}${m}`;_a("subscribe connection %s to topic %s",p,a),x.subscribe(a)})}function S9(){jc.Adapter.prototype.addAll=L6,jc.Adapter.prototype.del=N6,jc.Adapter.prototype.broadcast=h6}var X9=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function W9(n,i){let{size:o}=j6.statSync(i),c=j6.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),x=(a)=>{throw p(),a},m=(a)=>{let f=X9(a);n.cork(()=>{let v=n.getWriteOffset(),[$,w]=n.tryEnd(f,o);if(!w&&!$)c.pause(),n.onWritable((J)=>{let[S,X]=n.tryEnd(f.slice(J-v),o);if(!X&&S)c.resume();return S})})};n.onAborted(p),c.on("data",m).on("error",x).on("end",p)}});var I6=C((PL,K9)=>{K9.exports={name:"socket.io",version:"4.8.1",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --require ts-node/register --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.3.2","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var d6=C((Mi,Nx)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.1/node_modules/socket.io/dist",l9=Mi&&Mi.__createBinding||(Object.create?function(n,i,o,c){if(c===void 0)c=o;var p=Object.getOwnPropertyDescriptor(i,o);if(!p||("get"in p?!i.__esModule:p.writable||p.configurable))p={enumerable:!0,get:function(){return i[o]}};Object.defineProperty(n,c,p)}:function(n,i,o,c){if(c===void 0)c=o;n[c]=i[o]}),G9=Mi&&Mi.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),M9=Mi&&Mi.__importStar||function(n){if(n&&n.__esModule)return n;var i={};if(n!=null){for(var o in n)if(o!=="default"&&Object.prototype.hasOwnProperty.call(n,o))l9(i,n,o)}return G9(i,n),i},t6=Mi&&Mi.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.Namespace=Mi.Socket=Mi.Server=void 0;var Y9=Kn("node:http"),H9=Kn("node:fs"),K$=Kn("node:zlib"),z9=va(),ba=Kn("node:stream"),y6=Kn("node:path"),k6=N8(),Q9=x6(),Z6=Kn("node:events"),G$=J$();Object.defineProperty(Mi,"Namespace",{enumerable:!0,get:function(){return G$.Namespace}});var E9=B6(),q6=Ua(),O9=M9(Dx()),U9=t6(fi()),r6=w$();Object.defineProperty(Mi,"Socket",{enumerable:!0,get:function(){return r6.Socket}});var V9=za(),l$=C6(),_9=t6(i$()),Bi=U9.default("socket.io:server"),s6=I6().version,P6=/\.map/;class Vp extends V9.StrictEventEmitter{constructor(n,i={}){super();if(this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof n==="object"&&n instanceof Object&&!n.listen)i=n,n=void 0;if(this.path(i.path||"/socket.io"),this.connectTimeout(i.connectTimeout||45000),this.serveClient(i.serveClient!==!1),this._parser=i.parser||O9,this.encoder=new this._parser.Encoder,this.opts=i,i.connectionStateRecovery)i.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120000,skipMiddlewares:!0},i.connectionStateRecovery),this.adapter(i.adapter||q6.SessionAwareAdapter);else this.adapter(i.adapter||q6.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=_9.default(this.opts.cors)}get _opts(){return this.opts}serveClient(n){if(!arguments.length)return this._serveClient;return this._serveClient=n,this}_checkNamespace(n,i,o){if(this.parentNsps.size===0)return o(!1);let c=this.parentNsps.keys(),p=()=>{let x=c.next();if(x.done)return o(!1);x.value(n,i,(m,a)=>{if(m||!a)return p();if(this._nsps.has(n))return Bi("dynamic namespace %s already exists",n),o(this._nsps.get(n));let f=this.parentNsps.get(x.value).createChild(n);Bi("dynamic namespace %s was created",n),o(f)})};p()}path(n){if(!arguments.length)return this._path;this._path=n.replace(/\/$/,"");let i=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+i+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(n){if(n===void 0)return this._connectTimeout;return this._connectTimeout=n,this}adapter(n){if(!arguments.length)return this._adapter;this._adapter=n;for(let i of this._nsps.values())i._initAdapter();return this}listen(n,i={}){return this.attach(n,i)}attach(n,i={}){if(typeof n=="function")throw new Error("You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.");if(Number(n)==n)n=Number(n);if(typeof n=="number"){Bi("creating http server and binding to %d",n);let o=n;n=Y9.createServer((c,p)=>{p.writeHead(404),p.end()}),n.listen(o)}return Object.assign(i,this.opts),i.path=i.path||this._path,this.initEngine(n,i),this}attachApp(n,i={}){Object.assign(i,this.opts),i.path=i.path||this._path,Bi("creating uWebSockets.js-based engine with opts %j",i);let o=new k6.uServer(i);if(o.attach(n,i),this.bind(o),this._serveClient)n.get(`${this._path}/*`,(c,p)=>{if(!this.clientPathRegex.test(p.getUrl())){p.setYield(!0);return}let x=p.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),m=P6.test(x),a=m?"map":"source",f='"'+s6+'"',v="W/"+f,$=p.getHeader("if-none-match");if($){if(f===$||v===$){Bi("serve client %s 304",a),c.writeStatus("304 Not Modified"),c.end();return}}Bi("serve client %s",a),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(m?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",f);let w=y6.join(__dirname,"../client-dist/",x);l$.serveFile(c,w)});l$.patchAdapter(n)}initEngine(n,i){if(Bi("creating engine.io instance with opts %j",i),this.eio=k6.attach(n,i),this._serveClient)this.attachServe(n);this.httpServer=n,this.bind(this.eio)}attachServe(n){Bi("attaching client serving req handler");let i=n.listeners("request").slice(0);n.removeAllListeners("request"),n.on("request",(o,c)=>{if(this.clientPathRegex.test(o.url))if(this._corsMiddleware)this._corsMiddleware(o,c,()=>{this.serve(o,c)});else this.serve(o,c);else for(let p=0;p<i.length;p++)i[p].call(n,o,c)})}serve(n,i){let o=n.url.replace(this._path,"").replace(/\?.*$/,""),c=P6.test(o),p=c?"map":"source",x='"'+s6+'"',m="W/"+x,a=n.headers["if-none-match"];if(a){if(x===a||m===a){Bi("serve client %s 304",p),i.writeHead(304),i.end();return}}Bi("serve client %s",p),i.setHeader("Cache-Control","public, max-age=0"),i.setHeader("Content-Type","application/"+(c?"json":"javascript")+"; charset=utf-8"),i.setHeader("ETag",x),Vp.sendFile(o,n,i)}static sendFile(n,i,o){let c=H9.createReadStream(y6.join(__dirname,"../client-dist/",n)),p=z9(i).encodings(["br","gzip","deflate"]),x=(m)=>{if(m)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),ba.pipeline(c,K$.createBrotliCompress(),o,x);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),ba.pipeline(c,K$.createGzip(),o,x);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),ba.pipeline(c,K$.createDeflate(),o,x);break;default:o.writeHead(200),ba.pipeline(c,o,x)}}bind(n){return this.engine=n,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(n){Bi("incoming connection with id %s",n.id);let i=new Q9.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new E9.ParentNamespace(this);if(Bi("initializing parent namespace %s",c.name),typeof n==="function")this.parentNsps.set(n,c);else this.parentNsps.set((p,x,m)=>m(null,n.test(p)),c),this.parentNamespacesFromRegExp.set(n,c);if(i)c.on("connect",i);return c}if(String(n)[0]!=="/")n="/"+n;let o=this._nsps.get(n);if(!o){for(let[c,p]of this.parentNamespacesFromRegExp)if(c.test(n))return Bi("attaching namespace %s to parent namespace %s",n,c),p.createChild(n);if(Bi("initializing namespace %s",n),o=new G$.Namespace(this,n),this._nsps.set(n,o),n!=="/")this.sockets.emitReserved("new_namespace",o)}if(i)o.on("connect",i);return o}async close(n){if(await Promise.allSettled([...this._nsps.values()].map(async(i)=>{i.sockets.forEach((o)=>{o._onclose("server shutting down")}),await i.adapter.close()})),this.engine.close(),l$.restoreAdapter(),this.httpServer)this.httpServer.close(n);else n&&n()}use(n){return this.sockets.use(n),this}to(n){return this.sockets.to(n)}in(n){return this.sockets.in(n)}except(n){return this.sockets.except(n)}send(...n){return this.sockets.emit("message",...n),this}write(...n){return this.sockets.emit("message",...n),this}serverSideEmit(n,...i){return this.sockets.serverSideEmit(n,...i)}serverSideEmitWithAck(n,...i){return this.sockets.serverSideEmitWithAck(n,...i)}allSockets(){return this.sockets.allSockets()}compress(n){return this.sockets.compress(n)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(n){return this.sockets.timeout(n)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(n){return this.sockets.socketsJoin(n)}socketsLeave(n){return this.sockets.socketsLeave(n)}disconnectSockets(n=!1){return this.sockets.disconnectSockets(n)}}Mi.Server=Vp;var b9=Object.keys(Z6.EventEmitter.prototype).filter(function(n){return typeof Z6.EventEmitter.prototype[n]==="function"});b9.forEach(function(n){Vp.prototype[n]=function(){return this.sockets[n].apply(this.sockets,arguments)}});Nx.exports=(n,i)=>new Vp(n,i);Nx.exports.Server=Vp;Nx.exports.Namespace=G$.Namespace;Nx.exports.Socket=r6.Socket});import{createHash as pS}from"node:crypto";import{createServer as dM}from"node:http";import{createServer as gM}from"node:https";function am(n=Math.random){return n().toString(36).slice(2)}class cx extends Promise{fate;resolve;reject;done=!1;constructor(n){let i,o;super((c,p)=>{i=c,o=p});this.resolve=i,this.reject=o,this.use(n instanceof Promise?n:new Promise(n))}pass(n,i){if(n===this.fate)this.resolve(i),this.done=!0}fail(n,i){if(n===this.fate)this.reject(i),this.done=!0}use(n){if(n instanceof Promise){let i=n;this.fate=i,i.then((o)=>{this.pass(i,o)},(o)=>{this.fail(i,o)})}else this.resolve(n),this.fate=void 0}}function Y0(n){return Object.entries(n)}var H0=(n,i,o=g.STORE)=>{return Jf(o,{key:`${n.key}:JSON`,get:({get:c})=>i.toJson(c(n)),set:({set:c},p)=>{c(n,i.fromJson(p))}})};function j(n){while(n.child!==null)n=n.child;return n}class $n{Subscriber;subscribers=new Map;subscribe(n,i){return this.subscribers.set(n,i),()=>{this.unsubscribe(n)}}unsubscribe(n){this.subscribers.delete(n)}next(n){let i=this.subscribers.values();for(let o of i)o(n)}}class Af extends $n{state;constructor(n){super();this.state=n}next(n){this.state=n,super.next(n)}}function Jc(n,i,o){let c={key:i.key,type:"atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","atom_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=j(n),S=i.default,X={key:w,default:S instanceof Function?S(f):S};if(i.effects)X.effects=i.effects(f);let R=Ac(J,X,$);return x.next({type:"state_creation",token:R}),R},c,{subject:x,install:(f)=>Jc(f,i),internalRoles:o});return n.families.set(i.key,a),n.defaults.set(i.key,i.default),c}function z0(n,i){if("mutable"in i)return px(n,i);return Jc(n,i)}function Io(n,i,o){let c={key:i.key,type:"readonly_selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","readonly_selector_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=j(n),S=xx(J,{key:w,get:i.get(f)},$);return x.next({type:"state_creation",token:S}),S},c,{internalRoles:o,subject:x,install:(f)=>Io(f,i),default:(f)=>{return i.get(f)({get:(...$)=>Gn(n,...$),find:(...$)=>t(n,...$),json:($)=>ni(n,$)})}});return n.families.set(i.key,a),c}function Q0(n,i){if("set"in i)return mx(n,i);return Io(n,i)}class fm{_buffer;_index=0;constructor(n){let i;if(typeof n==="number")i=n;else i=n.length;this._buffer=Array.from({length:i})}get buffer(){return this._buffer}get index(){return this._index}add(n){this._buffer[this._index]=n,this._index=(this._index+1)%this._buffer.length}copy(){let n=new fm([...this._buffer]);return n._index=this._index,n}}var x3={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function E0(n,i){let o=wn(i),c=`${n.key}(${o})`,p=x3[n.type],x={key:c,type:p};return Object.assign(x,{family:{key:n.key,subKey:o}}),Object.assign(x,{counterfeit:!0}),x}function lo(n){let i={key:n.key,type:n.type};if("family"in n)i.family=n.family;return i}class ii{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(n,i)=>`${n}:${i}`;warn;getRelatedKeys(n){return this.relations.get(n)}addRelation(n,i){let o=this.relations.get(n),c=this.relations.get(i);if(o)o.add(i);else o=new Set([i]),this.relations.set(n,o);if(c)c.add(n);else c=new Set([n]),this.relations.set(i,c)}deleteRelation(n,i){let o=this.relations.get(n);if(o){if(o.delete(i),o.size===0)this.relations.delete(n);let c=this.relations.get(i);if(c){if(c.delete(n),c.size===0)this.relations.delete(i)}}}replaceRelationsUnsafely(n,i){this.relations.set(n,new Set(i));for(let o of i){let c=new Set().add(n);this.relations.set(o,c)}}replaceRelationsSafely(n,i){let o=this.relations.get(n),c=this.isAType?.(n)?n:void 0,p=c===void 0?n:void 0;if(o)for(let x of o){c??=x,p??=x;let m=this.relations.get(x);if(m){if(m.size===1)this.relations.delete(x);else m.delete(n);this.contents.delete(this.makeContentKey(c,p))}}this.relations.set(n,new Set(i));for(let x of i){let m=this.relations.get(x);if(m)m.add(n);else m=new Set().add(n),this.relations.set(x,m)}}getContentInternal(n){return this.contents.get(n)}setContent(n,i){this.contents.set(n,i)}deleteContent(n){this.contents.delete(n)}constructor(n,i){if(this.a=n.between[0],this.b=n.between[1],this.cardinality=n.cardinality,!i?.externalStore)this.relations=new Map(n.relations?.map(([o,c])=>[o,new Set(c)])),this.contents=new Map(n.contents);if(this.isAType=i?.isAType??null,this.isBType=i?.isBType??null,this.isContent=i?.isContent??null,i?.makeContentKey)this.makeContentKey=i.makeContentKey;if(i?.externalStore){let o=i.externalStore;if(this.has=(c,p)=>o.has(c,p),this.addRelation=(c,p)=>{o.addRelation(c,p)},this.deleteRelation=(c,p)=>{o.deleteRelation(c,p)},this.replaceRelationsSafely=(c,p)=>{o.replaceRelationsSafely(c,p)},this.replaceRelationsUnsafely=(c,p)=>{o.replaceRelationsUnsafely(c,p)},this.getRelatedKeys=(c)=>o.getRelatedKeys(c),o.getContent)this.getContentInternal=(c)=>{return o.getContent(c)},this.setContent=(c,p)=>{o.setContent(c,p)},this.deleteContent=(c)=>{o.deleteContent(c)};for(let[c,p]of n.relations??[]){let x=this.isAType?.(c)?c:void 0,m=x===void 0?c:void 0;for(let a of p)x??=a,m??=a,this.addRelation(x,m)}for(let[c,p]of n.contents??[])this.setContent(c,p)}if(i?.warn)this.warn=i.warn}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([n,i])=>[n,[...i]]),contents:[...this.contents.entries()]}}set(...n){let i,o,c;switch(n.length){case 1:{let p=n[0];i=p[this.a],o=p[this.b],c=void 0;break}case 2:{let p=n[0];if(typeof p==="string")[i,o]=n;else i=p[this.a],o=p[this.b],c=n[1];break}default:{i=n[0],o=n[1],c=n[2];break}}switch(this.cardinality){case"1:1":{let p=this.getRelatedKey(i);if(p&&p!==o)this.delete(i,p)}case"1:n":{let p=this.getRelatedKey(o);if(p&&p!==i)this.delete(p,o)}break;case"n:n":}if(c){let p=this.makeContentKey(i,o);this.setContent(p,c)}return this.addRelation(i,o),this}delete(n,i){i=typeof i==="string"?i:n[this.b];let o=typeof n==="string"?n:n[this.a];if(o===void 0&&typeof i==="string"){let c=this.getRelatedKeys(i);if(c)for(let p of c)this.delete(p,i)}if(typeof o==="string"&&i===void 0){let c=this.getRelatedKeys(o);if(c)for(let p of c)this.delete(o,p)}if(typeof o==="string"&&typeof i==="string"){this.deleteRelation(o,i);let c=this.makeContentKey(o,i);this.deleteContent(c)}return this}getRelatedKey(n){let i=this.getRelatedKeys(n);if(i){if(i.size>1)this.warn?.(`${i.size} related keys were found for key "${n}": (${[...i].map((c)=>`"${c}"`).join(", ")}). Only one related key was expected.`);let o;for(let c of i){o=c;break}return o}}replaceRelations(n,i,o){let c=!Array.isArray(i),p=c?Object.keys(i):i;if(o?.reckless)this.replaceRelationsUnsafely(n,p);else this.replaceRelationsSafely(n,p);if(c)for(let x of p){let m=this.makeContentKey(n,x),a=i[x];this.setContent(m,a)}return this}getContent(n,i){let o=this.makeContentKey(n,i);return this.getContentInternal(o)}getRelationEntries(n){let i=n[this.a],o=n[this.b];if(i!==void 0&&o===void 0){let c=this.getRelatedKeys(i);if(c)return[...c].map((p)=>{return[p,this.getContent(i,p)]})}if(i===void 0&&o!==void 0){let c=this.getRelatedKeys(o);if(c)return[...c].map((p)=>{return[p,this.getContent(p,o)]})}return[]}has(n,i){if(i)return this.getRelatedKeys(n)?.has(i)??!1;return this.relations.has(n)}}function $i(n){return"epoch"in n.transactionMeta}function Mn(n){return"phase"in n.transactionMeta}var O0=(n)=>{let i=j(n);if(!Mn(i)){n.logger.warn("\uD83D\uDC1E","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.logger.info("\uD83E\uDE82","transaction",i.transactionMeta.update.key,"Aborting transaction"),i.parent.child=null};function Yn(n){return n[0].toUpperCase()+n.slice(1)}function Ko(n){return n.type.split("_").map(Yn).join(" ")}class Fc extends Error{constructor(n,i){super(`${Ko(n)} ${wn(n.key)} not found in store "${i.config.name}".`)}}function dc(n,i,o){return(...c)=>{let p=Tn(n,i);if(p)return p.run(c,o);throw new Fc(i,n)}}var vm=(n)=>(i)=>n instanceof Function?n(i):n;var yo=(n,i)=>{if(n.valueMap.has(i.key))return n.logger.info("\uD83D\uDCD6",i.type,i.key,"reading cached value"),U0(i,n);switch(i.type){case"selector":case"readonly_selector":return n.logger.info("\uD83E\uDDEE",i.type,i.key,"computing value"),i.get();case"atom":case"mutable_atom":{let o=i.default,c;if(o instanceof Function)c=o();else c=o;return n.logger.info("\uD83D\uDC81","atom",i.key,"could not find cached value; using default",c),c}}};var V0=(n,i)=>{if(n.operation.open){let o=performance.now();return n.logger.info("\u2757",i.type,i.key,`deferring setState at T-${o} until setState for "${n.operation.token.key}" is done`),o}n.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:i},n.logger.info("\u2B55",i.type,i.key,`operation start in store "${n.config.name}"${!Mn(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},_0=(n)=>{if(n.operation.open)n.logger.info("\uD83D\uDD34",n.operation.token.type,n.operation.token.key,`operation done in store "${n.config.name}"`);n.operation={open:!1},n.on.operationClose.next(n.operation)},b0=(n,i)=>{if(!n.operation.open)return n.logger.error("\uD83D\uDC1E","unknown",i,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0;return n.operation.done.has(i)},gc=(n,i)=>{if(!n.operation.open){n.logger.error("\uD83D\uDC1E","unknown",i,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}n.operation.done.add(i)};var u0=(n,i,o)=>{switch(i.type){case"mutable_atom":n.logger.info("\uD83D\uDCE2",i.type,i.key,"is now (",o.newValue,") subscribers:",i.subject.subscribers);break;case"atom":case"selector":case"readonly_selector":n.logger.info("\uD83D\uDCE2",i.type,i.key,"went (",o.oldValue,"->",o.newValue,") subscribers:",i.subject.subscribers)}i.subject.next(o)};var Ff=(n,i)=>{let o=j(n),c=o.selectorAtoms.getRelatedKeys(i.key);if(o.logger.info("\uD83E\uDDF9",i.type,i.key,c?`evicting ${c.size} states downstream:`:"no downstream states",c??"to evict"),c){if(o.operation.open)o.logger.info("\uD83E\uDDF9",i.type,i.key,`[ ${[...o.operation.done].join(", ")} ] already done`);for(let p of c){if(b0(o,p))continue;B0(p,o),gc(o,p)}}};var j0=(n,i,o)=>{let c=yo(n,i),p=c;if(i.type==="mutable_atom"&&Mn(n)){let{parent:m}=n;p=ax(n,i,m)}if(p=vm(o)(p),n.logger.info("\uD83D\uDCDD","atom",i.key,"set to",p),p=Zi(n,i.key,p,i.subject),L0(n,i.key))N0(n,i.key);gc(n,i.key),Ff(n,i);let x={oldValue:c,newValue:p};if(!Mn(n)){u0(n,i,x);return}if(n.on.transactionApplying.state===null){let{key:m}=i;if(D0(x.newValue))return;let a={type:"atom_update",key:m,...x};if(i.family)a.family=i.family;n.transactionMeta.update.updates.push(a),n.logger.info("\uD83D\uDCC1","atom",m,"stowed (",x.oldValue,"->",x.newValue,")")}else if(i.key.startsWith("*")){let m=i.key.slice(1),a=n.atoms.get(m),f=n.valueMap.get(m);if(a.type==="mutable_atom"&&Mn(n)){let{parent:$}=n;f=ax(n,a,$)}if(f.do(x.newValue)===null)Ff(n,a)}};var $m=(n,i,o)=>{switch(i.type){case"atom":case"mutable_atom":j0(n,i,o);break;case"selector":i.set(o);break}};function h0(n,i){if(i.family){let o=n.families.get(i.family.key);if(o)return o}}function On(n,...i){let o,c,p,x;if(i.length===2){if(o=i[0],x=i[1],c=h0(n,o)??null,c)p=o.family?xi(o.family.subKey):null,o=t(n,c,p)}else c=i[0],p=i[1],x=i[2],o=t(n,c,p);if("counterfeit"in o&&"family"in o){let f=o.family.subKey,v=n.disposalTraces.buffer.find(($)=>$?.key===f);n.logger.error("\u274C",o.type,o.key,`could not be set because it was not found in the store "${n.config.name}".`,v?`This state was previously disposed:
48
+ ${v.trace}`:"No previous disposal trace was found.");return}let m=V0(n,o);if(m){let f=n.on.operationClose.subscribe(`waiting to set "${o.key}" at T-${m}`,()=>{f(),n.logger.info("\uD83D\uDFE2",o.type,o.key,`resuming deferred setState from T-${m}`),On(n,o,x)});return}let a=Tn(n,o);$m(n,a,x),_0(n)}function wm(n,i,o){let{key:c,newValue:p,oldValue:x}=i,m=n==="newValue"?p:x,a={key:c,type:"atom"};if(i.family)Object.assign(a,{family:i.family});On(o,a,m)}function C0(n){let{stack:i}=n;if(i)return`
49
49
  `+i.split(`
50
50
  `)?.slice(1)?.join(`
51
- `);return""}function C0(n,i=d.STORE){let o={key:n,stringKey:wn(n),dependsOn:"any"};return i.molecules.set(wn(n),o),n}function Fc(n,i,o,c="any"){let p=i,x=wn(o),m=[],a=D(n);if(Array.isArray(p))for(let $ of p){let w=wn($);if(a.molecules.get(w))n.moleculeGraph.set(w,x,{source:w});else m.push(w)}else{let $=wn(p);if(a.molecules.get($))n.moleculeGraph.set($,x,{source:$});else m.push($)}if(m.length===0)a.molecules.set(x,{key:o,stringKey:x,dependsOn:c});let f={type:"molecule_creation",key:o,provenance:p};if(Yn(a)&&a.transactionMeta.phase==="building")a.transactionMeta.update.updates.push(f);else a.on.moleculeCreation.next(f);for(let $ of m){let w=n.disposalTraces.buffer.find((J)=>J?.key===$);n.logger.error("\u274C","molecule",o,"allocation failed:",`Could not allocate to ${$} in store "${n.config.name}".`,w?`
51
+ `);return""}function I0(n,i=g.STORE){let o={key:n,stringKey:wn(n),dependsOn:"any"};return i.molecules.set(wn(n),o),n}function Tc(n,i,o,c="any"){let p=i,x=wn(o),m=[],a=j(n);if(Array.isArray(p))for(let $ of p){let w=wn($);if(a.molecules.get(w))n.moleculeGraph.set(w,x,{source:w});else m.push(w)}else{let $=wn(p);if(a.molecules.get($))n.moleculeGraph.set($,x,{source:$});else m.push($)}if(m.length===0)a.molecules.set(x,{key:o,stringKey:x,dependsOn:c});let f={type:"molecule_creation",key:o,provenance:p};if(Mn(a)&&a.transactionMeta.phase==="building")a.transactionMeta.update.updates.push(f);else a.on.moleculeCreation.next(f);for(let $ of m){let w=n.disposalTraces.buffer.find((J)=>J?.key===$);n.logger.error("\u274C","molecule",o,"allocation failed:",`Could not allocate to ${$} in store "${n.config.name}".`,w?`
52
52
  ${$} was most recently disposed
53
- ${w.trace}`:`No previous disposal trace for ${$} was found.`)}return o}function I0(n,i,o,c){let p=`T$--${i}==${o}++${c}`;return Fc(n,[o,c],p,"all"),p}function Rc(n,i){let o=wn(i),c=n.molecules.get(o);if(!c){let l=n.disposalTraces.buffer.find((S)=>S?.key===o);n.logger.error("\u274C","molecule",i,"deallocation failed:",`Could not find allocation for ${o} in store "${n.config.name}".`,l?`
53
+ ${w.trace}`:`No previous disposal trace for ${$} was found.`)}return o}function y0(n,i,o,c){let p=`T$--${i}==${o}++${c}`;return Tc(n,[o,c],p,"all"),p}function Rc(n,i){let o=wn(i),c=n.molecules.get(o);if(!c){let S=n.disposalTraces.buffer.find((X)=>X?.key===o);n.logger.error("\u274C","molecule",i,"deallocation failed:",`Could not find allocation for ${o} in store "${n.config.name}".`,S?`
54
54
  This state was most recently deallocated
55
- ${l.trace}`:`No previous disposal trace for ${o} was found.`);return}let p=n.moleculeJoins.getRelatedKeys(c.key);if(p)for(let l of p){let S=n.joins.get(l);if(S)S.relations.delete(c.key),S.molecules.delete(c.stringKey)}n.moleculeJoins.delete(c.stringKey);let x=[],m=[],a={type:"molecule_disposal",key:c.key,values:m,provenance:x},f=D(n);f.molecules.delete(o);let v=Yn(f)&&f.transactionMeta.phase==="building";if(v)f.transactionMeta.update.updates.push(a);let $=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey});if($)for(let[l,{source:S}]of $)if(S===c.stringKey){let R=xi(l);Rc(n,R)}else x.push(S);let w=f.moleculeData.getRelatedKeys(c.stringKey);if(w)for(let l of w){let S=f.families.get(l),R=t(n,S,c.key);m.push([S.key,R]),lc(n,R)}if(f.moleculeGraph.delete(c.stringKey),f.moleculeJoins.delete(c.stringKey),f.moleculeData.delete(c.stringKey),!v)f.on.moleculeDisposal.next(a);f.molecules.delete(c.stringKey);let J=h0(new Error);n.disposalTraces.add({key:o,trace:J})}function ec(n,i,o,c){let p=wn(o),x=D(n),m=x.molecules.get(p);if(!m){let J=n.disposalTraces.buffer.find((l)=>l?.key===p);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${p} in store "${n.config.name}".`,J?`
55
+ ${S.trace}`:`No previous disposal trace for ${o} was found.`);return}let p=n.moleculeJoins.getRelatedKeys(c.key);if(p)for(let S of p){let X=n.joins.get(S);if(X)X.relations.delete(c.key),X.molecules.delete(c.stringKey)}n.moleculeJoins.delete(c.stringKey);let x=[],m=[],a={type:"molecule_disposal",key:c.key,values:m,provenance:x},f=j(n);f.molecules.delete(o);let v=Mn(f)&&f.transactionMeta.phase==="building";if(v)f.transactionMeta.update.updates.push(a);let $=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey});if($)for(let[S,{source:X}]of $)if(X===c.stringKey){let R=xi(S);Rc(n,R)}else x.push(X);let w=f.moleculeData.getRelatedKeys(c.stringKey);if(w)for(let S of w){let X=f.families.get(S),R=t(n,X,c.key);m.push([X.key,R]),Sc(n,R)}if(f.moleculeGraph.delete(c.stringKey),f.moleculeJoins.delete(c.stringKey),f.moleculeData.delete(c.stringKey),!v)f.on.moleculeDisposal.next(a);f.molecules.delete(c.stringKey);let J=C0(new Error);n.disposalTraces.add({key:o,trace:J})}function ec(n,i,o,c){let p=wn(o),x=j(n),m=x.molecules.get(p);if(!m){let J=n.disposalTraces.buffer.find((S)=>S?.key===p);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${p} in store "${n.config.name}".`,J?`
56
56
  ${p} was most recently disposed
57
- ${J.trace}`:`No previous disposal trace for ${p} was found.`),o}let a=wn(i),f=x.molecules.get(a);if(!f){let J=n.disposalTraces.buffer.find((l)=>l?.key===a);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${a} in store "${n.config.name}".`,J?`
57
+ ${J.trace}`:`No previous disposal trace for ${p} was found.`),o}let a=wn(i),f=x.molecules.get(a);if(!f){let J=n.disposalTraces.buffer.find((S)=>S?.key===a);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${a} in store "${n.config.name}".`,J?`
58
58
  ${a} was most recently disposed
59
- ${J.trace}`:`No previous disposal trace for ${a} was found.`),o}let v=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:m.stringKey}).filter(([,{source:J}])=>J!==p).map(([J])=>xi(J));if(c)x.moleculeGraph.delete(p);x.moleculeGraph.set({upstreamMoleculeKey:f.stringKey,downstreamMoleculeKey:m.stringKey},{source:f.stringKey});let $={type:"molecule_transfer",key:m.key,from:v,to:[f.key]};if(Yn(x)&&x.transactionMeta.phase==="building")x.transactionMeta.update.updates.push($);return o}function Tf(n,i,o){switch(i){case"newValue":{y0(n,o);break}case"oldValue":{lc(o,n.token);break}}}function Ff(n,i,o){switch(i){case"newValue":{lc(o,n.token);break}case"oldValue":{if(y0(n,o),n.subType==="atom")o.valueMap.set(n.token.key,n.value);break}}}function y0(n,i){let{family:o}=n.token;if(o){let c=i.families.get(o.key);if(c)t(i,c,xi(o.subKey))}}function k0(n,i,o){switch(i){case"newValue":Fc(o,n.provenance,n.key);break;case"oldValue":Rc(o,n.key);break}}function Z0(n,i,o){switch(i){case"newValue":Rc(o,n.key);break;case"oldValue":{let c=n.provenance.map(xi);Fc(o,c,n.key);for(let[p,x]of n.values){let m=o.families.get(p);if(m){t(o,m,n.key);let a=`${p}(${wn(n.key)})`;o.valueMap.set(a,x)}}}break}}function s0(n,i,o){switch(i){case"newValue":{let c=n.to.length===1?n.to[0]:n.to;ec(o,c,n.key,"exclusive")}break;case"oldValue":{let c=n.from.length===1?n.from[0]:n.from;ec(o,c,n.key,"exclusive")}break}}function wm(n,i,o){let c=n==="newValue"?i.updates:[...i.updates].reverse();for(let p of c)switch(p.type){case"atom_update":case"selector_update":$m(n,p,o);break;case"state_creation":Tf(p,n,o);break;case"state_disposal":Ff(p,n,o);break;case"molecule_creation":k0(p,n,o);break;case"molecule_disposal":Z0(p,n,o);break;case"molecule_transfer":s0(p,n,o);break;case"transaction_update":wm(n,p,o);break}}function Rf(n,i){return n.transactionMeta.actionContinuities.getRelatedKey(i)}function nS(n,i){return n.transactionMeta.epoch.get(i)}function q0(n,i){if(!$i(n))return;let c=Rf(n,i);if(c===void 0)return;return nS(n,c)}function P0(n,i,o){if($i(n)&&i)n.transactionMeta.epoch.set(i,o)}function t0(n,i,o){if(!$i(n))return;let p=Rf(n,i);if(p!==void 0)n.transactionMeta.epoch.set(p,o)}var r0=(n,i)=>{let o=D(i),{parent:c}=o;if(c===null||!Yn(o)||o.transactionMeta?.phase!=="building"){i.logger.warn("\uD83D\uDC1E","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}o.transactionMeta.phase="applying",o.transactionMeta.update.output=n,c.child=null,c.on.transactionApplying.next(o.transactionMeta);let{updates:p}=o.transactionMeta.update;if(i.logger.info("\uD83D\uDEC4","transaction",o.transactionMeta.update.key,`Applying transaction with ${p.length} updates:`,p),wm("newValue",o.transactionMeta.update,c),$i(c))t0(c,o.transactionMeta.update.key,o.transactionMeta.update.epoch),Fn(i,{key:o.transactionMeta.update.key,type:"transaction"})?.subject.next(o.transactionMeta.update),i.logger.info("\uD83D\uDEEC","transaction",o.transactionMeta.update.key,"Finished applying transaction.");else if(Yn(c))c.transactionMeta.update.updates.push(o.transactionMeta.update);c.on.transactionApplying.next(null)};function g0(n,i,o){if(!$i(n))return;let{epoch:p,actionContinuities:x}=n.transactionMeta;if(x.set(i,o),!p.has(i))p.set(i,-1)}function d0(n){return{store:n}}function Gn(n,...i){let o,c,p;if(i.length===1)o=i[0];else c=i[0],p=i[1],o=t(n,c,p);if("counterfeit"in o&&"family"in o){c=n.families.get(o.family.key);let x=o.family.subKey,m=n.disposalTraces.buffer.find((a)=>a?.key===x);switch(n.logger.error("\u274C",o.type,o.key,`could not be retrieved because it was not found in the store "${n.config.name}".`,m?`This state was previously disposed:
60
- ${m.trace}`:"No previous disposal trace was found."),c.type){case"atom_family":case"mutable_atom_family":return n.defaults.get(c.key);case"selector_family":case"readonly_selector_family":{if(n.defaults.has(c.key))return n.defaults.get(o.family.key);let a=Fn(n,c).default(x);return n.defaults.set(c.key,a),a}}}return yo(n,Fn(n,o))}class Zi extends Map{deleted=new Set;source;constructor(n){super();this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n);return}set(n,i){return this.deleted.delete(n),super.set(n,i)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}var e0=(n,i,o,c)=>{let p=D(n),x={parent:p,child:null,on:p.on,loggers:p.loggers,logger:p.logger,config:p.config,atoms:new Zi(p.atoms),atomsThatAreDefault:new Set(p.atomsThatAreDefault),families:new Zi(p.families),joins:new Zi(p.joins),operation:{open:!1},readonlySelectors:new Zi(p.readonlySelectors),timelines:new Zi(p.timelines),timelineTopics:new ii(p.timelineTopics.toJSON()),trackers:new Map,transactions:new Zi(p.transactions),selectorAtoms:new ii(p.selectorAtoms.toJSON()),selectorGraph:new ii(p.selectorGraph.toJSON(),{makeContentKey:(...v)=>v.sort().join(":")}),selectors:new Zi(p.selectors),valueMap:new Zi(p.valueMap),defaults:p.defaults,disposalTraces:n.disposalTraces.copy(),molecules:new Zi(p.molecules),moleculeGraph:new ii(p.moleculeGraph.toJSON(),{makeContentKey:p.moleculeGraph.makeContentKey}),moleculeData:new ii(p.moleculeData.toJSON(),{makeContentKey:p.moleculeData.makeContentKey}),moleculeJoins:new ii(p.moleculeJoins.toJSON(),{makeContentKey:p.moleculeJoins.makeContentKey}),miscResources:new Zi(p.miscResources)},m=q0(n,i),a={phase:"building",update:{type:"transaction_update",key:i,id:c,epoch:m===void 0?Number.NaN:m+1,updates:[],params:o,output:void 0},toolkit:{get:(...v)=>Gn(f,...v),set:(...v)=>{On(f,...v)},run:(v,$=mm())=>gc(f,v,$),find:(v,$)=>t(f,v,$),json:(v)=>ni(f,v),dispose:(...v)=>{lc(f,...v)},env:()=>d0(f)}},f=Object.assign(x,{transactionMeta:a});return p.child=f,n.logger.info("\uD83D\uDEEB","transaction",i,"Building transaction with params:",o),f};function lf(n,i){let o={key:i.key,type:"transaction",run:(x,m)=>{let a=e0(n,i.key,x,m);try{let f=D(n),{toolkit:v}=a.transactionMeta,$=i.do(v,...x);return r0($,f),$}catch(f){throw E0(c),n.logger.warn("\uD83D\uDCA5","transaction",i.key,"caught:",f),f}},install:(x)=>lf(x,i),subject:new $n},c=D(n);c.transactions.set(o.key,o);let p=Ko(o);return n.on.transactionCreation.next(p),p}class n1{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;selectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new ii({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new ii({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});trackers=new Map;families=new Map;joins=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new ii({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new ii({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new am(100);molecules=new Map;moleculeJoins=new ii({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeGraph=new ii({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeData=new ii({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});miscResources=new Map;on={atomCreation:new $n,atomDisposal:new $n,selectorCreation:new $n,selectorDisposal:new $n,timelineCreation:new $n,transactionCreation:new $n,transactionApplying:new Jf(null),operationClose:new $n,moleculeCreation:new $n,moleculeDisposal:new $n};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Sc("warn",(n,i,o)=>!i1(o))];logger={error:(...n)=>{for(let i of this.loggers)i.error(...n)},info:(...n)=>{for(let i of this.loggers)i.info(...n)},warn:(...n)=>{for(let i of this.loggers)i.warn(...n)}};constructor(n,i=null){if(this.config={...i?.config,...n},i!==null){if(this.valueMap=new Map(i?.valueMap),this.operation={...i?.operation},$i(i))this.transactionMeta={epoch:new Map(i?.transactionMeta.epoch),actionContinuities:new ii(i?.transactionMeta.actionContinuities.toJSON())};for(let[,c]of i.families){if(c.internalRoles?.includes("mutable")||c.internalRoles?.includes("join"))continue;c.install(this)}let o=new Set;for(let[,c]of i.atoms){if(o.has(c.key))continue;if(c.install(this),c.type==="mutable_atom"){let p=ni(i,c),x=Uo(c);o.add(p.key),o.add(x.key)}}for(let[,c]of i.readonlySelectors)c.install(this);for(let[,c]of i.selectors){if(o.has(c.key))continue;c.install(this)}for(let[,c]of i.transactions)c.install(this);for(let[,c]of i.timelines)c.install(this)}}}var d={get STORE(){if(!globalThis.ATOM_IO_IMPLICIT_STORE)globalThis.ATOM_IO_IMPLICIT_STORE=new n1({name:"IMPLICIT_STORE",lifespan:"ephemeral"});return globalThis.ATOM_IO_IMPLICIT_STORE}};function Fn(n,i){let o,c=n;while(c!==null){switch(i.type){case"atom":case"mutable_atom":o=c.atoms.get(i.key);break;case"selector":o=c.selectors.get(i.key);break;case"readonly_selector":o=c.readonlySelectors.get(i.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":o=c.families.get(i.key);break;case"timeline":o=c.timelines.get(i.key);break;case"transaction":o=c.transactions.get(i.key);break}if(o)return o;c=c.child}throw new Tc(i,n)}function o1(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new Tc(i,n);let p=c(o),x=D(n);if(p.family){if($i(x))switch(p.type){case"atom":case"mutable_atom":n.on.atomCreation.next(p);break;case"selector":case"readonly_selector":n.on.selectorCreation.next(p);break}else if(Yn(x)&&x.on.transactionApplying.state===null)x.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function c1(n,i,o){let c=wn(o),p=`${i.key}(${c})`,x=D(n),m;switch(i.type){case"atom_family":case"mutable_atom_family":m=x.atoms.get(p);break;case"selector_family":m=x.selectors.get(p);break;case"readonly_selector_family":m=x.readonlySelectors.get(p);break}if(m)return Ko(m);return m}function t(n,i,o){let c=c1(n,i,o);if(c)return c;let p=wn(o),x=n.molecules.get(p);if(!x&&n.config.lifespan==="immortal"){let m=Q0(i,o);return n.logger.error("\u274C",m.type,m.key,`was not found in store "${n.config.name}"; returned a counterfeit token.`),m}if(c=o1(n,i,o),x)D(n).moleculeData.set(p,i.key);return c}function lc(n,...i){let o;if(i.length===1)o=i[0];else{let c=i[0],p=i[1];o=t(n,c,p)}try{Fn(n,o)}catch(c){n.logger.error("\u274C",o.type,o.key,`could not be disposed because it was not found in the store "${n.config.name}".`);return}switch(o.type){case"atom":case"mutable_atom":Sf(n,o);break;case"selector":case"readonly_selector":p1(n,o);break}}var Jm=(n,i)=>D(n).atoms.has(i),iS=(n,i)=>D(n).selectors.has(i),oS=(n,i)=>D(n).readonlySelectors.has(i),x1=(n,i)=>Jm(n,i)||iS(n,i)||oS(n,i);var Am=(n,i)=>{return D(i).selectorGraph.getRelationEntries({downstreamSelectorKey:n}).filter(([c,{source:p}])=>p!==n).map(([c,{source:p}])=>p).filter((c)=>x1(i,c))};var Xf=(n,i,o)=>{let c=[],p=Am(n,o);while(p.length>0){let x=p.shift();if(i.has(x))continue;if(i.add(x),!Jm(o,x))p.push(...Am(x,o));else if(!c.includes(x))c.push(x)}return c},m1=(n,i)=>{let o=n.key,c=Am(o,i),p=new Set;return c.flatMap((x)=>Jm(i,x)?x:Xf(x,p,i))};var a1=(n,i,o,c)=>{let p=D(c);if(i.type==="atom"||i.type==="mutable_atom")p.selectorAtoms.set({selectorKey:n,atomKey:i.key}),c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atom "${i.key}"`);else{let x=Xf(i.key,o,c);c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atoms: [ ${x.map((m)=>`"${m}"`).join(", ")} ]`);for(let m of x)p.selectorAtoms=p.selectorAtoms.set({selectorKey:n,atomKey:m})}o.add(i.key)};var Tm=(n,i,o)=>({get:(...c)=>{let p=D(o),x;if(c.length===2){let[f,v]=c;x=t(o,f,v)}else[x]=c;let m=Fn(o,x),a=yo(o,m);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${x.key}" =`,a,")"),p.selectorGraph.set({upstreamSelectorKey:x.key,downstreamSelectorKey:n},{source:x.key}),a1(n,x,i,o),a},set:(...c)=>{let p,x;if(c.length===2)p=c[0],x=c[1];else{let f=c[0],v=c[1];x=c[2],p=t(o,f,v)}let m=D(o),a=Fn(m,p);vm(m,a,x)},find:(c,p)=>t(o,c,p),json:(c)=>ni(o,c)});var xx=(n,i,o)=>{let c=D(n),p=new $n,x=new Set,{get:m,find:a,json:f}=Tm(i.key,x,c),v=()=>{let l=i.get({get:m,find:a,json:f});return ki(D(n),i.key,l,p),x.clear(),l},$={...i,subject:p,install:(l)=>xx(l,i,o),get:v,type:"readonly_selector",...o&&{family:o}};c.readonlySelectors.set(i.key,$);let w=v();n.logger.info("\u2728",$.type,$.key,"=",w);let J={key:i.key,type:"readonly_selector"};if(o)J.family=o;return J};var fx=(n,i,o)=>{let c=D(n),p=new $n,x=new Set,m=Tm(i.key,x,c),{find:a,get:f,json:v}=m,$={find:a,get:f,json:v},w=(K=i.get,Y=D(n))=>{let M=K($);return ki(Y,i.key,M,p),x.clear(),M},l={...i,subject:p,install:(K)=>fx(K,i,o),get:w,set:(K)=>{let Y=D(n),M=w(i.get,Y),I=fm(K)(M);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",M,"->",I,")"),ki(Y,i.key,I,p),dc(Y,i.key),$i(Y))p.next({newValue:I,oldValue:M});i.set(m,I)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,l);let S=w();n.logger.info("\u2728",l.type,l.key,"=",S);let R={key:i.key,type:"selector"};if(o)R.family=o;return R};function wf(n,i){if("set"in i){let p=fx(n,i,void 0);return n.on.selectorCreation.next(p),p}let c=xx(n,i,void 0);return n.on.selectorCreation.next(c),c}function p1(n,i){let o=D(n),{key:c}=i,p=Fn(o,i);if(!p.family)n.logger.error("\u274C","selector",c,"Standalone selectors cannot be disposed.");else{if(o.molecules.get(p.family.subKey))o.moleculeData.delete(p.family.subKey,p.family.key);let m;switch(i.type){case"selector":o.selectors.delete(c),m={key:p.family.key,type:"selector_family"},Fn(n,m).subject.next({type:"state_disposal",subType:"selector",token:i});break;case"readonly_selector":o.readonlySelectors.delete(c),m={key:p.family.key,type:"readonly_selector_family"},Fn(n,m).subject.next({type:"state_disposal",subType:"selector",token:i});break}if(o.valueMap.delete(c),o.selectorAtoms.delete(c),o.selectorGraph.delete(c),n.logger.info("\uD83D\uDD25",i.type,c,"deleted"),Yn(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:i});else n.on.selectorDisposal.next(i)}}function mx(n,i,o){let c={key:i.key,type:"selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","selector_family",i.key,`Overwriting an existing ${Xo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=D(n),l=fx(J,{key:w,get:i.get(f),set:i.set(f)},$);return x.next({type:"state_creation",token:l}),l},c,{internalRoles:o,subject:x,install:(f)=>mx(f,i),default:(f)=>{return i.get(f)({get:(...$)=>Gn(n,...$),find:($,w)=>t(n,$,w),json:($)=>ni(n,$)})}});return n.families.set(i.key,a),c}function f1(n,i,o){return mx(n,{key:`${i.key}:JSON`,get:(p)=>({get:x})=>{let m=x(i,p);return o.toJson(m)},set:(p)=>({set:x},m)=>{x(i,p,o.fromJson(m))}},["mutable","json"])}var xi=(n)=>JSON.parse(n),wn=(n)=>JSON.stringify(n),VQ=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var v1=(n,i)=>{let o=D(n);if(o.operation.open)return o.operation.prev.get(i.key);return o.valueMap.get(i.key)};var Gf=(n,i)=>{let o=D(n);return m1(i,n).map((p)=>{let x=o.atoms.get(p);if(x===void 0)throw new Error(`Atom "${p}", a dependency of selector "${i.key}", not found in store "${n.config.name}".`);return x.subject.subscribe(`${i.type}:${i.key}`,(m)=>{n.logger.info("\uD83D\uDCE2",i.type,i.key,"root",p,"went",m.oldValue,"->",m.newValue);let a=v1(o,i),f=yo(o,i);n.logger.info("\u2728",i.type,i.key,"went",a,"->",f),i.subject.next({newValue:f,oldValue:a})})})};function Si(n,i,o,c){function p(w){if(n.operation.open){let J=n.on.operationClose.subscribe(`state subscription ${o}`,()=>{J(),c(w)})}else c(w)}let x=Fn(n,i);n.logger.info("\uD83D\uDC40",x.type,x.key,`Adding subscription "${o}"`);let m=x.type==="selector"||x.type==="readonly_selector",a=null,f=p;if(m)a=Gf(n,x),f=(w)=>{if(a)a.length=0,a.push(...Gf(n,x));p(w)};let v=x.subject.subscribe(o,f);return()=>{if(n.logger.info("\uD83D\uDE48",x.type,x.key,`Removing subscription "${o}"`),v(),a)for(let w of a)w()}}var Kf=(n,i,o,c)=>{let p=Fn(n,i);n.logger.info("\uD83D\uDC40","timeline",i.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,c);return()=>{n.logger.info("\uD83D\uDE48","timeline",i.key,`Removing subscription "${o}" from timeline`),x()}};var Wf=(n,i,o,c)=>{let p=Fn(n,i);n.logger.info("\uD83D\uDC40","transaction",i.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,c);return()=>{n.logger.info("\uD83D\uDE48","transaction",i.key,`Removing subscription "${o}"`),x()}};class Xc{Update;initializeState(n,i){let o=`*${n.key}`;i.atoms.delete(o),i.valueMap.delete(o);let c=n.family?{key:`*${n.family.key}`,subKey:n.family.subKey}:void 0,p=Ac(i,{key:o,default:null},c);if(i.parent?.valueMap.has(o)){let x=i.parent.valueMap.get(o);i.valueMap.set(o,x)}return p}unsubscribeFromInnerValue;unsubscribeFromState;observeCore(n,i,o){let c=`tracker:${o.config.name}:${Yn(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=Gn(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(x)=>{On(o,i,x)}),this.unsubscribeFromState=Si(o,n,c,(x)=>{if(x.newValue!==x.oldValue)this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=x.newValue.subscribe(c,(m)=>{On(o,i,m)})})}updateCore(n,i,o){let c=`tracker:${o.config.name}:${Yn(o)?o.transactionMeta.update.key:"main"}:${n.key}`;Si(o,i,c,({newValue:p,oldValue:x})=>{let m=o.timelineTopics.getRelatedKey(i.key);if(m){if(o.timelines.get(m)?.timeTraveling){let v=Kf(o,{key:m,type:"timeline"},c,($)=>{v(),On(o,n,(w)=>{if($==="redo"&&p)w.do(p);else if($==="undo"&&x)w.undo(x);return w})});return}}let a=o.on.operationClose.subscribe(c,()=>{a();let f=Gn(o,n),v=p===null?-1:f.getUpdateNumber(p),$=v-f.cacheUpdateNumber;if(p&&$===1)On(o,n,(w)=>(w.do(p),w));else o.logger.info("\u274C","mutable_atom",n.key,`could not be updated. Expected update number ${f.cacheUpdateNumber+1}, but got ${v}`)})})}mutableState;latestUpdateState;[Symbol.dispose];constructor(n,i){this.mutableState=n;let o=D(i);this.latestUpdateState=this.initializeState(n,o),this.observeCore(n,this.latestUpdateState,o),this.updateCore(n,this.latestUpdateState,o),o.trackers.set(n.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),o.trackers.delete(n.key)}}}function vx(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=D(n),p=c.atoms.get(i.key);if(p&&p.type==="mutable_atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),Ko(p);let x=new $n,m={...i,type:"mutable_atom",install:(v)=>{return v.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${v.config.name}"`),vx(v,i,o)},subject:x};if(o)m.family=o;let a=i.default();c.atoms.set(m.key,m),Fm(n,i.key),ki(c,i.key,a,x);let f=Ko(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(l)=>{On(n,f,l)},onSet:(l)=>Si(n,f,`effect[${v}]`,l)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}if(new Xc(f,n),!o)M0(f,i,n);return f}class Yf{trackers=new Map;Update;latestUpdateAtoms;mutableAtoms;constructor(n,i){let o=Jc(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=Fn(i,o),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{let{type:p,token:x}=c;if(x.family){let m=xi(x.family.subKey);switch(p){case"state_creation":this.trackers.set(m,new Xc(x,i));break;case"state_disposal":{let a=this.trackers.get(m);if(a)a[Symbol.dispose](),this.trackers.delete(m)}break}}})}}function px(n,i,o){let c={key:i.key,type:"mutable_atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","mutable_atom_family",i.key,`Overwriting an existing ${Xo(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=D(n),l={key:w,default:()=>i.default(f),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)l.effects=i.effects(f);let S=vx(J,l,$);return x.next({type:"state_creation",token:S}),S},c,{subject:x,install:(f)=>px(f,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,a),f1(n,a,i),new Yf(a,n),c}var Mf=(n,i)=>{let o=D(i),c=`${n.key}:JSON`;return o.families.get(c)};var ni=(n,i)=>{if(i.family){let c=D(n),x={key:`${i.family.key}:JSON`,type:"selector_family"},m=Fn(c,x),a=JSON.parse(i.family.subKey);return t(n,m,a)}return{type:"selector",key:`${i.key}:JSON`}};var Uo=(n)=>{let o={type:"atom",key:`*${n.key}`};if(n.family)o.family={key:`*${n.family.key}`,subKey:n.family.subKey};return o};function D0(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function ax(n,i,o){let c=o.valueMap.get(i.key),p=n.valueMap.get(i.key);if(c!==p)return p;if(c===void 0)return i.default();o.logger.info("\uD83D\uDCC3","atom",i.key,"copying");let x=i.toJson(c),m=i.fromJson(x);return n.valueMap.set(i.key,m),new Xc(i,o),m}function ki(n,i,o,c){let p=n.valueMap.get(i);if(p instanceof cx)p.use(o);if(o instanceof Promise){let x=new cx(o);return n.valueMap.set(i,x),x.then((m)=>{ki(n,i,m,c),c.next({newValue:m,oldValue:x})}).catch((m)=>{n.logger.error("\uD83D\uDCA5","state",i,"rejected:",m)}),x}return n.valueMap.set(i,o),o}var O0=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&Yn(i)){let{parent:c}=i;o=ax(i,n,c)}return o},b0=(n,i)=>{let o=i.valueMap.get(n);if(o instanceof cx){let c=o,p=i.selectors.get(n)??i.readonlySelectors.get(n);if(p)c.use(p.get());return}if(i.operation.open)i.operation.prev.set(n,o);i.valueMap.delete(n),i.logger.info("\uD83D\uDDD1","state",n,"evicted")};var L0=(n,i)=>{return D(n).atomsThatAreDefault.has(i)},Fm=(n,i)=>{let o=D(n);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(i)},u0=(n,i)=>{let o=D(n);o.atomsThatAreDefault=new Set(D(n).atomsThatAreDefault),o.atomsThatAreDefault.delete(i)};function Ac(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=D(n),p=c.atoms.get(i.key);if(p&&p.type==="atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),Ko(p);let x=new $n,m={...i,type:"atom",install:(v)=>{return v.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${v.config.name}"`),Ac(v,i,o)},subject:x};if(o)m.family=o;let a=i.default;if(i.default instanceof Function)a=i.default();c.atoms.set(m.key,m),Fm(n,i.key),ki(c,i.key,a,x);let f=Ko(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(l)=>{On(n,f,l)},onSet:(l)=>Si(n,f,`effect[${v}]`,l)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}return f}function $1(n,i){if("mutable"in i){let p=vx(n,i,void 0);return n.on.atomCreation.next(p),p}let c=Ac(n,i,void 0);return n.on.atomCreation.next(c),c}function Sf(n,i){let o=D(n),{key:c,family:p}=i,x=Fn(o,i);if(!p)n.logger.error("\u274C","atom",c,"Standalone atoms cannot be disposed.");else{x.cleanup?.();let m=n.valueMap.get(x.key),a=Fn(n,{key:p.key,type:"atom_family"}),f={type:"state_disposal",subType:"atom",token:i,value:m};a.subject.next(f);let v=Yn(o);if(o.atoms.delete(c),o.valueMap.delete(c),o.selectorAtoms.delete(c),o.atomsThatAreDefault.delete(c),n.timelineTopics.delete(c),i.type==="mutable_atom"){let $=Uo(i);Sf(n,$),n.trackers.delete(c)}if(n.logger.info("\uD83D\uDD25","atom",c,"deleted"),v&&o.transactionMeta.phase==="building"){let $=o.transactionMeta.update.updates.at(-1);if(!($?.type==="molecule_disposal"&&$.values.some(([l])=>l===x.family?.key)))o.transactionMeta.update.updates.push(f)}else n.on.atomDisposal.next(i)}}class oi extends Set{mode="record";subject=new $n;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof oi)this.parent=n,this.cacheUpdateNumber=n.cacheUpdateNumber;if(i)this.cacheLimit=i,this.cache=new Array(i),this.subscribe("auto cache",(o)=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=o})}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(n){let i=new oi(n.members,n.cacheLimit);return i.cache=n.cache,i.cacheIdx=n.cacheIdx,i.cacheUpdateNumber=n.cacheUpdateNumber,i}add(n){let i=super.add(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`add:${wn(n)}`);return i}clear(){let n=this.mode==="record"?[...this]:null;if(super.clear(),n)this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(n)}`)}delete(n){let i=super.delete(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`del:${wn(n)}`);return i}parent;child=null;transactionUpdates=null;transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new oi(this);let i=this.child._subscribe("transaction",(o)=>{this.transactionUpdates?.push(o)});try{if(n(this.child)){for(let c of this.transactionUpdates)this.doStep(c);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(o){throw console.warn("Did not apply transaction to SetRTX; this error was thrown:",o),o}finally{i(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(n,i){return this.subject.subscribe(n,i)}subscribe(n,i){return this.subject.subscribe(n,(o)=>{i(`${this.cacheUpdateNumber}=${o}`)})}emit(n){this.subject.next(n)}doStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.add(JSON.parse(c));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(c));break;case"tx":for(let p of c.split(";"))this.doStep(p)}}getUpdateNumber(n){let i=n.indexOf("=");return Number(n.substring(0,i))}do(n){let i=n.indexOf("="),o=Number(n.substring(0,i)),c=o-this.cacheUpdateNumber;if(c>0){if(c===1){this.mode="playback";let x=n.substring(i+1);return this.doStep(x),this.mode="record",this.cacheUpdateNumber=o,null}return this.cacheUpdateNumber+1}if(Math.abs(c)<this.cacheLimit){let x=this.cacheIdx+c;if(this.cache[x]===n)return null;this.mode="playback";let a=!1;while(!a){this.cacheIdx%=this.cacheLimit;let v=this.cache[this.cacheIdx];if(this.cacheIdx--,!v)return"OUT_OF_RANGE";this.undo(v),a=this.cacheIdx===x-1}let f=n.substring(i+1);return this.doStep(f),this.mode="record",this.cacheUpdateNumber=o,null}return"OUT_OF_RANGE"}undoStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.delete(JSON.parse(c));break;case"del":this.add(JSON.parse(c));break;case"clear":{let p=JSON.parse(c);for(let x of p)this.add(x);break}case"tx":{let p=c.split(";");for(let x=p.length-1;x>=0;x--)this.undoStep(p[x])}}}undo(n){let i=n.indexOf("=");if(Number(n.substring(0,i))===this.cacheUpdateNumber){this.mode="playback";let c=n.substring(i+1);return this.undoStep(c),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}class $x{toolkit;options;defaultContent;molecules=new Map;relations;states;core;transact(n,i){let o=this.toolkit;this.toolkit=n,i(this),this.toolkit=o}store;realm;[Symbol.dispose](){}constructor(n,i,o=d.STORE){this.store=o,this.realm=new Hf(o),this.options=n,this.defaultContent=i,this.store.miscResources.set(`join:${n.key}`,this),this.realm.allocate("root",n.key),this.toolkit={get:(...G)=>Gn(o,...G),set:(...G)=>{On(o,...G)},find:(...G)=>t(o,...G),json:(G)=>ni(o,G)};let c=n.between[0],p=n.between[1],x=px(o,{key:`${n.key}/relatedKeys`,default:()=>new oi,mutable:!0,fromJson:(G)=>oi.fromJSON(G),toJson:(G)=>G.toJSON()},["join","relations"]);this.core={relatedKeysAtoms:x};let m=({get:G},z)=>G(x,z),a=({set:G},z,E)=>{if(!this.store.molecules.has(wn(z)))this.realm.allocate(n.key,z);G(x,z,(Q)=>Q.add(E)),G(x,E,(Q)=>Q.add(z))},f=({set:G},z,E)=>{G(x,z,(Q)=>{return Q.delete(E),Q}),G(x,E,(Q)=>{return Q.delete(z),Q})},v=(G,z,E)=>{let{find:Q,get:B,set:y}=G,H=Q(x,z),an=B(H);for(let Z of an){if(E.includes(Z))continue;y(x,Z,(En)=>{return En.delete(z),En})}y(H,(Z)=>{return Z.transaction((fn)=>{fn.clear();for(let En of E){let gn=m(G,En),_i=gn.has(z);if(this.relations.cardinality==="1:n"){let Oo=[];for(let O of gn){if(O===z)continue;let s=m(G,O);if(s.delete(En),s.size===0)Oo.push(O)}if(!_i&&gn.size>0)gn.clear();for(let O of Oo){let s=[En,O].sort(),Rn=`"${s[0]}:${s[1]}"`;this.molecules.delete(Rn)}}if(!_i)gn.add(z);fn.add(En)}return!0}),Z})},$=(G,z,E)=>{let{set:Q}=G;Q(x,z,(B)=>{return B.transaction((y)=>{for(let H of E)y.add(H);return!0}),B});for(let B of E)Q(x,B,(y)=>{return y.add(z),y});return!0},w=(G,z,E)=>{let Q=m(G,z);return E?Q.has(E):Q.size>0},J={getRelatedKeys:(G)=>m(this.toolkit,G),addRelation:(G,z)=>{this.store.moleculeJoins.set(G,n.key),this.store.moleculeJoins.set(z,n.key),a(this.toolkit,G,z)},deleteRelation:(G,z)=>{f(this.toolkit,G,z)},replaceRelationsSafely:(G,z)=>{v(this.toolkit,G,z)},replaceRelationsUnsafely:(G,z)=>{$(this.toolkit,G,z)},has:(G,z)=>w(this.toolkit,G,z)},l,S;if(i){S=Jc(o,{key:`${n.key}/content`,default:i},["join","content"]);let G=({get:Q},B)=>Q(S,B),z=({set:Q},B,y)=>{Q(S,B,y)};l=Object.assign(J,{getContent:(Q)=>{return G(this.toolkit,Q)},setContent:(Q,B)=>{z(this.toolkit,Q,B)},deleteContent:(Q)=>{this.realm.deallocate(Q)}})}else l=J;let R=new ii(n,{externalStore:l,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...G)=>{let[z,E]=G,Q=G.sort(),B=`${Q[0]}:${Q[1]}`,y=o.molecules.get(wn(z)),H=o.molecules.get(wn(E));if(!y)this.realm.allocate(n.key,z);if(!H)this.realm.allocate(n.key,E);return this.realm.allocate(z,B,"all"),this.realm.claim(E,B),this.store.moleculeJoins.set(B,n.key),B}}),K=()=>Io(o,{key:`${n.key}/singleRelatedKey`,get:(G)=>({get:z})=>{let E=z(x,G);for(let Q of E)return Q;return null}},["join","keys"]),Y=()=>{return Io(o,{key:`${n.key}/multipleRelatedKeys`,get:(G)=>({get:z})=>{let E=Mf(x,o);return z(E,G).members}},["join","keys"])},M=()=>Io(o,{key:`${n.key}/singleRelatedEntry`,get:(G)=>({get:z})=>{let E=z(x,G);for(let Q of E){let B=R.isAType?.(G)?G:void 0,y=B===void 0?G:void 0;B??=Q,y??=Q;let H=R.makeContentKey(B,y),an=z(S,H);return[Q,an]}return null}},["join","entries"]),I=()=>Io(o,{key:`${n.key}/multipleRelatedEntries`,get:(G)=>({get:z})=>{let E=Mf(x,o);return z(E,G).members.map((B)=>{let y=R.isAType?.(G)?G:void 0,H=y===void 0?G:void 0;y??=B,H??=B;let an=R.makeContentKey(y,H),Z=z(S,an);return[B,Z]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let G=K(),z=`${c}KeyOf${Mn(p)}`,E=`${p}KeyOf${Mn(c)}`,Q={[z]:G,[E]:G},B;if(i){let y=M(),H=`${c}EntryOf${Mn(p)}`,an=`${p}EntryOf${Mn(c)}`,Z={[H]:y,[an]:y};B=Object.assign(Q,Z)}else B=Q;this.relations=R,this.states=B;break}case"1:n":{let G=K(),z=Y(),E=`${c}KeyOf${Mn(p)}`,Q=`${p}KeysOf${Mn(c)}`,B={[E]:G,[Q]:z},y;if(i){let H=M(),an=I(),Z=`${c}EntryOf${Mn(p)}`,fn=`${p}EntriesOf${Mn(c)}`,En={[Z]:H,[fn]:an};y=Object.assign(B,En)}else y=B;this.relations=R,this.states=y;break}case"n:n":{let G=Y(),z=`${c}KeysOf${Mn(p)}`,E=`${p}KeysOf${Mn(c)}`,Q={[z]:G,[E]:G},B;if(i){let y=I(),H=`${c}EntriesOf${Mn(p)}`,an=`${p}EntriesOf${Mn(c)}`,Z={[H]:y,[an]:y};B=Object.assign(Q,Z)}else B=Q;this.relations=R,this.states=B}}}}function np(n,i){let o=i.joins.get(n.key);if(o===void 0){let p=d.STORE.joins.get(n.key);if(p===void 0)throw new Error(`Join "${n.key}" not found in store "${i.config.name}"`);o=new $x(p.options,p.defaultContent,i),i.joins.set(n.key,o)}return o}function ko(n,i,o){let c=np(n,o),p=D(o);if(Yn(p)){let{toolkit:x}=p.transactionMeta;c.transact(x,({relations:m})=>{i(m)})}else i(c.relations)}function ip(n,i,o){let c=np(n,o),p;switch(n.cardinality){case"1:1":{let x=`${n.a}KeyOf${Mn(n.b)}`,m=`${n.b}KeyOf${Mn(n.a)}`;p={get[x](){let f=c.states[x];return t(o,f,i)},get[m](){let f=c.states[m];return t(o,f,i)}};let a=`${n.a}EntryOf${Mn(n.b)}`;if(a in c.states){let f=`${n.b}EntryOf${Mn(n.a)}`;Object.assign(p,{get[a](){let v=c.states[a];return t(o,v,i)},get[f](){let v=c.states[f];return t(o,v,i)}})}break}case"1:n":{let x=`${n.a}KeyOf${Mn(n.b)}`,m=`${n.b}KeysOf${Mn(n.a)}`;p={get[x](){let f=c.states[x];return t(o,f,i)},get[m](){let f=c.states[m];return t(o,f,i)}};let a=`${n.a}EntryOf${Mn(n.b)}`;if(a in c.states){let f=`${n.b}EntriesOf${Mn(n.a)}`;Object.assign(p,{get[a](){let v=c.states[a];return t(o,v,i)},get[f](){let v=c.states[f];return t(o,v,i)}})}break}case"n:n":{let x=`${n.a}KeysOf${Mn(n.b)}`,m=`${n.b}KeysOf${Mn(n.a)}`;p={get[x](){let f=c.states[x];return t(o,f,i)},get[m](){let f=c.states[m];return t(o,f,i)}};let a=`${n.a}EntriesOf${Mn(n.b)}`;if(a in c.states){let f=`${n.b}EntriesOf${Mn(n.a)}`;Object.assign(p,{get[a](){let v=c.states[a];return t(o,v,i)},get[f](){let v=c.states[f];return t(o,v,i)}})}}}return p}function w1(n,i){return np(n,i).core.relatedKeysAtoms}function i1(n){return n.startsWith("\uD83D\uDD0D ")}function Zo(n){return $1(d.STORE,n)}function Kc(n){return H0(d.STORE,n)}function Rm(n,i,o=d.STORE){return o.joins.set(n.key,new $x(n,i,o)),{key:n.key,type:"join",a:n.between[0],b:n.between[1],cardinality:n.cardinality}}function J1(n){return w1(n,d.STORE)}var zf=(n)=>(i,o,c,p,...x)=>{console[n](`${i} ${o} "${c}" ${p}`,...x)},cS={error:zf("error"),info:zf("info"),warn:zf("warn")};class Sc{logLevel;filter;logger;constructor(n,i,o=cS){this.logLevel=n,this.filter=i,this.logger=o}error=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!==null)this.logger.error(...n)};info=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel==="info")this.logger.info(...n)};warn=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!=="error"&&this.logLevel!==null)this.logger.warn(...n)}}var eU=Symbol("claim");class A1{store;constructor(n=d.STORE){this.store=n,C0("root",n)}allocate(n,i,o){return Fc(this.store,n,i,o)}fuse(n,i,o){return I0(this.store,n,i,o)}deallocate(n){Rc(this.store,n)}claim(n,i,o){return ec(this.store,n,i,o)}}class Hf{store;realm;constructor(n=d.STORE){this.store=n,this.realm=new A1(n)}allocate(n,i,o){Fc(this.store,n,i,o)}deallocate(n){Rc(this.store,n)}claim(n,i,o){ec(this.store,n,i,o)}}function lm(n){return z0(d.STORE,n)}function Wc(n){return lf(d.STORE,n)}class T1 extends Map{set(n,i){if(this.has(n))return console.warn("Tried to set a key that already exists in an InvariantMap",{key:n,value:i}),this;return super.set(n,i)}clear(){throw new Error("Cannot clear an InvariantMap")}}class Sm{type="continuity";globals=[];actions=[];perspectives=[];key;constructor(n){this.key=n}static existing=new T1;static create(n,i){let o=new Sm(n),{type:c,globals:p,actions:x,perspectives:m}=i(o),a={type:c,key:n,globals:p,actions:x,perspectives:m};return Sm.existing.set(n,a),a}add(...n){switch(n[0].type){case"atom":case"mutable_atom":this.globals.push(...n);break;case"transaction":this.actions.push(...n);break;case"atom_family":case"mutable_atom_family":{let[o,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:o,viewAtoms:c})}break}return this}}function F1(n){let{key:i,config:o}=n,c=Sm.create(i,o),{actions:p}=c;for(let x of p)g0(d.STORE,i,x.key);return P0(d.STORE,i,-1),c}var vV=Zo({key:"usersInRoomIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),Qf=Zo({key:"roomIndex",default:()=>new oi,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),pS={enteredAtEpoch:0},wx=Rm({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},pS),$V=lm({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=J1(wx);return[i(o,n)]}});import{spawn as xS}from"child_process";class op{listeners;globalListeners;handleEvent(n,...i){for(let c of this.globalListeners)c(n,...i);let o=this.listeners.get(n);if(o)for(let c of o)c(...i)}id="no_id_retrieved";emit;constructor(n){this.emit=n,this.listeners=new Map,this.globalListeners=new Set}on(n,i){let o=this.listeners.get(n);if(o)o.add(i);else this.listeners.set(n,new Set([i]));return this}onAny(n){return this.globalListeners.add(n),this}off(n,i){let o=this.listeners.get(n);if(o)if(i)o.delete(i);else this.listeners.delete(n);return this}offAny(n){return this.globalListeners.delete(n),this}}class Jx extends op{incompleteData="";unprocessedEvents=[];incompleteLog="";unprocessedLogs=[];id="#####";process;key;logger;handleLog(n){if(Array.isArray(n)){let[i,...o]=n;switch(i){case"i":this.logger.info(...o);break;case"w":this.logger.warn(...o);break;case"e":this.logger.error(...o);break;default:return}}}constructor(n,i,o){super((c,...p)=>{let x=JSON.stringify([c,...p])+"\x03",m=(a)=>{if(a.code==="EPIPE")console.error("EPIPE error during write",this.process.stdin);this.process.stdin.removeListener("error",m)};return this.process.stdin.once("error",m),this.process.stdin.write(x),this});if(this.process=n,this.key=i,this.logger=o??{info:(...c)=>{console.info(this.id,this.key,...c)},warn:(...c)=>{console.warn(this.id,this.key,...c)},error:(...c)=>{console.error(this.id,this.key,...c)}},this.process.stdout.on("data",(c)=>{let p=c.toString();if(p==="ALIVE")return;this.unprocessedEvents.push(...p.split("\x03"));let x=this.unprocessedEvents.shift();this.incompleteData+=x??"";try{if(this.incompleteData.startsWith("error"))console.log("\u2757",this.incompleteData);let m=xi(this.incompleteData);this.handleEvent(...m);while(this.unprocessedEvents.length>0){let a=this.unprocessedEvents.shift();if(a){if(this.unprocessedEvents.length===0)this.incompleteData=a;m=xi(a),this.handleEvent(...m)}}this.incompleteData=""}catch(m){console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.warn(this.incompleteData),console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.error(m)}}),this.process.stderr.on("data",(c)=>{let p=c.toString();this.unprocessedLogs.push(...p.split("\x03"));let x=this.unprocessedLogs.shift();this.incompleteLog+=x??"";try{let m=xi(this.incompleteLog);this.handleLog(m);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)m=xi(this.incompleteLog),this.handleLog(m)}catch(m){console.error("\u274C\u274C\u274C"),console.error(this.incompleteLog),console.error(m),console.error("\u274C\u274C\u274C\uFE0F")}}),n.pid)this.id=n.pid.toString()}}class R1 extends op{in;out;id="no_id_retrieved";disposalFunctions=[];constructor(n){super((...i)=>{return this.out.next(i),this});this.id=n,this.in=new $n,this.out=new $n,this.in.subscribe("socket",(i)=>{this.handleEvent(...i)})}dispose(){for(let n of this.disposalFunctions)n()}}class Ef extends op{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(wn(n.map((i)=>i instanceof oi?`{ ${i.toJSON().members.join(" | ")} }`:i))+"\x03")}logger={info:(...n)=>{this.log("i",...n)},warn:(...n)=>{this.log("w",...n)},error:(...n)=>{this.log("e",...n)}};constructor(){super((n,...i)=>{let o=JSON.stringify([n,...i]);return this.process.stdout.write(o+"\x03"),this});if(this.process=process,this.process.stdin.resume(),this.relays=new Map,this.relayServices=[],this.process.stdin.on("data",(n)=>{let i=n.toString();this.unprocessedEvents.push(...i.split("\x03"));let o=this.unprocessedEvents.shift();this.incompleteData+=o??"";try{let c=xi(this.incompleteData);this.logger.info("\uD83C\uDFB0","received",c),this.handleEvent(...c);while(this.unprocessedEvents.length>0){let p=this.unprocessedEvents.shift();if(p){if(this.unprocessedEvents.length===0)this.incompleteData=p;let x=xi(p);this.handleEvent(...x)}}this.incompleteData=""}catch(c){if(c instanceof Error)this.logger.error("\u2757",c.message,c.cause,c.stack)}}),this.on("exit",()=>{this.logger.info("\uD83D\uDD25",this.id,'received "exit"'),process.exit(0)}),process.on("exit",(n)=>{this.logger.info("\uD83D\uDD25",this.id,`exited with code ${n}`)}),process.on("end",()=>{this.logger.info("\uD83D\uDD25",this.id,"ended"),process.exit(0)}),process.on("SIGTERM",()=>{this.logger.error("\uD83D\uDD25",this.id,"terminated"),process.exit(0)}),process.on("SIGINT",()=>{this.logger.error("\uD83D\uDD25",this.id,"interrupted"),process.exit(0)}),process.pid)this.id=process.pid?.toString();this.on("user-joins",(n)=>{this.logger.info("\uD83D\uDC64","user",n,"joined");let i=new R1(`user:${n}`);this.relays.set(n,i),this.logger.info("\uD83D\uDD17","attaching services:",`[${[...this.relayServices.keys()].join(", ")}]`);for(let o of this.relayServices){let c=o(i);if(c)i.disposalFunctions.push(c)}this.on(`user:${n}`,(...o)=>{i.in.next(o)}),i.out.subscribe("socket",(o)=>{this.emit(...o)})}),this.on("user-leaves",(n)=>{let i=this.relays.get(n);if(this.off(`relay:${n}`),i)i.dispose(),this.relays.delete(n)}),process.stdout.write("ALIVE")}relay(n){this.logger.info("\uD83D\uDD17","running relay method"),this.relayServices.push(n)}}var Of=Kc({key:"roomArguments",default:["echo",["Hello World!"]]}),l1=lm({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(Of,n),p=i(c),[x,m]=p,a=await new Promise((f)=>{let v=xS(x,m,{env:process.env}),$=(w)=>{if(w.toString()==="ALIVE")v.stdout.off("data",$),f(v)};v.stdout.on("data",$)});return new Jx(a,n)}});var LV=Wc({key:"createRoom",do:({get:n,set:i,find:o},c,p,x)=>{let m=x?[p,x]:[p],a=o(Of,c);i(a,m),i(Qf,($)=>$.add(c));let f=o(l1,c);return n(f)}}),uV=Wc({key:"joinRoom",do:(n,i,o,c)=>{let p={enteredAtEpoch:c};return ko(wx,(x)=>{x.set({room:i,user:o},p)},n.env().store),p}}),NV=Wc({key:"leaveRoom",do:(n,i,o)=>{ko(wx,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),hV=Wc({key:"destroyRoom",do:(n,i)=>{ko(wx,(o)=>{o.delete({room:i})},n.env().store),n.set(Qf,(o)=>(o.delete(i),o))}});function Uf(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=Uf(n,o.updates);return{...o,updates:c}}case"atom_update":case"selector_update":case"molecule_creation":case"molecule_disposal":case"molecule_transfer":case"state_creation":case"state_disposal":return o}}).filter((o)=>{switch(o.type){case"atom_update":case"selector_update":return n.includes(o.key);case"state_creation":case"state_disposal":return n.includes(o.token.key);case"molecule_creation":case"transaction_update":case"molecule_disposal":case"molecule_transfer":return!0}})}var yV=Kc({key:"redactor",default:{occlude:(n)=>n}}),cp=Kc({key:"unacknowledgedUpdates",default:()=>[]});var Xm=Kc({key:"sockets",default:null}),Vf=Zo({key:"socketsIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),_f=Zo({key:"usersIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),Gc=Rm({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function S1(n,i,o,c){let p=i.key;return function x(){let m=[];for(let f of i.globals){let v=f.type==="mutable_atom"?ni(n,f):f,$=Gn(n,v);m.push(v,$)}for(let f of i.perspectives){let{viewAtoms:v,resourceAtoms:$}=f,w=t(n,v,o),J=Gn(n,w);n.logger.info("\uD83D\uDC41","atom",$.key,`${o} can see`,{viewAtoms:v,resourceAtoms:$,userView:J});for(let l of J){let S=l.type==="mutable_atom"?ni(n,l):l,R=Gn(n,S);m.push(S,R)}}let a=$i(n)?n.transactionMeta.epoch.get(p)??null:null;c?.emit(`continuity-init:${p}`,a,m)}}function X1(n,i,o){let c=i.key;return function p(x){n.logger.info("\uD83D\uDECE\uFE0F","continuity",c,"received",x);let{key:m,id:a}=x,f=`tx-run:${m}:${a}`,v=`${f}:start`,$=`${f}:end`;performance.mark(v);try{gc(n,{type:"transaction",key:m},a)(...x.params)}catch(J){if(J instanceof Error)n.logger.error("\u274C","continuity",c,`failed to run transaction ${m} from ${o} with update ${a}`,J.message)}performance.mark($);let w=performance.measure(f,v,$);n?.logger.info("\uD83D\uDE80","transaction",m,a,o,w.duration)}}function K1(n,i,o,c){let p=i.key;return function x(m){if(n.logger.info("\uD83D\uDC4D","continuity",p,`${o} acknowledged epoch ${m}`),c[0]?.epoch===m)On(n,cp,o,(f)=>{return f.shift(),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,f.length,"items"),f})}}function W1(n,i,o,c){let p=i.key,x=[];for(let m of i.actions){let a=Wf(n,m,`sync-continuity:${p}:${o}`,(f)=>{try{let v=i.globals.map((J)=>{if(J.type==="atom")return J.key;return Uo(J).key}).concat(i.perspectives.flatMap((J)=>{let{viewAtoms:l}=J,S=t(n,l,o);return Gn(n,S).map((K)=>{return K.type==="mutable_atom"?"*"+K.key:K.key})})),$=Uf(v,f.updates),w={...f,updates:$};On(n,cp,o,(J)=>{if(w)J.push(w),J.sort((l,S)=>l.epoch-S.epoch),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,J.length,"items");return J}),c?.emit(`tx-new:${p}`,w)}catch(v){if(v instanceof Error)n.logger.error("\u274C","continuity",p,`${o} failed to send update from transaction ${m.key} to ${o}`,v.message)}});x.push(a)}return x}function G1(n,i,o,c){let p=i.key,x=[];for(let m of i.perspectives){let{viewAtoms:a}=m,f=t(n,a,o),v=Si(n,f,`sync-continuity:${p}:${o}:perspective:${m.resourceAtoms.key}`,({oldValue:$,newValue:w})=>{let J=$.map((K)=>K.key),l=w.map((K)=>K.key),S=$.filter((K)=>!l.includes(K.key)),R=w.filter((K)=>!J.includes(K.key)).flatMap((K)=>{let Y=K.type==="mutable_atom"?ni(n,K):K,M=Gn(n,Y);return[Y,M]});if(n.logger.info("\uD83D\uDC41","atom",m.resourceAtoms.key,`${o} has a new perspective`,{oldKeys:J,newKeys:l,revealed:R,concealed:S}),R.length>0)c?.emit(`reveal:${p}`,R);if(S.length>0)c?.emit(`conceal:${p}`,S)});x.push(v)}return x}function Y1({socket:n,store:i=d.STORE}){return function o(c){let p=n,x=c.key,m=ip(Gc,`socket::${p.id}`,i).userKeyOfSocket,a=Gn(i,m);if(!a)return i.logger.error("\u274C","continuity",x,`Tried to create a synchronizer for a socket (${p.id}) that is not connected to a user.`),()=>{};let f=ip(Gc,a,i).socketKeyOfUser,v=Si(i,f,`sync-continuity:${x}:${a}`,({newValue:Y})=>{if(i.logger.info("\uD83D\uDC4B","continuity",x,`seeing ${a} on new socket ${Y}`),Y===null){i.logger.warn("\u274C","continuity",x,`User (${a}) is not connected to a socket, waiting for them to reappear.`);return}let M=t(i,Xm,Y);p=Gn(i,M);for(let G of $)p?.emit(`tx-new:${x}`,G)}),$=Gn(i,cp,a),w=[],J=G1(i,c,a,p),l=W1(i,c,a,p);w.push(...J,...l);let S=S1(i,c,a,n);p.off(`get:${x}`,S),p.on(`get:${x}`,S);let R=X1(i,c,a);p.off(`tx-run:${x}`,R),p.on(`tx-run:${x}`,R);let K=K1(i,c,a,$);return p?.on(`ack:${x}`,K),()=>{for(let Y of w)Y();p?.off(`ack:${x}`,K),p?.off(`get:${x}`,S),p?.off(`tx-run:${x}`,R)}}}var nl=$f(vv(),1);var T=Symbol.for("drizzle:entityKind"),nB=Symbol.for("drizzle:hasOwnEntityKind");function W(n,i){if(!n||typeof n!=="object")return!1;if(n instanceof i)return!0;if(!Object.prototype.hasOwnProperty.call(i,T))throw new Error(`Class "${i.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let o=Object.getPrototypeOf(n).constructor;if(o)while(o){if(T in o&&o[T]===i[T])return!0;o=Object.getPrototypeOf(o)}return!1}class Un{constructor(n,i){this.table=n,this.config=i,this.name=i.name,this.keyAsName=i.keyAsName,this.notNull=i.notNull,this.default=i.default,this.defaultFn=i.defaultFn,this.onUpdateFn=i.onUpdateFn,this.hasDefault=i.hasDefault,this.primary=i.primaryKey,this.isUnique=i.isUnique,this.uniqueName=i.uniqueName,this.uniqueType=i.uniqueType,this.dataType=i.dataType,this.columnType=i.columnType,this.generated=i.generated,this.generatedIdentity=i.generatedIdentity}static[T]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(n){return n}mapToDriverValue(n){return n}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class $v{static[T]="ColumnBuilder";config;constructor(n,i,o){this.config={name:n,keyAsName:n==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:i,columnType:o,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(n){return this.config.default=n,this.config.hasDefault=!0,this}$defaultFn(n){return this.config.defaultFn=n,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(n){return this.config.onUpdateFn=n,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(n){if(this.config.name!=="")return;this.config.name=n}}var ao=Symbol.for("drizzle:Name");class wv{static[T]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(n,i){if(this.reference=()=>{let{name:o,columns:c,foreignColumns:p}=n();return{name:o,columns:c,foreignTable:p[0].table,foreignColumns:p}},i)this._onUpdate=i.onUpdate,this._onDelete=i.onDelete}onUpdate(n){return this._onUpdate=n===void 0?"no action":n,this}onDelete(n){return this._onDelete=n===void 0?"no action":n,this}build(n){return new XJ(n,this)}}class XJ{constructor(n,i){this.table=n,this.reference=i.reference,this.onUpdate=i._onUpdate,this.onDelete=i._onDelete}static[T]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:n,columns:i,foreignColumns:o}=this.reference(),c=i.map((m)=>m.name),p=o.map((m)=>m.name),x=[this.table[ao],...c,o[0].table[ao],...p];return n??`${x.join("_")}_fk`}}function Cm(n,...i){return n(...i)}function KJ(n,i){return`${n[ao]}_${i.join("_")}_unique`}function WJ(n,i,o){for(let c=i;c<n.length;c++){let p=n[c];if(p==="\\"){c++;continue}if(p==='"')return[n.slice(i,c).replace(/\\/g,""),c+1];if(o)continue;if(p===","||p==="}")return[n.slice(i,c).replace(/\\/g,""),c]}return[n.slice(i).replace(/\\/g,""),n.length]}function GJ(n,i=0){let o=[],c=i,p=!1;while(c<n.length){let x=n[c];if(x===","){if(p||c===i)o.push("");p=!0,c++;continue}if(p=!1,x==="\\"){c+=2;continue}if(x==='"'){let[f,v]=WJ(n,c+1,!0);o.push(f),c=v;continue}if(x==="}")return[o,c+1];if(x==="{"){let[f,v]=GJ(n,c+1);o.push(f),c=v;continue}let[m,a]=WJ(n,c,!1);o.push(m),c=a}return[o,c]}function YJ(n){let[i]=GJ(n,1);return i}function Jv(n){return`{${n.map((i)=>{if(Array.isArray(i))return Jv(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${i}`}).join(",")}}`}class C extends $v{foreignKeyConfigs=[];static[T]="PgColumnBuilder";array(n){return new HJ(this.config.name,this,n)}references(n,i={}){return this.foreignKeyConfigs.push({ref:n,actions:i}),this}unique(n,i){return this.config.isUnique=!0,this.config.uniqueName=n,this.config.uniqueType=i?.nulls,this}generatedAlwaysAs(n){return this.config.generated={as:n,type:"always",mode:"stored"},this}buildForeignKeys(n,i){return this.foreignKeyConfigs.map(({ref:o,actions:c})=>{return Cm((p,x)=>{let m=new wv(()=>{let a=p();return{columns:[n],foreignColumns:[a]}});if(x.onUpdate)m.onUpdate(x.onUpdate);if(x.onDelete)m.onDelete(x.onDelete);return m.build(i)},o,c)})}buildExtraConfigColumn(n){return new MJ(n,this.config)}}class V extends Un{constructor(n,i){if(!i.uniqueName)i.uniqueName=KJ(n,[i.name]);super(n,i);this.table=n}static[T]="PgColumn"}class MJ extends V{static[T]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(n){return this.indexConfig.opClass=n,this}}class Yx{static[T]="IndexedColumn";constructor(n,i,o,c){this.name=n,this.keyAsName=i,this.type=o,this.indexConfig=c}name;keyAsName;type;indexConfig}class HJ extends C{static[T]="PgArrayBuilder";constructor(n,i,o){super(n,"array","PgArray");this.config.baseBuilder=i,this.config.size=o}build(n){let i=this.config.baseBuilder.build(n);return new Av(n,this.config,i)}}class Av extends V{constructor(n,i,o,c){super(n,i);this.baseColumn=o,this.range=c,this.size=i.size}size;static[T]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(n){if(typeof n==="string")n=YJ(n);return n.map((i)=>this.baseColumn.mapFromDriverValue(i))}mapToDriverValue(n,i=!1){let o=n.map((c)=>c===null?null:W(this.baseColumn,Av)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return Jv(o)}}var Tv=Symbol.for("drizzle:isPgEnum");function zJ(n){return!!n&&typeof n==="function"&&Tv in n&&n[Tv]===!0}class QJ extends C{static[T]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new EJ(n,this.config)}}class EJ extends V{static[T]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(n,i){super(n,i);this.enum=i.enum}getSQLType(){return this.enum.enumName}}function Im(n,i){return H7(n,i,void 0)}function H7(n,i,o){let c=Object.assign((p)=>new QJ(p??"",c),{enumName:n,enumValues:i,schema:o,[Tv]:!0});return c}class ci{static[T]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Mx extends ci{static[T]="WithSubquery"}var OJ="0.40.0";var Fv,Rv,Vn={startActiveSpan(n,i){if(!Fv)return i();if(!Rv)Rv=Fv.trace.getTracer("drizzle-orm",OJ);return Cm((o,c)=>c.startActiveSpan(n,(p)=>{try{return i(p)}catch(x){throw p.setStatus({code:o.SpanStatusCode.ERROR,message:x instanceof Error?x.message:"Unknown error"}),x}finally{p.end()}}),Fv,Rv)}};var bn=Symbol.for("drizzle:ViewBaseConfig");var ym=Symbol.for("drizzle:Schema"),km=Symbol.for("drizzle:Columns"),UJ=Symbol.for("drizzle:ExtraConfigColumns"),lv=Symbol.for("drizzle:OriginalName"),Sv=Symbol.for("drizzle:BaseName"),Hx=Symbol.for("drizzle:IsAlias"),VJ=Symbol.for("drizzle:ExtraConfigBuilder"),z7=Symbol.for("drizzle:IsDrizzleTable");class L{static[T]="Table";static Symbol={Name:ao,Schema:ym,OriginalName:lv,Columns:km,ExtraConfigColumns:UJ,BaseName:Sv,IsAlias:Hx,ExtraConfigBuilder:VJ};[ao];[lv];[ym];[km];[UJ];[Sv];[Hx]=!1;[z7]=!0;[VJ]=void 0;constructor(n,i,o){this[ao]=this[lv]=n,this[ym]=i,this[Sv]=o}}function mi(n){return n[ao]}function Ec(n){return`${n[ym]??"public"}.${n[ao]}`}function Xv(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function Q7(n){let i={sql:"",params:[]};for(let o of n)if(i.sql+=o.sql,i.params.push(...o.params),o.typings?.length){if(!i.typings)i.typings=[];i.typings.push(...o.typings)}return i}class pi{static[T]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new u([this])}}class u{constructor(n){this.queryChunks=n}static[T]="SQL";decoder=BJ;shouldInlineParams=!1;append(n){return this.queryChunks.push(...n.queryChunks),this}toQuery(n){return Vn.startActiveSpan("drizzle.buildSQL",(i)=>{let o=this.buildQueryFromSourceParams(this.queryChunks,n);return i?.setAttributes({"drizzle.query.text":o.sql,"drizzle.query.params":JSON.stringify(o.params)}),o})}buildQueryFromSourceParams(n,i){let o=Object.assign({},i,{inlineParams:i.inlineParams||this.shouldInlineParams,paramStartIndex:i.paramStartIndex||{value:0}}),{casing:c,escapeName:p,escapeParam:x,prepareTyping:m,inlineParams:a,paramStartIndex:f}=o;return Q7(n.map((v)=>{if(W(v,pi))return{sql:v.value.join(""),params:[]};if(W(v,Zm))return{sql:p(v.value),params:[]};if(v===void 0)return{sql:"",params:[]};if(Array.isArray(v)){let $=[new pi("(")];for(let[w,J]of v.entries())if($.push(J),w<v.length-1)$.push(new pi(", "));return $.push(new pi(")")),this.buildQueryFromSourceParams($,o)}if(W(v,u))return this.buildQueryFromSourceParams(v.queryChunks,{...o,inlineParams:a||v.shouldInlineParams});if(W(v,L)){let $=v[L.Symbol.Schema],w=v[L.Symbol.Name];return{sql:$===void 0||v[Hx]?p(w):p($)+"."+p(w),params:[]}}if(W(v,Un)){let $=c.getColumnCasing(v);if(i.invokeSource==="indexes")return{sql:p($),params:[]};let w=v.table[L.Symbol.Schema];return{sql:v.table[Hx]||w===void 0?p(v.table[L.Symbol.Name])+"."+p($):p(w)+"."+p(v.table[L.Symbol.Name])+"."+p($),params:[]}}if(W(v,Bi)){let $=v[bn].schema,w=v[bn].name;return{sql:$===void 0||v[bn].isAlias?p(w):p($)+"."+p(w),params:[]}}if(W(v,Li)){if(W(v.value,go))return{sql:x(f.value++,v),params:[v],typings:["none"]};let $=v.value===null?null:v.encoder.mapToDriverValue(v.value);if(W($,u))return this.buildQueryFromSourceParams([$],o);if(a)return{sql:this.mapInlineParam($,o),params:[]};let w=["none"];if(m)w=[m(v.encoder)];return{sql:x(f.value++,$),params:[$],typings:w}}if(W(v,go))return{sql:x(f.value++,v),params:[v],typings:["none"]};if(W(v,u.Aliased)&&v.fieldAlias!==void 0)return{sql:p(v.fieldAlias),params:[]};if(W(v,ci)){if(v._.isWith)return{sql:p(v._.alias),params:[]};return this.buildQueryFromSourceParams([new pi("("),v._.sql,new pi(") "),new Zm(v._.alias)],o)}if(zJ(v)){if(v.schema)return{sql:p(v.schema)+"."+p(v.enumName),params:[]};return{sql:p(v.enumName),params:[]}}if(Xv(v)){if(v.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([v.getSQL()],o);return this.buildQueryFromSourceParams([new pi("("),v.getSQL(),new pi(")")],o)}if(a)return{sql:this.mapInlineParam(v,o),params:[]};return{sql:x(f.value++,v),params:[v],typings:["none"]}}))}mapInlineParam(n,{escapeString:i}){if(n===null)return"null";if(typeof n==="number"||typeof n==="boolean")return n.toString();if(typeof n==="string")return i(n);if(typeof n==="object"){let o=n.toString();if(o==="[object Object]")return i(JSON.stringify(n));return i(o)}throw new Error("Unexpected param value: "+n)}getSQL(){return this}as(n){if(n===void 0)return this;return new u.Aliased(this,n)}mapWith(n){return this.decoder=typeof n==="function"?{mapFromDriverValue:n}:n,this}inlineParams(){return this.shouldInlineParams=!0,this}if(n){return n?this:void 0}}class Zm{constructor(n){this.value=n}static[T]="Name";brand;getSQL(){return new u([this])}}function _J(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var BJ={mapFromDriverValue:(n)=>n},bJ={mapToDriverValue:(n)=>n},IB={...BJ,...bJ};class Li{constructor(n,i=bJ){this.value=n,this.encoder=i}static[T]="Param";brand;getSQL(){return new u([this])}}function F(n,...i){let o=[];if(i.length>0||n.length>0&&n[0]!=="")o.push(new pi(n[0]));for(let[c,p]of i.entries())o.push(p,new pi(n[c+1]));return new u(o)}((n)=>{function i(){return new u([])}n.empty=i;function o(f){return new u(f)}n.fromList=o;function c(f){return new u([new pi(f)])}n.raw=c;function p(f,v){let $=[];for(let[w,J]of f.entries()){if(w>0&&v!==void 0)$.push(v);$.push(J)}return new u($)}n.join=p;function x(f){return new Zm(f)}n.identifier=x;function m(f){return new go(f)}n.placeholder=m;function a(f,v){return new Li(f,v)}n.param=a})(F||(F={}));((n)=>{class i{constructor(o,c){this.sql=o,this.fieldAlias=c}static[T]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}}n.Aliased=i})(u||(u={}));class go{constructor(n){this.name=n}static[T]="Placeholder";getSQL(){return new u([this])}}function Kv(n,i){return n.map((o)=>{if(W(o,go)){if(!(o.name in i))throw new Error(`No value for placeholder "${o.name}" was provided`);return i[o.name]}if(W(o,Li)&&W(o.value,go)){if(!(o.value.name in i))throw new Error(`No value for placeholder "${o.value.name}" was provided`);return o.encoder.mapToDriverValue(i[o.value.name])}return o})}var E7=Symbol.for("drizzle:IsDrizzleView");class Bi{static[T]="View";[bn];[E7]=!0;constructor({name:n,schema:i,selectedFields:o,query:c}){this[bn]={name:n,originalName:n,schema:i,selectedFields:o,query:c,isExisting:!c,isAlias:!1}}getSQL(){return new u([this])}}Un.prototype.getSQL=function(){return new u([this])};L.prototype.getSQL=function(){return new u([this])};ci.prototype.getSQL=function(){return new u([this])};class lp{constructor(n){this.table=n}static[T]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class zx{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[T]="TableAliasProxyHandler";get(n,i){if(i===L.Symbol.IsAlias)return!0;if(i===L.Symbol.Name)return this.alias;if(this.replaceOriginalName&&i===L.Symbol.OriginalName)return this.alias;if(i===bn)return{...n[bn],name:this.alias,isAlias:!0};if(i===L.Symbol.Columns){let c=n[L.Symbol.Columns];if(!c)return c;let p={};return Object.keys(c).map((x)=>{p[x]=new Proxy(c[x],new lp(new Proxy(n,this)))}),p}let o=n[i];if(W(o,Un))return new Proxy(o,new lp(new Proxy(n,this)));return o}}function sm(n,i){return new Proxy(n,new zx(i,!1))}function Yo(n,i){return new Proxy(n,new lp(new Proxy(n.table,new zx(i,!1))))}function Wv(n,i){return new u.Aliased(Qx(n.sql,i),n.fieldAlias)}function Qx(n,i){return F.join(n.queryChunks.map((o)=>{if(W(o,Un))return Yo(o,i);if(W(o,u))return Qx(o,i);if(W(o,u.Aliased))return Wv(o,i);return o}))}class qm extends Error{static[T]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class Gv extends qm{static[T]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function bi(n,i){if(_J(i)&&!Xv(n)&&!W(n,Li)&&!W(n,go)&&!W(n,Un)&&!W(n,L)&&!W(n,Bi))return new Li(n,i);return n}var Mo=(n,i)=>{return F`${n} = ${bi(i,n)}`},jJ=(n,i)=>{return F`${n} <> ${bi(i,n)}`};function Oc(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new u(i);return new u([new pi("("),F.join(i,new pi(" and ")),new pi(")")])}function DJ(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new u(i);return new u([new pi("("),F.join(i,new pi(" or ")),new pi(")")])}function LJ(n){return F`not ${n}`}var Pm=(n,i)=>{return F`${n} > ${bi(i,n)}`},uJ=(n,i)=>{return F`${n} >= ${bi(i,n)}`},NJ=(n,i)=>{return F`${n} < ${bi(i,n)}`},hJ=(n,i)=>{return F`${n} <= ${bi(i,n)}`};function CJ(n,i){if(Array.isArray(i)){if(i.length===0)return F`false`;return F`${n} in ${i.map((o)=>bi(o,n))}`}return F`${n} in ${bi(i,n)}`}function IJ(n,i){if(Array.isArray(i)){if(i.length===0)return F`true`;return F`${n} not in ${i.map((o)=>bi(o,n))}`}return F`${n} not in ${bi(i,n)}`}function yJ(n){return F`${n} is null`}function kJ(n){return F`${n} is not null`}function ZJ(n){return F`exists ${n}`}function sJ(n){return F`not exists ${n}`}function qJ(n,i,o){return F`${n} between ${bi(i,n)} and ${bi(o,n)}`}function PJ(n,i,o){return F`${n} not between ${bi(i,n)} and ${bi(o,n)}`}function tJ(n,i){return F`${n} like ${i}`}function rJ(n,i){return F`${n} not like ${i}`}function gJ(n,i){return F`${n} ilike ${i}`}function dJ(n,i){return F`${n} not ilike ${i}`}function eJ(n){return F`${n} asc`}function nA(n){return F`${n} desc`}class iA{static[T]="ConsoleLogWriter";write(n){console.log(n)}}class Yv{static[T]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new iA}logQuery(n,i){let o=i.map((p)=>{try{return JSON.stringify(p)}catch{return String(p)}}),c=o.length?` -- params: [${o.join(", ")}]`:"";this.writer.write(`Query: ${n}${c}`)}}class Mv{static[T]="NoopLogger";logQuery(){}}class Ei{static[T]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}then(n,i){return this.execute().then(n,i)}}function oA(n,i,o){let c={},p=n.reduce((x,{path:m,field:a},f)=>{let v;if(W(a,Un))v=a;else if(W(a,u))v=a.decoder;else v=a.sql.decoder;let $=x;for(let[w,J]of m.entries())if(w<m.length-1){if(!(J in $))$[J]={};$=$[J]}else{let l=i[f],S=$[J]=l===null?null:v.mapFromDriverValue(l);if(o&&W(a,Un)&&m.length===2){let R=m[0];if(!(R in c))c[R]=S===null?mi(a.table):!1;else if(typeof c[R]==="string"&&c[R]!==mi(a.table))c[R]=!1}}return x},{});if(o&&Object.keys(c).length>0){for(let[x,m]of Object.entries(c))if(typeof m==="string"&&!o[m])p[x]=null}return p}function ri(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let x=i?[...i,c]:[c];if(W(p,Un)||W(p,u)||W(p,u.Aliased))o.push({path:x,field:p});else if(W(p,L))o.push(...ri(p[L.Symbol.Columns],x));else o.push(...ri(p,x));return o},[])}function Ex(n,i){let o=Object.keys(n),c=Object.keys(i);if(o.length!==c.length)return!1;for(let[p,x]of o.entries())if(x!==c[p])return!1;return!0}function tm(n,i){let o=Object.entries(i).filter(([,c])=>c!==void 0).map(([c,p])=>{if(W(p,u)||W(p,Un))return[c,p];else return[c,new Li(p,n[L.Symbol.Columns][c])]});if(o.length===0)throw new Error("No values to set");return Object.fromEntries(o)}function cA(n,i){for(let o of i)for(let c of Object.getOwnPropertyNames(o.prototype)){if(c==="constructor")continue;Object.defineProperty(n.prototype,c,Object.getOwnPropertyDescriptor(o.prototype,c)||Object.create(null))}}function pA(n){return n[L.Symbol.Columns]}function _o(n){return W(n,ci)?n._.alias:W(n,Bi)?n[bn].name:W(n,u)?void 0:n[L.Symbol.IsAlias]?n[L.Symbol.Name]:n[L.Symbol.BaseName]}function Jn(n,i){return{name:typeof n==="string"&&n.length>0?n:"",config:typeof n==="object"?n:i}}function xA(n){if(typeof n!=="object"||n===null)return!1;if(n.constructor.name!=="Object")return!1;if("logger"in n){let i=typeof n.logger;if(i!=="boolean"&&(i!=="object"||typeof n.logger.logQuery!=="function")&&i!=="undefined")return!1;return!0}if("schema"in n){let i=typeof n.logger;if(i!=="object"&&i!=="undefined")return!1;return!0}if("casing"in n){let i=typeof n.logger;if(i!=="string"&&i!=="undefined")return!1;return!0}if("mode"in n){if(n.mode!=="default"||n.mode!=="planetscale"||n.mode!==void 0)return!1;return!0}if("connection"in n){let i=typeof n.connection;if(i!=="string"&&i!=="object"&&i!=="undefined")return!1;return!0}if("client"in n){let i=typeof n.client;if(i!=="object"&&i!=="function"&&i!=="undefined")return!1;return!0}if(Object.keys(n).length===0)return!0;return!1}class eo extends C{static[T]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"always",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"byDefault",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}class mA extends eo{static[T]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new aA(n,this.config)}}class aA extends V{static[T]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class fA extends eo{static[T]="PgBigInt64Builder";constructor(n){super(n,"bigint","PgBigInt64")}build(n){return new vA(n,this.config)}}class vA extends V{static[T]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function $A(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new mA(o);return new fA(o)}class wA extends C{static[T]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new JA(n,this.config)}}class JA extends V{static[T]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class AA extends C{static[T]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new TA(n,this.config)}}class TA extends V{static[T]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function FA(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new wA(o);return new AA(o)}class RA extends C{static[T]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new lA(n,this.config)}}class lA extends V{static[T]="PgBoolean";getSQLType(){return"boolean"}}function Ox(n){return new RA(n??"")}class SA extends C{static[T]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new XA(n,this.config)}}class XA extends V{static[T]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}function KA(n,i={}){let{name:o,config:c}=Jn(n,i);return new SA(o,c)}class WA extends C{static[T]="PgCidrBuilder";constructor(n){super(n,"string","PgCidr")}build(n){return new GA(n,this.config)}}class GA extends V{static[T]="PgCidr";getSQLType(){return"cidr"}}function YA(n){return new WA(n??"")}class MA extends C{static[T]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new HA(n,this.config)}}class HA extends V{static[T]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(n,i){super(n,i);this.sqlName=i.customTypeParams.dataType(i.fieldConfig),this.mapTo=i.customTypeParams.toDriver,this.mapFrom=i.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(n){return typeof this.mapFrom==="function"?this.mapFrom(n):n}mapToDriverValue(n){return typeof this.mapTo==="function"?this.mapTo(n):n}}function zA(n){return(i,o)=>{let{name:c,config:p}=Jn(i,o);return new MA(c,p,n)}}class Bo extends C{static[T]="PgDateColumnBaseBuilder";defaultNow(){return this.default(F`now()`)}}class QA extends Bo{static[T]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new rm(n,this.config)}}class rm extends V{static[T]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class EA extends Bo{static[T]="PgDateStringBuilder";constructor(n){super(n,"string","PgDateString")}build(n){return new gm(n,this.config)}}class gm extends V{static[T]="PgDateString";getSQLType(){return"date"}}function OA(n,i){let{name:o,config:c}=Jn(n,i);if(c?.mode==="date")return new QA(o);return new EA(o)}class UA extends C{static[T]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new VA(n,this.config)}}class VA extends V{static[T]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function _A(n){return new UA(n??"")}class BA extends C{static[T]="PgInetBuilder";constructor(n){super(n,"string","PgInet")}build(n){return new bA(n,this.config)}}class bA extends V{static[T]="PgInet";getSQLType(){return"inet"}}function jA(n){return new BA(n??"")}class DA extends eo{static[T]="PgIntegerBuilder";constructor(n){super(n,"number","PgInteger")}build(n){return new LA(n,this.config)}}class LA extends V{static[T]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseInt(n);return n}}function dm(n){return new DA(n??"")}class uA extends C{static[T]="PgIntervalBuilder";constructor(n,i){super(n,"string","PgInterval");this.config.intervalConfig=i}build(n){return new NA(n,this.config)}}class NA extends V{static[T]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let n=this.fields?` ${this.fields}`:"",i=this.precision?`(${this.precision})`:"";return`interval${n}${i}`}}function hA(n,i={}){let{name:o,config:c}=Jn(n,i);return new uA(o,c)}class CA extends C{static[T]="PgJsonBuilder";constructor(n){super(n,"json","PgJson")}build(n){return new em(n,this.config)}}class em extends V{static[T]="PgJson";constructor(n,i){super(n,i)}getSQLType(){return"json"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function IA(n){return new CA(n??"")}class yA extends C{static[T]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new na(n,this.config)}}class na extends V{static[T]="PgJsonb";constructor(n,i){super(n,i)}getSQLType(){return"jsonb"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function kA(n){return new yA(n??"")}class ZA extends C{static[T]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new sA(n,this.config)}}class sA extends V{static[T]="PgLine";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o),Number.parseFloat(c)]}mapToDriverValue(n){return`{${n[0]},${n[1]},${n[2]}}`}}class qA extends C{static[T]="PgLineABCBuilder";constructor(n){super(n,"json","PgLineABC")}build(n){return new PA(n,this.config)}}class PA extends V{static[T]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return{a:Number.parseFloat(i),b:Number.parseFloat(o),c:Number.parseFloat(c)}}mapToDriverValue(n){return`{${n.a},${n.b},${n.c}}`}}function tA(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new ZA(o);return new qA(o)}class rA extends C{static[T]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new gA(n,this.config)}}class gA extends V{static[T]="PgMacaddr";getSQLType(){return"macaddr"}}function dA(n){return new rA(n??"")}class eA extends C{static[T]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new nT(n,this.config)}}class nT extends V{static[T]="PgMacaddr8";getSQLType(){return"macaddr8"}}function iT(n){return new eA(n??"")}class oT extends C{static[T]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new ia(n,this.config)}}class ia extends V{static[T]="PgNumeric";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}function cT(n,i){let{name:o,config:c}=Jn(n,i);return new oT(o,c?.precision,c?.scale)}class pT extends C{static[T]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new xT(n,this.config)}}class xT extends V{static[T]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o)]}return[n.x,n.y]}mapToDriverValue(n){return`(${n[0]},${n[1]})`}}class mT extends C{static[T]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new aT(n,this.config)}}class aT extends V{static[T]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return{x:Number.parseFloat(i),y:Number.parseFloat(o)}}return n}mapToDriverValue(n){return`(${n.x},${n.y})`}}function fT(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new pT(o);return new mT(o)}function O7(n){let i=[];for(let o=0;o<n.length;o+=2)i.push(Number.parseInt(n.slice(o,o+2),16));return new Uint8Array(i)}function vT(n,i){let o=new ArrayBuffer(8),c=new DataView(o);for(let p=0;p<8;p++)c.setUint8(p,n[i+p]);return c.getFloat64(0,!0)}function Hv(n){let i=O7(n),o=0,c=i[o];o+=1;let p=new DataView(i.buffer),x=p.getUint32(o,c===1);o+=4;let m;if(x&536870912)m=p.getUint32(o,c===1),o+=4;if((x&65535)===1){let a=vT(i,o);o+=8;let f=vT(i,o);return o+=8,[a,f]}throw new Error("Unsupported geometry type")}class $T extends C{static[T]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new wT(n,this.config)}}class wT extends V{static[T]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return Hv(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class JT extends C{static[T]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new AT(n,this.config)}}class AT extends V{static[T]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=Hv(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function TT(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new $T(o);return new JT(o)}class FT extends C{static[T]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new RT(n,this.config)}}class RT extends V{static[T]="PgReal";constructor(n,i){super(n,i)}getSQLType(){return"real"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number.parseFloat(n);return n}}function lT(n){return new FT(n??"")}class ST extends C{static[T]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new XT(n,this.config)}}class XT extends V{static[T]="PgSerial";getSQLType(){return"serial"}}function KT(n){return new ST(n??"")}class WT extends eo{static[T]="PgSmallIntBuilder";constructor(n){super(n,"number","PgSmallInt")}build(n){return new GT(n,this.config)}}class GT extends V{static[T]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number(n);return n}}function YT(n){return new WT(n??"")}class MT extends C{static[T]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new HT(n,this.config)}}class HT extends V{static[T]="PgSmallSerial";getSQLType(){return"smallserial"}}function zT(n){return new MT(n??"")}class QT extends C{static[T]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new ET(n,this.config)}}class ET extends V{static[T]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function OT(n,i={}){let{name:o,config:c}=Jn(n,i);return new QT(o,c)}class UT extends Bo{constructor(n,i,o){super(n,"string","PgTime");this.withTimezone=i,this.precision=o,this.config.withTimezone=i,this.config.precision=o}static[T]="PgTimeBuilder";build(n){return new oa(n,this.config)}}class oa extends V{static[T]="PgTime";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function VT(n,i={}){let{name:o,config:c}=Jn(n,i);return new UT(o,c.withTimezone??!1,c.precision)}class _T extends Bo{static[T]="PgTimestampBuilder";constructor(n,i,o){super(n,"date","PgTimestamp");this.config.withTimezone=i,this.config.precision=o}build(n){return new ca(n,this.config)}}class ca extends V{static[T]="PgTimestamp";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue=(n)=>{return new Date(this.withTimezone?n:n+"+0000")};mapToDriverValue=(n)=>{return n.toISOString()}}class BT extends Bo{static[T]="PgTimestampStringBuilder";constructor(n,i,o){super(n,"string","PgTimestampString");this.config.withTimezone=i,this.config.precision=o}build(n){return new pa(n,this.config)}}class pa extends V{static[T]="PgTimestampString";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function fo(n,i={}){let{name:o,config:c}=Jn(n,i);if(c?.mode==="string")return new BT(o,c.withTimezone??!1,c.precision);return new _T(o,c?.withTimezone??!1,c?.precision)}class bT extends C{static[T]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(F`gen_random_uuid()`)}build(n){return new xa(n,this.config)}}class xa extends V{static[T]="PgUUID";getSQLType(){return"uuid"}}function ui(n){return new bT(n??"")}class jT extends C{static[T]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new DT(n,this.config)}}class DT extends V{static[T]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}function Ji(n,i={}){let{name:o,config:c}=Jn(n,i);return new jT(o,c)}class LT extends C{static[T]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new uT(n,this.config)}}class uT extends V{static[T]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function NT(n,i){let{name:o,config:c}=Jn(n,i);return new LT(o,c)}class hT extends C{static[T]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new CT(n,this.config)}}class CT extends V{static[T]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function IT(n,i){let{name:o,config:c}=Jn(n,i);return new hT(o,c)}class yT extends C{static[T]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new kT(n,this.config)}}class kT extends V{static[T]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function ZT(n,i){let{name:o,config:c}=Jn(n,i);return new yT(o,c)}class sT extends C{static[T]="PgVectorBuilder";constructor(n,i){super(n,"array","PgVector");this.config.dimensions=i.dimensions}build(n){return new qT(n,this.config)}}class qT extends V{static[T]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function PT(n,i){let{name:o,config:c}=Jn(n,i);return new sT(o,c)}function tT(){return{bigint:$A,bigserial:FA,boolean:Ox,char:KA,cidr:YA,customType:zA,date:OA,doublePrecision:_A,inet:jA,integer:dm,interval:hA,json:IA,jsonb:kA,line:tA,macaddr:dA,macaddr8:iT,numeric:cT,point:fT,geometry:TT,real:lT,serial:KT,smallint:YT,smallserial:zT,text:OT,time:VT,timestamp:fo,uuid:ui,varchar:Ji,bit:NT,halfvec:IT,sparsevec:ZT,vector:PT}}var zv=Symbol.for("drizzle:PgInlineForeignKeys"),rT=Symbol.for("drizzle:EnableRLS");class Ai extends L{static[T]="PgTable";static Symbol=Object.assign({},L.Symbol,{InlineForeignKeys:zv,EnableRLS:rT});[zv]=[];[rT]=!1;[L.Symbol.ExtraConfigBuilder]=void 0;[L.Symbol.ExtraConfigColumns]={}}function U7(n,i,o,c,p=n){let x=new Ai(n,c,p),m=typeof i==="function"?i(tT()):i,a=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let l=J.build(x);return x[zv].push(...J.buildForeignKeys(l,x)),[$,l]})),f=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let l=J.buildExtraConfigColumn(x);return[$,l]})),v=Object.assign(x,a);if(v[L.Symbol.Columns]=a,v[L.Symbol.ExtraConfigColumns]=f,o)v[Ai.Symbol.ExtraConfigBuilder]=o;return Object.assign(v,{enableRLS:()=>{return v[Ai.Symbol.EnableRLS]=!0,v}})}var nc=(n,i,o)=>{return U7(n,i,o,void 0)};function gT(...n){if(n[0].columns)return new Ux(n[0].columns,n[0].name);return new Ux(n)}class Ux{static[T]="PgPrimaryKeyBuilder";columns;name;constructor(n,i){this.columns=n,this.name=i}build(n){return new dT(n,this.columns,this.name)}}class dT{constructor(n,i,o){this.table=n,this.columns=i,this.name=o}static[T]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[Ai.Symbol.Name]}_${this.columns.map((n)=>n.name).join("_")}_pk`}}class Qv{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[L.Symbol.Name]}static[T]="Relation";referencedTableName;fieldName}class eT{constructor(n,i){this.table=n,this.config=i}static[T]="Relations"}class ic extends Qv{constructor(n,i,o,c){super(n,i,o?.relationName);this.config=o,this.isNullable=c}static[T]="One";withFieldName(n){let i=new ic(this.sourceTable,this.referencedTable,this.config,this.isNullable);return i.fieldName=n,i}}class Vx extends Qv{constructor(n,i,o){super(n,i,o?.relationName);this.config=o}static[T]="Many";withFieldName(n){let i=new Vx(this.sourceTable,this.referencedTable,this.config);return i.fieldName=n,i}}function nF(){return{and:Oc,between:qJ,eq:Mo,exists:ZJ,gt:Pm,gte:uJ,ilike:gJ,inArray:CJ,isNull:yJ,isNotNull:kJ,like:tJ,lt:NJ,lte:hJ,ne:jJ,not:LJ,notBetween:PJ,notExists:sJ,notLike:rJ,notIlike:dJ,notInArray:IJ,or:DJ,sql:F}}function iF(){return{sql:F,asc:eJ,desc:nA}}function oF(n,i){if(Object.keys(n).length===1&&"default"in n&&!W(n.default,L))n=n.default;let o={},c={},p={};for(let[x,m]of Object.entries(n))if(W(m,L)){let a=Ec(m),f=c[a];o[a]=x,p[x]={tsName:x,dbName:m[L.Symbol.Name],schema:m[L.Symbol.Schema],columns:m[L.Symbol.Columns],relations:f?.relations??{},primaryKey:f?.primaryKey??[]};for(let $ of Object.values(m[L.Symbol.Columns]))if($.primary)p[x].primaryKey.push($);let v=m[L.Symbol.ExtraConfigBuilder]?.(m[L.Symbol.ExtraConfigColumns]);if(v){for(let $ of Object.values(v))if(W($,Ux))p[x].primaryKey.push(...$.columns)}}else if(W(m,eT)){let a=Ec(m.table),f=o[a],v=m.config(i(m.table)),$;for(let[w,J]of Object.entries(v))if(f){let l=p[f];if(l.relations[w]=J,$)l.primaryKey.push(...$)}else{if(!(a in c))c[a]={relations:{},primaryKey:$};c[a].relations[w]=J}}return{tables:p,tableNamesMap:o}}function V7(n){return function i(o,c){return new ic(n,o,c,c?.fields.reduce((p,x)=>p&&x.notNull,!0)??!1)}}function _7(n){return function i(o,c){return new Vx(n,o,c)}}function cF(n,i,o){if(W(o,ic)&&o.config)return{fields:o.config.fields,references:o.config.references};let c=i[Ec(o.referencedTable)];if(!c)throw new Error(`Table "${o.referencedTable[L.Symbol.Name]}" not found in schema`);let p=n[c];if(!p)throw new Error(`Table "${c}" not found in schema`);let x=o.sourceTable,m=i[Ec(x)];if(!m)throw new Error(`Table "${x[L.Symbol.Name]}" not found in schema`);let a=[];for(let f of Object.values(p.relations))if(o.relationName&&o!==f&&f.relationName===o.relationName||!o.relationName&&f.referencedTable===o.sourceTable)a.push(f);if(a.length>1)throw o.relationName?new Error(`There are multiple relations with name "${o.relationName}" in table "${c}"`):new Error(`There are multiple relations between "${c}" and "${o.sourceTable[L.Symbol.Name]}". Please specify relation name`);if(a[0]&&W(a[0],ic)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${m}.${o.fieldName}"`)}function pF(n){return{one:V7(n),many:_7(n)}}function ma(n,i,o,c,p=(x)=>x){let x={};for(let[m,a]of c.entries())if(a.isJson){let f=i.relations[a.tsKey],v=o[m],$=typeof v==="string"?JSON.parse(v):v;x[a.tsKey]=W(f,ic)?$&&ma(n,n[a.relationTableTsKey],$,a.selection,p):$.map((w)=>ma(n,n[a.relationTableTsKey],w,a.selection,p))}else{let f=p(o[m]),v=a.field,$;if(W(v,Un))$=v;else if(W(v,u))$=v.decoder;else $=v.sql.decoder;x[a.tsKey]=f===null?null:$.mapFromDriverValue(f)}return x}var s6=$f(Z6(),1),{Server:q6,Namespace:yu,Socket:ku}=s6.default;import{readFileSync as fR}from"fs";import{resolve as Q$}from"path";function E9(n,i){let o={},c=[];for(let p in n){let x=n[p],m=i[p],a=x["~standard"].validate(m);if(a instanceof Promise)throw new Error(`Validation must be synchronous, but ${p} returned a Promise.`);if(a.issues){c.push(...a.issues.map((f)=>({...f,path:[p,...f.path??[]]})));continue}o[p]=a.value}if(c.length)return{issues:c};return{value:o}}function P6(n){let i=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1){for(let[M,I]of Object.entries(i))if(I==="")delete i[M]}if(!!n.skipValidation)return i;let p=typeof n.client==="object"?n.client:{},x=typeof n.server==="object"?n.server:{},m=typeof n.shared==="object"?n.shared:{},a=n.isServer??(typeof window==="undefined"||("Deno"in window)),f=a?{...x,...m,...p}:{...p,...m},v=E9(f,i),$=n.onValidationError??((M)=>{throw console.error("\u274C Invalid environment variables:",M),new Error("Invalid environment variables")}),w=n.onInvalidAccess??(()=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(v.issues)return $(v.issues);let J=(M)=>{if(!n.clientPrefix)return!0;return!M.startsWith(n.clientPrefix)&&!(M in m)},l=(M)=>{return a||!J(M)},S=(M)=>{return M==="__esModule"||M==="$$typeof"},R=(n.extends??[]).reduce((M,I)=>{return Object.assign(M,I)},{}),K=Object.assign(v.value,R);return new Proxy(K,{get(M,I){if(typeof I!=="string")return;if(S(I))return;if(!l(I))return w(I);return Reflect.get(M,I)}})}var Tn;(function(n){n.assertEqual=(p)=>p;function i(p){}n.assertIs=i;function o(p){throw new Error}n.assertNever=o,n.arrayToEnum=(p)=>{let x={};for(let m of p)x[m]=m;return x},n.getValidEnumValues=(p)=>{let x=n.objectKeys(p).filter((a)=>typeof p[p[a]]!=="number"),m={};for(let a of x)m[a]=p[a];return n.objectValues(m)},n.objectValues=(p)=>{return n.objectKeys(p).map(function(x){return p[x]})},n.objectKeys=typeof Object.keys==="function"?(p)=>Object.keys(p):(p)=>{let x=[];for(let m in p)if(Object.prototype.hasOwnProperty.call(p,m))x.push(m);return x},n.find=(p,x)=>{for(let m of p)if(x(m))return m;return},n.isInteger=typeof Number.isInteger==="function"?(p)=>Number.isInteger(p):(p)=>typeof p==="number"&&isFinite(p)&&Math.floor(p)===p;function c(p,x=" | "){return p.map((m)=>typeof m==="string"?`'${m}'`:m).join(x)}n.joinValues=c,n.jsonStringifyReplacer=(p,x)=>{if(typeof x==="bigint")return x.toString();return x}})(Tn||(Tn={}));var Y$;(function(n){n.mergeShapes=(i,o)=>{return{...i,...o}}})(Y$||(Y$={}));var N=Tn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),uo=(n)=>{switch(typeof n){case"undefined":return N.undefined;case"string":return N.string;case"number":return isNaN(n)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":if(Array.isArray(n))return N.array;if(n===null)return N.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return N.promise;if(typeof Map!=="undefined"&&n instanceof Map)return N.map;if(typeof Set!=="undefined"&&n instanceof Set)return N.set;if(typeof Date!=="undefined"&&n instanceof Date)return N.date;return N.object;default:return N.unknown}},U=Tn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),O9=(n)=>{return JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:")};class Ii extends Error{get errors(){return this.issues}constructor(n){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let i=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,i);else this.__proto__=i;this.name="ZodError",this.issues=n}format(n){let i=n||function(p){return p.message},o={_errors:[]},c=(p)=>{for(let x of p.issues)if(x.code==="invalid_union")x.unionErrors.map(c);else if(x.code==="invalid_return_type")c(x.returnTypeError);else if(x.code==="invalid_arguments")c(x.argumentsError);else if(x.path.length===0)o._errors.push(i(x));else{let m=o,a=0;while(a<x.path.length){let f=x.path[a];if(a!==x.path.length-1)m[f]=m[f]||{_errors:[]};else m[f]=m[f]||{_errors:[]},m[f]._errors.push(i(x));m=m[f],a++}}};return c(this),o}static assert(n){if(!(n instanceof Ii))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=(i)=>i.message){let i={},o=[];for(let c of this.issues)if(c.path.length>0)i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(n(c));else o.push(n(c));return{formErrors:o,fieldErrors:i}}get formErrors(){return this.flatten()}}Ii.create=(n)=>{return new Ii(n)};var jp=(n,i)=>{let o;switch(n.code){case U.invalid_type:if(n.received===N.undefined)o="Required";else o=`Expected ${n.expected}, received ${n.received}`;break;case U.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(n.expected,Tn.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:o=`Unrecognized key(s) in object: ${Tn.joinValues(n.keys,", ")}`;break;case U.invalid_union:o="Invalid input";break;case U.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Tn.joinValues(n.options)}`;break;case U.invalid_enum_value:o=`Invalid enum value. Expected ${Tn.joinValues(n.options)}, received '${n.received}'`;break;case U.invalid_arguments:o="Invalid function arguments";break;case U.invalid_return_type:o="Invalid function return type";break;case U.invalid_date:o="Invalid date";break;case U.invalid_string:if(typeof n.validation==="object")if("includes"in n.validation){if(o=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${n.validation.position}`}else if("startsWith"in n.validation)o=`Invalid input: must start with "${n.validation.startsWith}"`;else if("endsWith"in n.validation)o=`Invalid input: must end with "${n.validation.endsWith}"`;else Tn.assertNever(n.validation);else if(n.validation!=="regex")o=`Invalid ${n.validation}`;else o="Invalid";break;case U.too_small:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`;else o="Invalid input";break;case U.too_big:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="bigint")o=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`;else o="Invalid input";break;case U.custom:o="Invalid input";break;case U.invalid_intersection_types:o="Intersection results could not be merged";break;case U.not_multiple_of:o=`Number must be a multiple of ${n.multipleOf}`;break;case U.not_finite:o="Number must be finite";break;default:o=i.defaultError,Tn.assertNever(n)}return{message:o}},d6=jp;function U9(n){d6=n}function Ba(){return d6}var ba=(n)=>{let{data:i,path:o,errorMaps:c,issueData:p}=n,x=[...o,...p.path||[]],m={...p,path:x};if(p.message!==void 0)return{...p,path:x,message:p.message};let a="",f=c.filter((v)=>!!v).slice().reverse();for(let v of f)a=v(m,{data:i,defaultError:a}).message;return{...p,path:x,message:a}},V9=[];function j(n,i){let o=Ba(),c=ba({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,o,o===jp?void 0:jp].filter((p)=>!!p)});n.common.issues.push(c)}class Hi{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(n,i){let o=[];for(let c of i){if(c.status==="aborted")return g;if(c.status==="dirty")n.dirty();o.push(c.value)}return{status:n.value,value:o}}static async mergeObjectAsync(n,i){let o=[];for(let c of i){let p=await c.key,x=await c.value;o.push({key:p,value:x})}return Hi.mergeObjectSync(n,o)}static mergeObjectSync(n,i){let o={};for(let c of i){let{key:p,value:x}=c;if(p.status==="aborted")return g;if(x.status==="aborted")return g;if(p.status==="dirty")n.dirty();if(x.status==="dirty")n.dirty();if(p.value!=="__proto__"&&(typeof x.value!=="undefined"||c.alwaysSet))o[p.value]=x.value}return{status:n.value,value:o}}}var g=Object.freeze({status:"aborted"}),Bp=(n)=>({status:"dirty",value:n}),Ui=(n)=>({status:"valid",value:n}),M$=(n)=>n.status==="aborted",H$=(n)=>n.status==="dirty",uc=(n)=>n.status==="valid",Cx=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function ja(n,i,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(n):c?c.value:i.get(n)}function e6(n,i,o,c,p){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?n!==i||!p:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?p.call(n,o):p?p.value=o:i.set(n,o),o}var k;(function(n){n.errToObj=(i)=>typeof i==="string"?{message:i}:i||{},n.toString=(i)=>typeof i==="string"?i:i===null||i===void 0?void 0:i.message})(k||(k={}));var Nx,hx;class Fo{constructor(n,i,o,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=o,this._key=c}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var t6=(n,i)=>{if(uc(i))return{success:!0,data:i.value};else{if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new Ii(n.common.issues);return this._error=o,this._error}}}};function cn(n){if(!n)return{};let{errorMap:i,invalid_type_error:o,required_error:c,description:p}=n;if(i&&(o||c))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(i)return{errorMap:i,description:p};return{errorMap:(m,a)=>{var f,v;let{message:$}=n;if(m.code==="invalid_enum_value")return{message:$!==null&&$!==void 0?$:a.defaultError};if(typeof a.data==="undefined")return{message:(f=$!==null&&$!==void 0?$:c)!==null&&f!==void 0?f:a.defaultError};if(m.code!=="invalid_type")return{message:a.defaultError};return{message:(v=$!==null&&$!==void 0?$:o)!==null&&v!==void 0?v:a.defaultError}},description:p}}class pn{get description(){return this._def.description}_getType(n){return uo(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:uo(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Hi,ctx:{common:n.parent.common,data:n.data,parsedType:uo(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(Cx(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){let i=this._parse(n);return Promise.resolve(i)}parse(n,i){let o=this.safeParse(n,i);if(o.success)return o.data;throw o.error}safeParse(n,i){var o;let c={common:{issues:[],async:(o=i===null||i===void 0?void 0:i.async)!==null&&o!==void 0?o:!1,contextualErrorMap:i===null||i===void 0?void 0:i.errorMap},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:uo(n)},p=this._parseSync({data:n,path:c.path,parent:c});return t6(c,p)}"~validate"(n){var i,o;let c={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:uo(n)};if(!this["~standard"].async)try{let p=this._parseSync({data:n,path:[],parent:c});return uc(p)?{value:p.value}:{issues:c.common.issues}}catch(p){if((o=(i=p===null||p===void 0?void 0:p.message)===null||i===void 0?void 0:i.toLowerCase())===null||o===void 0?void 0:o.includes("encountered"))this["~standard"].async=!0;c.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:c}).then((p)=>uc(p)?{value:p.value}:{issues:c.common.issues})}async parseAsync(n,i){let o=await this.safeParseAsync(n,i);if(o.success)return o.data;throw o.error}async safeParseAsync(n,i){let o={common:{issues:[],contextualErrorMap:i===null||i===void 0?void 0:i.errorMap,async:!0},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:uo(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(Cx(c)?c:Promise.resolve(c));return t6(o,p)}refine(n,i){let o=(c)=>{if(typeof i==="string"||typeof i==="undefined")return{message:i};else if(typeof i==="function")return i(c);else return i};return this._refinement((c,p)=>{let x=n(c),m=()=>p.addIssue({code:U.custom,...o(c)});if(typeof Promise!=="undefined"&&x instanceof Promise)return x.then((a)=>{if(!a)return m(),!1;else return!0});if(!x)return m(),!1;else return!0})}refinement(n,i){return this._refinement((o,c)=>{if(!n(o))return c.addIssue(typeof i==="function"?i(o,c):i),!1;else return!0})}_refinement(n){return new no({schema:this,typeName:r.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(i)=>this["~validate"](i)}}optional(){return To.create(this,this._def)}nullable(){return No.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ao.create(this)}promise(){return Ic.create(this,this._def)}or(n){return Np.create([this,n],this._def)}and(n){return hp.create(this,n,this._def)}transform(n){return new no({...cn(this._def),schema:this,typeName:r.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new kp({...cn(this._def),innerType:this,defaultValue:i,typeName:r.ZodDefault})}brand(){return new La({typeName:r.ZodBranded,type:this,...cn(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new Zp({...cn(this._def),innerType:this,catchValue:i,typeName:r.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return qx.create(this,n)}readonly(){return sp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var _9=/^c[^\s-]{8,}$/i,B9=/^[0-9a-z]+$/,b9=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j9=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,D9=/^[a-z0-9_-]{21}$/i,L9=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,u9=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,N9=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,h9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",G$,C9=/^(?:(?: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])$/,I9=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,y9=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,k9=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Z9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,s9=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nR="((\\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])))",q9=new RegExp(`^${nR}$`);function iR(n){let i="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(n.precision)i=`${i}\\.\\d{${n.precision}}`;else if(n.precision==null)i=`${i}(\\.\\d+)?`;return i}function P9(n){return new RegExp(`^${iR(n)}$`)}function oR(n){let i=`${nR}T${iR(n)}`,o=[];if(o.push(n.local?"Z?":"Z"),n.offset)o.push("([+-]\\d{2}:?\\d{2})");return i=`${i}(${o.join("|")})`,new RegExp(`^${i}$`)}function t9(n,i){if((i==="v4"||!i)&&C9.test(n))return!0;if((i==="v6"||!i)&&y9.test(n))return!0;return!1}function r9(n,i){if(!L9.test(n))return!1;try{let[o]=n.split("."),c=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),p=JSON.parse(atob(c));if(typeof p!=="object"||p===null)return!1;if(!p.typ||!p.alg)return!1;if(i&&p.alg!==i)return!1;return!0}catch(o){return!1}}function g9(n,i){if((i==="v4"||!i)&&I9.test(n))return!0;if((i==="v6"||!i)&&k9.test(n))return!0;return!1}class Jo extends pn{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==N.string){let p=this._getOrReturnCtx(n);return j(p,{code:U.invalid_type,expected:N.string,received:p.parsedType}),g}let o=new Hi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.length<p.value)c=this._getOrReturnCtx(n,c),j(c,{code:U.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="max"){if(n.data.length>p.value)c=this._getOrReturnCtx(n,c),j(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="length"){let x=n.data.length>p.value,m=n.data.length<p.value;if(x||m){if(c=this._getOrReturnCtx(n,c),x)j(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(m)j(c,{code:U.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});o.dirty()}}else if(p.kind==="email"){if(!N9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"email",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!G$)G$=new RegExp(h9,"u");if(!G$.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"emoji",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!j9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"uuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!D9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"nanoid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!_9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"cuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!B9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"cuid2",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!b9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"ulid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="url")try{new URL(n.data)}catch(x){c=this._getOrReturnCtx(n,c),j(c,{validation:"url",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="regex"){if(p.regex.lastIndex=0,!p.regex.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"regex",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="trim")n.data=n.data.trim();else if(p.kind==="includes"){if(!n.data.includes(p.value,p.position))c=this._getOrReturnCtx(n,c),j(c,{code:U.invalid_string,validation:{includes:p.value,position:p.position},message:p.message}),o.dirty()}else if(p.kind==="toLowerCase")n.data=n.data.toLowerCase();else if(p.kind==="toUpperCase")n.data=n.data.toUpperCase();else if(p.kind==="startsWith"){if(!n.data.startsWith(p.value))c=this._getOrReturnCtx(n,c),j(c,{code:U.invalid_string,validation:{startsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="endsWith"){if(!n.data.endsWith(p.value))c=this._getOrReturnCtx(n,c),j(c,{code:U.invalid_string,validation:{endsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="datetime"){if(!oR(p).test(n.data))c=this._getOrReturnCtx(n,c),j(c,{code:U.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!q9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{code:U.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!P9(p).test(n.data))c=this._getOrReturnCtx(n,c),j(c,{code:U.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!u9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"duration",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!t9(n.data,p.version))c=this._getOrReturnCtx(n,c),j(c,{validation:"ip",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="jwt"){if(!r9(n.data,p.alg))c=this._getOrReturnCtx(n,c),j(c,{validation:"jwt",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cidr"){if(!g9(n.data,p.version))c=this._getOrReturnCtx(n,c),j(c,{validation:"cidr",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!Z9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"base64",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64url"){if(!s9.test(n.data))c=this._getOrReturnCtx(n,c),j(c,{validation:"base64url",code:U.invalid_string,message:p.message}),o.dirty()}else Tn.assertNever(p);return{status:o.value,value:n.data}}_regex(n,i,o){return this.refinement((c)=>n.test(c),{validation:i,code:U.invalid_string,...k.errToObj(o)})}_addCheck(n){return new Jo({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...k.errToObj(n)})}url(n){return this._addCheck({kind:"url",...k.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...k.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...k.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...k.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...k.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...k.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...k.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...k.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...k.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...k.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...k.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...k.errToObj(n)})}datetime(n){var i,o;if(typeof n==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n});return this._addCheck({kind:"datetime",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,offset:(i=n===null||n===void 0?void 0:n.offset)!==null&&i!==void 0?i:!1,local:(o=n===null||n===void 0?void 0:n.local)!==null&&o!==void 0?o:!1,...k.errToObj(n===null||n===void 0?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){if(typeof n==="string")return this._addCheck({kind:"time",precision:null,message:n});return this._addCheck({kind:"time",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,...k.errToObj(n===null||n===void 0?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...k.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...k.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i===null||i===void 0?void 0:i.position,...k.errToObj(i===null||i===void 0?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...k.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...k.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...k.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...k.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...k.errToObj(i)})}nonempty(n){return this.min(1,k.errToObj(n))}trim(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((n)=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find((n)=>n.kind==="date")}get isTime(){return!!this._def.checks.find((n)=>n.kind==="time")}get isDuration(){return!!this._def.checks.find((n)=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find((n)=>n.kind==="email")}get isURL(){return!!this._def.checks.find((n)=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find((n)=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find((n)=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((n)=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((n)=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((n)=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find((n)=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find((n)=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find((n)=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find((n)=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find((n)=>n.kind==="base64url")}get minLength(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxLength(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}Jo.create=(n)=>{var i;return new Jo({checks:[],typeName:r.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};function d9(n,i){let o=(n.toString().split(".")[1]||"").length,c=(i.toString().split(".")[1]||"").length,p=o>c?o:c,x=parseInt(n.toFixed(p).replace(".","")),m=parseInt(i.toFixed(p).replace(".",""));return x%m/Math.pow(10,p)}class ac extends pn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce)n.data=Number(n.data);if(this._getType(n)!==N.number){let p=this._getOrReturnCtx(n);return j(p,{code:U.invalid_type,expected:N.number,received:p.parsedType}),g}let o=void 0,c=new Hi;for(let p of this._def.checks)if(p.kind==="int"){if(!Tn.isInteger(n.data))o=this._getOrReturnCtx(n,o),j(o,{code:U.invalid_type,expected:"integer",received:"float",message:p.message}),c.dirty()}else if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),j(o,{code:U.too_small,minimum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),j(o,{code:U.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(d9(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),j(o,{code:U.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else if(p.kind==="finite"){if(!Number.isFinite(n.data))o=this._getOrReturnCtx(n,o),j(o,{code:U.not_finite,message:p.message}),c.dirty()}else Tn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,k.toString(i))}gt(n,i){return this.setLimit("min",n,!1,k.toString(i))}lte(n,i){return this.setLimit("max",n,!0,k.toString(i))}lt(n,i){return this.setLimit("max",n,!1,k.toString(i))}setLimit(n,i,o,c){return new ac({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:k.toString(c)}]})}_addCheck(n){return new ac({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:k.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:k.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:k.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(n)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}get isInt(){return!!this._def.checks.find((n)=>n.kind==="int"||n.kind==="multipleOf"&&Tn.isInteger(n.value))}get isFinite(){let n=null,i=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(i===null||o.value>i)i=o.value}else if(o.kind==="max"){if(n===null||o.value<n)n=o.value}return Number.isFinite(i)&&Number.isFinite(n)}}ac.create=(n)=>{return new ac({checks:[],typeName:r.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class fc extends pn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch(p){return this._getInvalidInput(n)}if(this._getType(n)!==N.bigint)return this._getInvalidInput(n);let o=void 0,c=new Hi;for(let p of this._def.checks)if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),j(o,{code:U.too_small,type:"bigint",minimum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),j(o,{code:U.too_big,type:"bigint",maximum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(n.data%p.value!==BigInt(0))o=this._getOrReturnCtx(n,o),j(o,{code:U.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else Tn.assertNever(p);return{status:c.value,value:n.data}}_getInvalidInput(n){let i=this._getOrReturnCtx(n);return j(i,{code:U.invalid_type,expected:N.bigint,received:i.parsedType}),g}gte(n,i){return this.setLimit("min",n,!0,k.toString(i))}gt(n,i){return this.setLimit("min",n,!1,k.toString(i))}lte(n,i){return this.setLimit("max",n,!0,k.toString(i))}lt(n,i){return this.setLimit("max",n,!1,k.toString(i))}setLimit(n,i,o,c){return new fc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:k.toString(c)}]})}_addCheck(n){return new fc({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:k.toString(i)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}fc.create=(n)=>{var i;return new fc({checks:[],typeName:r.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};class Dp extends pn{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==N.boolean){let o=this._getOrReturnCtx(n);return j(o,{code:U.invalid_type,expected:N.boolean,received:o.parsedType}),g}return Ui(n.data)}}Dp.create=(n)=>{return new Dp({typeName:r.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class Nc extends pn{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==N.date){let p=this._getOrReturnCtx(n);return j(p,{code:U.invalid_type,expected:N.date,received:p.parsedType}),g}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return j(p,{code:U.invalid_date}),g}let o=new Hi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.getTime()<p.value)c=this._getOrReturnCtx(n,c),j(c,{code:U.too_small,message:p.message,inclusive:!0,exact:!1,minimum:p.value,type:"date"}),o.dirty()}else if(p.kind==="max"){if(n.data.getTime()>p.value)c=this._getOrReturnCtx(n,c),j(c,{code:U.too_big,message:p.message,inclusive:!0,exact:!1,maximum:p.value,type:"date"}),o.dirty()}else Tn.assertNever(p);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Nc({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:k.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:k.toString(i)})}get minDate(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n!=null?new Date(n):null}get maxDate(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n!=null?new Date(n):null}}Nc.create=(n)=>{return new Nc({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:r.ZodDate,...cn(n)})};class Ix extends pn{_parse(n){if(this._getType(n)!==N.symbol){let o=this._getOrReturnCtx(n);return j(o,{code:U.invalid_type,expected:N.symbol,received:o.parsedType}),g}return Ui(n.data)}}Ix.create=(n)=>{return new Ix({typeName:r.ZodSymbol,...cn(n)})};class Lp extends pn{_parse(n){if(this._getType(n)!==N.undefined){let o=this._getOrReturnCtx(n);return j(o,{code:U.invalid_type,expected:N.undefined,received:o.parsedType}),g}return Ui(n.data)}}Lp.create=(n)=>{return new Lp({typeName:r.ZodUndefined,...cn(n)})};class up extends pn{_parse(n){if(this._getType(n)!==N.null){let o=this._getOrReturnCtx(n);return j(o,{code:U.invalid_type,expected:N.null,received:o.parsedType}),g}return Ui(n.data)}}up.create=(n)=>{return new up({typeName:r.ZodNull,...cn(n)})};class hc extends pn{constructor(){super(...arguments);this._any=!0}_parse(n){return Ui(n.data)}}hc.create=(n)=>{return new hc({typeName:r.ZodAny,...cn(n)})};class mc extends pn{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Ui(n.data)}}mc.create=(n)=>{return new mc({typeName:r.ZodUnknown,...cn(n)})};class zo extends pn{_parse(n){let i=this._getOrReturnCtx(n);return j(i,{code:U.invalid_type,expected:N.never,received:i.parsedType}),g}}zo.create=(n)=>{return new zo({typeName:r.ZodNever,...cn(n)})};class yx extends pn{_parse(n){if(this._getType(n)!==N.undefined){let o=this._getOrReturnCtx(n);return j(o,{code:U.invalid_type,expected:N.void,received:o.parsedType}),g}return Ui(n.data)}}yx.create=(n)=>{return new yx({typeName:r.ZodVoid,...cn(n)})};class Ao extends pn{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==N.array)return j(i,{code:U.invalid_type,expected:N.array,received:i.parsedType}),g;if(c.exactLength!==null){let x=i.data.length>c.exactLength.value,m=i.data.length<c.exactLength.value;if(x||m)j(i,{code:x?U.too_big:U.too_small,minimum:m?c.exactLength.value:void 0,maximum:x?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),o.dirty()}if(c.minLength!==null){if(i.data.length<c.minLength.value)j(i,{code:U.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),o.dirty()}if(c.maxLength!==null){if(i.data.length>c.maxLength.value)j(i,{code:U.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),o.dirty()}if(i.common.async)return Promise.all([...i.data].map((x,m)=>{return c.type._parseAsync(new Fo(i,x,i.path,m))})).then((x)=>{return Hi.mergeArray(o,x)});let p=[...i.data].map((x,m)=>{return c.type._parseSync(new Fo(i,x,i.path,m))});return Hi.mergeArray(o,p)}get element(){return this._def.type}min(n,i){return new Ao({...this._def,minLength:{value:n,message:k.toString(i)}})}max(n,i){return new Ao({...this._def,maxLength:{value:n,message:k.toString(i)}})}length(n,i){return new Ao({...this._def,exactLength:{value:n,message:k.toString(i)}})}nonempty(n){return this.min(1,n)}}Ao.create=(n,i)=>{return new Ao({type:n,minLength:null,maxLength:null,exactLength:null,typeName:r.ZodArray,...cn(i)})};function _p(n){if(n instanceof Cn){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=To.create(_p(c))}return new Cn({...n._def,shape:()=>i})}else if(n instanceof Ao)return new Ao({...n._def,type:_p(n.element)});else if(n instanceof To)return To.create(_p(n.unwrap()));else if(n instanceof No)return No.create(_p(n.unwrap()));else if(n instanceof Qo)return Qo.create(n.items.map((i)=>_p(i)));else return n}class Cn extends pn{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let n=this._def.shape(),i=Tn.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==N.object){let f=this._getOrReturnCtx(n);return j(f,{code:U.invalid_type,expected:N.object,received:f.parsedType}),g}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:x}=this._getCached(),m=[];if(!(this._def.catchall instanceof zo&&this._def.unknownKeys==="strip")){for(let f in c.data)if(!x.includes(f))m.push(f)}let a=[];for(let f of x){let v=p[f],$=c.data[f];a.push({key:{status:"valid",value:f},value:v._parse(new Fo(c,$,c.path,f)),alwaysSet:f in c.data})}if(this._def.catchall instanceof zo){let f=this._def.unknownKeys;if(f==="passthrough")for(let v of m)a.push({key:{status:"valid",value:v},value:{status:"valid",value:c.data[v]}});else if(f==="strict"){if(m.length>0)j(c,{code:U.unrecognized_keys,keys:m}),o.dirty()}else if(f==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let v of m){let $=c.data[v];a.push({key:{status:"valid",value:v},value:f._parse(new Fo(c,$,c.path,v)),alwaysSet:v in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let f=[];for(let v of a){let $=await v.key,w=await v.value;f.push({key:$,value:w,alwaysSet:v.alwaysSet})}return f}).then((f)=>{return Hi.mergeObjectSync(o,f)});else return Hi.mergeObjectSync(o,a)}get shape(){return this._def.shape()}strict(n){return k.errToObj,new Cn({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,x,m;let a=(x=(p=(c=this._def).errorMap)===null||p===void 0?void 0:p.call(c,i,o).message)!==null&&x!==void 0?x:o.defaultError;if(i.code==="unrecognized_keys")return{message:(m=k.errToObj(n).message)!==null&&m!==void 0?m:a};return{message:a}}}:{}})}strip(){return new Cn({...this._def,unknownKeys:"strip"})}passthrough(){return new Cn({...this._def,unknownKeys:"passthrough"})}extend(n){return new Cn({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Cn({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:r.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new Cn({...this._def,catchall:n})}pick(n){let i={};return Tn.objectKeys(n).forEach((o)=>{if(n[o]&&this.shape[o])i[o]=this.shape[o]}),new Cn({...this._def,shape:()=>i})}omit(n){let i={};return Tn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new Cn({...this._def,shape:()=>i})}deepPartial(){return _p(this)}partial(n){let i={};return Tn.objectKeys(this.shape).forEach((o)=>{let c=this.shape[o];if(n&&!n[o])i[o]=c;else i[o]=c.optional()}),new Cn({...this._def,shape:()=>i})}required(n){let i={};return Tn.objectKeys(this.shape).forEach((o)=>{if(n&&!n[o])i[o]=this.shape[o];else{let p=this.shape[o];while(p instanceof To)p=p._def.innerType;i[o]=p}}),new Cn({...this._def,shape:()=>i})}keyof(){return cR(Tn.objectKeys(this.shape))}}Cn.create=(n,i)=>{return new Cn({shape:()=>n,unknownKeys:"strip",catchall:zo.create(),typeName:r.ZodObject,...cn(i)})};Cn.strictCreate=(n,i)=>{return new Cn({shape:()=>n,unknownKeys:"strict",catchall:zo.create(),typeName:r.ZodObject,...cn(i)})};Cn.lazycreate=(n,i)=>{return new Cn({shape:n,unknownKeys:"strip",catchall:zo.create(),typeName:r.ZodObject,...cn(i)})};class Np extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=this._def.options;function c(p){for(let m of p)if(m.result.status==="valid")return m.result;for(let m of p)if(m.result.status==="dirty")return i.common.issues.push(...m.ctx.common.issues),m.result;let x=p.map((m)=>new Ii(m.ctx.common.issues));return j(i,{code:U.invalid_union,unionErrors:x}),g}if(i.common.async)return Promise.all(o.map(async(p)=>{let x={...i,common:{...i.common,issues:[]},parent:null};return{result:await p._parseAsync({data:i.data,path:i.path,parent:x}),ctx:x}})).then(c);else{let p=void 0,x=[];for(let a of o){let f={...i,common:{...i.common,issues:[]},parent:null},v=a._parseSync({data:i.data,path:i.path,parent:f});if(v.status==="valid")return v;else if(v.status==="dirty"&&!p)p={result:v,ctx:f};if(f.common.issues.length)x.push(f.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let m=x.map((a)=>new Ii(a));return j(i,{code:U.invalid_union,unionErrors:m}),g}}get options(){return this._def.options}}Np.create=(n,i)=>{return new Np({options:n,typeName:r.ZodUnion,...cn(i)})};var Lo=(n)=>{if(n instanceof Cp)return Lo(n.schema);else if(n instanceof no)return Lo(n.innerType());else if(n instanceof Ip)return[n.value];else if(n instanceof vc)return n.options;else if(n instanceof yp)return Tn.objectValues(n.enum);else if(n instanceof kp)return Lo(n._def.innerType);else if(n instanceof Lp)return[void 0];else if(n instanceof up)return[null];else if(n instanceof To)return[void 0,...Lo(n.unwrap())];else if(n instanceof No)return[null,...Lo(n.unwrap())];else if(n instanceof La)return Lo(n.unwrap());else if(n instanceof sp)return Lo(n.unwrap());else if(n instanceof Zp)return Lo(n._def.innerType);else return[]};class Da extends pn{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.object)return j(i,{code:U.invalid_type,expected:N.object,received:i.parsedType}),g;let o=this.discriminator,c=i.data[o],p=this.optionsMap.get(c);if(!p)return j(i,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),g;if(i.common.async)return p._parseAsync({data:i.data,path:i.path,parent:i});else return p._parseSync({data:i.data,path:i.path,parent:i})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,o){let c=new Map;for(let p of i){let x=Lo(p.shape[n]);if(!x.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(let m of x){if(c.has(m))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(m)}`);c.set(m,p)}}return new Da({typeName:r.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...cn(o)})}}function z$(n,i){let o=uo(n),c=uo(i);if(n===i)return{valid:!0,data:n};else if(o===N.object&&c===N.object){let p=Tn.objectKeys(i),x=Tn.objectKeys(n).filter((a)=>p.indexOf(a)!==-1),m={...n,...i};for(let a of x){let f=z$(n[a],i[a]);if(!f.valid)return{valid:!1};m[a]=f.data}return{valid:!0,data:m}}else if(o===N.array&&c===N.array){if(n.length!==i.length)return{valid:!1};let p=[];for(let x=0;x<n.length;x++){let m=n[x],a=i[x],f=z$(m,a);if(!f.valid)return{valid:!1};p.push(f.data)}return{valid:!0,data:p}}else if(o===N.date&&c===N.date&&+n===+i)return{valid:!0,data:n};else return{valid:!1}}class hp extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=(p,x)=>{if(M$(p)||M$(x))return g;let m=z$(p.value,x.value);if(!m.valid)return j(o,{code:U.invalid_intersection_types}),g;if(H$(p)||H$(x))i.dirty();return{status:i.value,value:m.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([p,x])=>c(p,x));else return c(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}hp.create=(n,i,o)=>{return new hp({left:n,right:i,typeName:r.ZodIntersection,...cn(o)})};class Qo extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.array)return j(o,{code:U.invalid_type,expected:N.array,received:o.parsedType}),g;if(o.data.length<this._def.items.length)return j(o,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;if(!this._def.rest&&o.data.length>this._def.items.length)j(o,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty();let p=[...o.data].map((x,m)=>{let a=this._def.items[m]||this._def.rest;if(!a)return null;return a._parse(new Fo(o,x,o.path,m))}).filter((x)=>!!x);if(o.common.async)return Promise.all(p).then((x)=>{return Hi.mergeArray(i,x)});else return Hi.mergeArray(i,p)}get items(){return this._def.items}rest(n){return new Qo({...this._def,rest:n})}}Qo.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qo({items:n,typeName:r.ZodTuple,rest:null,...cn(i)})};class kx extends pn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.object)return j(o,{code:U.invalid_type,expected:N.object,received:o.parsedType}),g;let c=[],p=this._def.keyType,x=this._def.valueType;for(let m in o.data)c.push({key:p._parse(new Fo(o,m,o.path,m)),value:x._parse(new Fo(o,o.data[m],o.path,m)),alwaysSet:m in o.data});if(o.common.async)return Hi.mergeObjectAsync(i,c);else return Hi.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,o){if(i instanceof pn)return new kx({keyType:n,valueType:i,typeName:r.ZodRecord,...cn(o)});return new kx({keyType:Jo.create(),valueType:n,typeName:r.ZodRecord,...cn(i)})}}class Zx extends pn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.map)return j(o,{code:U.invalid_type,expected:N.map,received:o.parsedType}),g;let c=this._def.keyType,p=this._def.valueType,x=[...o.data.entries()].map(([m,a],f)=>{return{key:c._parse(new Fo(o,m,o.path,[f,"key"])),value:p._parse(new Fo(o,a,o.path,[f,"value"]))}});if(o.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let a of x){let f=await a.key,v=await a.value;if(f.status==="aborted"||v.status==="aborted")return g;if(f.status==="dirty"||v.status==="dirty")i.dirty();m.set(f.value,v.value)}return{status:i.value,value:m}})}else{let m=new Map;for(let a of x){let{key:f,value:v}=a;if(f.status==="aborted"||v.status==="aborted")return g;if(f.status==="dirty"||v.status==="dirty")i.dirty();m.set(f.value,v.value)}return{status:i.value,value:m}}}}Zx.create=(n,i,o)=>{return new Zx({valueType:i,keyType:n,typeName:r.ZodMap,...cn(o)})};class Cc extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.set)return j(o,{code:U.invalid_type,expected:N.set,received:o.parsedType}),g;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)j(o,{code:U.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()}if(c.maxSize!==null){if(o.data.size>c.maxSize.value)j(o,{code:U.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty()}let p=this._def.valueType;function x(a){let f=new Set;for(let v of a){if(v.status==="aborted")return g;if(v.status==="dirty")i.dirty();f.add(v.value)}return{status:i.value,value:f}}let m=[...o.data.values()].map((a,f)=>p._parse(new Fo(o,a,o.path,f)));if(o.common.async)return Promise.all(m).then((a)=>x(a));else return x(m)}min(n,i){return new Cc({...this._def,minSize:{value:n,message:k.toString(i)}})}max(n,i){return new Cc({...this._def,maxSize:{value:n,message:k.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}Cc.create=(n,i)=>{return new Cc({valueType:n,minSize:null,maxSize:null,typeName:r.ZodSet,...cn(i)})};class bp extends pn{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.function)return j(i,{code:U.invalid_type,expected:N.function,received:i.parsedType}),g;function o(m,a){return ba({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Ba(),jp].filter((f)=>!!f),issueData:{code:U.invalid_arguments,argumentsError:a}})}function c(m,a){return ba({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Ba(),jp].filter((f)=>!!f),issueData:{code:U.invalid_return_type,returnTypeError:a}})}let p={errorMap:i.common.contextualErrorMap},x=i.data;if(this._def.returns instanceof Ic){let m=this;return Ui(async function(...a){let f=new Ii([]),v=await m._def.args.parseAsync(a,p).catch((J)=>{throw f.addIssue(o(a,J)),f}),$=await Reflect.apply(x,this,v);return await m._def.returns._def.type.parseAsync($,p).catch((J)=>{throw f.addIssue(c($,J)),f})})}else{let m=this;return Ui(function(...a){let f=m._def.args.safeParse(a,p);if(!f.success)throw new Ii([o(a,f.error)]);let v=Reflect.apply(x,this,f.data),$=m._def.returns.safeParse(v,p);if(!$.success)throw new Ii([c(v,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new bp({...this._def,args:Qo.create(n).rest(mc.create())})}returns(n){return new bp({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,o){return new bp({args:n?n:Qo.create([]).rest(mc.create()),returns:i||mc.create(),typeName:r.ZodFunction,...cn(o)})}}class Cp extends pn{get schema(){return this._def.getter()}_parse(n){let{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Cp.create=(n,i)=>{return new Cp({getter:n,typeName:r.ZodLazy,...cn(i)})};class Ip extends pn{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return j(i,{received:i.data,code:U.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:n.data}}get value(){return this._def.value}}Ip.create=(n,i)=>{return new Ip({value:n,typeName:r.ZodLiteral,...cn(i)})};function cR(n,i){return new vc({values:n,typeName:r.ZodEnum,...cn(i)})}class vc extends pn{constructor(){super(...arguments);Nx.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return j(i,{expected:Tn.joinValues(o),received:i.parsedType,code:U.invalid_type}),g}if(!ja(this,Nx,"f"))e6(this,Nx,new Set(this._def.values),"f");if(!ja(this,Nx,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return j(i,{received:i.data,code:U.invalid_enum_value,options:o}),g}return Ui(n.data)}get options(){return this._def.values}get enum(){let n={};for(let i of this._def.values)n[i]=i;return n}get Values(){let n={};for(let i of this._def.values)n[i]=i;return n}get Enum(){let n={};for(let i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return vc.create(n,{...this._def,...i})}exclude(n,i=this._def){return vc.create(this.options.filter((o)=>!n.includes(o)),{...this._def,...i})}}Nx=new WeakMap;vc.create=cR;class yp extends pn{constructor(){super(...arguments);hx.set(this,void 0)}_parse(n){let i=Tn.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==N.string&&o.parsedType!==N.number){let c=Tn.objectValues(i);return j(o,{expected:Tn.joinValues(c),received:o.parsedType,code:U.invalid_type}),g}if(!ja(this,hx,"f"))e6(this,hx,new Set(Tn.getValidEnumValues(this._def.values)),"f");if(!ja(this,hx,"f").has(n.data)){let c=Tn.objectValues(i);return j(o,{received:o.data,code:U.invalid_enum_value,options:c}),g}return Ui(n.data)}get enum(){return this._def.values}}hx=new WeakMap;yp.create=(n,i)=>{return new yp({values:n,typeName:r.ZodNativeEnum,...cn(i)})};class Ic extends pn{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.promise&&i.common.async===!1)return j(i,{code:U.invalid_type,expected:N.promise,received:i.parsedType}),g;let o=i.parsedType===N.promise?i.data:Promise.resolve(i.data);return Ui(o.then((c)=>{return this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})}))}}Ic.create=(n,i)=>{return new Ic({type:n,typeName:r.ZodPromise,...cn(i)})};class no extends pn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===r.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=this._def.effect||null,p={addIssue:(x)=>{if(j(o,x),x.fatal)i.abort();else i.dirty()},get path(){return o.path}};if(p.addIssue=p.addIssue.bind(p),c.type==="preprocess"){let x=c.transform(o.data,p);if(o.common.async)return Promise.resolve(x).then(async(m)=>{if(i.value==="aborted")return g;let a=await this._def.schema._parseAsync({data:m,path:o.path,parent:o});if(a.status==="aborted")return g;if(a.status==="dirty")return Bp(a.value);if(i.value==="dirty")return Bp(a.value);return a});else{if(i.value==="aborted")return g;let m=this._def.schema._parseSync({data:x,path:o.path,parent:o});if(m.status==="aborted")return g;if(m.status==="dirty")return Bp(m.value);if(i.value==="dirty")return Bp(m.value);return m}}if(c.type==="refinement"){let x=(m)=>{let a=c.refinement(m,p);if(o.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(o.common.async===!1){let m=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(m.status==="aborted")return g;if(m.status==="dirty")i.dirty();return x(m.value),{status:i.value,value:m.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((m)=>{if(m.status==="aborted")return g;if(m.status==="dirty")i.dirty();return x(m.value).then(()=>{return{status:i.value,value:m.value}})})}if(c.type==="transform")if(o.common.async===!1){let x=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!uc(x))return x;let m=c.transform(x.value,p);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:m}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((x)=>{if(!uc(x))return x;return Promise.resolve(c.transform(x.value,p)).then((m)=>({status:i.value,value:m}))});Tn.assertNever(c)}}no.create=(n,i,o)=>{return new no({schema:n,typeName:r.ZodEffects,effect:i,...cn(o)})};no.createWithPreprocess=(n,i,o)=>{return new no({schema:i,effect:{type:"preprocess",transform:n},typeName:r.ZodEffects,...cn(o)})};class To extends pn{_parse(n){if(this._getType(n)===N.undefined)return Ui(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}To.create=(n,i)=>{return new To({innerType:n,typeName:r.ZodOptional,...cn(i)})};class No extends pn{_parse(n){if(this._getType(n)===N.null)return Ui(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}No.create=(n,i)=>{return new No({innerType:n,typeName:r.ZodNullable,...cn(i)})};class kp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;if(i.parsedType===N.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}kp.create=(n,i)=>{return new kp({innerType:n,typeName:r.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...cn(i)})};class Zp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(Cx(c))return c.then((p)=>{return{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new Ii(o.common.issues)},input:o.data})}});else return{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Ii(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Zp.create=(n,i)=>{return new Zp({innerType:n,typeName:r.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...cn(i)})};class sx extends pn{_parse(n){if(this._getType(n)!==N.nan){let o=this._getOrReturnCtx(n);return j(o,{code:U.invalid_type,expected:N.nan,received:o.parsedType}),g}return{status:"valid",value:n.data}}}sx.create=(n)=>{return new sx({typeName:r.ZodNaN,...cn(n)})};var e9=Symbol("zod_brand");class La extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;return this._def.type._parse({data:o,path:i.path,parent:i})}unwrap(){return this._def.type}}class qx extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.common.async)return(async()=>{let p=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(p.status==="aborted")return g;if(p.status==="dirty")return i.dirty(),Bp(p.value);else return this._def.out._parseAsync({data:p.value,path:o.path,parent:o})})();else{let c=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(c.status==="aborted")return g;if(c.status==="dirty")return i.dirty(),{status:"dirty",value:c.value};else return this._def.out._parseSync({data:c.value,path:o.path,parent:o})}}static create(n,i){return new qx({in:n,out:i,typeName:r.ZodPipeline})}}class sp extends pn{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(uc(c))c.value=Object.freeze(c.value);return c};return Cx(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}sp.create=(n,i)=>{return new sp({innerType:n,typeName:r.ZodReadonly,...cn(i)})};function r6(n,i){let o=typeof n==="function"?n(i):typeof n==="string"?{message:n}:n;return typeof o==="string"?{message:o}:o}function pR(n,i={},o){if(n)return hc.create().superRefine((c,p)=>{var x,m;let a=n(c);if(a instanceof Promise)return a.then((f)=>{var v,$;if(!f){let w=r6(i,c),J=($=(v=w.fatal)!==null&&v!==void 0?v:o)!==null&&$!==void 0?$:!0;p.addIssue({code:"custom",...w,fatal:J})}});if(!a){let f=r6(i,c),v=(m=(x=f.fatal)!==null&&x!==void 0?x:o)!==null&&m!==void 0?m:!0;p.addIssue({code:"custom",...f,fatal:v})}return});return hc.create()}var nG={object:Cn.lazycreate},r;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(r||(r={}));var iG=(n,i={message:`Input not instance of ${n.name}`})=>pR((o)=>o instanceof n,i),xR=Jo.create,mR=ac.create,oG=sx.create,cG=fc.create,aR=Dp.create,pG=Nc.create,xG=Ix.create,mG=Lp.create,aG=up.create,fG=hc.create,vG=mc.create,$G=zo.create,wG=yx.create,JG=Ao.create,AG=Cn.create,TG=Cn.strictCreate,FG=Np.create,RG=Da.create,lG=hp.create,SG=Qo.create,XG=kx.create,KG=Zx.create,WG=Cc.create,GG=bp.create,YG=Cp.create,MG=Ip.create,HG=vc.create,zG=yp.create,QG=Ic.create,g6=no.create,EG=To.create,OG=No.create,UG=no.createWithPreprocess,VG=qx.create,_G=()=>xR().optional(),BG=()=>mR().optional(),bG=()=>aR().optional(),jG={string:(n)=>Jo.create({...n,coerce:!0}),number:(n)=>ac.create({...n,coerce:!0}),boolean:(n)=>Dp.create({...n,coerce:!0}),bigint:(n)=>fc.create({...n,coerce:!0}),date:(n)=>Nc.create({...n,coerce:!0})},DG=g,Xn=Object.freeze({__proto__:null,defaultErrorMap:jp,setErrorMap:U9,getErrorMap:Ba,makeIssue:ba,EMPTY_PATH:V9,addIssueToContext:j,ParseStatus:Hi,INVALID:g,DIRTY:Bp,OK:Ui,isAborted:M$,isDirty:H$,isValid:uc,isAsync:Cx,get util(){return Tn},get objectUtil(){return Y$},ZodParsedType:N,getParsedType:uo,ZodType:pn,datetimeRegex:oR,ZodString:Jo,ZodNumber:ac,ZodBigInt:fc,ZodBoolean:Dp,ZodDate:Nc,ZodSymbol:Ix,ZodUndefined:Lp,ZodNull:up,ZodAny:hc,ZodUnknown:mc,ZodNever:zo,ZodVoid:yx,ZodArray:Ao,ZodObject:Cn,ZodUnion:Np,ZodDiscriminatedUnion:Da,ZodIntersection:hp,ZodTuple:Qo,ZodRecord:kx,ZodMap:Zx,ZodSet:Cc,ZodFunction:bp,ZodLazy:Cp,ZodLiteral:Ip,ZodEnum:vc,ZodNativeEnum:yp,ZodPromise:Ic,ZodEffects:no,ZodTransformer:no,ZodOptional:To,ZodNullable:No,ZodDefault:kp,ZodCatch:Zp,ZodNaN:sx,BRAND:e9,ZodBranded:La,ZodPipeline:qx,ZodReadonly:sp,custom:pR,Schema:pn,ZodSchema:pn,late:nG,get ZodFirstPartyTypeKind(){return r},coerce:jG,any:fG,array:JG,bigint:cG,boolean:aR,date:pG,discriminatedUnion:RG,effect:g6,enum:HG,function:GG,instanceof:iG,intersection:lG,lazy:YG,literal:MG,map:KG,nan:oG,nativeEnum:zG,never:$G,null:aG,nullable:OG,number:mR,object:AG,oboolean:bG,onumber:BG,optional:EG,ostring:_G,pipeline:VG,preprocess:UG,promise:QG,record:XG,set:WG,strictObject:TG,string:xR,symbol:xG,transformer:g6,tuple:SG,undefined:mG,union:FG,unknown:vG,void:wG,NEVER:DG,ZodIssueCode:U,quotelessJson:O9,ZodError:Ii});var LG="__vite_start_time"in globalThis,uG=typeof window!=="undefined",ru="vitest"in globalThis,qn=P6({isServer:!LG&&!uG,server:{CI:Xn.string().transform((n)=>!0).optional(),POSTGRES_USER:Xn.string(),POSTGRES_PASSWORD:Xn.string(),POSTGRES_DATABASE:Xn.string(),POSTGRES_HOST:Xn.string(),POSTGRES_PORT:Xn.string().transform((n)=>Number.parseInt(n,10)),BACKEND_PORT:Xn.string().transform((n)=>Number.parseInt(n,10)),RUN_WORKERS_FROM_SOURCE:Xn.union([Xn.literal("true"),Xn.literal("false")]).optional().transform((n)=>n==="true"),FRONTEND_PORT:Xn.string().transform((n)=>Number.parseInt(n,10)),FRONTEND_ORIGINS:Xn.string().transform((n)=>JSON.parse(n)).pipe(Xn.array(Xn.string())),OPENAI_API_KEY:Xn.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Xn.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Xn.union([Xn.literal("true"),Xn.literal("false")]).optional().transform((n)=>n==="true")},runtimeEnv:import.meta.env,emptyStringAsUndefined:!0});var vR=Q$(import.meta.dirname,"../dev"),E$=qn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:fR(Q$(vR,"./cert.pem"),"utf-8"),key:fR(Q$(vR,"./key.pem"),"utf-8")}:void 0;var $c=new Ef,mn=qn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:$c.logger;d.STORE.loggers[0]=new Sc("warn",void 0,mn);if(mn!==console)Object.assign(console,mn,{log:mn.info});import{spawn as NG}from"child_process";import{resolve as hG}from"path";function O$(n,i,o=n.logger){let c=qn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",m=[hG(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")m.push("--experimental-strip-types");let a=NG(p,m);return new Jx(a,i,o)}var $R=$f(vv(),1);var CG=604800000,ua=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new $R.CronJob("00 00 03 * * *",()=>{for(let[o,c]of n.entries()){let p=Date.now();for(let[x,m]of c.entries())if(p-m>CG)c.delete(x);if(c.size===0)n.delete(o)}});i.start(),process.on("exit",()=>{i.stop(),mn.info("\uD83D\uDEEC autoExpiry stopped")})}return n})();import BY from"path";import wY from"os";import JY from"fs";var Na=new Map,U$=new Map,V$=Symbol("OriginError"),qp={};class io extends Promise{constructor(n,i,o,c,p={}){let x,m;super((a,f)=>{x=a,m=f});this.tagged=Array.isArray(n.raw),this.strings=n,this.args=i,this.handler=o,this.canceller=c,this.options=p,this.state=null,this.statement=null,this.resolve=(a)=>(this.active=!1,x(a)),this.reject=(a)=>(this.active=!1,m(a)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[V$]=this.handler.debug?new Error:this.tagged&&IG(this.strings)}get origin(){return(this.handler.debug?this[V$].stack:this.tagged&&U$.has(this.strings)?U$.get(this.strings):U$.set(this.strings,this[V$].stack).get(this.strings))||""}static get[Symbol.species](){return Promise}cancel(){return this.canceller&&(this.canceller(this),this.canceller=null)}simple(){return this.options.simple=!0,this.options.prepare=!1,this}async readable(){return this.simple(),this.streaming=!0,this}async writable(){return this.simple(),this.streaming=!0,this}cursor(n=1,i){if(this.options.simple=!1,typeof n==="function")i=n,n=1;if(this.cursorRows=n,typeof i==="function")return this.cursorFn=i,this;let o;return{[Symbol.asyncIterator]:()=>({next:()=>{if(this.executed&&!this.active)return{done:!0};o&&o();let c=new Promise((p,x)=>{this.cursorFn=(m)=>{return p({value:m,done:!1}),new Promise((a)=>o=a)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(m)=>(this.active=!1,x(m))});return this.execute(),c},return(){return o&&o(qp),{done:!0}}})}}describe(){return this.options.simple=!1,this.onlyDescribe=this.options.prepare=!0,this}stream(){throw new Error(".stream has been renamed to .forEach")}forEach(n){return this.forEachFn=n,this.handle(),this}raw(){return this.isRaw=!0,this}values(){return this.isRaw="values",this}async handle(){!this.executed&&(this.executed=!0)&&await 1&&this.handler(this)}execute(){return this.handle(),this}then(){return this.handle(),super.then.apply(this,arguments)}catch(){return this.handle(),super.catch.apply(this,arguments)}finally(){return this.handle(),super.finally.apply(this,arguments)}}function IG(n){if(Na.has(n))return Na.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,Na.set(n,new Error),Error.stackTraceLimit=i,Na.get(n)}class Pp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var rn={connection:wR,postgres:JR,generic:AR,notSupported:TR};function wR(n,i,o){let{host:c,port:p}=o||i,x=Object.assign(new Error("write "+n+" "+(i.path||c+":"+p)),{code:n,errno:n,address:i.path||c},i.path?{}:{port:p});return Error.captureStackTrace(x,wR),x}function JR(n){let i=new Pp(n);return Error.captureStackTrace(i,JR),i}function AR(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,AR),o}function TR(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,TR),i}var yG={string:{to:25,from:null,serialize:(n)=>""+n},number:{to:0,from:[21,23,26,700,701],serialize:(n)=>""+n,parse:(n)=>+n},json:{to:114,from:[114,3802],serialize:(n)=>JSON.stringify(n),parse:(n)=>JSON.parse(n)},boolean:{to:16,from:16,serialize:(n)=>n===!0?"t":"f",parse:(n)=>n==="t"},date:{to:1184,from:[1082,1114,1184],serialize:(n)=>(n instanceof Date?n:new Date(n)).toISOString(),parse:(n)=>new Date(n)},bytea:{to:17,from:17,serialize:(n)=>"\\x"+Buffer.from(n).toString("hex"),parse:(n)=>Buffer.from(n.slice(2),"hex")}};class Ia{then(){_$()}catch(){_$()}finally(){_$()}}class gx extends Ia{constructor(n){super();this.value=Za(n)}}class Eo extends Ia{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class ya extends Ia{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=kG.map(([x,m])=>({fn:m,i:n.search(x)})).sort((x,m)=>x.i-m.i).pop();return p.i===-1?L$(this.first,c):p.fn(this.first,this.rest,i,o,c)}}function ka(n,i,o,c){let p=n instanceof Eo?n.value:n;if(p===void 0){if(n instanceof Eo?n.value=c.transform.undefined:p=n=c.transform.undefined,p===void 0)throw rn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+o.push(n instanceof Eo?(i.push(n.value),n.array?n.array[n.type||Ca(n.value)]||n.type||SR(n.value):n.type):(i.push(n),Ca(n)))}var RR=KR(yG);function j$(n,i,o,c,p,x){for(let m=1;m<n.strings.length;m++)i+=D$(i,o,c,p,x)+n.strings[m],o=n.args[m];return i}function D$(n,i,o,c,p){return i instanceof ya?i.build(n,o,c,p):i instanceof io?b$(i,o,c,p):i instanceof gx?i.value:i&&i[0]instanceof io?i.reduce((x,m)=>x+" "+b$(m,o,c,p),""):ka(i,o,c,p)}function b$(n,i,o,c){return n.fragment=!0,j$(n,n.strings[0],n.args[0],i,o,c)}function lR(n,i,o,c,p){return n.map((x)=>"("+c.map((m)=>D$("values",x[m],i,o,p)).join(",")+")").join(",")}function FR(n,i,o,c,p){let x=Array.isArray(n[0]),m=i.length?i.flat():Object.keys(x?n[0]:n);return lR(x?n:[n],o,c,m,p)}function ha(n,i,o,c,p){if(typeof n==="string"&&(n=[n].concat(i)),Array.isArray(n))return L$(n,p);let x;return(i.length?i.flat():Object.keys(n)).map((a)=>{return x=n[a],(x instanceof io?b$(x,o,c,p):x instanceof gx?x.value:ka(x,o,c,p))+" as "+Za(p.transform.column.to?p.transform.column.to(a):a)}).join(",")}var kG=Object.entries({values:FR,in:(...n)=>{let i=FR(...n);return i==="()"?"(null)":i},select:ha,as:ha,returning:ha,"\\(":ha,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((x)=>Za(p.transform.column.to?p.transform.column.to(x):x)+"="+D$("values",n[x],o,c,p))},insert(n,i,o,c,p){let x=i.length?i.flat():Object.keys(Array.isArray(n)?n[0]:n);return"("+L$(x,p)+")values"+lR(Array.isArray(n)?n:[n],o,c,x,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function _$(){throw rn.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:ZG,parsers:sG}=RR;function SR(n){if(Array.isArray(n))return SR(n[0]);return typeof n==="string"?1009:0}var XR=function(n){let i=KR(n||{});return{serializers:Object.assign({},ZG,i.serializers),parsers:Object.assign({},sG,i.parsers)}};function KR(n){return Object.keys(n).reduce((i,o)=>{if(n[o].from&&[].concat(n[o].from).forEach((c)=>i.parsers[c]=n[o].parse),n[o].serialize)i.serializers[n[o].to]=n[o].serialize,n[o].from&&[].concat(n[o].from).forEach((c)=>i.serializers[c]=n[o].serialize);return i},{parsers:{},serializers:{}})}function L$(n,{transform:{column:i}}){return n.map((o)=>Za(i.to?i.to(o):o)).join(",")}var Za=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},Ca=function n(i){return i instanceof Eo?i.type:i instanceof Date?1184:i instanceof Uint8Array?17:i===!0||i===!1?16:typeof i==="bigint"?20:Array.isArray(i)?n(i[0]):0},qG=/\\/g,PG=/"/g;function tG(n){return n.replace(qG,"\\\\").replace(PG,"\\\"")}var WR=function n(i,o,c,p){if(Array.isArray(i)===!1)return i;if(!i.length)return"{}";let x=i[0],m=p===1020?";":",";if(Array.isArray(x)&&!x.type)return"{"+i.map((a)=>n(a,o,c,p)).join(m)+"}";return"{"+i.map((a)=>{if(a===void 0){if(a=c.transform.undefined,a===void 0)throw rn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return a===null?"null":'"'+tG(o?o(a.type?a.value:a):""+a)+'"'}).join(m)+"}"},B$={i:0,char:null,str:"",quoted:!1,last:0},GR=function n(i,o,c){return B$.i=B$.last=0,YR(B$,i,o,c)};function YR(n,i,o,c){let p=[],x=c===1020?";":",";for(;n.i<i.length;n.i++){if(n.char=i[n.i],n.quoted)if(n.char==="\\")n.str+=i[++n.i];else if(n.char==='"')p.push(o?o(n.str):n.str),n.str="",n.quoted=i[n.i+1]==='"',n.last=n.i+2;else n.str+=n.char;else if(n.char==='"')n.quoted=!0;else if(n.char==="{")n.last=++n.i,p.push(YR(n,i,o,c));else if(n.char==="}"){n.quoted=!1,n.last<n.i&&p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;break}else if(n.char===x&&n.p!=="}"&&n.p!=='"')p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;n.p=n.char}return n.last<n.i&&p.push(o?o(i.slice(n.last,n.i+1)):i.slice(n.last,n.i+1)),p}var yc=(n)=>{let i=n[0];for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},kc=(n)=>{let i=n[0].toUpperCase();for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},Zc=(n)=>n.replace(/_/g,"-"),Px=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),tx=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),rx=(n)=>n.replace(/-/g,"_");function u$(n){return function i(o,c){return typeof o==="object"&&o!==null&&(c.type===114||c.type===3802)?Array.isArray(o)?o.map((p)=>i(p,c)):Object.entries(o).reduce((p,[x,m])=>Object.assign(p,{[n(x)]:i(m,c)}),{}):o}}yc.column={from:yc};yc.value={from:u$(yc)};Px.column={to:Px};var N$={...yc};N$.column.to=Px;kc.column={from:kc};kc.value={from:u$(kc)};tx.column={to:tx};var h$={...kc};h$.column.to=tx;Zc.column={from:Zc};Zc.value={from:u$(Zc)};rx.column={to:rx};var C$={...Zc};C$.column.to=rx;import MR from"net";import eG from"tls";import dx from"crypto";import I$ from"stream";import{performance as HR}from"perf_hooks";class sc extends Array{constructor(){super();Object.defineProperties(this,{count:{value:null,writable:!0},state:{value:null,writable:!0},command:{value:null,writable:!0},columns:{value:null,writable:!0},statement:{value:null,writable:!0}})}static get[Symbol.species](){return Array}}var yi=rG;function rG(n=[]){let i=n.slice(),o=0;return{get length(){return i.length-o},remove:(c)=>{let p=i.indexOf(c);return p===-1?null:(i.splice(p,1),c)},push:(c)=>(i.push(c),c),shift:()=>{let c=i[o++];if(o===i.length)o=0,i=[];else i[o-1]=void 0;return c}}}var zi=Buffer.allocUnsafe(256),gG="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return zi[0]=o,Qn.i=5,Qn},n},{}),Qn=Object.assign(dG,gG,{N:String.fromCharCode(0),i:0,inc(n){return Qn.i+=n,Qn},str(n){let i=Buffer.byteLength(n);return sa(i),Qn.i+=zi.write(n,Qn.i,i,"utf8"),Qn},i16(n){return sa(2),zi.writeUInt16BE(n,Qn.i),Qn.i+=2,Qn},i32(n,i){if(i||i===0)return zi.writeUInt32BE(n,i),Qn;return sa(4),zi.writeUInt32BE(n,Qn.i),Qn.i+=4,Qn},z(n){return sa(n),zi.fill(0,Qn.i,Qn.i+n),Qn.i+=n,Qn},raw(n){return zi=Buffer.concat([zi.subarray(0,Qn.i),n]),Qn.i=zi.length,Qn},end(n=1){zi.writeUInt32BE(Qn.i-n,n);let i=zi.subarray(0,Qn.i);return Qn.i=0,zi=Buffer.allocUnsafe(256),i}}),q=Qn;function sa(n){if(zi.length-Qn.i<n){let i=zi,o=i.length;zi=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(zi)}}function dG(){return Qn.i=0,Qn}var Z$=ER,nY=1,wc=q().S().end(),zR=q().H().end(),iY=q().i32(8).i32(80877103).end(8),oY=Buffer.concat([q().E().str(q.N).i32(0).end(),wc]),cY=q().D().str("S").str(q.N).end(),tp=()=>{},pY=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),xY={83:"severity_local",86:"severity",67:"code",77:"message",68:"detail",72:"hint",80:"position",112:"internal_position",113:"internal_query",87:"where",115:"schema_name",116:"table_name",99:"column_name",100:"data type_name",110:"constraint_name",70:"file",76:"line",82:"routine"};function ER(n,i={},{onopen:o=tp,onend:c=tp,onclose:p=tp}={}){let{ssl:x,max:m,user:a,host:f,port:v,database:$,parsers:w,transform:J,onnotice:l,onnotify:S,onparameter:R,max_pipeline:K,keep_alive:Y,backoff:M,target_session_attrs:I}=n,G=yi(),z=nY++,E={pid:null,secret:null},Q=k$(af,n.idle_timeout),B=k$(af,n.max_lifetime),y=k$(al,n.connect_timeout),H=null,an,Z=new sc,fn=Buffer.alloc(0),En=n.fetch_types,gn={},_i={},Oo=Math.random().toString(36).slice(2),O=1,s=0,Rn=0,Ln=0,dn=0,vn=0,_n=0,Pn=0,Nn=null,jn=null,Ti=!1,Bn=null,oo=null,Fi=null,ho=null,en=null,Dn=null,co=null,lo=null,_=null,nx=null,Ri={queue:i.closed,idleTimer:Q,connect(A){Fi=A||!0,S0()},terminate:ox,execute:ix,cancel:cl,end:af,count:0,id:z};return i.closed&&i.closed.push(Ri),Ri;async function ol(){let A;try{A=n.socket?await Promise.resolve(n.socket(n)):new MR.Socket}catch(X){rc(X);return}return A.on("error",rc),A.on("close",X0),A.on("drain",R0),A}async function cl({pid:A,secret:X},P,ln){try{an=q().i32(16).i32(80877102).i32(A).i32(X).end(16),await l0(),H.once("error",ln),H.once("close",P)}catch(In){ln(In)}}function ix(A){if(Ti)return xm(A,rn.connection("CONNECTION_DESTROYED",n));if(A.cancelled)return;try{return A.state=E,_?G.push(A):(_=A,_.active=!0),ml(A),vi(pl(A))&&!A.describeFirst&&!A.cursorFn&&G.length<K&&(!A.options.onexecute||A.options.onexecute(Ri))}catch(X){return G.length===0&&vi(wc),So(X),!0}}function pl(A){if(A.parameters.length>=65534)throw rn.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return A.options.simple?q().Q().str(A.statement.string+q.N).end():A.describeFirst?Buffer.concat([A0(A),zR]):A.prepare?A.prepared?pm(A):Buffer.concat([A0(A),pm(A)]):xl(A)}function A0(A){return Buffer.concat([W0(A.statement.string,A.parameters,A.statement.types,A.statement.name),Zl("S",A.statement.name)])}function pm(A){return Buffer.concat([kl(A.parameters,A.statement.types,A.statement.name,A.cursorName),A.cursorFn?G0("",A.cursorRows):oY])}function xl(A){return Buffer.concat([W0(A.statement.string,A.parameters,A.statement.types),cY,pm(A)])}function ml(A){let X=[],P=[],ln=j$(A,A.strings[0],A.args[0],X,P,n);!A.tagged&&A.args.forEach((In)=>ka(In,X,P,n)),A.prepare=n.prepare&&("prepare"in A.options?A.options.prepare:!0),A.string=ln,A.signature=A.prepare&&P+ln,A.onlyDescribe&&delete _i[A.signature],A.parameters=A.parameters||X,A.prepared=A.prepare&&A.signature in _i,A.describeFirst=A.onlyDescribe||X.length&&!A.prepared,A.statement=A.prepared?_i[A.signature]:{string:ln,types:P,name:A.prepare?Oo+O++:""},typeof n.debug==="function"&&n.debug(z,ln,X,P)}function vi(A,X){if(Dn=Dn?Buffer.concat([Dn,A]):Buffer.from(A),X||Dn.length>=1024)return T0(X);return jn===null&&(jn=setImmediate(T0)),!0}function T0(A){let X=H.write(Dn,A);return jn!==null&&clearImmediate(jn),Dn=jn=null,X}function al(){So(rn.connection("CONNECT_TIMEOUT",n,H)),H.destroy()}async function F0(){if(vi(iY),!await new Promise((X)=>H.once("data",(P)=>X(P[0]===83)))&&x==="prefer")return tc();H.removeAllListeners(),H=eG.connect({socket:H,servername:MR.isIP(H.host)?void 0:H.host,...x==="require"||x==="allow"||x==="prefer"?{rejectUnauthorized:!1}:x==="verify-full"?{}:typeof x==="object"?x:{}}),H.on("secureConnect",tc),H.on("error",rc),H.on("close",X0),H.on("drain",R0)}function R0(){!_&&o(Ri)}function mf(A){if(Bn){if(Bn.push(A),Rn-=A.length,Rn>=0)return}fn=Bn?Buffer.concat(Bn,vn-Rn):fn.length===0?A:Buffer.concat([fn,A],fn.length+A.length);while(fn.length>4){if(vn=fn.readUInt32BE(1),vn>=fn.length){Rn=vn-fn.length,Bn=[fn];break}try{fl(fn.subarray(0,vn+1))}catch(X){_&&(_.cursorFn||_.describeFirst)&&vi(wc),So(X)}fn=fn.subarray(vn+1),Rn=0,Bn=null}}async function l0(){if(Ti=!1,gn={},H||(H=await ol()),!H)return;if(y.start(),n.socket)return x?F0():tc();if(H.on("connect",x?F0:tc),n.path)return H.connect(n.path);H.ssl=x,H.connect(v[Ln],f[Ln]),H.host=f[Ln],H.port=v[Ln],Ln=(Ln+1)%v.length}function S0(){setTimeout(l0,s?s+_n-HR.now():0)}function tc(){try{_i={},En=n.fetch_types,Oo=Math.random().toString(36).slice(2),O=1,B.start(),H.on("data",mf),Y&&H.setKeepAlive&&H.setKeepAlive(!0,1000*Y);let A=ql();vi(A)}catch(A){rc(A)}}function rc(A){if(Ri.queue===i.connecting&&n.host[dn+1])return;So(A);while(G.length)xm(G.shift(),A)}function So(A){en&&(en.destroy(A),en=null),_&&xm(_,A),Fi&&(xm(Fi,A),Fi=null)}function xm(A,X){"query"in X||"parameters"in X||Object.defineProperties(X,{stack:{value:X.stack+A.origin.replace(/.*\n/,`
61
- `),enumerable:n.debug},query:{value:A.string,enumerable:n.debug},parameters:{value:A.parameters,enumerable:n.debug},args:{value:A.args,enumerable:n.debug},types:{value:A.statement&&A.statement.types,enumerable:n.debug}}),A.reject(X)}function af(){return ho||(!Ri.reserved&&c(Ri),!Ri.reserved&&!Fi&&!_&&G.length===0?(ox(),new Promise((A)=>H&&H.readyState!=="closed"?H.once("close",A):A())):ho=new Promise((A)=>co=A))}function ox(){if(Ti=!0,en||_||Fi||G.length)rc(rn.connection("CONNECTION_DESTROYED",n));if(clearImmediate(jn),H)H.removeListener("data",mf),H.removeListener("connect",tc),H.readyState==="open"&&H.end(q().X().end());co&&(co(),ho=co=null)}async function X0(A){if(fn=Buffer.alloc(0),Rn=0,Bn=null,clearImmediate(jn),H.removeListener("data",mf),H.removeListener("connect",tc),Q.cancel(),B.cancel(),y.cancel(),H.removeAllListeners(),H=null,Fi)return S0();!A&&(_||G.length)&&rc(rn.connection("CONNECTION_CLOSED",n,H)),s=HR.now(),A&&n.shared.retries++,_n=(typeof M==="function"?M(n.shared.retries):M)*1000,p(Ri,rn.connection("CONNECTION_CLOSED",n,H))}function fl(A,X=A[0]){(X===68?vl:X===100?Dl:X===65?Ul:X===83?$l:X===90?wl:X===67?Jl:X===50?K0:X===49?Al:X===116?Tl:X===84?Fl:X===82?Rl:X===110?Gl:X===75?Yl:X===69?El:X===115?Vl:X===51?_l:X===71?Bl:X===78?ul:X===72?bl:X===99?Ll:X===73?Nl:X===86?hl:X===118?Cl:X===87?jl:Il)(A)}function vl(A){let X=7,P,ln,In,li=_.isRaw?new Array(_.statement.columns.length):{};for(let Qi=0;Qi<_.statement.columns.length;Qi++)ln=_.statement.columns[Qi],P=A.readInt32BE(X),X+=4,In=P===-1?null:_.isRaw===!0?A.subarray(X,X+=P):ln.parser===void 0?A.toString("utf8",X,X+=P):ln.parser.array===!0?ln.parser(A.toString("utf8",X+1,X+=P)):ln.parser(A.toString("utf8",X,X+=P)),_.isRaw?li[Qi]=_.isRaw===!0?In:J.value.from?J.value.from(In,ln):In:li[ln.name]=J.value.from?J.value.from(In,ln):In;_.forEachFn?_.forEachFn(J.row.from?J.row.from(li):li,Z):Z[Pn++]=J.row.from?J.row.from(li):li}function $l(A){let[X,P]=A.toString("utf8",5,A.length-1).split(q.N);if(gn[X]=P,n.parameters[X]!==P)n.parameters[X]=P,R&&R(X,P)}function wl(A){if(_&&_.options.simple&&_.resolve(oo||Z),_=oo=null,Z=new sc,y.cancel(),Fi){if(I){if(!gn.in_hot_standby||!gn.default_transaction_read_only)return Ql();else if(zl(I,gn))return ox()}if(En)return Fi===!0&&(Fi=null),Ml();Fi!==!0&&ix(Fi),n.shared.retries=dn=0,Fi=null;return}while(G.length&&(_=G.shift())&&(_.active=!0,_.cancelled))ER(n).cancel(_.state,_.cancelled.resolve,_.cancelled.reject);if(_)return;Ri.reserved?!Ri.reserved.release&&A[5]===73?ho?ox():(Ri.reserved=null,o(Ri)):Ri.reserved():ho?ox():o(Ri)}function Jl(A){Pn=0;for(let X=A.length-1;X>0;X--){if(A[X]===32&&A[X+1]<58&&Z.count===null)Z.count=+A.toString("utf8",X+1,A.length-1);if(A[X-1]>=65){Z.command=A.toString("utf8",5,X),Z.state=E;break}}if(nx&&(nx(),nx=null),Z.command==="BEGIN"&&m!==1&&!Ri.reserved)return So(rn.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(_.options.simple)return K0();if(_.cursorFn)Z.count&&_.cursorFn(Z),vi(wc);_.resolve(Z)}function Al(){_.parsing=!1}function K0(){!Z.statement&&(Z.statement=_.statement),Z.columns=_.statement.columns}function Tl(A){let X=A.readUInt16BE(5);for(let P=0;P<X;++P)!_.statement.types[P]&&(_.statement.types[P]=A.readUInt32BE(7+P*4));_.prepare&&(_i[_.signature]=_.statement),_.describeFirst&&!_.onlyDescribe&&(vi(pm(_)),_.describeFirst=!1)}function Fl(A){if(Z.command)oo=oo||[Z],oo.push(Z=new sc),Z.count=null,_.statement.columns=null;let X=A.readUInt16BE(5),P=7,ln;_.statement.columns=Array(X);for(let In=0;In<X;++In){ln=P;while(A[P++]!==0);let li=A.readUInt32BE(P),Qi=A.readUInt16BE(P+4),Co=A.readUInt32BE(P+6);_.statement.columns[In]={name:J.column.from?J.column.from(A.toString("utf8",ln,P-1)):A.toString("utf8",ln,P-1),parser:w[Co],table:li,number:Qi,type:Co},P+=18}if(Z.statement=_.statement,_.onlyDescribe)return _.resolve(_.statement),vi(wc)}async function Rl(A,X=A.readUInt32BE(5)){(X===3?ll:X===5?Sl:X===10?Xl:X===11?Kl:X===12?Wl:X!==0?yl:tp)(A,X)}async function ll(){let A=await ff();vi(q().p().str(A).z(1).end())}async function Sl(A){let X="md5"+await QR(Buffer.concat([Buffer.from(await QR(await ff()+a)),A.subarray(9)]));vi(q().p().str(X).z(1).end())}async function Xl(){lo=(await dx.randomBytes(18)).toString("base64"),q().p().str("SCRAM-SHA-256"+q.N);let A=q.i;vi(q.inc(4).str("n,,n=*,r="+lo).i32(q.i-A-4,A).end())}async function Kl(A){let X=A.toString("utf8",9).split(",").reduce((Qi,Co)=>(Qi[Co[0]]=Co.slice(2),Qi),{}),P=await dx.pbkdf2Sync(await ff(),Buffer.from(X.s,"base64"),parseInt(X.i),32,"sha256"),ln=await qa(P,"Client Key"),In="n=*,r="+lo+",r="+X.r+",s="+X.s+",i="+X.i+",c=biws,r="+X.r;Nn=(await qa(await qa(P,"Server Key"),In)).toString("base64");let li="c=biws,r="+X.r+",p="+aY(ln,Buffer.from(await qa(await mY(ln),In))).toString("base64");vi(q().p().str(li).end())}function Wl(A){if(A.toString("utf8",9).split(q.N,1)[0].slice(2)===Nn)return;So(rn.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),H.destroy()}function ff(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function Gl(){if(Z.statement=_.statement,Z.statement.columns=[],_.onlyDescribe)return _.resolve(_.statement),vi(wc)}function Yl(A){E.pid=A.readUInt32BE(5),E.secret=A.readUInt32BE(9)}async function Ml(){En=!1,(await new io([`
59
+ ${J.trace}`:`No previous disposal trace for ${a} was found.`),o}let v=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:m.stringKey}).filter(([,{source:J}])=>J!==p).map(([J])=>xi(J));if(c)x.moleculeGraph.delete(p);x.moleculeGraph.set({upstreamMoleculeKey:f.stringKey,downstreamMoleculeKey:m.stringKey},{source:f.stringKey});let $={type:"molecule_transfer",key:m.key,from:v,to:[f.key]};if(Mn(x)&&x.transactionMeta.phase==="building")x.transactionMeta.update.updates.push($);return o}function Tf(n,i,o){switch(i){case"newValue":{k0(n,o);break}case"oldValue":{Sc(o,n.token);break}}}function Rf(n,i,o){switch(i){case"newValue":{Sc(o,n.token);break}case"oldValue":{if(k0(n,o),n.subType==="atom")o.valueMap.set(n.token.key,n.value);break}}}function k0(n,i){let{family:o}=n.token;if(o){let c=i.families.get(o.key);if(c)t(i,c,xi(o.subKey))}}function Z0(n,i,o){switch(i){case"newValue":Tc(o,n.provenance,n.key);break;case"oldValue":Rc(o,n.key);break}}function q0(n,i,o){switch(i){case"newValue":Rc(o,n.key);break;case"oldValue":{let c=n.provenance.map(xi);Tc(o,c,n.key);for(let[p,x]of n.values){let m=o.families.get(p);if(m){t(o,m,n.key);let a=`${p}(${wn(n.key)})`;o.valueMap.set(a,x)}}}break}}function s0(n,i,o){switch(i){case"newValue":{let c=n.to.length===1?n.to[0]:n.to;ec(o,c,n.key,"exclusive")}break;case"oldValue":{let c=n.from.length===1?n.from[0]:n.from;ec(o,c,n.key,"exclusive")}break}}function Jm(n,i,o){let c=n==="newValue"?i.updates:[...i.updates].reverse();for(let p of c)switch(p.type){case"atom_update":case"selector_update":wm(n,p,o);break;case"state_creation":Tf(p,n,o);break;case"state_disposal":Rf(p,n,o);break;case"molecule_creation":Z0(p,n,o);break;case"molecule_disposal":q0(p,n,o);break;case"molecule_transfer":s0(p,n,o);break;case"transaction_update":Jm(n,p,o);break}}function Sf(n,i){return n.transactionMeta.actionContinuities.getRelatedKey(i)}function m3(n,i){return n.transactionMeta.epoch.get(i)}function P0(n,i){if(!$i(n))return;let c=Sf(n,i);if(c===void 0)return;return m3(n,c)}function t0(n,i,o){if($i(n)&&i)n.transactionMeta.epoch.set(i,o)}function r0(n,i,o){if(!$i(n))return;let p=Sf(n,i);if(p!==void 0)n.transactionMeta.epoch.set(p,o)}var d0=(n,i)=>{let o=j(i),{parent:c}=o;if(c===null||!Mn(o)||o.transactionMeta?.phase!=="building"){i.logger.warn("\uD83D\uDC1E","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}o.transactionMeta.phase="applying",o.transactionMeta.update.output=n,c.child=null,c.on.transactionApplying.next(o.transactionMeta);let{updates:p}=o.transactionMeta.update;if(i.logger.info("\uD83D\uDEC4","transaction",o.transactionMeta.update.key,`Applying transaction with ${p.length} updates:`,p),Jm("newValue",o.transactionMeta.update,c),$i(c))r0(c,o.transactionMeta.update.key,o.transactionMeta.update.epoch),Tn(i,{key:o.transactionMeta.update.key,type:"transaction"})?.subject.next(o.transactionMeta.update),i.logger.info("\uD83D\uDEEC","transaction",o.transactionMeta.update.key,"Finished applying transaction.");else if(Mn(c))c.transactionMeta.update.updates.push(o.transactionMeta.update);c.on.transactionApplying.next(null)};function g0(n,i,o){if(!$i(n))return;let{epoch:p,actionContinuities:x}=n.transactionMeta;if(x.set(i,o),!p.has(i))p.set(i,-1)}function e0(n){return{store:n}}function Gn(n,...i){let o,c,p;if(i.length===1)o=i[0];else c=i[0],p=i[1],o=t(n,c,p);if("counterfeit"in o&&"family"in o){c=n.families.get(o.family.key);let x=o.family.subKey,m=n.disposalTraces.buffer.find((a)=>a?.key===x);switch(n.logger.error("\u274C",o.type,o.key,`could not be retrieved because it was not found in the store "${n.config.name}".`,m?`This state was previously disposed:
60
+ ${m.trace}`:"No previous disposal trace was found."),c.type){case"atom_family":case"mutable_atom_family":return n.defaults.get(c.key);case"selector_family":case"readonly_selector_family":{if(n.defaults.has(c.key))return n.defaults.get(o.family.key);let a=Tn(n,c).default(x);return n.defaults.set(c.key,a),a}}}return yo(n,Tn(n,o))}class qi extends Map{deleted=new Set;source;constructor(n){super();this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n);return}set(n,i){return this.deleted.delete(n),super.set(n,i)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}var n1=(n,i,o,c)=>{let p=j(n),x={parent:p,child:null,on:p.on,loggers:p.loggers,logger:p.logger,config:p.config,atoms:new qi(p.atoms),atomsThatAreDefault:new Set(p.atomsThatAreDefault),families:new qi(p.families),joins:new qi(p.joins),operation:{open:!1},readonlySelectors:new qi(p.readonlySelectors),timelines:new qi(p.timelines),timelineTopics:new ii(p.timelineTopics.toJSON()),trackers:new Map,transactions:new qi(p.transactions),selectorAtoms:new ii(p.selectorAtoms.toJSON()),selectorGraph:new ii(p.selectorGraph.toJSON(),{makeContentKey:(...v)=>v.sort().join(":")}),selectors:new qi(p.selectors),valueMap:new qi(p.valueMap),defaults:p.defaults,disposalTraces:n.disposalTraces.copy(),molecules:new qi(p.molecules),moleculeGraph:new ii(p.moleculeGraph.toJSON(),{makeContentKey:p.moleculeGraph.makeContentKey}),moleculeData:new ii(p.moleculeData.toJSON(),{makeContentKey:p.moleculeData.makeContentKey}),moleculeJoins:new ii(p.moleculeJoins.toJSON(),{makeContentKey:p.moleculeJoins.makeContentKey}),miscResources:new qi(p.miscResources)},m=P0(n,i),a={phase:"building",update:{type:"transaction_update",key:i,id:c,epoch:m===void 0?Number.NaN:m+1,updates:[],params:o,output:void 0},toolkit:{get:(...v)=>Gn(f,...v),set:(...v)=>{On(f,...v)},run:(v,$=am())=>dc(f,v,$),find:(v,$)=>t(f,v,$),json:(v)=>ni(f,v),dispose:(...v)=>{Sc(f,...v)},env:()=>e0(f)}},f=Object.assign(x,{transactionMeta:a});return p.child=f,n.logger.info("\uD83D\uDEEB","transaction",i,"Building transaction with params:",o),f};function Xf(n,i){let o={key:i.key,type:"transaction",run:(x,m)=>{let a=n1(n,i.key,x,m);try{let f=j(n),{toolkit:v}=a.transactionMeta,$=i.do(v,...x);return d0($,f),$}catch(f){throw O0(c),n.logger.warn("\uD83D\uDCA5","transaction",i.key,"caught:",f),f}},install:(x)=>Xf(x,i),subject:new $n},c=j(n);c.transactions.set(o.key,o);let p=lo(o);return n.on.transactionCreation.next(p),p}class i1{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;selectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new ii({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new ii({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});trackers=new Map;families=new Map;joins=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new ii({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new ii({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new fm(100);molecules=new Map;moleculeJoins=new ii({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeGraph=new ii({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeData=new ii({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});miscResources=new Map;on={atomCreation:new $n,atomDisposal:new $n,selectorCreation:new $n,selectorDisposal:new $n,timelineCreation:new $n,transactionCreation:new $n,transactionApplying:new Af(null),operationClose:new $n,moleculeCreation:new $n,moleculeDisposal:new $n};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Xc("warn",(n,i,o)=>!o1(o))];logger={error:(...n)=>{for(let i of this.loggers)i.error(...n)},info:(...n)=>{for(let i of this.loggers)i.info(...n)},warn:(...n)=>{for(let i of this.loggers)i.warn(...n)}};constructor(n,i=null){if(this.config={...i?.config,...n},i!==null){if(this.valueMap=new Map(i?.valueMap),this.operation={...i?.operation},$i(i))this.transactionMeta={epoch:new Map(i?.transactionMeta.epoch),actionContinuities:new ii(i?.transactionMeta.actionContinuities.toJSON())};for(let[,c]of i.families){if(c.internalRoles?.includes("mutable")||c.internalRoles?.includes("join"))continue;c.install(this)}let o=new Set;for(let[,c]of i.atoms){if(o.has(c.key))continue;if(c.install(this),c.type==="mutable_atom"){let p=ni(i,c),x=Uo(c);o.add(p.key),o.add(x.key)}}for(let[,c]of i.readonlySelectors)c.install(this);for(let[,c]of i.selectors){if(o.has(c.key))continue;c.install(this)}for(let[,c]of i.transactions)c.install(this);for(let[,c]of i.timelines)c.install(this)}}}var g={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??=new i1({name:"IMPLICIT_STORE",lifespan:"ephemeral"}),globalThis.ATOM_IO_IMPLICIT_STORE}};function Tn(n,i){let o,c=n;while(c!==null){switch(i.type){case"atom":case"mutable_atom":o=c.atoms.get(i.key);break;case"selector":o=c.selectors.get(i.key);break;case"readonly_selector":o=c.readonlySelectors.get(i.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":o=c.families.get(i.key);break;case"timeline":o=c.timelines.get(i.key);break;case"transaction":o=c.transactions.get(i.key);break}if(o)return o;c=c.child}throw new Fc(i,n)}function c1(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new Fc(i,n);let p=c(o),x=j(n);if(p.family){if($i(x))switch(p.type){case"atom":case"mutable_atom":n.on.atomCreation.next(p);break;case"selector":case"readonly_selector":n.on.selectorCreation.next(p);break}else if(Mn(x)&&x.on.transactionApplying.state===null)x.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function p1(n,i,o){let c=wn(o),p=`${i.key}(${c})`,x=j(n),m;switch(i.type){case"atom_family":case"mutable_atom_family":m=x.atoms.get(p);break;case"selector_family":m=x.selectors.get(p);break;case"readonly_selector_family":m=x.readonlySelectors.get(p);break}if(m)return lo(m);return m}function t(n,i,o){let c=p1(n,i,o);if(c)return c;let p=wn(o),x=n.molecules.get(p);if(!x&&n.config.lifespan==="immortal"){let m=E0(i,o);return n.logger.error("\u274C",m.type,m.key,`was not found in store "${n.config.name}"; returned a counterfeit token.`),m}if(c=c1(n,i,o),x)j(n).moleculeData.set(p,i.key);return c}function Sc(n,...i){let o;if(i.length===1)o=i[0];else{let c=i[0],p=i[1];o=t(n,c,p)}try{Tn(n,o)}catch(c){n.logger.error("\u274C",o.type,o.key,`could not be disposed because it was not found in the store "${n.config.name}".`);return}switch(o.type){case"atom":case"mutable_atom":Wf(n,o);break;case"selector":case"readonly_selector":x1(n,o);break}}var Am=(n,i)=>j(n).atoms.has(i),a3=(n,i)=>j(n).selectors.has(i),f3=(n,i)=>j(n).readonlySelectors.has(i),m1=(n,i)=>Am(n,i)||a3(n,i)||f3(n,i);var Fm=(n,i)=>{return j(i).selectorGraph.getRelationEntries({downstreamSelectorKey:n}).filter(([c,{source:p}])=>p!==n).map(([c,{source:p}])=>p).filter((c)=>m1(i,c))};var Kf=(n,i,o)=>{let c=[],p=Fm(n,o);while(p.length>0){let x=p.shift();if(i.has(x))continue;if(i.add(x),!Am(o,x))p.push(...Fm(x,o));else if(!c.includes(x))c.push(x)}return c},a1=(n,i)=>{let o=n.key,c=Fm(o,i),p=new Set;return c.flatMap((x)=>Am(i,x)?x:Kf(x,p,i))};var f1=(n,i,o,c)=>{let p=j(c);if(i.type==="atom"||i.type==="mutable_atom")p.selectorAtoms.set({selectorKey:n,atomKey:i.key}),c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atom "${i.key}"`);else{let x=Kf(i.key,o,c);c.logger.info("\uD83D\uDD0D","selector",n,`discovers root atoms: [ ${x.map((m)=>`"${m}"`).join(", ")} ]`);for(let m of x)p.selectorAtoms=p.selectorAtoms.set({selectorKey:n,atomKey:m})}o.add(i.key)};var Tm=(n,i,o)=>({get:(...c)=>{let p=j(o),x;if(c.length===2){let[f,v]=c;x=t(o,f,v)}else[x]=c;let m=Tn(o,x),a=yo(o,m);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${x.key}" =`,a,")"),p.selectorGraph.set({upstreamSelectorKey:x.key,downstreamSelectorKey:n},{source:x.key}),f1(n,x,i,o),a},set:(...c)=>{let p,x;if(c.length===2)p=c[0],x=c[1];else{let f=c[0],v=c[1];x=c[2],p=t(o,f,v)}let m=j(o),a=Tn(m,p);$m(m,a,x)},find:(c,p)=>t(o,c,p),json:(c)=>ni(o,c)});var xx=(n,i,o)=>{let c=j(n),p=new $n,x=new Set,{get:m,find:a,json:f}=Tm(i.key,x,c),v=()=>{let S=i.get({get:m,find:a,json:f});return Zi(j(n),i.key,S,p),x.clear(),S},$={...i,subject:p,install:(S)=>xx(S,i,o),get:v,type:"readonly_selector",...o&&{family:o}};c.readonlySelectors.set(i.key,$);let w=v();n.logger.info("\u2728",$.type,$.key,"=",w);let J={key:i.key,type:"readonly_selector"};if(o)J.family=o;return J};var fx=(n,i,o)=>{let c=j(n),p=new $n,x=new Set,m=Tm(i.key,x,c),{find:a,get:f,json:v}=m,$={find:a,get:f,json:v},w=(K=i.get,M=j(n))=>{let Y=K($);return Zi(M,i.key,Y,p),x.clear(),Y},S={...i,subject:p,install:(K)=>fx(K,i,o),get:w,set:(K)=>{let M=j(n),Y=w(i.get,M),I=vm(K)(Y);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",Y,"->",I,")"),Zi(M,i.key,I,p),gc(M,i.key),$i(M))p.next({newValue:I,oldValue:Y});i.set(m,I)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,S);let X=w();n.logger.info("\u2728",S.type,S.key,"=",X);let R={key:i.key,type:"selector"};if(o)R.family=o;return R};function Jf(n,i){if("set"in i){let p=fx(n,i,void 0);return n.on.selectorCreation.next(p),p}let c=xx(n,i,void 0);return n.on.selectorCreation.next(c),c}function x1(n,i){let o=j(n),{key:c}=i,p=Tn(o,i);if(!p.family)n.logger.error("\u274C","selector",c,"Standalone selectors cannot be disposed.");else{if(o.molecules.get(p.family.subKey))o.moleculeData.delete(p.family.subKey,p.family.key);let m;switch(i.type){case"selector":o.selectors.delete(c),m={key:p.family.key,type:"selector_family"},Tn(n,m).subject.next({type:"state_disposal",subType:"selector",token:i});break;case"readonly_selector":o.readonlySelectors.delete(c),m={key:p.family.key,type:"readonly_selector_family"},Tn(n,m).subject.next({type:"state_disposal",subType:"selector",token:i});break}if(o.valueMap.delete(c),o.selectorAtoms.delete(c),o.selectorGraph.delete(c),n.logger.info("\uD83D\uDD25",i.type,c,"deleted"),Mn(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:i});else n.on.selectorDisposal.next(i)}}function mx(n,i,o){let c={key:i.key,type:"selector_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","selector_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=j(n),S=fx(J,{key:w,get:i.get(f),set:i.set(f)},$);return x.next({type:"state_creation",token:S}),S},c,{internalRoles:o,subject:x,install:(f)=>mx(f,i),default:(f)=>{return i.get(f)({get:(...$)=>Gn(n,...$),find:($,w)=>t(n,$,w),json:($)=>ni(n,$)})}});return n.families.set(i.key,a),c}function v1(n,i,o){return mx(n,{key:`${i.key}:JSON`,get:(p)=>({get:x})=>{let m=x(i,p);return o.toJson(m)},set:(p)=>({set:x},m)=>{x(i,p,o.fromJson(m))}},["mutable","json"])}var xi=(n)=>JSON.parse(n),wn=(n)=>JSON.stringify(n),DQ=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var $1=(n,i)=>{let o=j(n);if(o.operation.open)return o.operation.prev.get(i.key);return o.valueMap.get(i.key)};var Mf=(n,i)=>{let o=j(n);return a1(i,n).map((p)=>{let x=o.atoms.get(p);if(x===void 0)throw new Error(`Atom "${p}", a dependency of selector "${i.key}", not found in store "${n.config.name}".`);return x.subject.subscribe(`${i.type}:${i.key}`,(m)=>{n.logger.info("\uD83D\uDCE2",i.type,i.key,"root",p,"went",m.oldValue,"->",m.newValue);let a=$1(o,i),f=yo(o,i);n.logger.info("\u2728",i.type,i.key,"went",a,"->",f),i.subject.next({newValue:f,oldValue:a})})})};function Xi(n,i,o,c){function p(w){if(n.operation.open){let J=n.on.operationClose.subscribe(`state subscription ${o}`,()=>{J(),c(w)})}else c(w)}let x=Tn(n,i);n.logger.info("\uD83D\uDC40",x.type,x.key,`Adding subscription "${o}"`);let m=x.type==="selector"||x.type==="readonly_selector",a=null,f=p;if(m)a=Mf(n,x),f=(w)=>{if(a)a.length=0,a.push(...Mf(n,x));p(w)};let v=x.subject.subscribe(o,f);return()=>{if(n.logger.info("\uD83D\uDE48",x.type,x.key,`Removing subscription "${o}"`),v(),a)for(let w of a)w()}}var lf=(n,i,o,c)=>{let p=Tn(n,i);n.logger.info("\uD83D\uDC40","timeline",i.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,c);return()=>{n.logger.info("\uD83D\uDE48","timeline",i.key,`Removing subscription "${o}" from timeline`),x()}};var Gf=(n,i,o,c)=>{let p=Tn(n,i);n.logger.info("\uD83D\uDC40","transaction",i.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,c);return()=>{n.logger.info("\uD83D\uDE48","transaction",i.key,`Removing subscription "${o}"`),x()}};class Wc{Update;initializeState(n,i){let o=`*${n.key}`;i.atoms.delete(o),i.valueMap.delete(o);let c=n.family?{key:`*${n.family.key}`,subKey:n.family.subKey}:void 0,p=Ac(i,{key:o,default:null},c);if(i.parent?.valueMap.has(o)){let x=i.parent.valueMap.get(o);i.valueMap.set(o,x)}return p}unsubscribeFromInnerValue;unsubscribeFromState;observeCore(n,i,o){let c=`tracker:${o.config.name}:${Mn(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=Gn(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(x)=>{On(o,i,x)}),this.unsubscribeFromState=Xi(o,n,c,(x)=>{if(x.newValue!==x.oldValue)this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=x.newValue.subscribe(c,(m)=>{On(o,i,m)})})}updateCore(n,i,o){let c=`tracker:${o.config.name}:${Mn(o)?o.transactionMeta.update.key:"main"}:${n.key}`;Xi(o,i,c,({newValue:p,oldValue:x})=>{let m=o.timelineTopics.getRelatedKey(i.key);if(m){if(o.timelines.get(m)?.timeTraveling){let v=lf(o,{key:m,type:"timeline"},c,($)=>{v(),On(o,n,(w)=>{if($==="redo"&&p)w.do(p);else if($==="undo"&&x)w.undo(x);return w})});return}}let a=o.on.operationClose.subscribe(c,()=>{a();let f=Gn(o,n),v=p===null?-1:f.getUpdateNumber(p),$=v-f.cacheUpdateNumber;if(p&&$===1)On(o,n,(w)=>(w.do(p),w));else o.logger.info("\u274C","mutable_atom",n.key,`could not be updated. Expected update number ${f.cacheUpdateNumber+1}, but got ${v}`)})})}mutableState;latestUpdateState;[Symbol.dispose];constructor(n,i){this.mutableState=n;let o=j(i);this.latestUpdateState=this.initializeState(n,o),this.observeCore(n,this.latestUpdateState,o),this.updateCore(n,this.latestUpdateState,o),o.trackers.set(n.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),o.trackers.delete(n.key)}}}function vx(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=j(n),p=c.atoms.get(i.key);if(p&&p.type==="mutable_atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),lo(p);let x=new $n,m={...i,type:"mutable_atom",install:(v)=>{return v.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${v.config.name}"`),vx(v,i,o)},subject:x};if(o)m.family=o;let a=i.default();c.atoms.set(m.key,m),Rm(n,i.key),Zi(c,i.key,a,x);let f=lo(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(S)=>{On(n,f,S)},onSet:(S)=>Xi(n,f,`effect[${v}]`,S)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}if(new Wc(f,n),!o)H0(f,i,n);return f}class Yf{trackers=new Map;Update;latestUpdateAtoms;mutableAtoms;constructor(n,i){let o=Jc(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=Tn(i,o),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{let{type:p,token:x}=c;if(x.family){let m=xi(x.family.subKey);switch(p){case"state_creation":this.trackers.set(m,new Wc(x,i));break;case"state_disposal":{let a=this.trackers.get(m);if(a)a[Symbol.dispose](),this.trackers.delete(m)}break}}})}}function px(n,i,o){let c={key:i.key,type:"mutable_atom_family"},p=n.families.get(i.key);if(p)n.logger.error("\u2757","mutable_atom_family",i.key,`Overwriting an existing ${Ko(p)} "${p.key}" in store "${n.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);let x=new $n,a=Object.assign((f)=>{let v=wn(f),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=j(n),S={key:w,default:()=>i.default(f),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)S.effects=i.effects(f);let X=vx(J,S,$);return x.next({type:"state_creation",token:X}),X},c,{subject:x,install:(f)=>px(f,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,a),v1(n,a,i),new Yf(a,n),c}var Hf=(n,i)=>{let o=j(i),c=`${n.key}:JSON`;return o.families.get(c)};var ni=(n,i)=>{if(i.family){let c=j(n),x={key:`${i.family.key}:JSON`,type:"selector_family"},m=Tn(c,x),a=JSON.parse(i.family.subKey);return t(n,m,a)}return{type:"selector",key:`${i.key}:JSON`}};var Uo=(n)=>{let o={type:"atom",key:`*${n.key}`};if(n.family)o.family={key:`*${n.family.key}`,subKey:n.family.subKey};return o};function D0(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function ax(n,i,o){let c=o.valueMap.get(i.key),p=n.valueMap.get(i.key);if(c!==p)return p;if(c===void 0)return i.default();o.logger.info("\uD83D\uDCC3","atom",i.key,"copying");let x=i.toJson(c),m=i.fromJson(x);return n.valueMap.set(i.key,m),new Wc(i,o),m}function Zi(n,i,o,c){let p=n.valueMap.get(i);if(p instanceof cx)p.use(o);if(o instanceof Promise){let x=new cx(o);return n.valueMap.set(i,x),x.then((m)=>{Zi(n,i,m,c),c.next({newValue:m,oldValue:x})}).catch((m)=>{n.logger.error("\uD83D\uDCA5","state",i,"rejected:",m)}),x}return n.valueMap.set(i,o),o}var U0=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&Mn(i)){let{parent:c}=i;o=ax(i,n,c)}return o},B0=(n,i)=>{let o=i.valueMap.get(n);if(o instanceof cx){let c=o,p=i.selectors.get(n)??i.readonlySelectors.get(n);if(p)c.use(p.get());return}if(i.operation.open)i.operation.prev.set(n,o);i.valueMap.delete(n),i.logger.info("\uD83D\uDDD1","state",n,"evicted")};var L0=(n,i)=>{return j(n).atomsThatAreDefault.has(i)},Rm=(n,i)=>{let o=j(n);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(i)},N0=(n,i)=>{let o=j(n);o.atomsThatAreDefault=new Set(j(n).atomsThatAreDefault),o.atomsThatAreDefault.delete(i)};function Ac(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=j(n),p=c.atoms.get(i.key);if(p&&p.type==="atom")return n.logger.error("\u274C","atom",i.key,"Tried to create atom, but it already exists in the store."),lo(p);let x=new $n,m={...i,type:"atom",install:(v)=>{return v.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${v.config.name}"`),Ac(v,i,o)},subject:x};if(o)m.family=o;let a=i.default;if(i.default instanceof Function)a=i.default();c.atoms.set(m.key,m),Rm(n,i.key),Zi(c,i.key,a,x);let f=lo(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(S)=>{On(n,f,S)},onSet:(S)=>Xi(n,f,`effect[${v}]`,S)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}return f}function w1(n,i){if("mutable"in i){let p=vx(n,i,void 0);return n.on.atomCreation.next(p),p}let c=Ac(n,i,void 0);return n.on.atomCreation.next(c),c}function Wf(n,i){let o=j(n),{key:c,family:p}=i,x=Tn(o,i);if(!p)n.logger.error("\u274C","atom",c,"Standalone atoms cannot be disposed.");else{x.cleanup?.();let m=n.valueMap.get(x.key),a=Tn(n,{key:p.key,type:"atom_family"}),f={type:"state_disposal",subType:"atom",token:i,value:m};a.subject.next(f);let v=Mn(o);if(o.atoms.delete(c),o.valueMap.delete(c),o.selectorAtoms.delete(c),o.atomsThatAreDefault.delete(c),n.timelineTopics.delete(c),i.type==="mutable_atom"){let $=Uo(i);Wf(n,$),n.trackers.delete(c)}if(n.logger.info("\uD83D\uDD25","atom",c,"deleted"),v&&o.transactionMeta.phase==="building"){let $=o.transactionMeta.update.updates.at(-1);if(!($?.type==="molecule_disposal"&&$.values.some(([S])=>S===x.family?.key)))o.transactionMeta.update.updates.push(f)}else n.on.atomDisposal.next(i)}}class oi extends Set{mode="record";subject=new $n;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof oi)this.parent=n,this.cacheUpdateNumber=n.cacheUpdateNumber;if(i)this.cacheLimit=i,this.cache=new Array(i),this.subscribe("auto cache",(o)=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=o})}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(n){let i=new oi(n.members,n.cacheLimit);return i.cache=n.cache,i.cacheIdx=n.cacheIdx,i.cacheUpdateNumber=n.cacheUpdateNumber,i}add(n){let i=super.add(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`add:${wn(n)}`);return i}clear(){let n=this.mode==="record"?[...this]:null;if(super.clear(),n)this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(n)}`)}delete(n){let i=super.delete(n);if(this.mode==="record")this.cacheUpdateNumber++,this.emit(`del:${wn(n)}`);return i}parent;child=null;transactionUpdates=null;transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new oi(this);let i=this.child._subscribe("transaction",(o)=>{this.transactionUpdates?.push(o)});try{if(n(this.child)){for(let c of this.transactionUpdates)this.doStep(c);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(o){throw console.warn("Did not apply transaction to SetRTX; this error was thrown:",o),o}finally{i(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(n,i){return this.subject.subscribe(n,i)}subscribe(n,i){return this.subject.subscribe(n,(o)=>{i(`${this.cacheUpdateNumber}=${o}`)})}emit(n){this.subject.next(n)}doStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.add(JSON.parse(c));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(c));break;case"tx":for(let p of c.split(";"))this.doStep(p)}}getUpdateNumber(n){let i=n.indexOf("=");return Number(n.substring(0,i))}do(n){let i=n.indexOf("="),o=Number(n.substring(0,i)),c=o-this.cacheUpdateNumber;if(c>0){if(c===1){this.mode="playback";let x=n.substring(i+1);return this.doStep(x),this.mode="record",this.cacheUpdateNumber=o,null}return this.cacheUpdateNumber+1}if(Math.abs(c)<this.cacheLimit){let x=this.cacheIdx+c;if(this.cache[x]===n)return null;this.mode="playback";let a=!1;while(!a){this.cacheIdx%=this.cacheLimit;let v=this.cache[this.cacheIdx];if(this.cacheIdx--,!v)return"OUT_OF_RANGE";this.undo(v),a=this.cacheIdx===x-1}let f=n.substring(i+1);return this.doStep(f),this.mode="record",this.cacheUpdateNumber=o,null}return"OUT_OF_RANGE"}undoStep(n){let i=n.indexOf(":"),o=n.substring(0,i),c=n.substring(i+1);switch(o){case"add":this.delete(JSON.parse(c));break;case"del":this.add(JSON.parse(c));break;case"clear":{let p=JSON.parse(c);for(let x of p)this.add(x);break}case"tx":{let p=c.split(";");for(let x=p.length-1;x>=0;x--)this.undoStep(p[x])}}}undo(n){let i=n.indexOf("=");if(Number(n.substring(0,i))===this.cacheUpdateNumber){this.mode="playback";let c=n.substring(i+1);return this.undoStep(c),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}class $x{toolkit;options;defaultContent;molecules=new Map;relations;states;core;transact(n,i){let o=this.toolkit;this.toolkit=n,i(this),this.toolkit=o}store;realm;[Symbol.dispose](){}constructor(n,i,o=g.STORE){this.store=o,this.realm=new zf(o),this.options=n,this.defaultContent=i,this.store.miscResources.set(`join:${n.key}`,this),this.realm.allocate("root",n.key),this.toolkit={get:(...G)=>Gn(o,...G),set:(...G)=>{On(o,...G)},find:(...G)=>t(o,...G),json:(G)=>ni(o,G)};let c=n.between[0],p=n.between[1],x=px(o,{key:`${n.key}/relatedKeys`,default:()=>new oi,mutable:!0,fromJson:(G)=>oi.fromJSON(G),toJson:(G)=>G.toJSON()},["join","relations"]);this.core={relatedKeysAtoms:x};let m=({get:G},z)=>G(x,z),a=({set:G},z,E)=>{if(!this.store.molecules.has(wn(z)))this.realm.allocate(n.key,z);G(x,z,(Q)=>Q.add(E)),G(x,E,(Q)=>Q.add(z))},f=({set:G},z,E)=>{G(x,z,(Q)=>{return Q.delete(E),Q}),G(x,E,(Q)=>{return Q.delete(z),Q})},v=(G,z,E)=>{let{find:Q,get:b,set:y}=G,H=Q(x,z),an=b(H);for(let Z of an){if(E.includes(Z))continue;y(x,Z,(En)=>{return En.delete(z),En})}y(H,(Z)=>{return Z.transaction((fn)=>{fn.clear();for(let En of E){let dn=m(G,En),Vi=dn.has(z);if(this.relations.cardinality==="1:n"){let Oo=[];for(let O of dn){if(O===z)continue;let q=m(G,O);if(q.delete(En),q.size===0)Oo.push(O)}if(!Vi&&dn.size>0)dn.clear();for(let O of Oo){let q=[En,O].sort(),Rn=`"${q[0]}:${q[1]}"`;this.molecules.delete(Rn)}}if(!Vi)dn.add(z);fn.add(En)}return!0}),Z})},$=(G,z,E)=>{let{set:Q}=G;Q(x,z,(b)=>{return b.transaction((y)=>{for(let H of E)y.add(H);return!0}),b});for(let b of E)Q(x,b,(y)=>{return y.add(z),y});return!0},w=(G,z,E)=>{let Q=m(G,z);return E?Q.has(E):Q.size>0},J={getRelatedKeys:(G)=>m(this.toolkit,G),addRelation:(G,z)=>{this.store.moleculeJoins.set(G,n.key),this.store.moleculeJoins.set(z,n.key),a(this.toolkit,G,z)},deleteRelation:(G,z)=>{f(this.toolkit,G,z)},replaceRelationsSafely:(G,z)=>{v(this.toolkit,G,z)},replaceRelationsUnsafely:(G,z)=>{$(this.toolkit,G,z)},has:(G,z)=>w(this.toolkit,G,z)},S,X;if(i){X=Jc(o,{key:`${n.key}/content`,default:i},["join","content"]);let G=({get:Q},b)=>Q(X,b),z=({set:Q},b,y)=>{Q(X,b,y)};S=Object.assign(J,{getContent:(Q)=>{return G(this.toolkit,Q)},setContent:(Q,b)=>{z(this.toolkit,Q,b)},deleteContent:(Q)=>{this.realm.deallocate(Q)}})}else S=J;let R=new ii(n,{externalStore:S,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...G)=>{let[z,E]=G,Q=G.sort(),b=`${Q[0]}:${Q[1]}`,y=o.molecules.get(wn(z)),H=o.molecules.get(wn(E));if(!y)this.realm.allocate(n.key,z);if(!H)this.realm.allocate(n.key,E);return this.realm.allocate(z,b,"all"),this.realm.claim(E,b),this.store.moleculeJoins.set(b,n.key),b}}),K=()=>Io(o,{key:`${n.key}/singleRelatedKey`,get:(G)=>({get:z})=>{let E=z(x,G);for(let Q of E)return Q;return null}},["join","keys"]),M=()=>{return Io(o,{key:`${n.key}/multipleRelatedKeys`,get:(G)=>({get:z})=>{let E=Hf(x,o);return z(E,G).members}},["join","keys"])},Y=()=>Io(o,{key:`${n.key}/singleRelatedEntry`,get:(G)=>({get:z})=>{let E=z(x,G);for(let Q of E){let b=R.isAType?.(G)?G:void 0,y=b===void 0?G:void 0;b??=Q,y??=Q;let H=R.makeContentKey(b,y),an=z(X,H);return[Q,an]}return null}},["join","entries"]),I=()=>Io(o,{key:`${n.key}/multipleRelatedEntries`,get:(G)=>({get:z})=>{let E=Hf(x,o);return z(E,G).members.map((b)=>{let y=R.isAType?.(G)?G:void 0,H=y===void 0?G:void 0;y??=b,H??=b;let an=R.makeContentKey(y,H),Z=z(X,an);return[b,Z]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let G=K(),z=`${c}KeyOf${Yn(p)}`,E=`${p}KeyOf${Yn(c)}`,Q={[z]:G,[E]:G},b;if(i){let y=Y(),H=`${c}EntryOf${Yn(p)}`,an=`${p}EntryOf${Yn(c)}`,Z={[H]:y,[an]:y};b=Object.assign(Q,Z)}else b=Q;this.relations=R,this.states=b;break}case"1:n":{let G=K(),z=M(),E=`${c}KeyOf${Yn(p)}`,Q=`${p}KeysOf${Yn(c)}`,b={[E]:G,[Q]:z},y;if(i){let H=Y(),an=I(),Z=`${c}EntryOf${Yn(p)}`,fn=`${p}EntriesOf${Yn(c)}`,En={[Z]:H,[fn]:an};y=Object.assign(b,En)}else y=b;this.relations=R,this.states=y;break}case"n:n":{let G=M(),z=`${c}KeysOf${Yn(p)}`,E=`${p}KeysOf${Yn(c)}`,Q={[z]:G,[E]:G},b;if(i){let y=I(),H=`${c}EntriesOf${Yn(p)}`,an=`${p}EntriesOf${Yn(c)}`,Z={[H]:y,[an]:y};b=Object.assign(Q,Z)}else b=Q;this.relations=R,this.states=b}}}}function np(n,i){let o=i.joins.get(n.key);if(o===void 0){let p=g.STORE.joins.get(n.key);if(p===void 0)throw new Error(`Join "${n.key}" not found in store "${i.config.name}"`);o=new $x(p.options,p.defaultContent,i),i.joins.set(n.key,o)}return o}function ko(n,i,o){let c=np(n,o),p=j(o);if(Mn(p)){let{toolkit:x}=p.transactionMeta;c.transact(x,({relations:m})=>{i(m)})}else i(c.relations)}function ip(n,i,o){let c=np(n,o),p;switch(n.cardinality){case"1:1":{let x=`${n.a}KeyOf${Yn(n.b)}`,m=`${n.b}KeyOf${Yn(n.a)}`;p={get[x](){let f=c.states[x];return t(o,f,i)},get[m](){let f=c.states[m];return t(o,f,i)}};let a=`${n.a}EntryOf${Yn(n.b)}`;if(a in c.states){let f=`${n.b}EntryOf${Yn(n.a)}`;Object.assign(p,{get[a](){let v=c.states[a];return t(o,v,i)},get[f](){let v=c.states[f];return t(o,v,i)}})}break}case"1:n":{let x=`${n.a}KeyOf${Yn(n.b)}`,m=`${n.b}KeysOf${Yn(n.a)}`;p={get[x](){let f=c.states[x];return t(o,f,i)},get[m](){let f=c.states[m];return t(o,f,i)}};let a=`${n.a}EntryOf${Yn(n.b)}`;if(a in c.states){let f=`${n.b}EntriesOf${Yn(n.a)}`;Object.assign(p,{get[a](){let v=c.states[a];return t(o,v,i)},get[f](){let v=c.states[f];return t(o,v,i)}})}break}case"n:n":{let x=`${n.a}KeysOf${Yn(n.b)}`,m=`${n.b}KeysOf${Yn(n.a)}`;p={get[x](){let f=c.states[x];return t(o,f,i)},get[m](){let f=c.states[m];return t(o,f,i)}};let a=`${n.a}EntriesOf${Yn(n.b)}`;if(a in c.states){let f=`${n.b}EntriesOf${Yn(n.a)}`;Object.assign(p,{get[a](){let v=c.states[a];return t(o,v,i)},get[f](){let v=c.states[f];return t(o,v,i)}})}}}return p}function J1(n,i){return np(n,i).core.relatedKeysAtoms}function o1(n){return n.startsWith("\uD83D\uDD0D ")}function Zo(n){return w1(g.STORE,n)}function Kc(n){return z0(g.STORE,n)}function Sm(n,i,o=g.STORE){return o.joins.set(n.key,new $x(n,i,o)),{key:n.key,type:"join",a:n.between[0],b:n.between[1],cardinality:n.cardinality}}function A1(n){return J1(n,g.STORE)}var Qf=(n)=>(i,o,c,p,...x)=>{console[n](`${i} ${o} "${c}" ${p}`,...x)},v3={error:Qf("error"),info:Qf("info"),warn:Qf("warn")};class Xc{logLevel;filter;logger;constructor(n,i,o=v3){this.logLevel=n,this.filter=i,this.logger=o}error=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!==null)this.logger.error(...n)};info=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel==="info")this.logger.info(...n)};warn=(...n)=>{if((this.filter?.(...n)??!0)&&this.logLevel!=="error"&&this.logLevel!==null)this.logger.warn(...n)}}var xV=Symbol("claim");class F1{store;constructor(n=g.STORE){this.store=n,I0("root",n)}allocate(n,i,o){return Tc(this.store,n,i,o)}fuse(n,i,o){return y0(this.store,n,i,o)}deallocate(n){Rc(this.store,n)}claim(n,i,o){return ec(this.store,n,i,o)}}class zf{store;realm;constructor(n=g.STORE){this.store=n,this.realm=new F1(n)}allocate(n,i,o){Tc(this.store,n,i,o)}deallocate(n){Rc(this.store,n)}claim(n,i,o){ec(this.store,n,i,o)}}function Xm(n){return Q0(g.STORE,n)}function lc(n){return Xf(g.STORE,n)}class T1 extends Map{set(n,i){if(this.has(n))return console.warn("Tried to set a key that already exists in an InvariantMap",{key:n,value:i}),this;return super.set(n,i)}clear(){throw new Error("Cannot clear an InvariantMap")}}class Wm{type="continuity";globals=[];actions=[];perspectives=[];key;constructor(n){this.key=n}static existing=new T1;static create(n,i){let o=new Wm(n),{type:c,globals:p,actions:x,perspectives:m}=i(o),a={type:c,key:n,globals:p,actions:x,perspectives:m};return Wm.existing.set(n,a),a}add(...n){switch(n[0].type){case"atom":case"mutable_atom":this.globals.push(...n);break;case"transaction":this.actions.push(...n);break;case"atom_family":case"mutable_atom_family":{let[o,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:o,viewAtoms:c})}break}return this}}function R1(n){let{key:i,config:o}=n,c=Wm.create(i,o),{actions:p}=c;for(let x of p)g0(g.STORE,i,x.key);return t0(g.STORE,i,-1),c}var TV=Zo({key:"usersInRoomIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),Ef=Zo({key:"roomIndex",default:()=>new oi,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),$3={enteredAtEpoch:0},wx=Sm({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},$3),RV=Xm({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=A1(wx);return[i(o,n)]}});import{spawn as w3}from"node:child_process";class op{listeners;globalListeners;handleEvent(n,...i){for(let c of this.globalListeners)c(n,...i);let o=this.listeners.get(n);if(o)for(let c of o)c(...i)}id="no_id_retrieved";emit;constructor(n){this.emit=n,this.listeners=new Map,this.globalListeners=new Set}on(n,i){let o=this.listeners.get(n);if(o)o.add(i);else this.listeners.set(n,new Set([i]));return this}onAny(n){return this.globalListeners.add(n),this}off(n,i){let o=this.listeners.get(n);if(o)if(i)o.delete(i);else this.listeners.delete(n);return this}offAny(n){return this.globalListeners.delete(n),this}}class Jx extends op{incompleteData="";unprocessedEvents=[];incompleteLog="";unprocessedLogs=[];id="#####";process;key;logger;handleLog(n){if(Array.isArray(n)){let[i,...o]=n;switch(i){case"i":this.logger.info(...o);break;case"w":this.logger.warn(...o);break;case"e":this.logger.error(...o);break;default:return}}}constructor(n,i,o){super((c,...p)=>{let x=JSON.stringify([c,...p])+"\x03",m=(a)=>{if(a.code==="EPIPE")console.error("EPIPE error during write",this.process.stdin);this.process.stdin.removeListener("error",m)};return this.process.stdin.once("error",m),this.process.stdin.write(x),this});if(this.process=n,this.key=i,this.logger=o??{info:(...c)=>{console.info(this.id,this.key,...c)},warn:(...c)=>{console.warn(this.id,this.key,...c)},error:(...c)=>{console.error(this.id,this.key,...c)}},this.process.stdout.on("data",(c)=>{let p=c.toString();if(p==="ALIVE")return;this.unprocessedEvents.push(...p.split("\x03"));let x=this.unprocessedEvents.shift();this.incompleteData+=x??"";try{if(this.incompleteData.startsWith("error"))console.log("\u2757",this.incompleteData);let m=xi(this.incompleteData);this.handleEvent(...m);while(this.unprocessedEvents.length>0){let a=this.unprocessedEvents.shift();if(a){if(this.unprocessedEvents.length===0)this.incompleteData=a;m=xi(a),this.handleEvent(...m)}}this.incompleteData=""}catch(m){console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.warn(this.incompleteData),console.warn("\u26A0\uFE0F----------------\u26A0\uFE0F"),console.error(m)}}),this.process.stderr.on("data",(c)=>{let p=c.toString();this.unprocessedLogs.push(...p.split("\x03"));let x=this.unprocessedLogs.shift();this.incompleteLog+=x??"";try{let m=xi(this.incompleteLog);this.handleLog(m);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)m=xi(this.incompleteLog),this.handleLog(m)}catch(m){console.error("\u274C\u274C\u274C"),console.error(this.incompleteLog),console.error(m),console.error("\u274C\u274C\u274C\uFE0F")}}),n.pid)this.id=n.pid.toString()}}class S1 extends op{in;out;id="no_id_retrieved";disposalFunctions=[];constructor(n){super((...i)=>{return this.out.next(i),this});this.id=n,this.in=new $n,this.out=new $n,this.in.subscribe("socket",(i)=>{this.handleEvent(...i)})}dispose(){for(let n of this.disposalFunctions)n()}}class Of extends op{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(wn(n.map((i)=>i instanceof oi?`{ ${i.toJSON().members.join(" | ")} }`:i))+"\x03")}logger={info:(...n)=>{this.log("i",...n)},warn:(...n)=>{this.log("w",...n)},error:(...n)=>{this.log("e",...n)}};constructor(){super((n,...i)=>{let o=JSON.stringify([n,...i]);return this.process.stdout.write(o+"\x03"),this});if(this.process=process,this.process.stdin.resume(),this.relays=new Map,this.relayServices=[],this.process.stdin.on("data",(n)=>{let i=n.toString();this.unprocessedEvents.push(...i.split("\x03"));let o=this.unprocessedEvents.shift();this.incompleteData+=o??"";try{let c=xi(this.incompleteData);this.logger.info("\uD83C\uDFB0","received",c),this.handleEvent(...c);while(this.unprocessedEvents.length>0){let p=this.unprocessedEvents.shift();if(p){if(this.unprocessedEvents.length===0)this.incompleteData=p;let x=xi(p);this.handleEvent(...x)}}this.incompleteData=""}catch(c){if(c instanceof Error)this.logger.error("\u2757",c.message,c.cause,c.stack)}}),this.on("exit",()=>{this.logger.info("\uD83D\uDD25",this.id,'received "exit"'),process.exit(0)}),process.on("exit",(n)=>{this.logger.info("\uD83D\uDD25",this.id,`exited with code ${n}`)}),process.on("end",()=>{this.logger.info("\uD83D\uDD25",this.id,"ended"),process.exit(0)}),process.on("SIGTERM",()=>{this.logger.error("\uD83D\uDD25",this.id,"terminated"),process.exit(0)}),process.on("SIGINT",()=>{this.logger.error("\uD83D\uDD25",this.id,"interrupted"),process.exit(0)}),process.pid)this.id=process.pid?.toString();this.on("user-joins",(n)=>{this.logger.info("\uD83D\uDC64","user",n,"joined");let i=new S1(`user:${n}`);this.relays.set(n,i),this.logger.info("\uD83D\uDD17","attaching services:",`[${[...this.relayServices.keys()].join(", ")}]`);for(let o of this.relayServices){let c=o(i);if(c)i.disposalFunctions.push(c)}this.on(`user:${n}`,(...o)=>{i.in.next(o)}),i.out.subscribe("socket",(o)=>{this.emit(...o)})}),this.on("user-leaves",(n)=>{let i=this.relays.get(n);if(this.off(`relay:${n}`),i)i.dispose(),this.relays.delete(n)}),process.stdout.write("ALIVE")}relay(n){this.logger.info("\uD83D\uDD17","running relay method"),this.relayServices.push(n)}}var Uf=Kc({key:"roomArguments",default:["echo",["Hello World!"]]}),X1=Xm({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(Uf,n),p=i(c),[x,m]=p,a=await new Promise((f)=>{let v=w3(x,m,{env:process.env}),$=(w)=>{if(w.toString()==="ALIVE")v.stdout.off("data",$),f(v)};v.stdout.on("data",$)});return new Jx(a,n)}});var yV=lc({key:"createRoom",do:({get:n,set:i,find:o},c,p,x)=>{let m=x?[p,x]:[p],a=o(Uf,c);i(a,m),i(Ef,($)=>$.add(c));let f=o(X1,c);return n(f)}}),kV=lc({key:"joinRoom",do:(n,i,o,c)=>{let p={enteredAtEpoch:c};return ko(wx,(x)=>{x.set({room:i,user:o},p)},n.env().store),p}}),ZV=lc({key:"leaveRoom",do:(n,i,o)=>{ko(wx,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),qV=lc({key:"destroyRoom",do:(n,i)=>{ko(wx,(o)=>{o.delete({room:i})},n.env().store),n.set(Ef,(o)=>(o.delete(i),o))}});function Vf(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=Vf(n,o.updates);return{...o,updates:c}}case"atom_update":case"selector_update":case"molecule_creation":case"molecule_disposal":case"molecule_transfer":case"state_creation":case"state_disposal":return o}}).filter((o)=>{switch(o.type){case"atom_update":case"selector_update":return n.includes(o.key);case"state_creation":case"state_disposal":return n.includes(o.token.key);case"molecule_creation":case"transaction_update":case"molecule_disposal":case"molecule_transfer":return!0}})}var tV=Kc({key:"redactor",default:{occlude:(n)=>n}}),cp=Kc({key:"unacknowledgedUpdates",default:()=>[]});var Km=Kc({key:"sockets",default:null}),_f=Zo({key:"socketsIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),bf=Zo({key:"usersIndex",mutable:!0,default:()=>new oi,toJson:(n)=>n.toJSON(),fromJson:(n)=>oi.fromJSON(n)}),Gc=Sm({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function W1(n,i,o,c){let p=i.key;return function x(){let m=[];for(let f of i.globals){let v=f.type==="mutable_atom"?ni(n,f):f,$=Gn(n,v);m.push(v,$)}for(let f of i.perspectives){let{viewAtoms:v,resourceAtoms:$}=f,w=t(n,v,o),J=Gn(n,w);n.logger.info("\uD83D\uDC41","atom",$.key,`${o} can see`,{viewAtoms:v,resourceAtoms:$,userView:J});for(let S of J){let X=S.type==="mutable_atom"?ni(n,S):S,R=Gn(n,X);m.push(X,R)}}let a=$i(n)?n.transactionMeta.epoch.get(p)??null:null;c?.emit(`continuity-init:${p}`,a,m)}}function K1(n,i,o){let c=i.key;return function p(x){n.logger.info("\uD83D\uDECE\uFE0F","continuity",c,"received",x);let{key:m,id:a}=x,f=`tx-run:${m}:${a}`,v=`${f}:start`,$=`${f}:end`;performance.mark(v);try{dc(n,{type:"transaction",key:m},a)(...x.params)}catch(J){if(J instanceof Error)n.logger.error("\u274C","continuity",c,`failed to run transaction ${m} from ${o} with update ${a}`,J.message)}performance.mark($);let w=performance.measure(f,v,$);n?.logger.info("\uD83D\uDE80","transaction",m,a,o,w.duration)}}function l1(n,i,o,c){let p=i.key;return function x(m){if(n.logger.info("\uD83D\uDC4D","continuity",p,`${o} acknowledged epoch ${m}`),c[0]?.epoch===m)On(n,cp,o,(f)=>{return f.shift(),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,f.length,"items"),f})}}function G1(n,i,o,c){let p=i.key,x=[];for(let m of i.actions){let a=Gf(n,m,`sync-continuity:${p}:${o}`,(f)=>{try{let v=i.globals.map((J)=>{if(J.type==="atom")return J.key;return Uo(J).key}).concat(i.perspectives.flatMap((J)=>{let{viewAtoms:S}=J,X=t(n,S,o);return Gn(n,X).map((K)=>{return K.type==="mutable_atom"?"*"+K.key:K.key})})),$=Vf(v,f.updates),w={...f,updates:$};On(n,cp,o,(J)=>{if(w)J.push(w),J.sort((S,X)=>S.epoch-X.epoch),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,J.length,"items");return J}),c?.emit(`tx-new:${p}`,w)}catch(v){if(v instanceof Error)n.logger.error("\u274C","continuity",p,`${o} failed to send update from transaction ${m.key} to ${o}`,v.message)}});x.push(a)}return x}function M1(n,i,o,c){let p=i.key,x=[];for(let m of i.perspectives){let{viewAtoms:a}=m,f=t(n,a,o),v=Xi(n,f,`sync-continuity:${p}:${o}:perspective:${m.resourceAtoms.key}`,({oldValue:$,newValue:w})=>{let J=$.map((K)=>K.key),S=w.map((K)=>K.key),X=$.filter((K)=>!S.includes(K.key)),R=w.filter((K)=>!J.includes(K.key)).flatMap((K)=>{let M=K.type==="mutable_atom"?ni(n,K):K,Y=Gn(n,M);return[M,Y]});if(n.logger.info("\uD83D\uDC41","atom",m.resourceAtoms.key,`${o} has a new perspective`,{oldKeys:J,newKeys:S,revealed:R,concealed:X}),R.length>0)c?.emit(`reveal:${p}`,R);if(X.length>0)c?.emit(`conceal:${p}`,X)});x.push(v)}return x}function Y1({socket:n,store:i=g.STORE}){return function o(c){let p=n,x=c.key,m=ip(Gc,`socket::${p.id}`,i).userKeyOfSocket,a=Gn(i,m);if(!a)return i.logger.error("\u274C","continuity",x,`Tried to create a synchronizer for a socket (${p.id}) that is not connected to a user.`),()=>{};let f=ip(Gc,a,i).socketKeyOfUser,v=Xi(i,f,`sync-continuity:${x}:${a}`,({newValue:M})=>{if(i.logger.info("\uD83D\uDC4B","continuity",x,`seeing ${a} on new socket ${M}`),M===null){i.logger.warn("\u274C","continuity",x,`User (${a}) is not connected to a socket, waiting for them to reappear.`);return}let Y=t(i,Km,M);p=Gn(i,Y);for(let G of $)p?.emit(`tx-new:${x}`,G)}),$=Gn(i,cp,a),w=[],J=M1(i,c,a,p),S=G1(i,c,a,p);w.push(...J,...S);let X=W1(i,c,a,n);p.off(`get:${x}`,X),p.on(`get:${x}`,X);let R=K1(i,c,a);p.off(`tx-run:${x}`,R),p.on(`tx-run:${x}`,R);let K=l1(i,c,a,$);return p?.on(`ack:${x}`,K),()=>{for(let M of w)M();p?.off(`ack:${x}`,K),p?.off(`get:${x}`,X),p?.off(`tx-run:${x}`,R)}}}var mS=wf($v(),1);var F=Symbol.for("drizzle:entityKind"),mb=Symbol.for("drizzle:hasOwnEntityKind");function l(n,i){if(!n||typeof n!=="object")return!1;if(n instanceof i)return!0;if(!Object.prototype.hasOwnProperty.call(i,F))throw new Error(`Class "${i.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let o=Object.getPrototypeOf(n).constructor;if(o)while(o){if(F in o&&o[F]===i[F])return!0;o=Object.getPrototypeOf(o)}return!1}class Un{constructor(n,i){this.table=n,this.config=i,this.name=i.name,this.keyAsName=i.keyAsName,this.notNull=i.notNull,this.default=i.default,this.defaultFn=i.defaultFn,this.onUpdateFn=i.onUpdateFn,this.hasDefault=i.hasDefault,this.primary=i.primaryKey,this.isUnique=i.isUnique,this.uniqueName=i.uniqueName,this.uniqueType=i.uniqueType,this.dataType=i.dataType,this.columnType=i.columnType,this.generated=i.generated,this.generatedIdentity=i.generatedIdentity}static[F]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(n){return n}mapToDriverValue(n){return n}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}class wv{static[F]="ColumnBuilder";config;constructor(n,i,o){this.config={name:n,keyAsName:n==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:i,columnType:o,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(n){return this.config.default=n,this.config.hasDefault=!0,this}$defaultFn(n){return this.config.defaultFn=n,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(n){return this.config.onUpdateFn=n,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(n){if(this.config.name!=="")return;this.config.name=n}}var fo=Symbol.for("drizzle:Name");class Jv{static[F]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(n,i){if(this.reference=()=>{let{name:o,columns:c,foreignColumns:p}=n();return{name:o,columns:c,foreignTable:p[0].table,foreignColumns:p}},i)this._onUpdate=i.onUpdate,this._onDelete=i.onDelete}onUpdate(n){return this._onUpdate=n===void 0?"no action":n,this}onDelete(n){return this._onDelete=n===void 0?"no action":n,this}build(n){return new lJ(n,this)}}class lJ{constructor(n,i){this.table=n,this.reference=i.reference,this.onUpdate=i._onUpdate,this.onDelete=i._onDelete}static[F]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:n,columns:i,foreignColumns:o}=this.reference(),c=i.map((m)=>m.name),p=o.map((m)=>m.name),x=[this.table[fo],...c,o[0].table[fo],...p];return n??`${x.join("_")}_fk`}}function Im(n,...i){return n(...i)}function GJ(n,i){return`${n[fo]}_${i.join("_")}_unique`}function MJ(n,i,o){for(let c=i;c<n.length;c++){let p=n[c];if(p==="\\"){c++;continue}if(p==='"')return[n.slice(i,c).replace(/\\/g,""),c+1];if(o)continue;if(p===","||p==="}")return[n.slice(i,c).replace(/\\/g,""),c]}return[n.slice(i).replace(/\\/g,""),n.length]}function YJ(n,i=0){let o=[],c=i,p=!1;while(c<n.length){let x=n[c];if(x===","){if(p||c===i)o.push("");p=!0,c++;continue}if(p=!1,x==="\\"){c+=2;continue}if(x==='"'){let[f,v]=MJ(n,c+1,!0);o.push(f),c=v;continue}if(x==="}")return[o,c+1];if(x==="{"){let[f,v]=YJ(n,c+1);o.push(f),c=v;continue}let[m,a]=MJ(n,c,!1);o.push(m),c=a}return[o,c]}function HJ(n){let[i]=YJ(n,1);return i}function Av(n){return`{${n.map((i)=>{if(Array.isArray(i))return Av(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${i}`}).join(",")}}`}class h extends wv{foreignKeyConfigs=[];static[F]="PgColumnBuilder";array(n){return new QJ(this.config.name,this,n)}references(n,i={}){return this.foreignKeyConfigs.push({ref:n,actions:i}),this}unique(n,i){return this.config.isUnique=!0,this.config.uniqueName=n,this.config.uniqueType=i?.nulls,this}generatedAlwaysAs(n){return this.config.generated={as:n,type:"always",mode:"stored"},this}buildForeignKeys(n,i){return this.foreignKeyConfigs.map(({ref:o,actions:c})=>{return Im((p,x)=>{let m=new Jv(()=>{let a=p();return{columns:[n],foreignColumns:[a]}});if(x.onUpdate)m.onUpdate(x.onUpdate);if(x.onDelete)m.onDelete(x.onDelete);return m.build(i)},o,c)})}buildExtraConfigColumn(n){return new zJ(n,this.config)}}class V extends Un{constructor(n,i){if(!i.uniqueName)i.uniqueName=GJ(n,[i.name]);super(n,i);this.table=n}static[F]="PgColumn"}class zJ extends V{static[F]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(n){return this.indexConfig.opClass=n,this}}class Yx{static[F]="IndexedColumn";constructor(n,i,o,c){this.name=n,this.keyAsName=i,this.type=o,this.indexConfig=c}name;keyAsName;type;indexConfig}class QJ extends h{static[F]="PgArrayBuilder";constructor(n,i,o){super(n,"array","PgArray");this.config.baseBuilder=i,this.config.size=o}build(n){let i=this.config.baseBuilder.build(n);return new Fv(n,this.config,i)}}class Fv extends V{constructor(n,i,o,c){super(n,i);this.baseColumn=o,this.range=c,this.size=i.size}size;static[F]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(n){if(typeof n==="string")n=HJ(n);return n.map((i)=>this.baseColumn.mapFromDriverValue(i))}mapToDriverValue(n,i=!1){let o=n.map((c)=>c===null?null:l(this.baseColumn,Fv)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return Av(o)}}var Tv=Symbol.for("drizzle:isPgEnum");function EJ(n){return!!n&&typeof n==="function"&&Tv in n&&n[Tv]===!0}class OJ extends h{static[F]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new UJ(n,this.config)}}class UJ extends V{static[F]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(n,i){super(n,i);this.enum=i.enum}getSQLType(){return this.enum.enumName}}function ym(n,i){return VX(n,i,void 0)}function VX(n,i,o){let c=Object.assign((p)=>new OJ(p??"",c),{enumName:n,enumValues:i,schema:o,[Tv]:!0});return c}class ci{static[F]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Hx extends ci{static[F]="WithSubquery"}var VJ="0.41.0";var Rv,Sv,Vn={startActiveSpan(n,i){if(!Rv)return i();if(!Sv)Sv=Rv.trace.getTracer("drizzle-orm",VJ);return Im((o,c)=>c.startActiveSpan(n,(p)=>{try{return i(p)}catch(x){throw p.setStatus({code:o.SpanStatusCode.ERROR,message:x instanceof Error?x.message:"Unknown error"}),x}finally{p.end()}}),Rv,Sv)}};var un=Symbol.for("drizzle:ViewBaseConfig");var km=Symbol.for("drizzle:Schema"),Zm=Symbol.for("drizzle:Columns"),_J=Symbol.for("drizzle:ExtraConfigColumns"),Xv=Symbol.for("drizzle:OriginalName"),Wv=Symbol.for("drizzle:BaseName"),zx=Symbol.for("drizzle:IsAlias"),bJ=Symbol.for("drizzle:ExtraConfigBuilder"),_X=Symbol.for("drizzle:IsDrizzleTable");class D{static[F]="Table";static Symbol={Name:fo,Schema:km,OriginalName:Xv,Columns:Zm,ExtraConfigColumns:_J,BaseName:Wv,IsAlias:zx,ExtraConfigBuilder:bJ};[fo];[Xv];[km];[Zm];[_J];[Wv];[zx]=!1;[_X]=!0;[bJ]=void 0;constructor(n,i,o){this[fo]=this[Xv]=n,this[km]=i,this[Wv]=o}}function mi(n){return n[fo]}function Ec(n){return`${n[km]??"public"}.${n[fo]}`}function Kv(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function bX(n){let i={sql:"",params:[]};for(let o of n)if(i.sql+=o.sql,i.params.push(...o.params),o.typings?.length){if(!i.typings)i.typings=[];i.typings.push(...o.typings)}return i}class pi{static[F]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new L([this])}}class L{constructor(n){this.queryChunks=n}static[F]="SQL";decoder=BJ;shouldInlineParams=!1;append(n){return this.queryChunks.push(...n.queryChunks),this}toQuery(n){return Vn.startActiveSpan("drizzle.buildSQL",(i)=>{let o=this.buildQueryFromSourceParams(this.queryChunks,n);return i?.setAttributes({"drizzle.query.text":o.sql,"drizzle.query.params":JSON.stringify(o.params)}),o})}buildQueryFromSourceParams(n,i){let o=Object.assign({},i,{inlineParams:i.inlineParams||this.shouldInlineParams,paramStartIndex:i.paramStartIndex||{value:0}}),{casing:c,escapeName:p,escapeParam:x,prepareTyping:m,inlineParams:a,paramStartIndex:f}=o;return bX(n.map((v)=>{if(l(v,pi))return{sql:v.value.join(""),params:[]};if(l(v,qm))return{sql:p(v.value),params:[]};if(v===void 0)return{sql:"",params:[]};if(Array.isArray(v)){let $=[new pi("(")];for(let[w,J]of v.entries())if($.push(J),w<v.length-1)$.push(new pi(", "));return $.push(new pi(")")),this.buildQueryFromSourceParams($,o)}if(l(v,L))return this.buildQueryFromSourceParams(v.queryChunks,{...o,inlineParams:a||v.shouldInlineParams});if(l(v,D)){let $=v[D.Symbol.Schema],w=v[D.Symbol.Name];return{sql:$===void 0||v[zx]?p(w):p($)+"."+p(w),params:[]}}if(l(v,Un)){let $=c.getColumnCasing(v);if(i.invokeSource==="indexes")return{sql:p($),params:[]};let w=v.table[D.Symbol.Schema];return{sql:v.table[zx]||w===void 0?p(v.table[D.Symbol.Name])+"."+p($):p(w)+"."+p(v.table[D.Symbol.Name])+"."+p($),params:[]}}if(l(v,bi)){let $=v[un].schema,w=v[un].name;return{sql:$===void 0||v[un].isAlias?p(w):p($)+"."+p(w),params:[]}}if(l(v,Li)){if(l(v.value,go))return{sql:x(f.value++,v),params:[v],typings:["none"]};let $=v.value===null?null:v.encoder.mapToDriverValue(v.value);if(l($,L))return this.buildQueryFromSourceParams([$],o);if(a)return{sql:this.mapInlineParam($,o),params:[]};let w=["none"];if(m)w=[m(v.encoder)];return{sql:x(f.value++,$),params:[$],typings:w}}if(l(v,go))return{sql:x(f.value++,v),params:[v],typings:["none"]};if(l(v,L.Aliased)&&v.fieldAlias!==void 0)return{sql:p(v.fieldAlias),params:[]};if(l(v,ci)){if(v._.isWith)return{sql:p(v._.alias),params:[]};return this.buildQueryFromSourceParams([new pi("("),v._.sql,new pi(") "),new qm(v._.alias)],o)}if(EJ(v)){if(v.schema)return{sql:p(v.schema)+"."+p(v.enumName),params:[]};return{sql:p(v.enumName),params:[]}}if(Kv(v)){if(v.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([v.getSQL()],o);return this.buildQueryFromSourceParams([new pi("("),v.getSQL(),new pi(")")],o)}if(a)return{sql:this.mapInlineParam(v,o),params:[]};return{sql:x(f.value++,v),params:[v],typings:["none"]}}))}mapInlineParam(n,{escapeString:i}){if(n===null)return"null";if(typeof n==="number"||typeof n==="boolean")return n.toString();if(typeof n==="string")return i(n);if(typeof n==="object"){let o=n.toString();if(o==="[object Object]")return i(JSON.stringify(n));return i(o)}throw new Error("Unexpected param value: "+n)}getSQL(){return this}as(n){if(n===void 0)return this;return new L.Aliased(this,n)}mapWith(n){return this.decoder=typeof n==="function"?{mapFromDriverValue:n}:n,this}inlineParams(){return this.shouldInlineParams=!0,this}if(n){return n?this:void 0}}class qm{constructor(n){this.value=n}static[F]="Name";brand;getSQL(){return new L([this])}}function uJ(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var BJ={mapFromDriverValue:(n)=>n},jJ={mapToDriverValue:(n)=>n},Pb={...BJ,...jJ};class Li{constructor(n,i=jJ){this.value=n,this.encoder=i}static[F]="Param";brand;getSQL(){return new L([this])}}function T(n,...i){let o=[];if(i.length>0||n.length>0&&n[0]!=="")o.push(new pi(n[0]));for(let[c,p]of i.entries())o.push(p,new pi(n[c+1]));return new L(o)}((n)=>{function i(){return new L([])}n.empty=i;function o(f){return new L(f)}n.fromList=o;function c(f){return new L([new pi(f)])}n.raw=c;function p(f,v){let $=[];for(let[w,J]of f.entries()){if(w>0&&v!==void 0)$.push(v);$.push(J)}return new L($)}n.join=p;function x(f){return new qm(f)}n.identifier=x;function m(f){return new go(f)}n.placeholder=m;function a(f,v){return new Li(f,v)}n.param=a})(T||(T={}));((n)=>{class i{constructor(o,c){this.sql=o,this.fieldAlias=c}static[F]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}}n.Aliased=i})(L||(L={}));class go{constructor(n){this.name=n}static[F]="Placeholder";getSQL(){return new L([this])}}function lv(n,i){return n.map((o)=>{if(l(o,go)){if(!(o.name in i))throw new Error(`No value for placeholder "${o.name}" was provided`);return i[o.name]}if(l(o,Li)&&l(o.value,go)){if(!(o.value.name in i))throw new Error(`No value for placeholder "${o.value.name}" was provided`);return o.encoder.mapToDriverValue(i[o.value.name])}return o})}var uX=Symbol.for("drizzle:IsDrizzleView");class bi{static[F]="View";[un];[uX]=!0;constructor({name:n,schema:i,selectedFields:o,query:c}){this[un]={name:n,originalName:n,schema:i,selectedFields:o,query:c,isExisting:!c,isAlias:!1}}getSQL(){return new L([this])}}Un.prototype.getSQL=function(){return new L([this])};D.prototype.getSQL=function(){return new L([this])};ci.prototype.getSQL=function(){return new L([this])};class Sp{constructor(n){this.table=n}static[F]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class Qx{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[F]="TableAliasProxyHandler";get(n,i){if(i===D.Symbol.IsAlias)return!0;if(i===D.Symbol.Name)return this.alias;if(this.replaceOriginalName&&i===D.Symbol.OriginalName)return this.alias;if(i===un)return{...n[un],name:this.alias,isAlias:!0};if(i===D.Symbol.Columns){let c=n[D.Symbol.Columns];if(!c)return c;let p={};return Object.keys(c).map((x)=>{p[x]=new Proxy(c[x],new Sp(new Proxy(n,this)))}),p}let o=n[i];if(l(o,Un))return new Proxy(o,new Sp(new Proxy(n,this)));return o}}function sm(n,i){return new Proxy(n,new Qx(i,!1))}function Mo(n,i){return new Proxy(n,new Sp(new Proxy(n.table,new Qx(i,!1))))}function Gv(n,i){return new L.Aliased(Ex(n.sql,i),n.fieldAlias)}function Ex(n,i){return T.join(n.queryChunks.map((o)=>{if(l(o,Un))return Mo(o,i);if(l(o,L))return Ex(o,i);if(l(o,L.Aliased))return Gv(o,i);return o}))}class Pm extends Error{static[F]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class Mv extends Pm{static[F]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function ui(n,i){if(uJ(i)&&!Kv(n)&&!l(n,Li)&&!l(n,go)&&!l(n,Un)&&!l(n,D)&&!l(n,bi))return new Li(n,i);return n}var Yo=(n,i)=>{return T`${n} = ${ui(i,n)}`},DJ=(n,i)=>{return T`${n} <> ${ui(i,n)}`};function Oc(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new L(i);return new L([new pi("("),T.join(i,new pi(" and ")),new pi(")")])}function LJ(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new L(i);return new L([new pi("("),T.join(i,new pi(" or ")),new pi(")")])}function NJ(n){return T`not ${n}`}var tm=(n,i)=>{return T`${n} > ${ui(i,n)}`},hJ=(n,i)=>{return T`${n} >= ${ui(i,n)}`},CJ=(n,i)=>{return T`${n} < ${ui(i,n)}`},IJ=(n,i)=>{return T`${n} <= ${ui(i,n)}`};function yJ(n,i){if(Array.isArray(i)){if(i.length===0)return T`false`;return T`${n} in ${i.map((o)=>ui(o,n))}`}return T`${n} in ${ui(i,n)}`}function kJ(n,i){if(Array.isArray(i)){if(i.length===0)return T`true`;return T`${n} not in ${i.map((o)=>ui(o,n))}`}return T`${n} not in ${ui(i,n)}`}function ZJ(n){return T`${n} is null`}function qJ(n){return T`${n} is not null`}function sJ(n){return T`exists ${n}`}function PJ(n){return T`not exists ${n}`}function tJ(n,i,o){return T`${n} between ${ui(i,n)} and ${ui(o,n)}`}function rJ(n,i,o){return T`${n} not between ${ui(i,n)} and ${ui(o,n)}`}function dJ(n,i){return T`${n} like ${i}`}function gJ(n,i){return T`${n} not like ${i}`}function eJ(n,i){return T`${n} ilike ${i}`}function nA(n,i){return T`${n} not ilike ${i}`}function iA(n){return T`${n} asc`}function oA(n){return T`${n} desc`}class cA{static[F]="ConsoleLogWriter";write(n){console.log(n)}}class Yv{static[F]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new cA}logQuery(n,i){let o=i.map((p)=>{try{return JSON.stringify(p)}catch{return String(p)}}),c=o.length?` -- params: [${o.join(", ")}]`:"";this.writer.write(`Query: ${n}${c}`)}}class Hv{static[F]="NoopLogger";logQuery(){}}class Qi{static[F]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}then(n,i){return this.execute().then(n,i)}}function pA(n,i,o){let c={},p=n.reduce((x,{path:m,field:a},f)=>{let v;if(l(a,Un))v=a;else if(l(a,L))v=a.decoder;else v=a.sql.decoder;let $=x;for(let[w,J]of m.entries())if(w<m.length-1){if(!(J in $))$[J]={};$=$[J]}else{let S=i[f],X=$[J]=S===null?null:v.mapFromDriverValue(S);if(o&&l(a,Un)&&m.length===2){let R=m[0];if(!(R in c))c[R]=X===null?mi(a.table):!1;else if(typeof c[R]==="string"&&c[R]!==mi(a.table))c[R]=!1}}return x},{});if(o&&Object.keys(c).length>0){for(let[x,m]of Object.entries(c))if(typeof m==="string"&&!o[m])p[x]=null}return p}function di(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let x=i?[...i,c]:[c];if(l(p,Un)||l(p,L)||l(p,L.Aliased))o.push({path:x,field:p});else if(l(p,D))o.push(...di(p[D.Symbol.Columns],x));else o.push(...di(p,x));return o},[])}function Ox(n,i){let o=Object.keys(n),c=Object.keys(i);if(o.length!==c.length)return!1;for(let[p,x]of o.entries())if(x!==c[p])return!1;return!0}function rm(n,i){let o=Object.entries(i).filter(([,c])=>c!==void 0).map(([c,p])=>{if(l(p,L)||l(p,Un))return[c,p];else return[c,new Li(p,n[D.Symbol.Columns][c])]});if(o.length===0)throw new Error("No values to set");return Object.fromEntries(o)}function xA(n,i){for(let o of i)for(let c of Object.getOwnPropertyNames(o.prototype)){if(c==="constructor")continue;Object.defineProperty(n.prototype,c,Object.getOwnPropertyDescriptor(o.prototype,c)||Object.create(null))}}function mA(n){return n[D.Symbol.Columns]}function _o(n){return l(n,ci)?n._.alias:l(n,bi)?n[un].name:l(n,L)?void 0:n[D.Symbol.IsAlias]?n[D.Symbol.Name]:n[D.Symbol.BaseName]}function Jn(n,i){return{name:typeof n==="string"&&n.length>0?n:"",config:typeof n==="object"?n:i}}function aA(n){if(typeof n!=="object"||n===null)return!1;if(n.constructor.name!=="Object")return!1;if("logger"in n){let i=typeof n.logger;if(i!=="boolean"&&(i!=="object"||typeof n.logger.logQuery!=="function")&&i!=="undefined")return!1;return!0}if("schema"in n){let i=typeof n.schema;if(i!=="object"&&i!=="undefined")return!1;return!0}if("casing"in n){let i=typeof n.casing;if(i!=="string"&&i!=="undefined")return!1;return!0}if("mode"in n){if(n.mode!=="default"||n.mode!=="planetscale"||n.mode!==void 0)return!1;return!0}if("connection"in n){let i=typeof n.connection;if(i!=="string"&&i!=="object"&&i!=="undefined")return!1;return!0}if("client"in n){let i=typeof n.client;if(i!=="object"&&i!=="function"&&i!=="undefined")return!1;return!0}if(Object.keys(n).length===0)return!0;return!1}class eo extends h{static[F]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"always",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(n){if(n){let{name:i,...o}=n;this.config.generatedIdentity={type:"byDefault",sequenceName:i,sequenceOptions:o}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}class fA extends eo{static[F]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new vA(n,this.config)}}class vA extends V{static[F]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class $A extends eo{static[F]="PgBigInt64Builder";constructor(n){super(n,"bigint","PgBigInt64")}build(n){return new wA(n,this.config)}}class wA extends V{static[F]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function JA(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new fA(o);return new $A(o)}class AA extends h{static[F]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new FA(n,this.config)}}class FA extends V{static[F]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class TA extends h{static[F]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new RA(n,this.config)}}class RA extends V{static[F]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function SA(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new AA(o);return new TA(o)}class XA extends h{static[F]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new WA(n,this.config)}}class WA extends V{static[F]="PgBoolean";getSQLType(){return"boolean"}}function Ux(n){return new XA(n??"")}class KA extends h{static[F]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new lA(n,this.config)}}class lA extends V{static[F]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}function GA(n,i={}){let{name:o,config:c}=Jn(n,i);return new KA(o,c)}class MA extends h{static[F]="PgCidrBuilder";constructor(n){super(n,"string","PgCidr")}build(n){return new YA(n,this.config)}}class YA extends V{static[F]="PgCidr";getSQLType(){return"cidr"}}function HA(n){return new MA(n??"")}class zA extends h{static[F]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new QA(n,this.config)}}class QA extends V{static[F]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(n,i){super(n,i);this.sqlName=i.customTypeParams.dataType(i.fieldConfig),this.mapTo=i.customTypeParams.toDriver,this.mapFrom=i.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(n){return typeof this.mapFrom==="function"?this.mapFrom(n):n}mapToDriverValue(n){return typeof this.mapTo==="function"?this.mapTo(n):n}}function EA(n){return(i,o)=>{let{name:c,config:p}=Jn(i,o);return new zA(c,p,n)}}class bo extends h{static[F]="PgDateColumnBaseBuilder";defaultNow(){return this.default(T`now()`)}}class OA extends bo{static[F]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new dm(n,this.config)}}class dm extends V{static[F]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class UA extends bo{static[F]="PgDateStringBuilder";constructor(n){super(n,"string","PgDateString")}build(n){return new gm(n,this.config)}}class gm extends V{static[F]="PgDateString";getSQLType(){return"date"}}function VA(n,i){let{name:o,config:c}=Jn(n,i);if(c?.mode==="date")return new OA(o);return new UA(o)}class _A extends h{static[F]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new bA(n,this.config)}}class bA extends V{static[F]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function uA(n){return new _A(n??"")}class BA extends h{static[F]="PgInetBuilder";constructor(n){super(n,"string","PgInet")}build(n){return new jA(n,this.config)}}class jA extends V{static[F]="PgInet";getSQLType(){return"inet"}}function DA(n){return new BA(n??"")}class LA extends eo{static[F]="PgIntegerBuilder";constructor(n){super(n,"number","PgInteger")}build(n){return new NA(n,this.config)}}class NA extends V{static[F]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseInt(n);return n}}function em(n){return new LA(n??"")}class hA extends h{static[F]="PgIntervalBuilder";constructor(n,i){super(n,"string","PgInterval");this.config.intervalConfig=i}build(n){return new CA(n,this.config)}}class CA extends V{static[F]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let n=this.fields?` ${this.fields}`:"",i=this.precision?`(${this.precision})`:"";return`interval${n}${i}`}}function IA(n,i={}){let{name:o,config:c}=Jn(n,i);return new hA(o,c)}class yA extends h{static[F]="PgJsonBuilder";constructor(n){super(n,"json","PgJson")}build(n){return new na(n,this.config)}}class na extends V{static[F]="PgJson";constructor(n,i){super(n,i)}getSQLType(){return"json"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function kA(n){return new yA(n??"")}class ZA extends h{static[F]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new ia(n,this.config)}}class ia extends V{static[F]="PgJsonb";constructor(n,i){super(n,i)}getSQLType(){return"jsonb"}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){if(typeof n==="string")try{return JSON.parse(n)}catch{return n}return n}}function qA(n){return new ZA(n??"")}class sA extends h{static[F]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new PA(n,this.config)}}class PA extends V{static[F]="PgLine";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o),Number.parseFloat(c)]}mapToDriverValue(n){return`{${n[0]},${n[1]},${n[2]}}`}}class tA extends h{static[F]="PgLineABCBuilder";constructor(n){super(n,"json","PgLineABC")}build(n){return new rA(n,this.config)}}class rA extends V{static[F]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(n){let[i,o,c]=n.slice(1,-1).split(",");return{a:Number.parseFloat(i),b:Number.parseFloat(o),c:Number.parseFloat(c)}}mapToDriverValue(n){return`{${n.a},${n.b},${n.c}}`}}function dA(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new sA(o);return new tA(o)}class gA extends h{static[F]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new eA(n,this.config)}}class eA extends V{static[F]="PgMacaddr";getSQLType(){return"macaddr"}}function nF(n){return new gA(n??"")}class iF extends h{static[F]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new oF(n,this.config)}}class oF extends V{static[F]="PgMacaddr8";getSQLType(){return"macaddr8"}}function cF(n){return new iF(n??"")}class pF extends h{static[F]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new oa(n,this.config)}}class oa extends V{static[F]="PgNumeric";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}mapFromDriverValue(n){if(typeof n==="string")return n;return String(n)}getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}class xF extends h{static[F]="PgNumericNumberBuilder";constructor(n,i,o){super(n,"number","PgNumericNumber");this.config.precision=i,this.config.scale=o}build(n){return new mF(n,this.config)}}class mF extends V{static[F]="PgNumericNumber";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}mapToDriverValue=String;getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}class aF extends h{static[F]="PgNumericBigIntBuilder";constructor(n,i,o){super(n,"bigint","PgNumericBigInt");this.config.precision=i,this.config.scale=o}build(n){return new fF(n,this.config)}}class fF extends V{static[F]="PgNumericBigInt";precision;scale;constructor(n,i){super(n,i);this.precision=i.precision,this.scale=i.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}}function vF(n,i){let{name:o,config:c}=Jn(n,i),p=c?.mode;return p==="number"?new xF(o,c?.precision,c?.scale):p==="bigint"?new aF(o,c?.precision,c?.scale):new pF(o,c?.precision,c?.scale)}class $F extends h{static[F]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new wF(n,this.config)}}class wF extends V{static[F]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return[Number.parseFloat(i),Number.parseFloat(o)]}return[n.x,n.y]}mapToDriverValue(n){return`(${n[0]},${n[1]})`}}class JF extends h{static[F]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new AF(n,this.config)}}class AF extends V{static[F]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(n){if(typeof n==="string"){let[i,o]=n.slice(1,-1).split(",");return{x:Number.parseFloat(i),y:Number.parseFloat(o)}}return n}mapToDriverValue(n){return`(${n.x},${n.y})`}}function FF(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new $F(o);return new JF(o)}function BX(n){let i=[];for(let o=0;o<n.length;o+=2)i.push(Number.parseInt(n.slice(o,o+2),16));return new Uint8Array(i)}function TF(n,i){let o=new ArrayBuffer(8),c=new DataView(o);for(let p=0;p<8;p++)c.setUint8(p,n[i+p]);return c.getFloat64(0,!0)}function zv(n){let i=BX(n),o=0,c=i[o];o+=1;let p=new DataView(i.buffer),x=p.getUint32(o,c===1);o+=4;let m;if(x&536870912)m=p.getUint32(o,c===1),o+=4;if((x&65535)===1){let a=TF(i,o);o+=8;let f=TF(i,o);return o+=8,[a,f]}throw new Error("Unsupported geometry type")}class RF extends h{static[F]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new SF(n,this.config)}}class SF extends V{static[F]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return zv(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class XF extends h{static[F]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new WF(n,this.config)}}class WF extends V{static[F]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=zv(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function KF(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new RF(o);return new XF(o)}class lF extends h{static[F]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new GF(n,this.config)}}class GF extends V{static[F]="PgReal";constructor(n,i){super(n,i)}getSQLType(){return"real"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number.parseFloat(n);return n}}function MF(n){return new lF(n??"")}class YF extends h{static[F]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new HF(n,this.config)}}class HF extends V{static[F]="PgSerial";getSQLType(){return"serial"}}function zF(n){return new YF(n??"")}class QF extends eo{static[F]="PgSmallIntBuilder";constructor(n){super(n,"number","PgSmallInt")}build(n){return new EF(n,this.config)}}class EF extends V{static[F]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number(n);return n}}function OF(n){return new QF(n??"")}class UF extends h{static[F]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new VF(n,this.config)}}class VF extends V{static[F]="PgSmallSerial";getSQLType(){return"smallserial"}}function _F(n){return new UF(n??"")}class bF extends h{static[F]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new uF(n,this.config)}}class uF extends V{static[F]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function BF(n,i={}){let{name:o,config:c}=Jn(n,i);return new bF(o,c)}class jF extends bo{constructor(n,i,o){super(n,"string","PgTime");this.withTimezone=i,this.precision=o,this.config.withTimezone=i,this.config.precision=o}static[F]="PgTimeBuilder";build(n){return new ca(n,this.config)}}class ca extends V{static[F]="PgTime";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function DF(n,i={}){let{name:o,config:c}=Jn(n,i);return new jF(o,c.withTimezone??!1,c.precision)}class LF extends bo{static[F]="PgTimestampBuilder";constructor(n,i,o){super(n,"date","PgTimestamp");this.config.withTimezone=i,this.config.precision=o}build(n){return new pa(n,this.config)}}class pa extends V{static[F]="PgTimestamp";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue=(n)=>{return new Date(this.withTimezone?n:n+"+0000")};mapToDriverValue=(n)=>{return n.toISOString()}}class NF extends bo{static[F]="PgTimestampStringBuilder";constructor(n,i,o){super(n,"string","PgTimestampString");this.config.withTimezone=i,this.config.precision=o}build(n){return new xa(n,this.config)}}class xa extends V{static[F]="PgTimestampString";withTimezone;precision;constructor(n,i){super(n,i);this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}function vo(n,i={}){let{name:o,config:c}=Jn(n,i);if(c?.mode==="string")return new NF(o,c.withTimezone??!1,c.precision);return new LF(o,c?.withTimezone??!1,c?.precision)}class hF extends h{static[F]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(T`gen_random_uuid()`)}build(n){return new ma(n,this.config)}}class ma extends V{static[F]="PgUUID";getSQLType(){return"uuid"}}function Ni(n){return new hF(n??"")}class CF extends h{static[F]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new IF(n,this.config)}}class IF extends V{static[F]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}function Ji(n,i={}){let{name:o,config:c}=Jn(n,i);return new CF(o,c)}class yF extends h{static[F]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new kF(n,this.config)}}class kF extends V{static[F]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function ZF(n,i){let{name:o,config:c}=Jn(n,i);return new yF(o,c)}class qF extends h{static[F]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new sF(n,this.config)}}class sF extends V{static[F]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function PF(n,i){let{name:o,config:c}=Jn(n,i);return new qF(o,c)}class tF extends h{static[F]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new rF(n,this.config)}}class rF extends V{static[F]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function dF(n,i){let{name:o,config:c}=Jn(n,i);return new tF(o,c)}class gF extends h{static[F]="PgVectorBuilder";constructor(n,i){super(n,"array","PgVector");this.config.dimensions=i.dimensions}build(n){return new eF(n,this.config)}}class eF extends V{static[F]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(n){return JSON.stringify(n)}mapFromDriverValue(n){return n.slice(1,-1).split(",").map((i)=>Number.parseFloat(i))}}function nT(n,i){let{name:o,config:c}=Jn(n,i);return new gF(o,c)}function iT(){return{bigint:JA,bigserial:SA,boolean:Ux,char:GA,cidr:HA,customType:EA,date:VA,doublePrecision:uA,inet:DA,integer:em,interval:IA,json:kA,jsonb:qA,line:dA,macaddr:nF,macaddr8:cF,numeric:vF,point:FF,geometry:KF,real:MF,serial:zF,smallint:OF,smallserial:_F,text:BF,time:DF,timestamp:vo,uuid:Ni,varchar:Ji,bit:ZF,halfvec:PF,sparsevec:dF,vector:nT}}var Qv=Symbol.for("drizzle:PgInlineForeignKeys"),oT=Symbol.for("drizzle:EnableRLS");class Ai extends D{static[F]="PgTable";static Symbol=Object.assign({},D.Symbol,{InlineForeignKeys:Qv,EnableRLS:oT});[Qv]=[];[oT]=!1;[D.Symbol.ExtraConfigBuilder]=void 0;[D.Symbol.ExtraConfigColumns]={}}function jX(n,i,o,c,p=n){let x=new Ai(n,c,p),m=typeof i==="function"?i(iT()):i,a=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let S=J.build(x);return x[Qv].push(...J.buildForeignKeys(S,x)),[$,S]})),f=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let S=J.buildExtraConfigColumn(x);return[$,S]})),v=Object.assign(x,a);if(v[D.Symbol.Columns]=a,v[D.Symbol.ExtraConfigColumns]=f,o)v[Ai.Symbol.ExtraConfigBuilder]=o;return Object.assign(v,{enableRLS:()=>{return v[Ai.Symbol.EnableRLS]=!0,v}})}var nc=(n,i,o)=>{return jX(n,i,o,void 0)};function cT(...n){if(n[0].columns)return new Vx(n[0].columns,n[0].name);return new Vx(n)}class Vx{static[F]="PgPrimaryKeyBuilder";columns;name;constructor(n,i){this.columns=n,this.name=i}build(n){return new pT(n,this.columns,this.name)}}class pT{constructor(n,i,o){this.table=n,this.columns=i,this.name=o}static[F]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[Ai.Symbol.Name]}_${this.columns.map((n)=>n.name).join("_")}_pk`}}class Ev{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[D.Symbol.Name]}static[F]="Relation";referencedTableName;fieldName}class xT{constructor(n,i){this.table=n,this.config=i}static[F]="Relations"}class ic extends Ev{constructor(n,i,o,c){super(n,i,o?.relationName);this.config=o,this.isNullable=c}static[F]="One";withFieldName(n){let i=new ic(this.sourceTable,this.referencedTable,this.config,this.isNullable);return i.fieldName=n,i}}class _x extends Ev{constructor(n,i,o){super(n,i,o?.relationName);this.config=o}static[F]="Many";withFieldName(n){let i=new _x(this.sourceTable,this.referencedTable,this.config);return i.fieldName=n,i}}function mT(){return{and:Oc,between:tJ,eq:Yo,exists:sJ,gt:tm,gte:hJ,ilike:eJ,inArray:yJ,isNull:ZJ,isNotNull:qJ,like:dJ,lt:CJ,lte:IJ,ne:DJ,not:NJ,notBetween:rJ,notExists:PJ,notLike:gJ,notIlike:nA,notInArray:kJ,or:LJ,sql:T}}function aT(){return{sql:T,asc:iA,desc:oA}}function fT(n,i){if(Object.keys(n).length===1&&"default"in n&&!l(n.default,D))n=n.default;let o={},c={},p={};for(let[x,m]of Object.entries(n))if(l(m,D)){let a=Ec(m),f=c[a];o[a]=x,p[x]={tsName:x,dbName:m[D.Symbol.Name],schema:m[D.Symbol.Schema],columns:m[D.Symbol.Columns],relations:f?.relations??{},primaryKey:f?.primaryKey??[]};for(let $ of Object.values(m[D.Symbol.Columns]))if($.primary)p[x].primaryKey.push($);let v=m[D.Symbol.ExtraConfigBuilder]?.(m[D.Symbol.ExtraConfigColumns]);if(v){for(let $ of Object.values(v))if(l($,Vx))p[x].primaryKey.push(...$.columns)}}else if(l(m,xT)){let a=Ec(m.table),f=o[a],v=m.config(i(m.table)),$;for(let[w,J]of Object.entries(v))if(f){let S=p[f];if(S.relations[w]=J,$)S.primaryKey.push(...$)}else{if(!(a in c))c[a]={relations:{},primaryKey:$};c[a].relations[w]=J}}return{tables:p,tableNamesMap:o}}function DX(n){return function i(o,c){return new ic(n,o,c,c?.fields.reduce((p,x)=>p&&x.notNull,!0)??!1)}}function LX(n){return function i(o,c){return new _x(n,o,c)}}function vT(n,i,o){if(l(o,ic)&&o.config)return{fields:o.config.fields,references:o.config.references};let c=i[Ec(o.referencedTable)];if(!c)throw new Error(`Table "${o.referencedTable[D.Symbol.Name]}" not found in schema`);let p=n[c];if(!p)throw new Error(`Table "${c}" not found in schema`);let x=o.sourceTable,m=i[Ec(x)];if(!m)throw new Error(`Table "${x[D.Symbol.Name]}" not found in schema`);let a=[];for(let f of Object.values(p.relations))if(o.relationName&&o!==f&&f.relationName===o.relationName||!o.relationName&&f.referencedTable===o.sourceTable)a.push(f);if(a.length>1)throw o.relationName?new Error(`There are multiple relations with name "${o.relationName}" in table "${c}"`):new Error(`There are multiple relations between "${c}" and "${o.sourceTable[D.Symbol.Name]}". Please specify relation name`);if(a[0]&&l(a[0],ic)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${m}.${o.fieldName}"`)}function $T(n){return{one:DX(n),many:LX(n)}}function aa(n,i,o,c,p=(x)=>x){let x={};for(let[m,a]of c.entries())if(a.isJson){let f=i.relations[a.tsKey],v=o[m],$=typeof v==="string"?JSON.parse(v):v;x[a.tsKey]=l(f,ic)?$&&aa(n,n[a.relationTableTsKey],$,a.selection,p):$.map((w)=>aa(n,n[a.relationTableTsKey],w,a.selection,p))}else{let f=p(o[m]),v=a.field,$;if(l(v,Un))$=v;else if(l(v,L))$=v.decoder;else $=v.sql.decoder;x[a.tsKey]=f===null?null:$.mapFromDriverValue(f)}return x}var g6=wf(d6(),1),{Server:e6,Namespace:tL,Socket:rL}=g6.default;import{readFileSync as FR}from"node:fs";import{resolve as E$}from"node:path";function u9(n,i){let o={},c=[];for(let p in n){let x=n[p],m=i[p],a=x["~standard"].validate(m);if(a instanceof Promise)throw new Error(`Validation must be synchronous, but ${p} returned a Promise.`);if(a.issues){c.push(...a.issues.map((f)=>({...f,path:[p,...f.path??[]]})));continue}o[p]=a.value}if(c.length)return{issues:c};return{value:o}}function nR(n){let i=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1){for(let[Y,I]of Object.entries(i))if(I==="")delete i[Y]}if(!!n.skipValidation)return i;let p=typeof n.client==="object"?n.client:{},x=typeof n.server==="object"?n.server:{},m=typeof n.shared==="object"?n.shared:{},a=n.isServer??(typeof window==="undefined"||("Deno"in window)),f=a?{...x,...m,...p}:{...p,...m},v=u9(f,i),$=n.onValidationError??((Y)=>{throw console.error("\u274C Invalid environment variables:",Y),new Error("Invalid environment variables")}),w=n.onInvalidAccess??(()=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(v.issues)return $(v.issues);let J=(Y)=>{if(!n.clientPrefix)return!0;return!Y.startsWith(n.clientPrefix)&&!(Y in m)},S=(Y)=>{return a||!J(Y)},X=(Y)=>{return Y==="__esModule"||Y==="$$typeof"},R=(n.extends??[]).reduce((Y,I)=>{return Object.assign(Y,I)},{}),K=Object.assign(v.value,R);return new Proxy(K,{get(Y,I){if(typeof I!=="string")return;if(X(I))return;if(!S(I))return w(I);return Reflect.get(Y,I)}})}var Fn;(function(n){n.assertEqual=(p)=>p;function i(p){}n.assertIs=i;function o(p){throw new Error}n.assertNever=o,n.arrayToEnum=(p)=>{let x={};for(let m of p)x[m]=m;return x},n.getValidEnumValues=(p)=>{let x=n.objectKeys(p).filter((a)=>typeof p[p[a]]!=="number"),m={};for(let a of x)m[a]=p[a];return n.objectValues(m)},n.objectValues=(p)=>{return n.objectKeys(p).map(function(x){return p[x]})},n.objectKeys=typeof Object.keys==="function"?(p)=>Object.keys(p):(p)=>{let x=[];for(let m in p)if(Object.prototype.hasOwnProperty.call(p,m))x.push(m);return x},n.find=(p,x)=>{for(let m of p)if(x(m))return m;return},n.isInteger=typeof Number.isInteger==="function"?(p)=>Number.isInteger(p):(p)=>typeof p==="number"&&isFinite(p)&&Math.floor(p)===p;function c(p,x=" | "){return p.map((m)=>typeof m==="string"?`'${m}'`:m).join(x)}n.joinValues=c,n.jsonStringifyReplacer=(p,x)=>{if(typeof x==="bigint")return x.toString();return x}})(Fn||(Fn={}));var Y$;(function(n){n.mergeShapes=(i,o)=>{return{...i,...o}}})(Y$||(Y$={}));var N=Fn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Lo=(n)=>{switch(typeof n){case"undefined":return N.undefined;case"string":return N.string;case"number":return isNaN(n)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":if(Array.isArray(n))return N.array;if(n===null)return N.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return N.promise;if(typeof Map!=="undefined"&&n instanceof Map)return N.map;if(typeof Set!=="undefined"&&n instanceof Set)return N.set;if(typeof Date!=="undefined"&&n instanceof Date)return N.date;return N.object;default:return N.unknown}},U=Fn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),B9=(n)=>{return JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:")};class yi extends Error{get errors(){return this.issues}constructor(n){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let i=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,i);else this.__proto__=i;this.name="ZodError",this.issues=n}format(n){let i=n||function(p){return p.message},o={_errors:[]},c=(p)=>{for(let x of p.issues)if(x.code==="invalid_union")x.unionErrors.map(c);else if(x.code==="invalid_return_type")c(x.returnTypeError);else if(x.code==="invalid_arguments")c(x.argumentsError);else if(x.path.length===0)o._errors.push(i(x));else{let m=o,a=0;while(a<x.path.length){let f=x.path[a];if(a!==x.path.length-1)m[f]=m[f]||{_errors:[]};else m[f]=m[f]||{_errors:[]},m[f]._errors.push(i(x));m=m[f],a++}}};return c(this),o}static assert(n){if(!(n instanceof yi))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=(i)=>i.message){let i={},o=[];for(let c of this.issues)if(c.path.length>0)i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(n(c));else o.push(n(c));return{formErrors:o,fieldErrors:i}}get formErrors(){return this.flatten()}}yi.create=(n)=>{return new yi(n)};var Bp=(n,i)=>{let o;switch(n.code){case U.invalid_type:if(n.received===N.undefined)o="Required";else o=`Expected ${n.expected}, received ${n.received}`;break;case U.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(n.expected,Fn.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:o=`Unrecognized key(s) in object: ${Fn.joinValues(n.keys,", ")}`;break;case U.invalid_union:o="Invalid input";break;case U.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Fn.joinValues(n.options)}`;break;case U.invalid_enum_value:o=`Invalid enum value. Expected ${Fn.joinValues(n.options)}, received '${n.received}'`;break;case U.invalid_arguments:o="Invalid function arguments";break;case U.invalid_return_type:o="Invalid function return type";break;case U.invalid_date:o="Invalid date";break;case U.invalid_string:if(typeof n.validation==="object")if("includes"in n.validation){if(o=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${n.validation.position}`}else if("startsWith"in n.validation)o=`Invalid input: must start with "${n.validation.startsWith}"`;else if("endsWith"in n.validation)o=`Invalid input: must end with "${n.validation.endsWith}"`;else Fn.assertNever(n.validation);else if(n.validation!=="regex")o=`Invalid ${n.validation}`;else o="Invalid";break;case U.too_small:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`;else o="Invalid input";break;case U.too_big:if(n.type==="array")o=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`;else if(n.type==="string")o=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`;else if(n.type==="number")o=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="bigint")o=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="date")o=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`;else o="Invalid input";break;case U.custom:o="Invalid input";break;case U.invalid_intersection_types:o="Intersection results could not be merged";break;case U.not_multiple_of:o=`Number must be a multiple of ${n.multipleOf}`;break;case U.not_finite:o="Number must be finite";break;default:o=i.defaultError,Fn.assertNever(n)}return{message:o}},pR=Bp;function j9(n){pR=n}function ua(){return pR}var Ba=(n)=>{let{data:i,path:o,errorMaps:c,issueData:p}=n,x=[...o,...p.path||[]],m={...p,path:x};if(p.message!==void 0)return{...p,path:x,message:p.message};let a="",f=c.filter((v)=>!!v).slice().reverse();for(let v of f)a=v(m,{data:i,defaultError:a}).message;return{...p,path:x,message:a}},D9=[];function B(n,i){let o=ua(),c=Ba({issueData:i,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,o,o===Bp?void 0:Bp].filter((p)=>!!p)});n.common.issues.push(c)}class Yi{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(n,i){let o=[];for(let c of i){if(c.status==="aborted")return d;if(c.status==="dirty")n.dirty();o.push(c.value)}return{status:n.value,value:o}}static async mergeObjectAsync(n,i){let o=[];for(let c of i){let p=await c.key,x=await c.value;o.push({key:p,value:x})}return Yi.mergeObjectSync(n,o)}static mergeObjectSync(n,i){let o={};for(let c of i){let{key:p,value:x}=c;if(p.status==="aborted")return d;if(x.status==="aborted")return d;if(p.status==="dirty")n.dirty();if(x.status==="dirty")n.dirty();if(p.value!=="__proto__"&&(typeof x.value!=="undefined"||c.alwaysSet))o[p.value]=x.value}return{status:n.value,value:o}}}var d=Object.freeze({status:"aborted"}),bp=(n)=>({status:"dirty",value:n}),Oi=(n)=>({status:"valid",value:n}),H$=(n)=>n.status==="aborted",z$=(n)=>n.status==="dirty",Lc=(n)=>n.status==="valid",Ix=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function ja(n,i,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(n):c?c.value:i.get(n)}function xR(n,i,o,c,p){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?n!==i||!p:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?p.call(n,o):p?p.value=o:i.set(n,o),o}var k;(function(n){n.errToObj=(i)=>typeof i==="string"?{message:i}:i||{},n.toString=(i)=>typeof i==="string"?i:i===null||i===void 0?void 0:i.message})(k||(k={}));var hx,Cx;class Ro{constructor(n,i,o,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=o,this._key=c}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var iR=(n,i)=>{if(Lc(i))return{success:!0,data:i.value};else{if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new yi(n.common.issues);return this._error=o,this._error}}}};function cn(n){if(!n)return{};let{errorMap:i,invalid_type_error:o,required_error:c,description:p}=n;if(i&&(o||c))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(i)return{errorMap:i,description:p};return{errorMap:(m,a)=>{var f,v;let{message:$}=n;if(m.code==="invalid_enum_value")return{message:$!==null&&$!==void 0?$:a.defaultError};if(typeof a.data==="undefined")return{message:(f=$!==null&&$!==void 0?$:c)!==null&&f!==void 0?f:a.defaultError};if(m.code!=="invalid_type")return{message:a.defaultError};return{message:(v=$!==null&&$!==void 0?$:o)!==null&&v!==void 0?v:a.defaultError}},description:p}}class pn{get description(){return this._def.description}_getType(n){return Lo(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:Lo(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Yi,ctx:{common:n.parent.common,data:n.data,parsedType:Lo(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(Ix(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){let i=this._parse(n);return Promise.resolve(i)}parse(n,i){let o=this.safeParse(n,i);if(o.success)return o.data;throw o.error}safeParse(n,i){var o;let c={common:{issues:[],async:(o=i===null||i===void 0?void 0:i.async)!==null&&o!==void 0?o:!1,contextualErrorMap:i===null||i===void 0?void 0:i.errorMap},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Lo(n)},p=this._parseSync({data:n,path:c.path,parent:c});return iR(c,p)}"~validate"(n){var i,o;let c={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Lo(n)};if(!this["~standard"].async)try{let p=this._parseSync({data:n,path:[],parent:c});return Lc(p)?{value:p.value}:{issues:c.common.issues}}catch(p){if((o=(i=p===null||p===void 0?void 0:p.message)===null||i===void 0?void 0:i.toLowerCase())===null||o===void 0?void 0:o.includes("encountered"))this["~standard"].async=!0;c.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:c}).then((p)=>Lc(p)?{value:p.value}:{issues:c.common.issues})}async parseAsync(n,i){let o=await this.safeParseAsync(n,i);if(o.success)return o.data;throw o.error}async safeParseAsync(n,i){let o={common:{issues:[],contextualErrorMap:i===null||i===void 0?void 0:i.errorMap,async:!0},path:(i===null||i===void 0?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Lo(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(Ix(c)?c:Promise.resolve(c));return iR(o,p)}refine(n,i){let o=(c)=>{if(typeof i==="string"||typeof i==="undefined")return{message:i};else if(typeof i==="function")return i(c);else return i};return this._refinement((c,p)=>{let x=n(c),m=()=>p.addIssue({code:U.custom,...o(c)});if(typeof Promise!=="undefined"&&x instanceof Promise)return x.then((a)=>{if(!a)return m(),!1;else return!0});if(!x)return m(),!1;else return!0})}refinement(n,i){return this._refinement((o,c)=>{if(!n(o))return c.addIssue(typeof i==="function"?i(o,c):i),!1;else return!0})}_refinement(n){return new io({schema:this,typeName:r.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(i)=>this["~validate"](i)}}optional(){return To.create(this,this._def)}nullable(){return No.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fo.create(this)}promise(){return Ic.create(this,this._def)}or(n){return Np.create([this,n],this._def)}and(n){return hp.create(this,n,this._def)}transform(n){return new io({...cn(this._def),schema:this,typeName:r.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new kp({...cn(this._def),innerType:this,defaultValue:i,typeName:r.ZodDefault})}brand(){return new La({typeName:r.ZodBranded,type:this,...cn(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new Zp({...cn(this._def),innerType:this,catchValue:i,typeName:r.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return Px.create(this,n)}readonly(){return qp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var L9=/^c[^\s-]{8,}$/i,N9=/^[0-9a-z]+$/,h9=/^[0-9A-HJKMNP-TV-Z]{26}$/i,C9=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,I9=/^[a-z0-9_-]{21}$/i,y9=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,k9=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Z9=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,q9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",M$,s9=/^(?:(?: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])$/,P9=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,t9=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,r9=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,d9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,g9=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mR="((\\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])))",e9=new RegExp(`^${mR}$`);function aR(n){let i="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(n.precision)i=`${i}\\.\\d{${n.precision}}`;else if(n.precision==null)i=`${i}(\\.\\d+)?`;return i}function nG(n){return new RegExp(`^${aR(n)}$`)}function fR(n){let i=`${mR}T${aR(n)}`,o=[];if(o.push(n.local?"Z?":"Z"),n.offset)o.push("([+-]\\d{2}:?\\d{2})");return i=`${i}(${o.join("|")})`,new RegExp(`^${i}$`)}function iG(n,i){if((i==="v4"||!i)&&s9.test(n))return!0;if((i==="v6"||!i)&&t9.test(n))return!0;return!1}function oG(n,i){if(!y9.test(n))return!1;try{let[o]=n.split("."),c=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),p=JSON.parse(atob(c));if(typeof p!=="object"||p===null)return!1;if(!p.typ||!p.alg)return!1;if(i&&p.alg!==i)return!1;return!0}catch(o){return!1}}function cG(n,i){if((i==="v4"||!i)&&P9.test(n))return!0;if((i==="v6"||!i)&&r9.test(n))return!0;return!1}class Ao extends pn{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==N.string){let p=this._getOrReturnCtx(n);return B(p,{code:U.invalid_type,expected:N.string,received:p.parsedType}),d}let o=new Yi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.length<p.value)c=this._getOrReturnCtx(n,c),B(c,{code:U.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="max"){if(n.data.length>p.value)c=this._getOrReturnCtx(n,c),B(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),o.dirty()}else if(p.kind==="length"){let x=n.data.length>p.value,m=n.data.length<p.value;if(x||m){if(c=this._getOrReturnCtx(n,c),x)B(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(m)B(c,{code:U.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});o.dirty()}}else if(p.kind==="email"){if(!Z9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"email",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!M$)M$=new RegExp(q9,"u");if(!M$.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"emoji",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!C9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"uuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!I9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"nanoid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!L9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"cuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!N9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"cuid2",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!h9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"ulid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="url")try{new URL(n.data)}catch(x){c=this._getOrReturnCtx(n,c),B(c,{validation:"url",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="regex"){if(p.regex.lastIndex=0,!p.regex.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"regex",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="trim")n.data=n.data.trim();else if(p.kind==="includes"){if(!n.data.includes(p.value,p.position))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:{includes:p.value,position:p.position},message:p.message}),o.dirty()}else if(p.kind==="toLowerCase")n.data=n.data.toLowerCase();else if(p.kind==="toUpperCase")n.data=n.data.toUpperCase();else if(p.kind==="startsWith"){if(!n.data.startsWith(p.value))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:{startsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="endsWith"){if(!n.data.endsWith(p.value))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:{endsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="datetime"){if(!fR(p).test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!e9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!nG(p).test(n.data))c=this._getOrReturnCtx(n,c),B(c,{code:U.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!k9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"duration",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!iG(n.data,p.version))c=this._getOrReturnCtx(n,c),B(c,{validation:"ip",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="jwt"){if(!oG(n.data,p.alg))c=this._getOrReturnCtx(n,c),B(c,{validation:"jwt",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cidr"){if(!cG(n.data,p.version))c=this._getOrReturnCtx(n,c),B(c,{validation:"cidr",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!d9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"base64",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64url"){if(!g9.test(n.data))c=this._getOrReturnCtx(n,c),B(c,{validation:"base64url",code:U.invalid_string,message:p.message}),o.dirty()}else Fn.assertNever(p);return{status:o.value,value:n.data}}_regex(n,i,o){return this.refinement((c)=>n.test(c),{validation:i,code:U.invalid_string,...k.errToObj(o)})}_addCheck(n){return new Ao({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...k.errToObj(n)})}url(n){return this._addCheck({kind:"url",...k.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...k.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...k.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...k.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...k.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...k.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...k.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...k.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...k.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...k.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...k.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...k.errToObj(n)})}datetime(n){var i,o;if(typeof n==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n});return this._addCheck({kind:"datetime",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,offset:(i=n===null||n===void 0?void 0:n.offset)!==null&&i!==void 0?i:!1,local:(o=n===null||n===void 0?void 0:n.local)!==null&&o!==void 0?o:!1,...k.errToObj(n===null||n===void 0?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){if(typeof n==="string")return this._addCheck({kind:"time",precision:null,message:n});return this._addCheck({kind:"time",precision:typeof(n===null||n===void 0?void 0:n.precision)==="undefined"?null:n===null||n===void 0?void 0:n.precision,...k.errToObj(n===null||n===void 0?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...k.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...k.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i===null||i===void 0?void 0:i.position,...k.errToObj(i===null||i===void 0?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...k.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...k.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...k.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...k.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...k.errToObj(i)})}nonempty(n){return this.min(1,k.errToObj(n))}trim(){return new Ao({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ao({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ao({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((n)=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find((n)=>n.kind==="date")}get isTime(){return!!this._def.checks.find((n)=>n.kind==="time")}get isDuration(){return!!this._def.checks.find((n)=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find((n)=>n.kind==="email")}get isURL(){return!!this._def.checks.find((n)=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find((n)=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find((n)=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((n)=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((n)=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((n)=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find((n)=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find((n)=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find((n)=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find((n)=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find((n)=>n.kind==="base64url")}get minLength(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxLength(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}Ao.create=(n)=>{var i;return new Ao({checks:[],typeName:r.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};function pG(n,i){let o=(n.toString().split(".")[1]||"").length,c=(i.toString().split(".")[1]||"").length,p=o>c?o:c,x=parseInt(n.toFixed(p).replace(".","")),m=parseInt(i.toFixed(p).replace(".",""));return x%m/Math.pow(10,p)}class ac extends pn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce)n.data=Number(n.data);if(this._getType(n)!==N.number){let p=this._getOrReturnCtx(n);return B(p,{code:U.invalid_type,expected:N.number,received:p.parsedType}),d}let o=void 0,c=new Yi;for(let p of this._def.checks)if(p.kind==="int"){if(!Fn.isInteger(n.data))o=this._getOrReturnCtx(n,o),B(o,{code:U.invalid_type,expected:"integer",received:"float",message:p.message}),c.dirty()}else if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:U.too_small,minimum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:U.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(pG(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),B(o,{code:U.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else if(p.kind==="finite"){if(!Number.isFinite(n.data))o=this._getOrReturnCtx(n,o),B(o,{code:U.not_finite,message:p.message}),c.dirty()}else Fn.assertNever(p);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,k.toString(i))}gt(n,i){return this.setLimit("min",n,!1,k.toString(i))}lte(n,i){return this.setLimit("max",n,!0,k.toString(i))}lt(n,i){return this.setLimit("max",n,!1,k.toString(i))}setLimit(n,i,o,c){return new ac({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:k.toString(c)}]})}_addCheck(n){return new ac({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:k.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:k.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:k.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(n)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}get isInt(){return!!this._def.checks.find((n)=>n.kind==="int"||n.kind==="multipleOf"&&Fn.isInteger(n.value))}get isFinite(){let n=null,i=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(i===null||o.value>i)i=o.value}else if(o.kind==="max"){if(n===null||o.value<n)n=o.value}return Number.isFinite(i)&&Number.isFinite(n)}}ac.create=(n)=>{return new ac({checks:[],typeName:r.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class fc extends pn{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch(p){return this._getInvalidInput(n)}if(this._getType(n)!==N.bigint)return this._getInvalidInput(n);let o=void 0,c=new Yi;for(let p of this._def.checks)if(p.kind==="min"){if(p.inclusive?n.data<p.value:n.data<=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:U.too_small,type:"bigint",minimum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="max"){if(p.inclusive?n.data>p.value:n.data>=p.value)o=this._getOrReturnCtx(n,o),B(o,{code:U.too_big,type:"bigint",maximum:p.value,inclusive:p.inclusive,message:p.message}),c.dirty()}else if(p.kind==="multipleOf"){if(n.data%p.value!==BigInt(0))o=this._getOrReturnCtx(n,o),B(o,{code:U.not_multiple_of,multipleOf:p.value,message:p.message}),c.dirty()}else Fn.assertNever(p);return{status:c.value,value:n.data}}_getInvalidInput(n){let i=this._getOrReturnCtx(n);return B(i,{code:U.invalid_type,expected:N.bigint,received:i.parsedType}),d}gte(n,i){return this.setLimit("min",n,!0,k.toString(i))}gt(n,i){return this.setLimit("min",n,!1,k.toString(i))}lte(n,i){return this.setLimit("max",n,!0,k.toString(i))}lt(n,i){return this.setLimit("max",n,!1,k.toString(i))}setLimit(n,i,o,c){return new fc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:k.toString(c)}]})}_addCheck(n){return new fc({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:k.toString(i)})}get minValue(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n}get maxValue(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n}}fc.create=(n)=>{var i;return new fc({checks:[],typeName:r.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};class jp extends pn{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==N.boolean){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.boolean,received:o.parsedType}),d}return Oi(n.data)}}jp.create=(n)=>{return new jp({typeName:r.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class Nc extends pn{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==N.date){let p=this._getOrReturnCtx(n);return B(p,{code:U.invalid_type,expected:N.date,received:p.parsedType}),d}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return B(p,{code:U.invalid_date}),d}let o=new Yi,c=void 0;for(let p of this._def.checks)if(p.kind==="min"){if(n.data.getTime()<p.value)c=this._getOrReturnCtx(n,c),B(c,{code:U.too_small,message:p.message,inclusive:!0,exact:!1,minimum:p.value,type:"date"}),o.dirty()}else if(p.kind==="max"){if(n.data.getTime()>p.value)c=this._getOrReturnCtx(n,c),B(c,{code:U.too_big,message:p.message,inclusive:!0,exact:!1,maximum:p.value,type:"date"}),o.dirty()}else Fn.assertNever(p);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Nc({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:k.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:k.toString(i)})}get minDate(){let n=null;for(let i of this._def.checks)if(i.kind==="min"){if(n===null||i.value>n)n=i.value}return n!=null?new Date(n):null}get maxDate(){let n=null;for(let i of this._def.checks)if(i.kind==="max"){if(n===null||i.value<n)n=i.value}return n!=null?new Date(n):null}}Nc.create=(n)=>{return new Nc({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:r.ZodDate,...cn(n)})};class yx extends pn{_parse(n){if(this._getType(n)!==N.symbol){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.symbol,received:o.parsedType}),d}return Oi(n.data)}}yx.create=(n)=>{return new yx({typeName:r.ZodSymbol,...cn(n)})};class Dp extends pn{_parse(n){if(this._getType(n)!==N.undefined){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.undefined,received:o.parsedType}),d}return Oi(n.data)}}Dp.create=(n)=>{return new Dp({typeName:r.ZodUndefined,...cn(n)})};class Lp extends pn{_parse(n){if(this._getType(n)!==N.null){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.null,received:o.parsedType}),d}return Oi(n.data)}}Lp.create=(n)=>{return new Lp({typeName:r.ZodNull,...cn(n)})};class hc extends pn{constructor(){super(...arguments);this._any=!0}_parse(n){return Oi(n.data)}}hc.create=(n)=>{return new hc({typeName:r.ZodAny,...cn(n)})};class mc extends pn{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Oi(n.data)}}mc.create=(n)=>{return new mc({typeName:r.ZodUnknown,...cn(n)})};class zo extends pn{_parse(n){let i=this._getOrReturnCtx(n);return B(i,{code:U.invalid_type,expected:N.never,received:i.parsedType}),d}}zo.create=(n)=>{return new zo({typeName:r.ZodNever,...cn(n)})};class kx extends pn{_parse(n){if(this._getType(n)!==N.undefined){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.void,received:o.parsedType}),d}return Oi(n.data)}}kx.create=(n)=>{return new kx({typeName:r.ZodVoid,...cn(n)})};class Fo extends pn{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==N.array)return B(i,{code:U.invalid_type,expected:N.array,received:i.parsedType}),d;if(c.exactLength!==null){let x=i.data.length>c.exactLength.value,m=i.data.length<c.exactLength.value;if(x||m)B(i,{code:x?U.too_big:U.too_small,minimum:m?c.exactLength.value:void 0,maximum:x?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),o.dirty()}if(c.minLength!==null){if(i.data.length<c.minLength.value)B(i,{code:U.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),o.dirty()}if(c.maxLength!==null){if(i.data.length>c.maxLength.value)B(i,{code:U.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),o.dirty()}if(i.common.async)return Promise.all([...i.data].map((x,m)=>{return c.type._parseAsync(new Ro(i,x,i.path,m))})).then((x)=>{return Yi.mergeArray(o,x)});let p=[...i.data].map((x,m)=>{return c.type._parseSync(new Ro(i,x,i.path,m))});return Yi.mergeArray(o,p)}get element(){return this._def.type}min(n,i){return new Fo({...this._def,minLength:{value:n,message:k.toString(i)}})}max(n,i){return new Fo({...this._def,maxLength:{value:n,message:k.toString(i)}})}length(n,i){return new Fo({...this._def,exactLength:{value:n,message:k.toString(i)}})}nonempty(n){return this.min(1,n)}}Fo.create=(n,i)=>{return new Fo({type:n,minLength:null,maxLength:null,exactLength:null,typeName:r.ZodArray,...cn(i)})};function _p(n){if(n instanceof Cn){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=To.create(_p(c))}return new Cn({...n._def,shape:()=>i})}else if(n instanceof Fo)return new Fo({...n._def,type:_p(n.element)});else if(n instanceof To)return To.create(_p(n.unwrap()));else if(n instanceof No)return No.create(_p(n.unwrap()));else if(n instanceof Qo)return Qo.create(n.items.map((i)=>_p(i)));else return n}class Cn extends pn{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let n=this._def.shape(),i=Fn.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==N.object){let f=this._getOrReturnCtx(n);return B(f,{code:U.invalid_type,expected:N.object,received:f.parsedType}),d}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:x}=this._getCached(),m=[];if(!(this._def.catchall instanceof zo&&this._def.unknownKeys==="strip")){for(let f in c.data)if(!x.includes(f))m.push(f)}let a=[];for(let f of x){let v=p[f],$=c.data[f];a.push({key:{status:"valid",value:f},value:v._parse(new Ro(c,$,c.path,f)),alwaysSet:f in c.data})}if(this._def.catchall instanceof zo){let f=this._def.unknownKeys;if(f==="passthrough")for(let v of m)a.push({key:{status:"valid",value:v},value:{status:"valid",value:c.data[v]}});else if(f==="strict"){if(m.length>0)B(c,{code:U.unrecognized_keys,keys:m}),o.dirty()}else if(f==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let v of m){let $=c.data[v];a.push({key:{status:"valid",value:v},value:f._parse(new Ro(c,$,c.path,v)),alwaysSet:v in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let f=[];for(let v of a){let $=await v.key,w=await v.value;f.push({key:$,value:w,alwaysSet:v.alwaysSet})}return f}).then((f)=>{return Yi.mergeObjectSync(o,f)});else return Yi.mergeObjectSync(o,a)}get shape(){return this._def.shape()}strict(n){return k.errToObj,new Cn({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,x,m;let a=(x=(p=(c=this._def).errorMap)===null||p===void 0?void 0:p.call(c,i,o).message)!==null&&x!==void 0?x:o.defaultError;if(i.code==="unrecognized_keys")return{message:(m=k.errToObj(n).message)!==null&&m!==void 0?m:a};return{message:a}}}:{}})}strip(){return new Cn({...this._def,unknownKeys:"strip"})}passthrough(){return new Cn({...this._def,unknownKeys:"passthrough"})}extend(n){return new Cn({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Cn({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:r.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new Cn({...this._def,catchall:n})}pick(n){let i={};return Fn.objectKeys(n).forEach((o)=>{if(n[o]&&this.shape[o])i[o]=this.shape[o]}),new Cn({...this._def,shape:()=>i})}omit(n){let i={};return Fn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new Cn({...this._def,shape:()=>i})}deepPartial(){return _p(this)}partial(n){let i={};return Fn.objectKeys(this.shape).forEach((o)=>{let c=this.shape[o];if(n&&!n[o])i[o]=c;else i[o]=c.optional()}),new Cn({...this._def,shape:()=>i})}required(n){let i={};return Fn.objectKeys(this.shape).forEach((o)=>{if(n&&!n[o])i[o]=this.shape[o];else{let p=this.shape[o];while(p instanceof To)p=p._def.innerType;i[o]=p}}),new Cn({...this._def,shape:()=>i})}keyof(){return vR(Fn.objectKeys(this.shape))}}Cn.create=(n,i)=>{return new Cn({shape:()=>n,unknownKeys:"strip",catchall:zo.create(),typeName:r.ZodObject,...cn(i)})};Cn.strictCreate=(n,i)=>{return new Cn({shape:()=>n,unknownKeys:"strict",catchall:zo.create(),typeName:r.ZodObject,...cn(i)})};Cn.lazycreate=(n,i)=>{return new Cn({shape:n,unknownKeys:"strip",catchall:zo.create(),typeName:r.ZodObject,...cn(i)})};class Np extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=this._def.options;function c(p){for(let m of p)if(m.result.status==="valid")return m.result;for(let m of p)if(m.result.status==="dirty")return i.common.issues.push(...m.ctx.common.issues),m.result;let x=p.map((m)=>new yi(m.ctx.common.issues));return B(i,{code:U.invalid_union,unionErrors:x}),d}if(i.common.async)return Promise.all(o.map(async(p)=>{let x={...i,common:{...i.common,issues:[]},parent:null};return{result:await p._parseAsync({data:i.data,path:i.path,parent:x}),ctx:x}})).then(c);else{let p=void 0,x=[];for(let a of o){let f={...i,common:{...i.common,issues:[]},parent:null},v=a._parseSync({data:i.data,path:i.path,parent:f});if(v.status==="valid")return v;else if(v.status==="dirty"&&!p)p={result:v,ctx:f};if(f.common.issues.length)x.push(f.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let m=x.map((a)=>new yi(a));return B(i,{code:U.invalid_union,unionErrors:m}),d}}get options(){return this._def.options}}Np.create=(n,i)=>{return new Np({options:n,typeName:r.ZodUnion,...cn(i)})};var Do=(n)=>{if(n instanceof Cp)return Do(n.schema);else if(n instanceof io)return Do(n.innerType());else if(n instanceof Ip)return[n.value];else if(n instanceof vc)return n.options;else if(n instanceof yp)return Fn.objectValues(n.enum);else if(n instanceof kp)return Do(n._def.innerType);else if(n instanceof Dp)return[void 0];else if(n instanceof Lp)return[null];else if(n instanceof To)return[void 0,...Do(n.unwrap())];else if(n instanceof No)return[null,...Do(n.unwrap())];else if(n instanceof La)return Do(n.unwrap());else if(n instanceof qp)return Do(n.unwrap());else if(n instanceof Zp)return Do(n._def.innerType);else return[]};class Da extends pn{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.object)return B(i,{code:U.invalid_type,expected:N.object,received:i.parsedType}),d;let o=this.discriminator,c=i.data[o],p=this.optionsMap.get(c);if(!p)return B(i,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),d;if(i.common.async)return p._parseAsync({data:i.data,path:i.path,parent:i});else return p._parseSync({data:i.data,path:i.path,parent:i})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,o){let c=new Map;for(let p of i){let x=Do(p.shape[n]);if(!x.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(let m of x){if(c.has(m))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(m)}`);c.set(m,p)}}return new Da({typeName:r.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...cn(o)})}}function Q$(n,i){let o=Lo(n),c=Lo(i);if(n===i)return{valid:!0,data:n};else if(o===N.object&&c===N.object){let p=Fn.objectKeys(i),x=Fn.objectKeys(n).filter((a)=>p.indexOf(a)!==-1),m={...n,...i};for(let a of x){let f=Q$(n[a],i[a]);if(!f.valid)return{valid:!1};m[a]=f.data}return{valid:!0,data:m}}else if(o===N.array&&c===N.array){if(n.length!==i.length)return{valid:!1};let p=[];for(let x=0;x<n.length;x++){let m=n[x],a=i[x],f=Q$(m,a);if(!f.valid)return{valid:!1};p.push(f.data)}return{valid:!0,data:p}}else if(o===N.date&&c===N.date&&+n===+i)return{valid:!0,data:n};else return{valid:!1}}class hp extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=(p,x)=>{if(H$(p)||H$(x))return d;let m=Q$(p.value,x.value);if(!m.valid)return B(o,{code:U.invalid_intersection_types}),d;if(z$(p)||z$(x))i.dirty();return{status:i.value,value:m.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([p,x])=>c(p,x));else return c(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}hp.create=(n,i,o)=>{return new hp({left:n,right:i,typeName:r.ZodIntersection,...cn(o)})};class Qo extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.array)return B(o,{code:U.invalid_type,expected:N.array,received:o.parsedType}),d;if(o.data.length<this._def.items.length)return B(o,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),d;if(!this._def.rest&&o.data.length>this._def.items.length)B(o,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty();let p=[...o.data].map((x,m)=>{let a=this._def.items[m]||this._def.rest;if(!a)return null;return a._parse(new Ro(o,x,o.path,m))}).filter((x)=>!!x);if(o.common.async)return Promise.all(p).then((x)=>{return Yi.mergeArray(i,x)});else return Yi.mergeArray(i,p)}get items(){return this._def.items}rest(n){return new Qo({...this._def,rest:n})}}Qo.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qo({items:n,typeName:r.ZodTuple,rest:null,...cn(i)})};class Zx extends pn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.object)return B(o,{code:U.invalid_type,expected:N.object,received:o.parsedType}),d;let c=[],p=this._def.keyType,x=this._def.valueType;for(let m in o.data)c.push({key:p._parse(new Ro(o,m,o.path,m)),value:x._parse(new Ro(o,o.data[m],o.path,m)),alwaysSet:m in o.data});if(o.common.async)return Yi.mergeObjectAsync(i,c);else return Yi.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,o){if(i instanceof pn)return new Zx({keyType:n,valueType:i,typeName:r.ZodRecord,...cn(o)});return new Zx({keyType:Ao.create(),valueType:n,typeName:r.ZodRecord,...cn(i)})}}class qx extends pn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.map)return B(o,{code:U.invalid_type,expected:N.map,received:o.parsedType}),d;let c=this._def.keyType,p=this._def.valueType,x=[...o.data.entries()].map(([m,a],f)=>{return{key:c._parse(new Ro(o,m,o.path,[f,"key"])),value:p._parse(new Ro(o,a,o.path,[f,"value"]))}});if(o.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let a of x){let f=await a.key,v=await a.value;if(f.status==="aborted"||v.status==="aborted")return d;if(f.status==="dirty"||v.status==="dirty")i.dirty();m.set(f.value,v.value)}return{status:i.value,value:m}})}else{let m=new Map;for(let a of x){let{key:f,value:v}=a;if(f.status==="aborted"||v.status==="aborted")return d;if(f.status==="dirty"||v.status==="dirty")i.dirty();m.set(f.value,v.value)}return{status:i.value,value:m}}}}qx.create=(n,i,o)=>{return new qx({valueType:i,keyType:n,typeName:r.ZodMap,...cn(o)})};class Cc extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==N.set)return B(o,{code:U.invalid_type,expected:N.set,received:o.parsedType}),d;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)B(o,{code:U.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()}if(c.maxSize!==null){if(o.data.size>c.maxSize.value)B(o,{code:U.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty()}let p=this._def.valueType;function x(a){let f=new Set;for(let v of a){if(v.status==="aborted")return d;if(v.status==="dirty")i.dirty();f.add(v.value)}return{status:i.value,value:f}}let m=[...o.data.values()].map((a,f)=>p._parse(new Ro(o,a,o.path,f)));if(o.common.async)return Promise.all(m).then((a)=>x(a));else return x(m)}min(n,i){return new Cc({...this._def,minSize:{value:n,message:k.toString(i)}})}max(n,i){return new Cc({...this._def,maxSize:{value:n,message:k.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}Cc.create=(n,i)=>{return new Cc({valueType:n,minSize:null,maxSize:null,typeName:r.ZodSet,...cn(i)})};class up extends pn{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.function)return B(i,{code:U.invalid_type,expected:N.function,received:i.parsedType}),d;function o(m,a){return Ba({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,ua(),Bp].filter((f)=>!!f),issueData:{code:U.invalid_arguments,argumentsError:a}})}function c(m,a){return Ba({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,ua(),Bp].filter((f)=>!!f),issueData:{code:U.invalid_return_type,returnTypeError:a}})}let p={errorMap:i.common.contextualErrorMap},x=i.data;if(this._def.returns instanceof Ic){let m=this;return Oi(async function(...a){let f=new yi([]),v=await m._def.args.parseAsync(a,p).catch((J)=>{throw f.addIssue(o(a,J)),f}),$=await Reflect.apply(x,this,v);return await m._def.returns._def.type.parseAsync($,p).catch((J)=>{throw f.addIssue(c($,J)),f})})}else{let m=this;return Oi(function(...a){let f=m._def.args.safeParse(a,p);if(!f.success)throw new yi([o(a,f.error)]);let v=Reflect.apply(x,this,f.data),$=m._def.returns.safeParse(v,p);if(!$.success)throw new yi([c(v,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new up({...this._def,args:Qo.create(n).rest(mc.create())})}returns(n){return new up({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,o){return new up({args:n?n:Qo.create([]).rest(mc.create()),returns:i||mc.create(),typeName:r.ZodFunction,...cn(o)})}}class Cp extends pn{get schema(){return this._def.getter()}_parse(n){let{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Cp.create=(n,i)=>{return new Cp({getter:n,typeName:r.ZodLazy,...cn(i)})};class Ip extends pn{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return B(i,{received:i.data,code:U.invalid_literal,expected:this._def.value}),d}return{status:"valid",value:n.data}}get value(){return this._def.value}}Ip.create=(n,i)=>{return new Ip({value:n,typeName:r.ZodLiteral,...cn(i)})};function vR(n,i){return new vc({values:n,typeName:r.ZodEnum,...cn(i)})}class vc extends pn{constructor(){super(...arguments);hx.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return B(i,{expected:Fn.joinValues(o),received:i.parsedType,code:U.invalid_type}),d}if(!ja(this,hx,"f"))xR(this,hx,new Set(this._def.values),"f");if(!ja(this,hx,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return B(i,{received:i.data,code:U.invalid_enum_value,options:o}),d}return Oi(n.data)}get options(){return this._def.values}get enum(){let n={};for(let i of this._def.values)n[i]=i;return n}get Values(){let n={};for(let i of this._def.values)n[i]=i;return n}get Enum(){let n={};for(let i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return vc.create(n,{...this._def,...i})}exclude(n,i=this._def){return vc.create(this.options.filter((o)=>!n.includes(o)),{...this._def,...i})}}hx=new WeakMap;vc.create=vR;class yp extends pn{constructor(){super(...arguments);Cx.set(this,void 0)}_parse(n){let i=Fn.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==N.string&&o.parsedType!==N.number){let c=Fn.objectValues(i);return B(o,{expected:Fn.joinValues(c),received:o.parsedType,code:U.invalid_type}),d}if(!ja(this,Cx,"f"))xR(this,Cx,new Set(Fn.getValidEnumValues(this._def.values)),"f");if(!ja(this,Cx,"f").has(n.data)){let c=Fn.objectValues(i);return B(o,{received:o.data,code:U.invalid_enum_value,options:c}),d}return Oi(n.data)}get enum(){return this._def.values}}Cx=new WeakMap;yp.create=(n,i)=>{return new yp({values:n,typeName:r.ZodNativeEnum,...cn(i)})};class Ic extends pn{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==N.promise&&i.common.async===!1)return B(i,{code:U.invalid_type,expected:N.promise,received:i.parsedType}),d;let o=i.parsedType===N.promise?i.data:Promise.resolve(i.data);return Oi(o.then((c)=>{return this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})}))}}Ic.create=(n,i)=>{return new Ic({type:n,typeName:r.ZodPromise,...cn(i)})};class io extends pn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===r.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=this._def.effect||null,p={addIssue:(x)=>{if(B(o,x),x.fatal)i.abort();else i.dirty()},get path(){return o.path}};if(p.addIssue=p.addIssue.bind(p),c.type==="preprocess"){let x=c.transform(o.data,p);if(o.common.async)return Promise.resolve(x).then(async(m)=>{if(i.value==="aborted")return d;let a=await this._def.schema._parseAsync({data:m,path:o.path,parent:o});if(a.status==="aborted")return d;if(a.status==="dirty")return bp(a.value);if(i.value==="dirty")return bp(a.value);return a});else{if(i.value==="aborted")return d;let m=this._def.schema._parseSync({data:x,path:o.path,parent:o});if(m.status==="aborted")return d;if(m.status==="dirty")return bp(m.value);if(i.value==="dirty")return bp(m.value);return m}}if(c.type==="refinement"){let x=(m)=>{let a=c.refinement(m,p);if(o.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(o.common.async===!1){let m=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(m.status==="aborted")return d;if(m.status==="dirty")i.dirty();return x(m.value),{status:i.value,value:m.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((m)=>{if(m.status==="aborted")return d;if(m.status==="dirty")i.dirty();return x(m.value).then(()=>{return{status:i.value,value:m.value}})})}if(c.type==="transform")if(o.common.async===!1){let x=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Lc(x))return x;let m=c.transform(x.value,p);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:m}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((x)=>{if(!Lc(x))return x;return Promise.resolve(c.transform(x.value,p)).then((m)=>({status:i.value,value:m}))});Fn.assertNever(c)}}io.create=(n,i,o)=>{return new io({schema:n,typeName:r.ZodEffects,effect:i,...cn(o)})};io.createWithPreprocess=(n,i,o)=>{return new io({schema:i,effect:{type:"preprocess",transform:n},typeName:r.ZodEffects,...cn(o)})};class To extends pn{_parse(n){if(this._getType(n)===N.undefined)return Oi(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}To.create=(n,i)=>{return new To({innerType:n,typeName:r.ZodOptional,...cn(i)})};class No extends pn{_parse(n){if(this._getType(n)===N.null)return Oi(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}No.create=(n,i)=>{return new No({innerType:n,typeName:r.ZodNullable,...cn(i)})};class kp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;if(i.parsedType===N.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}kp.create=(n,i)=>{return new kp({innerType:n,typeName:r.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...cn(i)})};class Zp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(Ix(c))return c.then((p)=>{return{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new yi(o.common.issues)},input:o.data})}});else return{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new yi(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Zp.create=(n,i)=>{return new Zp({innerType:n,typeName:r.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...cn(i)})};class sx extends pn{_parse(n){if(this._getType(n)!==N.nan){let o=this._getOrReturnCtx(n);return B(o,{code:U.invalid_type,expected:N.nan,received:o.parsedType}),d}return{status:"valid",value:n.data}}}sx.create=(n)=>{return new sx({typeName:r.ZodNaN,...cn(n)})};var xG=Symbol("zod_brand");class La extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;return this._def.type._parse({data:o,path:i.path,parent:i})}unwrap(){return this._def.type}}class Px extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.common.async)return(async()=>{let p=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(p.status==="aborted")return d;if(p.status==="dirty")return i.dirty(),bp(p.value);else return this._def.out._parseAsync({data:p.value,path:o.path,parent:o})})();else{let c=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(c.status==="aborted")return d;if(c.status==="dirty")return i.dirty(),{status:"dirty",value:c.value};else return this._def.out._parseSync({data:c.value,path:o.path,parent:o})}}static create(n,i){return new Px({in:n,out:i,typeName:r.ZodPipeline})}}class qp extends pn{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(Lc(c))c.value=Object.freeze(c.value);return c};return Ix(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}qp.create=(n,i)=>{return new qp({innerType:n,typeName:r.ZodReadonly,...cn(i)})};function oR(n,i){let o=typeof n==="function"?n(i):typeof n==="string"?{message:n}:n;return typeof o==="string"?{message:o}:o}function $R(n,i={},o){if(n)return hc.create().superRefine((c,p)=>{var x,m;let a=n(c);if(a instanceof Promise)return a.then((f)=>{var v,$;if(!f){let w=oR(i,c),J=($=(v=w.fatal)!==null&&v!==void 0?v:o)!==null&&$!==void 0?$:!0;p.addIssue({code:"custom",...w,fatal:J})}});if(!a){let f=oR(i,c),v=(m=(x=f.fatal)!==null&&x!==void 0?x:o)!==null&&m!==void 0?m:!0;p.addIssue({code:"custom",...f,fatal:v})}return});return hc.create()}var mG={object:Cn.lazycreate},r;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(r||(r={}));var aG=(n,i={message:`Input not instance of ${n.name}`})=>$R((o)=>o instanceof n,i),wR=Ao.create,JR=ac.create,fG=sx.create,vG=fc.create,AR=jp.create,$G=Nc.create,wG=yx.create,JG=Dp.create,AG=Lp.create,FG=hc.create,TG=mc.create,RG=zo.create,SG=kx.create,XG=Fo.create,WG=Cn.create,KG=Cn.strictCreate,lG=Np.create,GG=Da.create,MG=hp.create,YG=Qo.create,HG=Zx.create,zG=qx.create,QG=Cc.create,EG=up.create,OG=Cp.create,UG=Ip.create,VG=vc.create,_G=yp.create,bG=Ic.create,cR=io.create,uG=To.create,BG=No.create,jG=io.createWithPreprocess,DG=Px.create,LG=()=>wR().optional(),NG=()=>JR().optional(),hG=()=>AR().optional(),CG={string:(n)=>Ao.create({...n,coerce:!0}),number:(n)=>ac.create({...n,coerce:!0}),boolean:(n)=>jp.create({...n,coerce:!0}),bigint:(n)=>fc.create({...n,coerce:!0}),date:(n)=>Nc.create({...n,coerce:!0})},IG=d,Wn=Object.freeze({__proto__:null,defaultErrorMap:Bp,setErrorMap:j9,getErrorMap:ua,makeIssue:Ba,EMPTY_PATH:D9,addIssueToContext:B,ParseStatus:Yi,INVALID:d,DIRTY:bp,OK:Oi,isAborted:H$,isDirty:z$,isValid:Lc,isAsync:Ix,get util(){return Fn},get objectUtil(){return Y$},ZodParsedType:N,getParsedType:Lo,ZodType:pn,datetimeRegex:fR,ZodString:Ao,ZodNumber:ac,ZodBigInt:fc,ZodBoolean:jp,ZodDate:Nc,ZodSymbol:yx,ZodUndefined:Dp,ZodNull:Lp,ZodAny:hc,ZodUnknown:mc,ZodNever:zo,ZodVoid:kx,ZodArray:Fo,ZodObject:Cn,ZodUnion:Np,ZodDiscriminatedUnion:Da,ZodIntersection:hp,ZodTuple:Qo,ZodRecord:Zx,ZodMap:qx,ZodSet:Cc,ZodFunction:up,ZodLazy:Cp,ZodLiteral:Ip,ZodEnum:vc,ZodNativeEnum:yp,ZodPromise:Ic,ZodEffects:io,ZodTransformer:io,ZodOptional:To,ZodNullable:No,ZodDefault:kp,ZodCatch:Zp,ZodNaN:sx,BRAND:xG,ZodBranded:La,ZodPipeline:Px,ZodReadonly:qp,custom:$R,Schema:pn,ZodSchema:pn,late:mG,get ZodFirstPartyTypeKind(){return r},coerce:CG,any:FG,array:XG,bigint:vG,boolean:AR,date:$G,discriminatedUnion:GG,effect:cR,enum:VG,function:EG,instanceof:aG,intersection:MG,lazy:OG,literal:UG,map:zG,nan:fG,nativeEnum:_G,never:RG,null:AG,nullable:BG,number:JR,object:WG,oboolean:hG,onumber:NG,optional:uG,ostring:LG,pipeline:DG,preprocess:jG,promise:bG,record:HG,set:QG,strictObject:KG,string:wR,symbol:wG,transformer:cR,tuple:YG,undefined:JG,union:lG,unknown:TG,void:SG,NEVER:IG,ZodIssueCode:U,quotelessJson:B9,ZodError:yi});var yG="__vite_start_time"in globalThis,kG=typeof window!=="undefined",oN="vitest"in globalThis,sn=nR({isServer:!yG&&!kG,server:{CI:Wn.string().transform((n)=>!0).optional(),POSTGRES_USER:Wn.string(),POSTGRES_PASSWORD:Wn.string(),POSTGRES_DATABASE:Wn.string(),POSTGRES_HOST:Wn.string(),POSTGRES_PORT:Wn.string().transform((n)=>Number.parseInt(n,10)),BACKEND_PORT:Wn.string().transform((n)=>Number.parseInt(n,10)),RUN_WORKERS_FROM_SOURCE:Wn.union([Wn.literal("true"),Wn.literal("false")]).optional().transform((n)=>n==="true"),FRONTEND_PORT:Wn.string().transform((n)=>Number.parseInt(n,10)),FRONTEND_ORIGINS:Wn.string().transform((n)=>JSON.parse(n)).pipe(Wn.array(Wn.string())),OPENAI_API_KEY:Wn.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Wn.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Wn.union([Wn.literal("true"),Wn.literal("false")]).optional().transform((n)=>n==="true")},runtimeEnv:import.meta.env,emptyStringAsUndefined:!0});var TR=E$(import.meta.dirname,"../dev"),O$=sn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:FR(E$(TR,"./cert.pem"),"utf-8"),key:FR(E$(TR,"./key.pem"),"utf-8")}:void 0;var $c=new Of,mn=sn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:$c.logger;g.STORE.loggers[0]=new Xc("warn",void 0,mn);if(mn!==console)Object.assign(console,mn,{log:mn.info});import{spawn as ZG}from"node:child_process";import{resolve as qG}from"node:path";function U$(n,i,o=n.logger){let c=sn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",m=[qG(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")m.push("--experimental-strip-types");let a=ZG(p,m);return new Jx(a,i,o)}var RR=wf($v(),1);var sG=604800000,Na=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new RR.CronJob("00 00 03 * * *",()=>{for(let[o,c]of n.entries()){let p=Date.now();for(let[x,m]of c.entries())if(p-m>sG)c.delete(x);if(c.size===0)n.delete(o)}});i.start(),process.on("exit",()=>{i.stop(),mn.info("\uD83D\uDEEC autoExpiry stopped")})}return n})();import NM from"node:path";import SM from"node:os";import XM from"node:fs";var ha=new Map,V$=new Map,_$=Symbol("OriginError"),sp={};class oo extends Promise{constructor(n,i,o,c,p={}){let x,m;super((a,f)=>{x=a,m=f});this.tagged=Array.isArray(n.raw),this.strings=n,this.args=i,this.handler=o,this.canceller=c,this.options=p,this.state=null,this.statement=null,this.resolve=(a)=>(this.active=!1,x(a)),this.reject=(a)=>(this.active=!1,m(a)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[_$]=this.handler.debug?new Error:this.tagged&&PG(this.strings)}get origin(){return(this.handler.debug?this[_$].stack:this.tagged&&V$.has(this.strings)?V$.get(this.strings):V$.set(this.strings,this[_$].stack).get(this.strings))||""}static get[Symbol.species](){return Promise}cancel(){return this.canceller&&(this.canceller(this),this.canceller=null)}simple(){return this.options.simple=!0,this.options.prepare=!1,this}async readable(){return this.simple(),this.streaming=!0,this}async writable(){return this.simple(),this.streaming=!0,this}cursor(n=1,i){if(this.options.simple=!1,typeof n==="function")i=n,n=1;if(this.cursorRows=n,typeof i==="function")return this.cursorFn=i,this;let o;return{[Symbol.asyncIterator]:()=>({next:()=>{if(this.executed&&!this.active)return{done:!0};o&&o();let c=new Promise((p,x)=>{this.cursorFn=(m)=>{return p({value:m,done:!1}),new Promise((a)=>o=a)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(m)=>(this.active=!1,x(m))});return this.execute(),c},return(){return o&&o(sp),{done:!0}}})}}describe(){return this.options.simple=!1,this.onlyDescribe=this.options.prepare=!0,this}stream(){throw new Error(".stream has been renamed to .forEach")}forEach(n){return this.forEachFn=n,this.handle(),this}raw(){return this.isRaw=!0,this}values(){return this.isRaw="values",this}async handle(){!this.executed&&(this.executed=!0)&&await 1&&this.handler(this)}execute(){return this.handle(),this}then(){return this.handle(),super.then.apply(this,arguments)}catch(){return this.handle(),super.catch.apply(this,arguments)}finally(){return this.handle(),super.finally.apply(this,arguments)}}function PG(n){if(ha.has(n))return ha.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,ha.set(n,new Error),Error.stackTraceLimit=i,ha.get(n)}class Pp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var rn={connection:SR,postgres:XR,generic:WR,notSupported:KR};function SR(n,i,o){let{host:c,port:p}=o||i,x=Object.assign(new Error("write "+n+" "+(i.path||c+":"+p)),{code:n,errno:n,address:i.path||c},i.path?{}:{port:p});return Error.captureStackTrace(x,SR),x}function XR(n){let i=new Pp(n);return Error.captureStackTrace(i,XR),i}function WR(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,WR),o}function KR(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,KR),i}var tG={string:{to:25,from:null,serialize:(n)=>""+n},number:{to:0,from:[21,23,26,700,701],serialize:(n)=>""+n,parse:(n)=>+n},json:{to:114,from:[114,3802],serialize:(n)=>JSON.stringify(n),parse:(n)=>JSON.parse(n)},boolean:{to:16,from:16,serialize:(n)=>n===!0?"t":"f",parse:(n)=>n==="t"},date:{to:1184,from:[1082,1114,1184],serialize:(n)=>(n instanceof Date?n:new Date(n)).toISOString(),parse:(n)=>new Date(n)},bytea:{to:17,from:17,serialize:(n)=>"\\x"+Buffer.from(n).toString("hex"),parse:(n)=>Buffer.from(n.slice(2),"hex")}};class ya{then(){b$()}catch(){b$()}finally(){b$()}}class gx extends ya{constructor(n){super();this.value=qa(n)}}class Eo extends ya{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class ka extends ya{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=rG.map(([x,m])=>({fn:m,i:n.search(x)})).sort((x,m)=>x.i-m.i).pop();return p.i===-1?L$(this.first,c):p.fn(this.first,this.rest,i,o,c)}}function Za(n,i,o,c){let p=n instanceof Eo?n.value:n;if(p===void 0){if(n instanceof Eo?n.value=c.transform.undefined:p=n=c.transform.undefined,p===void 0)throw rn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+o.push(n instanceof Eo?(i.push(n.value),n.array?n.array[n.type||Ia(n.value)]||n.type||YR(n.value):n.type):(i.push(n),Ia(n)))}var GR=zR(tG);function j$(n,i,o,c,p,x){for(let m=1;m<n.strings.length;m++)i+=D$(i,o,c,p,x)+n.strings[m],o=n.args[m];return i}function D$(n,i,o,c,p){return i instanceof ka?i.build(n,o,c,p):i instanceof oo?B$(i,o,c,p):i instanceof gx?i.value:i&&i[0]instanceof oo?i.reduce((x,m)=>x+" "+B$(m,o,c,p),""):Za(i,o,c,p)}function B$(n,i,o,c){return n.fragment=!0,j$(n,n.strings[0],n.args[0],i,o,c)}function MR(n,i,o,c,p){return n.map((x)=>"("+c.map((m)=>D$("values",x[m],i,o,p)).join(",")+")").join(",")}function lR(n,i,o,c,p){let x=Array.isArray(n[0]),m=i.length?i.flat():Object.keys(x?n[0]:n);return MR(x?n:[n],o,c,m,p)}function Ca(n,i,o,c,p){if(typeof n==="string"&&(n=[n].concat(i)),Array.isArray(n))return L$(n,p);let x;return(i.length?i.flat():Object.keys(n)).map((a)=>{return x=n[a],(x instanceof oo?B$(x,o,c,p):x instanceof gx?x.value:Za(x,o,c,p))+" as "+qa(p.transform.column.to?p.transform.column.to(a):a)}).join(",")}var rG=Object.entries({values:lR,in:(...n)=>{let i=lR(...n);return i==="()"?"(null)":i},select:Ca,as:Ca,returning:Ca,"\\(":Ca,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((x)=>qa(p.transform.column.to?p.transform.column.to(x):x)+"="+D$("values",n[x],o,c,p))},insert(n,i,o,c,p){let x=i.length?i.flat():Object.keys(Array.isArray(n)?n[0]:n);return"("+L$(x,p)+")values"+MR(Array.isArray(n)?n:[n],o,c,x,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function b$(){throw rn.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:dG,parsers:gG}=GR;function YR(n){if(Array.isArray(n))return YR(n[0]);return typeof n==="string"?1009:0}var HR=function(n){let i=zR(n||{});return{serializers:Object.assign({},dG,i.serializers),parsers:Object.assign({},gG,i.parsers)}};function zR(n){return Object.keys(n).reduce((i,o)=>{if(n[o].from&&[].concat(n[o].from).forEach((c)=>i.parsers[c]=n[o].parse),n[o].serialize)i.serializers[n[o].to]=n[o].serialize,n[o].from&&[].concat(n[o].from).forEach((c)=>i.serializers[c]=n[o].serialize);return i},{parsers:{},serializers:{}})}function L$(n,{transform:{column:i}}){return n.map((o)=>qa(i.to?i.to(o):o)).join(",")}var qa=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},Ia=function n(i){return i instanceof Eo?i.type:i instanceof Date?1184:i instanceof Uint8Array?17:i===!0||i===!1?16:typeof i==="bigint"?20:Array.isArray(i)?n(i[0]):0},eG=/\\/g,nM=/"/g;function iM(n){return n.replace(eG,"\\\\").replace(nM,"\\\"")}var QR=function n(i,o,c,p){if(Array.isArray(i)===!1)return i;if(!i.length)return"{}";let x=i[0],m=p===1020?";":",";if(Array.isArray(x)&&!x.type)return"{"+i.map((a)=>n(a,o,c,p)).join(m)+"}";return"{"+i.map((a)=>{if(a===void 0){if(a=c.transform.undefined,a===void 0)throw rn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return a===null?"null":'"'+iM(o?o(a.type?a.value:a):""+a)+'"'}).join(m)+"}"},u$={i:0,char:null,str:"",quoted:!1,last:0},ER=function n(i,o,c){return u$.i=u$.last=0,OR(u$,i,o,c)};function OR(n,i,o,c){let p=[],x=c===1020?";":",";for(;n.i<i.length;n.i++){if(n.char=i[n.i],n.quoted)if(n.char==="\\")n.str+=i[++n.i];else if(n.char==='"')p.push(o?o(n.str):n.str),n.str="",n.quoted=i[n.i+1]==='"',n.last=n.i+2;else n.str+=n.char;else if(n.char==='"')n.quoted=!0;else if(n.char==="{")n.last=++n.i,p.push(OR(n,i,o,c));else if(n.char==="}"){n.quoted=!1,n.last<n.i&&p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;break}else if(n.char===x&&n.p!=="}"&&n.p!=='"')p.push(o?o(i.slice(n.last,n.i)):i.slice(n.last,n.i)),n.last=n.i+1;n.p=n.char}return n.last<n.i&&p.push(o?o(i.slice(n.last,n.i+1)):i.slice(n.last,n.i+1)),p}var yc=(n)=>{let i=n[0];for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},kc=(n)=>{let i=n[0].toUpperCase();for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},Zc=(n)=>n.replace(/_/g,"-"),tx=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),rx=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),dx=(n)=>n.replace(/-/g,"_");function N$(n){return function i(o,c){return typeof o==="object"&&o!==null&&(c.type===114||c.type===3802)?Array.isArray(o)?o.map((p)=>i(p,c)):Object.entries(o).reduce((p,[x,m])=>Object.assign(p,{[n(x)]:i(m,c)}),{}):o}}yc.column={from:yc};yc.value={from:N$(yc)};tx.column={to:tx};var h$={...yc};h$.column.to=tx;kc.column={from:kc};kc.value={from:N$(kc)};rx.column={to:rx};var C$={...kc};C$.column.to=rx;Zc.column={from:Zc};Zc.value={from:N$(Zc)};dx.column={to:dx};var I$={...Zc};I$.column.to=dx;import UR from"node:net";import xM from"node:tls";import ex from"node:crypto";import y$ from"node:stream";import{performance as VR}from"node:perf_hooks";class qc extends Array{constructor(){super();Object.defineProperties(this,{count:{value:null,writable:!0},state:{value:null,writable:!0},command:{value:null,writable:!0},columns:{value:null,writable:!0},statement:{value:null,writable:!0}})}static get[Symbol.species](){return Array}}var ki=oM;function oM(n=[]){let i=n.slice(),o=0;return{get length(){return i.length-o},remove:(c)=>{let p=i.indexOf(c);return p===-1?null:(i.splice(p,1),c)},push:(c)=>(i.push(c),c),shift:()=>{let c=i[o++];if(o===i.length)o=0,i=[];else i[o-1]=void 0;return c}}}var Hi=Buffer.allocUnsafe(256),cM="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return Hi[0]=o,Qn.i=5,Qn},n},{}),Qn=Object.assign(pM,cM,{N:String.fromCharCode(0),i:0,inc(n){return Qn.i+=n,Qn},str(n){let i=Buffer.byteLength(n);return sa(i),Qn.i+=Hi.write(n,Qn.i,i,"utf8"),Qn},i16(n){return sa(2),Hi.writeUInt16BE(n,Qn.i),Qn.i+=2,Qn},i32(n,i){if(i||i===0)return Hi.writeUInt32BE(n,i),Qn;return sa(4),Hi.writeUInt32BE(n,Qn.i),Qn.i+=4,Qn},z(n){return sa(n),Hi.fill(0,Qn.i,Qn.i+n),Qn.i+=n,Qn},raw(n){return Hi=Buffer.concat([Hi.subarray(0,Qn.i),n]),Qn.i=Hi.length,Qn},end(n=1){Hi.writeUInt32BE(Qn.i-n,n);let i=Hi.subarray(0,Qn.i);return Qn.i=0,Hi=Buffer.allocUnsafe(256),i}}),s=Qn;function sa(n){if(Hi.length-Qn.i<n){let i=Hi,o=i.length;Hi=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(Hi)}}function pM(){return Qn.i=0,Qn}var q$=uR,mM=1,wc=s().S().end(),_R=s().H().end(),aM=s().i32(8).i32(80877103).end(8),fM=Buffer.concat([s().E().str(s.N).i32(0).end(),wc]),vM=s().D().str("S").str(s.N).end(),tp=()=>{},$M=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),wM={83:"severity_local",86:"severity",67:"code",77:"message",68:"detail",72:"hint",80:"position",112:"internal_position",113:"internal_query",87:"where",115:"schema_name",116:"table_name",99:"column_name",100:"data type_name",110:"constraint_name",70:"file",76:"line",82:"routine"};function uR(n,i={},{onopen:o=tp,onend:c=tp,onclose:p=tp}={}){let{ssl:x,max:m,user:a,host:f,port:v,database:$,parsers:w,transform:J,onnotice:S,onnotify:X,onparameter:R,max_pipeline:K,keep_alive:M,backoff:Y,target_session_attrs:I}=n,G=ki(),z=mM++,E={pid:null,secret:null},Q=Z$(ff,n.idle_timeout),b=Z$(ff,n.max_lifetime),y=Z$(AS,n.connect_timeout),H=null,an,Z=new qc,fn=Buffer.alloc(0),En=n.fetch_types,dn={},Vi={},Oo=Math.random().toString(36).slice(2),O=1,q=0,Rn=0,Dn=0,gn=0,vn=0,_n=0,Pn=0,Nn=null,Bn=null,Fi=!1,bn=null,co=null,Ti=null,ho=null,en=null,jn=null,po=null,Xo=null,_=null,nx=null,Ri={queue:i.closed,idleTimer:Q,connect(A){Ti=A||!0,W0()},terminate:ox,execute:ix,cancel:vS,end:ff,count:0,id:z};return i.closed&&i.closed.push(Ri),Ri;async function fS(){let A;try{A=n.socket?await Promise.resolve(n.socket(n)):new UR.Socket}catch(W){rc(W);return}return A.on("error",rc),A.on("close",K0),A.on("drain",S0),A}async function vS({pid:A,secret:W},P,Sn){try{an=s().i32(16).i32(80877102).i32(A).i32(W).end(16),await X0(),H.once("error",Sn),H.once("close",P)}catch(In){Sn(In)}}function ix(A){if(Fi)return mm(A,rn.connection("CONNECTION_DESTROYED",n));if(A.cancelled)return;try{return A.state=E,_?G.push(A):(_=A,_.active=!0),JS(A),vi($S(A))&&!A.describeFirst&&!A.cursorFn&&G.length<K&&(!A.options.onexecute||A.options.onexecute(Ri))}catch(W){return G.length===0&&vi(wc),Wo(W),!0}}function $S(A){if(A.parameters.length>=65534)throw rn.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return A.options.simple?s().Q().str(A.statement.string+s.N).end():A.describeFirst?Buffer.concat([F0(A),_R]):A.prepare?A.prepared?xm(A):Buffer.concat([F0(A),xm(A)]):wS(A)}function F0(A){return Buffer.concat([G0(A.statement.string,A.parameters,A.statement.types,A.statement.name),dS("S",A.statement.name)])}function xm(A){return Buffer.concat([rS(A.parameters,A.statement.types,A.statement.name,A.cursorName),A.cursorFn?M0("",A.cursorRows):fM])}function wS(A){return Buffer.concat([G0(A.statement.string,A.parameters,A.statement.types),vM,xm(A)])}function JS(A){let W=[],P=[],Sn=j$(A,A.strings[0],A.args[0],W,P,n);!A.tagged&&A.args.forEach((In)=>Za(In,W,P,n)),A.prepare=n.prepare&&("prepare"in A.options?A.options.prepare:!0),A.string=Sn,A.signature=A.prepare&&P+Sn,A.onlyDescribe&&delete Vi[A.signature],A.parameters=A.parameters||W,A.prepared=A.prepare&&A.signature in Vi,A.describeFirst=A.onlyDescribe||W.length&&!A.prepared,A.statement=A.prepared?Vi[A.signature]:{string:Sn,types:P,name:A.prepare?Oo+O++:""},typeof n.debug==="function"&&n.debug(z,Sn,W,P)}function vi(A,W){if(jn=jn?Buffer.concat([jn,A]):Buffer.from(A),W||jn.length>=1024)return T0(W);return Bn===null&&(Bn=setImmediate(T0)),!0}function T0(A){let W=H.write(jn,A);return Bn!==null&&clearImmediate(Bn),jn=Bn=null,W}function AS(){Wo(rn.connection("CONNECT_TIMEOUT",n,H)),H.destroy()}async function R0(){if(vi(aM),!await new Promise((W)=>H.once("data",(P)=>W(P[0]===83)))&&x==="prefer")return tc();H.removeAllListeners(),H=xM.connect({socket:H,servername:UR.isIP(H.host)?void 0:H.host,...x==="require"||x==="allow"||x==="prefer"?{rejectUnauthorized:!1}:x==="verify-full"?{}:typeof x==="object"?x:{}}),H.on("secureConnect",tc),H.on("error",rc),H.on("close",K0),H.on("drain",S0)}function S0(){!_&&o(Ri)}function af(A){if(bn){if(bn.push(A),Rn-=A.length,Rn>=0)return}fn=bn?Buffer.concat(bn,vn-Rn):fn.length===0?A:Buffer.concat([fn,A],fn.length+A.length);while(fn.length>4){if(vn=fn.readUInt32BE(1),vn>=fn.length){Rn=vn-fn.length,bn=[fn];break}try{FS(fn.subarray(0,vn+1))}catch(W){_&&(_.cursorFn||_.describeFirst)&&vi(wc),Wo(W)}fn=fn.subarray(vn+1),Rn=0,bn=null}}async function X0(){if(Fi=!1,dn={},H||(H=await fS()),!H)return;if(y.start(),n.socket)return x?R0():tc();if(H.on("connect",x?R0:tc),n.path)return H.connect(n.path);H.ssl=x,H.connect(v[Dn],f[Dn]),H.host=f[Dn],H.port=v[Dn],Dn=(Dn+1)%v.length}function W0(){setTimeout(X0,q?q+_n-VR.now():0)}function tc(){try{Vi={},En=n.fetch_types,Oo=Math.random().toString(36).slice(2),O=1,b.start(),H.on("data",af),M&&H.setKeepAlive&&H.setKeepAlive(!0,1000*M);let A=eS();vi(A)}catch(A){rc(A)}}function rc(A){if(Ri.queue===i.connecting&&n.host[gn+1])return;Wo(A);while(G.length)mm(G.shift(),A)}function Wo(A){en&&(en.destroy(A),en=null),_&&mm(_,A),Ti&&(mm(Ti,A),Ti=null)}function mm(A,W){"query"in W||"parameters"in W||Object.defineProperties(W,{stack:{value:W.stack+A.origin.replace(/.*\n/,`
61
+ `),enumerable:n.debug},query:{value:A.string,enumerable:n.debug},parameters:{value:A.parameters,enumerable:n.debug},args:{value:A.args,enumerable:n.debug},types:{value:A.statement&&A.statement.types,enumerable:n.debug}}),A.reject(W)}function ff(){return ho||(!Ri.reserved&&c(Ri),!Ri.reserved&&!Ti&&!_&&G.length===0?(ox(),new Promise((A)=>H&&H.readyState!=="closed"?H.once("close",A):A())):ho=new Promise((A)=>po=A))}function ox(){if(Fi=!0,en||_||Ti||G.length)rc(rn.connection("CONNECTION_DESTROYED",n));if(clearImmediate(Bn),H)H.removeListener("data",af),H.removeListener("connect",tc),H.readyState==="open"&&H.end(s().X().end());po&&(po(),ho=po=null)}async function K0(A){if(fn=Buffer.alloc(0),Rn=0,bn=null,clearImmediate(Bn),H.removeListener("data",af),H.removeListener("connect",tc),Q.cancel(),b.cancel(),y.cancel(),H.removeAllListeners(),H=null,Ti)return W0();!A&&(_||G.length)&&rc(rn.connection("CONNECTION_CLOSED",n,H)),q=VR.now(),A&&n.shared.retries++,_n=(typeof Y==="function"?Y(n.shared.retries):Y)*1000,p(Ri,rn.connection("CONNECTION_CLOSED",n,H))}function FS(A,W=A[0]){(W===68?TS:W===100?IS:W===65?jS:W===83?RS:W===90?SS:W===67?XS:W===50?l0:W===49?WS:W===116?KS:W===84?lS:W===82?GS:W===110?ES:W===75?OS:W===69?uS:W===115?DS:W===51?LS:W===71?NS:W===78?kS:W===72?hS:W===99?yS:W===73?ZS:W===86?qS:W===118?sS:W===87?CS:PS)(A)}function TS(A){let W=7,P,Sn,In,Si=_.isRaw?new Array(_.statement.columns.length):{};for(let zi=0;zi<_.statement.columns.length;zi++)Sn=_.statement.columns[zi],P=A.readInt32BE(W),W+=4,In=P===-1?null:_.isRaw===!0?A.subarray(W,W+=P):Sn.parser===void 0?A.toString("utf8",W,W+=P):Sn.parser.array===!0?Sn.parser(A.toString("utf8",W+1,W+=P)):Sn.parser(A.toString("utf8",W,W+=P)),_.isRaw?Si[zi]=_.isRaw===!0?In:J.value.from?J.value.from(In,Sn):In:Si[Sn.name]=J.value.from?J.value.from(In,Sn):In;_.forEachFn?_.forEachFn(J.row.from?J.row.from(Si):Si,Z):Z[Pn++]=J.row.from?J.row.from(Si):Si}function RS(A){let[W,P]=A.toString("utf8",5,A.length-1).split(s.N);if(dn[W]=P,n.parameters[W]!==P)n.parameters[W]=P,R&&R(W,P)}function SS(A){if(_&&_.options.simple&&_.resolve(co||Z),_=co=null,Z=new qc,y.cancel(),Ti){if(I){if(!dn.in_hot_standby||!dn.default_transaction_read_only)return bS();else if(_S(I,dn))return ox()}if(En)return Ti===!0&&(Ti=null),US();Ti!==!0&&ix(Ti),n.shared.retries=gn=0,Ti=null;return}while(G.length&&(_=G.shift())&&(_.active=!0,_.cancelled))uR(n).cancel(_.state,_.cancelled.resolve,_.cancelled.reject);if(_)return;Ri.reserved?!Ri.reserved.release&&A[5]===73?ho?ox():(Ri.reserved=null,o(Ri)):Ri.reserved():ho?ox():o(Ri)}function XS(A){Pn=0;for(let W=A.length-1;W>0;W--){if(A[W]===32&&A[W+1]<58&&Z.count===null)Z.count=+A.toString("utf8",W+1,A.length-1);if(A[W-1]>=65){Z.command=A.toString("utf8",5,W),Z.state=E;break}}if(nx&&(nx(),nx=null),Z.command==="BEGIN"&&m!==1&&!Ri.reserved)return Wo(rn.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(_.options.simple)return l0();if(_.cursorFn)Z.count&&_.cursorFn(Z),vi(wc);_.resolve(Z)}function WS(){_.parsing=!1}function l0(){!Z.statement&&(Z.statement=_.statement),Z.columns=_.statement.columns}function KS(A){let W=A.readUInt16BE(5);for(let P=0;P<W;++P)!_.statement.types[P]&&(_.statement.types[P]=A.readUInt32BE(7+P*4));_.prepare&&(Vi[_.signature]=_.statement),_.describeFirst&&!_.onlyDescribe&&(vi(xm(_)),_.describeFirst=!1)}function lS(A){if(Z.command)co=co||[Z],co.push(Z=new qc),Z.count=null,_.statement.columns=null;let W=A.readUInt16BE(5),P=7,Sn;_.statement.columns=Array(W);for(let In=0;In<W;++In){Sn=P;while(A[P++]!==0);let Si=A.readUInt32BE(P),zi=A.readUInt16BE(P+4),Co=A.readUInt32BE(P+6);_.statement.columns[In]={name:J.column.from?J.column.from(A.toString("utf8",Sn,P-1)):A.toString("utf8",Sn,P-1),parser:w[Co],table:Si,number:zi,type:Co},P+=18}if(Z.statement=_.statement,_.onlyDescribe)return _.resolve(_.statement),vi(wc)}async function GS(A,W=A.readUInt32BE(5)){(W===3?MS:W===5?YS:W===10?HS:W===11?zS:W===12?QS:W!==0?tS:tp)(A,W)}async function MS(){let A=await vf();vi(s().p().str(A).z(1).end())}async function YS(A){let W="md5"+await bR(Buffer.concat([Buffer.from(await bR(await vf()+a)),A.subarray(9)]));vi(s().p().str(W).z(1).end())}async function HS(){Xo=(await ex.randomBytes(18)).toString("base64"),s().p().str("SCRAM-SHA-256"+s.N);let A=s.i;vi(s.inc(4).str("n,,n=*,r="+Xo).i32(s.i-A-4,A).end())}async function zS(A){let W=A.toString("utf8",9).split(",").reduce((zi,Co)=>(zi[Co[0]]=Co.slice(2),zi),{}),P=await ex.pbkdf2Sync(await vf(),Buffer.from(W.s,"base64"),parseInt(W.i),32,"sha256"),Sn=await Pa(P,"Client Key"),In="n=*,r="+Xo+",r="+W.r+",s="+W.s+",i="+W.i+",c=biws,r="+W.r;Nn=(await Pa(await Pa(P,"Server Key"),In)).toString("base64");let Si="c=biws,r="+W.r+",p="+AM(Sn,Buffer.from(await Pa(await JM(Sn),In))).toString("base64");vi(s().p().str(Si).end())}function QS(A){if(A.toString("utf8",9).split(s.N,1)[0].slice(2)===Nn)return;Wo(rn.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),H.destroy()}function vf(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function ES(){if(Z.statement=_.statement,Z.statement.columns=[],_.onlyDescribe)return _.resolve(_.statement),vi(wc)}function OS(A){E.pid=A.readUInt32BE(5),E.secret=A.readUInt32BE(9)}async function US(){En=!1,(await new oo([`
62
62
  select b.oid, b.typarray
63
63
  from pg_catalog.pg_type a
64
64
  left join pg_catalog.pg_type b on b.oid = a.typelem
65
65
  where a.typcategory = 'A'
66
66
  group by b.oid, b.typarray
67
67
  order by b.oid
68
- `],[],ix)).forEach(({oid:X,typarray:P})=>Hl(X,P))}function Hl(A,X){if(!!n.parsers[X]&&!!n.serializers[X])return;let P=n.parsers[A];n.shared.typeArrayMap[A]=X,n.parsers[X]=(ln)=>GR(ln,P,X),n.parsers[X].array=!0,n.serializers[X]=(ln)=>WR(ln,n.serializers[A],n,X)}function zl(A,X){return A==="read-write"&&X.default_transaction_read_only==="on"||A==="read-only"&&X.default_transaction_read_only==="off"||A==="primary"&&X.in_hot_standby==="on"||A==="standby"&&X.in_hot_standby==="off"||A==="prefer-standby"&&X.in_hot_standby==="off"&&n.host[dn]}function Ql(){let A=new io([`
68
+ `],[],ix)).forEach(({oid:W,typarray:P})=>VS(W,P))}function VS(A,W){if(!!n.parsers[W]&&!!n.serializers[W])return;let P=n.parsers[A];n.shared.typeArrayMap[A]=W,n.parsers[W]=(Sn)=>ER(Sn,P,W),n.parsers[W].array=!0,n.serializers[W]=(Sn)=>QR(Sn,n.serializers[A],n,W)}function _S(A,W){return A==="read-write"&&W.default_transaction_read_only==="on"||A==="read-only"&&W.default_transaction_read_only==="off"||A==="primary"&&W.in_hot_standby==="on"||A==="standby"&&W.in_hot_standby==="off"||A==="prefer-standby"&&W.in_hot_standby==="off"&&n.host[gn]}function bS(){let A=new oo([`
69
69
  show transaction_read_only;
70
70
  select pg_catalog.pg_is_in_recovery()
71
- `],[],ix,null,{simple:!0});A.resolve=([[X],[P]])=>{gn.default_transaction_read_only=X.transaction_read_only,gn.in_hot_standby=P.pg_is_in_recovery?"on":"off"},A.execute()}function El(A){_&&(_.cursorFn||_.describeFirst)&&vi(wc);let X=rn.postgres(y$(A));_&&_.retried?So(_.retried):_&&_.prepared&&pY.has(X.routine)?Ol(_,X):So(X)}function Ol(A,X){delete _i[A.signature],A.retried=X,ix(A)}function Ul(A){if(!S)return;let X=9;while(A[X++]!==0);S(A.toString("utf8",9,X-1),A.toString("utf8",X,A.length-1))}async function Vl(){try{let A=await Promise.resolve(_.cursorFn(Z));Pn=0,A===qp?vi(sl(_.portal)):(Z=new sc,vi(G0("",_.cursorRows)))}catch(A){vi(wc),_.reject(A)}}function _l(){Z.count&&_.cursorFn(Z),_.resolve(Z)}function Bl(){en=new I$.Writable({autoDestroy:!0,write(A,X,P){H.write(q().d().raw(A).end(),P)},destroy(A,X){X(A),H.write(q().f().str(A+q.N).end()),en=null},final(A){H.write(q().c().end()),nx=A}}),_.resolve(en)}function bl(){en=new I$.Readable({read(){H.resume()}}),_.resolve(en)}function jl(){en=new I$.Duplex({autoDestroy:!0,read(){H.resume()},write(A,X,P){H.write(q().d().raw(A).end(),P)},destroy(A,X){X(A),H.write(q().f().str(A+q.N).end()),en=null},final(A){H.write(q().c().end()),nx=A}}),_.resolve(en)}function Dl(A){en&&(en.push(A.subarray(5))||H.pause())}function Ll(){en&&en.push(null),en=null}function ul(A){l?l(y$(A)):console.log(y$(A))}function Nl(){}function hl(){So(rn.notSupported("FunctionCallResponse"))}function Cl(){So(rn.notSupported("NegotiateProtocolVersion"))}function Il(A){console.error("Postgres.js : Unknown Message:",A[0])}function yl(A,X){console.error("Postgres.js : Unknown Auth:",X)}function kl(A,X,P="",ln=""){let In,li;return q().B().str(ln+q.N).str(P+q.N).i16(0).i16(A.length),A.forEach((Qi,Co)=>{if(Qi===null)return q.i32(4294967295);li=X[Co],A[Co]=Qi=li in n.serializers?n.serializers[li](Qi):""+Qi,In=q.i,q.inc(4).str(Qi).i32(q.i-In-4,In)}),q.i16(0),q.end()}function W0(A,X,P,ln=""){return q().P().str(ln+q.N).str(A+q.N).i16(X.length),X.forEach((In,li)=>q.i32(P[li]||0)),q.end()}function Zl(A,X=""){return q().D().str(A).str(X+q.N).end()}function G0(A="",X=0){return Buffer.concat([q().E().str(A+q.N).i32(X).end(),zR])}function sl(A=""){return Buffer.concat([q().C().str("P").str(A+q.N).end(),q().S().end()])}function ql(){return an||q().inc(4).i16(3).z(2).str(Object.entries(Object.assign({user:a,database:$,client_encoding:"UTF8"},n.connection)).filter(([,A])=>A).map(([A,X])=>A+q.N+X).join(q.N)).z(2).end(0)}}function y$(n){let i={},o=5;for(let c=5;c<n.length-1;c++)if(n[c]===0)i[xY[n[o]]]=n.toString("utf8",o+1,c),o=c+1;return i}function QR(n){return dx.createHash("md5").update(n).digest("hex")}function qa(n,i){return dx.createHmac("sha256",n).update(i).digest()}function mY(n){return dx.createHash("sha256").update(n).digest()}function aY(n,i){let o=Math.max(n.length,i.length),c=Buffer.allocUnsafe(o);for(let p=0;p<o;p++)c[p]=n[p]^i[p];return c}function k$(n,i){if(i=typeof i==="function"?i():i,!i)return{cancel:tp,start:tp};let o;return{cancel(){o&&(clearTimeout(o),o=null)},start(){o&&clearTimeout(o),o=setTimeout(c,i*1000,arguments)}};function c(p){n.apply(null,p),o=null}}var OR=()=>{};function s$(n,i){let o=new Map,c="postgresjs_"+Math.random().toString(36).slice(2),p={},x,m,a=!1,f=w.sql=n({...i,transform:{column:{},value:{},row:{}},max:1,fetch_types:!1,idle_timeout:null,max_lifetime:null,connection:{...i.connection,replication:"database"},onclose:async function(){if(a)return;m=null,p.pid=p.secret=void 0,J(await l(f,c,i.publications)),o.forEach((R)=>R.forEach(({onsubscribe:K})=>K()))},no_subscribe:!0}),v=f.end,$=f.close;return f.end=async()=>{return a=!0,m&&await new Promise((R)=>(m.once("close",R),m.end())),v()},f.close=async()=>{return m&&await new Promise((R)=>(m.once("close",R),m.end())),$()},w;async function w(R,K,Y=OR,M=OR){if(R=$Y(R),!x)x=l(f,c,i.publications);let I={fn:K,onsubscribe:Y},G=o.has(R)?o.get(R).add(I):o.set(R,new Set([I])).get(R),z=()=>{G.delete(I),G.size===0&&o.delete(R)};return x.then((E)=>{return J(E),Y(),m&&m.on("error",M),{unsubscribe:z,state:p,sql:f}})}function J(R){m=R.stream,p.pid=R.state.pid,p.secret=R.state.secret}async function l(R,K,Y){if(!Y)throw new Error("Missing publication names");let M=await R.unsafe(`CREATE_REPLICATION_SLOT ${K} TEMPORARY LOGICAL pgoutput NOEXPORT_SNAPSHOT`),[I]=M,G=await R.unsafe(`START_REPLICATION SLOT ${K} LOGICAL ${I.consistent_point} (proto_version '1', publication_names '${Y}')`).writable(),z={lsn:Buffer.concat(I.consistent_point.split("/").map((H)=>Buffer.from(("00000000"+H).slice(-8),"hex")))};return G.on("data",Q),G.on("error",E),G.on("close",R.close),{stream:G,state:M.state};function E(H){console.error("Unexpected error during logical streaming - reconnecting",H)}function Q(H){if(H[0]===119)vY(H.subarray(25),z,R.options.parsers,B,i.transform);else if(H[0]===107&&H[17])z.lsn=H.subarray(1,9),y()}function B(H,an){let Z=an.relation.schema+"."+an.relation.table;S("*",H,an),S("*:"+Z,H,an),an.relation.keys.length&&S("*:"+Z+"="+an.relation.keys.map((fn)=>H[fn.name]),H,an),S(an.command,H,an),S(an.command+":"+Z,H,an),an.relation.keys.length&&S(an.command+":"+Z+"="+an.relation.keys.map((fn)=>H[fn.name]),H,an)}function y(){let H=Buffer.alloc(34);H[0]=114,H.fill(z.lsn,1),H.writeBigInt64BE(BigInt(Date.now()-Date.UTC(2000,0,1))*BigInt(1000),25),G.write(H)}}function S(R,K,Y){o.has(R)&&o.get(R).forEach(({fn:M})=>M(K,Y,R))}}function fY(n){return new Date(Date.UTC(2000,0,1)+Number(n/BigInt(1000)))}function vY(n,i,o,c,p){let x=(m,[a,f])=>(m[a.charCodeAt(0)]=f,m);Object.entries({R:(m)=>{let a=1,f=i[m.readUInt32BE(a)]={schema:m.toString("utf8",a+=4,a=m.indexOf(0,a))||"pg_catalog",table:m.toString("utf8",a+1,a=m.indexOf(0,a+1)),columns:Array(m.readUInt16BE(a+=2)),keys:[]};a+=2;let v=0,$;while(a<m.length)$=f.columns[v++]={key:m[a++],name:p.column.from?p.column.from(m.toString("utf8",a,a=m.indexOf(0,a))):m.toString("utf8",a,a=m.indexOf(0,a)),type:m.readUInt32BE(a+=1),parser:o[m.readUInt32BE(a)],atttypmod:m.readUInt32BE(a+=4)},$.key&&f.keys.push($),a+=4},Y:()=>{},O:()=>{},B:(m)=>{i.date=fY(m.readBigInt64BE(9)),i.lsn=m.subarray(1,9)},I:(m)=>{let a=1,f=i[m.readUInt32BE(a)],{row:v}=Pa(m,f.columns,a+=7,p);c(v,{command:"insert",relation:f})},D:(m)=>{let a=1,f=i[m.readUInt32BE(a)];a+=4;let v=m[a]===75;c(v||m[a]===79?Pa(m,f.columns,a+=3,p).row:null,{command:"delete",relation:f,key:v})},U:(m)=>{let a=1,f=i[m.readUInt32BE(a)];a+=4;let v=m[a]===75,$=v||m[a]===79?Pa(m,f.columns,a+=3,p):null;$&&(a=$.i);let{row:w}=Pa(m,f.columns,a+3,p);c(w,{command:"update",relation:f,key:v,old:$&&$.row})},T:()=>{},C:()=>{}}).reduce(x,{})[n[0]](n)}function Pa(n,i,o,c){let p,x,m,a=c.raw?new Array(i.length):{};for(let f=0;f<i.length;f++)p=n[o++],x=i[f],m=p===110?null:p===117?void 0:x.parser===void 0?n.toString("utf8",o+4,o+=4+n.readUInt32BE(o)):x.parser.array===!0?x.parser(n.toString("utf8",o+5,o+=4+n.readUInt32BE(o))):x.parser(n.toString("utf8",o+4,o+=4+n.readUInt32BE(o))),c.raw?a[f]=c.raw===!0?m:c.value.from?c.value.from(m,x):m:a[x.name]=c.value.from?c.value.from(m,x):m;return{i:o,row:c.row.from?c.row.from(a):a}}function $Y(n){let i=n.match(/^(\*|insert|update|delete)?:?([^.]+?\.?[^=]+)?=?(.+)?/i)||[];if(!i)throw new Error("Malformed subscribe pattern: "+n);let[,o,c,p]=i;return(o||"*")+(c?":"+(c.indexOf(".")===-1?"public."+c:c):"")+(p?"="+p:"")}import UR from"stream";function q$(n,i,o=393216){return new Promise(async(c,p)=>{await n.begin(async(x)=>{let m;!i&&([{oid:i}]=await x`select lo_creat(-1) as oid`);let[{fd:a}]=await x`select lo_open(${i}, ${o}) as fd`,f={writable:$,readable:v,close:()=>x`select lo_close(${a})`.then(m),tell:()=>x`select lo_tell64(${a})`,read:(w)=>x`select loread(${a}, ${w}) as data`,write:(w)=>x`select lowrite(${a}, ${w})`,truncate:(w)=>x`select lo_truncate64(${a}, ${w})`,seek:(w,J=0)=>x`select lo_lseek64(${a}, ${w}, ${J})`,size:()=>x`
71
+ `],[],ix,null,{simple:!0});A.resolve=([[W],[P]])=>{dn.default_transaction_read_only=W.transaction_read_only,dn.in_hot_standby=P.pg_is_in_recovery?"on":"off"},A.execute()}function uS(A){_&&(_.cursorFn||_.describeFirst)&&vi(wc);let W=rn.postgres(k$(A));_&&_.retried?Wo(_.retried):_&&_.prepared&&$M.has(W.routine)?BS(_,W):Wo(W)}function BS(A,W){delete Vi[A.signature],A.retried=W,ix(A)}function jS(A){if(!X)return;let W=9;while(A[W++]!==0);X(A.toString("utf8",9,W-1),A.toString("utf8",W,A.length-1))}async function DS(){try{let A=await Promise.resolve(_.cursorFn(Z));Pn=0,A===sp?vi(gS(_.portal)):(Z=new qc,vi(M0("",_.cursorRows)))}catch(A){vi(wc),_.reject(A)}}function LS(){Z.count&&_.cursorFn(Z),_.resolve(Z)}function NS(){en=new y$.Writable({autoDestroy:!0,write(A,W,P){H.write(s().d().raw(A).end(),P)},destroy(A,W){W(A),H.write(s().f().str(A+s.N).end()),en=null},final(A){H.write(s().c().end()),nx=A}}),_.resolve(en)}function hS(){en=new y$.Readable({read(){H.resume()}}),_.resolve(en)}function CS(){en=new y$.Duplex({autoDestroy:!0,read(){H.resume()},write(A,W,P){H.write(s().d().raw(A).end(),P)},destroy(A,W){W(A),H.write(s().f().str(A+s.N).end()),en=null},final(A){H.write(s().c().end()),nx=A}}),_.resolve(en)}function IS(A){en&&(en.push(A.subarray(5))||H.pause())}function yS(){en&&en.push(null),en=null}function kS(A){S?S(k$(A)):console.log(k$(A))}function ZS(){}function qS(){Wo(rn.notSupported("FunctionCallResponse"))}function sS(){Wo(rn.notSupported("NegotiateProtocolVersion"))}function PS(A){console.error("Postgres.js : Unknown Message:",A[0])}function tS(A,W){console.error("Postgres.js : Unknown Auth:",W)}function rS(A,W,P="",Sn=""){let In,Si;return s().B().str(Sn+s.N).str(P+s.N).i16(0).i16(A.length),A.forEach((zi,Co)=>{if(zi===null)return s.i32(4294967295);Si=W[Co],A[Co]=zi=Si in n.serializers?n.serializers[Si](zi):""+zi,In=s.i,s.inc(4).str(zi).i32(s.i-In-4,In)}),s.i16(0),s.end()}function G0(A,W,P,Sn=""){return s().P().str(Sn+s.N).str(A+s.N).i16(W.length),W.forEach((In,Si)=>s.i32(P[Si]||0)),s.end()}function dS(A,W=""){return s().D().str(A).str(W+s.N).end()}function M0(A="",W=0){return Buffer.concat([s().E().str(A+s.N).i32(W).end(),_R])}function gS(A=""){return Buffer.concat([s().C().str("P").str(A+s.N).end(),s().S().end()])}function eS(){return an||s().inc(4).i16(3).z(2).str(Object.entries(Object.assign({user:a,database:$,client_encoding:"UTF8"},n.connection)).filter(([,A])=>A).map(([A,W])=>A+s.N+W).join(s.N)).z(2).end(0)}}function k$(n){let i={},o=5;for(let c=5;c<n.length-1;c++)if(n[c]===0)i[wM[n[o]]]=n.toString("utf8",o+1,c),o=c+1;return i}function bR(n){return ex.createHash("md5").update(n).digest("hex")}function Pa(n,i){return ex.createHmac("sha256",n).update(i).digest()}function JM(n){return ex.createHash("sha256").update(n).digest()}function AM(n,i){let o=Math.max(n.length,i.length),c=Buffer.allocUnsafe(o);for(let p=0;p<o;p++)c[p]=n[p]^i[p];return c}function Z$(n,i){if(i=typeof i==="function"?i():i,!i)return{cancel:tp,start:tp};let o;return{cancel(){o&&(clearTimeout(o),o=null)},start(){o&&clearTimeout(o),o=setTimeout(c,i*1000,arguments)}};function c(p){n.apply(null,p),o=null}}var BR=()=>{};function s$(n,i){let o=new Map,c="postgresjs_"+Math.random().toString(36).slice(2),p={},x,m,a=!1,f=w.sql=n({...i,transform:{column:{},value:{},row:{}},max:1,fetch_types:!1,idle_timeout:null,max_lifetime:null,connection:{...i.connection,replication:"database"},onclose:async function(){if(a)return;m=null,p.pid=p.secret=void 0,J(await S(f,c,i.publications)),o.forEach((R)=>R.forEach(({onsubscribe:K})=>K()))},no_subscribe:!0}),v=f.end,$=f.close;return f.end=async()=>{return a=!0,m&&await new Promise((R)=>(m.once("close",R),m.end())),v()},f.close=async()=>{return m&&await new Promise((R)=>(m.once("close",R),m.end())),$()},w;async function w(R,K,M=BR,Y=BR){if(R=RM(R),!x)x=S(f,c,i.publications);let I={fn:K,onsubscribe:M},G=o.has(R)?o.get(R).add(I):o.set(R,new Set([I])).get(R),z=()=>{G.delete(I),G.size===0&&o.delete(R)};return x.then((E)=>{return J(E),M(),m&&m.on("error",Y),{unsubscribe:z,state:p,sql:f}})}function J(R){m=R.stream,p.pid=R.state.pid,p.secret=R.state.secret}async function S(R,K,M){if(!M)throw new Error("Missing publication names");let Y=await R.unsafe(`CREATE_REPLICATION_SLOT ${K} TEMPORARY LOGICAL pgoutput NOEXPORT_SNAPSHOT`),[I]=Y,G=await R.unsafe(`START_REPLICATION SLOT ${K} LOGICAL ${I.consistent_point} (proto_version '1', publication_names '${M}')`).writable(),z={lsn:Buffer.concat(I.consistent_point.split("/").map((H)=>Buffer.from(("00000000"+H).slice(-8),"hex")))};return G.on("data",Q),G.on("error",E),G.on("close",R.close),{stream:G,state:Y.state};function E(H){console.error("Unexpected error during logical streaming - reconnecting",H)}function Q(H){if(H[0]===119)TM(H.subarray(25),z,R.options.parsers,b,i.transform);else if(H[0]===107&&H[17])z.lsn=H.subarray(1,9),y()}function b(H,an){let Z=an.relation.schema+"."+an.relation.table;X("*",H,an),X("*:"+Z,H,an),an.relation.keys.length&&X("*:"+Z+"="+an.relation.keys.map((fn)=>H[fn.name]),H,an),X(an.command,H,an),X(an.command+":"+Z,H,an),an.relation.keys.length&&X(an.command+":"+Z+"="+an.relation.keys.map((fn)=>H[fn.name]),H,an)}function y(){let H=Buffer.alloc(34);H[0]=114,H.fill(z.lsn,1),H.writeBigInt64BE(BigInt(Date.now()-Date.UTC(2000,0,1))*BigInt(1000),25),G.write(H)}}function X(R,K,M){o.has(R)&&o.get(R).forEach(({fn:Y})=>Y(K,M,R))}}function FM(n){return new Date(Date.UTC(2000,0,1)+Number(n/BigInt(1000)))}function TM(n,i,o,c,p){let x=(m,[a,f])=>(m[a.charCodeAt(0)]=f,m);Object.entries({R:(m)=>{let a=1,f=i[m.readUInt32BE(a)]={schema:m.toString("utf8",a+=4,a=m.indexOf(0,a))||"pg_catalog",table:m.toString("utf8",a+1,a=m.indexOf(0,a+1)),columns:Array(m.readUInt16BE(a+=2)),keys:[]};a+=2;let v=0,$;while(a<m.length)$=f.columns[v++]={key:m[a++],name:p.column.from?p.column.from(m.toString("utf8",a,a=m.indexOf(0,a))):m.toString("utf8",a,a=m.indexOf(0,a)),type:m.readUInt32BE(a+=1),parser:o[m.readUInt32BE(a)],atttypmod:m.readUInt32BE(a+=4)},$.key&&f.keys.push($),a+=4},Y:()=>{},O:()=>{},B:(m)=>{i.date=FM(m.readBigInt64BE(9)),i.lsn=m.subarray(1,9)},I:(m)=>{let a=1,f=i[m.readUInt32BE(a)],{row:v}=ta(m,f.columns,a+=7,p);c(v,{command:"insert",relation:f})},D:(m)=>{let a=1,f=i[m.readUInt32BE(a)];a+=4;let v=m[a]===75;c(v||m[a]===79?ta(m,f.columns,a+=3,p).row:null,{command:"delete",relation:f,key:v})},U:(m)=>{let a=1,f=i[m.readUInt32BE(a)];a+=4;let v=m[a]===75,$=v||m[a]===79?ta(m,f.columns,a+=3,p):null;$&&(a=$.i);let{row:w}=ta(m,f.columns,a+3,p);c(w,{command:"update",relation:f,key:v,old:$&&$.row})},T:()=>{},C:()=>{}}).reduce(x,{})[n[0]](n)}function ta(n,i,o,c){let p,x,m,a=c.raw?new Array(i.length):{};for(let f=0;f<i.length;f++)p=n[o++],x=i[f],m=p===110?null:p===117?void 0:x.parser===void 0?n.toString("utf8",o+4,o+=4+n.readUInt32BE(o)):x.parser.array===!0?x.parser(n.toString("utf8",o+5,o+=4+n.readUInt32BE(o))):x.parser(n.toString("utf8",o+4,o+=4+n.readUInt32BE(o))),c.raw?a[f]=c.raw===!0?m:c.value.from?c.value.from(m,x):m:a[x.name]=c.value.from?c.value.from(m,x):m;return{i:o,row:c.row.from?c.row.from(a):a}}function RM(n){let i=n.match(/^(\*|insert|update|delete)?:?([^.]+?\.?[^=]+)?=?(.+)?/i)||[];if(!i)throw new Error("Malformed subscribe pattern: "+n);let[,o,c,p]=i;return(o||"*")+(c?":"+(c.indexOf(".")===-1?"public."+c:c):"")+(p?"="+p:"")}import jR from"node:stream";function P$(n,i,o=393216){return new Promise(async(c,p)=>{await n.begin(async(x)=>{let m;!i&&([{oid:i}]=await x`select lo_creat(-1) as oid`);let[{fd:a}]=await x`select lo_open(${i}, ${o}) as fd`,f={writable:$,readable:v,close:()=>x`select lo_close(${a})`.then(m),tell:()=>x`select lo_tell64(${a})`,read:(w)=>x`select loread(${a}, ${w}) as data`,write:(w)=>x`select lowrite(${a}, ${w})`,truncate:(w)=>x`select lo_truncate64(${a}, ${w})`,seek:(w,J=0)=>x`select lo_lseek64(${a}, ${w}, ${J})`,size:()=>x`
72
72
  select
73
73
  lo_lseek64(${a}, location, 0) as position,
74
74
  seek.size
@@ -78,10 +78,10 @@ ${m.trace}`:"No previous disposal trace was found."),c.type){case"atom_family":c
78
78
  tell.location
79
79
  from (select lo_tell64($1) as location) tell
80
80
  ) seek
81
- `};return c(f),new Promise(async(w)=>m=w);async function v({highWaterMark:w=16384,start:J=0,end:l=1/0}={}){let S=l-J;return J&&await f.seek(J),new UR.Readable({highWaterMark:w,async read(R){let K=R>S?R-S:R;S-=R;let[{data:Y}]=await f.read(K);if(this.push(Y),Y.length<R)this.push(null)}})}async function $({highWaterMark:w=16384,start:J=0}={}){return J&&await f.seek(J),new UR.Writable({highWaterMark:w,write(l,S,R){f.write(l).then(()=>R(),R)}})}}).catch(p)})}Object.assign(ta,{PostgresError:Pp,toPascal:kc,pascal:h$,toCamel:yc,camel:N$,toKebab:Zc,kebab:C$,fromPascal:tx,fromCamel:Px,fromKebab:rx,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var rp=ta;function ta(n,i){let o=AY(n,i),c=o.no_subscribe||s$(ta,{...o}),p=!1,x=yi(),m=yi(),a=yi(),f=yi(),v=yi(),$=yi(),w=yi(),J=yi(),l={connecting:m,reserved:a,closed:f,ended:v,open:$,busy:w,full:J},S=[...Array(o.max)].map(()=>Z$(o,l,{onopen:_i,onend:gn,onclose:Oo})),R=K(B);return Object.assign(R,{get parameters(){return o.parameters},largeObject:q$.bind(null,R),subscribe:c,CLOSE:qp,END:qp,PostgresError:Pp,options:o,reserve:I,listen:Y,begin:G,close:Z,end:an}),R;function K(O){return O.debug=o.debug,Object.entries(o.types).reduce((vn,[_n,Pn])=>{return vn[_n]=(Nn)=>new Eo(Nn,Pn.to),vn},s),Object.assign(Rn,{types:s,typed:s,unsafe:Ln,notify:M,array:Q,json:E,file:dn}),Rn;function s(vn,_n){return new Eo(vn,_n)}function Rn(vn,..._n){return vn&&Array.isArray(vn.raw)?new io(vn,_n,O,H):typeof vn==="string"&&!_n.length?new gx(o.transform.column.to?o.transform.column.to(vn):vn):new ya(vn,_n)}function Ln(vn,_n=[],Pn={}){return arguments.length===2&&!Array.isArray(_n)&&(Pn=_n,_n=[]),new io([vn],_n,O,H,{prepare:!1,...Pn,simple:"simple"in Pn?Pn.simple:_n.length===0})}function dn(vn,_n=[],Pn={}){return arguments.length===2&&!Array.isArray(_n)&&(Pn=_n,_n=[]),new io([],_n,(jn)=>{JY.readFile(vn,"utf8",(Ti,Bn)=>{if(Ti)return jn.reject(Ti);jn.strings=[Bn],O(jn)})},H,{...Pn,simple:"simple"in Pn?Pn.simple:_n.length===0})}}async function Y(O,s,Rn){let Ln={fn:s,onlisten:Rn},dn=Y.sql||(Y.sql=ta({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(Y.channels).forEach(([jn,{listeners:Ti}])=>{delete Y.channels[jn],Promise.all(Ti.map((Bn)=>Y(jn,Bn.fn,Bn.onlisten).catch(()=>{})))})},onnotify(jn,Ti){jn in Y.channels&&Y.channels[jn].listeners.forEach((Bn)=>Bn.fn(Ti))}})),vn=Y.channels||(Y.channels={});if(O in vn){vn[O].listeners.push(Ln);let jn=await vn[O].result;return Ln.onlisten&&Ln.onlisten(),{state:jn.state,unlisten:Nn}}vn[O]={result:dn`listen ${dn.unsafe('"'+O.replace(/"/g,'""')+'"')}`,listeners:[Ln]};let Pn=await vn[O].result;return Ln.onlisten&&Ln.onlisten(),{state:Pn.state,unlisten:Nn};async function Nn(){if(O in vn===!1)return;if(vn[O].listeners=vn[O].listeners.filter((jn)=>jn!==Ln),vn[O].listeners.length)return;return delete vn[O],dn`unlisten ${dn.unsafe('"'+O.replace(/"/g,'""')+'"')}`}}async function M(O,s){return await R`select pg_notify(${O}, ${""+s})`}async function I(){let O=yi(),s=$.length?$.shift():await new Promise((dn)=>{x.push({reserve:dn}),f.length&&En(f.shift())});z(s,a),s.reserved=()=>O.length?s.execute(O.shift()):z(s,a),s.reserved.release=!0;let Rn=K(Ln);return Rn.release=()=>{s.reserved=null,_i(s)},Rn;function Ln(dn){s.queue===J?O.push(dn):s.execute(dn)||z(s,J)}}async function G(O,s){!s&&(s=O,O="");let Rn=yi(),Ln=0,dn,vn=null;try{return await R.unsafe("begin "+O.replace(/[^a-z ]/ig,""),[],{onexecute:Pn}).execute(),await Promise.race([_n(dn,s),new Promise((Nn,jn)=>dn.onclose=jn)])}catch(Nn){throw Nn}async function _n(Nn,jn,Ti){let Bn=K(en);Bn.savepoint=ho,Bn.prepare=(Dn)=>vn=Dn.replace(/[^a-z0-9$-_. ]/gi);let oo,Fi;Ti&&await Bn`savepoint ${Bn(Ti)}`;try{if(Fi=await new Promise((Dn,co)=>{let lo=jn(Bn);Promise.resolve(Array.isArray(lo)?Promise.all(lo):lo).then(Dn,co)}),oo)throw oo}catch(Dn){throw await(Ti?Bn`rollback to ${Bn(Ti)}`:Bn`rollback`),Dn instanceof Pp&&Dn.code==="25P02"&&oo||Dn}if(!Ti)vn?await Bn`prepare transaction '${Bn.unsafe(vn)}'`:await Bn`commit`;return Fi;function ho(Dn,co){if(Dn&&Array.isArray(Dn.raw))return ho((lo)=>lo.apply(lo,arguments));return arguments.length===1&&(co=Dn,Dn=null),_n(Nn,co,"s"+Ln+++(Dn?"_"+Dn:""))}function en(Dn){Dn.catch((co)=>oo||(oo=co)),Nn.queue===J?Rn.push(Dn):Nn.execute(Dn)||z(Nn,J)}}function Pn(Nn){dn=Nn,z(Nn,a),Nn.reserved=()=>Rn.length?Nn.execute(Rn.shift()):z(Nn,a)}}function z(O,s){return O.queue.remove(O),s.push(O),O.queue=s,s===$?O.idleTimer.start():O.idleTimer.cancel(),O}function E(O){return new Eo(O,3802)}function Q(O,s){if(!Array.isArray(O))return Q(Array.from(arguments));return new Eo(O,s||(O.length?Ca(O)||25:0),o.shared.typeArrayMap)}function B(O){if(p)return O.reject(rn.connection("CONNECTION_ENDED",o,o));if($.length)return y($.shift(),O);if(f.length)return En(f.shift(),O);w.length?y(w.shift(),O):x.push(O)}function y(O,s){return O.execute(s)?z(O,w):z(O,J)}function H(O){return new Promise((s,Rn)=>{O.state?O.active?Z$(o).cancel(O.state,s,Rn):O.cancelled={resolve:s,reject:Rn}:(x.remove(O),O.cancelled=!0,O.reject(rn.generic("57014","canceling statement due to user request")),s())})}async function an({timeout:O=null}={}){if(p)return p;await 1;let s;return p=Promise.race([new Promise((Rn)=>O!==null&&(s=setTimeout(fn,O*1000,Rn))),Promise.all(S.map((Rn)=>Rn.end()).concat(Y.sql?Y.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(s))}async function Z(){await Promise.all(S.map((O)=>O.end()))}async function fn(O){await Promise.all(S.map((s)=>s.terminate()));while(x.length)x.shift().reject(rn.connection("CONNECTION_DESTROYED",o));O()}function En(O,s){return z(O,m),O.connect(s),O}function gn(O){z(O,v)}function _i(O){if(x.length===0)return z(O,$);let s=Math.ceil(x.length/(m.length+1)),Rn=!0;while(Rn&&x.length&&s-- >0){let Ln=x.shift();if(Ln.reserve)return Ln.reserve(O);Rn=O.execute(Ln)}Rn?z(O,w):z(O,J)}function Oo(O,s){z(O,f),O.reserved=null,O.onclose&&(O.onclose(s),O.onclose=null),o.onclose&&o.onclose(O.id),x.length&&En(O,x.shift())}}function AY(n,i){if(n&&n.shared)return n;let o=process.env,c=(!n||typeof n==="string"?i:n)||{},{url:p,multihost:x}=SY(n),m=[...p.searchParams].reduce((J,[l,S])=>(J[l]=S,J),{}),a=c.hostname||c.host||x||p.hostname||o.PGHOST||"localhost",f=c.port||p.port||o.PGPORT||5432,v=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||XY();c.no_prepare&&(c.prepare=!1),m.sslmode&&(m.ssl=m.sslmode,delete m.sslmode),"timeout"in c&&(console.log("The timeout option is deprecated, use idle_timeout instead"),c.idle_timeout=c.timeout),m.sslrootcert==="system"&&(m.ssl="verify-full");let $=["idle_timeout","connect_timeout","max_lifetime","max_pipeline","backoff","keep_alive"],w={max:10,ssl:!1,idle_timeout:null,connect_timeout:30,max_lifetime:RY,max_pipeline:100,backoff:FY,keep_alive:60,prepare:!0,debug:!1,fetch_types:!0,publications:"alltables",target_session_attrs:null};return{host:Array.isArray(a)?a:a.split(",").map((J)=>J.split(":")[0]),port:Array.isArray(f)?f:a.split(",").map((J)=>parseInt(J.split(":")[1]||f)),path:c.path||a.indexOf("/")>-1&&a+"/.s.PGSQL."+f,database:c.database||c.db||(p.pathname||"").slice(1)||o.PGDATABASE||v,user:v,pass:c.pass||c.password||p.password||o.PGPASSWORD||"",...Object.entries(w).reduce((J,[l,S])=>{let R=l in c?c[l]:(l in m)?m[l]==="disable"||m[l]==="false"?!1:m[l]:o["PG"+l.toUpperCase()]||S;return J[l]=typeof R==="string"&&$.includes(l)?+R:R,J},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(m).reduce((J,[l,S])=>((l in w)||(J[l]=S),J),{})},types:c.types||{},target_session_attrs:TY(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:lY(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...XR(c.types)}}function TY(n,i,o){let c=n.target_session_attrs||i.searchParams.get("target_session_attrs")||o.PGTARGETSESSIONATTRS;if(!c||["read-write","read-only","primary","standby","prefer-standby"].includes(c))return c;throw new Error("target_session_attrs "+c+" is not supported")}function FY(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function RY(){return 60*(30+Math.random()*30)}function lY(n){return{undefined:n.undefined,column:{from:typeof n.column==="function"?n.column:n.column&&n.column.from,to:n.column&&n.column.to},value:{from:typeof n.value==="function"?n.value:n.value&&n.value.from,to:n.value&&n.value.to},row:{from:typeof n.row==="function"?n.row:n.row&&n.row.from,to:n.row&&n.row.to}}}function SY(n){if(!n||typeof n!=="string")return{url:{searchParams:new Map}};let i=n;i=i.slice(i.indexOf("://")+3).split(/[?/]/)[0],i=decodeURIComponent(i.slice(i.indexOf("@")+1));let o=new URL(n.replace(i,i.split(",")[0]));return{url:{username:decodeURIComponent(o.username),password:decodeURIComponent(o.password),host:o.host,hostname:o.hostname,port:o.port,pathname:o.pathname,searchParams:o.searchParams},multihost:i.indexOf(",")>-1&&i}}function XY(){try{return wY.userInfo().username}catch(n){return process.env.USERNAME||process.env.USER||process.env.LOGNAME}}class kn{static[T]="SelectionProxyHandler";config;constructor(n){this.config={...n}}get(n,i){if(i==="_")return{...n._,selectedFields:new Proxy(n._.selectedFields,this)};if(i===bn)return{...n[bn],selectedFields:new Proxy(n[bn].selectedFields,this)};if(typeof i==="symbol")return n[i];let c=(W(n,ci)?n._.selectedFields:W(n,Bi)?n[bn].selectedFields:n)[i];if(W(c,u.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(W(c,u)){if(this.config.sqlBehavior==="sql")return c;throw new Error(`You tried to reference "${i}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}if(W(c,Un)){if(this.config.alias)return new Proxy(c,new lp(new Proxy(c.table,new zx(this.config.alias,this.config.replaceOriginalName??!1))));return c}if(typeof c!=="object"||c===null)return c;return new Proxy(c,new kn(this.config))}}class ra extends Ei{constructor(n,i,o,c){super();this.session=i,this.dialect=o,this.config={table:n,withList:c}}static[T]="PgDelete";config;where(n){return this.config.where=n,this}returning(n=this.config.table[L.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=ri(n),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:mi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}function KY(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((o)=>o.toLowerCase()).join("_")}function WY(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((o,c,p)=>{let x=p===0?c.toLowerCase():`${c[0].toUpperCase()}${c.slice(1)}`;return o+x},"")}function GY(n){return n}class P${static[T]="CasingCache";cache={};cachedTables={};convert;constructor(n){this.convert=n==="snake_case"?KY:n==="camelCase"?WY:GY}getColumnCasing(n){if(!n.keyAsName)return n.name;let i=n.table[L.Symbol.Schema]??"public",o=n.table[L.Symbol.OriginalName],c=`${i}.${o}.${n.name}`;if(!this.cache[c])this.cacheTable(n.table);return this.cache[c]}cacheTable(n){let i=n[L.Symbol.Schema]??"public",o=n[L.Symbol.OriginalName],c=`${i}.${o}`;if(!this.cachedTables[c]){for(let p of Object.values(n[L.Symbol.Columns])){let x=`${c}.${p.name}`;this.cache[x]=this.convert(p.name)}this.cachedTables[c]=!0}}clearCache(){this.cache={},this.cachedTables={}}}class ex extends Bi{static[T]="PgViewBase"}class qc{static[T]="PgDialect";casing;constructor(n){this.casing=new P$(n?.casing)}async migrate(n,i,o){let c=typeof o==="string"?"__drizzle_migrations":o.migrationsTable??"__drizzle_migrations",p=typeof o==="string"?"drizzle":o.migrationsSchema??"drizzle",x=F`
82
- CREATE TABLE IF NOT EXISTS ${F.identifier(p)}.${F.identifier(c)} (
81
+ `};return c(f),new Promise(async(w)=>m=w);async function v({highWaterMark:w=16384,start:J=0,end:S=1/0}={}){let X=S-J;return J&&await f.seek(J),new jR.Readable({highWaterMark:w,async read(R){let K=R>X?R-X:R;X-=R;let[{data:M}]=await f.read(K);if(this.push(M),M.length<R)this.push(null)}})}async function $({highWaterMark:w=16384,start:J=0}={}){return J&&await f.seek(J),new jR.Writable({highWaterMark:w,write(S,X,R){f.write(S).then(()=>R(),R)}})}}).catch(p)})}Object.assign(ra,{PostgresError:Pp,toPascal:kc,pascal:C$,toCamel:yc,camel:h$,toKebab:Zc,kebab:I$,fromPascal:rx,fromCamel:tx,fromKebab:dx,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var rp=ra;function ra(n,i){let o=WM(n,i),c=o.no_subscribe||s$(ra,{...o}),p=!1,x=ki(),m=ki(),a=ki(),f=ki(),v=ki(),$=ki(),w=ki(),J=ki(),S={connecting:m,reserved:a,closed:f,ended:v,open:$,busy:w,full:J},X=[...Array(o.max)].map(()=>q$(o,S,{onopen:Vi,onend:dn,onclose:Oo})),R=K(b);return Object.assign(R,{get parameters(){return o.parameters},largeObject:P$.bind(null,R),subscribe:c,CLOSE:sp,END:sp,PostgresError:Pp,options:o,reserve:I,listen:M,begin:G,close:Z,end:an}),R;function K(O){return O.debug=o.debug,Object.entries(o.types).reduce((vn,[_n,Pn])=>{return vn[_n]=(Nn)=>new Eo(Nn,Pn.to),vn},q),Object.assign(Rn,{types:q,typed:q,unsafe:Dn,notify:Y,array:Q,json:E,file:gn}),Rn;function q(vn,_n){return new Eo(vn,_n)}function Rn(vn,..._n){return vn&&Array.isArray(vn.raw)?new oo(vn,_n,O,H):typeof vn==="string"&&!_n.length?new gx(o.transform.column.to?o.transform.column.to(vn):vn):new ka(vn,_n)}function Dn(vn,_n=[],Pn={}){return arguments.length===2&&!Array.isArray(_n)&&(Pn=_n,_n=[]),new oo([vn],_n,O,H,{prepare:!1,...Pn,simple:"simple"in Pn?Pn.simple:_n.length===0})}function gn(vn,_n=[],Pn={}){return arguments.length===2&&!Array.isArray(_n)&&(Pn=_n,_n=[]),new oo([],_n,(Bn)=>{XM.readFile(vn,"utf8",(Fi,bn)=>{if(Fi)return Bn.reject(Fi);Bn.strings=[bn],O(Bn)})},H,{...Pn,simple:"simple"in Pn?Pn.simple:_n.length===0})}}async function M(O,q,Rn){let Dn={fn:q,onlisten:Rn},gn=M.sql||(M.sql=ra({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(M.channels).forEach(([Bn,{listeners:Fi}])=>{delete M.channels[Bn],Promise.all(Fi.map((bn)=>M(Bn,bn.fn,bn.onlisten).catch(()=>{})))})},onnotify(Bn,Fi){Bn in M.channels&&M.channels[Bn].listeners.forEach((bn)=>bn.fn(Fi))}})),vn=M.channels||(M.channels={});if(O in vn){vn[O].listeners.push(Dn);let Bn=await vn[O].result;return Dn.onlisten&&Dn.onlisten(),{state:Bn.state,unlisten:Nn}}vn[O]={result:gn`listen ${gn.unsafe('"'+O.replace(/"/g,'""')+'"')}`,listeners:[Dn]};let Pn=await vn[O].result;return Dn.onlisten&&Dn.onlisten(),{state:Pn.state,unlisten:Nn};async function Nn(){if(O in vn===!1)return;if(vn[O].listeners=vn[O].listeners.filter((Bn)=>Bn!==Dn),vn[O].listeners.length)return;return delete vn[O],gn`unlisten ${gn.unsafe('"'+O.replace(/"/g,'""')+'"')}`}}async function Y(O,q){return await R`select pg_notify(${O}, ${""+q})`}async function I(){let O=ki(),q=$.length?$.shift():await new Promise((gn)=>{x.push({reserve:gn}),f.length&&En(f.shift())});z(q,a),q.reserved=()=>O.length?q.execute(O.shift()):z(q,a),q.reserved.release=!0;let Rn=K(Dn);return Rn.release=()=>{q.reserved=null,Vi(q)},Rn;function Dn(gn){q.queue===J?O.push(gn):q.execute(gn)||z(q,J)}}async function G(O,q){!q&&(q=O,O="");let Rn=ki(),Dn=0,gn,vn=null;try{return await R.unsafe("begin "+O.replace(/[^a-z ]/ig,""),[],{onexecute:Pn}).execute(),await Promise.race([_n(gn,q),new Promise((Nn,Bn)=>gn.onclose=Bn)])}catch(Nn){throw Nn}async function _n(Nn,Bn,Fi){let bn=K(en);bn.savepoint=ho,bn.prepare=(jn)=>vn=jn.replace(/[^a-z0-9$-_. ]/gi);let co,Ti;Fi&&await bn`savepoint ${bn(Fi)}`;try{if(Ti=await new Promise((jn,po)=>{let Xo=Bn(bn);Promise.resolve(Array.isArray(Xo)?Promise.all(Xo):Xo).then(jn,po)}),co)throw co}catch(jn){throw await(Fi?bn`rollback to ${bn(Fi)}`:bn`rollback`),jn instanceof Pp&&jn.code==="25P02"&&co||jn}if(!Fi)vn?await bn`prepare transaction '${bn.unsafe(vn)}'`:await bn`commit`;return Ti;function ho(jn,po){if(jn&&Array.isArray(jn.raw))return ho((Xo)=>Xo.apply(Xo,arguments));return arguments.length===1&&(po=jn,jn=null),_n(Nn,po,"s"+Dn+++(jn?"_"+jn:""))}function en(jn){jn.catch((po)=>co||(co=po)),Nn.queue===J?Rn.push(jn):Nn.execute(jn)||z(Nn,J)}}function Pn(Nn){gn=Nn,z(Nn,a),Nn.reserved=()=>Rn.length?Nn.execute(Rn.shift()):z(Nn,a)}}function z(O,q){return O.queue.remove(O),q.push(O),O.queue=q,q===$?O.idleTimer.start():O.idleTimer.cancel(),O}function E(O){return new Eo(O,3802)}function Q(O,q){if(!Array.isArray(O))return Q(Array.from(arguments));return new Eo(O,q||(O.length?Ia(O)||25:0),o.shared.typeArrayMap)}function b(O){if(p)return O.reject(rn.connection("CONNECTION_ENDED",o,o));if($.length)return y($.shift(),O);if(f.length)return En(f.shift(),O);w.length?y(w.shift(),O):x.push(O)}function y(O,q){return O.execute(q)?z(O,w):z(O,J)}function H(O){return new Promise((q,Rn)=>{O.state?O.active?q$(o).cancel(O.state,q,Rn):O.cancelled={resolve:q,reject:Rn}:(x.remove(O),O.cancelled=!0,O.reject(rn.generic("57014","canceling statement due to user request")),q())})}async function an({timeout:O=null}={}){if(p)return p;await 1;let q;return p=Promise.race([new Promise((Rn)=>O!==null&&(q=setTimeout(fn,O*1000,Rn))),Promise.all(X.map((Rn)=>Rn.end()).concat(M.sql?M.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(q))}async function Z(){await Promise.all(X.map((O)=>O.end()))}async function fn(O){await Promise.all(X.map((q)=>q.terminate()));while(x.length)x.shift().reject(rn.connection("CONNECTION_DESTROYED",o));O()}function En(O,q){return z(O,m),O.connect(q),O}function dn(O){z(O,v)}function Vi(O){if(x.length===0)return z(O,$);let q=Math.ceil(x.length/(m.length+1)),Rn=!0;while(Rn&&x.length&&q-- >0){let Dn=x.shift();if(Dn.reserve)return Dn.reserve(O);Rn=O.execute(Dn)}Rn?z(O,w):z(O,J)}function Oo(O,q){z(O,f),O.reserved=null,O.onclose&&(O.onclose(q),O.onclose=null),o.onclose&&o.onclose(O.id),x.length&&En(O,x.shift())}}function WM(n,i){if(n&&n.shared)return n;let o=process.env,c=(!n||typeof n==="string"?i:n)||{},{url:p,multihost:x}=YM(n),m=[...p.searchParams].reduce((J,[S,X])=>(J[S]=X,J),{}),a=c.hostname||c.host||x||p.hostname||o.PGHOST||"localhost",f=c.port||p.port||o.PGPORT||5432,v=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||HM();c.no_prepare&&(c.prepare=!1),m.sslmode&&(m.ssl=m.sslmode,delete m.sslmode),"timeout"in c&&(console.log("The timeout option is deprecated, use idle_timeout instead"),c.idle_timeout=c.timeout),m.sslrootcert==="system"&&(m.ssl="verify-full");let $=["idle_timeout","connect_timeout","max_lifetime","max_pipeline","backoff","keep_alive"],w={max:10,ssl:!1,idle_timeout:null,connect_timeout:30,max_lifetime:GM,max_pipeline:100,backoff:lM,keep_alive:60,prepare:!0,debug:!1,fetch_types:!0,publications:"alltables",target_session_attrs:null};return{host:Array.isArray(a)?a:a.split(",").map((J)=>J.split(":")[0]),port:Array.isArray(f)?f:a.split(",").map((J)=>parseInt(J.split(":")[1]||f)),path:c.path||a.indexOf("/")>-1&&a+"/.s.PGSQL."+f,database:c.database||c.db||(p.pathname||"").slice(1)||o.PGDATABASE||v,user:v,pass:c.pass||c.password||p.password||o.PGPASSWORD||"",...Object.entries(w).reduce((J,[S,X])=>{let R=S in c?c[S]:(S in m)?m[S]==="disable"||m[S]==="false"?!1:m[S]:o["PG"+S.toUpperCase()]||X;return J[S]=typeof R==="string"&&$.includes(S)?+R:R,J},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(m).reduce((J,[S,X])=>((S in w)||(J[S]=X),J),{})},types:c.types||{},target_session_attrs:KM(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:MM(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...HR(c.types)}}function KM(n,i,o){let c=n.target_session_attrs||i.searchParams.get("target_session_attrs")||o.PGTARGETSESSIONATTRS;if(!c||["read-write","read-only","primary","standby","prefer-standby"].includes(c))return c;throw new Error("target_session_attrs "+c+" is not supported")}function lM(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function GM(){return 60*(30+Math.random()*30)}function MM(n){return{undefined:n.undefined,column:{from:typeof n.column==="function"?n.column:n.column&&n.column.from,to:n.column&&n.column.to},value:{from:typeof n.value==="function"?n.value:n.value&&n.value.from,to:n.value&&n.value.to},row:{from:typeof n.row==="function"?n.row:n.row&&n.row.from,to:n.row&&n.row.to}}}function YM(n){if(!n||typeof n!=="string")return{url:{searchParams:new Map}};let i=n;i=i.slice(i.indexOf("://")+3).split(/[?/]/)[0],i=decodeURIComponent(i.slice(i.indexOf("@")+1));let o=new URL(n.replace(i,i.split(",")[0]));return{url:{username:decodeURIComponent(o.username),password:decodeURIComponent(o.password),host:o.host,hostname:o.hostname,port:o.port,pathname:o.pathname,searchParams:o.searchParams},multihost:i.indexOf(",")>-1&&i}}function HM(){try{return SM.userInfo().username}catch(n){return process.env.USERNAME||process.env.USER||process.env.LOGNAME}}class kn{static[F]="SelectionProxyHandler";config;constructor(n){this.config={...n}}get(n,i){if(i==="_")return{...n._,selectedFields:new Proxy(n._.selectedFields,this)};if(i===un)return{...n[un],selectedFields:new Proxy(n[un].selectedFields,this)};if(typeof i==="symbol")return n[i];let c=(l(n,ci)?n._.selectedFields:l(n,bi)?n[un].selectedFields:n)[i];if(l(c,L.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(l(c,L)){if(this.config.sqlBehavior==="sql")return c;throw new Error(`You tried to reference "${i}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}if(l(c,Un)){if(this.config.alias)return new Proxy(c,new Sp(new Proxy(c.table,new Qx(this.config.alias,this.config.replaceOriginalName??!1))));return c}if(typeof c!=="object"||c===null)return c;return new Proxy(c,new kn(this.config))}}class da extends Qi{constructor(n,i,o,c){super();this.session=i,this.dialect=o,this.config={table:n,withList:c}}static[F]="PgDelete";config;where(n){return this.config.where=n,this}returning(n=this.config.table[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=di(n),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:mi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}function zM(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((o)=>o.toLowerCase()).join("_")}function QM(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((o,c,p)=>{let x=p===0?c.toLowerCase():`${c[0].toUpperCase()}${c.slice(1)}`;return o+x},"")}function EM(n){return n}class t${static[F]="CasingCache";cache={};cachedTables={};convert;constructor(n){this.convert=n==="snake_case"?zM:n==="camelCase"?QM:EM}getColumnCasing(n){if(!n.keyAsName)return n.name;let i=n.table[D.Symbol.Schema]??"public",o=n.table[D.Symbol.OriginalName],c=`${i}.${o}.${n.name}`;if(!this.cache[c])this.cacheTable(n.table);return this.cache[c]}cacheTable(n){let i=n[D.Symbol.Schema]??"public",o=n[D.Symbol.OriginalName],c=`${i}.${o}`;if(!this.cachedTables[c]){for(let p of Object.values(n[D.Symbol.Columns])){let x=`${c}.${p.name}`;this.cache[x]=this.convert(p.name)}this.cachedTables[c]=!0}}clearCache(){this.cache={},this.cachedTables={}}}class nm extends bi{static[F]="PgViewBase"}class sc{static[F]="PgDialect";casing;constructor(n){this.casing=new t$(n?.casing)}async migrate(n,i,o){let c=typeof o==="string"?"__drizzle_migrations":o.migrationsTable??"__drizzle_migrations",p=typeof o==="string"?"drizzle":o.migrationsSchema??"drizzle",x=T`
82
+ CREATE TABLE IF NOT EXISTS ${T.identifier(p)}.${T.identifier(c)} (
83
83
  id SERIAL PRIMARY KEY,
84
84
  hash text NOT NULL,
85
85
  created_at bigint
86
86
  )
87
- `;await i.execute(F`CREATE SCHEMA IF NOT EXISTS ${F.identifier(p)}`),await i.execute(x);let a=(await i.all(F`select id, hash, created_at from ${F.identifier(p)}.${F.identifier(c)} order by created_at desc limit 1`))[0];await i.transaction(async(f)=>{for await(let v of n)if(!a||Number(a.created_at)<v.folderMillis){for(let $ of v.sql)await f.execute(F.raw($));await f.execute(F`insert into ${F.identifier(p)}.${F.identifier(c)} ("hash", "created_at") values(${v.hash}, ${v.folderMillis})`)}})}escapeName(n){return`"${n}"`}escapeParam(n){return`$${n+1}`}escapeString(n){return`'${n.replace(/'/g,"''")}'`}buildWithCTE(n){if(!n?.length)return;let i=[F`with `];for(let[o,c]of n.entries())if(i.push(F`${F.identifier(c._.alias)} as (${c._.sql})`),o<n.length-1)i.push(F`, `);return i.push(F` `),F.join(i)}buildDeleteQuery({table:n,where:i,returning:o,withList:c}){let p=this.buildWithCTE(c),x=o?F` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,m=i?F` where ${i}`:void 0;return F`${p}delete from ${n}${m}${x}`}buildUpdateSet(n,i){let o=n[L.Symbol.Columns],c=Object.keys(o).filter((x)=>i[x]!==void 0||o[x]?.onUpdateFn!==void 0),p=c.length;return F.join(c.flatMap((x,m)=>{let a=o[x],f=i[x]??F.param(a.onUpdateFn(),a),v=F`${F.identifier(this.casing.getColumnCasing(a))} = ${f}`;if(m<p-1)return[v,F.raw(", ")];return[v]}))}buildUpdateQuery({table:n,set:i,where:o,returning:c,withList:p,from:x,joins:m}){let a=this.buildWithCTE(p),f=n[Ai.Symbol.Name],v=n[Ai.Symbol.Schema],$=n[Ai.Symbol.OriginalName],w=f===$?void 0:f,J=F`${v?F`${F.identifier(v)}.`:void 0}${F.identifier($)}${w&&F` ${F.identifier(w)}`}`,l=this.buildUpdateSet(n,i),S=x&&F.join([F.raw(" from "),this.buildFromTable(x)]),R=this.buildJoins(m),K=c?F` returning ${this.buildSelection(c,{isSingleTable:!x})}`:void 0,Y=o?F` where ${o}`:void 0;return F`${a}update ${J} set ${l}${S}${R}${Y}${K}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},x)=>{let m=[];if(W(p,u.Aliased)&&p.isSelectionField)m.push(F.identifier(p.fieldAlias));else if(W(p,u.Aliased)||W(p,u)){let a=W(p,u.Aliased)?p.sql:p;if(i)m.push(new u(a.queryChunks.map((f)=>{if(W(f,V))return F.identifier(this.casing.getColumnCasing(f));return f})));else m.push(a);if(W(p,u.Aliased))m.push(F` as ${F.identifier(p.fieldAlias)}`)}else if(W(p,Un))if(i)m.push(F.identifier(this.casing.getColumnCasing(p)));else m.push(p);if(x<o-1)m.push(F`, `);return m});return F.join(c)}buildJoins(n){if(!n||n.length===0)return;let i=[];for(let[o,c]of n.entries()){if(o===0)i.push(F` `);let p=c.table,x=c.lateral?F` lateral`:void 0;if(W(p,Ai)){let m=p[Ai.Symbol.Name],a=p[Ai.Symbol.Schema],f=p[Ai.Symbol.OriginalName],v=m===f?void 0:c.alias;i.push(F`${F.raw(c.joinType)} join${x} ${a?F`${F.identifier(a)}.`:void 0}${F.identifier(f)}${v&&F` ${F.identifier(v)}`} on ${c.on}`)}else if(W(p,Bi)){let m=p[bn].name,a=p[bn].schema,f=p[bn].originalName,v=m===f?void 0:c.alias;i.push(F`${F.raw(c.joinType)} join${x} ${a?F`${F.identifier(a)}.`:void 0}${F.identifier(f)}${v&&F` ${F.identifier(v)}`} on ${c.on}`)}else i.push(F`${F.raw(c.joinType)} join${x} ${p} on ${c.on}`);if(o<n.length-1)i.push(F` `)}return F.join(i)}buildFromTable(n){if(W(n,L)&&n[L.Symbol.OriginalName]!==n[L.Symbol.Name]){let i=F`${F.identifier(n[L.Symbol.OriginalName])}`;if(n[L.Symbol.Schema])i=F`${F.identifier(n[L.Symbol.Schema])}.${i}`;return F`${i} ${F.identifier(n[L.Symbol.Name])}`}return n}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:x,joins:m,orderBy:a,groupBy:f,limit:v,offset:$,lockingClause:w,distinct:J,setOperators:l}){let S=o??ri(i);for(let fn of S)if(W(fn.field,Un)&&mi(fn.field.table)!==(W(x,ci)?x._.alias:W(x,ex)?x[bn].name:W(x,u)?void 0:mi(x))&&!((En)=>m?.some(({alias:gn})=>gn===(En[L.Symbol.IsAlias]?mi(En):En[L.Symbol.BaseName])))(fn.field.table)){let En=mi(fn.field.table);throw new Error(`Your "${fn.path.join("->")}" field references a column "${En}"."${fn.field.name}", but the table "${En}" is not part of the query! Did you forget to join it?`)}let R=!m||m.length===0,K=this.buildWithCTE(n),Y;if(J)Y=J===!0?F` distinct`:F` distinct on (${F.join(J.on,F`, `)})`;let M=this.buildSelection(S,{isSingleTable:R}),I=this.buildFromTable(x),G=this.buildJoins(m),z=c?F` where ${c}`:void 0,E=p?F` having ${p}`:void 0,Q;if(a&&a.length>0)Q=F` order by ${F.join(a,F`, `)}`;let B;if(f&&f.length>0)B=F` group by ${F.join(f,F`, `)}`;let y=typeof v==="object"||typeof v==="number"&&v>=0?F` limit ${v}`:void 0,H=$?F` offset ${$}`:void 0,an=F.empty();if(w){let fn=F` for ${F.raw(w.strength)}`;if(w.config.of)fn.append(F` of ${F.join(Array.isArray(w.config.of)?w.config.of:[w.config.of],F`, `)}`);if(w.config.noWait)fn.append(F` no wait`);else if(w.config.skipLocked)fn.append(F` skip locked`);an.append(fn)}let Z=F`${K}select${Y} ${M} from ${I}${G}${z}${B}${E}${Q}${y}${H}${an}`;if(l.length>0)return this.buildSetOperations(Z,l);return Z}buildSetOperations(n,i){let[o,...c]=i;if(!o)throw new Error("Cannot pass undefined values to any set operator");if(c.length===0)return this.buildSetOperationQuery({leftSelect:n,setOperator:o});return this.buildSetOperations(this.buildSetOperationQuery({leftSelect:n,setOperator:o}),c)}buildSetOperationQuery({leftSelect:n,setOperator:{type:i,isAll:o,rightSelect:c,limit:p,orderBy:x,offset:m}}){let a=F`(${n.getSQL()}) `,f=F`(${c.getSQL()})`,v;if(x&&x.length>0){let l=[];for(let S of x)if(W(S,V))l.push(F.identifier(S.name));else if(W(S,u)){for(let R=0;R<S.queryChunks.length;R++){let K=S.queryChunks[R];if(W(K,V))S.queryChunks[R]=F.identifier(K.name)}l.push(F`${S}`)}else l.push(F`${S}`);v=F` order by ${F.join(l,F`, `)} `}let $=typeof p==="object"||typeof p==="number"&&p>=0?F` limit ${p}`:void 0,w=F.raw(`${i} ${o?"all ":""}`),J=m?F` offset ${m}`:void 0;return F`${a}${w}${f}${v}${$}${J}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p,select:x,overridingSystemValue_:m}){let a=[],f=n[L.Symbol.Columns],v=Object.entries(f).filter(([K,Y])=>!Y.shouldDisableInsert()),$=v.map(([,K])=>F.identifier(this.casing.getColumnCasing(K)));if(x){let K=i;if(W(K,u))a.push(K);else a.push(K.getSQL())}else{let K=i;a.push(F.raw("values "));for(let[Y,M]of K.entries()){let I=[];for(let[G,z]of v){let E=M[G];if(E===void 0||W(E,Li)&&E.value===void 0)if(z.defaultFn!==void 0){let Q=z.defaultFn(),B=W(Q,u)?Q:F.param(Q,z);I.push(B)}else if(!z.default&&z.onUpdateFn!==void 0){let Q=z.onUpdateFn(),B=W(Q,u)?Q:F.param(Q,z);I.push(B)}else I.push(F`default`);else I.push(E)}if(a.push(I),Y<K.length-1)a.push(F`, `)}}let w=this.buildWithCTE(p),J=F.join(a),l=c?F` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,S=o?F` on conflict ${o}`:void 0,R=m===!0?F`overriding system value `:void 0;return F`${w}insert into ${n} ${$} ${R}${J}${S}${l}`}buildRefreshMaterializedViewQuery({view:n,concurrently:i,withNoData:o}){let c=i?F` concurrently`:void 0,p=o?F` with no data`:void 0;return F`refresh materialized view${c} ${n}${p}`}prepareTyping(n){if(W(n,na)||W(n,em))return"json";else if(W(n,ia))return"decimal";else if(W(n,oa))return"time";else if(W(n,ca)||W(n,pa))return"timestamp";else if(W(n,rm)||W(n,gm))return"date";else if(W(n,xa))return"uuid";else return"none"}sqlToQuery(n,i){return n.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,prepareTyping:this.prepareTyping,invokeSource:i})}buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:c,tableConfig:p,queryConfig:x,tableAlias:m,nestedQueryRelation:a,joinOn:f}){let v=[],$,w,J=[],l,S=[];if(x===!0)v=Object.entries(p.columns).map(([Y,M])=>({dbKey:M.name,tsKey:Y,field:Yo(M,m),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let K=Object.fromEntries(Object.entries(p.columns).map(([E,Q])=>[E,Yo(Q,m)]));if(x.where){let E=typeof x.where==="function"?x.where(K,nF()):x.where;l=E&&Qx(E,m)}let Y=[],M=[];if(x.columns){let E=!1;for(let[Q,B]of Object.entries(x.columns)){if(B===void 0)continue;if(Q in p.columns){if(!E&&B===!0)E=!0;M.push(Q)}}if(M.length>0)M=E?M.filter((Q)=>x.columns?.[Q]===!0):Object.keys(p.columns).filter((Q)=>!M.includes(Q))}else M=Object.keys(p.columns);for(let E of M){let Q=p.columns[E];Y.push({tsKey:E,value:Q})}let I=[];if(x.with)I=Object.entries(x.with).filter((E)=>!!E[1]).map(([E,Q])=>({tsKey:E,queryConfig:Q,relation:p.relations[E]}));let G;if(x.extras){G=typeof x.extras==="function"?x.extras(K,{sql:F}):x.extras;for(let[E,Q]of Object.entries(G))Y.push({tsKey:E,value:Wv(Q,m)})}for(let{tsKey:E,value:Q}of Y)v.push({dbKey:W(Q,u.Aliased)?Q.fieldAlias:p.columns[E].name,tsKey:E,field:W(Q,Un)?Yo(Q,m):Q,relationTableTsKey:void 0,isJson:!1,selection:[]});let z=typeof x.orderBy==="function"?x.orderBy(K,iF()):x.orderBy??[];if(!Array.isArray(z))z=[z];J=z.map((E)=>{if(W(E,Un))return Yo(E,m);return Qx(E,m)}),$=x.limit,w=x.offset;for(let{tsKey:E,queryConfig:Q,relation:B}of I){let y=cF(i,o,B),H=Ec(B.referencedTable),an=o[H],Z=`${m}_${E}`,fn=Oc(...y.fields.map((_i,Oo)=>Mo(Yo(y.references[Oo],Z),Yo(_i,m)))),En=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[an],tableConfig:i[an],queryConfig:W(B,ic)?Q===!0?{limit:1}:{...Q,limit:1}:Q,tableAlias:Z,joinOn:fn,nestedQueryRelation:B}),gn=F`${F.identifier(Z)}.${F.identifier("data")}`.as(E);S.push({on:F`true`,table:new ci(En.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),v.push({dbKey:E,tsKey:E,field:gn,relationTableTsKey:an,isJson:!0,selection:En.selection})}}if(v.length===0)throw new qm({message:`No fields selected for table "${p.tsName}" ("${m}")`});let R;if(l=Oc(f,l),a){let K=F`json_build_array(${F.join(v.map(({field:I,tsKey:G,isJson:z})=>z?F`${F.identifier(`${m}_${G}`)}.${F.identifier("data")}`:W(I,u.Aliased)?I.sql:I),F`, `)})`;if(W(a,Vx))K=F`coalesce(json_agg(${K}${J.length>0?F` order by ${F.join(J,F`, `)}`:void 0}), '[]'::json)`;let Y=[{dbKey:"data",tsKey:"data",field:K.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:v}];if($!==void 0||w!==void 0||J.length>0)R=this.buildSelectQuery({table:sm(c,m),fields:{},fieldsFlat:[{path:[],field:F.raw("*")}],where:l,limit:$,offset:w,orderBy:J,setOperators:[]}),l=void 0,$=void 0,w=void 0,J=[];else R=sm(c,m);R=this.buildSelectQuery({table:W(R,Ai)?R:new ci(R,{},m),fields:{},fieldsFlat:Y.map(({field:I})=>({path:[],field:W(I,Un)?Yo(I,m):I})),joins:S,where:l,limit:$,offset:w,orderBy:J,setOperators:[]})}else R=this.buildSelectQuery({table:sm(c,m),fields:{},fieldsFlat:v.map(({field:K})=>({path:[],field:W(K,Un)?Yo(K,m):K})),joins:S,where:l,limit:$,offset:w,orderBy:J,setOperators:[]});return{tableTsKey:p.tsName,sql:R,selection:v}}}class t${static[T]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class Vi{static[T]="PgSelectBuilder";fields;session;dialect;withList=[];distinct;constructor(n){if(this.fields=n.fields,this.session=n.session,this.dialect=n.dialect,n.withList)this.withList=n.withList;this.distinct=n.distinct}authToken;setToken(n){return this.authToken=n,this}from(n){let i=!!this.fields,o=n,c;if(this.fields)c=this.fields;else if(W(o,ci))c=Object.fromEntries(Object.keys(o._.selectedFields).map((p)=>[p,o[p]]));else if(W(o,ex))c=o[bn].selectedFields;else if(W(o,u))c={};else c=pA(o);return new r$({table:o,fields:c,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}class VR extends t${static[T]="PgSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;constructor({table:n,fields:i,isPartialSelect:o,session:c,dialect:p,withList:x,distinct:m}){super();this.config={withList:x,table:n,fields:{...i},distinct:m,setOperators:[]},this.isPartialSelect=o,this.session=c,this.dialect=p,this._={selectedFields:i},this.tableName=_o(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}createJoin(n){return(i,o)=>{let c=this.tableName,p=_o(i);if(typeof p==="string"&&this.config.joins?.some((x)=>x.alias===p))throw new Error(`Alias "${p}" is already used in this query`);if(!this.isPartialSelect){if(Object.keys(this.joinsNotNullableMap).length===1&&typeof c==="string")this.config.fields={[c]:this.config.fields};if(typeof p==="string"&&!W(i,u)){let x=W(i,ci)?i._.selectedFields:W(i,Bi)?i[bn].selectedFields:i[L.Symbol.Columns];this.config.fields[p]=x}}if(typeof o==="function")o=o(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));if(!this.config.joins)this.config.joins=[];if(this.config.joins.push({on:o,table:i,joinType:n,alias:p}),typeof p==="string")switch(n){case"left":{this.joinsNotNullableMap[p]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!0;break}case"inner":{this.joinsNotNullableMap[p]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");createSetOperator(n,i){return(o)=>{let c=typeof o==="function"?o(YY()):o;if(!Ex(this.getSelectedFields(),c.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:n,isAll:i,rightSelect:c}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);intersectAll=this.createSetOperator("intersect",!0);except=this.createSetOperator("except",!1);exceptAll=this.createSetOperator("except",!0);addSetOperators(n){return this.config.setOperators.push(...n),this}where(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.where=n,this}having(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.having=n,this}groupBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=n;return this}orderBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),o=Array.isArray(i)?i:[i];if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=o;else this.config.orderBy=o}else{let i=n;if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=i;else this.config.orderBy=i}return this}limit(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).limit=n;else this.config.limit=n;return this}offset(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).offset=n;else this.config.offset=n;return this}for(n,i={}){return this.config.lockingClause={strength:n,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(n){return new Proxy(new ci(this.getSQL(),this.config.fields,n),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new kn({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class r$ extends VR{static[T]="PgSelect";_prepare(n){let{session:i,config:o,dialect:c,joinsNotNullableMap:p,authToken:x}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Vn.startActiveSpan("drizzle.prepareQuery",()=>{let m=ri(o.fields),a=i.prepareQuery(c.sqlToQuery(this.getSQL()),m,n,!0);return a.joinsNotNullableMap=p,a.setToken(x)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}cA(r$,[Ei]);function gp(n,i){return(o,c,...p)=>{let x=[c,...p].map((m)=>({type:n,isAll:i,rightSelect:m}));for(let m of x)if(!Ex(o.getSelectedFields(),m.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return o.addSetOperators(x)}}var YY=()=>({union:MY,unionAll:HY,intersect:zY,intersectAll:QY,except:EY,exceptAll:OY}),MY=gp("union",!1),HY=gp("union",!0),zY=gp("intersect",!1),QY=gp("intersect",!0),EY=gp("except",!1),OY=gp("except",!0);class nm{static[T]="PgQueryBuilder";dialect;dialectConfig;constructor(n){this.dialect=W(n,qc)?n:void 0,this.dialectConfig=W(n,qc)?void 0:n}$with=(n,i)=>{let o=this;return{as:(p)=>{if(typeof p==="function")p=p(o);return new Proxy(new Mx(p.getSQL(),i??("getSelectedFields"in p?p.getSelectedFields()??{}:{}),n,!0),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};with(...n){let i=this;function o(x){return new Vi({fields:x??void 0,session:void 0,dialect:i.getDialect(),withList:n})}function c(x){return new Vi({fields:x??void 0,session:void 0,dialect:i.getDialect(),distinct:!0})}function p(x,m){return new Vi({fields:m??void 0,session:void 0,dialect:i.getDialect(),distinct:{on:x}})}return{select:o,selectDistinct:c,selectDistinctOn:p}}select(n){return new Vi({fields:n??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(n){return new Vi({fields:n??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(n,i){return new Vi({fields:i??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:n}})}getDialect(){if(!this.dialect)this.dialect=new qc(this.dialectConfig);return this.dialect}}class ga{constructor(n,i,o,c,p){this.table=n,this.session=i,this.dialect=o,this.withList=c,this.overridingSystemValue_=p}static[T]="PgInsertBuilder";authToken;setToken(n){return this.authToken=n,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(n){if(n=Array.isArray(n)?n:[n],n.length===0)throw new Error("values() must be called with at least one value");let i=n.map((o)=>{let c={},p=this.table[L.Symbol.Columns];for(let x of Object.keys(o)){let m=o[x];c[x]=W(m,u)?m:new Li(m,p[x])}return c});return new g$(this.table,i,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(n){let i=typeof n==="function"?n(new nm):n;if(!W(i,u)&&!Ex(this.table[km],i._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new g$(this.table,i,this.session,this.dialect,this.withList,!0)}}class g$ extends Ei{constructor(n,i,o,c,p,x,m){super();this.session=o,this.dialect=c,this.config={table:n,values:i,withList:p,select:x,overridingSystemValue_:m}}static[T]="PgInsert";config;returning(n=this.config.table[L.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=ri(n),this}onConflictDoNothing(n={}){if(n.target===void 0)this.config.onConflict=F`do nothing`;else{let i="";i=Array.isArray(n.target)?n.target.map((c)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(c))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target));let o=n.where?F` where ${n.where}`:void 0;this.config.onConflict=F`(${F.raw(i)})${o} do nothing`}return this}onConflictDoUpdate(n){if(n.where&&(n.targetWhere||n.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');let i=n.where?F` where ${n.where}`:void 0,o=n.targetWhere?F` where ${n.targetWhere}`:void 0,c=n.setWhere?F` where ${n.setWhere}`:void 0,p=this.dialect.buildUpdateSet(this.config.table,tm(this.config.table,n.set)),x="";return x=Array.isArray(n.target)?n.target.map((m)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(m))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target)),this.config.onConflict=F`(${F.raw(x)})${o} do update set ${p}${i}${c}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:mi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class d$ extends Ei{constructor(n,i,o){super();this.session=i,this.dialect=o,this.config={view:n}}static[T]="PgRefreshMaterializedView";config;concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}class da{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[T]="PgUpdateBuilder";authToken;setToken(n){return this.authToken=n,this}set(n){return new _R(this.table,tm(this.table,n),this.session,this.dialect,this.withList).setToken(this.authToken)}}class _R extends Ei{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={set:i,table:n,withList:p,joins:[]},this.tableName=_o(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}static[T]="PgUpdate";config;tableName;joinsNotNullableMap;from(n){let i=n,o=_o(i);if(typeof o==="string")this.joinsNotNullableMap[o]=!0;return this.config.from=i,this}getTableLikeFields(n){if(W(n,Ai))return n[L.Symbol.Columns];else if(W(n,ci))return n._.selectedFields;return n[bn].selectedFields}createJoin(n){return(i,o)=>{let c=_o(i);if(typeof c==="string"&&this.config.joins.some((p)=>p.alias===c))throw new Error(`Alias "${c}" is already used in this query`);if(typeof o==="function"){let p=this.config.from&&!W(this.config.from,u)?this.getTableLikeFields(this.config.from):void 0;o=o(new Proxy(this.config.table[L.Symbol.Columns],new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),p&&new Proxy(p,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:o,table:i,joinType:n,alias:c}),typeof c==="string")switch(n){case"left":{this.joinsNotNullableMap[c]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!0;break}case"inner":{this.joinsNotNullableMap[c]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(n){return this.config.where=n,this}returning(n){if(!n){if(n=Object.assign({},this.config.table[L.Symbol.Columns]),this.config.from){let i=_o(this.config.from);if(typeof i==="string"&&this.config.from&&!W(this.config.from,u)){let o=this.getTableLikeFields(this.config.from);n[i]=o}for(let o of this.config.joins){let c=_o(o.table);if(typeof c==="string"&&!W(o.table,u)){let p=this.getTableLikeFields(o.table);n[c]=p}}}}return this.config.returningFields=n,this.config.returning=ri(n),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){let i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return this._prepare().execute(n,this.authToken)};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:mi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class im extends u{constructor(n){super(im.buildEmbeddedCount(n.source,n.filters).queryChunks);this.params=n,this.mapWith(Number),this.session=n.session,this.sql=im.buildCount(n.source,n.filters)}sql;token;static[T]="PgCountBuilder";[Symbol.toStringTag]="PgCountBuilder";session;static buildEmbeddedCount(n,i){return F`(select count(*) from ${n}${F.raw(" where ").if(i)}${i})`}static buildCount(n,i){return F`select count(*) as count from ${n}${F.raw(" where ").if(i)}${i};`}setToken(n){return this.token=n,this}then(n,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(n,i)}catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}}class n0{constructor(n,i,o,c,p,x,m){this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m}static[T]="PgRelationalQueryBuilder";findMany(n){return new e$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new e$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class e$ extends Ei{constructor(n,i,o,c,p,x,m,a,f){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m,this.config=a,this.mode=f}static[T]="PgRelationalQuery";_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{let{query:i,builtQuery:o}=this._toSQL();return this.session.prepareQuery(o,void 0,n,!0,(c,p)=>{let x=c.map((m)=>ma(this.schema,this.tableConfig,m,i.selection,p));if(this.mode==="first")return x[0];return x})})}prepare(n){return this._prepare(n)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let n=this._getQuery(),i=this.dialect.sqlToQuery(n.sql);return{query:n,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}authToken;setToken(n){return this.authToken=n,this}execute(){return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(void 0,this.authToken)})}}class i0 extends Ei{constructor(n,i,o,c){super();this.execute=n,this.sql=i,this.query=o,this.mapBatchResult=c}static[T]="PgRaw";getSQL(){return this.sql}getQuery(){return this.query}mapResult(n,i){return i?this.mapBatchResult(n):n}_prepare(){return this}isResponseInArrayMode(){return!1}}class om{constructor(n,i,o){if(this.dialect=n,this.session=i,this._=o?{schema:o.schema,fullSchema:o.fullSchema,tableNamesMap:o.tableNamesMap,session:i}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:i},this.query={},this._.schema)for(let[c,p]of Object.entries(this._.schema))this.query[c]=new n0(o.fullSchema,this._.schema,this._.tableNamesMap,o.fullSchema[c],p,n,i)}static[T]="PgDatabase";query;$with=(n,i)=>{let o=this;return{as:(p)=>{if(typeof p==="function")p=p(new nm(o.dialect));return new Proxy(new Mx(p.getSQL(),i??("getSelectedFields"in p?p.getSelectedFields()??{}:{}),n,!0),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};$count(n,i){return new im({source:n,filters:i,session:this.session})}with(...n){let i=this;function o(f){return new Vi({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(f){return new Vi({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(f,v){return new Vi({fields:v??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:f}})}function x(f){return new da(f,i.session,i.dialect,n)}function m(f){return new ga(f,i.session,i.dialect,n)}function a(f){return new ra(f,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:x,insert:m,delete:a}}select(n){return new Vi({fields:n??void 0,session:this.session,dialect:this.dialect})}selectDistinct(n){return new Vi({fields:n??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(n,i){return new Vi({fields:i??void 0,session:this.session,dialect:this.dialect,distinct:{on:n}})}update(n){return new da(n,this.session,this.dialect)}insert(n){return new ga(n,this.session,this.dialect)}delete(n){return new ra(n,this.session,this.dialect)}refreshMaterializedView(n){return new d$(n,this.session,this.dialect)}authToken;execute(n){let i=typeof n==="string"?F.raw(n):n.getSQL(),o=this.dialect.sqlToQuery(i),c=this.session.prepareQuery(o,void 0,void 0,!1);return new i0(()=>c.execute(void 0,this.authToken),i,o,(p)=>c.mapResult(p,!0))}transaction(n,i){return this.session.transaction(n,i)}}class BR{constructor(n,i){this.unique=n,this.name=i}static[T]="PgIndexBuilderOn";on(...n){return new ea(n.map((i)=>{if(W(i,u))return i;i=i;let o=new Yx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=JSON.parse(JSON.stringify(i.defaultConfig)),o}),this.unique,!1,this.name)}onOnly(...n){return new ea(n.map((i)=>{if(W(i,u))return i;i=i;let o=new Yx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new ea(i.map((o)=>{if(W(o,u))return o;o=o;let c=new Yx(o.name,!!o.keyAsName,o.columnType,o.indexConfig);return o.indexConfig=JSON.parse(JSON.stringify(o.defaultConfig)),c}),this.unique,!0,this.name,n)}}class ea{static[T]="PgIndexBuilder";config;constructor(n,i,o,c,p="btree"){this.config={name:c,columns:n,unique:i,only:o,method:p}}concurrently(){return this.config.concurrently=!0,this}with(n){return this.config.with=n,this}where(n){return this.config.where=n,this}build(n){return new bR(this.config,n)}}class bR{static[T]="PgIndex";config;constructor(n,i){this.config={...n,table:i}}}function o0(n){return new BR(!0,n)}class c0{constructor(n){this.query=n}authToken;getQuery(){return this.query}mapResult(n,i){return n}setToken(n){return this.authToken=n,this}static[T]="PgPreparedQuery";joinsNotNullableMap}class p0{constructor(n){this.dialect=n}static[T]="PgSession";execute(n,i){return Vn.startActiveSpan("drizzle.operation",()=>{return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1)}).setToken(i).execute(void 0,i)})}all(n){return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1).all()}async count(n,i){let o=await this.execute(n,i);return Number(o[0].count)}}class x0 extends om{constructor(n,i,o,c=0){super(n,i,o);this.schema=o,this.nestedIndex=c}static[T]="PgTransaction";rollback(){throw new Gv}getTransactionConfigSQL(n){let i=[];if(n.isolationLevel)i.push(`isolation level ${n.isolationLevel}`);if(n.accessMode)i.push(n.accessMode);if(typeof n.deferrable==="boolean")i.push(n.deferrable?"deferrable":"not deferrable");return F.raw(i.join(" "))}setTransaction(n){return this.session.execute(F`set transaction ${this.getTransactionConfigSQL(n)}`)}}class jR extends c0{constructor(n,i,o,c,p,x,m){super({sql:i,params:o});this.client=n,this.queryString=i,this.params=o,this.logger=c,this.fields=p,this._isResponseInArrayMode=x,this.customResultMapper=m}static[T]="PostgresJsPreparedQuery";async execute(n={}){return Vn.startActiveSpan("drizzle.execute",async(i)=>{let o=Kv(this.params,n);i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o);let{fields:c,queryString:p,client:x,joinsNotNullableMap:m,customResultMapper:a}=this;if(!c&&!a)return Vn.startActiveSpan("drizzle.driver.execute",()=>{return x.unsafe(p,o)});let f=await Vn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":p,"drizzle.query.params":JSON.stringify(o)}),x.unsafe(p,o).values()});return Vn.startActiveSpan("drizzle.mapResponse",()=>{return a?a(f):f.map((v)=>oA(c,v,m))})})}all(n={}){return Vn.startActiveSpan("drizzle.execute",async(i)=>{let o=Kv(this.params,n);return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o),Vn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.client.unsafe(this.queryString,o)})})}isResponseInArrayMode(){return this._isResponseInArrayMode}}class cm extends p0{constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new Mv}static[T]="PostgresJsSession";logger;prepareQuery(n,i,o,c,p){return new jR(this.client,n.sql,n.params,this.logger,i,c,p)}query(n,i){return this.logger.logQuery(n,i),this.client.unsafe(n,i).values()}queryObjects(n,i){return this.client.unsafe(n,i)}transaction(n,i){return this.client.begin(async(o)=>{let c=new cm(o,this.dialect,this.schema,this.options),p=new m0(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class m0 extends x0{constructor(n,i,o,c=0){super(n,i,o,c);this.session=i}static[T]="PostgresJsTransaction";transaction(n){return this.session.client.savepoint((i)=>{let o=new cm(i,this.dialect,this.schema,this.session.options),c=new m0(this.dialect,o,this.schema);return n(c)})}}class DR extends om{static[T]="PostgresJsDatabase"}function dp(n,i={}){let o=(f)=>f;for(let f of["1184","1082","1083","1114"])n.options.parsers[f]=o,n.options.serializers[f]=o;n.options.serializers["114"]=o,n.options.serializers["3802"]=o;let c=new qc({casing:i.casing}),p;if(i.logger===!0)p=new Yv;else if(i.logger!==!1)p=i.logger;let x;if(i.schema){let f=oF(i.schema,pF);x={fullSchema:i.schema,schema:f.tables,tableNamesMap:f.tableNamesMap}}let m=new cm(n,c,x,{logger:p}),a=new DR(c,m,x);return a.$client=n,a}function nf(...n){if(typeof n[0]==="string"){let i=rp(n[0]);return dp(i,n[1])}if(xA(n[0])){let{connection:i,client:o,...c}=n[0];if(o)return dp(o,c);if(typeof i==="object"&&i.url!==void 0){let{url:x,...m}=i,a=rp(x,m);return dp(a,c)}let p=rp(i);return dp(p,c)}return dp(n[0],n[1])}((n)=>{function i(o){return dp({options:{parsers:{},serializers:{}}},o)}n.mock=i})(nf||(nf={}));var f0={};dl(f0,{users:()=>Ro,userChanges:()=>VY,untrackedUserColumnNames:()=>UY,twoFactorMethod:()=>CR,trackedUserColumnName:()=>hR,trackableUserColumnNames:()=>NR,role:()=>uR,players:()=>a0,passwordResetAttempts:()=>_Y,loginHistory:()=>ep,games:()=>of,banishedIps:()=>cf});function LR(n){return F`lower(${n})`}var uR=Im("role",["admin","user"]),Ro=nc("users",{id:ui().primaryKey().defaultRandom(),username:Ji({length:16}).notNull(),email:Ji({length:254}).notNull(),hash:Ji({length:64}).notNull(),salt:Ji({length:36}).notNull(),createdAt:fo({withTimezone:!0}).notNull().defaultNow(),createdIp:Ji({length:45}).notNull(),isActive:Ox().notNull().default(!1),verifiedAt:fo({withTimezone:!0}),userRole:uR().default("user")},(n)=>[o0("usernameUniqueIndex").on(LR(n.username)),o0("emailUniqueIndex").on(LR(n.email))]),UY=["id","createdAt","createdIp","isActive","salt","verifiedAt"],NR=["username","email","hash","userRole"],hR=Im("trackedUserColumnName",NR),VY=nc("userChanges",{id:ui().primaryKey().defaultRandom(),userId:ui().notNull().references(()=>Ro.id),changedAt:fo({withTimezone:!0}).notNull().defaultNow(),changedIp:Ji({length:45}).notNull(),changedColumn:hR().notNull(),oldValue:Ji({length:255}),newValue:Ji({length:255})}),of=nc("games",{id:ui().primaryKey().defaultRandom()}),a0=nc("players",{userId:ui().notNull().references(()=>Ro.id),gameId:ui().notNull().references(()=>of.id),score:dm().notNull()},(n)=>[gT({name:"players_userId_gameId_pk",columns:[n.userId,n.gameId]})]),ep=nc("loginHistory",{id:ui().primaryKey().defaultRandom(),userId:ui().references(()=>Ro.id),loginTime:fo({withTimezone:!0}).notNull().defaultNow(),ipAddress:Ji({length:45}).notNull(),userAgent:Ji({length:1024}),successful:Ox().notNull().default(!1)}),CR=Im("twoFactorMethod",["email","phone"]),_Y=nc("passwordResetAttempts",{id:ui().primaryKey().defaultRandom(),userId:ui().notNull().references(()=>Ro.id),requestedIp:Ji({length:45}).notNull(),requestedAt:fo({withTimezone:!0}).notNull().defaultNow(),succeededIp:Ji({length:45}),succeededAt:fo({withTimezone:!0}),verificationMethod:CR().notNull()}),cf=nc("banishedIps",{ip:Ji({length:45}).primaryKey(),reason:Ji({length:2048}).notNull(),banishedAt:fo({withTimezone:!0}).notNull().defaultNow(),banishedUntil:fo({withTimezone:!0})});var __dirname="/home/runner/work/wayforge/wayforge/apps/tempest.games/src/database";class v0{options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(BY.resolve(__dirname,"notify_update.sql"));let n=[mi(Ro),mi(of),mi(a0)];await this.sql`SELECT create_notify_triggers(${this.sql.array(n)})`,await this.sql.listen("table_update",(i)=>{let o=i.split(","),c=o[0],p=o[1],x=`${c}("${p}")`;if(this.observers.has(x))this.observers.get(x).next(x)})}constructor(n=!1,i={host:qn.POSTGRES_HOST,port:qn.POSTGRES_PORT,user:qn.POSTGRES_USER,password:qn.POSTGRES_PASSWORD,database:qn.POSTGRES_DATABASE}){this.options=i,this.sql=rp(i),this.drizzle=nf(this.sql,{schema:f0,logger:n})}observe(n,i){if(!this.observers.has(n))this.observers.set(n,new $n);this.observers.get(n).subscribe("SINGLETON",i)}}import{createHash as bY}from"crypto";function $0(n){let i=bY("sha256").update(n).digest("hex");return`${i.substring(0,8)}-${i.substring(8,12)}-${i.substring(12,16)}-${i.substring(16,20)}-${i.substring(20,32)}`}var IR=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"];var jY=3,DY=15,LY=/^[a-zA-Z0-9_-]+$/,ZR=Xn.string().min(jY).max(DY).regex(LY),yR=20,kR={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function uY(n){let i="";for(let o of n)if(o in kR)i+=kR[o];else i+=o;return i}function NY(n){let i=n.toLocaleLowerCase(),o=uY(i);for(let c of IR){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function hY(n){let i=new Set(n).size;return n.length*Math.log2(i)}function CY(n){let i=0,o=100;if(NY(n))i-=o;return i+=hY(n)*0.5,Math.max(i,0)}var sR=Xn.string().refine((n)=>{return CY(n)>=yR},{message:`Password does not meet the minimum complexity of ${yR}.`}).brand("password"),qR=Xn.object({username:ZR,password:sR}).strict(),IY=Xn.string().email().brand("email"),PR=Xn.object({username:ZR,password:sR,email:IY}).strict();var pf={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication 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:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",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"},w0=Y0(pf).map(([n])=>Xn.literal(Number(n))),yY=Xn.union([w0[0],w0[1],...w0]),tR=Xn.tuple([yY,Xn.string()]);var rR=Zo({key:"count",default:0}),kY=Wc({key:"incrementTX",do:({set:n})=>{n(rR,(i)=>i+1)}}),gR=F1({key:"countContinuity",config:(n)=>n.add(rR).add(kY)});var eR=O$($c,"backend.worker.game.bun",mn),Pc=new v0({logQuery(n,i){mn.info("\uD83D\uDCDD query",n,i)}});d.STORE.loggers[0]=new Sc("info",void 0,mn);var ny=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new nl.CronJob("00 15 * * * *",()=>{O$($c,"backend.worker.tribunal.bun",mn)}),n.start(),process.on("exit",()=>{n.stop(),mn.info("\u231B tribunal daily cronjob stopped")}),mn.info("\u23F3 tribunal daily cronjob started");return n})();function qY(n){if(E$)return sY(E$,n);return ZY({},n)}var il=qY((n,i)=>{let o;n.on("data",(c)=>(o??=[]).push(c)).on("end",async()=>{let c=n.headers.authorization;try{if(typeof n.url==="undefined")throw[400,"No URL"];let p=n.socket.remoteAddress;if(!p)throw[400,"No IP address"];let x=new Date,m=new URL(n.url,qn.VITE_BACKEND_ORIGIN);mn.info(x,p,n.method,m.pathname);let a=await Pc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:Mo(cf.ip,p)}),f=a?.banishedUntil===null,v=a?.banishedUntil&&a.banishedUntil>x;if(f||v){mn.info(`\uD83D\uDE45 request from banned ip ${p}`);return}switch(n.method){case"POST":if(!o)throw[400,"No data received"];switch(m.pathname){case`/sign-up-${$0("sign-up")}`:{let $=Buffer.concat(o).toString(),w=JSON.parse($),J=PR.safeParse(w);if(!J.success){mn.warn("signup parsed",J.error.issues);return}let{username:l,password:S,email:R}=J.data;if(mn.info(`\uD83D\uDD11 attempting to sign up: ${l}`),await Pc.drizzle.query.users.findFirst({columns:{id:!0},where:Mo(Ro.email,R)}))throw[400,"User already exists"];let Y=crypto.randomUUID(),M=dR("sha256").update(S+Y).digest("hex");await Pc.drizzle.insert(Ro).values({username:l,email:R,hash:M,salt:Y,createdIp:p}),mn.info(`\uD83D\uDD11 user created: ${l}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${qn.FRONTEND_ORIGINS[0]}`}),i.end(pf[201])}break;case`/login-${$0("login")}`:{let $=!1,w=null;try{let J=new Date(+x-600000);mn.info("\uD83D\uDD11 ten minutes ago",{tenMinutesAgo:J,now:x});let l=await Pc.drizzle.query.loginHistory.findMany({columns:{userId:!0,successful:!0},where:Oc(Mo(ep.ipAddress,p),Mo(ep.successful,!1),Pm(ep.loginTime,J)),limit:10});mn.info(`\uD83D\uDD11 ${l.length}/10 recent failed logins from ${p}`);let S=10-l.length;if(S<1)throw mn.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await Pc.drizzle.insert(cf).values({ip:p,reason:"Too many recent login attempts.",banishedAt:x,banishedUntil:new Date(+x+86400000)}),[429,"Too many recent login attempts."];let R=Buffer.concat(o).toString(),K=JSON.parse(R),Y=qR.safeParse(K);if(!Y.success)throw mn.warn("login parsed",Y.error.issues),[400,`${S} attempts remaining.`];let{username:M,password:I}=Y.data,G=await Pc.drizzle.query.users.findFirst({columns:{id:!0,hash:!0,salt:!0},where:Mo(Ro.username,M)});if(mn.info("\uD83D\uDD11 login attempt as user",M),!G)throw mn.info(`\uD83D\uDD11 user ${M} does not exist`),[400,`${S} attempts remaining.`];let{hash:z,salt:E}=G;if(w=G.id,dR("sha256").update(I+E).digest("hex")===z){let B=crypto.randomUUID(),y=ua.get(M);if(!y)y=new Map,ua.set(M,y);y.set(B,Number(x)),$=!0,mn.info("\uD83D\uDD11 login successful as",M),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${qn.FRONTEND_ORIGINS[0]}`}),i.end(`${M} ${B}`)}}finally{await Pc.drizzle.insert(ep).values({userId:w,successful:$,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),mn.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}break;default:throw[404,"Not found"]}break;case void 0:throw[400,"No Method"];default:throw[405,"Method not allowed"]}}catch(p){let x=tR.safeParse(p);if(x.success){let[m,a]=x.data,v=`${pf[m]}. ${a}`;mn.info(`\u274C ${m}: ${v}`),i.writeHead(m,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${qn.FRONTEND_ORIGINS[0]}`}),i.end(v)}else mn.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${qn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),J0=il.listen(qn.BACKEND_PORT).address(),PY=typeof J0==="string"?null:J0===null?null:J0.port;if(PY===null)throw new Error("Could not determine port for test server");new q6(il,{cors:{origin:qn.FRONTEND_ORIGINS,methods:["GET","POST"]}}).use((n,i)=>{let{username:o,sessionKey:c}=n.handshake.auth;if(!(o&&c)){i(new Error("No auth header provided"));return}let p=`user::${o}`,x=`socket::${n.id}`;if(ua.get(o)?.has(c)){let a=t(d.STORE,Xm,x);On(d.STORE,a,n),ko(Gc,(f)=>{f.set(p,x)},d.STORE),On(d.STORE,_f,(f)=>f.add(p)),On(d.STORE,Vf,(f)=>f.add(x)),mn.info(`${o} connected on ${n.id}`),i()}else mn.info(`${o} couldn't authenticate`),i(new Error("Authentication error"))}).on("connection",(n)=>{let o=Y1({socket:n,store:d.STORE})(gR);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=ip(Gc,c,d.STORE).userKeyOfSocket,x=Gn(d.STORE,p);if(ko(Gc,(m)=>{m.delete(c)},d.STORE),x)On(d.STORE,_f,(m)=>(m.delete(x),m));On(d.STORE,Vf,(m)=>(m.delete(c),m)),mn.info(`${n.id} disconnected`),o()})});async function xf(){mn.info("\uD83E\uDDF9 closing workers");let n=new Promise((i)=>eR.process.once("close",i));eR.emit("timeToStop"),await n,mn.info("\uD83D\uDEEC backend server exiting"),process.exit(0)}process.on("SIGINT",async()=>{mn.info("\u2757 received SIGINT; exiting gracefully"),await xf()});process.on("SIGTERM",async()=>{mn.info("\u2757 received SIGTERM; exiting gracefully"),await xf()});process.on("exit",async()=>{mn.info("\u2757 received exit; exiting gracefully"),await xf()});$c.on("updatesReady",()=>{mn.info('\u2757 backend server received signal "updatesReady"'),$c.emit("readyToUpdate"),mn.info('\u2757 backend server has sent signal "readyToUpdate"; now awaits signal "timeToStop"'),$c.on("timeToStop",async()=>{mn.info('\u2757 backend server received signal "timeToStop"; exiting gracefully'),await xf()})});mn.info(`\uD83D\uDEEB backend server ready on port ${qn.BACKEND_PORT}`);$c.emit("alive");export{ny as tribunalDaily};
87
+ `;await i.execute(T`CREATE SCHEMA IF NOT EXISTS ${T.identifier(p)}`),await i.execute(x);let a=(await i.all(T`select id, hash, created_at from ${T.identifier(p)}.${T.identifier(c)} order by created_at desc limit 1`))[0];await i.transaction(async(f)=>{for await(let v of n)if(!a||Number(a.created_at)<v.folderMillis){for(let $ of v.sql)await f.execute(T.raw($));await f.execute(T`insert into ${T.identifier(p)}.${T.identifier(c)} ("hash", "created_at") values(${v.hash}, ${v.folderMillis})`)}})}escapeName(n){return`"${n}"`}escapeParam(n){return`$${n+1}`}escapeString(n){return`'${n.replace(/'/g,"''")}'`}buildWithCTE(n){if(!n?.length)return;let i=[T`with `];for(let[o,c]of n.entries())if(i.push(T`${T.identifier(c._.alias)} as (${c._.sql})`),o<n.length-1)i.push(T`, `);return i.push(T` `),T.join(i)}buildDeleteQuery({table:n,where:i,returning:o,withList:c}){let p=this.buildWithCTE(c),x=o?T` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,m=i?T` where ${i}`:void 0;return T`${p}delete from ${n}${m}${x}`}buildUpdateSet(n,i){let o=n[D.Symbol.Columns],c=Object.keys(o).filter((x)=>i[x]!==void 0||o[x]?.onUpdateFn!==void 0),p=c.length;return T.join(c.flatMap((x,m)=>{let a=o[x],f=i[x]??T.param(a.onUpdateFn(),a),v=T`${T.identifier(this.casing.getColumnCasing(a))} = ${f}`;if(m<p-1)return[v,T.raw(", ")];return[v]}))}buildUpdateQuery({table:n,set:i,where:o,returning:c,withList:p,from:x,joins:m}){let a=this.buildWithCTE(p),f=n[Ai.Symbol.Name],v=n[Ai.Symbol.Schema],$=n[Ai.Symbol.OriginalName],w=f===$?void 0:f,J=T`${v?T`${T.identifier(v)}.`:void 0}${T.identifier($)}${w&&T` ${T.identifier(w)}`}`,S=this.buildUpdateSet(n,i),X=x&&T.join([T.raw(" from "),this.buildFromTable(x)]),R=this.buildJoins(m),K=c?T` returning ${this.buildSelection(c,{isSingleTable:!x})}`:void 0,M=o?T` where ${o}`:void 0;return T`${a}update ${J} set ${S}${X}${R}${M}${K}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},x)=>{let m=[];if(l(p,L.Aliased)&&p.isSelectionField)m.push(T.identifier(p.fieldAlias));else if(l(p,L.Aliased)||l(p,L)){let a=l(p,L.Aliased)?p.sql:p;if(i)m.push(new L(a.queryChunks.map((f)=>{if(l(f,V))return T.identifier(this.casing.getColumnCasing(f));return f})));else m.push(a);if(l(p,L.Aliased))m.push(T` as ${T.identifier(p.fieldAlias)}`)}else if(l(p,Un))if(i)m.push(T.identifier(this.casing.getColumnCasing(p)));else m.push(p);if(x<o-1)m.push(T`, `);return m});return T.join(c)}buildJoins(n){if(!n||n.length===0)return;let i=[];for(let[o,c]of n.entries()){if(o===0)i.push(T` `);let p=c.table,x=c.lateral?T` lateral`:void 0;if(l(p,Ai)){let m=p[Ai.Symbol.Name],a=p[Ai.Symbol.Schema],f=p[Ai.Symbol.OriginalName],v=m===f?void 0:c.alias;i.push(T`${T.raw(c.joinType)} join${x} ${a?T`${T.identifier(a)}.`:void 0}${T.identifier(f)}${v&&T` ${T.identifier(v)}`} on ${c.on}`)}else if(l(p,bi)){let m=p[un].name,a=p[un].schema,f=p[un].originalName,v=m===f?void 0:c.alias;i.push(T`${T.raw(c.joinType)} join${x} ${a?T`${T.identifier(a)}.`:void 0}${T.identifier(f)}${v&&T` ${T.identifier(v)}`} on ${c.on}`)}else i.push(T`${T.raw(c.joinType)} join${x} ${p} on ${c.on}`);if(o<n.length-1)i.push(T` `)}return T.join(i)}buildFromTable(n){if(l(n,D)&&n[D.Symbol.IsAlias]){let i=T`${T.identifier(n[D.Symbol.OriginalName])}`;if(n[D.Symbol.Schema])i=T`${T.identifier(n[D.Symbol.Schema])}.${i}`;return T`${i} ${T.identifier(n[D.Symbol.Name])}`}return n}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:x,joins:m,orderBy:a,groupBy:f,limit:v,offset:$,lockingClause:w,distinct:J,setOperators:S}){let X=o??di(i);for(let fn of X)if(l(fn.field,Un)&&mi(fn.field.table)!==(l(x,ci)?x._.alias:l(x,nm)?x[un].name:l(x,L)?void 0:mi(x))&&!((En)=>m?.some(({alias:dn})=>dn===(En[D.Symbol.IsAlias]?mi(En):En[D.Symbol.BaseName])))(fn.field.table)){let En=mi(fn.field.table);throw new Error(`Your "${fn.path.join("->")}" field references a column "${En}"."${fn.field.name}", but the table "${En}" is not part of the query! Did you forget to join it?`)}let R=!m||m.length===0,K=this.buildWithCTE(n),M;if(J)M=J===!0?T` distinct`:T` distinct on (${T.join(J.on,T`, `)})`;let Y=this.buildSelection(X,{isSingleTable:R}),I=this.buildFromTable(x),G=this.buildJoins(m),z=c?T` where ${c}`:void 0,E=p?T` having ${p}`:void 0,Q;if(a&&a.length>0)Q=T` order by ${T.join(a,T`, `)}`;let b;if(f&&f.length>0)b=T` group by ${T.join(f,T`, `)}`;let y=typeof v==="object"||typeof v==="number"&&v>=0?T` limit ${v}`:void 0,H=$?T` offset ${$}`:void 0,an=T.empty();if(w){let fn=T` for ${T.raw(w.strength)}`;if(w.config.of)fn.append(T` of ${T.join(Array.isArray(w.config.of)?w.config.of:[w.config.of],T`, `)}`);if(w.config.noWait)fn.append(T` no wait`);else if(w.config.skipLocked)fn.append(T` skip locked`);an.append(fn)}let Z=T`${K}select${M} ${Y} from ${I}${G}${z}${b}${E}${Q}${y}${H}${an}`;if(S.length>0)return this.buildSetOperations(Z,S);return Z}buildSetOperations(n,i){let[o,...c]=i;if(!o)throw new Error("Cannot pass undefined values to any set operator");if(c.length===0)return this.buildSetOperationQuery({leftSelect:n,setOperator:o});return this.buildSetOperations(this.buildSetOperationQuery({leftSelect:n,setOperator:o}),c)}buildSetOperationQuery({leftSelect:n,setOperator:{type:i,isAll:o,rightSelect:c,limit:p,orderBy:x,offset:m}}){let a=T`(${n.getSQL()}) `,f=T`(${c.getSQL()})`,v;if(x&&x.length>0){let S=[];for(let X of x)if(l(X,V))S.push(T.identifier(X.name));else if(l(X,L)){for(let R=0;R<X.queryChunks.length;R++){let K=X.queryChunks[R];if(l(K,V))X.queryChunks[R]=T.identifier(K.name)}S.push(T`${X}`)}else S.push(T`${X}`);v=T` order by ${T.join(S,T`, `)} `}let $=typeof p==="object"||typeof p==="number"&&p>=0?T` limit ${p}`:void 0,w=T.raw(`${i} ${o?"all ":""}`),J=m?T` offset ${m}`:void 0;return T`${a}${w}${f}${v}${$}${J}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p,select:x,overridingSystemValue_:m}){let a=[],f=n[D.Symbol.Columns],v=Object.entries(f).filter(([K,M])=>!M.shouldDisableInsert()),$=v.map(([,K])=>T.identifier(this.casing.getColumnCasing(K)));if(x){let K=i;if(l(K,L))a.push(K);else a.push(K.getSQL())}else{let K=i;a.push(T.raw("values "));for(let[M,Y]of K.entries()){let I=[];for(let[G,z]of v){let E=Y[G];if(E===void 0||l(E,Li)&&E.value===void 0)if(z.defaultFn!==void 0){let Q=z.defaultFn(),b=l(Q,L)?Q:T.param(Q,z);I.push(b)}else if(!z.default&&z.onUpdateFn!==void 0){let Q=z.onUpdateFn(),b=l(Q,L)?Q:T.param(Q,z);I.push(b)}else I.push(T`default`);else I.push(E)}if(a.push(I),M<K.length-1)a.push(T`, `)}}let w=this.buildWithCTE(p),J=T.join(a),S=c?T` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,X=o?T` on conflict ${o}`:void 0,R=m===!0?T`overriding system value `:void 0;return T`${w}insert into ${n} ${$} ${R}${J}${X}${S}`}buildRefreshMaterializedViewQuery({view:n,concurrently:i,withNoData:o}){let c=i?T` concurrently`:void 0,p=o?T` with no data`:void 0;return T`refresh materialized view${c} ${n}${p}`}prepareTyping(n){if(l(n,ia)||l(n,na))return"json";else if(l(n,oa))return"decimal";else if(l(n,ca))return"time";else if(l(n,pa)||l(n,xa))return"timestamp";else if(l(n,dm)||l(n,gm))return"date";else if(l(n,ma))return"uuid";else return"none"}sqlToQuery(n,i){return n.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,prepareTyping:this.prepareTyping,invokeSource:i})}buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:c,tableConfig:p,queryConfig:x,tableAlias:m,nestedQueryRelation:a,joinOn:f}){let v=[],$,w,J=[],S,X=[];if(x===!0)v=Object.entries(p.columns).map(([M,Y])=>({dbKey:Y.name,tsKey:M,field:Mo(Y,m),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let K=Object.fromEntries(Object.entries(p.columns).map(([E,Q])=>[E,Mo(Q,m)]));if(x.where){let E=typeof x.where==="function"?x.where(K,mT()):x.where;S=E&&Ex(E,m)}let M=[],Y=[];if(x.columns){let E=!1;for(let[Q,b]of Object.entries(x.columns)){if(b===void 0)continue;if(Q in p.columns){if(!E&&b===!0)E=!0;Y.push(Q)}}if(Y.length>0)Y=E?Y.filter((Q)=>x.columns?.[Q]===!0):Object.keys(p.columns).filter((Q)=>!Y.includes(Q))}else Y=Object.keys(p.columns);for(let E of Y){let Q=p.columns[E];M.push({tsKey:E,value:Q})}let I=[];if(x.with)I=Object.entries(x.with).filter((E)=>!!E[1]).map(([E,Q])=>({tsKey:E,queryConfig:Q,relation:p.relations[E]}));let G;if(x.extras){G=typeof x.extras==="function"?x.extras(K,{sql:T}):x.extras;for(let[E,Q]of Object.entries(G))M.push({tsKey:E,value:Gv(Q,m)})}for(let{tsKey:E,value:Q}of M)v.push({dbKey:l(Q,L.Aliased)?Q.fieldAlias:p.columns[E].name,tsKey:E,field:l(Q,Un)?Mo(Q,m):Q,relationTableTsKey:void 0,isJson:!1,selection:[]});let z=typeof x.orderBy==="function"?x.orderBy(K,aT()):x.orderBy??[];if(!Array.isArray(z))z=[z];J=z.map((E)=>{if(l(E,Un))return Mo(E,m);return Ex(E,m)}),$=x.limit,w=x.offset;for(let{tsKey:E,queryConfig:Q,relation:b}of I){let y=vT(i,o,b),H=Ec(b.referencedTable),an=o[H],Z=`${m}_${E}`,fn=Oc(...y.fields.map((Vi,Oo)=>Yo(Mo(y.references[Oo],Z),Mo(Vi,m)))),En=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[an],tableConfig:i[an],queryConfig:l(b,ic)?Q===!0?{limit:1}:{...Q,limit:1}:Q,tableAlias:Z,joinOn:fn,nestedQueryRelation:b}),dn=T`${T.identifier(Z)}.${T.identifier("data")}`.as(E);X.push({on:T`true`,table:new ci(En.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),v.push({dbKey:E,tsKey:E,field:dn,relationTableTsKey:an,isJson:!0,selection:En.selection})}}if(v.length===0)throw new Pm({message:`No fields selected for table "${p.tsName}" ("${m}")`});let R;if(S=Oc(f,S),a){let K=T`json_build_array(${T.join(v.map(({field:I,tsKey:G,isJson:z})=>z?T`${T.identifier(`${m}_${G}`)}.${T.identifier("data")}`:l(I,L.Aliased)?I.sql:I),T`, `)})`;if(l(a,_x))K=T`coalesce(json_agg(${K}${J.length>0?T` order by ${T.join(J,T`, `)}`:void 0}), '[]'::json)`;let M=[{dbKey:"data",tsKey:"data",field:K.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:v}];if($!==void 0||w!==void 0||J.length>0)R=this.buildSelectQuery({table:sm(c,m),fields:{},fieldsFlat:[{path:[],field:T.raw("*")}],where:S,limit:$,offset:w,orderBy:J,setOperators:[]}),S=void 0,$=void 0,w=void 0,J=[];else R=sm(c,m);R=this.buildSelectQuery({table:l(R,Ai)?R:new ci(R,{},m),fields:{},fieldsFlat:M.map(({field:I})=>({path:[],field:l(I,Un)?Mo(I,m):I})),joins:X,where:S,limit:$,offset:w,orderBy:J,setOperators:[]})}else R=this.buildSelectQuery({table:sm(c,m),fields:{},fieldsFlat:v.map(({field:K})=>({path:[],field:l(K,Un)?Mo(K,m):K})),joins:X,where:S,limit:$,offset:w,orderBy:J,setOperators:[]});return{tableTsKey:p.tsName,sql:R,selection:v}}}class r${static[F]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class Ui{static[F]="PgSelectBuilder";fields;session;dialect;withList=[];distinct;constructor(n){if(this.fields=n.fields,this.session=n.session,this.dialect=n.dialect,n.withList)this.withList=n.withList;this.distinct=n.distinct}authToken;setToken(n){return this.authToken=n,this}from(n){let i=!!this.fields,o=n,c;if(this.fields)c=this.fields;else if(l(o,ci))c=Object.fromEntries(Object.keys(o._.selectedFields).map((p)=>[p,o[p]]));else if(l(o,nm))c=o[un].selectedFields;else if(l(o,L))c={};else c=mA(o);return new d$({table:o,fields:c,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}class DR extends r${static[F]="PgSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;constructor({table:n,fields:i,isPartialSelect:o,session:c,dialect:p,withList:x,distinct:m}){super();this.config={withList:x,table:n,fields:{...i},distinct:m,setOperators:[]},this.isPartialSelect=o,this.session=c,this.dialect=p,this._={selectedFields:i},this.tableName=_o(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}createJoin(n){return(i,o)=>{let c=this.tableName,p=_o(i);if(typeof p==="string"&&this.config.joins?.some((x)=>x.alias===p))throw new Error(`Alias "${p}" is already used in this query`);if(!this.isPartialSelect){if(Object.keys(this.joinsNotNullableMap).length===1&&typeof c==="string")this.config.fields={[c]:this.config.fields};if(typeof p==="string"&&!l(i,L)){let x=l(i,ci)?i._.selectedFields:l(i,bi)?i[un].selectedFields:i[D.Symbol.Columns];this.config.fields[p]=x}}if(typeof o==="function")o=o(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));if(!this.config.joins)this.config.joins=[];if(this.config.joins.push({on:o,table:i,joinType:n,alias:p}),typeof p==="string")switch(n){case"left":{this.joinsNotNullableMap[p]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!0;break}case"inner":{this.joinsNotNullableMap[p]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([x])=>[x,!1])),this.joinsNotNullableMap[p]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");createSetOperator(n,i){return(o)=>{let c=typeof o==="function"?o(OM()):o;if(!Ox(this.getSelectedFields(),c.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:n,isAll:i,rightSelect:c}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);intersectAll=this.createSetOperator("intersect",!0);except=this.createSetOperator("except",!1);exceptAll=this.createSetOperator("except",!0);addSetOperators(n){return this.config.setOperators.push(...n),this}where(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.where=n,this}having(n){if(typeof n==="function")n=n(new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.having=n,this}groupBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=n;return this}orderBy(...n){if(typeof n[0]==="function"){let i=n[0](new Proxy(this.config.fields,new kn({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),o=Array.isArray(i)?i:[i];if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=o;else this.config.orderBy=o}else{let i=n;if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=i;else this.config.orderBy=i}return this}limit(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).limit=n;else this.config.limit=n;return this}offset(n){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).offset=n;else this.config.offset=n;return this}for(n,i={}){return this.config.lockingClause={strength:n,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(n){return new Proxy(new ci(this.getSQL(),this.config.fields,n),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new kn({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}class d$ extends DR{static[F]="PgSelect";_prepare(n){let{session:i,config:o,dialect:c,joinsNotNullableMap:p,authToken:x}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Vn.startActiveSpan("drizzle.prepareQuery",()=>{let m=di(o.fields),a=i.prepareQuery(c.sqlToQuery(this.getSQL()),m,n,!0);return a.joinsNotNullableMap=p,a.setToken(x)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}xA(d$,[Qi]);function dp(n,i){return(o,c,...p)=>{let x=[c,...p].map((m)=>({type:n,isAll:i,rightSelect:m}));for(let m of x)if(!Ox(o.getSelectedFields(),m.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return o.addSetOperators(x)}}var OM=()=>({union:UM,unionAll:VM,intersect:_M,intersectAll:bM,except:uM,exceptAll:BM}),UM=dp("union",!1),VM=dp("union",!0),_M=dp("intersect",!1),bM=dp("intersect",!0),uM=dp("except",!1),BM=dp("except",!0);class im{static[F]="PgQueryBuilder";dialect;dialectConfig;constructor(n){this.dialect=l(n,sc)?n:void 0,this.dialectConfig=l(n,sc)?void 0:n}$with=(n,i)=>{let o=this;return{as:(p)=>{if(typeof p==="function")p=p(o);return new Proxy(new Hx(p.getSQL(),i??("getSelectedFields"in p?p.getSelectedFields()??{}:{}),n,!0),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};with(...n){let i=this;function o(x){return new Ui({fields:x??void 0,session:void 0,dialect:i.getDialect(),withList:n})}function c(x){return new Ui({fields:x??void 0,session:void 0,dialect:i.getDialect(),distinct:!0})}function p(x,m){return new Ui({fields:m??void 0,session:void 0,dialect:i.getDialect(),distinct:{on:x}})}return{select:o,selectDistinct:c,selectDistinctOn:p}}select(n){return new Ui({fields:n??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(n){return new Ui({fields:n??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(n,i){return new Ui({fields:i??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:n}})}getDialect(){if(!this.dialect)this.dialect=new sc(this.dialectConfig);return this.dialect}}class ga{constructor(n,i,o,c,p){this.table=n,this.session=i,this.dialect=o,this.withList=c,this.overridingSystemValue_=p}static[F]="PgInsertBuilder";authToken;setToken(n){return this.authToken=n,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(n){if(n=Array.isArray(n)?n:[n],n.length===0)throw new Error("values() must be called with at least one value");let i=n.map((o)=>{let c={},p=this.table[D.Symbol.Columns];for(let x of Object.keys(o)){let m=o[x];c[x]=l(m,L)?m:new Li(m,p[x])}return c});return new g$(this.table,i,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(n){let i=typeof n==="function"?n(new im):n;if(!l(i,L)&&!Ox(this.table[Zm],i._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new g$(this.table,i,this.session,this.dialect,this.withList,!0)}}class g$ extends Qi{constructor(n,i,o,c,p,x,m){super();this.session=o,this.dialect=c,this.config={table:n,values:i,withList:p,select:x,overridingSystemValue_:m}}static[F]="PgInsert";config;returning(n=this.config.table[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=di(n),this}onConflictDoNothing(n={}){if(n.target===void 0)this.config.onConflict=T`do nothing`;else{let i="";i=Array.isArray(n.target)?n.target.map((c)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(c))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target));let o=n.where?T` where ${n.where}`:void 0;this.config.onConflict=T`(${T.raw(i)})${o} do nothing`}return this}onConflictDoUpdate(n){if(n.where&&(n.targetWhere||n.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');let i=n.where?T` where ${n.where}`:void 0,o=n.targetWhere?T` where ${n.targetWhere}`:void 0,c=n.setWhere?T` where ${n.setWhere}`:void 0,p=this.dialect.buildUpdateSet(this.config.table,rm(this.config.table,n.set)),x="";return x=Array.isArray(n.target)?n.target.map((m)=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(m))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(n.target)),this.config.onConflict=T`(${T.raw(x)})${o} do update set ${p}${i}${c}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:mi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class e$ extends Qi{constructor(n,i,o){super();this.session=i,this.dialect=o,this.config={view:n}}static[F]="PgRefreshMaterializedView";config;concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,n,!0)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}class ea{constructor(n,i,o,c){this.table=n,this.session=i,this.dialect=o,this.withList=c}static[F]="PgUpdateBuilder";authToken;setToken(n){return this.authToken=n,this}set(n){return new LR(this.table,rm(this.table,n),this.session,this.dialect,this.withList).setToken(this.authToken)}}class LR extends Qi{constructor(n,i,o,c,p){super();this.session=o,this.dialect=c,this.config={set:i,table:n,withList:p,joins:[]},this.tableName=_o(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}static[F]="PgUpdate";config;tableName;joinsNotNullableMap;from(n){let i=n,o=_o(i);if(typeof o==="string")this.joinsNotNullableMap[o]=!0;return this.config.from=i,this}getTableLikeFields(n){if(l(n,Ai))return n[D.Symbol.Columns];else if(l(n,ci))return n._.selectedFields;return n[un].selectedFields}createJoin(n){return(i,o)=>{let c=_o(i);if(typeof c==="string"&&this.config.joins.some((p)=>p.alias===c))throw new Error(`Alias "${c}" is already used in this query`);if(typeof o==="function"){let p=this.config.from&&!l(this.config.from,L)?this.getTableLikeFields(this.config.from):void 0;o=o(new Proxy(this.config.table[D.Symbol.Columns],new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),p&&new Proxy(p,new kn({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:o,table:i,joinType:n,alias:c}),typeof c==="string")switch(n){case"left":{this.joinsNotNullableMap[c]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!0;break}case"inner":{this.joinsNotNullableMap[c]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([p])=>[p,!1])),this.joinsNotNullableMap[c]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(n){return this.config.where=n,this}returning(n){if(!n){if(n=Object.assign({},this.config.table[D.Symbol.Columns]),this.config.from){let i=_o(this.config.from);if(typeof i==="string"&&this.config.from&&!l(this.config.from,L)){let o=this.getTableLikeFields(this.config.from);n[i]=o}for(let o of this.config.joins){let c=_o(o.table);if(typeof c==="string"&&!l(o.table,L)){let p=this.getTableLikeFields(o.table);n[c]=p}}}}return this.config.returningFields=n,this.config.returning=di(n),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){let i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,n,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return this._prepare().execute(n,this.authToken)};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:mi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class om extends L{constructor(n){super(om.buildEmbeddedCount(n.source,n.filters).queryChunks);this.params=n,this.mapWith(Number),this.session=n.session,this.sql=om.buildCount(n.source,n.filters)}sql;token;static[F]="PgCountBuilder";[Symbol.toStringTag]="PgCountBuilder";session;static buildEmbeddedCount(n,i){return T`(select count(*) from ${n}${T.raw(" where ").if(i)}${i})`}static buildCount(n,i){return T`select count(*) as count from ${n}${T.raw(" where ").if(i)}${i};`}setToken(n){return this.token=n,this}then(n,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(n,i)}catch(n){return this.then(void 0,n)}finally(n){return this.then((i)=>{return n?.(),i},(i)=>{throw n?.(),i})}}class i0{constructor(n,i,o,c,p,x,m){this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m}static[F]="PgRelationalQueryBuilder";findMany(n){return new n0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new n0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class n0 extends Qi{constructor(n,i,o,c,p,x,m,a,f){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m,this.config=a,this.mode=f}static[F]="PgRelationalQuery";_prepare(n){return Vn.startActiveSpan("drizzle.prepareQuery",()=>{let{query:i,builtQuery:o}=this._toSQL();return this.session.prepareQuery(o,void 0,n,!0,(c,p)=>{let x=c.map((m)=>aa(this.schema,this.tableConfig,m,i.selection,p));if(this.mode==="first")return x[0];return x})})}prepare(n){return this._prepare(n)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let n=this._getQuery(),i=this.dialect.sqlToQuery(n.sql);return{query:n,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}authToken;setToken(n){return this.authToken=n,this}execute(){return Vn.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(void 0,this.authToken)})}}class o0 extends Qi{constructor(n,i,o,c){super();this.execute=n,this.sql=i,this.query=o,this.mapBatchResult=c}static[F]="PgRaw";getSQL(){return this.sql}getQuery(){return this.query}mapResult(n,i){return i?this.mapBatchResult(n):n}_prepare(){return this}isResponseInArrayMode(){return!1}}class cm{constructor(n,i,o){if(this.dialect=n,this.session=i,this._=o?{schema:o.schema,fullSchema:o.fullSchema,tableNamesMap:o.tableNamesMap,session:i}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:i},this.query={},this._.schema)for(let[c,p]of Object.entries(this._.schema))this.query[c]=new i0(o.fullSchema,this._.schema,this._.tableNamesMap,o.fullSchema[c],p,n,i)}static[F]="PgDatabase";query;$with=(n,i)=>{let o=this;return{as:(p)=>{if(typeof p==="function")p=p(new im(o.dialect));return new Proxy(new Hx(p.getSQL(),i??("getSelectedFields"in p?p.getSelectedFields()??{}:{}),n,!0),new kn({alias:n,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};$count(n,i){return new om({source:n,filters:i,session:this.session})}with(...n){let i=this;function o(f){return new Ui({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(f){return new Ui({fields:f??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(f,v){return new Ui({fields:v??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:f}})}function x(f){return new ea(f,i.session,i.dialect,n)}function m(f){return new ga(f,i.session,i.dialect,n)}function a(f){return new da(f,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:x,insert:m,delete:a}}select(n){return new Ui({fields:n??void 0,session:this.session,dialect:this.dialect})}selectDistinct(n){return new Ui({fields:n??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(n,i){return new Ui({fields:i??void 0,session:this.session,dialect:this.dialect,distinct:{on:n}})}update(n){return new ea(n,this.session,this.dialect)}insert(n){return new ga(n,this.session,this.dialect)}delete(n){return new da(n,this.session,this.dialect)}refreshMaterializedView(n){return new e$(n,this.session,this.dialect)}authToken;execute(n){let i=typeof n==="string"?T.raw(n):n.getSQL(),o=this.dialect.sqlToQuery(i),c=this.session.prepareQuery(o,void 0,void 0,!1);return new o0(()=>c.execute(void 0,this.authToken),i,o,(p)=>c.mapResult(p,!0))}transaction(n,i){return this.session.transaction(n,i)}}class NR{constructor(n,i){this.unique=n,this.name=i}static[F]="PgIndexBuilderOn";on(...n){return new nf(n.map((i)=>{if(l(i,L))return i;i=i;let o=new Yx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=JSON.parse(JSON.stringify(i.defaultConfig)),o}),this.unique,!1,this.name)}onOnly(...n){return new nf(n.map((i)=>{if(l(i,L))return i;i=i;let o=new Yx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new nf(i.map((o)=>{if(l(o,L))return o;o=o;let c=new Yx(o.name,!!o.keyAsName,o.columnType,o.indexConfig);return o.indexConfig=JSON.parse(JSON.stringify(o.defaultConfig)),c}),this.unique,!0,this.name,n)}}class nf{static[F]="PgIndexBuilder";config;constructor(n,i,o,c,p="btree"){this.config={name:c,columns:n,unique:i,only:o,method:p}}concurrently(){return this.config.concurrently=!0,this}with(n){return this.config.with=n,this}where(n){return this.config.where=n,this}build(n){return new hR(this.config,n)}}class hR{static[F]="PgIndex";config;constructor(n,i){this.config={...n,table:i}}}function c0(n){return new NR(!0,n)}class p0{constructor(n){this.query=n}authToken;getQuery(){return this.query}mapResult(n,i){return n}setToken(n){return this.authToken=n,this}static[F]="PgPreparedQuery";joinsNotNullableMap}class x0{constructor(n){this.dialect=n}static[F]="PgSession";execute(n,i){return Vn.startActiveSpan("drizzle.operation",()=>{return Vn.startActiveSpan("drizzle.prepareQuery",()=>{return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1)}).setToken(i).execute(void 0,i)})}all(n){return this.prepareQuery(this.dialect.sqlToQuery(n),void 0,void 0,!1).all()}async count(n,i){let o=await this.execute(n,i);return Number(o[0].count)}}class m0 extends cm{constructor(n,i,o,c=0){super(n,i,o);this.schema=o,this.nestedIndex=c}static[F]="PgTransaction";rollback(){throw new Mv}getTransactionConfigSQL(n){let i=[];if(n.isolationLevel)i.push(`isolation level ${n.isolationLevel}`);if(n.accessMode)i.push(n.accessMode);if(typeof n.deferrable==="boolean")i.push(n.deferrable?"deferrable":"not deferrable");return T.raw(i.join(" "))}setTransaction(n){return this.session.execute(T`set transaction ${this.getTransactionConfigSQL(n)}`)}}class CR extends p0{constructor(n,i,o,c,p,x,m){super({sql:i,params:o});this.client=n,this.queryString=i,this.params=o,this.logger=c,this.fields=p,this._isResponseInArrayMode=x,this.customResultMapper=m}static[F]="PostgresJsPreparedQuery";async execute(n={}){return Vn.startActiveSpan("drizzle.execute",async(i)=>{let o=lv(this.params,n);i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o);let{fields:c,queryString:p,client:x,joinsNotNullableMap:m,customResultMapper:a}=this;if(!c&&!a)return Vn.startActiveSpan("drizzle.driver.execute",()=>{return x.unsafe(p,o)});let f=await Vn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":p,"drizzle.query.params":JSON.stringify(o)}),x.unsafe(p,o).values()});return Vn.startActiveSpan("drizzle.mapResponse",()=>{return a?a(f):f.map((v)=>pA(c,v,m))})})}all(n={}){return Vn.startActiveSpan("drizzle.execute",async(i)=>{let o=lv(this.params,n);return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o),Vn.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.client.unsafe(this.queryString,o)})})}isResponseInArrayMode(){return this._isResponseInArrayMode}}class pm extends x0{constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new Hv}static[F]="PostgresJsSession";logger;prepareQuery(n,i,o,c,p){return new CR(this.client,n.sql,n.params,this.logger,i,c,p)}query(n,i){return this.logger.logQuery(n,i),this.client.unsafe(n,i).values()}queryObjects(n,i){return this.client.unsafe(n,i)}transaction(n,i){return this.client.begin(async(o)=>{let c=new pm(o,this.dialect,this.schema,this.options),p=new a0(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class a0 extends m0{constructor(n,i,o,c=0){super(n,i,o,c);this.session=i}static[F]="PostgresJsTransaction";transaction(n){return this.session.client.savepoint((i)=>{let o=new pm(i,this.dialect,this.schema,this.session.options),c=new a0(this.dialect,o,this.schema);return n(c)})}}class IR extends cm{static[F]="PostgresJsDatabase"}function gp(n,i={}){let o=(f)=>f;for(let f of["1184","1082","1083","1114","1182","1185","1115","1231"])n.options.parsers[f]=o,n.options.serializers[f]=o;n.options.serializers["114"]=o,n.options.serializers["3802"]=o;let c=new sc({casing:i.casing}),p;if(i.logger===!0)p=new Yv;else if(i.logger!==!1)p=i.logger;let x;if(i.schema){let f=fT(i.schema,$T);x={fullSchema:i.schema,schema:f.tables,tableNamesMap:f.tableNamesMap}}let m=new pm(n,c,x,{logger:p}),a=new IR(c,m,x);return a.$client=n,a}function of(...n){if(typeof n[0]==="string"){let i=rp(n[0]);return gp(i,n[1])}if(aA(n[0])){let{connection:i,client:o,...c}=n[0];if(o)return gp(o,c);if(typeof i==="object"&&i.url!==void 0){let{url:x,...m}=i,a=rp(x,m);return gp(a,c)}let p=rp(i);return gp(p,c)}return gp(n[0],n[1])}((n)=>{function i(o){return gp({options:{parsers:{},serializers:{}}},o)}n.mock=i})(of||(of={}));var v0={};p3(v0,{users:()=>So,userChanges:()=>DM,untrackedUserColumnNames:()=>jM,twoFactorMethod:()=>sR,trackedUserColumnName:()=>qR,trackableUserColumnNames:()=>ZR,role:()=>kR,players:()=>f0,passwordResetAttempts:()=>LM,loginHistory:()=>ep,games:()=>cf,banishedIps:()=>pf});function yR(n){return T`lower(${n})`}var kR=ym("role",["admin","user"]),So=nc("users",{id:Ni().primaryKey().defaultRandom(),username:Ji({length:16}).notNull(),email:Ji({length:254}).notNull(),hash:Ji({length:64}).notNull(),salt:Ji({length:36}).notNull(),createdAt:vo({withTimezone:!0}).notNull().defaultNow(),createdIp:Ji({length:45}).notNull(),isActive:Ux().notNull().default(!1),verifiedAt:vo({withTimezone:!0}),userRole:kR().default("user")},(n)=>[c0("usernameUniqueIndex").on(yR(n.username)),c0("emailUniqueIndex").on(yR(n.email))]),jM=["id","createdAt","createdIp","isActive","salt","verifiedAt"],ZR=["username","email","hash","userRole"],qR=ym("trackedUserColumnName",ZR),DM=nc("userChanges",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>So.id),changedAt:vo({withTimezone:!0}).notNull().defaultNow(),changedIp:Ji({length:45}).notNull(),changedColumn:qR().notNull(),oldValue:Ji({length:255}),newValue:Ji({length:255})}),cf=nc("games",{id:Ni().primaryKey().defaultRandom()}),f0=nc("players",{userId:Ni().notNull().references(()=>So.id),gameId:Ni().notNull().references(()=>cf.id),score:em().notNull()},(n)=>[cT({name:"players_userId_gameId_pk",columns:[n.userId,n.gameId]})]),ep=nc("loginHistory",{id:Ni().primaryKey().defaultRandom(),userId:Ni().references(()=>So.id),loginTime:vo({withTimezone:!0}).notNull().defaultNow(),ipAddress:Ji({length:45}).notNull(),userAgent:Ji({length:1024}),successful:Ux().notNull().default(!1)}),sR=ym("twoFactorMethod",["email","phone"]),LM=nc("passwordResetAttempts",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>So.id),requestedIp:Ji({length:45}).notNull(),requestedAt:vo({withTimezone:!0}).notNull().defaultNow(),succeededIp:Ji({length:45}),succeededAt:vo({withTimezone:!0}),verificationMethod:sR().notNull()}),pf=nc("banishedIps",{ip:Ji({length:45}).primaryKey(),reason:Ji({length:2048}).notNull(),banishedAt:vo({withTimezone:!0}).notNull().defaultNow(),banishedUntil:vo({withTimezone:!0})});var __dirname="/home/runner/work/wayforge/wayforge/apps/tempest.games/src/database";class $0{options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(NM.resolve(__dirname,"notify_update.sql"));let n=[mi(So),mi(cf),mi(f0)];await this.sql`SELECT create_notify_triggers(${this.sql.array(n)})`,await this.sql.listen("table_update",(i)=>{let o=i.split(","),c=o[0],p=o[1],x=`${c}("${p}")`;if(this.observers.has(x))this.observers.get(x).next(x)})}constructor(n=!1,i={host:sn.POSTGRES_HOST,port:sn.POSTGRES_PORT,user:sn.POSTGRES_USER,password:sn.POSTGRES_PASSWORD,database:sn.POSTGRES_DATABASE}){this.options=i,this.sql=rp(i),this.drizzle=of(this.sql,{schema:v0,logger:n})}observe(n,i){if(!this.observers.has(n))this.observers.set(n,new $n);this.observers.get(n).subscribe("SINGLETON",i)}}import{createHash as hM}from"node:crypto";function w0(n){let i=hM("sha256").update(n).digest("hex");return`${i.substring(0,8)}-${i.substring(8,12)}-${i.substring(12,16)}-${i.substring(16,20)}-${i.substring(20,32)}`}var PR=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"];var CM=3,IM=15,yM=/^[a-zA-Z0-9_-]+$/,dR=Wn.string().min(CM).max(IM).regex(yM),tR=20,rR={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function kM(n){let i="";for(let o of n)if(o in rR)i+=rR[o];else i+=o;return i}function ZM(n){let i=n.toLocaleLowerCase(),o=kM(i);for(let c of PR){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function qM(n){let i=new Set(n).size;return n.length*Math.log2(i)}function sM(n){let i=0,o=100;if(ZM(n))i-=o;return i+=qM(n)*0.5,Math.max(i,0)}var gR=Wn.string().refine((n)=>{return sM(n)>=tR},{message:`Password does not meet the minimum complexity of ${tR}.`}).brand("password"),eR=Wn.object({username:dR,password:gR}).strict(),PM=Wn.string().email().brand("email"),nS=Wn.object({username:dR,password:gR,email:PM}).strict();var xf={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication 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:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",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"},J0=Y0(xf).map(([n])=>Wn.literal(Number(n))),tM=Wn.union([J0[0],J0[1],...J0]),iS=Wn.tuple([tM,Wn.string()]);var oS=Zo({key:"count",default:0}),rM=lc({key:"incrementTX",do:({set:n})=>{n(oS,(i)=>i+1)}}),cS=R1({key:"countContinuity",config:(n)=>n.add(oS).add(rM)});var xS=U$($c,"backend.worker.game.bun",mn),Pc=new $0({logQuery(n,i){mn.info("\uD83D\uDCDD query",n,i)}});g.STORE.loggers[0]=new Xc("info",void 0,mn);var my=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new mS.CronJob("00 15 * * * *",()=>{U$($c,"backend.worker.tribunal.bun",mn)}),n.start(),process.on("exit",()=>{n.stop(),mn.info("\u231B tribunal daily cronjob stopped")}),mn.info("\u23F3 tribunal daily cronjob started");return n})();function eM(n){if(O$)return gM(O$,n);return dM({},n)}var aS=eM((n,i)=>{let o;n.on("data",(c)=>(o??=[]).push(c)).on("end",async()=>{let c=n.headers.authorization;try{if(typeof n.url==="undefined")throw[400,"No URL"];let p=n.socket.remoteAddress;if(!p)throw[400,"No IP address"];let x=new Date,m=new URL(n.url,sn.VITE_BACKEND_ORIGIN);mn.info(x,p,n.method,m.pathname);let a=await Pc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:Yo(pf.ip,p)}),f=a?.banishedUntil===null,v=a?.banishedUntil&&a.banishedUntil>x;if(f||v){mn.info(`\uD83D\uDE45 request from banned ip ${p}`);return}switch(n.method){case"POST":if(!o)throw[400,"No data received"];switch(m.pathname){case`/sign-up-${w0("sign-up")}`:{let $=Buffer.concat(o).toString(),w=JSON.parse($),J=nS.safeParse(w);if(!J.success){mn.warn("signup parsed",J.error.issues);return}let{username:S,password:X,email:R}=J.data;if(mn.info(`\uD83D\uDD11 attempting to sign up: ${S}`),await Pc.drizzle.query.users.findFirst({columns:{id:!0},where:Yo(So.email,R)}))throw[400,"User already exists"];let M=crypto.randomUUID(),Y=pS("sha256").update(X+M).digest("hex");await Pc.drizzle.insert(So).values({username:S,email:R,hash:Y,salt:M,createdIp:p}),mn.info(`\uD83D\uDD11 user created: ${S}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end(xf[201])}break;case`/login-${w0("login")}`:{let $=!1,w=null;try{let J=new Date(+x-600000);mn.info("\uD83D\uDD11 ten minutes ago",{tenMinutesAgo:J,now:x});let S=await Pc.drizzle.query.loginHistory.findMany({columns:{userId:!0,successful:!0},where:Oc(Yo(ep.ipAddress,p),Yo(ep.successful,!1),tm(ep.loginTime,J)),limit:10});mn.info(`\uD83D\uDD11 ${S.length}/10 recent failed logins from ${p}`);let X=10-S.length;if(X<1)throw mn.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await Pc.drizzle.insert(pf).values({ip:p,reason:"Too many recent login attempts.",banishedAt:x,banishedUntil:new Date(+x+86400000)}),[429,"Too many recent login attempts."];let R=Buffer.concat(o).toString(),K=JSON.parse(R),M=eR.safeParse(K);if(!M.success)throw mn.warn("login parsed",M.error.issues),[400,`${X} attempts remaining.`];let{username:Y,password:I}=M.data,G=await Pc.drizzle.query.users.findFirst({columns:{id:!0,hash:!0,salt:!0},where:Yo(So.username,Y)});if(mn.info("\uD83D\uDD11 login attempt as user",Y),!G)throw mn.info(`\uD83D\uDD11 user ${Y} does not exist`),[400,`${X} attempts remaining.`];let{hash:z,salt:E}=G;if(w=G.id,pS("sha256").update(I+E).digest("hex")===z){let b=crypto.randomUUID(),y=Na.get(Y);if(!y)y=new Map,Na.set(Y,y);y.set(b,Number(x)),$=!0,mn.info("\uD83D\uDD11 login successful as",Y),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end(`${Y} ${b}`)}}finally{await Pc.drizzle.insert(ep).values({userId:w,successful:$,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),mn.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}break;default:throw[404,"Not found"]}break;case void 0:throw[400,"No Method"];default:throw[405,"Method not allowed"]}}catch(p){let x=iS.safeParse(p);if(x.success){let[m,a]=x.data,v=`${xf[m]}. ${a}`;mn.info(`\u274C ${m}: ${v}`),i.writeHead(m,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end(v)}else mn.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),A0=aS.listen(sn.BACKEND_PORT).address(),nY=typeof A0==="string"?null:A0===null?null:A0.port;if(nY===null)throw new Error("Could not determine port for test server");new e6(aS,{cors:{origin:sn.FRONTEND_ORIGINS,methods:["GET","POST"]}}).use((n,i)=>{let{username:o,sessionKey:c}=n.handshake.auth;if(!(o&&c)){i(new Error("No auth header provided"));return}let p=`user::${o}`,x=`socket::${n.id}`;if(Na.get(o)?.has(c)){let a=t(g.STORE,Km,x);On(g.STORE,a,n),ko(Gc,(f)=>{f.set(p,x)},g.STORE),On(g.STORE,bf,(f)=>f.add(p)),On(g.STORE,_f,(f)=>f.add(x)),mn.info(`${o} connected on ${n.id}`),i()}else mn.info(`${o} couldn't authenticate`),i(new Error("Authentication error"))}).on("connection",(n)=>{let o=Y1({socket:n,store:g.STORE})(cS);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=ip(Gc,c,g.STORE).userKeyOfSocket,x=Gn(g.STORE,p);if(ko(Gc,(m)=>{m.delete(c)},g.STORE),x)On(g.STORE,bf,(m)=>(m.delete(x),m));On(g.STORE,_f,(m)=>(m.delete(c),m)),mn.info(`${n.id} disconnected`),o()})});async function mf(){mn.info("\uD83E\uDDF9 closing workers");let n=new Promise((i)=>xS.process.once("close",i));xS.emit("timeToStop"),await n,mn.info("\uD83D\uDEEC backend server exiting"),process.exit(0)}process.on("SIGINT",async()=>{mn.info("\u2757 received SIGINT; exiting gracefully"),await mf()});process.on("SIGTERM",async()=>{mn.info("\u2757 received SIGTERM; exiting gracefully"),await mf()});process.on("exit",async()=>{mn.info("\u2757 received exit; exiting gracefully"),await mf()});$c.on("updatesReady",()=>{mn.info('\u2757 backend server received signal "updatesReady"'),$c.emit("readyToUpdate"),mn.info('\u2757 backend server has sent signal "readyToUpdate"; now awaits signal "timeToStop"'),$c.on("timeToStop",async()=>{mn.info('\u2757 backend server received signal "timeToStop"; exiting gracefully'),await mf()})});mn.info(`\uD83D\uDEEB backend server ready on port ${sn.BACKEND_PORT}`);$c.emit("alive");export{my as tribunalDaily};