tempest.games 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/app/assets/index-DG_Xy5jv.js +62 -0
- package/app/index.html +1 -1
- package/bin/backend.bun.js +27 -27
- package/bin/backend.worker.game.bun.js +11 -11
- package/bin/backend.worker.tribunal.bun.js +49 -49
- package/bin/frontend.bun.js +17 -17
- package/bin/setup-db.bun.js +50 -50
- package/package.json +14 -14
- package/app/assets/index-Bi0ww1qK.js +0 -62
package/bin/backend.bun.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var Z6=Object.create;var{getPrototypeOf:q6,defineProperty:$a,getOwnPropertyNames:P6}=Object;var s6=Object.prototype.hasOwnProperty;var va=(n,i,o)=>{o=n!=null?Z6(q6(n)):{};let c=i||!n||!n.__esModule?$a(o,"default",{value:n,enumerable:!0}):o;for(let p of P6(n))if(!s6.call(c,p))$a(c,p,{get:()=>n[p],enumerable:!0});return c};var u=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var r6=(n,i)=>{for(var o in i)$a(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var Kn=import.meta.require;var nJ=u((eA)=>{Object.defineProperty(eA,"__esModule",{value:!0});class ic extends Error{}class rv extends ic{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class tv extends ic{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class gv extends ic{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class Mc extends ic{}class sa extends ic{constructor(n){super(`Invalid unit ${n}`)}}class Ji extends ic{}class Bo extends ic{constructor(){super("Zone is an abstract class")}}var b="numeric",ao="short",Di="long",Em={year:b,month:b,day:b},dv={year:b,month:ao,day:b},mW={year:b,month:ao,day:b,weekday:ao},ev={year:b,month:Di,day:b},nA={year:b,month:Di,day:b,weekday:Di},iA={hour:b,minute:b},oA={hour:b,minute:b,second:b},cA={hour:b,minute:b,second:b,timeZoneName:ao},pA={hour:b,minute:b,second:b,timeZoneName:Di},xA={hour:b,minute:b,hourCycle:"h23"},mA={hour:b,minute:b,second:b,hourCycle:"h23"},fA={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:ao},aA={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:Di},$A={year:b,month:b,day:b,hour:b,minute:b},vA={year:b,month:b,day:b,hour:b,minute:b,second:b},AA={year:b,month:ao,day:b,hour:b,minute:b},JA={year:b,month:ao,day:b,hour:b,minute:b,second:b},fW={year:b,month:ao,day:b,weekday:ao,hour:b,minute:b},wA={year:b,month:Di,day:b,hour:b,minute:b,timeZoneName:ao},TA={year:b,month:Di,day:b,hour:b,minute:b,second:b,timeZoneName:ao},FA={year:b,month:Di,day:b,weekday:Di,hour:b,minute:b,timeZoneName:Di},RA={year:b,month:Di,day:b,weekday:Di,hour:b,minute:b,second:b,timeZoneName:Di};class Hc{get type(){throw new Bo}get name(){throw new Bo}get ianaName(){return this.name}get isUniversal(){throw new Bo}offsetName(n,i){throw new Bo}formatOffset(n,i){throw new Bo}offset(n){throw new Bo}equals(n){throw new Bo}get isValid(){throw new Bo}}var ja=null;class Wx extends Hc{static get instance(){if(ja===null)ja=new Wx;return ja}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return OA(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 lm={};function aW(n){if(!lm[n])lm[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 lm[n]}var $W={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function vW(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,x,m,f,a,$,v]=c;return[m,p,x,f,a,$,v]}function AW(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:x,value:m}=o[p],f=$W[x];if(x==="era")c[f]=m;else if(!nn(f))c[f]=parseInt(m,10)}return c}var Km={};class Yo extends Hc{static create(n){if(!Km[n])Km[n]=new Yo(n);return Km[n]}static resetCache(){Km={},lm={}}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=Yo.isValidZone(n)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return OA(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=aW(this.name),[c,p,x,m,f,a,$]=o.formatToParts?AW(o,i):vW(o,i);if(m==="BC")c=-Math.abs(c)+1;let A=jm({year:c,month:p,day:x,hour:f===24?0:f,minute:a,second:$,millisecond:0}),J=+i,S=J%1000;return J-=S>=0?S:1000+S,(A-J)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var Xv={};function JW(n,i={}){let o=JSON.stringify([n,i]),c=Xv[o];if(!c)c=new Intl.ListFormat(n,i),Xv[o]=c;return c}var Ia={};function ya(n,i={}){let o=JSON.stringify([n,i]),c=Ia[o];if(!c)c=new Intl.DateTimeFormat(n,i),Ia[o]=c;return c}var ka={};function wW(n,i={}){let o=JSON.stringify([n,i]),c=ka[o];if(!c)c=new Intl.NumberFormat(n,i),ka[o]=c;return c}var Za={};function TW(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),x=Za[p];if(!x)x=new Intl.RelativeTimeFormat(n,i),Za[p]=x;return x}var Tx=null;function FW(){if(Tx)return Tx;else return Tx=new Intl.DateTimeFormat().resolvedOptions().locale,Tx}var Kv={};function RW(n){let i=Kv[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,Kv[n]=i}return i}function SW(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=ya(n).resolvedOptions(),p=n}catch(f){let a=n.substring(0,o);c=ya(a).resolvedOptions(),p=a}let{numberingSystem:x,calendar:m}=c;return[p,x,m]}}function WW(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 XW(n){let i=[];for(let o=1;o<=12;o++){let c=e.utc(2009,o,1);i.push(n(c))}return i}function KW(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 GW(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 SA{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=wW(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):n0(n,3);return tn(i,this.padTo)}}}class WA{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&&Yo.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=ya(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 XA{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&HA())this.rtf=TW(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return yW(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var YW={firstDay:1,minimalDays:4,weekend:[6,7]};class Yn{static fromOpts(n){return Yn.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let x=n||Nn.defaultLocale,m=x||(p?"en-US":FW()),f=i||Nn.defaultNumberingSystem,a=o||Nn.defaultOutputCalendar,$=qa(c)||Nn.defaultWeekSettings;return new Yn(m,f,a,$,x)}static resetCache(){Tx=null,Ia={},ka={},Za={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return Yn.create(n,i,o,c)}constructor(n,i,o,c,p){let[x,m,f]=SW(n);this.locale=x,this.numberingSystem=i||m||null,this.outputCalendar=o||f||null,this.weekSettings=c,this.intl=WW(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=GW(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 Yn.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,qa(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,VA,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=XW((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Gm(this,n,jA,()=>{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]=KW((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Gm(this,void 0,()=>bA,()=>{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,LA,()=>{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 SA(this.intl,n.forceSimple||this.fastNumbers,n)}dtFormatter(n,i={}){return new WA(n,this.intl,i)}relFormatter(n={}){return new XA(this.intl,this.isEnglish(),n)}listFormatter(n={}){return JW(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(!QA())return YW;else return RW(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 ba=null;class Gi extends Hc{static get utcInstance(){if(ba===null)ba=new Gi(0);return ba}static instance(n){return n===0?Gi.utcInstance:new Gi(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Gi(bm(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 ra extends Hc{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 eo(n,i){if(nn(n)||n===null)return i;else if(n instanceof Hc)return n;else if(OW(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 Gi.utcInstance;else return Gi.parseSpecifier(o)||Yo.create(n)}else if(nc(n))return Gi.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new ra(n)}var ta={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"},Gv={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]},zW=ta.hanidec.replace(/[\[|\]]/g,"").split("");function MW(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(ta.hanidec)!==-1)i+=zW.indexOf(n[o]);else for(let p in Gv){let[x,m]=Gv[p];if(c>=x&&c<=m)i+=c-x}}return parseInt(i,10)}else return i}var xp={};function lW(){xp={}}function mo({numberingSystem:n},i=""){let o=n||"latn";if(!xp[o])xp[o]={};if(!xp[o][i])xp[o][i]=new RegExp(`${ta[o]}${i}`);return xp[o][i]}var Yv=()=>Date.now(),zv="system",Mv=null,lv=null,Hv=null,Qv=60,Ov,Ev=null;class Nn{static get now(){return Yv}static set now(n){Yv=n}static set defaultZone(n){zv=n}static get defaultZone(){return eo(zv,Wx.instance)}static get defaultLocale(){return Mv}static set defaultLocale(n){Mv=n}static get defaultNumberingSystem(){return lv}static set defaultNumberingSystem(n){lv=n}static get defaultOutputCalendar(){return Hv}static set defaultOutputCalendar(n){Hv=n}static get defaultWeekSettings(){return Ev}static set defaultWeekSettings(n){Ev=qa(n)}static get twoDigitCutoffYear(){return Qv}static set twoDigitCutoffYear(n){Qv=n%100}static get throwOnInvalid(){return Ov}static set throwOnInvalid(n){Ov=n}static resetCaches(){Yn.resetCache(),Yo.resetCache(),e.resetCache(),lW()}}class si{constructor(n,i){this.reason=n,this.explanation=i}toMessage(){if(this.explanation)return`${this.reason}: ${this.explanation}`;else return this.reason}}var KA=[0,31,59,90,120,151,181,212,243,273,304,334],GA=[0,31,60,91,121,152,182,213,244,274,305,335];function ri(n,i){return new si("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function ga(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 YA(n,i,o){return o+(Xx(n)?GA:KA)[i-1]}function zA(n,i){let o=Xx(n)?GA:KA,c=o.findIndex((x)=>x<i),p=i-o[c];return{month:c+1,day:p}}function da(n,i){return(n-i+7)%7+1}function Um(n,i=4,o=1){let{year:c,month:p,day:x}=n,m=YA(c,p,x),f=da(ga(c,p,x),o),a=Math.floor((m-f+14-i)/7),$;if(a<1)$=c-1,a=Sx($,i,o);else if(a>Sx(c,i,o))$=c+1,a=1;else $=c;return{weekYear:$,weekNumber:a,weekday:f,...Lm(n)}}function Uv(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:x}=n,m=da(ga(c,1,i),o),f=fp(c),a=p*7+x-m-7+i,$;if(a<1)$=c-1,a+=fp($);else if(a>f)$=c+1,a-=fp(c);else $=c;let{month:v,day:A}=zA($,a);return{year:$,month:v,day:A,...Lm(n)}}function La(n){let{year:i,month:o,day:c}=n,p=YA(i,o,c);return{year:i,ordinal:p,...Lm(n)}}function Vv(n){let{year:i,ordinal:o}=n,{month:c,day:p}=zA(i,o);return{year:i,month:c,day:p,...Lm(n)}}function _v(n,i){if(!nn(n.localWeekday)||!nn(n.localWeekNumber)||!nn(n.localWeekYear)){if(!nn(n.weekday)||!nn(n.weekNumber)||!nn(n.weekYear))throw new Mc("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 HW(n,i=4,o=1){let c=Bm(n.weekYear),p=ti(n.weekNumber,1,Sx(n.weekYear,i,o)),x=ti(n.weekday,1,7);if(!c)return ri("weekYear",n.weekYear);else if(!p)return ri("week",n.weekNumber);else if(!x)return ri("weekday",n.weekday);else return!1}function QW(n){let i=Bm(n.year),o=ti(n.ordinal,1,fp(n.year));if(!i)return ri("year",n.year);else if(!o)return ri("ordinal",n.ordinal);else return!1}function MA(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 ri("year",n.year);else if(!o)return ri("month",n.month);else if(!c)return ri("day",n.day);else return!1}function lA(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),f=ti(c,0,59),a=ti(p,0,999);if(!x)return ri("hour",i);else if(!m)return ri("minute",o);else if(!f)return ri("second",c);else if(!a)return ri("millisecond",p);else return!1}function nn(n){return typeof n==="undefined"}function nc(n){return typeof n==="number"}function Bm(n){return typeof n==="number"&&n%1===0}function OW(n){return typeof n==="string"}function EW(n){return Object.prototype.toString.call(n)==="[object Date]"}function HA(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function QA(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function UW(n){return Array.isArray(n)?n:[n]}function Bv(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 VW(n,i){return i.reduce((o,c)=>{return o[c]=n[c],o},{})}function $p(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function qa(n){if(n==null)return null;else if(typeof n!=="object")throw new Ji("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 Ji("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 _W(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 go(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 ea(n){if(nn(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function n0(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 fp(n){return Xx(n)?366:365}function Vm(n,i){let o=_W(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 jm(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 jv(n,i,o){return-da(ga(n,1,i),o)+i-1}function Sx(n,i=4,o=1){let c=jv(n,i,o),p=jv(n+1,i,o);return(fp(n)-c+p)/7}function Pa(n){if(n>99)return n;else return n>Nn.twoDigitCutoffYear?1900+n:2000+n}function OA(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},f=new Intl.DateTimeFormat(o,m).formatToParts(p).find((a)=>a.type.toLowerCase()==="timezonename");return f?f.value:null}function bm(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 EA(n){let i=Number(n);if(typeof n==="boolean"||n===""||Number.isNaN(i))throw new Ji(`Invalid unit value ${n}`);return i}function _m(n,i){let o={};for(let c in n)if($p(n,c)){let p=n[c];if(p===void 0||p===null)continue;o[i(c)]=EA(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 Lm(n){return VW(n,["hour","minute","second","millisecond"])}var BW=["January","February","March","April","May","June","July","August","September","October","November","December"],UA=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],jW=["J","F","M","A","M","J","J","A","S","O","N","D"];function VA(n){switch(n){case"narrow":return[...jW];case"short":return[...UA];case"long":return[...BW];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 _A=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],BA=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],bW=["M","T","W","T","F","S","S"];function jA(n){switch(n){case"narrow":return[...bW];case"short":return[...BA];case"long":return[..._A];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var bA=["AM","PM"],LW=["Before Christ","Anno Domini"],DW=["BC","AD"],NW=["B","A"];function LA(n){switch(n){case"narrow":return[...NW];case"short":return[...DW];case"long":return[...LW];default:return null}}function CW(n){return bA[n.hour<12?0:1]}function hW(n,i){return jA(i)[n.weekday-1]}function uW(n,i){return VA(i)[n.month-1]}function IW(n,i){return LA(i)[n.year<0?0:1]}function yW(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 A=n==="days";switch(i){case 1:return A?"tomorrow":`next ${p[n][0]}`;case-1:return A?"yesterday":`last ${p[n][0]}`;case 0:return A?"today":`this ${p[n][0]}`}}let m=Object.is(i,-0)||i<0,f=Math.abs(i),a=f===1,$=p[n],v=c?a?$[1]:$[2]||$[1]:a?p[n][0]:n;return m?`${f} ${v} ago`:`in ${f} ${v}`}function bv(n,i){let o="";for(let c of n)if(c.literal)o+=c.val;else o+=i(c.val);return o}var kW={D:Em,DD:dv,DDD:ev,DDDD:nA,t:iA,tt:oA,ttt:cA,tttt:pA,T:xA,TT:mA,TTT:fA,TTTT:aA,f:$A,ff:AA,fff:wA,ffff:FA,F:vA,FF:JA,FFF:TA,FFFF:RA};class Ki{static create(n,i={}){return new Ki(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 kW[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?CW(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),f=(J,S)=>o?uW(n,J):p(S?{month:J}:{month:J,day:"numeric"},"month"),a=(J,S)=>o?hW(n,J):p(S?{weekday:J}:{weekday:J,month:"long",day:"numeric"},"weekday"),$=(J)=>{let S=Ki.macroTokenToFormatOpts(J);if(S)return this.formatWithSystemDefault(n,S);else return J},v=(J)=>o?IW(n,J):p({era:J},"era"),A=(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 a("short",!0);case"cccc":return a("long",!0);case"ccccc":return a("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return a("short",!1);case"EEEE":return a("long",!1);case"EEEEE":return a("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 f("short",!0);case"LLLL":return f("long",!0);case"LLLLL":return f("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 f("short",!1);case"MMMM":return f("long",!1);case"MMMMM":return f("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 v("short");case"GG":return v("long");case"GGGGG":return v("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 $(J)}};return bv(Ki.parseFormat(i),A)}formatDurationFromString(n,i){let o=(f)=>{switch(f[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=(f)=>(a)=>{let $=o(a);if($)return this.num(f.get($),a.length);else return a},p=Ki.parseFormat(i),x=p.reduce((f,{literal:a,val:$})=>a?f:f.concat($),[]),m=n.shiftTo(...x.map(o).filter((f)=>f));return bv(p,c(m))}}var DA=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function vp(...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,f,a]=x(i,p);return[{...o,...m},f||c,a]},[{},null,1]).slice(0,2)}function Jp(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 NA(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=go(i[o+p]);return[c,null,o+p]}}var CA=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ZW=`(?:${CA.source}?(?:\\[(${DA.source})\\])?)?`,i0=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,hA=RegExp(`${i0.source}${ZW}`),o0=RegExp(`(?:T${hA.source})?`),qW=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,PW=/(\d{4})-?W(\d\d)(?:-?(\d))?/,sW=/(\d{4})-?(\d{3})/,rW=NA("weekYear","weekNumber","weekDay"),tW=NA("year","ordinal"),gW=/(\d{4})-(\d\d)-(\d\d)/,uA=RegExp(`${i0.source} ?(?:${CA.source}|(${DA.source}))?`),dW=RegExp(`(?: ${uA.source})?`);function ap(n,i,o){let c=n[i];return nn(c)?o:go(c)}function eW(n,i){return[{year:ap(n,i),month:ap(n,i+1,1),day:ap(n,i+2,1)},null,i+3]}function wp(n,i){return[{hours:ap(n,i,0),minutes:ap(n,i+1,0),seconds:ap(n,i+2,0),milliseconds:ea(n[i+3])},null,i+4]}function Kx(n,i){let o=!n[i]&&!n[i+1],c=bm(n[i+1],n[i+2]),p=o?null:Gi.instance(c);return[{},p,i+3]}function Gx(n,i){let o=n[i]?Yo.create(n[i]):null;return[{},o,i+1]}var n3=RegExp(`^T?${i0.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,f,a,$]=n,v=i[0]==="-",A=a&&a[0]==="-",J=(S,W=!1)=>S!==void 0&&(W||S&&v)?-S:S;return[{years:J(Yc(o)),months:J(Yc(c)),weeks:J(Yc(p)),days:J(Yc(x)),hours:J(Yc(m)),minutes:J(Yc(f)),seconds:J(Yc(a),a==="-0"),milliseconds:J(ea($),A)}]}var c3={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function c0(n,i,o,c,p,x,m){let f={year:i.length===2?Pa(go(i)):go(i),month:UA.indexOf(o)+1,day:go(c),hour:go(p),minute:go(x)};if(m)f.second=go(m);if(n)f.weekday=n.length>3?_A.indexOf(n)+1:BA.indexOf(n)+1;return f}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,f,a,$,v,A]=n,J=c0(i,p,c,o,x,m,f),S;if(a)S=c3[a];else if($)S=0;else S=bm(v,A);return[J,new Gi(S)]}function m3(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var f3=/^(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$/,a3=/^(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$/,$3=/^(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 Lv(n){let[,i,o,c,p,x,m,f]=n;return[c0(i,p,c,o,x,m,f),Gi.utcInstance]}function v3(n){let[,i,o,c,p,x,m,f]=n;return[c0(i,f,o,c,p,x,m),Gi.utcInstance]}var A3=vp(qW,o0),J3=vp(PW,o0),w3=vp(sW,o0),T3=vp(hA),IA=Ap(eW,wp,Kx,Gx),F3=Ap(rW,wp,Kx,Gx),R3=Ap(tW,wp,Kx,Gx),S3=Ap(wp,Kx,Gx);function W3(n){return Jp(n,[A3,IA],[J3,F3],[w3,R3],[T3,S3])}function X3(n){return Jp(m3(n),[p3,x3])}function K3(n){return Jp(n,[f3,Lv],[a3,Lv],[$3,v3])}function G3(n){return Jp(n,[i3,o3])}var Y3=Ap(wp);function z3(n){return Jp(n,[n3,Y3])}var M3=vp(gW,dW),l3=vp(uA),H3=Ap(wp,Kx,Gx);function Q3(n){return Jp(n,[M3,IA],[l3,H3])}var Dv="Invalid Duration",yA={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}},O3={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},...yA},Pi=365.2425,op=30.436875,E3={years:{quarters:4,months:12,weeks:Pi/7,days:Pi,hours:Pi*24,minutes:Pi*24*60,seconds:Pi*24*60*60,milliseconds:Pi*24*60*60*1000},quarters:{months:3,weeks:Pi/28,days:Pi/4,hours:Pi*24/4,minutes:Pi*24*60/4,seconds:Pi*24*60*60/4,milliseconds:Pi*24*60*60*1000/4},months:{weeks:op/7,days:op,hours:op*24,minutes:op*24*60,seconds:op*24*60*60,milliseconds:op*24*60*60*1000},...yA},lc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],U3=lc.slice(0).reverse();function to(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 Tn(c)}function kA(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 Nv(n,i){let o=kA(n,i)<0?-1:1;lc.reduceRight((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]*o,m=n[p][c],f=Math.floor(x/m);i[p]+=f*o,i[c]-=f*m*o}return p}else return c},null),lc.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 Tn{constructor(n){let i=n.conversionAccuracy==="longterm"||!1,o=i?E3:O3;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||Yn.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=n.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(n,i){return Tn.fromObject({milliseconds:n},i)}static fromObject(n,i={}){if(n==null||typeof n!=="object")throw new Ji(`Duration.fromObject: argument expected to be an object, got ${n===null?"null":typeof n}`);return new Tn({values:_m(n,Tn.normalizeUnit),loc:Yn.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(nc(n))return Tn.fromMillis(n);else if(Tn.isDuration(n))return n;else if(typeof n==="object")return Tn.fromObject(n);else throw new Ji(`Unknown duration argument ${n} of type ${typeof n}`)}static fromISO(n,i){let[o]=G3(n);if(o)return Tn.fromObject(o,i);else return Tn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static fromISOTime(n,i){let[o]=z3(n);if(o)return Tn.fromObject(o,i);else return Tn.invalid("unparsable",`the input "${n}" can't be parsed as ISO 8601`)}static invalid(n,i=null){if(!n)throw new Ji("need to specify a reason the Duration is invalid");let o=n instanceof si?n:new si(n,i);if(Nn.throwOnInvalid)throw new gv(o);else return new Tn({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 sa(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?Ki.create(this.loc,o).formatDurationFromString(this,n):Dv}toHuman(n={}){if(!this.isValid)return Dv;let i=lc.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+=n0(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 kA(this.matrix,this.values)}valueOf(){return this.toMillis()}plus(n){if(!this.isValid)return this;let i=Tn.fromDurationLike(n),o={};for(let c of lc)if($p(i.values,c)||$p(this.values,c))o[c]=i.get(c)+this.get(c);return to(this,{values:o},!0)}minus(n){if(!this.isValid)return this;let i=Tn.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]=EA(n(this.values[o],o));return to(this,{values:i},!0)}get(n){return this[Tn.normalizeUnit(n)]}set(n){if(!this.isValid)return this;let i={...this.values,..._m(n,Tn.normalizeUnit)};return to(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 to(this,x)}as(n){return this.isValid?this.shiftTo(n).get(n):NaN}normalize(){if(!this.isValid)return this;let n=this.toObject();return Nv(this.matrix,n),to(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=V3(this.normalize().shiftToAll().toObject());return to(this,{values:n},!0)}shiftTo(...n){if(!this.isValid)return this;if(n.length===0)return this;n=n.map((x)=>Tn.normalizeUnit(x));let i={},o={},c=this.toObject(),p;for(let x of lc)if(n.indexOf(x)>=0){p=x;let m=0;for(let a in o)m+=this.matrix[a][x]*o[a],o[a]=0;if(nc(c[x]))m+=c[x];let f=Math.trunc(m);i[x]=f,o[x]=(m*1000-f*1000)/1000}else if(nc(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 Nv(this.matrix,i),to(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 to(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 lc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var cp="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 Ji("need to specify a reason the Interval is invalid");let o=n instanceof si?n:new si(n,i);if(Nn.throwOnInvalid)throw new tv(o);else return new hn({invalid:o})}static fromDateTimes(n,i){let o=wx(n),c=wx(i),p=_3(o,c);if(p==null)return new hn({start:o,end:c});else return p}static after(n,i){let o=Tn.fromDurationLike(i),c=wx(n);return hn.fromDateTimes(c,c.plus(o))}static before(n,i){let o=Tn.fromDurationLike(i),c=wx(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(a){x=!1}let m,f;try{m=e.fromISO(c,i),f=m.isValid}catch(a){f=!1}if(x&&f)return hn.fromDateTimes(p,m);if(x){let a=Tn.fromISO(c,i);if(a.isValid)return hn.after(p,a)}else if(f){let a=Tn.fromISO(o,i);if(a.isValid)return hn.before(m,a)}}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(wx).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=Tn.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((f)=>f*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((f)=>[{time:f.s,type:"s"},{time:f.e,type:"e"}]),x=Array.prototype.concat(...p),m=x.sort((f,a)=>f.time-a.time);for(let f of m)if(o+=f.type==="s"?1:-1,o===1)i=f.time;else{if(i&&+i!==+f.time)c.push(hn.fromDateTimes(i,f.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 cp;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=Em,i={}){return this.isValid?Ki.create(this.s.loc.clone(i),n).formatInterval(this):cp}toISO(n){if(!this.isValid)return cp;return`${this.s.toISO(n)}/${this.e.toISO(n)}`}toISODate(){if(!this.isValid)return cp;return`${this.s.toISODate()}/${this.e.toISODate()}`}toISOTime(n){if(!this.isValid)return cp;return`${this.s.toISOTime(n)}/${this.e.toISOTime(n)}`}toFormat(n,{separator:i=" \u2013 "}={}){if(!this.isValid)return cp;return`${this.s.toFormat(n)}${i}${this.e.toFormat(n)}`}toDuration(n,i){if(!this.isValid)return Tn.invalid(this.invalidReason);return this.e.diff(this.s,n,i)}mapEndpoints(n){return hn.fromDateTimes(n(this.s),n(this.e))}}class mp{static hasDST(n=Nn.defaultZone){let i=e.now().setZone(n).set({month:12});return!n.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(n){return Yo.isValidZone(n)}static normalizeZone(n){return eo(n,Nn.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Yn.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Yn.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Yn.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Yn.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return Yn.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return Yn.create(i,null,"gregory").eras(n)}static features(){return{relative:HA(),localeWeek:QA()}}}function Cv(n,i){let o=(p)=>p.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),c=o(i)-o(n);return Math.floor(Tn.fromMillis(c).as("days"))}function B3(n,i,o){let c=[["years",(a,$)=>$.year-a.year],["quarters",(a,$)=>$.quarter-a.quarter+($.year-a.year)*4],["months",(a,$)=>$.month-a.month+($.year-a.year)*12],["weeks",(a,$)=>{let v=Cv(a,$);return(v-v%7)/7}],["days",Cv]],p={},x=n,m,f;for(let[a,$]of c)if(o.indexOf(a)>=0)if(m=a,p[a]=$(n,i),f=x.plus(p),f>i){if(p[a]--,n=x.plus(p),n>i)f=n,p[a]--,n=x.plus(p)}else n=f;return[n,p,f,m]}function j3(n,i,o,c){let[p,x,m,f]=B3(n,i,o),a=i-p,$=o.filter((A)=>["hours","minutes","seconds","milliseconds"].indexOf(A)>=0);if($.length===0){if(m<i)m=p.plus({[f]:1});if(m!==p)x[f]=(x[f]||0)+a/(m-p)}let v=Tn.fromObject(x,c);if($.length>0)return Tn.fromMillis(a,c).shiftTo(...$).plus(v);else return v}var b3="missing Intl.DateTimeFormat.formatToParts support";function Wn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(MW(o))}}var L3=String.fromCharCode(160),ZA=`[ ${L3}]`,qA=new RegExp(ZA,"g");function D3(n){return n.replace(/\./g,"\\.?").replace(qA,ZA)}function hv(n){return n.replace(/\./g,"").replace(qA," ").toLowerCase()}function fo(n,i){if(n===null)return null;else return{regex:RegExp(n.map(D3).join("|")),deser:([o])=>n.findIndex((c)=>hv(o)===hv(c))+i}}function uv(n,i){return{regex:n,deser:([,o,c])=>bm(o,c),groups:i}}function Ym(n){return{regex:n,deser:([i])=>i}}function N3(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function C3(n,i){let o=mo(i),c=mo(i,"{2}"),p=mo(i,"{3}"),x=mo(i,"{4}"),m=mo(i,"{6}"),f=mo(i,"{1,2}"),a=mo(i,"{1,3}"),$=mo(i,"{1,6}"),v=mo(i,"{1,9}"),A=mo(i,"{2,4}"),J=mo(i,"{4,6}"),S=(K)=>({regex:RegExp(N3(K.val)),deser:([z])=>z,literal:!0}),R=((K)=>{if(n.literal)return S(K);switch(K.val){case"G":return fo(i.eras("short"),0);case"GG":return fo(i.eras("long"),0);case"y":return Wn($);case"yy":return Wn(A,Pa);case"yyyy":return Wn(x);case"yyyyy":return Wn(J);case"yyyyyy":return Wn(m);case"M":return Wn(f);case"MM":return Wn(c);case"MMM":return fo(i.months("short",!0),1);case"MMMM":return fo(i.months("long",!0),1);case"L":return Wn(f);case"LL":return Wn(c);case"LLL":return fo(i.months("short",!1),1);case"LLLL":return fo(i.months("long",!1),1);case"d":return Wn(f);case"dd":return Wn(c);case"o":return Wn(a);case"ooo":return Wn(p);case"HH":return Wn(c);case"H":return Wn(f);case"hh":return Wn(c);case"h":return Wn(f);case"mm":return Wn(c);case"m":return Wn(f);case"q":return Wn(f);case"qq":return Wn(c);case"s":return Wn(f);case"ss":return Wn(c);case"S":return Wn(a);case"SSS":return Wn(p);case"u":return Ym(v);case"uu":return Ym(f);case"uuu":return Wn(o);case"a":return fo(i.meridiems(),0);case"kkkk":return Wn(x);case"kk":return Wn(A,Pa);case"W":return Wn(f);case"WW":return Wn(c);case"E":case"c":return Wn(o);case"EEE":return fo(i.weekdays("short",!1),1);case"EEEE":return fo(i.weekdays("long",!1),1);case"ccc":return fo(i.weekdays("short",!0),1);case"cccc":return fo(i.weekdays("long",!0),1);case"Z":case"ZZ":return uv(new RegExp(`([+-]${f.source})(?::(${c.source}))?`),2);case"ZZZ":return uv(new RegExp(`([+-]${f.source})(${c.source})?`),2);case"z":return Ym(/[a-z_+-/]{1,256}?/i);case" ":return Ym(/[^\S\n\r]/);default:return S(K)}})(n)||{invalidReason:b3};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 u3(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let a=/^\s+$/.test(p);return{literal:!a,val:a?" ":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 f=h3[m];if(typeof f==="object")f=f[x];if(f)return{literal:!1,val:f};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($p(o,m)){let f=o[m],a=f.groups?f.groups+1:1;if(!f.literal&&f.token)p[f.token.val[0]]=f.deser(c.slice(x,x+a));x+=a}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=Yo.create(n.z);if(!nn(n.Z)){if(!o)o=new Gi(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=ea(n.u);return[Object.keys(n).reduce((x,m)=>{let f=i(m);if(f)x[f]=n[m];return x},{}),o,c]}var Da=null;function Z3(){if(!Da)Da=e.fromMillis(1555555555555);return Da}function q3(n,i){if(n.literal)return n;let o=Ki.macroTokenToFormatOpts(n.val),c=rA(o,i);if(c==null||c.includes(void 0))return n;return c}function PA(n,i){return Array.prototype.concat(...n.map((o)=>q3(o,i)))}class p0{constructor(n,i){if(this.locale=n,this.format=i,this.tokens=PA(Ki.parseFormat(i),n),this.units=this.tokens.map((o)=>C3(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($p(o,"a")&&$p(o,"H"))throw new Mc("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 sA(n,i,o){return new p0(n,o).explainFromTokens(i)}function P3(n,i,o){let{result:c,zone:p,specificOffset:x,invalidReason:m}=sA(n,i,o);return[c,p,x,m]}function rA(n,i){if(!n)return null;let c=Ki.create(i,n).dtFormatter(Z3()),p=c.formatToParts(),x=c.resolvedOptions();return p.map((m)=>u3(m,n,x))}var Na="Invalid DateTime",Iv=8640000000000000;function Fx(n){return new si("unsupported zone",`the zone "${n.name}" is not supported`)}function Ca(n){if(n.weekData===null)n.weekData=Um(n.c);return n.weekData}function ha(n){if(n.localWeekData===null)n.localWeekData=Um(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek());return n.localWeekData}function zc(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 tA(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 zm(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 Hm(n,i,o){return tA(jm(n),i,o)}function yv(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=Tn.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"),f=jm(x),[a,$]=tA(f,o,n.zone);if(m!==0)a+=m,$=n.zone.offset(a);return{ts:a,o:$}}function pp(n,i,o,c,p,x){let{setZone:m,zone:f}=o;if(n&&Object.keys(n).length!==0||i){let a=i||f,$=e.fromObject(n,{...o,zone:a,specificOffset:x});return m?$:$.setZone(f)}else return e.invalid(new si("unparsable",`the input "${p}" can't be parsed as ${c}`))}function Mm(n,i,o=!0){return n.isValid?Ki.create(Yn.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function ua(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 kv(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 gA={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},s3={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},r3={ordinal:1,hour:0,minute:0,second:0,millisecond:0},dA=["year","month","day","hour","minute","second","millisecond"],t3=["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 sa(n);return i}function Zv(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(!Om[n]){if(Qm===void 0)Qm=Nn.now();Om[n]=n.offset(Qm)}return Om[n]}function qv(n,i){let o=eo(i.zone,Nn.defaultZone);if(!o.isValid)return e.invalid(Fx(o));let c=Yn.fromObject(i),p,x;if(!nn(n.year)){for(let a of dA)if(nn(n[a]))n[a]=gA[a];let m=MA(n)||lA(n);if(m)return e.invalid(m);let f=e3(o);[p,x]=Hm(n,f,o)}else p=Nn.now();return new e({ts:p,zone:o,loc:c,o:x})}function Pv(n,i,o){let c=nn(o.round)?!0:o.round,p=(m,f)=>{return m=n0(m,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(m,f)},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 f=x(m);if(Math.abs(f)>=1)return p(f,m)}return p(n>i?-0:0,o.units[o.units.length-1])}function sv(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,Om={};class e{constructor(n){let i=n.zone||Nn.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new si("invalid input"):null)||(!i.isValid?Fx(i):null);this.ts=nn(n.ts)?Nn.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=nc(n.o)&&!n.old?n.o:i.offset(this.ts);c=zm(this.ts,m),o=Number.isNaN(c.year)?new si("invalid input"):null,c=o?null:c,p=o?null:m}this._zone=i,this.loc=n.loc||Yn.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]=sv(arguments),[o,c,p,x,m,f,a]=i;return qv({year:o,month:c,day:p,hour:x,minute:m,second:f,millisecond:a},n)}static utc(){let[n,i]=sv(arguments),[o,c,p,x,m,f,a]=i;return n.zone=Gi.utcInstance,qv({year:o,month:c,day:p,hour:x,minute:m,second:f,millisecond:a},n)}static fromJSDate(n,i={}){let o=EW(n)?n.valueOf():NaN;if(Number.isNaN(o))return e.invalid("invalid input");let c=eo(i.zone,Nn.defaultZone);if(!c.isValid)return e.invalid(Fx(c));return new e({ts:o,zone:c,loc:Yn.fromObject(i)})}static fromMillis(n,i={}){if(!nc(n))throw new Ji(`fromMillis requires a numerical input, but received a ${typeof n} with value ${n}`);else if(n<-Iv||n>Iv)return e.invalid("Timestamp out of range");else return new e({ts:n,zone:eo(i.zone,Nn.defaultZone),loc:Yn.fromObject(i)})}static fromSeconds(n,i={}){if(!nc(n))throw new Ji("fromSeconds requires a numerical input");else return new e({ts:n*1000,zone:eo(i.zone,Nn.defaultZone),loc:Yn.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=eo(i.zone,Nn.defaultZone);if(!o.isValid)return e.invalid(Fx(o));let c=Yn.fromObject(i),p=_m(n,Zv),{minDaysInFirstWeek:x,startOfWeek:m}=_v(p,c),f=Nn.now(),a=!nn(i.specificOffset)?i.specificOffset:o.offset(f),$=!nn(p.ordinal),v=!nn(p.year),A=!nn(p.month)||!nn(p.day),J=v||A,S=p.weekYear||p.weekNumber;if((J||$)&&S)throw new Mc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(A&&$)throw new Mc("Can't mix ordinal dates with month/day");let W=S||p.weekday&&!J,R,K,z=zm(f,a);if(W)R=t3,K=s3,z=Um(z,x,m);else if($)R=g3,K=r3,z=La(z);else R=dA,K=gA;let M=!1;for(let y of R){let l=p[y];if(!nn(l))M=!0;else if(M)p[y]=K[y];else p[y]=z[y]}let h=W?HW(p,x,m):$?QW(p):MA(p),G=h||lA(p);if(G)return e.invalid(G);let H=W?Uv(p,x,m):$?Vv(p):p,[O,Q]=Hm(H,a,o),j=new e({ts:O,zone:o,o:Q,loc:c});if(p.weekday&&J&&n.weekday!==j.weekday)return e.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${j.toISO()}`);if(!j.isValid)return e.invalid(j.invalid);return j}static fromISO(n,i={}){let[o,c]=W3(n);return pp(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=X3(n);return pp(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=K3(n);return pp(o,c,i,"HTTP",i)}static fromFormat(n,i,o={}){if(nn(n)||nn(i))throw new Ji("fromFormat requires an input string and a format");let{locale:c=null,numberingSystem:p=null}=o,x=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[m,f,a,$]=P3(x,n,i);if($)return e.invalid($);else return pp(m,f,o,`format ${i}`,n,a)}static fromString(n,i,o={}){return e.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=Q3(n);return pp(o,c,i,"SQL",n)}static invalid(n,i=null){if(!n)throw new Ji("need to specify a reason the DateTime is invalid");let o=n instanceof si?n:new si(n,i);if(Nn.throwOnInvalid)throw new rv(o);else return new e({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=rA(n,Yn.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return PA(Ki.parseFormat(n),Yn.fromObject(i)).map((c)=>c.val).join("")}static resetCache(){Qm=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?Ca(this).weekYear:NaN}get weekNumber(){return this.isValid?Ca(this).weekNumber:NaN}get weekday(){return this.isValid?Ca(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ha(this).weekday:NaN}get localWeekNumber(){return this.isValid?ha(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ha(this).weekYear:NaN}get ordinal(){return this.isValid?La(this.c).ordinal:NaN}get monthShort(){return this.isValid?mp.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?mp.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?mp.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?mp.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=jm(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 f=o-x*i,a=o-m*i,$=zm(f,x),v=zm(a,m);if($.hour===v.hour&&$.minute===v.minute&&$.second===v.second&&$.millisecond===v.millisecond)return[zc(this,{ts:f}),zc(this,{ts:a})];return[this]}get isInLeapYear(){return Xx(this.year)}get daysInMonth(){return Vm(this.year,this.month)}get daysInYear(){return this.isValid?fp(this.year):NaN}get weeksInWeekYear(){return this.isValid?Sx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Sx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(n={}){let{locale:i,numberingSystem:o,calendar:c}=Ki.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Gi.instance(n),i)}toLocal(){return this.setZone(Nn.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=eo(n,Nn.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]=Hm(x,p,n)}return zc(this,{ts:c,zone:n})}}reconfigure({locale:n,numberingSystem:i,outputCalendar:o}={}){let c=this.loc.clone({locale:n,numberingSystem:i,outputCalendar:o});return zc(this,{loc:c})}setLocale(n){return this.reconfigure({locale:n})}set(n){if(!this.isValid)return this;let i=_m(n,Zv),{minDaysInFirstWeek:o,startOfWeek:c}=_v(i,this.loc),p=!nn(i.weekYear)||!nn(i.weekNumber)||!nn(i.weekday),x=!nn(i.ordinal),m=!nn(i.year),f=!nn(i.month)||!nn(i.day),a=m||f,$=i.weekYear||i.weekNumber;if((a||x)&&$)throw new Mc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&x)throw new Mc("Can't mix ordinal dates with month/day");let v;if(p)v=Uv({...Um(this.c,o,c),...i},o,c);else if(!nn(i.ordinal))v=Vv({...La(this.c),...i});else if(v={...this.toObject(),...i},nn(i.day))v.day=Math.min(Vm(v.year,v.month),v.day);let[A,J]=Hm(v,this.o,this.zone);return zc(this,{ts:A,o:J})}plus(n){if(!this.isValid)return this;let i=Tn.fromDurationLike(n);return zc(this,yv(this,i))}minus(n){if(!this.isValid)return this;let i=Tn.fromDurationLike(n).negate();return zc(this,yv(this,i))}startOf(n,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;let o={},c=Tn.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?Ki.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):Na}toLocaleString(n=Em,i={}){return this.isValid?Ki.create(this.loc.clone(i),n).formatDateTime(this):Na}toLocaleParts(n={}){return this.isValid?Ki.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=ua(this,x);return m+="T",m+=kv(this,x,i,o,c,p),m}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return ua(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":"")+kv(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 ua(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():Na}[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 Tn.invalid("created by diffing an invalid DateTime");let c={locale:this.locale,numberingSystem:this.numberingSystem,...o},p=UW(i).map(Tn.normalizeUnit),x=n.valueOf()>this.valueOf(),m=x?this:n,f=x?n:this,a=j3(m,f,p,c);return x?a.negate():a}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 Pv(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return Pv(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 Ji("min requires all arguments be DateTimes");return Bv(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(e.isDateTime))throw new Ji("max requires all arguments be DateTimes");return Bv(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,x=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return sA(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=Yn.fromOpts({locale:o,numberingSystem:c,defaultToEN:!0});return new p0(p,n)}static fromFormatParser(n,i,o={}){if(nn(n)||nn(i))throw new Ji("fromFormatParser requires an input string and a format parser");let{locale:c=null,numberingSystem:p=null}=o,x=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});if(!x.equals(i.locale))throw new Ji(`fromFormatParser called with a locale of ${x}, but the format parser was created for ${i.locale}`);let{result:m,zone:f,specificOffset:a,invalidReason:$}=i.explainFromTokens(n);if($)return e.invalid($);else return pp(m,f,o,`format ${i.format}`,n,a)}static get DATE_SHORT(){return Em}static get DATE_MED(){return dv}static get DATE_MED_WITH_WEEKDAY(){return mW}static get DATE_FULL(){return ev}static get DATE_HUGE(){return nA}static get TIME_SIMPLE(){return iA}static get TIME_WITH_SECONDS(){return oA}static get TIME_WITH_SHORT_OFFSET(){return cA}static get TIME_WITH_LONG_OFFSET(){return pA}static get TIME_24_SIMPLE(){return xA}static get TIME_24_WITH_SECONDS(){return mA}static get TIME_24_WITH_SHORT_OFFSET(){return fA}static get TIME_24_WITH_LONG_OFFSET(){return aA}static get DATETIME_SHORT(){return $A}static get DATETIME_SHORT_WITH_SECONDS(){return vA}static get DATETIME_MED(){return AA}static get DATETIME_MED_WITH_SECONDS(){return JA}static get DATETIME_MED_WITH_WEEKDAY(){return fW}static get DATETIME_FULL(){return wA}static get DATETIME_FULL_WITH_SECONDS(){return TA}static get DATETIME_HUGE(){return FA}static get DATETIME_HUGE_WITH_SECONDS(){return RA}}function wx(n){if(e.isDateTime(n))return n;else if(n&&n.valueOf&&nc(n.valueOf()))return e.fromJSDate(n);else if(n&&typeof n==="object")return e.fromObject(n);else throw new Ji(`Unknown datetime argument: ${n}, of type ${typeof n}`)}var n7="3.5.0";eA.DateTime=e;eA.Duration=Tn;eA.FixedOffsetZone=Gi;eA.IANAZone=Yo;eA.Info=mp;eA.Interval=hn;eA.InvalidZone=ra;eA.Settings=Nn;eA.SystemZone=Wx;eA.VERSION=n7;eA.Zone=Hc});var xJ=u((iJ)=>{Object.defineProperty(iJ,"__esModule",{value:!0});iJ.RE_RANGE=iJ.RE_WILDCARDS=iJ.PRESETS=iJ.TIME_UNITS_LEN=iJ.TIME_UNITS=iJ.TIME_UNITS_MAP=iJ.ALIASES=iJ.PARSE_DEFAULTS=iJ.CONSTRAINTS=void 0;iJ.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});iJ.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});iJ.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});iJ.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});iJ.TIME_UNITS=Object.freeze(Object.values(iJ.TIME_UNITS_MAP));iJ.TIME_UNITS_LEN=iJ.TIME_UNITS.length;iJ.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"});iJ.RE_WILDCARDS=/\*/g;iJ.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var m0=u((fJ)=>{Object.defineProperty(fJ,"__esModule",{value:!0});fJ.ExclusiveParametersError=fJ.CronError=void 0;class x0 extends Error{}fJ.CronError=x0;class mJ extends x0{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}fJ.ExclusiveParametersError=mJ});var Dm=u((vJ)=>{Object.defineProperty(vJ,"__esModule",{value:!0});vJ.CronTime=void 0;var zo=nJ(),Yi=xJ(),zi=m0();class $J{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 zi.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!zo.DateTime.fromObject({},{zone:i}).isValid)throw new zi.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(n instanceof Date||n instanceof zo.DateTime)this.source=n instanceof Date?zo.DateTime.fromJSDate(n):n,this.realDate=!0;else this.source=n,this._parse(this.source)}_getWeekDay(n){return n.weekday===7?0:n.weekday}sendAt(n){let i=this.realDate&&this.source instanceof zo.DateTime?this.source:zo.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"),f=`UTC${o}${p}:${m}`;if(i=i.setZone(f),!i.isValid)throw new zi.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(zo.DateTime.local()>i)throw new zi.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()-zo.DateTime.local().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return Yi.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o;if(n instanceof Date)n=zo.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 zi.CronError("ERROR: You specified an invalid date.");let x=zo.DateTime.now().plus({years:8});while(!0){let m=c.toMillis()-n.toMillis();if(c>x)throw new zi.CronError(`Something went wrong. No execution date was found in the next 8 years.
|
|
3
|
+
var P3=Object.create;var{getPrototypeOf:s3,defineProperty:va,getOwnPropertyNames:r3}=Object;var t3=Object.prototype.hasOwnProperty;var $a=(n,i,o)=>{o=n!=null?P3(s3(n)):{};let c=i||!n||!n.__esModule?va(o,"default",{value:n,enumerable:!0}):o;for(let p of r3(n))if(!t3.call(c,p))va(c,p,{get:()=>n[p],enumerable:!0});return c};var h=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports);var g3=(n,i)=>{for(var o in i)va(n,o,{get:i[o],enumerable:!0,configurable:!0,set:(c)=>i[o]=()=>c})};var Sn=import.meta.require;var pJ=h((cJ)=>{Object.defineProperty(cJ,"__esModule",{value:!0});class to extends Error{}class e1 extends to{constructor(n){super(`Invalid DateTime: ${n.toMessage()}`)}}class nw extends to{constructor(n){super(`Invalid Interval: ${n.toMessage()}`)}}class iw extends to{constructor(n){super(`Invalid Duration: ${n.toMessage()}`)}}class zc extends to{}class qa extends to{constructor(n){super(`Invalid unit ${n}`)}}class wi extends to{}class Vo extends to{constructor(){super("Zone is an abstract class")}}var b="numeric",mo="short",Li="long",Om={year:b,month:b,day:b},ow={year:b,month:mo,day:b},x7={year:b,month:mo,day:b,weekday:mo},cw={year:b,month:Li,day:b},pw={year:b,month:Li,day:b,weekday:Li},xw={hour:b,minute:b},mw={hour:b,minute:b,second:b},fw={hour:b,minute:b,second:b,timeZoneName:mo},aw={hour:b,minute:b,second:b,timeZoneName:Li},vw={hour:b,minute:b,hourCycle:"h23"},$w={hour:b,minute:b,second:b,hourCycle:"h23"},ww={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:mo},Jw={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:Li},Aw={year:b,month:b,day:b,hour:b,minute:b},Tw={year:b,month:b,day:b,hour:b,minute:b,second:b},Fw={year:b,month:mo,day:b,hour:b,minute:b},Rw={year:b,month:mo,day:b,hour:b,minute:b,second:b},m7={year:b,month:mo,day:b,weekday:mo,hour:b,minute:b},Xw={year:b,month:Li,day:b,hour:b,minute:b,timeZoneName:mo},Ww={year:b,month:Li,day:b,hour:b,minute:b,second:b,timeZoneName:mo},Kw={year:b,month:Li,day:b,weekday:Li,hour:b,minute:b,timeZoneName:Li},Sw={year:b,month:Li,day:b,weekday:Li,hour:b,minute:b,second:b,timeZoneName:Li};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 _a=null;class Wx extends Qc{static get instance(){if(_a===null)_a=new Wx;return _a}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(n,{format:i,locale:o}){return _w(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 zm={};function f7(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 a7={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function v7(n,i){let o=n.format(i).replace(/\u200E/g,""),c=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(o),[,p,x,m,f,a,v,$]=c;return[m,p,x,f,a,v,$]}function $7(n,i){let o=n.formatToParts(i),c=[];for(let p=0;p<o.length;p++){let{type:x,value:m}=o[p],f=a7[x];if(x==="era")c[f]=m;else if(!nn(f))c[f]=parseInt(m,10)}return c}var Sm={};class Go extends Qc{static create(n){if(!Sm[n])Sm[n]=new Go(n);return Sm[n]}static resetCache(){Sm={},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 _w(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=f7(this.name),[c,p,x,m,f,a,v]=o.formatToParts?$7(o,i):v7(o,i);if(m==="BC")c=-Math.abs(c)+1;let w=jm({year:c,month:p,day:x,hour:f===24?0:f,minute:a,second:v,millisecond:0}),J=+i,X=J%1000;return J-=X>=0?X:1000+X,(w-J)/60000}equals(n){return n.type==="iana"&&n.name===this.name}get isValid(){return this.valid}}var H1={};function w7(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 ha={};function ua(n,i={}){let o=JSON.stringify([n,i]),c=ha[o];if(!c)c=new Intl.DateTimeFormat(n,i),ha[o]=c;return c}var Ia={};function J7(n,i={}){let o=JSON.stringify([n,i]),c=Ia[o];if(!c)c=new Intl.NumberFormat(n,i),Ia[o]=c;return c}var ya={};function A7(n,i={}){let{base:o,...c}=i,p=JSON.stringify([n,c]),x=ya[p];if(!x)x=new Intl.RelativeTimeFormat(n,i),ya[p]=x;return x}var Tx=null;function T7(){if(Tx)return Tx;else return Tx=new Intl.DateTimeFormat().resolvedOptions().locale,Tx}var M1={};function F7(n){let i=M1[n];if(!i){let o=new Intl.Locale(n);i="getWeekInfo"in o?o.getWeekInfo():o.weekInfo,M1[n]=i}return i}function R7(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=ua(n).resolvedOptions(),p=n}catch(f){let a=n.substring(0,o);c=ua(a).resolvedOptions(),p=a}let{numberingSystem:x,calendar:m}=c;return[p,x,m]}}function X7(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 W7(n){let i=[];for(let o=1;o<=12;o++){let c=e.utc(2009,o,1);i.push(n(c))}return i}function K7(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 S7(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=J7(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):da(n,3);return rn(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&&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=ua(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 Hw{constructor(n,i,o){if(this.opts={style:"long",...o},!i&&Uw())this.rtf=A7(n,o)}format(n,i){if(this.rtf)return this.rtf.format(n,i);else return I7(i,n,this.opts.numeric,this.opts.style!=="long")}formatToParts(n,i){if(this.rtf)return this.rtf.formatToParts(n,i);else return[]}}var G7={firstDay:1,minimalDays:4,weekend:[6,7]};class Yn{static fromOpts(n){return Yn.create(n.locale,n.numberingSystem,n.outputCalendar,n.weekSettings,n.defaultToEN)}static create(n,i,o,c,p=!1){let x=n||Nn.defaultLocale,m=x||(p?"en-US":T7()),f=i||Nn.defaultNumberingSystem,a=o||Nn.defaultOutputCalendar,v=ka(c)||Nn.defaultWeekSettings;return new Yn(m,f,a,v,x)}static resetCache(){Tx=null,ha={},Ia={},ya={}}static fromObject({locale:n,numberingSystem:i,outputCalendar:o,weekSettings:c}={}){return Yn.create(n,i,o,c)}constructor(n,i,o,c,p){let[x,m,f]=R7(n);this.locale=x,this.numberingSystem=i||m||null,this.outputCalendar=o||f||null,this.weekSettings=c,this.intl=X7(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=S7(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 Yn.create(n.locale||this.specifiedLocale,n.numberingSystem||this.numberingSystem,n.outputCalendar||this.outputCalendar,ka(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,bw,()=>{let o=i?{month:n,day:"numeric"}:{month:n},c=i?"format":"standalone";if(!this.monthsCache[c][n])this.monthsCache[c][n]=W7((p)=>this.extract(p,o,"month"));return this.monthsCache[c][n]})}weekdays(n,i=!1){return Gm(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]=K7((p)=>this.extract(p,o,"weekday"));return this.weekdaysCache[c][n]})}meridiems(){return Gm(this,void 0,()=>Cw,()=>{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,hw,()=>{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 Hw(this.intl,this.isEnglish(),n)}listFormatter(n={}){return w7(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(!Vw())return G7;else return F7(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 Ba=null;class Si extends Qc{static get utcInstance(){if(Ba===null)Ba=new Si(0);return Ba}static instance(n){return n===0?Si.utcInstance:new Si(n)}static parseSpecifier(n){if(n){let i=n.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Si(bm(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 Pa 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 so(n,i){if(nn(n)||n===null)return i;else if(n instanceof Qc)return n;else if(Q7(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 Si.utcInstance;else return Si.parseSpecifier(o)||Go.create(n)}else if(ro(n))return Si.instance(n);else if(typeof n==="object"&&"offset"in n&&typeof n.offset==="function")return n;else return new Pa(n)}var sa={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]},Y7=sa.hanidec.replace(/[\[|\]]/g,"").split("");function H7(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(sa.hanidec)!==-1)i+=Y7.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 fp={};function M7(){fp={}}function po({numberingSystem:n},i=""){let o=n||"latn";if(!fp[o])fp[o]={};if(!fp[o][i])fp[o][i]=new RegExp(`${sa[o]}${i}`);return fp[o][i]}var l1=()=>Date.now(),Q1="system",E1=null,O1=null,U1=null,V1=60,_1,B1=null;class Nn{static get now(){return l1}static set now(n){l1=n}static set defaultZone(n){Q1=n}static get defaultZone(){return so(Q1,Wx.instance)}static get defaultLocale(){return E1}static set defaultLocale(n){E1=n}static get defaultNumberingSystem(){return O1}static set defaultNumberingSystem(n){O1=n}static get defaultOutputCalendar(){return U1}static set defaultOutputCalendar(n){U1=n}static get defaultWeekSettings(){return B1}static set defaultWeekSettings(n){B1=ka(n)}static get twoDigitCutoffYear(){return V1}static set twoDigitCutoffYear(n){V1=n%100}static get throwOnInvalid(){return _1}static set throwOnInvalid(n){_1=n}static resetCaches(){Yn.resetCache(),Go.resetCache(),e.resetCache(),M7()}}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 Mw=[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 si(n,i){return new Pi("unit out of range",`you specified ${i} (of type ${typeof i}) as a ${n}, which is invalid`)}function ra(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 lw(n,i,o){return o+(Kx(n)?zw:Mw)[i-1]}function Qw(n,i){let o=Kx(n)?zw:Mw,c=o.findIndex((x)=>x<i),p=i-o[c];return{month:c+1,day:p}}function ta(n,i){return(n-i+7)%7+1}function Um(n,i=4,o=1){let{year:c,month:p,day:x}=n,m=lw(c,p,x),f=ta(ra(c,p,x),o),a=Math.floor((m-f+14-i)/7),v;if(a<1)v=c-1,a=Xx(v,i,o);else if(a>Xx(c,i,o))v=c+1,a=1;else v=c;return{weekYear:v,weekNumber:a,weekday:f,...Lm(n)}}function j1(n,i=4,o=1){let{weekYear:c,weekNumber:p,weekday:x}=n,m=ta(ra(c,1,i),o),f=vp(c),a=p*7+x-m-7+i,v;if(a<1)v=c-1,a+=vp(v);else if(a>f)v=c+1,a-=vp(c);else v=c;let{month:$,day:w}=Qw(v,a);return{year:v,month:$,day:w,...Lm(n)}}function ja(n){let{year:i,month:o,day:c}=n,p=lw(i,o,c);return{year:i,ordinal:p,...Lm(n)}}function b1(n){let{year:i,ordinal:o}=n,{month:c,day:p}=Qw(i,o);return{year:i,month:c,day:p,...Lm(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 zc("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 z7(n,i=4,o=1){let c=Bm(n.weekYear),p=ri(n.weekNumber,1,Xx(n.weekYear,i,o)),x=ri(n.weekday,1,7);if(!c)return si("weekYear",n.weekYear);else if(!p)return si("week",n.weekNumber);else if(!x)return si("weekday",n.weekday);else return!1}function l7(n){let i=Bm(n.year),o=ri(n.ordinal,1,vp(n.year));if(!i)return si("year",n.year);else if(!o)return si("ordinal",n.ordinal);else return!1}function Ew(n){let i=Bm(n.year),o=ri(n.month,1,12),c=ri(n.day,1,Vm(n.year,n.month));if(!i)return si("year",n.year);else if(!o)return si("month",n.month);else if(!c)return si("day",n.day);else return!1}function Ow(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),f=ri(c,0,59),a=ri(p,0,999);if(!x)return si("hour",i);else if(!m)return si("minute",o);else if(!f)return si("second",c);else if(!a)return si("millisecond",p);else return!1}function nn(n){return typeof n==="undefined"}function ro(n){return typeof n==="number"}function Bm(n){return typeof n==="number"&&n%1===0}function Q7(n){return typeof n==="string"}function E7(n){return Object.prototype.toString.call(n)==="[object Date]"}function Uw(){try{return typeof Intl!=="undefined"&&!!Intl.RelativeTimeFormat}catch(n){return!1}}function Vw(){try{return typeof Intl!=="undefined"&&!!Intl.Locale&&(("weekInfo"in Intl.Locale.prototype)||("getWeekInfo"in Intl.Locale.prototype))}catch(n){return!1}}function O7(n){return Array.isArray(n)?n:[n]}function D1(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 U7(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 ka(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 Bm(n)&&n>=i&&n<=o}function V7(n,i){return n-i*Math.floor(n/i)}function rn(n,i=2){let o=n<0,c;if(o)c="-"+(""+-n).padStart(i,"0");else c=(""+n).padStart(i,"0");return c}function Po(n){if(nn(n)||n===null||n==="")return;else return parseInt(n,10)}function Hc(n){if(nn(n)||n===null||n==="")return;else return parseFloat(n)}function ga(n){if(nn(n)||n===null||n==="")return;else{let i=parseFloat("0."+n)*1000;return Math.floor(i)}}function da(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 Vm(n,i){let o=V7(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 jm(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-ta(ra(n,1,i),o)+i-1}function Xx(n,i=4,o=1){let c=N1(n,i,o),p=N1(n+1,i,o);return(vp(n)-c+p)/7}function Za(n){if(n>99)return n;else return n>Nn.twoDigitCutoffYear?1900+n:2000+n}function _w(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},f=new Intl.DateTimeFormat(o,m).formatToParts(p).find((a)=>a.type.toLowerCase()==="timezonename");return f?f.value:null}function bm(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}${rn(o,2)}:${rn(c,2)}`;case"narrow":return`${p}${o}${c>0?`:${c}`:""}`;case"techie":return`${p}${rn(o,2)}${rn(c,2)}`;default:throw new RangeError(`Value format ${i} is out of range for property format`)}}function Lm(n){return U7(n,["hour","minute","second","millisecond"])}var _7=["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"],B7=["J","F","M","A","M","J","J","A","S","O","N","D"];function bw(n){switch(n){case"narrow":return[...B7];case"short":return[...jw];case"long":return[..._7];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"],Dw=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],j7=["M","T","W","T","F","S","S"];function Nw(n){switch(n){case"narrow":return[...j7];case"short":return[...Dw];case"long":return[...Lw];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Cw=["AM","PM"],b7=["Before Christ","Anno Domini"],L7=["BC","AD"],D7=["B","A"];function hw(n){switch(n){case"narrow":return[...D7];case"short":return[...L7];case"long":return[...b7];default:return null}}function N7(n){return Cw[n.hour<12?0:1]}function C7(n,i){return Nw(i)[n.weekday-1]}function h7(n,i){return bw(i)[n.month-1]}function u7(n,i){return hw(i)[n.year<0?0:1]}function I7(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,f=Math.abs(i),a=f===1,v=p[n],$=c?a?v[1]:v[2]||v[1]:a?p[n][0]:n;return m?`${f} ${$} ago`:`in ${f} ${$}`}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 y7={D:Om,DD:ow,DDD:cw,DDDD:pw,t:xw,tt:mw,ttt:fw,tttt:aw,T:vw,TT:$w,TTT:ww,TTTT:Jw,f:Aw,ff:Fw,fff:Xw,ffff:Kw,F:Tw,FF:Rw,FFF:Ww,FFFF:Sw};class Ki{static create(n,i={}){return new Ki(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 y7[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 rn(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,X)=>this.loc.extract(n,J,X),x=(J)=>{if(n.isOffsetFixed&&n.offset===0&&J.allowZ)return"Z";return n.isValid?n.zone.formatOffset(n.ts,J.format):""},m=()=>o?N7(n):p({hour:"numeric",hourCycle:"h12"},"dayperiod"),f=(J,X)=>o?h7(n,J):p(X?{month:J}:{month:J,day:"numeric"},"month"),a=(J,X)=>o?C7(n,J):p(X?{weekday:J}:{weekday:J,month:"long",day:"numeric"},"weekday"),v=(J)=>{let X=Ki.macroTokenToFormatOpts(J);if(X)return this.formatWithSystemDefault(n,X);else return J},$=(J)=>o?u7(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 a("short",!0);case"cccc":return a("long",!0);case"ccccc":return a("narrow",!0);case"E":return this.num(n.weekday);case"EEE":return a("short",!1);case"EEEE":return a("long",!1);case"EEEEE":return a("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 f("short",!0);case"LLLL":return f("long",!0);case"LLLLL":return f("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 f("short",!1);case"MMMM":return f("long",!1);case"MMMMM":return f("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(Ki.parseFormat(i),w)}formatDurationFromString(n,i){let o=(f)=>{switch(f[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=(f)=>(a)=>{let v=o(a);if(v)return this.num(f.get(v),a.length);else return a},p=Ki.parseFormat(i),x=p.reduce((f,{literal:a,val:v})=>a?f:f.concat(v),[]),m=n.shiftTo(...x.map(o).filter((f)=>f));return C1(p,c(m))}}var uw=/[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,f,a]=x(i,p);return[{...o,...m},f||c,a]},[{},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 Iw(...n){return(i,o)=>{let c={},p;for(p=0;p<n.length;p++)c[n[p]]=Po(i[o+p]);return[c,null,o+p]}}var yw=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,k7=`(?:${yw.source}?(?:\\[(${uw.source})\\])?)?`,ea=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,kw=RegExp(`${ea.source}${k7}`),nv=RegExp(`(?:T${kw.source})?`),Z7=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,q7=/(\d{4})-?W(\d\d)(?:-?(\d))?/,P7=/(\d{4})-?(\d{3})/,s7=Iw("weekYear","weekNumber","weekDay"),r7=Iw("year","ordinal"),t7=/(\d{4})-(\d\d)-(\d\d)/,Zw=RegExp(`${ea.source} ?(?:${yw.source}|(${uw.source}))?`),g7=RegExp(`(?: ${Zw.source})?`);function $p(n,i,o){let c=n[i];return nn(c)?o:Po(c)}function d7(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:ga(n[i+3])},null,i+4]}function Sx(n,i){let o=!n[i]&&!n[i+1],c=bm(n[i+1],n[i+2]),p=o?null:Si.instance(c);return[{},p,i+3]}function Gx(n,i){let o=n[i]?Go.create(n[i]):null;return[{},o,i+1]}var e7=RegExp(`^T?${ea.source}$`),nX=/^-?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 iX(n){let[i,o,c,p,x,m,f,a,v]=n,$=i[0]==="-",w=a&&a[0]==="-",J=(X,W=!1)=>X!==void 0&&(W||X&&$)?-X:X;return[{years:J(Hc(o)),months:J(Hc(c)),weeks:J(Hc(p)),days:J(Hc(x)),hours:J(Hc(m)),minutes:J(Hc(f)),seconds:J(Hc(a),a==="-0"),milliseconds:J(ga(v),w)}]}var oX={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function iv(n,i,o,c,p,x,m){let f={year:i.length===2?Za(Po(i)):Po(i),month:jw.indexOf(o)+1,day:Po(c),hour:Po(p),minute:Po(x)};if(m)f.second=Po(m);if(n)f.weekday=n.length>3?Lw.indexOf(n)+1:Dw.indexOf(n)+1;return f}var cX=/^(?:(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 pX(n){let[,i,o,c,p,x,m,f,a,v,$,w]=n,J=iv(i,p,c,o,x,m,f),X;if(a)X=oX[a];else if(v)X=0;else X=bm($,w);return[J,new Si(X)]}function xX(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var mX=/^(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$/,fX=/^(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$/,aX=/^(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 h1(n){let[,i,o,c,p,x,m,f]=n;return[iv(i,p,c,o,x,m,f),Si.utcInstance]}function vX(n){let[,i,o,c,p,x,m,f]=n;return[iv(i,f,o,c,p,x,m),Si.utcInstance]}var $X=Jp(Z7,nv),wX=Jp(q7,nv),JX=Jp(P7,nv),AX=Jp(kw),qw=Ap(d7,Fp,Sx,Gx),TX=Ap(s7,Fp,Sx,Gx),FX=Ap(r7,Fp,Sx,Gx),RX=Ap(Fp,Sx,Gx);function XX(n){return Tp(n,[$X,qw],[wX,TX],[JX,FX],[AX,RX])}function WX(n){return Tp(xX(n),[cX,pX])}function KX(n){return Tp(n,[mX,h1],[fX,h1],[aX,vX])}function SX(n){return Tp(n,[nX,iX])}var GX=Ap(Fp);function YX(n){return Tp(n,[e7,GX])}var HX=Jp(t7,g7),MX=Jp(Zw),zX=Ap(Fp,Sx,Gx);function lX(n){return Tp(n,[HX,qw],[MX,zX])}var u1="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}},QX={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},qi=365.2425,pp=30.436875,EX={years:{quarters:4,months:12,weeks:qi/7,days:qi,hours:qi*24,minutes:qi*24*60,seconds:qi*24*60*60,milliseconds:qi*24*60*60*1000},quarters:{months:3,weeks:qi/28,days:qi/4,hours:qi*24/4,minutes:qi*24*60/4,seconds:qi*24*60*60/4,milliseconds:qi*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},lc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],OX=lc.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 sw(n,i){var o;let c=(o=i.milliseconds)!=null?o:0;for(let p of OX.slice(1))if(i[p])c+=i[p]*n[p].milliseconds;return c}function I1(n,i){let o=sw(n,i)<0?-1:1;lc.reduceRight((c,p)=>{if(!nn(i[p])){if(c){let x=i[c]*o,m=n[p][c],f=Math.floor(x/m);i[p]+=f*o,i[c]-=f*m*o}return p}else return c},null),lc.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 UX(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?EX:QX;if(n.matrix)o=n.matrix;this.values=n.values,this.loc=n.loc||Yn.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:Yn.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(n){if(ro(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]=SX(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]=YX(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(Nn.throwOnInvalid)throw new iw(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 qa(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?Ki.create(this.loc,o).formatDurationFromString(this,n):u1}toHuman(n={}){if(!this.isValid)return u1;let i=lc.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+=da(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 sw(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 lc)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]=Bw(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,..._m(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 I1(this.matrix,n),qo(this,{values:n},!0)}rescale(){if(!this.isValid)return this;let n=UX(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 lc)if(n.indexOf(x)>=0){p=x;let m=0;for(let a in o)m+=this.matrix[a][x]*o[a],o[a]=0;if(ro(c[x]))m+=c[x];let f=Math.trunc(m);i[x]=f,o[x]=(m*1000-f*1000)/1000}else if(ro(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 I1(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 lc)if(!i(this.values[o],n.values[o]))return!1;return!0}}var xp="Invalid Interval";function VX(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(Nn.throwOnInvalid)throw new nw(o);else return new hn({invalid:o})}static fromDateTimes(n,i){let o=Ax(n),c=Ax(i),p=VX(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(a){x=!1}let m,f;try{m=e.fromISO(c,i),f=m.isValid}catch(a){f=!1}if(x&&f)return hn.fromDateTimes(p,m);if(x){let a=An.fromISO(c,i);if(a.isValid)return hn.after(p,a)}else if(f){let a=An.fromISO(o,i);if(a.isValid)return hn.before(m,a)}}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((f)=>f*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((f)=>[{time:f.s,type:"s"},{time:f.e,type:"e"}]),x=Array.prototype.concat(...p),m=x.sort((f,a)=>f.time-a.time);for(let f of m)if(o+=f.type==="s"?1:-1,o===1)i=f.time;else{if(i&&+i!==+f.time)c.push(hn.fromDateTimes(i,f.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?Ki.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 ap{static hasDST(n=Nn.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 so(n,Nn.defaultZone)}static getStartOfWeek({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:n=null,locObj:i=null}={}){return(i||Yn.create(n)).getWeekendDays().slice()}static months(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Yn.create(i,o,p)).months(n)}static monthsFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null,outputCalendar:p="gregory"}={}){return(c||Yn.create(i,o,p)).months(n,!0)}static weekdays(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Yn.create(i,o,null)).weekdays(n)}static weekdaysFormat(n="long",{locale:i=null,numberingSystem:o=null,locObj:c=null}={}){return(c||Yn.create(i,o,null)).weekdays(n,!0)}static meridiems({locale:n=null}={}){return Yn.create(n).meridiems()}static eras(n="short",{locale:i=null}={}){return Yn.create(i,null,"gregory").eras(n)}static features(){return{relative:Uw(),localeWeek:Vw()}}}function y1(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 _X(n,i,o){let c=[["years",(a,v)=>v.year-a.year],["quarters",(a,v)=>v.quarter-a.quarter+(v.year-a.year)*4],["months",(a,v)=>v.month-a.month+(v.year-a.year)*12],["weeks",(a,v)=>{let $=y1(a,v);return($-$%7)/7}],["days",y1]],p={},x=n,m,f;for(let[a,v]of c)if(o.indexOf(a)>=0)if(m=a,p[a]=v(n,i),f=x.plus(p),f>i){if(p[a]--,n=x.plus(p),n>i)f=n,p[a]--,n=x.plus(p)}else n=f;return[n,p,f,m]}function BX(n,i,o,c){let[p,x,m,f]=_X(n,i,o),a=i-p,v=o.filter((w)=>["hours","minutes","seconds","milliseconds"].indexOf(w)>=0);if(v.length===0){if(m<i)m=p.plus({[f]:1});if(m!==p)x[f]=(x[f]||0)+a/(m-p)}let $=An.fromObject(x,c);if(v.length>0)return An.fromMillis(a,c).shiftTo(...v).plus($);else return $}var jX="missing Intl.DateTimeFormat.formatToParts support";function Wn(n,i=(o)=>o){return{regex:n,deser:([o])=>i(H7(o))}}var bX=String.fromCharCode(160),rw=`[ ${bX}]`,tw=new RegExp(rw,"g");function LX(n){return n.replace(/\./g,"\\.?").replace(tw,rw)}function k1(n){return n.replace(/\./g,"").replace(tw," ").toLowerCase()}function xo(n,i){if(n===null)return null;else return{regex:RegExp(n.map(LX).join("|")),deser:([o])=>n.findIndex((c)=>k1(o)===k1(c))+i}}function Z1(n,i){return{regex:n,deser:([,o,c])=>bm(o,c),groups:i}}function Ym(n){return{regex:n,deser:([i])=>i}}function DX(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function NX(n,i){let o=po(i),c=po(i,"{2}"),p=po(i,"{3}"),x=po(i,"{4}"),m=po(i,"{6}"),f=po(i,"{1,2}"),a=po(i,"{1,3}"),v=po(i,"{1,6}"),$=po(i,"{1,9}"),w=po(i,"{2,4}"),J=po(i,"{4,6}"),X=(S)=>({regex:RegExp(DX(S.val)),deser:([H])=>H,literal:!0}),R=((S)=>{if(n.literal)return X(S);switch(S.val){case"G":return xo(i.eras("short"),0);case"GG":return xo(i.eras("long"),0);case"y":return Wn(v);case"yy":return Wn(w,Za);case"yyyy":return Wn(x);case"yyyyy":return Wn(J);case"yyyyyy":return Wn(m);case"M":return Wn(f);case"MM":return Wn(c);case"MMM":return xo(i.months("short",!0),1);case"MMMM":return xo(i.months("long",!0),1);case"L":return Wn(f);case"LL":return Wn(c);case"LLL":return xo(i.months("short",!1),1);case"LLLL":return xo(i.months("long",!1),1);case"d":return Wn(f);case"dd":return Wn(c);case"o":return Wn(a);case"ooo":return Wn(p);case"HH":return Wn(c);case"H":return Wn(f);case"hh":return Wn(c);case"h":return Wn(f);case"mm":return Wn(c);case"m":return Wn(f);case"q":return Wn(f);case"qq":return Wn(c);case"s":return Wn(f);case"ss":return Wn(c);case"S":return Wn(a);case"SSS":return Wn(p);case"u":return Ym($);case"uu":return Ym(f);case"uuu":return Wn(o);case"a":return xo(i.meridiems(),0);case"kkkk":return Wn(x);case"kk":return Wn(w,Za);case"W":return Wn(f);case"WW":return Wn(c);case"E":case"c":return Wn(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 Z1(new RegExp(`([+-]${f.source})(?::(${c.source}))?`),2);case"ZZZ":return Z1(new RegExp(`([+-]${f.source})(${c.source})?`),2);case"z":return Ym(/[a-z_+-/]{1,256}?/i);case" ":return Ym(/[^\S\n\r]/);default:return X(S)}})(n)||{invalidReason:jX};return R.token=n,R}var CX={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 hX(n,i,o){let{type:c,value:p}=n;if(c==="literal"){let a=/^\s+$/.test(p);return{literal:!a,val:a?" ":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 f=CX[m];if(typeof f==="object")f=f[x];if(f)return{literal:!1,val:f};return}function uX(n){return[`^${n.map((o)=>o.regex).reduce((o,c)=>`${o}(${c.source})`,"")}$`,n]}function IX(n,i,o){let c=n.match(i);if(c){let p={},x=1;for(let m in o)if(wp(o,m)){let f=o[m],a=f.groups?f.groups+1:1;if(!f.literal&&f.token)p[f.token.val[0]]=f.deser(c.slice(x,x+a));x+=a}return[c,p]}else return[c,{}]}function yX(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 Si(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=ga(n.u);return[Object.keys(n).reduce((x,m)=>{let f=i(m);if(f)x[f]=n[m];return x},{}),o,c]}var ba=null;function kX(){if(!ba)ba=e.fromMillis(1555555555555);return ba}function ZX(n,i){if(n.literal)return n;let o=Ki.macroTokenToFormatOpts(n.val),c=ew(o,i);if(c==null||c.includes(void 0))return n;return c}function gw(n,i){return Array.prototype.concat(...n.map((o)=>ZX(o,i)))}class ov{constructor(n,i){if(this.locale=n,this.format=i,this.tokens=gw(Ki.parseFormat(i),n),this.units=this.tokens.map((o)=>NX(o,n)),this.disqualifyingUnit=this.units.find((o)=>o.invalidReason),!this.disqualifyingUnit){let[o,c]=uX(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]=IX(n,this.regex,this.handlers),[c,p,x]=o?yX(o):[null,null,void 0];if(wp(o,"a")&&wp(o,"H"))throw new zc("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 dw(n,i,o){return new ov(n,o).explainFromTokens(i)}function qX(n,i,o){let{result:c,zone:p,specificOffset:x,invalidReason:m}=dw(n,i,o);return[c,p,x,m]}function ew(n,i){if(!n)return null;let c=Ki.create(i,n).dtFormatter(kX()),p=c.formatToParts(),x=c.resolvedOptions();return p.map((m)=>hX(m,n,x))}var La="Invalid DateTime",q1=8640000000000000;function Fx(n){return new Pi("unsupported zone",`the zone "${n.name}" is not supported`)}function Da(n){if(n.weekData===null)n.weekData=Um(n.c);return n.weekData}function Na(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 nJ(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 Hm(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 lm(n,i,o){return nJ(jm(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"),f=jm(x),[a,v]=nJ(f,o,n.zone);if(m!==0)a+=m,v=n.zone.offset(a);return{ts:a,o:v}}function mp(n,i,o,c,p,x){let{setZone:m,zone:f}=o;if(n&&Object.keys(n).length!==0||i){let a=i||f,v=e.fromObject(n,{...o,zone:a,specificOffset:x});return m?v:v.setZone(f)}else return e.invalid(new Pi("unparsable",`the input "${p}" can't be parsed as ${c}`))}function Mm(n,i,o=!0){return n.isValid?Ki.create(Yn.create("en-US"),{allowZ:o,forceSimple:!0}).formatDateTimeFromString(n,i):null}function Ca(n,i){let o=n.c.year>9999||n.c.year<0,c="";if(o&&n.c.year>=0)c+="+";if(c+=rn(n.c.year,o?6:4),i)c+="-",c+=rn(n.c.month),c+="-",c+=rn(n.c.day);else c+=rn(n.c.month),c+=rn(n.c.day);return c}function s1(n,i,o,c,p,x){let m=rn(n.c.hour);if(i){if(m+=":",m+=rn(n.c.minute),n.c.millisecond!==0||n.c.second!==0||!o)m+=":"}else m+=rn(n.c.minute);if(n.c.millisecond!==0||n.c.second!==0||!o){if(m+=rn(n.c.second),n.c.millisecond!==0||!c)m+=".",m+=rn(n.c.millisecond,3)}if(p)if(n.isOffsetFixed&&n.offset===0&&!x)m+="Z";else if(n.o<0)m+="-",m+=rn(Math.trunc(-n.o/60)),m+=":",m+=rn(Math.trunc(-n.o%60));else m+="+",m+=rn(Math.trunc(n.o/60)),m+=":",m+=rn(Math.trunc(n.o%60));if(x)m+="["+n.zone.ianaName+"]";return m}var iJ={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},PX={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},sX={ordinal:1,hour:0,minute:0,second:0,millisecond:0},oJ=["year","month","day","hour","minute","second","millisecond"],rX=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],tX=["year","ordinal","hour","minute","second","millisecond"];function gX(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 qa(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 gX(n)}}function dX(n){if(!Em[n]){if(Qm===void 0)Qm=Nn.now();Em[n]=n.offset(Qm)}return Em[n]}function t1(n,i){let o=so(i.zone,Nn.defaultZone);if(!o.isValid)return e.invalid(Fx(o));let c=Yn.fromObject(i),p,x;if(!nn(n.year)){for(let a of oJ)if(nn(n[a]))n[a]=iJ[a];let m=Ew(n)||Ow(n);if(m)return e.invalid(m);let f=dX(o);[p,x]=lm(n,f,o)}else p=Nn.now();return new e({ts:p,zone:o,loc:c,o:x})}function g1(n,i,o){let c=nn(o.round)?!0:o.round,p=(m,f)=>{return m=da(m,c||o.calendary?0:2,!0),i.loc.clone(o).relFormatter(o).format(m,f)},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 f=x(m);if(Math.abs(f)>=1)return p(f,m)}return p(n>i?-0:0,o.units[o.units.length-1])}function d1(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||Nn.defaultZone,o=n.invalid||(Number.isNaN(n.ts)?new Pi("invalid input"):null)||(!i.isValid?Fx(i):null);this.ts=nn(n.ts)?Nn.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=ro(n.o)&&!n.old?n.o:i.offset(this.ts);c=Hm(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||Yn.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]=d1(arguments),[o,c,p,x,m,f,a]=i;return t1({year:o,month:c,day:p,hour:x,minute:m,second:f,millisecond:a},n)}static utc(){let[n,i]=d1(arguments),[o,c,p,x,m,f,a]=i;return n.zone=Si.utcInstance,t1({year:o,month:c,day:p,hour:x,minute:m,second:f,millisecond:a},n)}static fromJSDate(n,i={}){let o=E7(n)?n.valueOf():NaN;if(Number.isNaN(o))return e.invalid("invalid input");let c=so(i.zone,Nn.defaultZone);if(!c.isValid)return e.invalid(Fx(c));return new e({ts:o,zone:c,loc:Yn.fromObject(i)})}static fromMillis(n,i={}){if(!ro(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:so(i.zone,Nn.defaultZone),loc:Yn.fromObject(i)})}static fromSeconds(n,i={}){if(!ro(n))throw new wi("fromSeconds requires a numerical input");else return new e({ts:n*1000,zone:so(i.zone,Nn.defaultZone),loc:Yn.fromObject(i)})}static fromObject(n,i={}){n=n||{};let o=so(i.zone,Nn.defaultZone);if(!o.isValid)return e.invalid(Fx(o));let c=Yn.fromObject(i),p=_m(n,r1),{minDaysInFirstWeek:x,startOfWeek:m}=L1(p,c),f=Nn.now(),a=!nn(i.specificOffset)?i.specificOffset:o.offset(f),v=!nn(p.ordinal),$=!nn(p.year),w=!nn(p.month)||!nn(p.day),J=$||w,X=p.weekYear||p.weekNumber;if((J||v)&&X)throw new zc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&v)throw new zc("Can't mix ordinal dates with month/day");let W=X||p.weekday&&!J,R,S,H=Hm(f,a);if(W)R=rX,S=PX,H=Um(H,x,m);else if(v)R=tX,S=sX,H=ja(H);else R=oJ,S=iJ;let M=!1;for(let y of R){let z=p[y];if(!nn(z))M=!0;else if(M)p[y]=S[y];else p[y]=H[y]}let I=W?z7(p,x,m):v?l7(p):Ew(p),Y=I||Ow(p);if(Y)return e.invalid(Y);let l=W?j1(p,x,m):v?b1(p):p,[E,Q]=lm(l,a,o),j=new e({ts:E,zone:o,o:Q,loc:c});if(p.weekday&&J&&n.weekday!==j.weekday)return e.invalid("mismatched weekday",`you can't specify both a weekday of ${p.weekday} and a date of ${j.toISO()}`);if(!j.isValid)return e.invalid(j.invalid);return j}static fromISO(n,i={}){let[o,c]=XX(n);return mp(o,c,i,"ISO 8601",n)}static fromRFC2822(n,i={}){let[o,c]=WX(n);return mp(o,c,i,"RFC 2822",n)}static fromHTTP(n,i={}){let[o,c]=KX(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=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0}),[m,f,a,v]=qX(x,n,i);if(v)return e.invalid(v);else return mp(m,f,o,`format ${i}`,n,a)}static fromString(n,i,o={}){return e.fromFormat(n,i,o)}static fromSQL(n,i={}){let[o,c]=lX(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(Nn.throwOnInvalid)throw new e1(o);else return new e({invalid:o})}static isDateTime(n){return n&&n.isLuxonDateTime||!1}static parseFormatForOpts(n,i={}){let o=ew(n,Yn.fromObject(i));return!o?null:o.map((c)=>c?c.val:null).join("")}static expandFormat(n,i={}){return gw(Ki.parseFormat(n),Yn.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?Da(this).weekYear:NaN}get weekNumber(){return this.isValid?Da(this).weekNumber:NaN}get weekday(){return this.isValid?Da(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Na(this).weekday:NaN}get localWeekNumber(){return this.isValid?Na(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Na(this).weekYear:NaN}get ordinal(){return this.isValid?ja(this.c).ordinal:NaN}get monthShort(){return this.isValid?ap.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ap.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ap.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ap.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=jm(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 f=o-x*i,a=o-m*i,v=Hm(f,x),$=Hm(a,m);if(v.hour===$.hour&&v.minute===$.minute&&v.second===$.second&&v.millisecond===$.millisecond)return[Mc(this,{ts:f}),Mc(this,{ts:a})];return[this]}get isInLeapYear(){return Kx(this.year)}get daysInMonth(){return Vm(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}=Ki.create(this.loc.clone(n),n).resolvedOptions(this);return{locale:i,numberingSystem:o,outputCalendar:c}}toUTC(n=0,i={}){return this.setZone(Si.instance(n),i)}toLocal(){return this.setZone(Nn.defaultZone)}setZone(n,{keepLocalTime:i=!1,keepCalendarTime:o=!1}={}){if(n=so(n,Nn.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]=lm(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),f=!nn(i.month)||!nn(i.day),a=m||f,v=i.weekYear||i.weekNumber;if((a||x)&&v)throw new zc("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&x)throw new zc("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))$=b1({...ja(this.c),...i});else if($={...this.toObject(),...i},nn(i.day))$.day=Math.min(Vm($.year,$.month),$.day);let[w,J]=lm($,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?Ki.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,n):La}toLocaleString(n=Om,i={}){return this.isValid?Ki.create(this.loc.clone(i),n).formatDateTime(this):La}toLocaleParts(n={}){return this.isValid?Ki.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=Ca(this,x);return m+="T",m+=s1(this,x,i,o,c,p),m}toISODate({format:n="extended"}={}){if(!this.isValid)return null;return Ca(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":"")+s1(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 Ca(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():La}[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=O7(i).map(An.normalizeUnit),x=n.valueOf()>this.valueOf(),m=x?this:n,f=x?n:this,a=BX(m,f,p,c);return x?a.negate():a}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 g1(i,this.plus(o),{...n,numeric:"always",units:c,unit:p})}toRelativeCalendar(n={}){if(!this.isValid)return null;return g1(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 D1(n,(i)=>i.valueOf(),Math.min)}static max(...n){if(!n.every(e.isDateTime))throw new wi("max requires all arguments be DateTimes");return D1(n,(i)=>i.valueOf(),Math.max)}static fromFormatExplain(n,i,o={}){let{locale:c=null,numberingSystem:p=null}=o,x=Yn.fromOpts({locale:c,numberingSystem:p,defaultToEN:!0});return dw(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=Yn.fromOpts({locale:o,numberingSystem:c,defaultToEN:!0});return new ov(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=Yn.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:f,specificOffset:a,invalidReason:v}=i.explainFromTokens(n);if(v)return e.invalid(v);else return mp(m,f,o,`format ${i.format}`,n,a)}static get DATE_SHORT(){return Om}static get DATE_MED(){return ow}static get DATE_MED_WITH_WEEKDAY(){return x7}static get DATE_FULL(){return cw}static get DATE_HUGE(){return pw}static get TIME_SIMPLE(){return xw}static get TIME_WITH_SECONDS(){return mw}static get TIME_WITH_SHORT_OFFSET(){return fw}static get TIME_WITH_LONG_OFFSET(){return aw}static get TIME_24_SIMPLE(){return vw}static get TIME_24_WITH_SECONDS(){return $w}static get TIME_24_WITH_SHORT_OFFSET(){return ww}static get TIME_24_WITH_LONG_OFFSET(){return Jw}static get DATETIME_SHORT(){return Aw}static get DATETIME_SHORT_WITH_SECONDS(){return Tw}static get DATETIME_MED(){return Fw}static get DATETIME_MED_WITH_SECONDS(){return Rw}static get DATETIME_MED_WITH_WEEKDAY(){return m7}static get DATETIME_FULL(){return Xw}static get DATETIME_FULL_WITH_SECONDS(){return Ww}static get DATETIME_HUGE(){return Kw}static get DATETIME_HUGE_WITH_SECONDS(){return Sw}}function Ax(n){if(e.isDateTime(n))return n;else if(n&&n.valueOf&&ro(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 eX="3.5.0";cJ.DateTime=e;cJ.Duration=An;cJ.FixedOffsetZone=Si;cJ.IANAZone=Go;cJ.Info=ap;cJ.Interval=hn;cJ.InvalidZone=Pa;cJ.Settings=Nn;cJ.SystemZone=Wx;cJ.VERSION=eX;cJ.Zone=Qc});var vJ=h((xJ)=>{Object.defineProperty(xJ,"__esModule",{value:!0});xJ.RE_RANGE=xJ.RE_WILDCARDS=xJ.PRESETS=xJ.TIME_UNITS_LEN=xJ.TIME_UNITS=xJ.TIME_UNITS_MAP=xJ.ALIASES=xJ.PARSE_DEFAULTS=xJ.CONSTRAINTS=void 0;xJ.CONSTRAINTS=Object.freeze({second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,7]});xJ.PARSE_DEFAULTS=Object.freeze({second:"0",minute:"*",hour:"*",dayOfMonth:"*",month:"*",dayOfWeek:"*"});xJ.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});xJ.TIME_UNITS_MAP=Object.freeze({SECOND:"second",MINUTE:"minute",HOUR:"hour",DAY_OF_MONTH:"dayOfMonth",MONTH:"month",DAY_OF_WEEK:"dayOfWeek"});xJ.TIME_UNITS=Object.freeze(Object.values(xJ.TIME_UNITS_MAP));xJ.TIME_UNITS_LEN=xJ.TIME_UNITS.length;xJ.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"});xJ.RE_WILDCARDS=/\*/g;xJ.RE_RANGE=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g});var pv=h((wJ)=>{Object.defineProperty(wJ,"__esModule",{value:!0});wJ.ExclusiveParametersError=wJ.CronError=void 0;class cv extends Error{}wJ.CronError=cv;class $J extends cv{constructor(n,i){super(`You can't specify both ${n} and ${i}`)}}wJ.ExclusiveParametersError=$J});var Dm=h((AJ)=>{Object.defineProperty(AJ,"__esModule",{value:!0});AJ.CronTime=void 0;var Yo=pJ(),Gi=vJ(),Yi=pv();class xv{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 Yi.ExclusiveParametersError("timeZone","utcOffset");if(i){if(!Yo.DateTime.fromObject({},{zone:i}).isValid)throw new Yi.CronError("Invalid timezone.");this.timeZone=i}if(o!=null)this.utcOffset=o;if(n instanceof Date||n instanceof Yo.DateTime)this.source=n instanceof Date?Yo.DateTime.fromJSDate(n):n,this.realDate=!0;else this.source=n,this._parse(this.source)}static validateCronExpression(n){try{return new xv(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 Yo.DateTime?this.source:Yo.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"),f=`UTC${o}${p}:${m}`;if(i=i.setZone(f),!i.isValid)throw new Yi.CronError("ERROR: You specified an invalid UTC offset.")}if(this.realDate){if(Yo.DateTime.local()>i)throw new Yi.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()-Yo.DateTime.local().toMillis())}toString(){return this.toJSON().join(" ")}toJSON(){return Gi.TIME_UNITS.map((n)=>{return this._wcOrAll(n)})}getNextDateFrom(n,i){var o;if(n instanceof Date)n=Yo.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 Yi.CronError("ERROR: You specified an invalid date.");let x=Yo.DateTime.now().plus({years:8});while(!0){let m=c.toMillis()-n.toMillis();if(c>x)throw new Yi.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: ${zo.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[f,a]=this._findPreviousDSTJump(c);if(c=a,f)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[f,a]=this._findPreviousDSTJump(c);if(c=a,f)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[f,a]=this._findPreviousDSTJump(c);if(c=a,f)break}continue}if(!(c.hour in this.hour)&&Object.keys(this.hour).length!==24){let f=c.hour===23&&m>86400000?0:c.hour+1,a=c.minute;if(c=c.set({hour:f}),c=c.set({minute:0,second:0}),this._forwardDSTJump(f,a,c)){let[$,v]=this._findPreviousDSTJump(c);if(c=v,$)break}continue}if(!(c.minute in this.minute)&&Object.keys(this.minute).length!==60){let f=c.minute===59&&m>3600000?0:c.minute+1,a=c.hour+(f===60?1:0);if(c=c.set({minute:f}),c=c.set({second:0}),this._forwardDSTJump(a,f,c)){let[$,v]=this._findPreviousDSTJump(c);if(c=v,$)break}continue}if(!(c.second in this.second)&&Object.keys(this.second).length!==60){let f=c.second===59&&m>60000?0:c.second+1,a=c.minute+(f===60?1:0),$=c.hour+(a===60?1:0);if(c=c.set({second:f}),this._forwardDSTJump($,a,c)){let[v,A]=this._findPreviousDSTJump(c);if(c=A,v)break}continue}if(c.toMillis()===p){let f=c.second+1,a=c.minute+(f===60?1:0),$=c.hour+(a===60?1:0);if(c=c.set({second:f}),this._forwardDSTJump($,a,c)){let[v,A]=this._findPreviousDSTJump(c);if(c=A,v)break}continue}break}return c}_findPreviousDSTJump(n){var i;let o,c,p,x,m=n,f=1440,a=0;do{if(++a>f)throw new zi.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 $=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,$),$];return[!1,$]}_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 zi.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},(a,$)=>i+$),x=Array.from({length:c},(a,$)=>$),m=Array.from({length:60},(a,$)=>$),f=(a)=>{if(a===n)return p;else if(a===o)return x;else return m};for(let a=n;a<=o;++a){if(!(a in this.hour))continue;let $=f(a);for(let v of $)if(v 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=Yi.CONSTRAINTS[n],o=i[0],c=n===Yi.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(Yi.PRESETS).includes(n))n=Yi.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(Yi.ALIASES).includes(p))return Yi.ALIASES[p].toString();throw new zi.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<Yi.TIME_UNITS_LEN-1)throw new zi.CronError("Too few fields");if(o.length>Yi.TIME_UNITS_LEN)throw new zi.CronError("Too many fields");let c=o.length;for(let p of Yi.TIME_UNITS){let x=Yi.TIME_UNITS.indexOf(p),m=(i=o[x-(Yi.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:Yi.PARSE_DEFAULTS[p];this._parseField(m,p)}}_parseField(n,i){let o=this[i],c,p=Yi.CONSTRAINTS[i],x=p[0],m=p[1];n.split(",").forEach(($)=>{let v=$.indexOf("*");if(v!==-1&&v!==0)throw new zi.CronError(`Field (${$}) has an invalid wildcard expression`)}),n=n.replace(Yi.RE_WILDCARDS,`${x}-${m}`);let a=n.split(",");for(let $ of a){let v=[...$.matchAll(Yi.RE_RANGE)][0];if((v===null||v===void 0?void 0:v[1])!==void 0){let[,A,J,S]=v,W=parseInt(A,10),R=J!==void 0?parseInt(J,10):void 0,K=S!==void 0,z=parseInt(S!==null&&S!==void 0?S:"1",10);if(z===0)throw new zi.CronError(`Field (${i}) has a step of zero`);if(R!==void 0&&W>R)throw new zi.CronError(`Field (${i}) has an invalid range`);if(W<x||R!==void 0&&R>m||R===void 0&&W>m)throw new zi.CronError(`Field value (${n}) is out of range`);if(W=Math.min(Math.max(x,~~Math.abs(W)),m),R!==void 0)R=Math.min(m,~~Math.abs(R));else R=K?m:W;c=W;do o[c]=!0,c+=z;while(c<=R);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new zi.CronError(`Field (${i}) cannot be parsed`)}}}vJ.CronTime=$J});var wJ=u((Tp)=>{var Nm=Tp&&Tp.__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 f(v){try{$(c.next(v))}catch(A){m(A)}}function a(v){try{$(c.throw(v))}catch(A){m(A)}}function $(v){v.done?x(v.value):p(v.value).then(f,a)}$((c=c.apply(n,i||[])).next())})};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.CronJob=void 0;var JJ=Kn("child_process"),f0=m0(),Cm=Dm();class Yx{get isActive(){return this._isActive}get isCallbackRunning(){return this._isCallbackRunning}constructor(n,i,o,c,p,x,m,f,a,$,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($),this.errorHandler=v,p!=null&&f!=null)throw new f0.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new Cm.CronTime(n,p,null);else if(f!=null)this.cronTime=new Cm.CronTime(n,null,f);else this.cronTime=new Cm.CronTime(n,p,f);if(a!=null)this.unrefTimeout=a;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 f0.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new Yx(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 Yx(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else return new Yx(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 JJ.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return JJ.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 Cm.CronTime))throw new f0.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 f=this.cronTime.getTimeout();if(f>m)f=m;o+=f}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()}))}}Tp.CronJob=Yx});var a0=u((hm)=>{Object.defineProperty(hm,"__esModule",{value:!0});hm.timeout=hm.sendAt=hm.CronTime=hm.CronJob=void 0;var TJ=Dm(),X7=wJ();Object.defineProperty(hm,"CronJob",{enumerable:!0,get:function(){return X7.CronJob}});var K7=Dm();Object.defineProperty(hm,"CronTime",{enumerable:!0,get:function(){return K7.CronTime}});var G7=(n)=>new TJ.CronTime(n).sendAt();hm.sendAt=G7;var Y7=(n)=>new TJ.CronTime(n).getTimeout();hm.timeout=Y7});var xF=u((WD,Q0)=>{Q0.exports=pF;Q0.exports.preferredCharsets=pF;var _7=/^\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=_7.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 f=x[m].trim().split("=");if(f[0]==="q"){p=parseFloat(f[1]);break}}}return{charset:c,q:p,i}}function b7(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 pF(n,i){var o=B7(n===void 0?"*":n||"");if(!i)return o.filter(cF).sort(oF).map(D7);var c=i.map(function p(x,m){return b7(x,o,m)});return c.filter(cF).sort(oF).map(function p(x){return i[c.indexOf(x)]})}function oF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function D7(n){return n.charset}function cF(n){return n.q>0}});var vF=u((XD,O0)=>{O0.exports=$F;O0.exports.preferredEncodings=$F;var N7=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function C7(n){var i=n.split(","),o=!1,c=1;for(var p=0,x=0;p<i.length;p++){var m=h7(i[p].trim(),p);if(m)i[x++]=m,o=o||aF("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 h7(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 f=x[m].trim().split("=");if(f[0]==="q"){p=parseFloat(f[1]);break}}}return{encoding:c,q:p,i}}function u7(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=aF(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function aF(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 $F(n,i){var o=C7(n||"");if(!i)return o.filter(fF).sort(mF).map(I7);var c=i.map(function p(x,m){return u7(x,o,m)});return c.filter(fF).sort(mF).map(function p(x){return i[c.indexOf(x)]})}function mF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function I7(n){return n.encoding}function fF(n){return n.q>0}});var FF=u((KD,E0)=>{E0.exports=TF;E0.exports.preferredLanguages=TF;var y7=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function k7(n){var i=n.split(",");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=y7.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 f=o[3].split(";");for(var a=0;a<f.length;a++){var $=f[a].split("=");if($[0]==="q")m=parseFloat($[1])}}return{prefix:c,suffix:p,q:m,i,full:x}}function Z7(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=wF(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 TF(n,i){var o=k7(n===void 0?"*":n||"");if(!i)return o.filter(JF).sort(AF).map(P7);var c=i.map(function p(x,m){return Z7(x,o,m)});return c.filter(JF).sort(AF).map(function p(x){return i[c.indexOf(x)]})}function AF(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 JF(n){return n.q>0}});var GF=u((GD,U0)=>{U0.exports=XF;U0.exports.preferredMediaTypes=XF;var s7=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function r7(n){var i=nX(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=s7.exec(n);if(!o)return null;var c=Object.create(null),p=1,x=o[2],m=o[1];if(o[3]){var f=iX(o[3]).map(e7);for(var a=0;a<f.length;a++){var $=f[a],v=$[0].toLowerCase(),A=$[1],J=A&&A[0]==='"'&&A[A.length-1]==='"'?A.substr(1,A.length-2):A;if(v==="q"){p=parseFloat(J);break}c[v]=J}}return{type:m,subtype:x,params:c,q:p,i}}function t7(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=g7(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function g7(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 XF(n,i){var o=r7(n===void 0?"*/*":n||"");if(!i)return o.filter(SF).sort(RF).map(d7);var c=i.map(function p(x,m){return t7(x,o,m)});return c.filter(SF).sort(RF).map(function p(x){return i[c.indexOf(x)]})}function RF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function d7(n){return n.type+"/"+n.subtype}function SF(n){return n.q>0}function KF(n){var i=0,o=0;while((o=n.indexOf('"',o))!==-1)i++,o++;return i}function e7(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 nX(n){var i=n.split(",");for(var o=1,c=0;o<i.length;o++)if(KF(i[c])%2==0)i[++c]=i[o];else i[c]+=","+i[o];return i.length=c+1,i}function iX(n){var i=n.split(";");for(var o=1,c=0;o<i.length;o++)if(KF(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 YF=u((YD,V0)=>{/*!
|
|
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: ${Yo.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[f,a]=this._findPreviousDSTJump(c);if(c=a,f)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[f,a]=this._findPreviousDSTJump(c);if(c=a,f)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[f,a]=this._findPreviousDSTJump(c);if(c=a,f)break}continue}if(!(c.hour in this.hour)&&Object.keys(this.hour).length!==24){let f=c.hour===23&&m>86400000?0:c.hour+1,a=c.minute;if(c=c.set({hour:f}),c=c.set({minute:0,second:0}),this._forwardDSTJump(f,a,c)){let[v,$]=this._findPreviousDSTJump(c);if(c=$,v)break}continue}if(!(c.minute in this.minute)&&Object.keys(this.minute).length!==60){let f=c.minute===59&&m>3600000?0:c.minute+1,a=c.hour+(f===60?1:0);if(c=c.set({minute:f}),c=c.set({second:0}),this._forwardDSTJump(a,f,c)){let[v,$]=this._findPreviousDSTJump(c);if(c=$,v)break}continue}if(!(c.second in this.second)&&Object.keys(this.second).length!==60){let f=c.second===59&&m>60000?0:c.second+1,a=c.minute+(f===60?1:0),v=c.hour+(a===60?1:0);if(c=c.set({second:f}),this._forwardDSTJump(v,a,c)){let[$,w]=this._findPreviousDSTJump(c);if(c=w,$)break}continue}if(c.toMillis()===p){let f=c.second+1,a=c.minute+(f===60?1:0),v=c.hour+(a===60?1:0);if(c=c.set({second:f}),this._forwardDSTJump(v,a,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,f=1440,a=0;do{if(++a>f)throw new Yi.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 Yi.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},(a,v)=>i+v),x=Array.from({length:c},(a,v)=>v),m=Array.from({length:60},(a,v)=>v),f=(a)=>{if(a===n)return p;else if(a===o)return x;else return m};for(let a=n;a<=o;++a){if(!(a in this.hour))continue;let v=f(a);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=Gi.CONSTRAINTS[n],o=i[0],c=n===Gi.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(Gi.PRESETS).includes(n))n=Gi.PRESETS[n];n=n.replace(/[a-z]{1,3}/gi,(p)=>{if(Object.keys(Gi.ALIASES).includes(p))return Gi.ALIASES[p].toString();throw new Yi.CronError(`Unknown alias: ${p}`)});let o=n.trim().split(/\s+/);if(o.length<Gi.TIME_UNITS_LEN-1)throw new Yi.CronError("Too few fields");if(o.length>Gi.TIME_UNITS_LEN)throw new Yi.CronError("Too many fields");let c=o.length;for(let p of Gi.TIME_UNITS){let x=Gi.TIME_UNITS.indexOf(p),m=(i=o[x-(Gi.TIME_UNITS_LEN-c)])!==null&&i!==void 0?i:Gi.PARSE_DEFAULTS[p];this._parseField(m,p)}}_parseField(n,i){let o=this[i],c,p=Gi.CONSTRAINTS[i],x=p[0],m=p[1];n.split(",").forEach((v)=>{let $=v.indexOf("*");if($!==-1&&$!==0)throw new Yi.CronError(`Field (${v}) has an invalid wildcard expression`)}),n=n.replace(Gi.RE_WILDCARDS,`${x}-${m}`);let a=n.split(",");for(let v of a){let $=[...v.matchAll(Gi.RE_RANGE)][0];if(($===null||$===void 0?void 0:$[1])!==void 0){let[,w,J,X]=$,W=parseInt(w,10),R=J!==void 0?parseInt(J,10):void 0,S=X!==void 0,H=parseInt(X!==null&&X!==void 0?X:"1",10);if(H===0)throw new Yi.CronError(`Field (${i}) has a step of zero`);if(R!==void 0&&W>R)throw new Yi.CronError(`Field (${i}) has an invalid range`);if(W<x||R!==void 0&&R>m||R===void 0&&W>m)throw new Yi.CronError(`Field value (${n}) is out of range`);if(W=Math.min(Math.max(x,~~Math.abs(W)),m),R!==void 0)R=Math.min(m,~~Math.abs(R));else R=S?m:W;c=W;do o[c]=!0,c+=H;while(c<=R);if(i==="dayOfWeek"){if(!o[0]&&!!o[7])o[0]=o[7];delete o[7]}}else throw new Yi.CronError(`Field (${i}) cannot be parsed`)}}}AJ.CronTime=xv});var RJ=h((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 f($){try{v(c.next($))}catch(w){m(w)}}function a($){try{v(c.throw($))}catch(w){m(w)}}function v($){$.done?x($.value):p($.value).then(f,a)}v((c=c.apply(n,i||[])).next())})};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.CronJob=void 0;var FJ=Sn("child_process"),mv=pv(),Cm=Dm();class Yx{get isActive(){return this._isActive}get isCallbackRunning(){return this._isCallbackRunning}constructor(n,i,o,c,p,x,m,f,a,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&&f!=null)throw new mv.ExclusiveParametersError("timeZone","utcOffset");if(p!=null)this.cronTime=new Cm.CronTime(n,p,null);else if(f!=null)this.cronTime=new Cm.CronTime(n,null,f);else this.cronTime=new Cm.CronTime(n,p,f);if(a!=null)this.unrefTimeout=a;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 mv.ExclusiveParametersError("timeZone","utcOffset");if(n.timeZone!=null)return new Yx(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 Yx(n.cronTime,n.onTick,n.onComplete,n.start,null,n.context,n.runOnInit,n.utcOffset,n.unrefTimeout,n.waitForCompletion,n.errorHandler);else return new Yx(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 FJ.spawn.bind(void 0,c!==null&&c!==void 0?c:n,p,{})}case"object":return FJ.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 Cm.CronTime))throw new mv.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 f=this.cronTime.getTimeout();if(f>m)f=m;o+=f}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=Yx});var av=h((hm)=>{Object.defineProperty(hm,"__esModule",{value:!0});hm.validateCronExpression=hm.timeout=hm.sendAt=hm.CronTime=hm.CronJob=void 0;var fv=Dm(),WW=RJ();Object.defineProperty(hm,"CronJob",{enumerable:!0,get:function(){return WW.CronJob}});var KW=Dm();Object.defineProperty(hm,"CronTime",{enumerable:!0,get:function(){return KW.CronTime}});var SW=(n)=>new fv.CronTime(n).sendAt();hm.sendAt=SW;var GW=(n)=>new fv.CronTime(n).getTimeout();hm.timeout=GW;hm.validateCronExpression=fv.CronTime.validateCronExpression});var fF=h((UD,Qv)=>{Qv.exports=mF;Qv.exports.preferredCharsets=mF;var _W=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function BW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=jW(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function jW(n,i){var o=_W.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 f=x[m].trim().split("=");if(f[0]==="q"){p=parseFloat(f[1]);break}}}return{charset:c,q:p,i}}function bW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=LW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function LW(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 mF(n,i){var o=BW(n===void 0?"*":n||"");if(!i)return o.filter(xF).sort(pF).map(DW);var c=i.map(function p(x,m){return bW(x,o,m)});return c.filter(xF).sort(pF).map(function p(x){return i[c.indexOf(x)]})}function pF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function DW(n){return n.charset}function xF(n){return n.q>0}});var JF=h((VD,Ev)=>{Ev.exports=wF;Ev.exports.preferredEncodings=wF;var NW=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function CW(n){var i=n.split(","),o=!1,c=1;for(var p=0,x=0;p<i.length;p++){var m=hW(i[p].trim(),p);if(m)i[x++]=m,o=o||$F("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 hW(n,i){var o=NW.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 f=x[m].trim().split("=");if(f[0]==="q"){p=parseFloat(f[1]);break}}}return{encoding:c,q:p,i}}function uW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=$F(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function $F(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 wF(n,i){var o=CW(n||"");if(!i)return o.filter(vF).sort(aF).map(IW);var c=i.map(function p(x,m){return uW(x,o,m)});return c.filter(vF).sort(aF).map(function p(x){return i[c.indexOf(x)]})}function aF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function IW(n){return n.encoding}function vF(n){return n.q>0}});var XF=h((_D,Ov)=>{Ov.exports=RF;Ov.exports.preferredLanguages=RF;var yW=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function kW(n){var i=n.split(",");for(var o=0,c=0;o<i.length;o++){var p=FF(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function FF(n,i){var o=yW.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 f=o[3].split(";");for(var a=0;a<f.length;a++){var v=f[a].split("=");if(v[0]==="q")m=parseFloat(v[1])}}return{prefix:c,suffix:p,q:m,i,full:x}}function ZW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=qW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function qW(n,i,o){var c=FF(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 RF(n,i){var o=kW(n===void 0?"*":n||"");if(!i)return o.filter(TF).sort(AF).map(PW);var c=i.map(function p(x,m){return ZW(x,o,m)});return c.filter(TF).sort(AF).map(function p(x){return i[c.indexOf(x)]})}function AF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function PW(n){return n.full}function TF(n){return n.q>0}});var HF=h((BD,Uv)=>{Uv.exports=GF;Uv.exports.preferredMediaTypes=GF;var sW=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function rW(n){var i=n5(n);for(var o=0,c=0;o<i.length;o++){var p=SF(i[o].trim(),o);if(p)i[c++]=p}return i.length=c,i}function SF(n,i){var o=sW.exec(n);if(!o)return null;var c=Object.create(null),p=1,x=o[2],m=o[1];if(o[3]){var f=i5(o[3]).map(eW);for(var a=0;a<f.length;a++){var v=f[a],$=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 tW(n,i,o){var c={o:-1,q:0,s:0};for(var p=0;p<i.length;p++){var x=gW(n,i[p],o);if(x&&(c.s-x.s||c.q-x.q||c.o-x.o)<0)c=x}return c}function gW(n,i,o){var c=SF(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=rW(n===void 0?"*/*":n||"");if(!i)return o.filter(KF).sort(WF).map(dW);var c=i.map(function p(x,m){return tW(x,o,m)});return c.filter(KF).sort(WF).map(function p(x){return i[c.indexOf(x)]})}function WF(n,i){return i.q-n.q||i.s-n.s||n.o-i.o||n.i-i.i||0}function dW(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 eW(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 n5(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 i5(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 MF=h((jD,Vv)=>{/*!
|
|
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 oX=xF(),cX=vF(),pX=FF(),xX=GF();V0.exports=Mn;V0.exports.Negotiator=Mn;function Mn(n){if(!(this instanceof Mn))return new Mn(n);this.request=n}Mn.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};Mn.prototype.charsets=function n(i){return oX(this.request.headers["accept-charset"],i)};Mn.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};Mn.prototype.encodings=function n(i){return cX(this.request.headers["accept-encoding"],i)};Mn.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};Mn.prototype.languages=function n(i){return pX(this.request.headers["accept-language"],i)};Mn.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};Mn.prototype.mediaTypes=function n(i){return xX(this.request.headers.accept,i)};Mn.prototype.preferredCharset=Mn.prototype.charset;Mn.prototype.preferredCharsets=Mn.prototype.charsets;Mn.prototype.preferredEncoding=Mn.prototype.encoding;Mn.prototype.preferredEncodings=Mn.prototype.encodings;Mn.prototype.preferredLanguage=Mn.prototype.language;Mn.prototype.preferredLanguages=Mn.prototype.languages;Mn.prototype.preferredMediaType=Mn.prototype.mediaType;Mn.prototype.preferredMediaTypes=Mn.prototype.mediaTypes});var zF=u((zD,mX)=>{mX.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 lF=u((MD,MF)=>{/*!
|
|
11
|
+
*/var o5=fF(),c5=JF(),p5=XF(),x5=HF();Vv.exports=zn;Vv.exports.Negotiator=zn;function zn(n){if(!(this instanceof zn))return new zn(n);this.request=n}zn.prototype.charset=function n(i){var o=this.charsets(i);return o&&o[0]};zn.prototype.charsets=function n(i){return o5(this.request.headers["accept-charset"],i)};zn.prototype.encoding=function n(i){var o=this.encodings(i);return o&&o[0]};zn.prototype.encodings=function n(i){return c5(this.request.headers["accept-encoding"],i)};zn.prototype.language=function n(i){var o=this.languages(i);return o&&o[0]};zn.prototype.languages=function n(i){return p5(this.request.headers["accept-language"],i)};zn.prototype.mediaType=function n(i){var o=this.mediaTypes(i);return o&&o[0]};zn.prototype.mediaTypes=function n(i){return x5(this.request.headers.accept,i)};zn.prototype.preferredCharset=zn.prototype.charset;zn.prototype.preferredCharsets=zn.prototype.charsets;zn.prototype.preferredEncoding=zn.prototype.encoding;zn.prototype.preferredEncodings=zn.prototype.encodings;zn.prototype.preferredLanguage=zn.prototype.language;zn.prototype.preferredLanguages=zn.prototype.languages;zn.prototype.preferredMediaType=zn.prototype.mediaType;zn.prototype.preferredMediaTypes=zn.prototype.mediaTypes});var zF=h((bD,m5)=>{m5.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 QF=h((LD,lF)=>{/*!
|
|
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
|
-
*/
|
|
16
|
+
*/lF.exports=zF()});var _F=h((A5)=>{/*!
|
|
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 af=
|
|
21
|
+
*/var af=QF(),f5=Sn("path").extname,EF=/^\s*([^;\s]*)(?:;|\s|$)/,a5=/^text\//i;A5.charset=OF;A5.charsets={lookup:OF};A5.contentType=v5;A5.extension=$5;A5.extensions=Object.create(null);A5.lookup=w5;A5.types=Object.create(null);J5(A5.extensions,A5.types);function OF(n){if(!n||typeof n!=="string")return!1;var i=EF.exec(n),o=i&&af[i[1].toLowerCase()];if(o&&o.charset)return o.charset;if(i&&a5.test(i[1]))return"UTF-8";return!1}function v5(n){if(!n||typeof n!=="string")return!1;var i=n.indexOf("/")===-1?A5.lookup(n):n;if(!i)return!1;if(i.indexOf("charset")===-1){var o=A5.charset(i);if(o)i+="; charset="+o.toLowerCase()}return i}function $5(n){if(!n||typeof n!=="string")return!1;var i=EF.exec(n),o=i&&A5.extensions[i[1].toLowerCase()];if(!o||!o.length)return!1;return o[0]}function w5(n){if(!n||typeof n!=="string")return!1;var i=f5("x."+n).toLowerCase().substr(1);if(!i)return!1;return A5.types[i]||!1}function J5(n,i){var o=["nginx","apache",void 0,"iana"];Object.keys(af).forEach(function c(p){var x=af[p],m=x.extensions;if(!m||!m.length)return;n[p]=m;for(var f=0;f<m.length;f++){var a=m[f];if(i[a]){var v=o.indexOf(af[i[a]].source),$=o.indexOf(x.source);if(i[a]!=="application/octet-stream"&&(v>$||v===$&&i[a].substr(0,12)==="application/"))continue}i[a]=p}})}});var vf=h((ND,BF)=>{/*!
|
|
22
22
|
* accepts
|
|
23
23
|
* Copyright(c) 2014 Jonathan Ong
|
|
24
24
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
25
25
|
* MIT Licensed
|
|
26
|
-
*/var
|
|
26
|
+
*/var X5=MF(),W5=_F();BF.exports=Ci;function Ci(n){if(!(this instanceof Ci))return new Ci(n);this.headers=n.headers,this.negotiator=new X5(n)}Ci.prototype.type=Ci.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(K5),p=this.negotiator.mediaTypes(c.filter(S5)),x=p[0];return x?i[c.indexOf(x)]:!1};Ci.prototype.encoding=Ci.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};Ci.prototype.charset=Ci.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};Ci.prototype.lang=Ci.prototype.langs=Ci.prototype.language=Ci.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 K5(n){return n.indexOf("/")===-1?W5.lookup(n):n}function S5(n){return typeof n==="string"}});var bv=h((jF,bF)=>{/*!
|
|
27
27
|
* base64id v0.1.0
|
|
28
|
-
*/var _x=Kn("crypto"),j0=function(){};j0.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,f){o.bytesBuffer=f,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};j0.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,"-")};_F=BF.exports=new j0});var vf=u((bF)=>{Object.defineProperty(bF,"__esModule",{value:!0});bF.ERROR_PACKET=bF.PACKET_TYPES_REVERSE=bF.PACKET_TYPES=void 0;var Ho=Object.create(null);bF.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 jF=Object.create(null);bF.PACKET_TYPES_REVERSE=jF;Object.keys(Ho).forEach((n)=>{jF[Ho[n]]=n});var GX={type:"error",data:"parser error"};bF.ERROR_PACKET=GX});var CF=u((NF)=>{Object.defineProperty(NF,"__esModule",{value:!0});NF.encodePacket=void 0;NF.encodePacketToBinary=HX;var MX=vf(),lX=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+DF(i,!0).toString("base64"));return c(MX.PACKET_TYPES[n]+(i||""))};NF.encodePacket=lX;var DF=(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)},L0;function HX(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(DF(n.data,!1));NF.encodePacket(n,!0,(o)=>{if(!L0)L0=new TextEncoder;i(L0.encode(o))})}});var yF=u((uF)=>{Object.defineProperty(uF,"__esModule",{value:!0});uF.decodePacket=void 0;var Af=vf(),OX=(n,i)=>{if(typeof n!=="string")return{type:"message",data:hF(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:hF(c,i)}}if(!Af.PACKET_TYPES_REVERSE[o])return Af.ERROR_PACKET;return n.length>1?{type:Af.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:Af.PACKET_TYPES_REVERSE[o]}};uF.decodePacket=OX;var hF=(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=u((Tf)=>{Object.defineProperty(Tf,"__esModule",{value:!0});Tf.decodePayload=Tf.decodePacket=Tf.encodePayload=Tf.encodePacket=Tf.protocol=void 0;Tf.createPacketEncoderStream=VX;Tf.createPacketDecoderStream=_X;var C0=CF();Object.defineProperty(Tf,"encodePacket",{enumerable:!0,get:function(){return C0.encodePacket}});var h0=yF();Object.defineProperty(Tf,"decodePacket",{enumerable:!0,get:function(){return h0.decodePacket}});var kF=vf(),ZF=String.fromCharCode(30),EX=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((x,m)=>{C0.encodePacket(x,!1,(f)=>{if(c[m]=f,++p===o)i(c.join(ZF))})})};Tf.encodePayload=EX;var UX=(n,i)=>{let o=n.split(ZF),c=[];for(let p=0;p<o.length;p++){let x=h0.decodePacket(o[p],i);if(c.push(x),x.type==="error")break}return c};Tf.decodePayload=UX;function VX(){return new TransformStream({transform(n,i){C0.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 N0;function Jf(n){return n.reduce((i,o)=>i+o.length,0)}function wf(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 _X(n,i){if(!N0)N0=new TextDecoder;let o=[],c=0,p=-1,x=!1;return new TransformStream({transform(m,f){o.push(m);while(!0){if(c===0){if(Jf(o)<1)break;let a=wf(o,1);if(x=(a[0]&128)===128,p=a[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(Jf(o)<2)break;let a=wf(o,2);p=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),c=3}else if(c===2){if(Jf(o)<8)break;let a=wf(o,8),$=new DataView(a.buffer,a.byteOffset,a.length),v=$.getUint32(0);if(v>Math.pow(2,21)-1){f.enqueue(kF.ERROR_PACKET);break}p=v*Math.pow(2,32)+$.getUint32(4),c=3}else{if(Jf(o)<p)break;let a=wf(o,p);f.enqueue(h0.decodePacket(x?a:N0.decode(a),i)),c=0}if(p===0||p>n){f.enqueue(kF.ERROR_PACKET);break}}}})}Tf.protocol=4});var tF=u((BD,rF)=>{/*! https://mths.be/utf8js v2.1.2 by @mathias */var mc=String.fromCharCode;function PF(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 DX(n){var i=n.length,o=-1,c,p="";while(++o<i){if(c=n[o],c>65535)c-=65536,p+=mc(c>>>10&1023|55296),c=56320|c&1023;p+=mc(c)}return p}function sF(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 u0(n,i){return mc(n>>i&63|128)}function NX(n,i){if((n&4294967168)==0)return mc(n);var o="";if((n&4294965248)==0)o=mc(n>>6&31|192);else if((n&4294901760)==0){if(!sF(n,i))n=65533;o=mc(n>>12&15|224),o+=u0(n,6)}else if((n&4292870144)==0)o=mc(n>>18&7|240),o+=u0(n,12),o+=u0(n,6);return o+=mc(n&63|128),o}function CX(n,i){i=i||{};var o=i.strict!==!1,c=PF(n),p=c.length,x=-1,m,f="";while(++x<p)m=c[x],f+=NX(m,o);return f}function Rp(){if(fc>=Rf)throw Error("Invalid byte index");var n=Ff[fc]&255;if(fc++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function hX(n){var i,o,c,p,x;if(fc>Rf)throw Error("Invalid byte index");if(fc==Rf)return!1;if(i=Ff[fc]&255,fc++,(i&128)==0)return i;if((i&224)==192)if(o=Rp(),x=(i&31)<<6|o,x>=128)return x;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Rp(),c=Rp(),x=(i&15)<<12|o<<6|c,x>=2048)return sF(x,n)?x:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Rp(),c=Rp(),p=Rp(),x=(i&7)<<18|o<<12|c<<6|p,x>=65536&&x<=1114111)return x}throw Error("Invalid UTF-8 detected")}var Ff,Rf,fc;function uX(n,i){i=i||{};var o=i.strict!==!1;Ff=PF(n),Rf=Ff.length,fc=0;var c=[],p;while((p=hX(o))!==!1)c.push(p);return DX(c)}rF.exports={version:"2.1.2",encode:CX,decode:uX}});var x4=u((p4)=>{Object.defineProperty(p4,"__esModule",{value:!0});p4.packets=p4.protocol=void 0;p4.encodePacket=I0;p4.encodeBase64Packet=eF;p4.decodePacket=y0;p4.decodeBase64Packet=n4;p4.encodePayload=ZX;p4.decodePayload=PX;p4.encodePayloadAsBinary=o4;p4.decodePayloadAsBinary=c4;var dF=tF();p4.protocol=3;var IX=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};p4.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Sp=Object.keys(p4.packets),Ao={type:"error",data:"parser error"},yX=Buffer.concat([]);function I0(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 gF(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return gF({type:n.type,data:k0(n.data)},i,c);var p=p4.packets[n.type];if(n.data!==void 0)p+=o?dF.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function gF(n,i,o){if(!i)return eF(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=p4.packets[n.type],o(Buffer.concat([p,c]))}function eF(n,i){var o=Buffer.isBuffer(n.data)?n.data:k0(n.data),c="b"+p4.packets[n.type];return c+=o.toString("base64"),i(c)}function y0(n,i,o){if(n===void 0)return Ao;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return n4(n.slice(1),i);if(o){if(n=kX(n),n===!1)return Ao}if(Number(c)!=c||!Sp[c])return Ao;if(n.length>1)return{type:Sp[c],data:n.slice(1)};else return{type:Sp[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Sp[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=k0(n);return c=n[0],{type:Sp[c],data:n.slice(1)}}function kX(n){try{n=dF.decode(n,{strict:!1})}catch(i){return!1}return n}function n4(n,i){var o=Sp[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 ZX(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&IX(n))return o4(n,o);if(!n.length)return o("0:");function c(p,x){I0(p,i,!1,function(m){x(null,qX(m))})}i4(n,c,function(p,x){return o(x.join(""))})}function qX(n){return n.length+":"+n}function i4(n,i,o){let c=new Array(n.length),p=0;for(let x=0;x<n.length;x++)i(n[x],(m,f)=>{if(c[x]=f,++p===n.length)o(null,c)})}function PX(n,i,o){if(typeof n!=="string")return c4(n,i,o);if(typeof i==="function")o=i,i=null;if(n==="")return o(Ao,0,1);var c="",p,x,m;for(var f=0,a=n.length;f<a;f++){var $=n.charAt(f);if($!==":"){c+=$;continue}if(c===""||c!=(p=Number(c)))return o(Ao,0,1);if(x=n.slice(f+1,f+1+p),c!=x.length)return o(Ao,0,1);if(x.length){if(m=y0(x,i,!1),Ao.type===m.type&&Ao.data===m.data)return o(Ao,0,1);var v=o(m,f+p,a);if(v===!1)return}f+=p,c=""}if(c!=="")return o(Ao,0,1)}function sX(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 k0(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function o4(n,i){if(!n.length)return i(yX);i4(n,tX,function(o,c){return i(Buffer.concat(c))})}function tX(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]))}I0(n,!0,!0,o)}function c4(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],x;while(c.length>0){var m="",f=c[0]===0;for(x=1;;x++){if(c[x]===255)break;if(m.length>310)return o(Ao,0,1);m+=""+c[x]}c=c.slice(m.length+1);var a=parseInt(m,10),$=c.slice(1,a+1);if(f)$=sX($);p.push($),c=c.slice(a+1)}var v=p.length;for(x=0;x<v;x++){var A=p[x];o(y0(A,i,!0),x,v)}}});var f4=u((bD,m4)=>{var Xp=1000,Kp=Xp*60,Gp=Kp*60,Ec=Gp*24,m5=Ec*7,f5=Ec*365.25;m4.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return a5(n);else if(o==="number"&&isFinite(n))return i.long?v5(n):$5(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function a5(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*f5;case"weeks":case"week":case"w":return o*m5;case"days":case"day":case"d":return o*Ec;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Gp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Kp;case"seconds":case"second":case"secs":case"sec":case"s":return o*Xp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function $5(n){var i=Math.abs(n);if(i>=Ec)return Math.round(n/Ec)+"d";if(i>=Gp)return Math.round(n/Gp)+"h";if(i>=Kp)return Math.round(n/Kp)+"m";if(i>=Xp)return Math.round(n/Xp)+"s";return n+"ms"}function v5(n){var i=Math.abs(n);if(i>=Ec)return Sf(n,i,Ec,"day");if(i>=Gp)return Sf(n,i,Gp,"hour");if(i>=Kp)return Sf(n,i,Kp,"minute");if(i>=Xp)return Sf(n,i,Xp,"second");return n+" ms"}function Sf(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var Z0=u((LD,a4)=>{function A5(n){o.debug=o,o.default=o,o.coerce=a,o.disable=x,o.enable=p,o.enabled=m,o.humanize=f4(),o.destroy=$,Object.keys(n).forEach((v)=>{o[v]=n[v]}),o.names=[],o.skips=[],o.formatters={};function i(v){let A=0;for(let J=0;J<v.length;J++)A=(A<<5)-A+v.charCodeAt(J),A|=0;return o.colors[Math.abs(A)%o.colors.length]}o.selectColor=i;function o(v){let A,J=null,S,W;function R(...K){if(!R.enabled)return;let z=R,M=Number(new Date),h=M-(A||M);if(z.diff=h,z.prev=A,z.curr=M,A=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,(O,Q)=>{if(O==="%%")return"%";G++;let j=o.formatters[Q];if(typeof j==="function"){let y=K[G];O=j.call(z,y),K.splice(G,1),G--}return O}),o.formatArgs.call(z,K),(z.log||o.log).apply(z,K)}if(R.namespace=v,R.useColors=o.useColors(),R.color=o.selectColor(v),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,W=o.enabled(v);return W},set:(K)=>{J=K}}),typeof o.init==="function")o.init(R);return R}function c(v,A){let J=o(this.namespace+(typeof A==="undefined"?":":A)+v);return J.log=this.log,J}function p(v){o.save(v),o.namespaces=v,o.names=[],o.skips=[];let A,J=(typeof v==="string"?v:"").split(/[\s,]+/),S=J.length;for(A=0;A<S;A++){if(!J[A])continue;if(v=J[A].replace(/\*/g,".*?"),v[0]==="-")o.skips.push(new RegExp("^"+v.slice(1)+"$"));else o.names.push(new RegExp("^"+v+"$"))}}function x(){let v=[...o.names.map(f),...o.skips.map(f).map((A)=>"-"+A)].join(",");return o.enable(""),v}function m(v){if(v[v.length-1]==="*")return!0;let A,J;for(A=0,J=o.skips.length;A<J;A++)if(o.skips[A].test(v))return!1;for(A=0,J=o.names.length;A<J;A++)if(o.names[A].test(v))return!0;return!1}function f(v){return v.toString().substring(2,v.toString().length-2).replace(/\.\*\?$/,"*")}function a(v){if(v instanceof Error)return v.stack||v.message;return v}function $(){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}a4.exports=A5});var v4=u(($4,Xf)=>{$4.formatArgs=w5;$4.save=T5;$4.load=F5;$4.useColors=J5;$4.storage=R5();$4.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`.")}})();$4.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 J5(){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 w5(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Xf.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)}$4.log=console.debug||console.log||(()=>{});function T5(n){try{if(n)$4.storage.setItem("debug",n);else $4.storage.removeItem("debug")}catch(i){}}function F5(){let n;try{n=$4.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function R5(){try{return localStorage}catch(n){}}Xf.exports=Z0()($4);var{formatters:S5}=Xf.exports;S5.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var J4=u((ND,A4)=>{A4.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 F4=u((CD,T4)=>{var l5=Kn("os"),w4=Kn("tty"),di=J4(),{env:$i}=process,Kf;if(di("no-color")||di("no-colors")||di("color=false")||di("color=never"))Kf=0;else if(di("color")||di("colors")||di("color=true")||di("color=always"))Kf=1;function H5(){if("FORCE_COLOR"in $i){if($i.FORCE_COLOR==="true")return 1;if($i.FORCE_COLOR==="false")return 0;return $i.FORCE_COLOR.length===0?1:Math.min(Number.parseInt($i.FORCE_COLOR,10),3)}}function Q5(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function O5(n,{streamIsTTY:i,sniffFlags:o=!0}={}){let c=H5();if(c!==void 0)Kf=c;let p=o?Kf:c;if(p===0)return 0;if(o){if(di("color=16m")||di("color=full")||di("color=truecolor"))return 3;if(di("color=256"))return 2}if(n&&!i&&p===void 0)return 0;let x=p||0;if($i.TERM==="dumb")return x;if(process.platform==="win32"){let m=l5.release().split(".");if(Number(m[0])>=10&&Number(m[2])>=10586)return Number(m[2])>=14931?3:2;return 1}if("CI"in $i){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((m)=>(m in $i))||$i.CI_NAME==="codeship")return 1;return x}if("TEAMCITY_VERSION"in $i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($i.TEAMCITY_VERSION)?1:0;if($i.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $i){let m=Number.parseInt(($i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($i.TERM_PROGRAM){case"iTerm.app":return m>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test($i.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($i.TERM))return 1;if("COLORTERM"in $i)return 1;return x}function q0(n,i={}){let o=O5(n,{streamIsTTY:n&&n.isTTY,...i});return Q5(o)}T4.exports={supportsColor:q0,stdout:q0({isTTY:w4.isatty(1)}),stderr:q0({isTTY:w4.isatty(2)})}});var X4=u((S4,Yf)=>{var E5=Kn("tty"),Gf=Kn("util");S4.init=L5;S4.log=B5;S4.formatArgs=V5;S4.save=j5;S4.load=b5;S4.useColors=U5;S4.destroy=Gf.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");S4.colors=[6,2,3,4,5,1];try{let n=F4();if(n&&(n.stderr||n).level>=2)S4.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){}S4.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 U5(){return"colors"in S4.inspectOpts?Boolean(S4.inspectOpts.colors):E5.isatty(process.stderr.fd)}function V5(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 _x=Sn("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,f){o.bytesBuffer=f,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=bF.exports=new jv});var $f=h((DF)=>{Object.defineProperty(DF,"__esModule",{value:!0});DF.ERROR_PACKET=DF.PACKET_TYPES_REVERSE=DF.PACKET_TYPES=void 0;var zo=Object.create(null);DF.PACKET_TYPES=zo;zo.open="0";zo.close="1";zo.ping="2";zo.pong="3";zo.message="4";zo.upgrade="5";zo.noop="6";var LF=Object.create(null);DF.PACKET_TYPES_REVERSE=LF;Object.keys(zo).forEach((n)=>{LF[zo[n]]=n});var G5={type:"error",data:"parser error"};DF.ERROR_PACKET=G5});var uF=h((hF)=>{Object.defineProperty(hF,"__esModule",{value:!0});hF.encodePacket=void 0;hF.encodePacketToBinary=l5;var M5=$f(),z5=({type:n,data:i},o,c)=>{if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))return c(o?i:"b"+CF(i,!0).toString("base64"));return c(M5.PACKET_TYPES[n]+(i||""))};hF.encodePacket=z5;var CF=(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 l5(n,i){if(n.data instanceof ArrayBuffer||ArrayBuffer.isView(n.data))return i(CF(n.data,!1));hF.encodePacket(n,!0,(o)=>{if(!Lv)Lv=new TextEncoder;i(Lv.encode(o))})}});var ZF=h((yF)=>{Object.defineProperty(yF,"__esModule",{value:!0});yF.decodePacket=void 0;var wf=$f(),E5=(n,i)=>{if(typeof n!=="string")return{type:"message",data:IF(n,i)};let o=n.charAt(0);if(o==="b"){let c=Buffer.from(n.substring(1),"base64");return{type:"message",data:IF(c,i)}}if(!wf.PACKET_TYPES_REVERSE[o])return wf.ERROR_PACKET;return n.length>1?{type:wf.PACKET_TYPES_REVERSE[o],data:n.substring(1)}:{type:wf.PACKET_TYPES_REVERSE[o]}};yF.decodePacket=E5;var IF=(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((Tf)=>{Object.defineProperty(Tf,"__esModule",{value:!0});Tf.decodePayload=Tf.decodePacket=Tf.encodePayload=Tf.encodePacket=Tf.protocol=void 0;Tf.createPacketEncoderStream=V5;Tf.createPacketDecoderStream=_5;var Cv=uF();Object.defineProperty(Tf,"encodePacket",{enumerable:!0,get:function(){return Cv.encodePacket}});var hv=ZF();Object.defineProperty(Tf,"decodePacket",{enumerable:!0,get:function(){return hv.decodePacket}});var qF=$f(),PF=String.fromCharCode(30),O5=(n,i)=>{let o=n.length,c=new Array(o),p=0;n.forEach((x,m)=>{Cv.encodePacket(x,!1,(f)=>{if(c[m]=f,++p===o)i(c.join(PF))})})};Tf.encodePayload=O5;var U5=(n,i)=>{let o=n.split(PF),c=[];for(let p=0;p<o.length;p++){let x=hv.decodePacket(o[p],i);if(c.push(x),x.type==="error")break}return c};Tf.decodePayload=U5;function V5(){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 Nv;function Jf(n){return n.reduce((i,o)=>i+o.length,0)}function Af(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 _5(n,i){if(!Nv)Nv=new TextDecoder;let o=[],c=0,p=-1,x=!1;return new TransformStream({transform(m,f){o.push(m);while(!0){if(c===0){if(Jf(o)<1)break;let a=Af(o,1);if(x=(a[0]&128)===128,p=a[0]&127,p<126)c=3;else if(p===126)c=1;else c=2}else if(c===1){if(Jf(o)<2)break;let a=Af(o,2);p=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),c=3}else if(c===2){if(Jf(o)<8)break;let a=Af(o,8),v=new DataView(a.buffer,a.byteOffset,a.length),$=v.getUint32(0);if($>Math.pow(2,21)-1){f.enqueue(qF.ERROR_PACKET);break}p=$*Math.pow(2,32)+v.getUint32(4),c=3}else{if(Jf(o)<p)break;let a=Af(o,p);f.enqueue(hv.decodePacket(x?a:Nv.decode(a),i)),c=0}if(p===0||p>n){f.enqueue(qF.ERROR_PACKET);break}}}})}Tf.protocol=4});var dF=h((ZD,gF)=>{/*! 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 D5(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 tF(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 uv(n,i){return oc(n>>i&63|128)}function N5(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(!tF(n,i))n=65533;o=oc(n>>12&15|224),o+=uv(n,6)}else if((n&4292870144)==0)o=oc(n>>18&7|240),o+=uv(n,12),o+=uv(n,6);return o+=oc(n&63|128),o}function C5(n,i){i=i||{};var o=i.strict!==!1,c=rF(n),p=c.length,x=-1,m,f="";while(++x<p)m=c[x],f+=N5(m,o);return f}function Wp(){if(cc>=Rf)throw Error("Invalid byte index");var n=Ff[cc]&255;if(cc++,(n&192)==128)return n&63;throw Error("Invalid continuation byte")}function h5(n){var i,o,c,p,x;if(cc>Rf)throw Error("Invalid byte index");if(cc==Rf)return!1;if(i=Ff[cc]&255,cc++,(i&128)==0)return i;if((i&224)==192)if(o=Wp(),x=(i&31)<<6|o,x>=128)return x;else throw Error("Invalid continuation byte");if((i&240)==224)if(o=Wp(),c=Wp(),x=(i&15)<<12|o<<6|c,x>=2048)return tF(x,n)?x:65533;else throw Error("Invalid continuation byte");if((i&248)==240){if(o=Wp(),c=Wp(),p=Wp(),x=(i&7)<<18|o<<12|c<<6|p,x>=65536&&x<=1114111)return x}throw Error("Invalid UTF-8 detected")}var Ff,Rf,cc;function u5(n,i){i=i||{};var o=i.strict!==!1;Ff=rF(n),Rf=Ff.length,cc=0;var c=[],p;while((p=h5(o))!==!1)c.push(p);return D5(c)}gF.exports={version:"2.1.2",encode:C5,decode:u5}});var f4=h((m4)=>{Object.defineProperty(m4,"__esModule",{value:!0});m4.packets=m4.protocol=void 0;m4.encodePacket=Iv;m4.encodeBase64Packet=i4;m4.decodePacket=yv;m4.decodeBase64Packet=o4;m4.encodePayload=Z5;m4.decodePayload=P5;m4.encodePayloadAsBinary=p4;m4.decodePayloadAsBinary=x4;var n4=dF();m4.protocol=3;var I5=(n)=>{for(let i of n)if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return!0;return!1};m4.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Kp=Object.keys(m4.packets),vo={type:"error",data:"parser error"},y5=Buffer.concat([]);function Iv(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 eF(n,i,c);else if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return eF({type:n.type,data:kv(n.data)},i,c);var p=m4.packets[n.type];if(n.data!==void 0)p+=o?n4.encode(String(n.data),{strict:!1}):String(n.data);return c(""+p)}function eF(n,i,o){if(!i)return i4(n,o);var c=n.data,p=Buffer.allocUnsafe(1);return p[0]=m4.packets[n.type],o(Buffer.concat([p,c]))}function i4(n,i){var o=Buffer.isBuffer(n.data)?n.data:kv(n.data),c="b"+m4.packets[n.type];return c+=o.toString("base64"),i(c)}function yv(n,i,o){if(n===void 0)return vo;var c;if(typeof n==="string"){if(c=n.charAt(0),c==="b")return o4(n.slice(1),i);if(o){if(n=k5(n),n===!1)return vo}if(Number(c)!=c||!Kp[c])return vo;if(n.length>1)return{type:Kp[c],data:n.slice(1)};else return{type:Kp[c]}}if(i==="arraybuffer"){var p=new Uint8Array(n);return c=p[0],{type:Kp[c],data:p.buffer.slice(1)}}if(n instanceof ArrayBuffer)n=kv(n);return c=n[0],{type:Kp[c],data:n.slice(1)}}function k5(n){try{n=n4.decode(n,{strict:!1})}catch(i){return!1}return n}function o4(n,i){var o=Kp[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 Z5(n,i,o){if(typeof i==="function")o=i,i=null;if(i&&I5(n))return p4(n,o);if(!n.length)return o("0:");function c(p,x){Iv(p,i,!1,function(m){x(null,q5(m))})}c4(n,c,function(p,x){return o(x.join(""))})}function q5(n){return n.length+":"+n}function c4(n,i,o){let c=new Array(n.length),p=0;for(let x=0;x<n.length;x++)i(n[x],(m,f)=>{if(c[x]=f,++p===n.length)o(null,c)})}function P5(n,i,o){if(typeof n!=="string")return x4(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 f=0,a=n.length;f<a;f++){var v=n.charAt(f);if(v!==":"){c+=v;continue}if(c===""||c!=(p=Number(c)))return o(vo,0,1);if(x=n.slice(f+1,f+1+p),c!=x.length)return o(vo,0,1);if(x.length){if(m=yv(x,i,!1),vo.type===m.type&&vo.data===m.data)return o(vo,0,1);var $=o(m,f+p,a);if($===!1)return}f+=p,c=""}if(c!=="")return o(vo,0,1)}function s5(n){var i="";for(var o=0,c=n.length;o<c;o++)i+=String.fromCharCode(n[o]);return i}function r5(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 kv(n){var i=n.byteLength||n.length,o=n.byteOffset||0;return Buffer.from(n.buffer||n,o,i)}function p4(n,i){if(!n.length)return i(y5);c4(n,t5,function(o,c){return i(Buffer.concat(c))})}function t5(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,r5(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]))}Iv(n,!0,!0,o)}function x4(n,i,o){if(typeof i==="function")o=i,i=null;var c=n,p=[],x;while(c.length>0){var m="",f=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 a=parseInt(m,10),v=c.slice(1,a+1);if(f)v=s5(v);p.push(v),c=c.slice(a+1)}var $=p.length;for(x=0;x<$;x++){var w=p[x];o(yv(w,i,!0),x,$)}}});var v4=h((PD,a4)=>{var Gp=1000,Yp=Gp*60,Hp=Yp*60,Uc=Hp*24,mK=Uc*7,fK=Uc*365.25;a4.exports=function(n,i){i=i||{};var o=typeof n;if(o==="string"&&n.length>0)return aK(n);else if(o==="number"&&isFinite(n))return i.long?$K(n):vK(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function aK(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*mK;case"days":case"day":case"d":return o*Uc;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Hp;case"minutes":case"minute":case"mins":case"min":case"m":return o*Yp;case"seconds":case"second":case"secs":case"sec":case"s":return o*Gp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}function vK(n){var i=Math.abs(n);if(i>=Uc)return Math.round(n/Uc)+"d";if(i>=Hp)return Math.round(n/Hp)+"h";if(i>=Yp)return Math.round(n/Yp)+"m";if(i>=Gp)return Math.round(n/Gp)+"s";return n+"ms"}function $K(n){var i=Math.abs(n);if(i>=Uc)return Xf(n,i,Uc,"day");if(i>=Hp)return Xf(n,i,Hp,"hour");if(i>=Yp)return Xf(n,i,Yp,"minute");if(i>=Gp)return Xf(n,i,Gp,"second");return n+" ms"}function Xf(n,i,o,c){var p=i>=o*1.5;return Math.round(n/o)+" "+c+(p?"s":"")}});var Zv=h((sD,$4)=>{function wK(n){o.debug=o,o.default=o,o.coerce=a,o.disable=x,o.enable=p,o.enabled=m,o.humanize=v4(),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,X,W;function R(...S){if(!R.enabled)return;let H=R,M=Number(new Date),I=M-(w||M);if(H.diff=I,H.prev=w,H.curr=M,w=M,S[0]=o.coerce(S[0]),typeof S[0]!=="string")S.unshift("%O");let Y=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(E,Q)=>{if(E==="%%")return"%";Y++;let j=o.formatters[Q];if(typeof j==="function"){let y=S[Y];E=j.call(H,y),S.splice(Y,1),Y--}return E}),o.formatArgs.call(H,S),(H.log||o.log).apply(H,S)}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(X!==o.namespaces)X=o.namespaces,W=o.enabled($);return W},set:(S)=>{J=S}}),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,]+/),X=J.length;for(w=0;w<X;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(f),...o.skips.map(f).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 f($){return $.toString().substring(2,$.toString().length-2).replace(/\.\*\?$/,"*")}function a($){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}$4.exports=wK});var J4=h((w4,Kf)=>{w4.formatArgs=AK;w4.save=TK;w4.load=FK;w4.useColors=JK;w4.storage=RK();w4.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`.")}})();w4.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 JK(){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 AK(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Kf.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)}w4.log=console.debug||console.log||(()=>{});function TK(n){try{if(n)w4.storage.setItem("debug",n);else w4.storage.removeItem("debug")}catch(i){}}function FK(){let n;try{n=w4.storage.getItem("debug")}catch(i){}if(!n&&typeof process!=="undefined"&&"env"in process)n=process.env.DEBUG;return n}function RK(){try{return localStorage}catch(n){}}Kf.exports=Zv()(w4);var{formatters:XK}=Kf.exports;XK.j=function(n){try{return JSON.stringify(n)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}});var T4=h((tD,A4)=>{A4.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 X4=h((gD,R4)=>{var zK=Sn("os"),F4=Sn("tty"),gi=T4(),{env:ai}=process,Sf;if(gi("no-color")||gi("no-colors")||gi("color=false")||gi("color=never"))Sf=0;else if(gi("color")||gi("colors")||gi("color=true")||gi("color=always"))Sf=1;function lK(){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 QK(n){if(n===0)return!1;return{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function EK(n,{streamIsTTY:i,sniffFlags:o=!0}={}){let c=lK();if(c!==void 0)Sf=c;let p=o?Sf: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=EK(n,{streamIsTTY:n&&n.isTTY,...i});return QK(o)}R4.exports={supportsColor:qv,stdout:qv({isTTY:F4.isatty(1)}),stderr:qv({isTTY:F4.isatty(2)})}});var G4=h((K4,Yf)=>{var OK=Sn("tty"),Gf=Sn("util");K4.init=LK;K4.log=BK;K4.formatArgs=VK;K4.save=jK;K4.load=bK;K4.useColors=UK;K4.destroy=Gf.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=X4();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 UK(){return"colors"in K4.inspectOpts?Boolean(K4.inspectOpts.colors):OK.isatty(process.stderr.fd)}function VK(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+"+Yf.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=
|
|
31
|
-
`)}function
|
|
32
|
-
`).map((i)=>i.trim()).join(" ")};
|
|
33
|
-
`}),super.onData(n.replace(
|
|
30
|
+
`+x),n.push(p+"m+"+Yf.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=_K()+i+" "+n[0]}function _K(){if(K4.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function BK(...n){return process.stderr.write(Gf.formatWithOptions(K4.inspectOpts,...n)+`
|
|
31
|
+
`)}function jK(n){if(n)process.env.DEBUG=n;else delete process.env.DEBUG}function bK(){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]]}Yf.exports=Zv()(K4);var{formatters:W4}=Yf.exports;W4.o=function(n){return this.inspectOpts.colors=this.useColors,Gf.inspect(n,this.inspectOpts).split(`
|
|
32
|
+
`).map((i)=>i.trim()).join(" ")};W4.O=function(n){return this.inspectOpts.colors=this.useColors,Gf.inspect(n,this.inspectOpts)}});var vi=h((eD,Pv)=>{if(typeof process==="undefined"||process.type==="renderer"||!1||process.__nwjs)Pv.exports=J4();else Pv.exports=G4()});var _c=h((M4)=>{Object.defineProperty(M4,"__esModule",{value:!0});M4.Transport=void 0;var kK=Sn("events"),ZK=Bx(),qK=f4(),PK=vi(),Y4=PK.default("engine:transport");function sK(){}class H4 extends kK.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?ZK: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||sK)}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")}}M4.Transport=H4});var sv=h((E4)=>{Object.defineProperty(E4,"__esModule",{value:!0});E4.Polling=void 0;var rK=_c(),l4=Sn("zlib"),tK=vf(),gK=vi(),hi=gK.default("engine:polling"),dK={gzip:l4.createGzip,deflate:l4.createDeflate};class Q4 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",f),n.removeListener("close",x),this.dataReq=this.dataRes=c=null},x=()=>{p(),this.onError("data request connection closed prematurely")},m=(a)=>{let v;if(o)c=Buffer.concat([c,a]),v=c.length;else c+=a,v=Buffer.byteLength(c);if(v>this.maxHttpBufferSize)i.writeHead(413).end(),p()},f=()=>{this.onData(c);let a={"Content-Type":"text/html","Content-Length":"2"};i.writeHead(200,this.headers(n,a)),i.end("ok"),p()};if(n.on("close",x),!o)n.setEncoding("utf8");n.on("data",m),n.on("end",f)}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 a=tK(this.req).encodings(["gzip","deflate"]);if(!a){m(n);return}this.compress(n,a,(v,$)=>{if(v){this.res.writeHead(500),this.res.end(),o(v);return}x["Content-Encoding"]=a,m($)})}compress(n,i,o){hi("compressing");let c=[],p=0;dK[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}}E4.Polling=Q4});var B4=h((V4)=>{Object.defineProperty(V4,"__esModule",{value:!0});V4.JSONP=void 0;var eK=sv(),nS=Sn("querystring"),iS=/\\\\n/g,oS=/(\\)?\\n/g;class U4 extends eK.Polling{constructor(n){super(n);this.head="___eio["+(n._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(n){if(n=nS.parse(n).d,typeof n==="string")n=n.replace(oS,function(i,o){return o?i:`
|
|
33
|
+
`}),super.onData(n.replace(iS,"\\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)}}V4.JSONP=U4});var N4=h((L4)=>{Object.defineProperty(L4,"__esModule",{value:!0});L4.WebSocket=void 0;var cS=_c(),pS=vi(),j4=pS.default("engine:ws");class b4 extends cS.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=b4});var rv=h((h4)=>{Object.defineProperty(h4,"__esModule",{value:!0});h4.WebTransport=void 0;var xS=_c(),mS=vi(),fS=Bx(),Mp=mS.default("engine:webtransport");class C4 extends xS.Transport{constructor(n,i,o){super({_query:{EIO:"4"}});this.session=n;let c=fS.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()}}h4.WebTransport=C4});var tv=h((y4)=>{Object.defineProperty(y4,"__esModule",{value:!0});var aS=sv(),vS=B4(),$S=N4(),wS=rv();y4.default={polling:I4,websocket:$S.WebSocket,webtransport:wS.WebTransport};function I4(n){if(typeof n._query.j==="string")return new vS.JSONP(n);else return new aS.Polling(n)}I4.upgradesTo=["websocket","webtransport"]});var gv=h((Z4)=>{Object.defineProperty(Z4,"__esModule",{value:!0});Z4.Socket=void 0;var AS=Sn("events"),TS=vi(),jo=Sn("timers"),Zn=TS.default("engine:socket");class k4 extends AS.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"),jo.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=jo.setTimeout(()=>{Zn("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){jo.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=jo.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=jo.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),jo.clearTimeout(i),n.removeListener("packet",c),n.removeListener("close",f),n.removeListener("error",m),this.removeListener("close",a)},m=(v)=>{Zn("client did not complete upgrade - %s",v),x(),n.close(),n=null},f=()=>{m("transport closed")},a=()=>{m("socket closed")};n.on("packet",c),n.once("close",f),n.once("error",m),this.once("close",a)}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(),jo.clearTimeout(this.pingTimeoutTimer)}onClose(n,i){if(this.readyState!=="closed")this.readyState="closed",jo.clearTimeout(this.pingIntervalTimer),jo.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"))}}Z4.Socket=k4});var r4=h((lS)=>{/*!
|
|
34
34
|
* cookie
|
|
35
35
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|
36
36
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
37
37
|
* MIT Licensed
|
|
38
|
-
*/
|
|
38
|
+
*/lS.parse=GS;lS.serialize=YS;var FS=Object.prototype.toString,RS=Object.prototype.hasOwnProperty,XS=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,WS=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,KS=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,SS=/^[\u0020-\u003A\u003D-\u007E]*$/;function GS(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||HS,x=0,m=0,f=0;do{if(m=n.indexOf("=",x),m===-1)break;if(f=n.indexOf(";",x),f===-1)f=c;else if(m>f){x=n.lastIndexOf(";",m-1)+1;continue}var a=P4(n,x,m),v=s4(n,m,a),$=n.slice(a,v);if(!RS.call(o,$)){var w=P4(n,m+1,f),J=s4(n,f,w);if(n.charCodeAt(w)===34&&n.charCodeAt(J-1)===34)w++,J--;var X=n.slice(w,J);o[$]=zS(X,p)}x=f+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 s4(n,i,o){while(i>o){var c=n.charCodeAt(--i);if(c!==32&&c!==9)return i+1}return o}function YS(n,i,o){var c=o&&o.encode||encodeURIComponent;if(typeof c!=="function")throw new TypeError("option encode is invalid");if(!XS.test(n))throw new TypeError("argument name is invalid");var p=c(i);if(!WS.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(!KS.test(o.domain))throw new TypeError("option domain is invalid");x+="; Domain="+o.domain}if(o.path){if(!SS.test(o.path))throw new TypeError("option path is invalid");x+="; Path="+o.path}if(o.expires){var f=o.expires;if(!MS(f)||isNaN(f.valueOf()))throw new TypeError("option expires is invalid");x+="; Expires="+f.toUTCString()}if(o.httpOnly)x+="; HttpOnly";if(o.secure)x+="; Secure";if(o.partitioned)x+="; Partitioned";if(o.priority){var a=typeof o.priority==="string"?o.priority.toLowerCase():o.priority;switch(a){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 HS(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function MS(n){return FS.call(n)==="[object Date]"}function zS(n,i){try{return i(n)}catch(o){return n}}});var d4=h((aN,g4)=>{var t4=Object.getOwnPropertySymbols,OS=Object.prototype.hasOwnProperty,US=Object.prototype.propertyIsEnumerable;function VS(n){if(n===null||n===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function _S(){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}}g4.exports=_S()?Object.assign:function(n,i){var o,c=VS(n),p;for(var x=1;x<arguments.length;x++){o=Object(arguments[x]);for(var m in o)if(OS.call(o,m))c[m]=o[m];if(t4){p=t4(o);for(var f=0;f<p.length;f++)if(US.call(o,p[f]))c[p[f]]=o[p[f]]}}return c}});var i8=h((vN,dv)=>{/*!
|
|
39
39
|
* vary
|
|
40
40
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
41
41
|
* MIT Licensed
|
|
42
|
-
*/d0.exports=jK;d0.exports.append=d4;var BK=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function d4(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)?g4(String(i)):i;for(var c=0;c<o.length;c++)if(!BK.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,x=g4(n.toLowerCase());if(o.indexOf("*")!==-1||x.indexOf("*")!==-1)return"*";for(var m=0;m<o.length;m++){var f=o[m].toLowerCase();if(x.indexOf(f)===-1)x.push(f),p=p?p+", "+o[m]:o[m]}return p}function g4(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 jK(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=d4(c,i))n.setHeader("Vary",o)}});var e0=u((dD,n8)=>{(function(){var n=t4(),i=e4(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(W){return typeof W==="string"||W instanceof String}function p(W,R){if(Array.isArray(R)){for(var K=0;K<R.length;++K)if(p(W,R[K]))return!0;return!1}else if(c(R))return W===R;else if(R instanceof RegExp)return R.test(W);else return!!R}function x(W,R){var K=R.headers.origin,z=[],M;if(!W.origin||W.origin==="*")z.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(W.origin))z.push([{key:"Access-Control-Allow-Origin",value:W.origin}]),z.push([{key:"Vary",value:"Origin"}]);else M=p(K,W.origin),z.push([{key:"Access-Control-Allow-Origin",value:M?K:!1}]),z.push([{key:"Vary",value:"Origin"}]);return z}function m(W){var R=W.methods;if(R.join)R=W.methods.join(",");return{key:"Access-Control-Allow-Methods",value:R}}function f(W){if(W.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function a(W,R){var K=W.allowedHeaders||W.headers,z=[];if(!K)K=R.headers["access-control-request-headers"],z.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(K.join)K=K.join(",");if(K&&K.length)z.push([{key:"Access-Control-Allow-Headers",value:K}]);return z}function $(W){var R=W.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 v(W){var R=(typeof W.maxAge==="number"||W.maxAge)&&W.maxAge.toString();if(R&&R.length)return{key:"Access-Control-Max-Age",value:R};return null}function A(W,R){for(var K=0,z=W.length;K<z;K++){var M=W[K];if(M){if(Array.isArray(M))A(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(W,R,K,z){var M=[],h=R.method&&R.method.toUpperCase&&R.method.toUpperCase();if(h==="OPTIONS")if(M.push(x(W,R)),M.push(f(W,R)),M.push(m(W,R)),M.push(a(W,R)),M.push(v(W,R)),M.push($(W,R)),A(M,K),W.preflightContinue)z();else K.statusCode=W.optionsSuccessStatus,K.setHeader("Content-Length","0"),K.end();else M.push(x(W,R)),M.push(f(W,R)),M.push($(W,R)),A(M,K),z()}function S(W){var R=null;if(typeof W==="function")R=W;else R=function(K,z){z(null,W)};return function K(z,M,h){R(z,function(G,H){if(G)h(G);else{var O=n({},o,H),Q=null;if(O.origin&&typeof O.origin==="function")Q=O.origin;else if(O.origin)Q=function(j,y){y(null,O.origin)};if(Q)Q(z.headers.origin,function(j,y){if(j||!y)h(j);else O.origin=y,J(O,z,M,h)});else h()}})}}n8.exports=S})()});var n$=u((f8)=>{Object.defineProperty(f8,"__esModule",{value:!0});f8.Server=f8.BaseServer=void 0;var bK=Kn("querystring"),LK=Kn("url"),i8=b0(),zf=t0(),DK=Kn("events"),o8=g0(),NK=vi(),CK=P4(),hK=Kn("ws"),c8=r0(),uK=Bx(),mn=NK.default("engine"),zp=Symbol("responseHeaders");function IK(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class bx extends DK.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:hK.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(e0()(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 zf.default[n].upgradesTo||[]}verify(n,i,o){let c=n._query.transport;if(!~this.opts.transports.indexOf(c)||c==="webtransport")return mn('unknown transport "%s"',c),o(ln.errors.UNKNOWN_TRANSPORT,{transport:c});if(yK(n.headers.origin)){let m=n.headers.origin;return n.headers.origin=null,mn("origin header invalid"),o(ln.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:m})}let x=n._query.sid;if(x){if(!this.clients.hasOwnProperty(x))return mn('unknown sid "%s"',x),o(ln.errors.UNKNOWN_SID,{sid:x});let m=this.clients[x].transport.name;if(!i&&m!==c)return mn("bad request: unexpected transport without upgrade"),o(ln.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:c,previousTransport:m})}else{if(n.method!=="GET")return o(ln.errors.BAD_HANDSHAKE_METHOD,{method:n.method});if(c==="websocket"&&!i)return mn("invalid transport upgrade"),o(ln.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(m,f)=>{if(!f)return o(ln.errors.FORBIDDEN,{message:m});o()})}o()}use(n){this.middlewares.push(n)}_applyMiddlewares(n,i,o){if(this.middlewares.length===0)return mn("no middleware to apply, skipping"),o();let c=(p)=>{mn("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(){mn("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 i8.generateId()}async handshake(n,i,o){let c=i._query.EIO==="4"?4:3;if(c===3&&!this.opts.allowEIO3){mn("unsupported protocol version"),this.emit("connection_error",{req:i,code:ln.errors.UNSUPPORTED_PROTOCOL_VERSION,message:ln.errorMessages[ln.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:c}}),o(ln.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let p;try{p=await this.generateId(i)}catch(f){mn("error while generating an id"),this.emit("connection_error",{req:i,code:ln.errors.BAD_REQUEST,message:ln.errorMessages[ln.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:f}}),o(ln.errors.BAD_REQUEST);return}mn('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(f){mn('error handshaking to transport "%s"',n),this.emit("connection_error",{req:i,code:ln.errors.BAD_REQUEST,message:ln.errorMessages[ln.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:f}}),o(ln.errors.BAD_REQUEST);return}let m=new o8.Socket(p,this,x,i,c);return x.on("headers",(f,a)=>{if(!a._query.sid){if(this.opts.cookie)f["Set-Cookie"]=[CK.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",f,a)}this.emit("headers",f,a)}),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(()=>{mn("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){mn("session is closed");return}let p=c.value,x=uK.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),m=p.readable.pipeThrough(x).getReader(),{value:f,done:a}=await m.read();if(a){mn("stream is closed");return}if(clearTimeout(i),f.type!=="open")return mn("invalid WebTransport handshake"),n.close();if(f.data===void 0){let A=new c8.WebTransport(n,p,m),J=i8.generateId();mn('handshaking client "%s" (WebTransport)',J);let S=new o8.Socket(J,this,A,null,4);this.clients[J]=S,this.clientsCount++,S.once("close",()=>{delete this.clients[J],this.clientsCount--}),this.emit("connection",S);return}let $=IK(f.data);if(!$)return mn("invalid WebTransport handshake"),n.close();let v=this.clients[$];if(!v)mn("upgrade attempt for closed client"),n.close();else if(v.upgrading)mn("transport has already been trying to upgrade"),n.close();else if(v.upgraded)mn("transport had already been upgraded"),n.close();else{mn("upgrading existing transport");let A=new c8.WebTransport(n,p,m);v._maybeUpgrade(A)}}}f8.BaseServer=bx;bx.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};bx.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class m8{constructor(n,i){this.req=n,this.socket=i,n[zp]={}}setHeader(n,i){this.req[zp][n]=i}getHeader(n){return this.req[zp][n]}removeHeader(n){delete this.req[zp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class ln extends bx{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[zp]||{};if(delete i[zp],!i._query.sid)this.emit("initial_headers",o,i);this.emit("headers",o,i),mn("writing headers: %j",o),Object.keys(o).forEach((p)=>{n.push(`${p}: ${o[p]}`)})})}cleanup(){if(this.ws)mn("closing webSocketServer"),this.ws.close()}prepare(n){if(!n._query)n._query=~n.url.indexOf("?")?bK.parse(LK.parse(n.url).query):{}}createTransport(n,i){return new zf.default[n](i)}handleRequest(n,i){mn('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:ln.errorMessages[c],context:p}),p8(i,c,p);return}if(n._query.sid)mn("setting new request for existing client"),this.clients[n._query.sid].transport.onRequest(n);else{let x=(m,f)=>p8(i,m,f);this.handshake(n._query.transport,n,x)}};this._applyMiddlewares(n,i,(c)=>{if(c)o(ln.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!1,o)})}handleUpgrade(n,i,o){this.prepare(n);let c=new m8(n,i),p=(x,m)=>{if(x!==void 0){this.emit("connection_error",{req:n,code:x,message:ln.errorMessages[x],context:m}),x8(i,x,m);return}let f=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,f,(a)=>{this.onWebSocket(n,i,a)})};this._applyMiddlewares(n,c,(x)=>{if(x)p(ln.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),zf.default[n._query.transport]!==void 0&&!zf.default[n._query.transport].prototype.handlesUpgrades){mn("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)mn("upgrade attempt for closed client"),o.close();else if(x.upgrading)mn("transport has already been trying to upgrade"),o.close();else if(x.upgraded)mn("transport had already been upgraded"),o.close();else{mn("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,f)=>x8(i,m,f);this.handshake(n._query.transport,n,x)}function p(){mn("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,f)=>{if(p(m))mn('intercepting request for path "%s"',o),this.handleRequest(m,f);else{let a=0,$=x.length;for(;a<$;a++)x[a].call(n,m,f)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(m,f,a)=>{if(p(m))this.handleUpgrade(m,f,a);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(f.writable&&f.bytesWritten<=0)return f.on("error",($)=>{mn("error while destroying upgrade: %s",$.message)}),f.end()},c)})}}f8.Server=ln;function p8(n,i,o){let c=i===ln.errors.FORBIDDEN?403:400,p=o&&o.message?o.message:ln.errorMessages[i];n.writeHead(c,{"Content-Type":"application/json"}),n.end(JSON.stringify({code:i,message:p}))}function x8(n,i,o={}){if(n.on("error",()=>{mn("ignoring error from closed connection")}),n.writable){let c=o.message||ln.errorMessages[i],p=Buffer.byteLength(c);n.write(`HTTP/1.1 400 Bad Request\r
|
|
42
|
+
*/dv.exports=jS;dv.exports.append=n8;var BS=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function n8(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)?e4(String(i)):i;for(var c=0;c<o.length;c++)if(!BS.test(o[c]))throw new TypeError("field argument contains an invalid header name");if(n==="*")return n;var p=n,x=e4(n.toLowerCase());if(o.indexOf("*")!==-1||x.indexOf("*")!==-1)return"*";for(var m=0;m<o.length;m++){var f=o[m].toLowerCase();if(x.indexOf(f)===-1)x.push(f),p=p?p+", "+o[m]:o[m]}return p}function e4(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 jS(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=n8(c,i))n.setHeader("Vary",o)}});var ev=h(($N,o8)=>{(function(){var n=d4(),i=i8(),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function c(W){return typeof W==="string"||W instanceof String}function p(W,R){if(Array.isArray(R)){for(var S=0;S<R.length;++S)if(p(W,R[S]))return!0;return!1}else if(c(R))return W===R;else if(R instanceof RegExp)return R.test(W);else return!!R}function x(W,R){var S=R.headers.origin,H=[],M;if(!W.origin||W.origin==="*")H.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(c(W.origin))H.push([{key:"Access-Control-Allow-Origin",value:W.origin}]),H.push([{key:"Vary",value:"Origin"}]);else M=p(S,W.origin),H.push([{key:"Access-Control-Allow-Origin",value:M?S:!1}]),H.push([{key:"Vary",value:"Origin"}]);return H}function m(W){var R=W.methods;if(R.join)R=W.methods.join(",");return{key:"Access-Control-Allow-Methods",value:R}}function f(W){if(W.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function a(W,R){var S=W.allowedHeaders||W.headers,H=[];if(!S)S=R.headers["access-control-request-headers"],H.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(S.join)S=S.join(",");if(S&&S.length)H.push([{key:"Access-Control-Allow-Headers",value:S}]);return H}function v(W){var R=W.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 $(W){var R=(typeof W.maxAge==="number"||W.maxAge)&&W.maxAge.toString();if(R&&R.length)return{key:"Access-Control-Max-Age",value:R};return null}function w(W,R){for(var S=0,H=W.length;S<H;S++){var M=W[S];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(W,R,S,H){var M=[],I=R.method&&R.method.toUpperCase&&R.method.toUpperCase();if(I==="OPTIONS")if(M.push(x(W,R)),M.push(f(W,R)),M.push(m(W,R)),M.push(a(W,R)),M.push($(W,R)),M.push(v(W,R)),w(M,S),W.preflightContinue)H();else S.statusCode=W.optionsSuccessStatus,S.setHeader("Content-Length","0"),S.end();else M.push(x(W,R)),M.push(f(W,R)),M.push(v(W,R)),w(M,S),H()}function X(W){var R=null;if(typeof W==="function")R=W;else R=function(S,H){H(null,W)};return function S(H,M,I){R(H,function(Y,l){if(Y)I(Y);else{var E=n({},o,l),Q=null;if(E.origin&&typeof E.origin==="function")Q=E.origin;else if(E.origin)Q=function(j,y){y(null,E.origin)};if(Q)Q(H.headers.origin,function(j,y){if(j||!y)I(j);else E.origin=y,J(E,H,M,I)});else I()}})}}o8.exports=X})()});var n0=h((v8)=>{Object.defineProperty(v8,"__esModule",{value:!0});v8.Server=v8.BaseServer=void 0;var bS=Sn("querystring"),LS=Sn("url"),c8=bv(),Hf=tv(),DS=Sn("events"),p8=gv(),NS=vi(),CS=r4(),hS=Sn("ws"),x8=rv(),uS=Bx(),xn=NS.default("engine"),zp=Symbol("responseHeaders");function IS(n){try{let i=JSON.parse(n);if(typeof i.sid==="string")return i.sid}catch(i){}}class bx extends DS.EventEmitter{constructor(n={}){super();if(this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:hS.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(ev()(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 Hf.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(ln.errors.UNKNOWN_TRANSPORT,{transport:c});if(yS(n.headers.origin)){let m=n.headers.origin;return n.headers.origin=null,xn("origin header invalid"),o(ln.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(ln.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(ln.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:c,previousTransport:m})}else{if(n.method!=="GET")return o(ln.errors.BAD_HANDSHAKE_METHOD,{method:n.method});if(c==="websocket"&&!i)return xn("invalid transport upgrade"),o(ln.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"});if(!this.opts.allowRequest)return o();return this.opts.allowRequest(n,(m,f)=>{if(!f)return o(ln.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 c8.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:ln.errors.UNSUPPORTED_PROTOCOL_VERSION,message:ln.errorMessages[ln.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:c}}),o(ln.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let p;try{p=await this.generateId(i)}catch(f){xn("error while generating an id"),this.emit("connection_error",{req:i,code:ln.errors.BAD_REQUEST,message:ln.errorMessages[ln.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:f}}),o(ln.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(f){xn('error handshaking to transport "%s"',n),this.emit("connection_error",{req:i,code:ln.errors.BAD_REQUEST,message:ln.errorMessages[ln.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:f}}),o(ln.errors.BAD_REQUEST);return}let m=new p8.Socket(p,this,x,i,c);return x.on("headers",(f,a)=>{if(!a._query.sid){if(this.opts.cookie)f["Set-Cookie"]=[CS.serialize(this.opts.cookie.name,p,this.opts.cookie)];this.emit("initial_headers",f,a)}this.emit("headers",f,a)}),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=uS.createPacketDecoderStream(this.opts.maxHttpBufferSize,"nodebuffer"),m=p.readable.pipeThrough(x).getReader(),{value:f,done:a}=await m.read();if(a){xn("stream is closed");return}if(clearTimeout(i),f.type!=="open")return xn("invalid WebTransport handshake"),n.close();if(f.data===void 0){let w=new x8.WebTransport(n,p,m),J=c8.generateId();xn('handshaking client "%s" (WebTransport)',J);let X=new p8.Socket(J,this,w,null,4);this.clients[J]=X,this.clientsCount++,X.once("close",()=>{delete this.clients[J],this.clientsCount--}),this.emit("connection",X);return}let v=IS(f.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 x8.WebTransport(n,p,m);$._maybeUpgrade(w)}}}v8.BaseServer=bx;bx.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};bx.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class a8{constructor(n,i){this.req=n,this.socket=i,n[zp]={}}setHeader(n,i){this.req[zp][n]=i}getHeader(n){return this.req[zp][n]}removeHeader(n){delete this.req[zp][n]}write(){}writeHead(){}end(){this.socket.destroy()}}class ln extends bx{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[zp]||{};if(delete i[zp],!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("?")?bS.parse(LS.parse(n.url).query):{}}createTransport(n,i){return new Hf.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:ln.errorMessages[c],context:p}),m8(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,f)=>m8(i,m,f);this.handshake(n._query.transport,n,x)}};this._applyMiddlewares(n,i,(c)=>{if(c)o(ln.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!1,o)})}handleUpgrade(n,i,o){this.prepare(n);let c=new a8(n,i),p=(x,m)=>{if(x!==void 0){this.emit("connection_error",{req:n,code:x,message:ln.errorMessages[x],context:m}),f8(i,x,m);return}let f=Buffer.from(o);o=null,c.writeHead(),this.ws.handleUpgrade(n,i,f,(a)=>{this.onWebSocket(n,i,a)})};this._applyMiddlewares(n,c,(x)=>{if(x)p(ln.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(n,!0,p)})}onWebSocket(n,i,o){if(o.on("error",p),Hf.default[n._query.transport]!==void 0&&!Hf.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,f)=>f8(i,m,f);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,f)=>{if(p(m))xn('intercepting request for path "%s"',o),this.handleRequest(m,f);else{let a=0,v=x.length;for(;a<v;a++)x[a].call(n,m,f)}}),~this.opts.transports.indexOf("websocket"))n.on("upgrade",(m,f,a)=>{if(p(m))this.handleUpgrade(m,f,a);else if(i.destroyUpgrade!==!1)setTimeout(function(){if(f.writable&&f.bytesWritten<=0)return f.on("error",(v)=>{xn("error while destroying upgrade: %s",v.message)}),f.end()},c)})}}v8.Server=ln;function m8(n,i,o){let c=i===ln.errors.FORBIDDEN?403:400,p=o&&o.message?o.message:ln.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||ln.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 jx=[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 yK(n){if(n+="",n.length<1)return!1;if(!jx[n.charCodeAt(0)])return mn('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!jx[n.charCodeAt(1)])return mn('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!jx[n.charCodeAt(2)])return mn('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!jx[n.charCodeAt(3)])return mn('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!jx[n.charCodeAt(i)])return mn('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var w8=u((A8)=>{Object.defineProperty(A8,"__esModule",{value:!0});A8.Polling=void 0;var ZK=Vc(),$8=Kn("zlib"),qK=$f(),PK=vi(),ei=PK.default("engine:polling"),sK={gzip:$8.createGzip,deflate:$8.createDeflate};class v8 extends ZK.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 a in m)i.writeHeader(a,String(m[a]));let f=(a)=>{this.onData(a.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((a,$)=>{let v=x+a.byteLength;if(v>o){this.onError("content-length mismatch"),i.close();return}if(!p){if($){f(Buffer.from(a));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(a).copy(p,x),$){if(v!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}f(p);return}x=v})}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=($)=>{this.headers(this.req,x),this.res.cork(()=>{Object.keys(x).forEach((v)=>{this.res.writeHeader(v,String(x[v]))}),this.res.end($)}),o()};if(!this.httpCompression||!i.compress){m(n);return}if((c?Buffer.byteLength(n):n.length)<this.httpCompression.threshold){m(n);return}let a=qK(this.req).encodings(["gzip","deflate"]);if(!a){m(n);return}this.compress(n,a,($,v)=>{if($){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o($);return}x["Content-Encoding"]=a,m(v)})}compress(n,i,o){ei("compressing");let c=[],p=0;sK[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}}A8.Polling=v8});var W8=u((R8)=>{Object.defineProperty(R8,"__esModule",{value:!0});R8.WebSocket=void 0;var rK=Vc(),tK=vi(),T8=tK.default("engine:ws");class F8 extends rK.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",f=this.perMessageDeflate&&Buffer.byteLength(x)>this.perMessageDeflate.threshold;if(T8('writing "%s"',x),this.socket.send(x,m,f),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){T8("closing"),n&&n(),this.socket.end()}}R8.WebSocket=F8});var K8=u((X8)=>{Object.defineProperty(X8,"__esModule",{value:!0});var gK=w8(),dK=W8();X8.default={polling:gK.Polling,websocket:dK.WebSocket}});var l8=u((z8)=>{Object.defineProperty(z8,"__esModule",{value:!0});z8.uServer=void 0;var n9=vi(),_c=n$(),i9=K8(),ac=n9.default("engine:uws");class G8 extends _c.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(()=>{ac("response has been aborted")})}createTransport(n,i){return new i9.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 Y8(i),super._applyMiddlewares(n,n.res,(c)=>{n.res.writeHead(),o(c)})}handleRequest(n,i){ac('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:_c.Server.errorMessages[c],context:p}),this.abortRequest(i.res,c,p);return}if(i._query.sid)ac("setting new request for existing client"),this.clients[i._query.sid].transport.onRequest(i);else{let x=(m,f)=>this.abortRequest(n,m,f);this.handshake(i._query.transport,i,x)}};this._applyMiddlewares(i,n,(c)=>{if(c)o(_c.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!1,o)})}handleUpgrade(n,i,o){ac("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:_c.Server.errorMessages[p],context:x}),this.abortRequest(n,p,x);return}let m=i._query.sid,f;if(m){let a=this.clients[m];if(!a)return ac("upgrade attempt for closed client"),n.close();else if(a.upgrading)return ac("transport has already been trying to upgrade"),n.close();else if(a.upgraded)return ac("transport had already been upgraded"),n.close();else ac("upgrading existing transport"),f=this.createTransport(i._query.transport,i),a._maybeUpgrade(f)}else if(f=await this.handshake(i._query.transport,i,(a,$)=>this.abortRequest(n,a,$)),!f)return;i.res.writeStatus("101 Switching Protocols"),n.upgrade({transport:f},i.getHeader("sec-websocket-key"),i.getHeader("sec-websocket-protocol"),i.getHeader("sec-websocket-extensions"),o)};this._applyMiddlewares(i,n,(p)=>{if(p)c(_c.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"});else this.verify(i,!0,c)})}abortRequest(n,i,o){let c=i===_c.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",p=o&&o.message?o.message:_c.Server.errorMessages[i];n.writeStatus(c),n.writeHeader("Content-Type","application/json"),n.end(JSON.stringify({code:i,message:p}))}}z8.uServer=G8;class Y8{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 U8=u((Mp)=>{Object.defineProperty(Mp,"__esModule",{value:!0});Mp.protocol=Mp.Transport=Mp.Socket=Mp.uServer=Mp.parser=Mp.transports=Mp.Server=void 0;Mp.listen=f9;Mp.attach=O8;var o9=Kn("http"),H8=n$();Object.defineProperty(Mp,"Server",{enumerable:!0,get:function(){return H8.Server}});var c9=t0();Mp.transports=c9.default;var Q8=Bx();Mp.parser=Q8;var p9=l8();Object.defineProperty(Mp,"uServer",{enumerable:!0,get:function(){return p9.uServer}});var x9=g0();Object.defineProperty(Mp,"Socket",{enumerable:!0,get:function(){return x9.Socket}});var m9=Vc();Object.defineProperty(Mp,"Transport",{enumerable:!0,get:function(){return m9.Transport}});Mp.protocol=Q8.protocol;function f9(n,i,o){if(typeof i==="function")o=i,i={};let c=o9.createServer(function(x,m){m.writeHead(501),m.end("Not Implemented")}),p=O8(c,i);return p.httpServer=c,c.listen(n,o),p}function O8(n,i){let o=new H8.Server(i);return o.attach(n,i),o}});var V8=u((w9)=>{w9.Emitter=Ui;function Ui(n){if(n)return J9(n)}function J9(n){for(var i in Ui.prototype)n[i]=Ui.prototype[i];return n}Ui.prototype.on=Ui.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};Ui.prototype.once=function(n,i){function o(){this.off(n,o),i.apply(this,arguments)}return o.fn=i,this.on(n,o),this};Ui.prototype.off=Ui.prototype.removeListener=Ui.prototype.removeAllListeners=Ui.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};Ui.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};Ui.prototype.emitReserved=Ui.prototype.emit;Ui.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Ui.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var i$=u((j8)=>{Object.defineProperty(j8,"__esModule",{value:!0});j8.hasBinary=j8.isBinary=void 0;var F9=typeof ArrayBuffer==="function",R9=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},_8=Object.prototype.toString,S9=typeof Blob==="function"||typeof Blob!=="undefined"&&_8.call(Blob)==="[object BlobConstructor]",W9=typeof File==="function"||typeof File!=="undefined"&&_8.call(File)==="[object FileConstructor]";function B8(n){return F9&&(n instanceof ArrayBuffer||R9(n))||S9&&n instanceof Blob||W9&&n instanceof File}j8.isBinary=B8;function Mf(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Mf(n[o]))return!0;return!1}if(B8(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Mf(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Mf(n[o]))return!0;return!1}j8.hasBinary=Mf});var N8=u((L8)=>{Object.defineProperty(L8,"__esModule",{value:!0});L8.reconstructPacket=L8.deconstructPacket=void 0;var K9=i$();function G9(n){let i=[],o=n.data,c=n;return c.data=o$(o,i),c.attachments=i.length,{packet:c,buffers:i}}L8.deconstructPacket=G9;function o$(n,i){if(!n)return n;if(K9.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]=o$(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]=o$(n[c],i);return o}return n}function Y9(n,i){return n.data=c$(n.data,i),delete n.attachments,n}L8.reconstructPacket=Y9;function c$(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]=c$(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=c$(n[o],i)}return n}});var Lx=u((Z8)=>{Object.defineProperty(Z8,"__esModule",{value:!0});Z8.Decoder=Z8.Encoder=Z8.PacketType=Z8.protocol=void 0;var M9=V8(),u8=N8(),I8=i$(),l9=vi(),p$=l9.default("socket.io-parser"),H9=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Z8.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=Z8.PacketType||(Z8.PacketType={}));class y8{constructor(n){this.replacer=n}encode(n){if(p$("encoding packet %j",n),n.type===yn.EVENT||n.type===yn.ACK){if(I8.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 p$("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=u8.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}Z8.Encoder=y8;function C8(n){return Object.prototype.toString.call(n)==="[object Object]"}class x$ extends M9.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 k8(i),i.attachments===0)super.emitReserved("decoded",i)}else super.emitReserved("decoded",i)}else if(I8.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(x$.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return p$("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 C8(i);case yn.DISCONNECT:return i===void 0;case yn.CONNECT_ERROR:return typeof i==="string"||C8(i);case yn.EVENT:case yn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&H9.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}}Z8.Decoder=x$;class k8{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=u8.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var t8=u((s8)=>{Object.defineProperty(s8,"__esModule",{value:!0});s8.Client=void 0;var lf=Lx(),E9=vi(),U9=Kn("url"),Jo=E9("socket.io:client");class P8{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)Jo("no namespace joined yet, close the client"),this.close();else Jo("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(n,i={}){if(this.server._nsps.has(n))return Jo("connecting to namespace %s",n),this.doConnect(n,i);this.server._checkNamespace(n,i,(o)=>{if(o)this.doConnect(n,i);else Jo("creation of namespace %s was denied",n),this._packet({type:lf.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 Jo("ignoring remove for %s",n.id)}close(){if(this.conn.readyState==="open")Jo("forcing transport close"),this.conn.close(),this.onclose("forced server close")}_packet(n,i={}){if(this.conn.readyState!=="open"){Jo("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){Jo("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){Jo("invalid packet format"),this.onerror(i)}}ondecoded(n){let i,o;if(this.conn.protocol===3){let p=U9.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===lf.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==lf.PacketType.CONNECT&&n.type!==lf.PacketType.CONNECT_ERROR)process.nextTick(function(){c._onpacket(n)});else Jo("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){Jo("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}}s8.Client=P8});var Hf=u((d8)=>{Object.defineProperty(d8,"__esModule",{value:!0});d8.StrictEventEmitter=void 0;var V9=Kn("events");class g8 extends V9.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)}}d8.StrictEventEmitter=g8});var m$=u((nR)=>{Object.defineProperty(nR,"__esModule",{value:!0});nR.RESERVED_EVENTS=void 0;nR.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var a$=u((oR)=>{Object.defineProperty(oR,"__esModule",{value:!0});oR.RemoteSocket=oR.BroadcastOperator=void 0;var _9=m$(),B9=Lx();class Do{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 Do(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 Do(this.adapter,this.rooms,i,this.flags)}compress(n){let i=Object.assign({},this.flags,{compress:n});return new Do(this.adapter,this.rooms,this.exceptRooms,i)}get volatile(){let n=Object.assign({},this.flags,{volatile:!0});return new Do(this.adapter,this.rooms,this.exceptRooms,n)}get local(){let n=Object.assign({},this.flags,{local:!0});return new Do(this.adapter,this.rooms,this.exceptRooms,n)}timeout(n){let i=Object.assign({},this.flags,{timeout:n});return new Do(this.adapter,this.rooms,this.exceptRooms,i)}emit(n,...i){if(_9.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:B9.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,f=[],a=setTimeout(()=>{m=!0,x.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:f])},this.flags.timeout),$=-1,v=0,A=0,J=()=>{if(!m&&$===v&&f.length===A)clearTimeout(a),x.apply(this,[null,this.flags.expectSingleResponse?f[0]:f])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(S)=>{A+=S,v++,J()},(S)=>{f.push(S),J()}),this.adapter.serverCount().then((S)=>{$=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 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)}}oR.BroadcastOperator=Do;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 Do(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}}oR.RemoteSocket=f$});var $$=u((lp)=>{var mR=lp&&lp.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(lp,"__esModule",{value:!0});lp.Socket=void 0;var no=Lx(),b9=mR(vi()),L9=Hf(),pR=mR(b0()),D9=a$(),N9=m$(),Mi=b9.default("socket.io:socket"),C9=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function xR(){}class fR extends L9.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=pR.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=pR.default.generateId()}this.handshake=this.buildHandshake(o),this.on("error",xR)}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(N9.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++;Mi("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(()=>{Mi("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 Mi("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return Mi("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(Mi("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(Mi("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(Mi("emitting event %j",i),n.id!=null)Mi("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);Mi("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")Mi("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else Mi("bad ack %s",n.id)}ondisconnect(){Mi("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(Mi("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&C9.has(n))Mi("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=xR}_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){Mi("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 Mi("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 D9.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}lp.Socket=fR});var v$=u((No)=>{var h9=No&&No.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(No,"__esModule",{value:!0});No.Namespace=No.RESERVED_EVENTS=void 0;var aR=$$(),u9=Hf(),I9=h9(vi()),Ii=a$(),Dx=I9.default("socket.io:namespace");No.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class $R extends u9.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;Dx("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"){Dx("next called after client was closed - ignoring socket"),p._cleanup();return}if(x)if(Dx("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){Dx("error while restoring session: %s",x)}if(p)return Dx("connection state recovered for sid %s",p.sid),new aR.Socket(this,n,i,p)}return new aR.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(No.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)}}No.Namespace=$R});var RR=u((TR)=>{Object.defineProperty(TR,"__esModule",{value:!0});TR.yeast=TR.decode=TR.encode=void 0;var JR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Qf=64,wR={},vR=0,$c=0,AR;function A$(n){let i="";do i=JR[n%Qf]+i,n=Math.floor(n/Qf);while(n>0);return i}TR.encode=A$;function y9(n){let i=0;for($c=0;$c<n.length;$c++)i=i*Qf+wR[n.charAt($c)];return i}TR.decode=y9;function k9(){let n=A$(+new Date);if(n!==AR)return vR=0,AR=n;return n+"."+A$(vR++)}TR.yeast=k9;for(;$c<Qf;$c++)wR[JR[$c]]=$c});var T$=u((WR)=>{var J$;Object.defineProperty(WR,"__esModule",{value:!0});WR.SessionAwareAdapter=WR.Adapter=void 0;var P9=Kn("events"),s9=RR(),Of=Kn("ws"),r9=typeof((J$=Of===null||Of===void 0?void 0:Of.Sender)===null||J$===void 0?void 0:J$.frame)==="function";class w$ extends P9.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),f=0;this.apply(i,(a)=>{if(f++,a.acks.set(n.id,c),typeof a.notifyOutgoingListeners==="function")a.notifyOutgoingListeners(n);a.client.writeToEngine(m,x)}),o(f)}_encode(n,i){let o=this.encoder.encode(n);if(r9&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=Of.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 f=this.nsp.sockets.get(m);if(f)i(f),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}}WR.Adapter=w$;class SR extends w${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 f=this.packets[m];if(t9(o.rooms,f.opts))x.push(f.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=s9.yeast();n.data.push(m),this.packets.push({id:m,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}WR.SessionAwareAdapter=SR;function t9(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 GR=u((wo)=>{var d9=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 e9=T$(),nG=vi(),iG=Kn("crypto"),Pn=nG.debug("socket.io-adapter"),oG="emitter",Ef=5000;function Qp(){return iG.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 Hp(n){return{rooms:new Set(n.rooms),except:new Set(n.except),flags:n.flags}}class F$ extends e9.Adapter{constructor(n){super(n);this.requests=new Map,this.ackRequests=new Map,this.uid=Qp()}onMessage(n,i){if(n.uid===this.uid)return Pn("[%s] ignore message from self",this.uid);switch(Pn("[%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,Hp(n.data.opts),(c)=>{Pn("[%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)=>{Pn("[%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=Hp(n.data.opts);this.addOffsetIfNecessary(c,p,i),super.broadcast(c,p)}break}case on.SOCKETS_JOIN:super.addSockets(Hp(n.data.opts),n.data.rooms);break;case on.SOCKETS_LEAVE:super.delSockets(Hp(n.data.opts),n.data.rooms);break;case on.DISCONNECT_SOCKETS:super.disconnectSockets(Hp(n.data.opts),n.data.close);break;case on.FETCH_SOCKETS:{Pn("[%s] calling fetchSockets with opts %j",this.uid,n.data.opts),super.fetchSockets(Hp(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=d9(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,Pn("[%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:Pn("[%s] unknown message type: %s",this.uid,n.type)}}onResponse(n){var i,o;let c=n.data.requestId;switch(Pn("[%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:Pn("[%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 Pn("[%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=Qp();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){Pn("[%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){Pn("[%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){Pn("[%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=Qp();return new Promise((m,f)=>{let a=setTimeout(()=>{let v=this.requests.get(x);if(v)f(new Error(`timeout reached: only ${v.current} responses received out of ${v.expected}`)),this.requests.delete(x)},n.flags.timeout||Ef),$={type:on.FETCH_SOCKETS,resolve:m,timeout:a,current:0,expected:p,responses:o};this.requests.set(x,$),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(Pn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Qp(),x=setTimeout(()=>{let f=this.requests.get(p);if(f)o(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`),f.responses),this.requests.delete(p)},Ef),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)=>{Pn("[%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)=>{Pn("[%s] error while publishing response: %s",this.uid,o)})}}wo.ClusterAdapter=F$;class KR extends F${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)Pn("[%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 Pn("[%s] ignore message from self",this.uid);if(n.uid&&n.uid!==oG)this.nodesMap.set(n.uid,Date.now());switch(Pn("[%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(Pn('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,c),c<=0)return o(null,[]);let p=Qp(),x=setTimeout(()=>{let f=this.customRequests.get(p);if(f)o(new Error(`timeout reached: missing ${f.missingUids.size} responses`),f.responses),this.customRequests.delete(p)},Ef),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=Qp();return new Promise((m,f)=>{let a=setTimeout(()=>{let v=this.customRequests.get(x);if(v)f(new Error(`timeout reached: missing ${v.missingUids.size} responses`)),this.customRequests.delete(x)},n.flags.timeout||Ef),$={type:on.FETCH_SOCKETS,resolve:m,timeout:a,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(x,$),this.publish({type:on.FETCH_SOCKETS,data:{opts:Bc(n),requestId:x}})})}onResponse(n){let i=n.data.requestId;switch(Pn("[%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=KR});var Uf=u((jc)=>{Object.defineProperty(jc,"__esModule",{value:!0});jc.MessageType=jc.ClusterAdapterWithHeartbeat=jc.ClusterAdapter=jc.SessionAwareAdapter=jc.Adapter=void 0;var YR=T$();Object.defineProperty(jc,"Adapter",{enumerable:!0,get:function(){return YR.Adapter}});Object.defineProperty(jc,"SessionAwareAdapter",{enumerable:!0,get:function(){return YR.SessionAwareAdapter}});var R$=GR();Object.defineProperty(jc,"ClusterAdapter",{enumerable:!0,get:function(){return R$.ClusterAdapter}});Object.defineProperty(jc,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return R$.ClusterAdapterWithHeartbeat}});Object.defineProperty(jc,"MessageType",{enumerable:!0,get:function(){return R$.MessageType}})});var HR=u((Op)=>{var pG=Op&&Op.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Op,"__esModule",{value:!0});Op.ParentNamespace=void 0;var zR=v$(),xG=Uf(),mG=pG(vi()),MR=mG.default("socket.io:parent-namespace");class Vf extends zR.Namespace{constructor(n){super(n,"/_"+Vf.count++);this.children=new Set}_initAdapter(){this.adapter=new lR(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){MR("creating child namespace %s",n);let i=new zR.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)MR("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")}}Op.ParentNamespace=Vf;Vf.count=0;class lR extends xG.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var _R=u((Lc)=>{var fG=Lc&&Lc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Lc,"__esModule",{value:!0});Lc.patchAdapter=$G;Lc.restoreAdapter=vG;Lc.serveFile=JG;var bc=Uf(),QR=Kn("fs"),aG=fG(vi()),_f=aG.default("socket.io:adapter-uws"),S$="\x1F",{addAll:ER,del:UR,broadcast:VR}=bc.Adapter.prototype;function $G(n){bc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);ER.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"){OR(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let x=this.sids.get(i);if(x)OR(this.nsp.name,p,c,x)})},bc.Adapter.prototype.del=function(i,o){UR.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}`;_f("unsubscribe connection %s from topic %s",p,m),x.unsubscribe(m)}},bc.Adapter.prototype.broadcast=function(i,o){if(!(o.rooms.size<=1&&o.except.size===0)){VR.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),f=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${S$}${o.rooms.keys().next().value}`;_f("fast publish to %s",f),m.forEach((a)=>{let $=typeof a!=="string";n.publish(f,$?a:"4"+a,$)}),this.apply(o,(a)=>{if(a.conn.transport.name!=="websocket")a.client.writeToEngine(m,x)})}}function OR(n,i,o,c){let p=i.conn.id,x=i.conn.transport.socket;if(o)_f("subscribe connection %s to topic %s",p,n),x.subscribe(n);c.forEach((m)=>{let f=`${n}${S$}${m}`;_f("subscribe connection %s to topic %s",p,f),x.subscribe(f)})}function vG(){bc.Adapter.prototype.addAll=ER,bc.Adapter.prototype.del=UR,bc.Adapter.prototype.broadcast=VR}var AG=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function JG(n,i){let{size:o}=QR.statSync(i),c=QR.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),x=(f)=>{throw p(),f},m=(f)=>{let a=AG(f);n.cork(()=>{let $=n.getWriteOffset(),[v,A]=n.tryEnd(a,o);if(!A&&!v)c.pause(),n.onWritable((J)=>{let[S,W]=n.tryEnd(a.slice(J-$),o);if(!W&&S)c.resume();return S})})};n.onAborted(p),c.on("data",m).on("error",x).on("end",p)}});var BR=u((EN,wG)=>{wG.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 IR=u((li,Nx)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.1/node_modules/socket.io/dist",TG=li&&li.__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]}),FG=li&&li.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),RG=li&&li.__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))TG(i,n,o)}return FG(i,n),i},hR=li&&li.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(li,"__esModule",{value:!0});li.Namespace=li.Socket=li.Server=void 0;var SG=Kn("http"),WG=Kn("fs"),W$=Kn("zlib"),XG=$f(),Bf=Kn("stream"),jR=Kn("path"),bR=U8(),KG=t8(),LR=Kn("events"),K$=v$();Object.defineProperty(li,"Namespace",{enumerable:!0,get:function(){return K$.Namespace}});var GG=HR(),DR=Uf(),YG=RG(Lx()),zG=hR(vi()),uR=$$();Object.defineProperty(li,"Socket",{enumerable:!0,get:function(){return uR.Socket}});var MG=Hf(),X$=_R(),lG=hR(e0()),Li=zG.default("socket.io:server"),NR=BR().version,CR=/\.map/;class Ep extends MG.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||YG,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||DR.SessionAwareAdapter);else this.adapter(i.adapter||DR.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=lG.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,f)=>{if(m||!f)return p();if(this._nsps.has(n))return Li("dynamic namespace %s already exists",n),o(this._nsps.get(n));let a=this.parentNsps.get(x.value).createChild(n);Li("dynamic namespace %s was created",n),o(a)})};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"){Li("creating http server and binding to %d",n);let o=n;n=SG.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,Li("creating uWebSockets.js-based engine with opts %j",i);let o=new bR.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=CR.test(x),f=m?"map":"source",a='"'+NR+'"',$="W/"+a,v=p.getHeader("if-none-match");if(v){if(a===v||$===v){Li("serve client %s 304",f),c.writeStatus("304 Not Modified"),c.end();return}}Li("serve client %s",f),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(m?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",a);let A=jR.join(__dirname,"../client-dist/",x);X$.serveFile(c,A)});X$.patchAdapter(n)}initEngine(n,i){if(Li("creating engine.io instance with opts %j",i),this.eio=bR.attach(n,i),this._serveClient)this.attachServe(n);this.httpServer=n,this.bind(this.eio)}attachServe(n){Li("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=CR.test(o),p=c?"map":"source",x='"'+NR+'"',m="W/"+x,f=n.headers["if-none-match"];if(f){if(x===f||m===f){Li("serve client %s 304",p),i.writeHead(304),i.end();return}}Li("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),Ep.sendFile(o,n,i)}static sendFile(n,i,o){let c=WG.createReadStream(jR.join(__dirname,"../client-dist/",n)),p=XG(i).encodings(["br","gzip","deflate"]),x=(m)=>{if(m)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),Bf.pipeline(c,W$.createBrotliCompress(),o,x);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),Bf.pipeline(c,W$.createGzip(),o,x);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),Bf.pipeline(c,W$.createDeflate(),o,x);break;default:o.writeHead(200),Bf.pipeline(c,o,x)}}bind(n){return this.engine=n,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(n){Li("incoming connection with id %s",n.id);let i=new KG.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new GG.ParentNamespace(this);if(Li("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 Li("attaching namespace %s to parent namespace %s",n,c),p.createChild(n);if(Li("initializing namespace %s",n),o=new K$.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(),X$.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)}}li.Server=Ep;var HG=Object.keys(LR.EventEmitter.prototype).filter(function(n){return typeof LR.EventEmitter.prototype[n]==="function"});HG.forEach(function(n){Ep.prototype[n]=function(){return this.sockets[n].apply(this.sockets,arguments)}});Nx.exports=(n,i)=>new Ep(n,i);Nx.exports.Server=Ep;Nx.exports.Namespace=K$.Namespace;Nx.exports.Socket=uR.Socket});import{createHash as rS}from"crypto";import{createServer as kY}from"http";import{createServer as ZY}from"https";function mm(n=Math.random){return n().toString(36).slice(2)}class ix 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 Y1(n){return Object.entries(n)}var z1=(n,i,o=t.STORE)=>{return ox(o,{key:`${n.key}:JSON`,get:({get:c})=>i.toJson(c(n)),set:({set:c},p)=>{c(n,i.fromJson(p))}})};function B(n){while(n.child!==null)n=n.child;return n}class An{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 Aa extends An{state;constructor(n){super();this.state=n}next(n){this.state=n,super.next(n)}}function ko(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 An,f=Object.assign((a)=>{let $=xn(a),v={key:i.key,subKey:$},A=`${i.key}(${$})`,J=B(n),S=i.default,W={key:A,default:S instanceof Function?S(a):S};if(i.effects)W.effects=i.effects(a);let R=Zo(J,W,v);return x.next({type:"state_creation",token:R}),R},c,{subject:x,install:(a)=>ko(a,i),internalRoles:o});return n.families.set(i.key,f),n.defaults.set(i.key,i.default),c}function M1(n,i){if("mutable"in i)return cx(n,i);return ko(n,i)}function qo(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 An,f=Object.assign((a)=>{let $=xn(a),v={key:i.key,subKey:$},A=`${i.key}(${$})`,J=B(n),S=px(J,{key:A,get:i.get(a)},v);return x.next({type:"state_creation",token:S}),S},c,{internalRoles:o,subject:x,install:(a)=>qo(a,i),default:(a)=>{return i.get(a)({get:(...v)=>zn(n,...v),find:(v,A)=>r(n,v,A),seek:(v,A)=>fi(n,v,A),json:(v)=>ii(n,v)})}});return n.families.set(i.key,f),c}function Ja(n,i){if("set"in i)return xx(n,i);return qo(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 t6={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function l1(n,i){let o=xn(i),c=`${n.key}(${o})`,p=t6[n.type],x={key:c,type:p};return Object.assign(x,{family:{key:n.key,subKey:o}}),Object.assign(x,{counterfeit:!0}),x}function Go(n){let i={key:n.key,type:n.type};if("family"in n)i.family=n.family;return i}class oi{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 f of p)x??=f,m??=f,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)}}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),f=i[x];this.setContent(m,f)}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 ci(n){return"epoch"in n.transactionMeta}function Gn(n){return"phase"in n.transactionMeta}var H1=(n)=>{let i=B(n);if(!Gn(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};var g6=(n)=>n[0].toUpperCase()+n.slice(1);function xo(n){return n.type.split("_").map(g6).join(" ")}class Vo extends Error{constructor(...n){let i=n[0],o=n.length===2?n[1]:n[2];if(n.length===2)super(`${xo(i)} ${xn(i.key)} not found in store "${o.config.name}".`);else{let c=n[1];super(`${xo(i)} "${i.key}" member ${xn(c)} not found in store "${o.config.name}".`)}}}function tc(n,i,o){return(...c)=>{let p=wn(n,o);if(p)return p.run(c,i);throw new Vo(n,o)}}var am=(n)=>(i)=>n instanceof Function?n(i):n;var Po=(n,i)=>{if(i.valueMap.has(n.key))return i.logger.info("\uD83D\uDCD6",n.type,n.key,"reading cached value"),Q1(n,i);if(n.type==="selector"||n.type==="readonly_selector")return i.logger.info("\uD83E\uDDEE",n.type,n.key,"computing value"),n.get();let o=n.default instanceof Function?n.default():n.default;return i.logger.info("\uD83D\uDC81","atom",n.key,"could not find cached value; using default",o),n.default instanceof Function?n.default():n.default};var O1=(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}"${!Gn(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},E1=(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)},U1=(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 V1=(n,i,o)=>{switch(n.type){case"mutable_atom":o.logger.info("\uD83D\uDCE2",n.type,n.key,"is now (",i.newValue,") subscribers:",n.subject.subscribers);break;default:o.logger.info("\uD83D\uDCE2",n.type,n.key,"went (",i.oldValue,"->",i.newValue,") subscribers:",n.subject.subscribers)}n.subject.next(i)};var wa=(n,i)=>{let o=B(i),c=o.selectorAtoms.getRelatedKeys(n.key);if(o.logger.info("\uD83E\uDDF9",n.type,n.key,c?`evicting ${c.size} states downstream:`:"no downstream states",c??"to evict"),c){if(o.operation.open)o.logger.info("\uD83E\uDDF9",n.type,n.key,`[ ${[...o.operation.done].join(", ")} ] already done`);for(let p of c){if(U1(o,p))continue;_1(p,o),gc(o,p)}}};function d6(n,i){if(j1(i.newValue))return!1;if(n.includes("\uD83D\uDD0D"))return!1;return!0}var B1=(n,i,o)=>{let{key:c}=n,p=B(o);if(!Gn(p)||p.transactionMeta.phase!=="building"){o.logger.error("\uD83D\uDC1E","atom",c,"stowUpdate called outside of a transaction. This is probably a bug.");return}if(!d6(c,i))return;let m={type:"atom_update",key:c,...i};if(n.family)m.family=n.family;p.transactionMeta.update.updates.push(m),o.logger.info("\uD83D\uDCC1","atom",c,"stowed (",i.oldValue,"->",i.newValue,")")};var b1=(n,i,o)=>{let c=Po(n,o),p=c;if(n.type==="mutable_atom"&&Gn(o)){let{parent:m}=o;p=mx(n,m,o)}if(p=am(i)(p),o.logger.info("\uD83D\uDCDD","atom",n.key,"set to",p),p=Zi(n.key,p,n.subject,o),L1(n.key,o))D1(n.key,o);gc(o,n.key),wa(n,o);let x={oldValue:c,newValue:p};if(ci(o))V1(n,x,o);else if(o.parent){if(o.on.transactionApplying.state===null)B1(n,x,o);else if(n.key.startsWith("*")){let m=n.key.slice(1),f=o.atoms.get(m),a=o.valueMap.get(m);if(f.type==="mutable_atom"&&Gn(o)){let{parent:v}=o;a=mx(f,v,o)}if(a.do(x.newValue)===null)wa(f,o)}}};var $m=(n,i,o)=>{switch(n.type){case"atom":case"mutable_atom":b1(n,i,o);break;case"selector":n.set(i);break}};function N1(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=N1(n,o)??null,c)p=o.family?Zn(o.family.subKey):null,o=r(n,c,p)}else c=i[0],p=i[1],x=i[2],o=r(n,c,p);if("counterfeit"in o&&"family"in o){let a=o.family.subKey,$=n.disposalTraces.buffer.find((v)=>v?.key===a);n.logger.error("\u274C",o.type,o.key,`could not be set because it was not found in the store "${n.config.name}".`,$?`This state was previously disposed:
|
|
48
|
-
${
|
|
49
|
-
${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 f=wn(c,n).default(x);return n.defaults.set(c.key,f),f}}}return Po(wn(o,n),n)}class qi extends Map{source;deleted=new Set;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 s1=(n,i,o,c)=>{let p=B(o),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 oi(p.timelineTopics.toJSON()),trackers:new Map,transactions:new qi(p.transactions),selectorAtoms:new oi(p.selectorAtoms.toJSON()),selectorGraph:new oi(p.selectorGraph.toJSON(),{makeContentKey:(...$)=>$.sort().join(":")}),selectors:new qi(p.selectors),valueMap:new qi(p.valueMap),defaults:p.defaults,disposalTraces:o.disposalTraces.copy(),molecules:new qi(p.molecules),moleculeGraph:new oi(p.moleculeGraph.toJSON(),{makeContentKey:p.moleculeGraph.makeContentKey}),moleculeData:new oi(p.moleculeData.toJSON(),{makeContentKey:p.moleculeData.makeContentKey}),moleculeJoins:new oi(p.moleculeJoins.toJSON(),{makeContentKey:p.moleculeJoins.makeContentKey}),miscResources:new qi(p.miscResources)},m=r1(n,o),f={phase:"building",update:{type:"transaction_update",key:n,id:c,epoch:m===void 0?Number.NaN:m+1,updates:[],params:i,output:void 0},toolkit:{get:(...$)=>zn(a,...$),set:(...$)=>{On(a,...$)},run:($,v=mm())=>tc($,v,a),find:($,v)=>r(a,$,v),seek:($,v)=>fi(a,$,v),json:($)=>ii(a,$),dispose:(...$)=>{Rc(a,...$)},env:()=>P1(a)}},a=Object.assign(x,{transactionMeta:f});return p.child=a,o.logger.info("\uD83D\uDEEB","transaction",n,"Building transaction with params:",i),a};function Ra(n,i){let o={key:n.key,type:"transaction",run:(x,m)=>{let f=s1(n.key,x,i,m);try{let a=B(i),{toolkit:$}=f.transactionMeta,v=n.do($,...x);return Z1(v,a),v}catch(a){throw H1(c),i.logger.warn("\uD83D\uDCA5","transaction",n.key,"caught:",a),a}},install:(x)=>Ra(n,x),subject:new An},c=B(i);c.transactions.set(o.key,o);let p=Go(o);return i.on.transactionCreation.next(p),p}function r1(n,i){let o=ci(i),c=o?i.transactionMeta.actionContinuities.getRelatedKey(n):void 0;return o&&c!==void 0?i.transactionMeta.epoch.get(c):void 0}class t1{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;selectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new oi({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new oi({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 oi({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new oi({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new fm(100);molecules=new Map;moleculeJoins=new oi({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeGraph=new oi({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});moleculeData=new oi({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")});miscResources=new Map;on={atomCreation:new An,atomDisposal:new An,selectorCreation:new An,selectorDisposal:new An,timelineCreation:new An,transactionCreation:new An,transactionApplying:new Aa(null),operationClose:new An,moleculeCreation:new An,moleculeDisposal:new An};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Sc("warn",(n,i,o)=>!o.includes("\uD83D\uDD0D"))];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},ci(i))this.transactionMeta={epoch:new Map(i?.transactionMeta.epoch),actionContinuities:new oi(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=ii(i,c),x=_o(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 t={get STORE(){if(!globalThis.ATOM_IO_IMPLICIT_STORE)globalThis.ATOM_IO_IMPLICIT_STORE=new t1({name:"IMPLICIT_STORE",lifespan:"ephemeral"});return globalThis.ATOM_IO_IMPLICIT_STORE}};function wn(n,i){let o,c=i;while(c!==null){switch(n.type){case"atom":case"mutable_atom":o=c.atoms.get(n.key);break;case"selector":o=c.selectors.get(n.key);break;case"readonly_selector":o=c.readonlySelectors.get(n.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":o=c.families.get(n.key);break;case"timeline":o=c.timelines.get(n.key);break;case"transaction":o=c.transactions.get(n.key);break}if(o)return o;c=c.child}throw new Vo(n,i)}function g1(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new Vo(i,n);let p=c(o),x=B(n);if(p.family){if(ci(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(Gn(x)&&x.on.transactionApplying.state===null)x.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function fi(n,i,o){let c=xn(o),p=`${i.key}(${c})`,x=B(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 Go(m);return m}function r(n,i,o){let c=fi(n,i,o);if(c)return c;let p=xn(o),x=n.molecules.get(p);if(!x&&n.config.lifespan==="immortal"){let m=l1(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=g1(n,i,o),x)B(n).moleculeData.set(p,i.key);return c}function Rc(n,...i){let o;if(i.length===1)o=i[0];else{let c=i[0],p=i[1];o=r(n,c,p)}try{wn(o,n)}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":Sa(o,n);break;case"selector":case"readonly_selector":d1(o,n);break}}var Jm=(n,i)=>B(i).atoms.has(n),e6=(n,i)=>B(i).selectors.has(n),nW=(n,i)=>B(i).readonlySelectors.has(n),e1=(n,i)=>Jm(n,i)||e6(n,i)||nW(n,i);var wm=(n,i)=>{return B(i).selectorGraph.getRelationEntries({downstreamSelectorKey:n}).filter(([c,{source:p}])=>p!==n).map(([c,{source:p}])=>p).filter((c)=>e1(c,i))};var Wa=(n,i,o)=>{let c=[],p=wm(n,o);while(p.length>0){let x=p.shift();if(i.has(x))continue;if(i.add(x),!Jm(x,o))p.push(...wm(x,o));else if(!c.includes(x))c.push(x)}return c},nv=(n,i)=>{let o=n.key,c=wm(o,i),p=new Set;return c.flatMap((x)=>Jm(x,i)?x:Wa(x,p,i))};var iv=(n,i,o,c)=>{let p=B(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=Wa(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=B(o),x;if(c.length===2){let[a,$]=c;x=r(o,a,$)}else[x]=c;let m=wn(x,o),f=Po(m,o);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${x.key}" =`,f,")"),p.selectorGraph.set({upstreamSelectorKey:x.key,downstreamSelectorKey:n},{source:x.key}),iv(n,x,i,o),f},set:(...c)=>{let p,x;if(c.length===2)p=c[0],x=c[1];else{let a=c[0],$=c[1];x=c[2];let v=o.config.lifespan==="ephemeral"?r(o,a,$):fi(o,a,$);if(!v)throw new Vo(a,$,o);p=v}let m=B(o),f=wn(p,m);$m(f,x,m)},find:(c,p)=>r(o,c,p),seek:(c,p)=>fi(o,c,p),json:(c)=>ii(o,c)});var px=(n,i,o)=>{let c=B(n),p=new An,x=new Set,{get:m,find:f,seek:a,json:$}=Tm(i.key,x,c),v=()=>{let W=i.get({get:m,find:f,seek:a,json:$});return Zi(i.key,W,p,B(n)),x.clear(),W},A={...i,subject:p,install:(W)=>px(W,i,o),get:v,type:"readonly_selector",...o&&{family:o}};c.readonlySelectors.set(i.key,A);let J=v();n.logger.info("\u2728",A.type,A.key,"=",J);let S={key:i.key,type:"readonly_selector"};if(o)S.family=o;return S};var ax=(n,i,o)=>{let c=B(n),p=new An,x=new Set,m=Tm(i.key,x,c),{find:f,get:a,seek:$,json:v}=m,A={find:f,get:a,seek:$,json:v},J=(z=i.get,M=B(n))=>{let h=z(A);return Zi(i.key,h,p,M),x.clear(),h},W={...i,subject:p,install:(z)=>ax(z,i,o),get:J,set:(z)=>{let M=B(n),h=J(i.get,M),G=am(z)(h);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",h,"->",G,")"),Zi(i.key,G,p,M),gc(M,i.key),ci(M))p.next({newValue:G,oldValue:h});i.set(m,G)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,W);let R=J();n.logger.info("\u2728",W.type,W.key,"=",R);let K={key:i.key,type:"selector"};if(o)K.family=o;return K};function ox(n,i){if("set"in i){let p=ax(n,i,void 0);return n.on.selectorCreation.next(p),p}let c=px(n,i,void 0);return n.on.selectorCreation.next(c),c}function d1(n,i){let o=B(i),{key:c}=n,p=wn(n,o);if(!p.family)i.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);switch(n.type){case"selector":{o.selectors.delete(c);let m=wn({key:p.family.key,type:"selector_family"},i)}break;case"readonly_selector":o.readonlySelectors.delete(c),wn({key:p.family.key,type:"readonly_selector_family"},i).subject.next({type:"state_disposal",subType:"selector",token:n});break}if(o.valueMap.delete(c),o.selectorAtoms.delete(c),o.selectorGraph.delete(c),i.logger.info("\uD83D\uDD25",n.type,c,"deleted"),Gn(o)&&o.transactionMeta.phase==="building")o.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:n});else i.on.selectorDisposal.next(n)}}function xx(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 An,f=Object.assign((a)=>{let $=xn(a),v={key:i.key,subKey:$},A=`${i.key}(${$})`,J=B(n),S=ax(J,{key:A,get:i.get(a),set:i.set(a)},v);return x.next({type:"state_creation",token:S}),S},c,{internalRoles:o,subject:x,install:(a)=>xx(a,i),default:(a)=>{return i.get(a)({get:(...v)=>zn(n,...v),find:(v,A)=>r(n,v,A),seek:(v,A)=>fi(n,v,A),json:(v)=>ii(n,v)})}});return n.families.set(i.key,f),c}function ov(n,i,o=t.STORE){let c=xx(o,{key:`${n.key}:JSON`,get:(x)=>({get:m})=>{let f=m(n,x);return i.toJson(f)},set:(x)=>({set:m},f)=>{m(n,x,i.fromJson(f))}},["mutable","json"]);return wn(n,o).subject.subscribe(`store=${o.config.name}::json-selector-family`,(x)=>{if(x.token.family)fi(o,c,Zn(x.token.family.subKey))}),c}var Zn=(n)=>JSON.parse(n),xn=(n)=>JSON.stringify(n),HQ=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var cv=(n,i)=>{let o=B(i);if(o.operation.open)return o.operation.prev.get(n.key);return o.valueMap.get(n.key)};var Ga=(n,i)=>{let o=B(i);return nv(n,i).map((p)=>{let x=o.atoms.get(p);if(x===void 0)throw new Error(`Atom "${p}", a dependency of selector "${n.key}", not found in store "${i.config.name}".`);return x.subject.subscribe(`${n.type}:${n.key}`,(m)=>{i.logger.info("\uD83D\uDCE2",n.type,n.key,"root",p,"went",m.oldValue,"->",m.newValue);let f=cv(n,o),a=Po(n,o);i.logger.info("\u2728",n.type,n.key,"went",f,"->",a),n.subject.next({newValue:a,oldValue:f})})})};function Xi(n,i,o,c){function p(A){if(c.operation.open){let J=c.on.operationClose.subscribe(`state subscription ${o}`,()=>{J(),i(A)})}else i(A)}let x=wn(n,c);c.logger.info("\uD83D\uDC40",x.type,x.key,`Adding subscription "${o}"`);let m=x.type==="selector"||x.type==="readonly_selector",f=null,a=p;if(m)f=Ga(x,c),a=(A)=>{if(f)f.length=0,f.push(...Ga(x,c));p(A)};let $=x.subject.subscribe(o,a);return()=>{if(c.logger.info("\uD83D\uDE48",x.type,x.key,`Removing subscription "${o}"`),$(),f)for(let A of f)A()}}var Xa=(n,i,o,c)=>{let p=wn(n,c);c.logger.info("\uD83D\uDC40","timeline",n.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","timeline",n.key,`Removing subscription "${o}" from timeline`),x()}};var Ka=(n,i,o,c)=>{let p=wn(n,c);c.logger.info("\uD83D\uDC40","transaction",n.key,`Adding subscription "${o}"`);let x=p.subject.subscribe(o,i);return()=>{c.logger.info("\uD83D\uDE48","transaction",n.key,`Removing subscription "${o}"`),x()}};class so{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=Zo(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}:${Gn(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=zn(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(x)=>{On(o,i,x)}),this.unsubscribeFromState=Xi(n,(x)=>{if(x.newValue!==x.oldValue)this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=x.newValue.subscribe(c,(m)=>{On(o,i,m)})},c,o)}updateCore(n,i,o){let c=`tracker:${o.config.name}:${Gn(o)?o.transactionMeta.update.key:"main"}:${n.key}`;Xi(i,({newValue:p,oldValue:x})=>{let m=o.timelineTopics.getRelatedKey(i.key);if(m){if(o.timelines.get(m)?.timeTraveling){let $=Xa({key:m,type:"timeline"},(v)=>{$(),On(o,n,(A)=>{if(v==="redo"&&p)A.do(p);else if(v==="undo"&&x)A.undo(x);return A})},c,o);return}}let f=o.on.operationClose.subscribe(c,()=>{f();let a=zn(o,n),$=p===null?-1:a.getUpdateNumber(p),v=$-a.cacheUpdateNumber;if(p&&v===1)On(o,n,(A)=>(A.do(p),A));else o.logger.info("\u274C","mutable_atom",n.key,`could not be updated. Expected update number ${a.cacheUpdateNumber+1}, but got ${$}`)})},c,o)}mutableState;latestUpdateState;dispose;constructor(n,i){this.mutableState=n;let o=B(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.dispose=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),o.trackers.delete(n.key)}}}function $x(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=B(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."),Go(p);let x=new An,m={...i,type:"mutable_atom",install:($)=>{return $.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${$.config.name}"`),$x($,i,o)},subject:x};if(o)m.family=o;let f=i.default();c.atoms.set(m.key,m),Fm(i.key,n),Zi(i.key,f,x,c);let a=Go(m);if(i.effects){let $=0,v=[];for(let A of i.effects){let J=A({setSelf:(S)=>{On(n,a,S)},onSet:(S)=>Xi(a,S,`effect[${$}]`,n)});if(J)v.push(J);++$}m.cleanup=()=>{for(let A of v)A()}}if(new so(a,n),!o)z1(a,i,n);return a}class Ya{Update;latestUpdateAtoms;mutableAtoms;constructor(n,i){let o=ko(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=wn(o,i),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{if(c.token.family){let p=Zn(c.token.family.subKey);fi(i,this.latestUpdateAtoms,p),new so(c.token,i)}}),this.latestUpdateAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,(c)=>{if(c.token.family){let p=Zn(c.token.family.subKey),x=fi(i,this.mutableAtoms,p);if(x)new so(x,i)}})}}function cx(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 An,f=Object.assign((a)=>{let $=xn(a),v={key:i.key,subKey:$},A=`${i.key}(${$})`,J=B(n),S={key:A,default:()=>i.default(a),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)S.effects=i.effects(a);let W=$x(J,S,v);return x.next({type:"state_creation",token:W}),W},c,{subject:x,install:(a)=>cx(a,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,f),ov(f,i,n),new Ya(f,n),c}var za=(n,i)=>{let o=B(i),c=`${n.key}:JSON`;return o.families.get(c)};var ii=(n,i)=>{if(i.family){let c=B(n),x={key:`${i.family.key}:JSON`,type:"selector_family"},m=wn(x,c),f=JSON.parse(i.family.subKey);return r(n,m,f)}return{type:"selector",key:`${i.key}:JSON`}};var _o=(n)=>{let o={type:"atom",key:`*${n.key}`};if(n.family)o.family={key:`*${n.family.key}`,subKey:n.family.subKey};return o};function j1(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function mx(n,i,o){let c=i.valueMap.get(n.key),p=o.valueMap.get(n.key);if(c===p){if(c===void 0)return typeof n.default==="function"?n.default():n.default;i.logger.info("\uD83D\uDCC3","atom",n.key,"copying");let x=n.toJson(c),m=n.fromJson(x);return o.valueMap.set(n.key,m),new so(n,i),m}return p}function Zi(n,i,o,c){let p=c.valueMap.get(n);if(p instanceof ix)p.use(i);if(i instanceof Promise){let x=new ix(i);return c.valueMap.set(n,x),x.then((m)=>{Zi(n,m,o,c),o.next({newValue:m,oldValue:x})}).catch((m)=>{c.logger.error("\uD83D\uDCA5","state",n,"rejected:",m)}),x}return c.valueMap.set(n,i),i}var Q1=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&Gn(i)){let{parent:c}=i;o=mx(n,c,i)}return o},_1=(n,i)=>{let o=i.valueMap.get(n);if(o instanceof ix){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 L1=(n,i)=>{return B(i).atomsThatAreDefault.has(n)},Fm=(n,i)=>{let o=B(i);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(n)},D1=(n,i)=>{let o=B(i);o.atomsThatAreDefault=new Set(B(i).atomsThatAreDefault),o.atomsThatAreDefault.delete(n)};function Zo(n,i,o){n.logger.info("\uD83D\uDD28","atom",i.key,`creating in store "${n.config.name}"`);let c=B(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."),Go(p);let x=new An,m={...i,type:"atom",install:($)=>{return $.logger.info("\uD83D\uDEE0\uFE0F","atom",i.key,`installing in store "${$.config.name}"`),Zo($,i,o)},subject:x};if(o)m.family=o;let f=i.default;if(i.default instanceof Function)f=i.default();c.atoms.set(m.key,m),Fm(i.key,n),Zi(i.key,f,x,c);let a=Go(m);if(i.effects){let $=0,v=[];for(let A of i.effects){let J=A({setSelf:(S)=>{On(n,a,S)},onSet:(S)=>Xi(a,S,`effect[${$}]`,n)});if(J)v.push(J);++$}m.cleanup=()=>{for(let A of v)A()}}return a}function pv(n,i){if("mutable"in i){let p=$x(n,i,void 0);return n.on.atomCreation.next(p),p}let c=Zo(n,i,void 0);return n.on.atomCreation.next(c),c}function Sa(n,i){let o=B(i),{key:c,family:p}=n,x=wn(n,o);if(!p)i.logger.error("\u274C","atom",c,"Standalone atoms cannot be disposed.");else{x.cleanup?.();let m=i.valueMap.get(x.key),f=wn({key:p.key,type:"atom_family"},i),a={type:"state_disposal",subType:"atom",token:n,value:m};f.subject.next(a);let $=Gn(o);if(o.atoms.delete(c),o.valueMap.delete(c),o.selectorAtoms.delete(c),o.atomsThatAreDefault.delete(c),i.timelineTopics.delete(c),n.type==="mutable_atom"){let v=_o(n);Sa(v,i),i.trackers.delete(c)}if(i.logger.info("\uD83D\uDD25","atom",c,"deleted"),$&&o.transactionMeta.phase==="building"){let v=o.transactionMeta.update.updates.at(-1);if(!(v?.type==="molecule_disposal"&&v.values.some(([S])=>S===x.family?.key)))o.transactionMeta.update.updates.push(a)}else i.on.atomDisposal.next(n)}}function xv(n){let{stack:i}=n;if(i)return`
|
|
47
|
+
`+c)}n.destroy()}var jx=[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 yS(n){if(n+="",n.length<1)return!1;if(!jx[n.charCodeAt(0)])return xn('invalid header, index 0, char "%s"',n.charCodeAt(0)),!0;if(n.length<2)return!1;if(!jx[n.charCodeAt(1)])return xn('invalid header, index 1, char "%s"',n.charCodeAt(1)),!0;if(n.length<3)return!1;if(!jx[n.charCodeAt(2)])return xn('invalid header, index 2, char "%s"',n.charCodeAt(2)),!0;if(n.length<4)return!1;if(!jx[n.charCodeAt(3)])return xn('invalid header, index 3, char "%s"',n.charCodeAt(3)),!0;for(let i=4;i<n.length;++i)if(!jx[n.charCodeAt(i)])return xn('invalid header, index "%i", char "%s"',i,n.charCodeAt(i)),!0;return!1}});var F8=h((A8)=>{Object.defineProperty(A8,"__esModule",{value:!0});A8.Polling=void 0;var ZS=_c(),w8=Sn("zlib"),qS=vf(),PS=vi(),di=PS.default("engine:polling"),sS={gzip:w8.createGzip,deflate:w8.createDeflate};class J8 extends ZS.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 a in m)i.writeHeader(a,String(m[a]));let f=(a)=>{this.onData(a.toString()),this.onDataRequestCleanup(),i.cork(()=>{i.end("ok")})};i.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),i.onData((a,v)=>{let $=x+a.byteLength;if($>o){this.onError("content-length mismatch"),i.close();return}if(!p){if(v){f(Buffer.from(a));return}p=Buffer.allocUnsafe(o)}if(Buffer.from(a).copy(p,x),v){if($!=o){this.onError("content-length mismatch"),i.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}f(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 a=qS(this.req).encodings(["gzip","deflate"]);if(!a){m(n);return}this.compress(n,a,(v,$)=>{if(v){this.res.writeStatus("500 Internal Server Error"),this.res.end(),o(v);return}x["Content-Encoding"]=a,m($)})}compress(n,i,o){di("compressing");let c=[],p=0;sS[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}}A8.Polling=J8});var S8=h((W8)=>{Object.defineProperty(W8,"__esModule",{value:!0});W8.WebSocket=void 0;var rS=_c(),tS=vi(),R8=tS.default("engine:ws");class X8 extends rS.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",f=this.perMessageDeflate&&Buffer.byteLength(x)>this.perMessageDeflate.threshold;if(R8('writing "%s"',x),this.socket.send(x,m,f),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){R8("closing"),n&&n(),this.socket.end()}}W8.WebSocket=X8});var Y8=h((G8)=>{Object.defineProperty(G8,"__esModule",{value:!0});var gS=F8(),dS=S8();G8.default={polling:gS.Polling,websocket:dS.WebSocket}});var Q8=h((z8)=>{Object.defineProperty(z8,"__esModule",{value:!0});z8.uServer=void 0;var n9=vi(),Bc=n0(),i9=Y8(),pc=n9.default("engine:uws");class H8 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 i9.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 M8(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,f)=>this.abortRequest(n,m,f);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,f;if(m){let a=this.clients[m];if(!a)return pc("upgrade attempt for closed client"),n.close();else if(a.upgrading)return pc("transport has already been trying to upgrade"),n.close();else if(a.upgraded)return pc("transport had already been upgraded"),n.close();else pc("upgrading existing transport"),f=this.createTransport(i._query.transport,i),a._maybeUpgrade(f)}else if(f=await this.handshake(i._query.transport,i,(a,v)=>this.abortRequest(n,a,v)),!f)return;i.res.writeStatus("101 Switching Protocols"),n.upgrade({transport:f},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=H8;class M8{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 _8=h((lp)=>{Object.defineProperty(lp,"__esModule",{value:!0});lp.protocol=lp.Transport=lp.Socket=lp.uServer=lp.parser=lp.transports=lp.Server=void 0;lp.listen=f9;lp.attach=U8;var o9=Sn("http"),E8=n0();Object.defineProperty(lp,"Server",{enumerable:!0,get:function(){return E8.Server}});var c9=tv();lp.transports=c9.default;var O8=Bx();lp.parser=O8;var p9=Q8();Object.defineProperty(lp,"uServer",{enumerable:!0,get:function(){return p9.uServer}});var x9=gv();Object.defineProperty(lp,"Socket",{enumerable:!0,get:function(){return x9.Socket}});var m9=_c();Object.defineProperty(lp,"Transport",{enumerable:!0,get:function(){return m9.Transport}});lp.protocol=O8.protocol;function f9(n,i,o){if(typeof i==="function")o=i,i={};let c=o9.createServer(function(x,m){m.writeHead(501),m.end("Not Implemented")}),p=U8(c,i);return p.httpServer=c,c.listen(n,o),p}function U8(n,i){let o=new E8.Server(i);return o.attach(n,i),o}});var B8=h((A9)=>{A9.Emitter=Oi;function Oi(n){if(n)return J9(n)}function J9(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 i0=h((L8)=>{Object.defineProperty(L8,"__esModule",{value:!0});L8.hasBinary=L8.isBinary=void 0;var F9=typeof ArrayBuffer==="function",R9=(n)=>{return typeof ArrayBuffer.isView==="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer},j8=Object.prototype.toString,X9=typeof Blob==="function"||typeof Blob!=="undefined"&&j8.call(Blob)==="[object BlobConstructor]",W9=typeof File==="function"||typeof File!=="undefined"&&j8.call(File)==="[object FileConstructor]";function b8(n){return F9&&(n instanceof ArrayBuffer||R9(n))||X9&&n instanceof Blob||W9&&n instanceof File}L8.isBinary=b8;function Mf(n,i){if(!n||typeof n!=="object")return!1;if(Array.isArray(n)){for(let o=0,c=n.length;o<c;o++)if(Mf(n[o]))return!0;return!1}if(b8(n))return!0;if(n.toJSON&&typeof n.toJSON==="function"&&arguments.length===1)return Mf(n.toJSON(),!0);for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&Mf(n[o]))return!0;return!1}L8.hasBinary=Mf});var h8=h((N8)=>{Object.defineProperty(N8,"__esModule",{value:!0});N8.reconstructPacket=N8.deconstructPacket=void 0;var S9=i0();function G9(n){let i=[],o=n.data,c=n;return c.data=o0(o,i),c.attachments=i.length,{packet:c,buffers:i}}N8.deconstructPacket=G9;function o0(n,i){if(!n)return n;if(S9.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]=o0(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]=o0(n[c],i);return o}return n}function Y9(n,i){return n.data=c0(n.data,i),delete n.attachments,n}N8.reconstructPacket=Y9;function c0(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]=c0(n[o],i);else if(typeof n==="object"){for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))n[o]=c0(n[o],i)}return n}});var Lx=h((P8)=>{Object.defineProperty(P8,"__esModule",{value:!0});P8.Decoder=P8.Encoder=P8.PacketType=P8.protocol=void 0;var M9=B8(),y8=h8(),k8=i0(),z9=vi(),p0=z9.default("socket.io-parser"),l9=["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 Z8{constructor(n){this.replacer=n}encode(n){if(p0("encoding packet %j",n),n.type===yn.EVENT||n.type===yn.ACK){if(k8.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 p0("encoded %j as %s",n,i),i}encodeAsBinary(n){let i=y8.deconstructPacket(n),o=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(o),c}}P8.Encoder=Z8;function u8(n){return Object.prototype.toString.call(n)==="[object Object]"}class x0 extends M9.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(k8.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(x0.isPayloadValid(o.type,p))o.data=p;else throw new Error("invalid payload")}return p0("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 u8(i);case yn.DISCONNECT:return i===void 0;case yn.CONNECT_ERROR:return typeof i==="string"||u8(i);case yn.EVENT:case yn.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]==="number"||typeof i[0]==="string"&&l9.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=x0;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=y8.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}});var d8=h((t8)=>{Object.defineProperty(t8,"__esModule",{value:!0});t8.Client=void 0;var zf=Lx(),O9=vi(),U9=Sn("url"),$o=O9("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:zf.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=U9.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===zf.PacketType.CONNECT)this.connect(i,o);else if(c&&n.type!==zf.PacketType.CONNECT&&n.type!==zf.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}}t8.Client=r8});var lf=h((n6)=>{Object.defineProperty(n6,"__esModule",{value:!0});n6.StrictEventEmitter=void 0;var V9=Sn("events");class e8 extends V9.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)}}n6.StrictEventEmitter=e8});var m0=h((o6)=>{Object.defineProperty(o6,"__esModule",{value:!0});o6.RESERVED_EVENTS=void 0;o6.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var a0=h((p6)=>{Object.defineProperty(p6,"__esModule",{value:!0});p6.RemoteSocket=p6.BroadcastOperator=void 0;var _9=m0(),B9=Lx();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(_9.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);let o=[n,...i],c={type:B9.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,f=[],a=setTimeout(()=>{m=!0,x.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:f])},this.flags.timeout),v=-1,$=0,w=0,J=()=>{if(!m&&v===$&&f.length===w)clearTimeout(a),x.apply(this,[null,this.flags.expectSingleResponse?f[0]:f])};return this.adapter.broadcastWithAck(c,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(X)=>{w+=X,$++,J()},(X)=>{f.push(X),J()}),this.adapter.serverCount().then((X)=>{v=X,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 f0(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)}}p6.BroadcastOperator=bo;class f0{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}}p6.RemoteSocket=f0});var v0=h((Qp)=>{var a6=Qp&&Qp.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Qp,"__esModule",{value:!0});Qp.Socket=void 0;var ei=Lx(),b9=a6(vi()),L9=lf(),m6=a6(bv()),D9=a0(),N9=m0(),Hi=b9.default("socket.io:socket"),C9=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function f6(){}class v6 extends L9.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=m6.default.generateId();if(this.server._opts.connectionStateRecovery)this.pid=m6.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(N9.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++;Hi("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(()=>{Hi("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 Hi("join room %s",n),this.adapter.addAll(this.id,new Set(Array.isArray(n)?n:[n]))}leave(n){return Hi("leave room %s",n),this.adapter.del(this.id,n)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){if(Hi("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(Hi("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(Hi("emitting event %j",i),n.id!=null)Hi("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);Hi("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")Hi("calling ack %s with %j",n.id,n.data),i.apply(this,n.data),this.acks.delete(n.id);else Hi("bad ack %s",n.id)}ondisconnect(){Hi("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(n){this.emitReserved("error",n)}_onclose(n,i){if(!this.connected)return this;if(Hi("closing socket - reason %s",n),this.emitReserved("disconnecting",n,i),this.server._opts.connectionStateRecovery&&C9.has(n))Hi("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){Hi("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 Hi("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 D9.BroadcastOperator(this.adapter,new Set,new Set([this.id]),n)}}Qp.Socket=v6});var $0=h((Lo)=>{var h9=Lo&&Lo.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.Namespace=Lo.RESERVED_EVENTS=void 0;var $6=v0(),u9=lf(),I9=h9(vi()),ui=a0(),Dx=I9.default("socket.io:namespace");Lo.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class w6 extends u9.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 ui.BroadcastOperator(this.adapter).to(n)}in(n){return new ui.BroadcastOperator(this.adapter).in(n)}except(n){return new ui.BroadcastOperator(this.adapter).except(n)}async _add(n,i,o){var c;Dx("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"){Dx("next called after client was closed - ignoring socket"),p._cleanup();return}if(x)if(Dx("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){Dx("error while restoring session: %s",x)}if(p)return Dx("connection state recovered for sid %s",p.sid),new $6.Socket(this,n,i,p)}return new $6.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 ui.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(Lo.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 ui.BroadcastOperator(this.adapter).allSockets()}compress(n){return new ui.BroadcastOperator(this.adapter).compress(n)}get volatile(){return new ui.BroadcastOperator(this.adapter).volatile}get local(){return new ui.BroadcastOperator(this.adapter).local}timeout(n){return new ui.BroadcastOperator(this.adapter).timeout(n)}fetchSockets(){return new ui.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(n){return new ui.BroadcastOperator(this.adapter).socketsJoin(n)}socketsLeave(n){return new ui.BroadcastOperator(this.adapter).socketsLeave(n)}disconnectSockets(n=!1){return new ui.BroadcastOperator(this.adapter).disconnectSockets(n)}}Lo.Namespace=w6});var W6=h((R6)=>{Object.defineProperty(R6,"__esModule",{value:!0});R6.yeast=R6.decode=R6.encode=void 0;var T6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Qf=64,F6={},J6=0,xc=0,A6;function w0(n){let i="";do i=T6[n%Qf]+i,n=Math.floor(n/Qf);while(n>0);return i}R6.encode=w0;function y9(n){let i=0;for(xc=0;xc<n.length;xc++)i=i*Qf+F6[n.charAt(xc)];return i}R6.decode=y9;function k9(){let n=w0(+new Date);if(n!==A6)return J6=0,A6=n;return n+"."+w0(J6++)}R6.yeast=k9;for(;xc<Qf;xc++)F6[T6[xc]]=xc});var T0=h((S6)=>{var J0;Object.defineProperty(S6,"__esModule",{value:!0});S6.SessionAwareAdapter=S6.Adapter=void 0;var P9=Sn("events"),s9=W6(),Ef=Sn("ws"),r9=typeof((J0=Ef===null||Ef===void 0?void 0:Ef.Sender)===null||J0===void 0?void 0:J0.frame)==="function";class A0 extends P9.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),f=0;this.apply(i,(a)=>{if(f++,a.acks.set(n.id,c),typeof a.notifyOutgoingListeners==="function")a.notifyOutgoingListeners(n);a.client.writeToEngine(m,x)}),o(f)}_encode(n,i){let o=this.encoder.encode(n);if(r9&&o.length===1&&typeof o[0]==="string"){let c=Buffer.from("4"+o[0]);i.wsPreEncodedFrame=Ef.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 f=this.nsp.sockets.get(m);if(f)i(f),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}}S6.Adapter=A0;class K6 extends A0{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 f=this.packets[m];if(t9(o.rooms,f.opts))x.push(f.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=s9.yeast();n.data.push(m),this.packets.push({id:m,opts:i,data:n.data,emittedAt:Date.now()})}super.broadcast(n,i)}}S6.SessionAwareAdapter=K6;function t9(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 H6=h((wo)=>{var d9=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 e9=T0(),nG=vi(),iG=Sn("crypto"),qn=nG.debug("socket.io-adapter"),oG="emitter",Of=5000;function Op(){return iG.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 jc(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 F0 extends e9.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=d9(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:jc(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:jc(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:jc(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:jc(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:jc(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,f)=>{let a=setTimeout(()=>{let $=this.requests.get(x);if($)f(new Error(`timeout reached: only ${$.current} responses received out of ${$.expected}`)),this.requests.delete(x)},n.flags.timeout||Of),v={type:on.FETCH_SOCKETS,resolve:m,timeout:a,current:0,expected:p,responses:o};this.requests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:jc(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 f=this.requests.get(p);if(f)o(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`),f.responses),this.requests.delete(p)},Of),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)})}}wo.ClusterAdapter=F0;class Y6 extends F0{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!==oG)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 f=this.customRequests.get(p);if(f)o(new Error(`timeout reached: missing ${f.missingUids.size} responses`),f.responses),this.customRequests.delete(p)},Of),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,f)=>{let a=setTimeout(()=>{let $=this.customRequests.get(x);if($)f(new Error(`timeout reached: missing ${$.missingUids.size} responses`)),this.customRequests.delete(x)},n.flags.timeout||Of),v={type:on.FETCH_SOCKETS,resolve:m,timeout:a,missingUids:new Set([...this.nodesMap.keys()]),responses:o};this.customRequests.set(x,v),this.publish({type:on.FETCH_SOCKETS,data:{opts:jc(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)}}wo.ClusterAdapterWithHeartbeat=Y6});var Uf=h((bc)=>{Object.defineProperty(bc,"__esModule",{value:!0});bc.MessageType=bc.ClusterAdapterWithHeartbeat=bc.ClusterAdapter=bc.SessionAwareAdapter=bc.Adapter=void 0;var M6=T0();Object.defineProperty(bc,"Adapter",{enumerable:!0,get:function(){return M6.Adapter}});Object.defineProperty(bc,"SessionAwareAdapter",{enumerable:!0,get:function(){return M6.SessionAwareAdapter}});var R0=H6();Object.defineProperty(bc,"ClusterAdapter",{enumerable:!0,get:function(){return R0.ClusterAdapter}});Object.defineProperty(bc,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return R0.ClusterAdapterWithHeartbeat}});Object.defineProperty(bc,"MessageType",{enumerable:!0,get:function(){return R0.MessageType}})});var E6=h((Up)=>{var pG=Up&&Up.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Up,"__esModule",{value:!0});Up.ParentNamespace=void 0;var z6=$0(),xG=Uf(),mG=pG(vi()),l6=mG.default("socket.io:parent-namespace");class Vf extends z6.Namespace{constructor(n){super(n,"/_"+Vf.count++);this.children=new Set}_initAdapter(){this.adapter=new Q6(this)}emit(n,...i){return this.children.forEach((o)=>{o.emit(n,...i)}),!0}createChild(n){l6("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)l6("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=Vf;Vf.count=0;class Q6 extends xG.Adapter{broadcast(n,i){this.nsp.children.forEach((o)=>{o.adapter.broadcast(n,i)})}}});var j6=h((Dc)=>{var fG=Dc&&Dc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Dc,"__esModule",{value:!0});Dc.patchAdapter=vG;Dc.restoreAdapter=$G;Dc.serveFile=JG;var Lc=Uf(),O6=Sn("fs"),aG=fG(vi()),_f=aG.default("socket.io:adapter-uws"),X0="\x1F",{addAll:V6,del:_6,broadcast:B6}=Lc.Adapter.prototype;function vG(n){Lc.Adapter.prototype.addAll=function(i,o){let c=!this.sids.has(i);V6.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"){U6(this.nsp.name,p,c,o);return}if(c)p.conn.on("upgrade",()=>{let x=this.sids.get(i);if(x)U6(this.nsp.name,p,c,x)})},Lc.Adapter.prototype.del=function(i,o){_6.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}${X0}${o}`;_f("unsubscribe connection %s from topic %s",p,m),x.unsubscribe(m)}},Lc.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),f=o.rooms.size===0?this.nsp.name:`${this.nsp.name}${X0}${o.rooms.keys().next().value}`;_f("fast publish to %s",f),m.forEach((a)=>{let v=typeof a!=="string";n.publish(f,v?a:"4"+a,v)}),this.apply(o,(a)=>{if(a.conn.transport.name!=="websocket")a.client.writeToEngine(m,x)})}}function U6(n,i,o,c){let p=i.conn.id,x=i.conn.transport.socket;if(o)_f("subscribe connection %s to topic %s",p,n),x.subscribe(n);c.forEach((m)=>{let f=`${n}${X0}${m}`;_f("subscribe connection %s to topic %s",p,f),x.subscribe(f)})}function $G(){Lc.Adapter.prototype.addAll=V6,Lc.Adapter.prototype.del=_6,Lc.Adapter.prototype.broadcast=B6}var wG=(n)=>{let{buffer:i,byteOffset:o,byteLength:c}=n;return i.slice(o,o+c)};function JG(n,i){let{size:o}=O6.statSync(i),c=O6.createReadStream(i),p=()=>!c.destroyed&&c.destroy(),x=(f)=>{throw p(),f},m=(f)=>{let a=wG(f);n.cork(()=>{let v=n.getWriteOffset(),[$,w]=n.tryEnd(a,o);if(!w&&!$)c.pause(),n.onWritable((J)=>{let[X,W]=n.tryEnd(a.slice(J-v),o);if(!W&&X)c.resume();return X})})};n.onAborted(p),c.on("data",m).on("error",x).on("end",p)}});var b6=h((uN,AG)=>{AG.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 k6=h((Mi,Nx)=>{var __dirname="/home/runner/work/wayforge/wayforge/node_modules/.pnpm/socket.io@4.8.1/node_modules/socket.io/dist",TG=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]}),FG=Mi&&Mi.__setModuleDefault||(Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i}),RG=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))TG(i,n,o)}return FG(i,n),i},I6=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 XG=Sn("http"),WG=Sn("fs"),W0=Sn("zlib"),KG=vf(),Bf=Sn("stream"),L6=Sn("path"),D6=_8(),SG=d8(),N6=Sn("events"),S0=$0();Object.defineProperty(Mi,"Namespace",{enumerable:!0,get:function(){return S0.Namespace}});var GG=E6(),C6=Uf(),YG=RG(Lx()),HG=I6(vi()),y6=v0();Object.defineProperty(Mi,"Socket",{enumerable:!0,get:function(){return y6.Socket}});var MG=lf(),K0=j6(),zG=I6(ev()),bi=HG.default("socket.io:server"),h6=b6().version,u6=/\.map/;class Vp extends MG.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||YG,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||C6.SessionAwareAdapter);else this.adapter(i.adapter||C6.Adapter);if(i.cleanupEmptyChildNamespaces=!!i.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),n||typeof n=="number")this.attach(n);if(this.opts.cors)this._corsMiddleware=zG.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,f)=>{if(m||!f)return p();if(this._nsps.has(n))return bi("dynamic namespace %s already exists",n),o(this._nsps.get(n));let a=this.parentNsps.get(x.value).createChild(n);bi("dynamic namespace %s was created",n),o(a)})};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=XG.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 D6.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=u6.test(x),f=m?"map":"source",a='"'+h6+'"',v="W/"+a,$=p.getHeader("if-none-match");if($){if(a===$||v===$){bi("serve client %s 304",f),c.writeStatus("304 Not Modified"),c.end();return}}bi("serve client %s",f),c.writeHeader("cache-control","public, max-age=0"),c.writeHeader("content-type","application/"+(m?"json":"javascript")+"; charset=utf-8"),c.writeHeader("etag",a);let w=L6.join(__dirname,"../client-dist/",x);K0.serveFile(c,w)});K0.patchAdapter(n)}initEngine(n,i){if(bi("creating engine.io instance with opts %j",i),this.eio=D6.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=u6.test(o),p=c?"map":"source",x='"'+h6+'"',m="W/"+x,f=n.headers["if-none-match"];if(f){if(x===f||m===f){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=WG.createReadStream(L6.join(__dirname,"../client-dist/",n)),p=KG(i).encodings(["br","gzip","deflate"]),x=(m)=>{if(m)o.end()};switch(p){case"br":o.writeHead(200,{"content-encoding":"br"}),Bf.pipeline(c,W0.createBrotliCompress(),o,x);break;case"gzip":o.writeHead(200,{"content-encoding":"gzip"}),Bf.pipeline(c,W0.createGzip(),o,x);break;case"deflate":o.writeHead(200,{"content-encoding":"deflate"}),Bf.pipeline(c,W0.createDeflate(),o,x);break;default:o.writeHead(200),Bf.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 SG.Client(this,n);if(n.protocol===3)i.connect("/");return this}of(n,i){if(typeof n==="function"||n instanceof RegExp){let c=new GG.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 S0.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(),K0.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 lG=Object.keys(N6.EventEmitter.prototype).filter(function(n){return typeof N6.EventEmitter.prototype[n]==="function"});lG.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=S0.Namespace;Nx.exports.Socket=y6.Socket});import{createHash as gR}from"crypto";import{createServer as k2}from"http";import{createServer as Z2}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 Y$(n){return Object.entries(n)}var H$=(n,i,o=d.STORE)=>{return wa(o,{key:`${n.key}:JSON`,get:({get:c})=>i.toJson(c(n)),set:({set:c},p)=>{c(n,i.fromJson(p))}})};function B(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 Ja 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,f=Object.assign((a)=>{let v=wn(a),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=B(n),X=i.default,W={key:w,default:X instanceof Function?X(a):X};if(i.effects)W.effects=i.effects(a);let R=Ac(J,W,$);return x.next({type:"state_creation",token:R}),R},c,{subject:x,install:(a)=>Jc(a,i),internalRoles:o});return n.families.set(i.key,f),n.defaults.set(i.key,i.default),c}function M$(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,f=Object.assign((a)=>{let v=wn(a),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=B(n),X=xx(J,{key:w,get:i.get(a)},$);return x.next({type:"state_creation",token:X}),X},c,{internalRoles:o,subject:x,install:(a)=>Io(a,i),default:(a)=>{return i.get(a)({get:(...$)=>Hn(n,...$),find:(...$)=>r(n,...$),json:($)=>ni(n,$)})}});return n.families.set(i.key,f),c}function z$(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 d3={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function l$(n,i){let o=wn(i),c=`${n.key}(${o})`,p=d3[n.type],x={key:c,type:p};return Object.assign(x,{family:{key:n.key,subKey:o}}),Object.assign(x,{counterfeit:!0}),x}function So(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 f of p)x??=f,m??=f,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)}}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),f=i[x];this.setContent(m,f)}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 oi(n){return"epoch"in n.transactionMeta}function Gn(n){return"phase"in n.transactionMeta}var Q$=(n)=>{let i=B(n);if(!Gn(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 Ko(n){return n.type.split("_").map(Mn).join(" ")}class Tc extends Error{constructor(n,i){super(`${Ko(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 am=(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"),E$(i,n);if(i.type==="selector"||i.type==="readonly_selector")return n.logger.info("\uD83E\uDDEE",i.type,i.key,"computing value"),i.get();let o=i.default instanceof Function?i.default():i.default;return n.logger.info("\uD83D\uDC81","atom",i.key,"could not find cached value; using default",o),i.default instanceof Function?i.default():i.default};var O$=(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}"${!Gn(n)?"":` ${n.transactionMeta.phase} "${n.transactionMeta.update.key}"`}`)},U$=(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)},V$=(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 _$=(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;default:n.logger.info("\uD83D\uDCE2",i.type,i.key,"went (",o.oldValue,"->",o.newValue,") subscribers:",i.subject.subscribers)}i.subject.next(o)};var Aa=(n,i)=>{let o=B(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(V$(o,p))continue;B$(p,o),dc(o,p)}}};function e3(n,i){if(b$(i.newValue))return!1;if(n.includes("\uD83D\uDD0D"))return!1;return!0}var j$=(n,i,o)=>{let{key:c}=i,p=B(n);if(!Gn(p)||p.transactionMeta.phase!=="building"){n.logger.error("\uD83D\uDC1E","atom",c,"stowUpdate called outside of a transaction. This is probably a bug.");return}if(!e3(c,o))return;let m={type:"atom_update",key:c,...o};if(i.family)m.family=i.family;p.transactionMeta.update.updates.push(m),n.logger.info("\uD83D\uDCC1","atom",c,"stowed (",o.oldValue,"->",o.newValue,")")};var L$=(n,i,o)=>{let c=yo(o,n),p=c;if(n.type==="mutable_atom"&&Gn(o)){let{parent:m}=o;p=fx(o,n,m)}if(p=am(i)(p),o.logger.info("\uD83D\uDCDD","atom",n.key,"set to",p),p=ki(o,n.key,p,n.subject),D$(o,n.key))N$(o,n.key);dc(o,n.key),Aa(o,n);let x={oldValue:c,newValue:p};if(oi(o))_$(o,n,x);else if(o.parent){if(o.on.transactionApplying.state===null)j$(o,n,x);else if(n.key.startsWith("*")){let m=n.key.slice(1),f=o.atoms.get(m),a=o.valueMap.get(m);if(f.type==="mutable_atom"&&Gn(o)){let{parent:$}=o;a=fx(o,f,$)}if(a.do(x.newValue)===null)Aa(o,f)}}};var vm=(n,i,o)=>{switch(i.type){case"atom":case"mutable_atom":L$(i,o,n);break;case"selector":i.set(o);break}};function C$(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=C$(n,o)??null,c)p=o.family?mi(o.family.subKey):null,o=r(n,c,p)}else c=i[0],p=i[1],x=i[2],o=r(n,c,p);if("counterfeit"in o&&"family"in o){let a=o.family.subKey,v=n.disposalTraces.buffer.find(($)=>$?.key===a);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=O$(n,o);if(m){let a=n.on.operationClose.subscribe(`waiting to set "${o.key}" at T-${m}`,()=>{a(),n.logger.info("\uD83D\uDFE2",o.type,o.key,`resuming deferred setState from T-${m}`),On(n,o,x)});return}let f=Fn(n,o);vm(n,f,x),U$(n)}function $m(n,i,o){let{key:c,newValue:p,oldValue:x}=i,m=n==="newValue"?p:x,f={key:c,type:"atom"};if(i.family)Object.assign(f,{family:i.family});On(o,f,m)}function h$(n){let{stack:i}=n;if(i)return`
|
|
50
49
|
`+i.split(`
|
|
51
50
|
`)?.slice(1)?.join(`
|
|
52
|
-
`);return""}function
|
|
53
|
-
${
|
|
54
|
-
${
|
|
51
|
+
`);return""}function u$(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=[],f=B(n);if(Array.isArray(p))for(let $ of p){let w=wn($);if(f.molecules.get(w))n.moleculeGraph.set(w,x,{source:w});else m.push(w)}else{let $=wn(p);if(f.molecules.get($))n.moleculeGraph.set($,x,{source:$});else m.push($)}if(m.length===0)f.molecules.set(x,{key:o,stringKey:x,dependsOn:c});let a={type:"molecule_creation",key:o,provenance:p};if(Gn(f)&&f.transactionMeta.phase==="building")f.transactionMeta.update.updates.push(a);else f.on.moleculeCreation.next(a);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
|
+
${$} was most recently disposed
|
|
53
|
+
${w.trace}`:`No previous disposal trace for ${$} was found.`)}return o}function I$(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 X=n.disposalTraces.buffer.find((W)=>W?.key===o);n.logger.error("\u274C","molecule",i,"deallocation failed:",`Could not find allocation for ${o} in store "${n.config.name}".`,X?`
|
|
55
54
|
This state was most recently deallocated
|
|
56
|
-
${
|
|
55
|
+
${X.trace}`:`No previous disposal trace for ${o} was found.`);return}let p=n.moleculeJoins.getRelatedKeys(c.key);if(p)for(let X of p){let W=n.joins.get(X);if(W)W.relations.delete(c.key),W.molecules.delete(c.stringKey)}n.moleculeJoins.delete(c.stringKey);let x=[],m=[],f={type:"molecule_disposal",key:c.key,values:m,provenance:x},a=B(n);a.molecules.delete(o);let v=Gn(a)&&a.transactionMeta.phase==="building";if(v)a.transactionMeta.update.updates.push(f);let $=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey});if($)for(let[X,{source:W}]of $)if(W===c.stringKey){let R=mi(X);Rc(n,R)}else x.push(W);let w=a.moleculeData.getRelatedKeys(c.stringKey);if(w)for(let X of w){let W=a.families.get(X),R=r(n,W,c.key);m.push([W.key,R]),Xc(n,R)}if(a.moleculeGraph.delete(c.stringKey),a.moleculeJoins.delete(c.stringKey),a.moleculeData.delete(c.stringKey),!v)a.on.moleculeDisposal.next(f);a.molecules.delete(c.stringKey);let J=h$(new Error);n.disposalTraces.add({key:o,trace:J})}function ec(n,i,o,c){let p=wn(o),x=B(n),m=x.molecules.get(p);if(!m){let J=n.disposalTraces.buffer.find((X)=>X?.key===p);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${p} in store "${n.config.name}".`,J?`
|
|
57
56
|
${p} was most recently disposed
|
|
58
|
-
${J.trace}`:`No previous disposal trace for ${p} was found.`),o}let f=
|
|
57
|
+
${J.trace}`:`No previous disposal trace for ${p} was found.`),o}let f=wn(i),a=x.molecules.get(f);if(!a){let J=n.disposalTraces.buffer.find((X)=>X?.key===f);return n.logger.error("\u274C","molecule",o,"claim failed:",`Could not allocate to ${f} in store "${n.config.name}".`,J?`
|
|
59
58
|
${f} was most recently disposed
|
|
60
|
-
${J.trace}`:`No previous disposal trace for ${f} was found.`),o}let $=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:m.stringKey}).filter(([,{source:J}])=>J!==p).map(([J])=>Zn(J));if(c)x.moleculeGraph.delete(p);x.moleculeGraph.set({upstreamMoleculeKey:a.stringKey,downstreamMoleculeKey:m.stringKey},{source:a.stringKey});let v={type:"molecule_transfer",key:m.key,from:$,to:[a.key]};if(Gn(x)&&x.transactionMeta.phase==="building")x.transactionMeta.update.updates.push(v);return o}class fv{store;constructor(n=t.STORE){this.store=n,mv("root",n)}allocate(n,i,o){return dc(this.store,n,i,o)}fuse(n,i,o){return iW(this.store,n,i,o)}deallocate(n){ec(this.store,n)}claim(n,i,o){return fx(this.store,n,i,o)}}class Ma{store;realm;constructor(n=t.STORE){this.store=n,this.realm=new fv(n)}allocate(n,i,o){dc(this.store,n,i,o)}deallocate(n){ec(this.store,n)}claim(n,i,o){fx(this.store,n,i,o)}}function ro(n){return pv(t.STORE,n)}function Wc(n){return M1(t.STORE,n)}var la=(n)=>(i,o,c,p,...x)=>{console[n](`${i} ${o} "${c}" ${p}`,...x)},oW={error:la("error"),info:la("info"),warn:la("warn")};class Sc{logLevel;filter;logger;constructor(n,i,o=oW){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)}}function Rm(n){return Ja(t.STORE,n)}function Xc(n){return Ra(n,t.STORE)}class pi extends Set{mode="record";subject=new An;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof pi)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 pi(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:${xn(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:${xn(n)}`);return i}parent;child=null;transactionUpdates=null;transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new pi(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.error("Failed to apply transaction to SetRTX:",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 f=!1;while(!f){this.cacheIdx%=this.cacheLimit;let $=this.cache[this.cacheIdx];if(this.cacheIdx--,!$)return"OUT_OF_RANGE";this.undo($),f=this.cacheIdx===x-1}let a=n.substring(i+1);return this.doStep(a),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}}function Dn(n){return n[0].toUpperCase()+n.slice(1)}class Ha{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=t.STORE){this.store=o,this.realm=new Ma(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)=>zn(o,...G),set:(...G)=>{On(o,...G)},find:(...G)=>r(o,...G),seek:(...G)=>fi(o,...G),json:(G)=>ii(o,G)};let c=n.between[0],p=n.between[1],x=cx(o,{key:`${n.key}/relatedKeys`,default:()=>new pi,mutable:!0,fromJson:(G)=>pi.fromJSON(G),toJson:(G)=>G.toJSON()},["join","relations"]);this.core={relatedKeysAtoms:x};let m=({get:G},H)=>G(x,H),f=({set:G},H,O)=>{if(!this.store.molecules.has(xn(H)))this.realm.allocate(n.key,H);G(x,H,(Q)=>Q.add(O)),G(x,O,(Q)=>Q.add(H))},a=({set:G},H,O)=>{G(x,H,(Q)=>{return Q.delete(O),Q}),G(x,O,(Q)=>{return Q.delete(H),Q})},$=(G,H,O)=>{let{find:Q,get:j,set:y}=G,l=Q(x,H),an=j(l);for(let Z of an){if(O.includes(Z))continue;y(x,Z,(Qn)=>{return Qn.delete(H),Qn})}y(l,(Z)=>{return Z.transaction(($n)=>{$n.clear();for(let Qn of O){let dn=m(G,Qn),Bi=dn.has(H);if(this.relations.cardinality==="1:n"){let Uo=[];for(let E of dn){if(E===H)continue;let q=m(G,E);if(q.delete(Qn),q.size===0)Uo.push(E)}if(!Bi&&dn.size>0)dn.clear();for(let E of Uo){let q=[Qn,E].sort(),Rn=`"${q[0]}:${q[1]}"`;this.molecules.delete(Rn)}}if(!Bi)dn.add(H);$n.add(Qn)}return!0}),Z})},v=(G,H,O)=>{let{set:Q}=G;Q(x,H,(j)=>{return j.transaction((y)=>{for(let l of O)y.add(l);return!0}),j});for(let j of O)Q(x,j,(y)=>{return y.add(H),y});return!0},A=(G,H,O)=>{let Q=m(G,H);return O?Q.has(O):Q.size>0},J={getRelatedKeys:(G)=>m(this.toolkit,G),addRelation:(G,H)=>{this.store.moleculeJoins.set(G,n.key),this.store.moleculeJoins.set(H,n.key),f(this.toolkit,G,H)},deleteRelation:(G,H)=>{a(this.toolkit,G,H)},replaceRelationsSafely:(G,H)=>{$(this.toolkit,G,H)},replaceRelationsUnsafely:(G,H)=>{v(this.toolkit,G,H)},has:(G,H)=>A(this.toolkit,G,H)},S,W;if(i){W=ko(o,{key:`${n.key}/content`,default:i},["join","content"]);let G=({get:Q},j)=>Q(W,j),H=({set:Q},j,y)=>{Q(W,j,y)};S=Object.assign(J,{getContent:(Q)=>{return G(this.toolkit,Q)},setContent:(Q,j)=>{H(this.toolkit,Q,j)},deleteContent:(Q)=>{this.realm.deallocate(Q)}})}else S=J;let R=new oi(n,{externalStore:S,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...G)=>{let[H,O]=G,Q=G.sort(),j=`${Q[0]}:${Q[1]}`,y=o.molecules.get(xn(H)),l=o.molecules.get(xn(O));if(!y)this.realm.allocate(n.key,H);if(!l)this.realm.allocate(n.key,O);return this.realm.allocate(H,j,"all"),this.realm.claim(O,j),this.store.moleculeJoins.set(j,n.key),j}}),K=()=>qo(o,{key:`${n.key}/singleRelatedKey`,get:(G)=>({get:H})=>{let O=H(x,G);for(let Q of O)return Q;return null}},["join","keys"]),z=()=>{return qo(o,{key:`${n.key}/multipleRelatedKeys`,get:(G)=>({get:H})=>{let O=za(x,o);return H(O,G).members}},["join","keys"])},M=()=>qo(o,{key:`${n.key}/singleRelatedEntry`,get:(G)=>({get:H})=>{let O=H(x,G);for(let Q of O){let j=R.isAType?.(G)?G:void 0,y=j===void 0?G:void 0;j??=Q,y??=Q;let l=R.makeContentKey(j,y),an=H(W,l);return[Q,an]}return null}},["join","entries"]),h=()=>qo(o,{key:`${n.key}/multipleRelatedEntries`,get:(G)=>({get:H})=>{let O=za(x,o);return H(O,G).members.map((j)=>{let y=R.isAType?.(G)?G:void 0,l=y===void 0?G:void 0;y??=j,l??=j;let an=R.makeContentKey(y,l),Z=H(W,an);return[j,Z]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let G=K(),H=`${c}KeyOf${Dn(p)}`,O=`${p}KeyOf${Dn(c)}`,Q={[H]:G,[O]:G},j;if(i){let y=M(),l=`${c}EntryOf${Dn(p)}`,an=`${p}EntryOf${Dn(c)}`,Z={[l]:y,[an]:y};j=Object.assign(Q,Z)}else j=Q;this.relations=R,this.states=j;break}case"1:n":{let G=K(),H=z(),O=`${c}KeyOf${Dn(p)}`,Q=`${p}KeysOf${Dn(c)}`,j={[O]:G,[Q]:H},y;if(i){let l=M(),an=h(),Z=`${c}EntryOf${Dn(p)}`,$n=`${p}EntriesOf${Dn(c)}`,Qn={[Z]:l,[$n]:an};y=Object.assign(j,Qn)}else y=j;this.relations=R,this.states=y;break}default:{let G=z(),H=`${c}KeysOf${Dn(p)}`,O=`${p}KeysOf${Dn(c)}`,Q={[H]:G,[O]:G},j;if(i){let y=h(),l=`${c}EntriesOf${Dn(p)}`,an=`${p}EntriesOf${Dn(c)}`,Z={[l]:y,[an]:y};j=Object.assign(Q,Z)}else j=Q;this.relations=R,this.states=j}}}}function Sm(n,i,o=t.STORE){return o.joins.set(n.key,new Ha(n,i,o)),{key:n.key,type:"join",a:n.between[0],b:n.between[1],cardinality:n.cardinality}}function Qa(n,i){let o=i.joins.get(n.key);if(o===void 0){let p=t.STORE.joins.get(n.key);if(p===void 0)throw new Error(`Join "${n.key}" not found in store "${i.config.name}"`);o=new Ha(p.options,p.defaultContent,i),i.joins.set(n.key,o)}return o}function vx(n,i,o){let c=Qa(n,o),p;switch(n.cardinality){case"1:1":{let x=`${n.a}KeyOf${Dn(n.b)}`,m=`${n.b}KeyOf${Dn(n.a)}`;p={get[x](){let a=c.states[x];return r(o,a,i)},get[m](){let a=c.states[m];return r(o,a,i)}};let f=`${n.a}EntryOf${Dn(n.b)}`;if(f in c.states){let a=`${n.b}EntryOf${Dn(n.a)}`;Object.assign(p,{get[f](){let $=c.states[f];return r(o,$,i)},get[a](){let $=c.states[a];return r(o,$,i)}})}break}case"1:n":{let x=`${n.a}KeyOf${Dn(n.b)}`,m=`${n.b}KeysOf${Dn(n.a)}`;p={get[x](){let a=c.states[x];return r(o,a,i)},get[m](){let a=c.states[m];return r(o,a,i)}};let f=`${n.a}EntryOf${Dn(n.b)}`;if(f in c.states){let a=`${n.b}EntriesOf${Dn(n.a)}`;Object.assign(p,{get[f](){let $=c.states[f];return r(o,$,i)},get[a](){let $=c.states[a];return r(o,$,i)}})}break}case"n:n":{let x=`${n.a}KeysOf${Dn(n.b)}`,m=`${n.b}KeysOf${Dn(n.a)}`;p={get[x](){let a=c.states[x];return r(o,a,i)},get[m](){let a=c.states[m];return r(o,a,i)}};let f=`${n.a}EntriesOf${Dn(n.b)}`;if(f in c.states){let a=`${n.b}EntriesOf${Dn(n.a)}`;Object.assign(p,{get[f](){let $=c.states[f];return r(o,$,i)},get[a](){let $=c.states[a];return r(o,$,i)}})}}}return p}function Kc(n,i,o){let c=Qa(n,o),p=B(o);if(Gn(p)){let{toolkit:x}=p.transactionMeta;c.transact(x,({relations:m})=>{i(m)})}else i(c.relations)}function cW(n,i){return Qa(n,i).core.relatedKeysAtoms}function av(n){return cW(n,t.STORE)}class $v 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{key;type="continuity";globals=[];actions=[];perspectives=[];constructor(n){this.key=n}static existing=new $v;static create(n,i){let o=new Wm(n),{type:c,globals:p,actions:x,perspectives:m}=i(o),f={type:c,key:n,globals:p,actions:x,perspectives:m};return Wm.existing.set(n,f),f}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":{let[o,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:o,viewAtoms:c})}break}return this}}function vv(n){let{key:i,config:o}=n,c=Wm.create(i,o),{actions:p}=c;for(let x of p)q1(i,x.key,t.STORE);return y1(i,-1,t.STORE),c}var PU=ro({key:"usersInRoomIndex",mutable:!0,default:()=>new pi,toJson:(n)=>n.toJSON(),fromJson:(n)=>pi.fromJSON(n)}),Oa=ro({key:"roomIndex",default:()=>new pi,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>pi.fromJSON(n)}),pW={enteredAtEpoch:0},Ax=Sm({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},pW),sU=Rm({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=av(Ax);return[i(o,n)]}});import{spawn as xW}from"child_process";class np{emit;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";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 np{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}}}constructor(n,i,o){super((c,...p)=>{let x=JSON.stringify([c,...p])+"\x03",m=(f)=>{if(f.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=Zn(this.incompleteData);this.handleEvent(...m);while(this.unprocessedEvents.length>0){let f=this.unprocessedEvents.shift();if(f){if(this.unprocessedEvents.length===0)this.incompleteData=f;m=Zn(f),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=Zn(this.incompleteLog);this.handleLog(m);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)m=Zn(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 Av extends np{in;out;id="no_id_retrieved";disposalFunctions=[];constructor(n){super((...i)=>{return this.out.next(i),this});this.id=n,this.in=new An,this.out=new An,this.in.subscribe("socket",(i)=>{this.handleEvent(...i)})}dispose(){for(let n of this.disposalFunctions)n()}}class Ea extends np{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(xn(n.map((i)=>i instanceof pi?`{ ${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=Zn(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=Zn(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 Av(`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 Ua=Wc({key:"roomArguments",default:["echo",["Hello World!"]]}),Jv=Rm({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(Ua,n),p=i(c),[x,m]=p,f=await new Promise((a)=>{let $=xW(x,m,{env:process.env}),v=(A)=>{if(A.toString()==="ALIVE")$.stdout.off("data",v),a($)};$.stdout.on("data",v)});return new Jx(f,n)}});var YV=Xc({key:"createRoom",do:({get:n,set:i,find:o},c,p,x)=>{let m=x?[p,x]:[p],f=o(Ua,c);i(f,m),i(Oa,(v)=>v.add(c));let a=o(Jv,c);return n(a)}}),zV=Xc({key:"joinRoom",do:(n,i,o,c)=>{let p={enteredAtEpoch:c};return Kc(Ax,(x)=>{x.set({room:i,user:o},p)},n.env().store),p}}),MV=Xc({key:"leaveRoom",do:(n,i,o)=>{Kc(Ax,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),lV=Xc({key:"destroyRoom",do:(n,i)=>{Kc(Ax,(o)=>{o.delete({room:i})},n.env().store),n.set(Oa,(o)=>(o.delete(i),o))}});function Va(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=Va(n,o.updates);return{...o,updates:c}}default:return o}}).filter((o)=>{switch(o.type){case"atom_update":case"selector_update":return n.includes(o.key);case"state_creation":return n.includes(o.token.key);case"molecule_creation":return!0;case"transaction_update":return!0}})}var OV=Wc({key:"redactor",default:{occlude:(n)=>n}}),ip=Wc({key:"unacknowledgedUpdates",default:()=>[]});var Xm=Wc({key:"sockets",default:null}),_a=ro({key:"socketsIndex",mutable:!0,default:()=>new pi,toJson:(n)=>n.toJSON(),fromJson:(n)=>pi.fromJSON(n)}),Ba=ro({key:"usersIndex",mutable:!0,default:()=>new pi,toJson:(n)=>n.toJSON(),fromJson:(n)=>pi.fromJSON(n)}),Gc=Sm({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function wv(n,i,o,c){let p=i.key;return function x(){let m=[];for(let a of i.globals){let $=a.type==="mutable_atom"?ii(n,a):a,v=zn(n,$);m.push($,v)}for(let a of i.perspectives){let{viewAtoms:$,resourceAtoms:v}=a,A=r(n,$,o),J=zn(n,A);n.logger.info("\uD83D\uDC41","atom",v.key,`${o} can see`,{viewAtoms:$,resourceAtoms:v,userView:J});for(let S of J){let W=S.type==="mutable_atom"?ii(n,S):S,R=zn(n,W);m.push(W,R)}}let f=ci(n)?n.transactionMeta.epoch.get(p)??null:null;c?.emit(`continuity-init:${p}`,f,m)}}function Tv(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:f}=x,a=`tx-run:${m}:${f}`,$=`${a}:start`,v=`${a}:end`;performance.mark($);try{tc({type:"transaction",key:m},f,n)(...x.params)}catch(J){if(J instanceof Error)n.logger.error("\u274C","continuity",c,`failed to run transaction ${m} from ${o} with update ${f}`,J.message)}performance.mark(v);let A=performance.measure(a,$,v);n?.logger.info("\uD83D\uDE80","transaction",m,f,o,A.duration)}}function Fv(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,ip,o,(a)=>{return a.shift(),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,a.length,"items"),a})}}function Rv(n,i,o,c){let p=i.key,x=[];for(let m of i.actions){let f=Ka(m,(a)=>{try{let $=i.globals.map((J)=>{if(J.type==="atom")return J.key;return _o(J).key}).concat(i.perspectives.flatMap((J)=>{let{viewAtoms:S}=J,W=r(n,S,o);return zn(n,W).map((K)=>{return K.type==="mutable_atom"?"*"+K.key:K.key})})),v=Va($,a.updates),A={...a,updates:v};On(n,ip,o,(J)=>{if(A)J.push(A),J.sort((S,W)=>S.epoch-W.epoch),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,J.length,"items");return J}),c?.emit(`tx-new:${p}`,A)}catch($){if($ instanceof Error)n.logger.error("\u274C","continuity",p,`${o} failed to send update from transaction ${m.key} to ${o}`,$.message)}},`sync-continuity:${p}:${o}`,n);x.push(f)}return x}function Sv(n,i,o,c){let p=i.key,x=[];for(let m of i.perspectives){let{viewAtoms:f}=m,a=r(n,f,o),$=Xi(a,({oldValue:v,newValue:A})=>{let J=v.map((K)=>K.key),S=A.map((K)=>K.key),W=v.filter((K)=>!S.includes(K.key)),R=A.filter((K)=>!J.includes(K.key)).flatMap((K)=>{let z=K.type==="mutable_atom"?ii(n,K):K,M=zn(n,z);return[z,M]});if(n.logger.info("\uD83D\uDC41","atom",m.resourceAtoms.key,`${o} has a new perspective`,{oldKeys:J,newKeys:S,revealed:R,concealed:W}),R.length>0)c?.emit(`reveal:${p}`,R);if(W.length>0)c?.emit(`conceal:${p}`,W)},`sync-continuity:${p}:${o}:perspective:${m.resourceAtoms.key}`,n);x.push($)}return x}function Wv({socket:n,store:i=t.STORE}){return function o(c){let p=n,x=c.key,m=vx(Gc,`socket::${p.id}`,i).userKeyOfSocket,f=zn(i,m);if(!f)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 a=vx(Gc,f,i).socketKeyOfUser,$=Xi(a,({newValue:z})=>{if(i.logger.info("\uD83D\uDC4B","continuity",x,`seeing ${f} on new socket ${z}`),z===null){i.logger.warn("\u274C","continuity",x,`User (${f}) is not connected to a socket, waiting for them to reappear.`);return}let M=r(i,Xm,z);p=zn(i,M);for(let G of v)p?.emit(`tx-new:${x}`,G)},`sync-continuity:${x}:${f}`,i),v=zn(i,ip,f),A=[],J=Sv(i,c,f,p),S=Rv(i,c,f,p);A.push(...J,...S);let W=wv(i,c,f,n);p.off(`get:${x}`,W),p.on(`get:${x}`,W);let R=Tv(i,c,f);p.off(`tx-run:${x}`,R),p.on(`tx-run:${x}`,R);let K=Fv(i,c,f,v);return p?.on(`ack:${x}`,K),()=>{for(let z of A)z();p?.off(`ack:${x}`,K),p?.off(`get:${x}`,W),p?.off(`tx-run:${x}`,R)}}}var gS=va(a0(),1);var T=Symbol.for("drizzle:entityKind"),u_=Symbol.for("drizzle:hasOwnEntityKind");function Y(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 En{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 $0{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 $o=Symbol.for("drizzle:Name");class v0{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 RJ(n,this)}}class RJ{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[$o],...c,o[0].table[$o],...p];return n??`${x.join("_")}_fk`}}function um(n,...i){return n(...i)}function SJ(n,i){return`${n[$o]}_${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 XJ(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[a,$]=WJ(n,c+1,!0);o.push(a),c=$;continue}if(x==="}")return[o,c+1];if(x==="{"){let[a,$]=XJ(n,c+1);o.push(a),c=$;continue}let[m,f]=WJ(n,c,!1);o.push(m),c=f}return[o,c]}function KJ(n){let[i]=XJ(n,1);return i}function A0(n){return`{${n.map((i)=>{if(Array.isArray(i))return A0(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${i}`}).join(",")}}`}class I extends $0{foreignKeyConfigs=[];static[T]="PgColumnBuilder";array(n){return new YJ(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 um((p,x)=>{let m=new v0(()=>{let f=p();return{columns:[n],foreignColumns:[f]}});if(x.onUpdate)m.onUpdate(x.onUpdate);if(x.onDelete)m.onDelete(x.onDelete);return m.build(i)},o,c)})}buildExtraConfigColumn(n){return new GJ(n,this.config)}}class V extends En{constructor(n,i){if(!i.uniqueName)i.uniqueName=SJ(n,[i.name]);super(n,i);this.table=n}static[T]="PgColumn"}class GJ 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 zx{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 YJ extends I{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 J0(n,this.config,i)}}class J0 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=KJ(n);return n.map((i)=>this.baseColumn.mapFromDriverValue(i))}mapToDriverValue(n,i=!1){let o=n.map((c)=>c===null?null:Y(this.baseColumn,J0)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return A0(o)}}var w0=Symbol.for("drizzle:isPgEnum");function zJ(n){return!!n&&typeof n==="function"&&w0 in n&&n[w0]===!0}class MJ extends I{static[T]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new lJ(n,this.config)}}class lJ 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 M7(n,i,void 0)}function M7(n,i,o){let c=Object.assign((p)=>new MJ(p??"",c),{enumName:n,enumValues:i,schema:o,[w0]:!0});return c}class xi{static[T]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Mx extends xi{static[T]="WithSubquery"}var HJ="0.39.3";var T0,F0,Un={startActiveSpan(n,i){if(!T0)return i();if(!F0)F0=T0.trace.getTracer("drizzle-orm",HJ);return um((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()}}),T0,F0)}};var Bn=Symbol.for("drizzle:ViewBaseConfig");var ym=Symbol.for("drizzle:Schema"),km=Symbol.for("drizzle:Columns"),QJ=Symbol.for("drizzle:ExtraConfigColumns"),R0=Symbol.for("drizzle:OriginalName"),S0=Symbol.for("drizzle:BaseName"),lx=Symbol.for("drizzle:IsAlias"),OJ=Symbol.for("drizzle:ExtraConfigBuilder"),l7=Symbol.for("drizzle:IsDrizzleTable");class D{static[T]="Table";static Symbol={Name:$o,Schema:ym,OriginalName:R0,Columns:km,ExtraConfigColumns:QJ,BaseName:S0,IsAlias:lx,ExtraConfigBuilder:OJ};[$o];[R0];[ym];[km];[QJ];[S0];[lx]=!1;[l7]=!0;[OJ]=void 0;constructor(n,i,o){this[$o]=this[R0]=n,this[ym]=i,this[S0]=o}}function ai(n){return n[$o]}function Qc(n){return`${n[ym]??"public"}.${n[$o]}`}function W0(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function H7(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 mi{static[T]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new N([this])}}class N{constructor(n){this.queryChunks=n}static[T]="SQL";decoder=UJ;shouldInlineParams=!1;append(n){return this.queryChunks.push(...n.queryChunks),this}toQuery(n){return Un.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:f,paramStartIndex:a}=o;return H7(n.map(($)=>{if(Y($,mi))return{sql:$.value.join(""),params:[]};if(Y($,Zm))return{sql:p($.value),params:[]};if($===void 0)return{sql:"",params:[]};if(Array.isArray($)){let v=[new mi("(")];for(let[A,J]of $.entries())if(v.push(J),A<$.length-1)v.push(new mi(", "));return v.push(new mi(")")),this.buildQueryFromSourceParams(v,o)}if(Y($,N))return this.buildQueryFromSourceParams($.queryChunks,{...o,inlineParams:f||$.shouldInlineParams});if(Y($,D)){let v=$[D.Symbol.Schema],A=$[D.Symbol.Name];return{sql:v===void 0||$[lx]?p(A):p(v)+"."+p(A),params:[]}}if(Y($,En)){let v=c.getColumnCasing($);if(i.invokeSource==="indexes")return{sql:p(v),params:[]};let A=$.table[D.Symbol.Schema];return{sql:$.table[lx]||A===void 0?p($.table[D.Symbol.Name])+"."+p(v):p(A)+"."+p($.table[D.Symbol.Name])+"."+p(v),params:[]}}if(Y($,ji)){let v=$[Bn].schema,A=$[Bn].name;return{sql:v===void 0||$[Bn].isAlias?p(A):p(v)+"."+p(A),params:[]}}if(Y($,Ni)){if(Y($.value,oc))return{sql:x(a.value++,$),params:[$],typings:["none"]};let v=$.value===null?null:$.encoder.mapToDriverValue($.value);if(Y(v,N))return this.buildQueryFromSourceParams([v],o);if(f)return{sql:this.mapInlineParam(v,o),params:[]};let A=["none"];if(m)A=[m($.encoder)];return{sql:x(a.value++,v),params:[v],typings:A}}if(Y($,oc))return{sql:x(a.value++,$),params:[$],typings:["none"]};if(Y($,N.Aliased)&&$.fieldAlias!==void 0)return{sql:p($.fieldAlias),params:[]};if(Y($,xi)){if($._.isWith)return{sql:p($._.alias),params:[]};return this.buildQueryFromSourceParams([new mi("("),$._.sql,new mi(") "),new Zm($._.alias)],o)}if(zJ($)){if($.schema)return{sql:p($.schema)+"."+p($.enumName),params:[]};return{sql:p($.enumName),params:[]}}if(W0($)){if($.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([$.getSQL()],o);return this.buildQueryFromSourceParams([new mi("("),$.getSQL(),new mi(")")],o)}if(f)return{sql:this.mapInlineParam($,o),params:[]};return{sql:x(a.value++,$),params:[$],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 N.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 N([this])}}function EJ(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var UJ={mapFromDriverValue:(n)=>n},VJ={mapToDriverValue:(n)=>n},EB={...UJ,...VJ};class Ni{constructor(n,i=VJ){this.value=n,this.encoder=i}static[T]="Param";brand;getSQL(){return new N([this])}}function F(n,...i){let o=[];if(i.length>0||n.length>0&&n[0]!=="")o.push(new mi(n[0]));for(let[c,p]of i.entries())o.push(p,new mi(n[c+1]));return new N(o)}((n)=>{function i(){return new N([])}n.empty=i;function o(a){return new N(a)}n.fromList=o;function c(a){return new N([new mi(a)])}n.raw=c;function p(a,$){let v=[];for(let[A,J]of a.entries()){if(A>0&&$!==void 0)v.push($);v.push(J)}return new N(v)}n.join=p;function x(a){return new Zm(a)}n.identifier=x;function m(a){return new oc(a)}n.placeholder=m;function f(a,$){return new Ni(a,$)}n.param=f})(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})(N||(N={}));class oc{constructor(n){this.name=n}static[T]="Placeholder";getSQL(){return new N([this])}}function X0(n,i){return n.map((o)=>{if(Y(o,oc)){if(!(o.name in i))throw new Error(`No value for placeholder "${o.name}" was provided`);return i[o.name]}if(Y(o,Ni)&&Y(o.value,oc)){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 Q7=Symbol.for("drizzle:IsDrizzleView");class ji{static[T]="View";[Bn];[Q7]=!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 N([this])}}En.prototype.getSQL=function(){return new N([this])};D.prototype.getSQL=function(){return new N([this])};xi.prototype.getSQL=function(){return new N([this])};class Fp{constructor(n){this.table=n}static[T]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class Hx{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[T]="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===Bn)return{...n[Bn],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 Fp(new Proxy(n,this)))}),p}let o=n[i];if(Y(o,En))return new Proxy(o,new Fp(new Proxy(n,this)));return o}}function qm(n,i){return new Proxy(n,new Hx(i,!1))}function Mo(n,i){return new Proxy(n,new Fp(new Proxy(n.table,new Hx(i,!1))))}function K0(n,i){return new N.Aliased(Qx(n.sql,i),n.fieldAlias)}function Qx(n,i){return F.join(n.queryChunks.map((o)=>{if(Y(o,En))return Mo(o,i);if(Y(o,N))return Qx(o,i);if(Y(o,N.Aliased))return K0(o,i);return o}))}class Pm extends Error{static[T]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class G0 extends Pm{static[T]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function bi(n,i){if(EJ(i)&&!W0(n)&&!Y(n,Ni)&&!Y(n,oc)&&!Y(n,En)&&!Y(n,D)&&!Y(n,ji))return new Ni(n,i);return n}var lo=(n,i)=>{return F`${n} = ${bi(i,n)}`},_J=(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 N(i);return new N([new mi("("),F.join(i,new mi(" and ")),new mi(")")])}function BJ(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new N(i);return new N([new mi("("),F.join(i,new mi(" or ")),new mi(")")])}function jJ(n){return F`not ${n}`}var sm=(n,i)=>{return F`${n} > ${bi(i,n)}`},bJ=(n,i)=>{return F`${n} >= ${bi(i,n)}`},LJ=(n,i)=>{return F`${n} < ${bi(i,n)}`},DJ=(n,i)=>{return F`${n} <= ${bi(i,n)}`};function NJ(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 CJ(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 hJ(n){return F`${n} is null`}function uJ(n){return F`${n} is not null`}function IJ(n){return F`exists ${n}`}function yJ(n){return F`not exists ${n}`}function kJ(n,i,o){return F`${n} between ${bi(i,n)} and ${bi(o,n)}`}function ZJ(n,i,o){return F`${n} not between ${bi(i,n)} and ${bi(o,n)}`}function qJ(n,i){return F`${n} like ${i}`}function PJ(n,i){return F`${n} not like ${i}`}function sJ(n,i){return F`${n} ilike ${i}`}function rJ(n,i){return F`${n} not ilike ${i}`}function tJ(n){return F`${n} asc`}function gJ(n){return F`${n} desc`}class dJ{static[T]="ConsoleLogWriter";write(n){console.log(n)}}class Y0{static[T]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new dJ}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 z0{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 eJ(n,i,o){let c={},p=n.reduce((x,{path:m,field:f},a)=>{let $;if(Y(f,En))$=f;else if(Y(f,N))$=f.decoder;else $=f.sql.decoder;let v=x;for(let[A,J]of m.entries())if(A<m.length-1){if(!(J in v))v[J]={};v=v[J]}else{let S=i[a],W=v[J]=S===null?null:$.mapFromDriverValue(S);if(o&&Y(f,En)&&m.length===2){let R=m[0];if(!(R in c))c[R]=W===null?ai(f.table):!1;else if(typeof c[R]==="string"&&c[R]!==ai(f.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 gi(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let x=i?[...i,c]:[c];if(Y(p,En)||Y(p,N)||Y(p,N.Aliased))o.push({path:x,field:p});else if(Y(p,D))o.push(...gi(p[D.Symbol.Columns],x));else o.push(...gi(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(Y(p,N)||Y(p,En))return[c,p];else return[c,new Ni(p,n[D.Symbol.Columns][c])]});if(o.length===0)throw new Error("No values to set");return Object.fromEntries(o)}function nw(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 iw(n){return n[D.Symbol.Columns]}function jo(n){return Y(n,xi)?n._.alias:Y(n,ji)?n[Bn].name:Y(n,N)?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 ow(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 cc extends I{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 cw extends cc{static[T]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new pw(n,this.config)}}class pw extends V{static[T]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class xw extends cc{static[T]="PgBigInt64Builder";constructor(n){super(n,"bigint","PgBigInt64")}build(n){return new mw(n,this.config)}}class mw extends V{static[T]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function fw(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new cw(o);return new xw(o)}class aw extends I{static[T]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new $w(n,this.config)}}class $w extends V{static[T]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class vw extends I{static[T]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new Aw(n,this.config)}}class Aw extends V{static[T]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function Jw(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new aw(o);return new vw(o)}class ww extends I{static[T]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new Tw(n,this.config)}}class Tw extends V{static[T]="PgBoolean";getSQLType(){return"boolean"}}function Ex(n){return new ww(n??"")}class Fw extends I{static[T]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new Rw(n,this.config)}}class Rw extends V{static[T]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}}function Sw(n,i={}){let{name:o,config:c}=Jn(n,i);return new Fw(o,c)}class Ww extends I{static[T]="PgCidrBuilder";constructor(n){super(n,"string","PgCidr")}build(n){return new Xw(n,this.config)}}class Xw extends V{static[T]="PgCidr";getSQLType(){return"cidr"}}function Kw(n){return new Ww(n??"")}class Gw extends I{static[T]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new Yw(n,this.config)}}class Yw 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 zw(n){return(i,o)=>{let{name:c,config:p}=Jn(i,o);return new Gw(c,p,n)}}class bo extends I{static[T]="PgDateColumnBaseBuilder";defaultNow(){return this.default(F`now()`)}}class Mw extends bo{static[T]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new tm(n,this.config)}}class tm extends V{static[T]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class lw 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 Hw(n,i){let{name:o,config:c}=Jn(n,i);if(c?.mode==="date")return new Mw(o);return new lw(o)}class Qw extends I{static[T]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new Ow(n,this.config)}}class Ow extends V{static[T]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function Ew(n){return new Qw(n??"")}class Uw extends I{static[T]="PgInetBuilder";constructor(n){super(n,"string","PgInet")}build(n){return new Vw(n,this.config)}}class Vw extends V{static[T]="PgInet";getSQLType(){return"inet"}}function _w(n){return new Uw(n??"")}class Bw extends cc{static[T]="PgIntegerBuilder";constructor(n){super(n,"number","PgInteger")}build(n){return new jw(n,this.config)}}class jw 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 Bw(n??"")}class bw extends I{static[T]="PgIntervalBuilder";constructor(n,i){super(n,"string","PgInterval");this.config.intervalConfig=i}build(n){return new Lw(n,this.config)}}class Lw 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 Dw(n,i={}){let{name:o,config:c}=Jn(n,i);return new bw(o,c)}class Nw extends I{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 Cw(n){return new Nw(n??"")}class hw extends I{static[T]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new nf(n,this.config)}}class nf 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 uw(n){return new hw(n??"")}class Iw extends I{static[T]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new yw(n,this.config)}}class yw 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 kw extends I{static[T]="PgLineABCBuilder";constructor(n){super(n,"json","PgLineABC")}build(n){return new Zw(n,this.config)}}class Zw 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 qw(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new Iw(o);return new kw(o)}class Pw extends I{static[T]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new sw(n,this.config)}}class sw extends V{static[T]="PgMacaddr";getSQLType(){return"macaddr"}}function rw(n){return new Pw(n??"")}class tw extends I{static[T]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new gw(n,this.config)}}class gw extends V{static[T]="PgMacaddr8";getSQLType(){return"macaddr8"}}function dw(n){return new tw(n??"")}class ew extends I{static[T]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new of(n,this.config)}}class of 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 nT(n,i){let{name:o,config:c}=Jn(n,i);return new ew(o,c?.precision,c?.scale)}class iT extends I{static[T]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new oT(n,this.config)}}class oT 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 cT extends I{static[T]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new pT(n,this.config)}}class pT 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 xT(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new iT(o);return new cT(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 mT(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 M0(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 f=mT(i,o);o+=8;let a=mT(i,o);return o+=8,[f,a]}throw new Error("Unsupported geometry type")}class fT extends I{static[T]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new aT(n,this.config)}}class aT extends V{static[T]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return M0(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class $T extends I{static[T]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new vT(n,this.config)}}class vT extends V{static[T]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=M0(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function AT(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new fT(o);return new $T(o)}class JT extends I{static[T]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new wT(n,this.config)}}class wT 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 TT(n){return new JT(n??"")}class FT extends I{static[T]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new RT(n,this.config)}}class RT extends V{static[T]="PgSerial";getSQLType(){return"serial"}}function ST(n){return new FT(n??"")}class WT extends cc{static[T]="PgSmallIntBuilder";constructor(n){super(n,"number","PgSmallInt")}build(n){return new XT(n,this.config)}}class XT extends V{static[T]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=(n)=>{if(typeof n==="string")return Number(n);return n}}function KT(n){return new WT(n??"")}class GT extends I{static[T]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new YT(n,this.config)}}class YT extends V{static[T]="PgSmallSerial";getSQLType(){return"smallserial"}}function zT(n){return new GT(n??"")}class MT extends I{static[T]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new lT(n,this.config)}}class lT extends V{static[T]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function HT(n,i={}){let{name:o,config:c}=Jn(n,i);return new MT(o,c)}class QT 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 cf(n,this.config)}}class cf 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 OT(n,i={}){let{name:o,config:c}=Jn(n,i);return new QT(o,c.withTimezone??!1,c.precision)}class ET 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 pf(n,this.config)}}class pf 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 UT 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 xf(n,this.config)}}class xf 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 vo(n,i={}){let{name:o,config:c}=Jn(n,i);if(c?.mode==="string")return new UT(o,c.withTimezone??!1,c.precision);return new ET(o,c?.withTimezone??!1,c?.precision)}class VT extends I{static[T]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(F`gen_random_uuid()`)}build(n){return new mf(n,this.config)}}class mf extends V{static[T]="PgUUID";getSQLType(){return"uuid"}}function Ci(n){return new VT(n??"")}class _T extends I{static[T]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new BT(n,this.config)}}class BT extends V{static[T]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}}function wi(n,i={}){let{name:o,config:c}=Jn(n,i);return new _T(o,c)}class jT extends I{static[T]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new bT(n,this.config)}}class bT extends V{static[T]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function LT(n,i){let{name:o,config:c}=Jn(n,i);return new jT(o,c)}class DT extends I{static[T]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new NT(n,this.config)}}class NT 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 CT(n,i){let{name:o,config:c}=Jn(n,i);return new DT(o,c)}class hT extends I{static[T]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new uT(n,this.config)}}class uT extends V{static[T]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function IT(n,i){let{name:o,config:c}=Jn(n,i);return new hT(o,c)}class yT extends I{static[T]="PgVectorBuilder";constructor(n,i){super(n,"array","PgVector");this.config.dimensions=i.dimensions}build(n){return new kT(n,this.config)}}class kT 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 ZT(n,i){let{name:o,config:c}=Jn(n,i);return new yT(o,c)}function qT(){return{bigint:fw,bigserial:Jw,boolean:Ex,char:Sw,cidr:Kw,customType:zw,date:Hw,doublePrecision:Ew,inet:_w,integer:dm,interval:Dw,json:Cw,jsonb:uw,line:qw,macaddr:rw,macaddr8:dw,numeric:nT,point:xT,geometry:AT,real:TT,serial:ST,smallint:KT,smallserial:zT,text:HT,time:OT,timestamp:vo,uuid:Ci,varchar:wi,bit:LT,halfvec:CT,sparsevec:IT,vector:ZT}}var l0=Symbol.for("drizzle:PgInlineForeignKeys"),PT=Symbol.for("drizzle:EnableRLS");class Ti extends D{static[T]="PgTable";static Symbol=Object.assign({},D.Symbol,{InlineForeignKeys:l0,EnableRLS:PT});[l0]=[];[PT]=!1;[D.Symbol.ExtraConfigBuilder]=void 0}function E7(n,i,o,c,p=n){let x=new Ti(n,c,p),m=typeof i==="function"?i(qT()):i,f=Object.fromEntries(Object.entries(m).map(([v,A])=>{let J=A;J.setName(v);let S=J.build(x);return x[l0].push(...J.buildForeignKeys(S,x)),[v,S]})),a=Object.fromEntries(Object.entries(m).map(([v,A])=>{let J=A;J.setName(v);let S=J.buildExtraConfigColumn(x);return[v,S]})),$=Object.assign(x,f);if($[D.Symbol.Columns]=f,$[D.Symbol.ExtraConfigColumns]=a,o)$[Ti.Symbol.ExtraConfigBuilder]=o;return Object.assign($,{enableRLS:()=>{return $[Ti.Symbol.EnableRLS]=!0,$}})}var pc=(n,i,o)=>{return E7(n,i,o,void 0)};function sT(...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 rT(n,this.columns,this.name)}}class rT{constructor(n,i,o){this.table=n,this.columns=i,this.name=o}static[T]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[Ti.Symbol.Name]}_${this.columns.map((n)=>n.name).join("_")}_pk`}}class H0{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[D.Symbol.Name]}static[T]="Relation";referencedTableName;fieldName}class tT{constructor(n,i){this.table=n,this.config=i}static[T]="Relations"}class xc extends H0{constructor(n,i,o,c){super(n,i,o?.relationName);this.config=o,this.isNullable=c}static[T]="One";withFieldName(n){let i=new xc(this.sourceTable,this.referencedTable,this.config,this.isNullable);return i.fieldName=n,i}}class Vx extends H0{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 gT(){return{and:Oc,between:kJ,eq:lo,exists:IJ,gt:sm,gte:bJ,ilike:sJ,inArray:NJ,isNull:hJ,isNotNull:uJ,like:qJ,lt:LJ,lte:DJ,ne:_J,not:jJ,notBetween:ZJ,notExists:yJ,notLike:PJ,notIlike:rJ,notInArray:CJ,or:BJ,sql:F}}function dT(){return{sql:F,asc:tJ,desc:gJ}}function eT(n,i){if(Object.keys(n).length===1&&"default"in n&&!Y(n.default,D))n=n.default;let o={},c={},p={};for(let[x,m]of Object.entries(n))if(Y(m,D)){let f=Qc(m),a=c[f];o[f]=x,p[x]={tsName:x,dbName:m[D.Symbol.Name],schema:m[D.Symbol.Schema],columns:m[D.Symbol.Columns],relations:a?.relations??{},primaryKey:a?.primaryKey??[]};for(let v of Object.values(m[D.Symbol.Columns]))if(v.primary)p[x].primaryKey.push(v);let $=m[D.Symbol.ExtraConfigBuilder]?.(m[D.Symbol.ExtraConfigColumns]);if($){for(let v of Object.values($))if(Y(v,Ux))p[x].primaryKey.push(...v.columns)}}else if(Y(m,tT)){let f=Qc(m.table),a=o[f],$=m.config(i(m.table)),v;for(let[A,J]of Object.entries($))if(a){let S=p[a];if(S.relations[A]=J,v)S.primaryKey.push(...v)}else{if(!(f in c))c[f]={relations:{},primaryKey:v};c[f].relations[A]=J}}return{tables:p,tableNamesMap:o}}function U7(n){return function i(o,c){return new xc(n,o,c,c?.fields.reduce((p,x)=>p&&x.notNull,!0)??!1)}}function V7(n){return function i(o,c){return new Vx(n,o,c)}}function nF(n,i,o){if(Y(o,xc)&&o.config)return{fields:o.config.fields,references:o.config.references};let c=i[Qc(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[Qc(x)];if(!m)throw new Error(`Table "${x[D.Symbol.Name]}" not found in schema`);let f=[];for(let a of Object.values(p.relations))if(o.relationName&&o!==a&&a.relationName===o.relationName||!o.relationName&&a.referencedTable===o.sourceTable)f.push(a);if(f.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(f[0]&&Y(f[0],xc)&&f[0].config)return{fields:f[0].config.references,references:f[0].config.fields};throw new Error(`There is not enough information to infer relation "${m}.${o.fieldName}"`)}function iF(n){return{one:U7(n),many:V7(n)}}function ff(n,i,o,c,p=(x)=>x){let x={};for(let[m,f]of c.entries())if(f.isJson){let a=i.relations[f.tsKey],$=o[m],v=typeof $==="string"?JSON.parse($):$;x[f.tsKey]=Y(a,xc)?v&&ff(n,n[f.relationTableTsKey],v,f.selection,p):v.map((A)=>ff(n,n[f.relationTableTsKey],A,f.selection,p))}else{let a=p(o[m]),$=f.field,v;if(Y($,En))v=$;else if(Y($,N))v=$.decoder;else v=$.sql.decoder;x[f.tsKey]=a===null?null:v.mapFromDriverValue(a)}return x}var yR=va(IR(),1),{Server:kR,Namespace:UN,Socket:VN}=yR.default;import{readFileSync as xS}from"fs";import{resolve as H$}from"path";function QG(n,i){let o={},c=[];for(let p in n){let x=n[p],m=i[p],f=x["~standard"].validate(m);if(f instanceof Promise)throw new Error(`Validation must be synchronous, but ${p} returned a Promise.`);if(f.issues){c.push(...f.issues.map((a)=>({...a,path:[p,...a.path??[]]})));continue}o[p]=f.value}if(c.length)return{issues:c};return{value:o}}function ZR(n){let i=n.runtimeEnvStrict??n.runtimeEnv??process.env;if(n.emptyStringAsUndefined??!1){for(let[M,h]of Object.entries(i))if(h==="")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:{},f=n.isServer??(typeof window==="undefined"||("Deno"in window)),a=f?{...x,...m,...p}:{...p,...m},$=QG(a,i),v=n.onValidationError??((M)=>{throw console.error("\u274C Invalid environment variables:",M),new Error("Invalid environment variables")}),A=n.onInvalidAccess??(()=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if($.issues)return v($.issues);let J=(M)=>{if(!n.clientPrefix)return!0;return!M.startsWith(n.clientPrefix)&&!(M in m)},S=(M)=>{return f||!J(M)},W=(M)=>{return M==="__esModule"||M==="$$typeof"},R=(n.extends??[]).reduce((M,h)=>{return Object.assign(M,h)},{}),K=Object.assign($.value,R);return new Proxy(K,{get(M,h){if(typeof h!=="string")return;if(W(h))return;if(!S(h))return A(h);return Reflect.get(M,h)}})}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((f)=>typeof p[p[f]]!=="number"),m={};for(let f of x)m[f]=p[f];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 C=Fn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ho=(n)=>{switch(typeof n){case"undefined":return C.undefined;case"string":return C.string;case"number":return isNaN(n)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":if(Array.isArray(n))return C.array;if(n===null)return C.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return C.promise;if(typeof Map!=="undefined"&&n instanceof Map)return C.map;if(typeof Set!=="undefined"&&n instanceof Set)return C.set;if(typeof Date!=="undefined"&&n instanceof Date)return C.date;return C.object;default:return C.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"]),OG=(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,f=0;while(f<x.path.length){let a=x.path[f];if(f!==x.path.length-1)m[a]=m[a]||{_errors:[]};else m[a]=m[a]||{_errors:[]},m[a]._errors.push(i(x));m=m[a],f++}}};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===C.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}},rR=Bp;function EG(n){rR=n}function jf(){return rR}var bf=(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 f="",a=c.filter(($)=>!!$).slice().reverse();for(let $ of a)f=$(m,{data:i,defaultError:f}).message;return{...p,path:x,message:f}},UG=[];function L(n,i){let o=jf(),c=bf({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 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 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 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 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"}),Vp=(n)=>({status:"dirty",value:n}),Vi=(n)=>({status:"valid",value:n}),z$=(n)=>n.status==="aborted",M$=(n)=>n.status==="dirty",Dc=(n)=>n.status==="valid",ux=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function Lf(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 tR(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 Cx,hx;class So{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 qR=(n,i)=>{if(Dc(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,f)=>{var a,$;let{message:v}=n;if(m.code==="invalid_enum_value")return{message:v!==null&&v!==void 0?v:f.defaultError};if(typeof f.data==="undefined")return{message:(a=v!==null&&v!==void 0?v:c)!==null&&a!==void 0?a:f.defaultError};if(m.code!=="invalid_type")return{message:f.defaultError};return{message:($=v!==null&&v!==void 0?v:o)!==null&&$!==void 0?$:f.defaultError}},description:p}}class pn{get description(){return this._def.description}_getType(n){return ho(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:ho(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:ho(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(ux(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:ho(n)},p=this._parseSync({data:n,path:c.path,parent:c});return qR(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:ho(n)};if(!this["~standard"].async)try{let p=this._parseSync({data:n,path:[],parent:c});return Dc(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)=>Dc(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:ho(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(ux(c)?c:Promise.resolve(c));return qR(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((f)=>{if(!f)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:g.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 Ro.create(this,this._def)}nullable(){return uo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fo.create(this)}promise(){return uc.create(this,this._def)}or(n){return Dp.create([this,n],this._def)}and(n){return Np.create(this,n,this._def)}transform(n){return new io({...cn(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let i=typeof n==="function"?n:()=>n;return new Ip({...cn(this._def),innerType:this,defaultValue:i,typeName:g.ZodDefault})}brand(){return new Nf({typeName:g.ZodBranded,type:this,...cn(this._def)})}catch(n){let i=typeof n==="function"?n:()=>n;return new yp({...cn(this._def),innerType:this,catchValue:i,typeName:g.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return Px.create(this,n)}readonly(){return kp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var VG=/^c[^\s-]{8,}$/i,_G=/^[0-9a-z]+$/,BG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jG=/^[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,bG=/^[a-z0-9_-]{21}$/i,LG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DG=/^[-+]?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)?)??$/,NG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,CG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",G$,hG=/^(?:(?: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])$/,uG=/^(?:(?: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])$/,IG=/^(([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]))$/,yG=/^(([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])$/,kG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ZG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gR="((\\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])))",qG=new RegExp(`^${gR}$`);function dR(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 PG(n){return new RegExp(`^${dR(n)}$`)}function eR(n){let i=`${gR}T${dR(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 sG(n,i){if((i==="v4"||!i)&&hG.test(n))return!0;if((i==="v6"||!i)&&IG.test(n))return!0;return!1}function rG(n,i){if(!LG.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 tG(n,i){if((i==="v4"||!i)&&uG.test(n))return!0;if((i==="v6"||!i)&&yG.test(n))return!0;return!1}class To extends pn{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==C.string){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_type,expected:C.string,received:p.parsedType}),d}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),L(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),L(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)L(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(m)L(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(!NG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"email",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!G$)G$=new RegExp(CG,"u");if(!G$.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"emoji",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!jG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"uuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!bG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"nanoid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!VG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"cuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!_G.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"cuid2",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!BG.test(n.data))c=this._getOrReturnCtx(n,c),L(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),L(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),L(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),L(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),L(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),L(c,{code:U.invalid_string,validation:{endsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="datetime"){if(!eR(p).test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!qG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!PG(p).test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!DG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"duration",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!sG(n.data,p.version))c=this._getOrReturnCtx(n,c),L(c,{validation:"ip",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="jwt"){if(!rG(n.data,p.alg))c=this._getOrReturnCtx(n,c),L(c,{validation:"jwt",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cidr"){if(!tG(n.data,p.version))c=this._getOrReturnCtx(n,c),L(c,{validation:"cidr",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!kG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"base64",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64url"){if(!ZG.test(n.data))c=this._getOrReturnCtx(n,c),L(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 To({...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 To({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new To({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new To({...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}}To.create=(n)=>{var i;return new To({checks:[],typeName:g.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};function gG(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)!==C.number){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_type,expected:C.number,received:p.parsedType}),d}let o=void 0,c=new Hi;for(let p of this._def.checks)if(p.kind==="int"){if(!Fn.isInteger(n.data))o=this._getOrReturnCtx(n,o),L(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),L(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),L(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(gG(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),L(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),L(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:g.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class Jc 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)!==C.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),L(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),L(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),L(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 L(i,{code:U.invalid_type,expected:C.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 Jc({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:o,message:k.toString(c)}]})}_addCheck(n){return new Jc({...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}}Jc.create=(n)=>{var i;return new Jc({checks:[],typeName:g.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)!==C.boolean){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.boolean,received:o.parsedType}),d}return Vi(n.data)}}jp.create=(n)=>{return new jp({typeName:g.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)!==C.date){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_type,expected:C.date,received:p.parsedType}),d}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_date}),d}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),L(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),L(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:g.ZodDate,...cn(n)})};class Ix extends pn{_parse(n){if(this._getType(n)!==C.symbol){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.symbol,received:o.parsedType}),d}return Vi(n.data)}}Ix.create=(n)=>{return new Ix({typeName:g.ZodSymbol,...cn(n)})};class bp extends pn{_parse(n){if(this._getType(n)!==C.undefined){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.undefined,received:o.parsedType}),d}return Vi(n.data)}}bp.create=(n)=>{return new bp({typeName:g.ZodUndefined,...cn(n)})};class Lp extends pn{_parse(n){if(this._getType(n)!==C.null){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.null,received:o.parsedType}),d}return Vi(n.data)}}Lp.create=(n)=>{return new Lp({typeName:g.ZodNull,...cn(n)})};class Cc extends pn{constructor(){super(...arguments);this._any=!0}_parse(n){return Vi(n.data)}}Cc.create=(n)=>{return new Cc({typeName:g.ZodAny,...cn(n)})};class vc extends pn{constructor(){super(...arguments);this._unknown=!0}_parse(n){return Vi(n.data)}}vc.create=(n)=>{return new vc({typeName:g.ZodUnknown,...cn(n)})};class Qo extends pn{_parse(n){let i=this._getOrReturnCtx(n);return L(i,{code:U.invalid_type,expected:C.never,received:i.parsedType}),d}}Qo.create=(n)=>{return new Qo({typeName:g.ZodNever,...cn(n)})};class yx extends pn{_parse(n){if(this._getType(n)!==C.undefined){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.void,received:o.parsedType}),d}return Vi(n.data)}}yx.create=(n)=>{return new yx({typeName:g.ZodVoid,...cn(n)})};class Fo extends pn{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==C.array)return L(i,{code:U.invalid_type,expected:C.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)L(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)L(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)L(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 So(i,x,i.path,m))})).then((x)=>{return Hi.mergeArray(o,x)});let p=[...i.data].map((x,m)=>{return c.type._parseSync(new So(i,x,i.path,m))});return Hi.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:g.ZodArray,...cn(i)})};function Up(n){if(n instanceof un){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=Ro.create(Up(c))}return new un({...n._def,shape:()=>i})}else if(n instanceof Fo)return new Fo({...n._def,type:Up(n.element)});else if(n instanceof Ro)return Ro.create(Up(n.unwrap()));else if(n instanceof uo)return uo.create(Up(n.unwrap()));else if(n instanceof Oo)return Oo.create(n.items.map((i)=>Up(i)));else return n}class un 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)!==C.object){let a=this._getOrReturnCtx(n);return L(a,{code:U.invalid_type,expected:C.object,received:a.parsedType}),d}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:x}=this._getCached(),m=[];if(!(this._def.catchall instanceof Qo&&this._def.unknownKeys==="strip")){for(let a in c.data)if(!x.includes(a))m.push(a)}let f=[];for(let a of x){let $=p[a],v=c.data[a];f.push({key:{status:"valid",value:a},value:$._parse(new So(c,v,c.path,a)),alwaysSet:a in c.data})}if(this._def.catchall instanceof Qo){let a=this._def.unknownKeys;if(a==="passthrough")for(let $ of m)f.push({key:{status:"valid",value:$},value:{status:"valid",value:c.data[$]}});else if(a==="strict"){if(m.length>0)L(c,{code:U.unrecognized_keys,keys:m}),o.dirty()}else if(a==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let a=this._def.catchall;for(let $ of m){let v=c.data[$];f.push({key:{status:"valid",value:$},value:a._parse(new So(c,v,c.path,$)),alwaysSet:$ in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let a=[];for(let $ of f){let v=await $.key,A=await $.value;a.push({key:v,value:A,alwaysSet:$.alwaysSet})}return a}).then((a)=>{return Hi.mergeObjectSync(o,a)});else return Hi.mergeObjectSync(o,f)}get shape(){return this._def.shape()}strict(n){return k.errToObj,new un({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,x,m;let f=(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:f};return{message:f}}}:{}})}strip(){return new un({...this._def,unknownKeys:"strip"})}passthrough(){return new un({...this._def,unknownKeys:"passthrough"})}extend(n){return new un({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new un({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:g.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new un({...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 un({...this._def,shape:()=>i})}omit(n){let i={};return Fn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new un({...this._def,shape:()=>i})}deepPartial(){return Up(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 un({...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 Ro)p=p._def.innerType;i[o]=p}}),new un({...this._def,shape:()=>i})}keyof(){return nS(Fn.objectKeys(this.shape))}}un.create=(n,i)=>{return new un({shape:()=>n,unknownKeys:"strip",catchall:Qo.create(),typeName:g.ZodObject,...cn(i)})};un.strictCreate=(n,i)=>{return new un({shape:()=>n,unknownKeys:"strict",catchall:Qo.create(),typeName:g.ZodObject,...cn(i)})};un.lazycreate=(n,i)=>{return new un({shape:n,unknownKeys:"strip",catchall:Qo.create(),typeName:g.ZodObject,...cn(i)})};class Dp 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 L(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 f of o){let a={...i,common:{...i.common,issues:[]},parent:null},$=f._parseSync({data:i.data,path:i.path,parent:a});if($.status==="valid")return $;else if($.status==="dirty"&&!p)p={result:$,ctx:a};if(a.common.issues.length)x.push(a.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let m=x.map((f)=>new yi(f));return L(i,{code:U.invalid_union,unionErrors:m}),d}}get options(){return this._def.options}}Dp.create=(n,i)=>{return new Dp({options:n,typeName:g.ZodUnion,...cn(i)})};var Co=(n)=>{if(n instanceof Cp)return Co(n.schema);else if(n instanceof io)return Co(n.innerType());else if(n instanceof hp)return[n.value];else if(n instanceof wc)return n.options;else if(n instanceof up)return Fn.objectValues(n.enum);else if(n instanceof Ip)return Co(n._def.innerType);else if(n instanceof bp)return[void 0];else if(n instanceof Lp)return[null];else if(n instanceof Ro)return[void 0,...Co(n.unwrap())];else if(n instanceof uo)return[null,...Co(n.unwrap())];else if(n instanceof Nf)return Co(n.unwrap());else if(n instanceof kp)return Co(n.unwrap());else if(n instanceof yp)return Co(n._def.innerType);else return[]};class Df extends pn{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==C.object)return L(i,{code:U.invalid_type,expected:C.object,received:i.parsedType}),d;let o=this.discriminator,c=i.data[o],p=this.optionsMap.get(c);if(!p)return L(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=Co(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 Df({typeName:g.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...cn(o)})}}function l$(n,i){let o=ho(n),c=ho(i);if(n===i)return{valid:!0,data:n};else if(o===C.object&&c===C.object){let p=Fn.objectKeys(i),x=Fn.objectKeys(n).filter((f)=>p.indexOf(f)!==-1),m={...n,...i};for(let f of x){let a=l$(n[f],i[f]);if(!a.valid)return{valid:!1};m[f]=a.data}return{valid:!0,data:m}}else if(o===C.array&&c===C.array){if(n.length!==i.length)return{valid:!1};let p=[];for(let x=0;x<n.length;x++){let m=n[x],f=i[x],a=l$(m,f);if(!a.valid)return{valid:!1};p.push(a.data)}return{valid:!0,data:p}}else if(o===C.date&&c===C.date&&+n===+i)return{valid:!0,data:n};else return{valid:!1}}class Np extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n),c=(p,x)=>{if(z$(p)||z$(x))return d;let m=l$(p.value,x.value);if(!m.valid)return L(o,{code:U.invalid_intersection_types}),d;if(M$(p)||M$(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}))}}Np.create=(n,i,o)=>{return new Np({left:n,right:i,typeName:g.ZodIntersection,...cn(o)})};class Oo extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==C.array)return L(o,{code:U.invalid_type,expected:C.array,received:o.parsedType}),d;if(o.data.length<this._def.items.length)return L(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)L(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 f=this._def.items[m]||this._def.rest;if(!f)return null;return f._parse(new So(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 Oo({...this._def,rest:n})}}Oo.create=(n,i)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Oo({items:n,typeName:g.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!==C.object)return L(o,{code:U.invalid_type,expected:C.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 So(o,m,o.path,m)),value:x._parse(new So(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:g.ZodRecord,...cn(o)});return new kx({keyType:To.create(),valueType:n,typeName:g.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!==C.map)return L(o,{code:U.invalid_type,expected:C.map,received:o.parsedType}),d;let c=this._def.keyType,p=this._def.valueType,x=[...o.data.entries()].map(([m,f],a)=>{return{key:c._parse(new So(o,m,o.path,[a,"key"])),value:p._parse(new So(o,f,o.path,[a,"value"]))}});if(o.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let f of x){let a=await f.key,$=await f.value;if(a.status==="aborted"||$.status==="aborted")return d;if(a.status==="dirty"||$.status==="dirty")i.dirty();m.set(a.value,$.value)}return{status:i.value,value:m}})}else{let m=new Map;for(let f of x){let{key:a,value:$}=f;if(a.status==="aborted"||$.status==="aborted")return d;if(a.status==="dirty"||$.status==="dirty")i.dirty();m.set(a.value,$.value)}return{status:i.value,value:m}}}}Zx.create=(n,i,o)=>{return new Zx({valueType:i,keyType:n,typeName:g.ZodMap,...cn(o)})};class hc extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==C.set)return L(o,{code:U.invalid_type,expected:C.set,received:o.parsedType}),d;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)L(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)L(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(f){let a=new Set;for(let $ of f){if($.status==="aborted")return d;if($.status==="dirty")i.dirty();a.add($.value)}return{status:i.value,value:a}}let m=[...o.data.values()].map((f,a)=>p._parse(new So(o,f,o.path,a)));if(o.common.async)return Promise.all(m).then((f)=>x(f));else return x(m)}min(n,i){return new hc({...this._def,minSize:{value:n,message:k.toString(i)}})}max(n,i){return new hc({...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)}}hc.create=(n,i)=>{return new hc({valueType:n,minSize:null,maxSize:null,typeName:g.ZodSet,...cn(i)})};class _p extends pn{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==C.function)return L(i,{code:U.invalid_type,expected:C.function,received:i.parsedType}),d;function o(m,f){return bf({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,jf(),Bp].filter((a)=>!!a),issueData:{code:U.invalid_arguments,argumentsError:f}})}function c(m,f){return bf({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,jf(),Bp].filter((a)=>!!a),issueData:{code:U.invalid_return_type,returnTypeError:f}})}let p={errorMap:i.common.contextualErrorMap},x=i.data;if(this._def.returns instanceof uc){let m=this;return Vi(async function(...f){let a=new yi([]),$=await m._def.args.parseAsync(f,p).catch((J)=>{throw a.addIssue(o(f,J)),a}),v=await Reflect.apply(x,this,$);return await m._def.returns._def.type.parseAsync(v,p).catch((J)=>{throw a.addIssue(c(v,J)),a})})}else{let m=this;return Vi(function(...f){let a=m._def.args.safeParse(f,p);if(!a.success)throw new yi([o(f,a.error)]);let $=Reflect.apply(x,this,a.data),v=m._def.returns.safeParse($,p);if(!v.success)throw new yi([c($,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new _p({...this._def,args:Oo.create(n).rest(vc.create())})}returns(n){return new _p({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,o){return new _p({args:n?n:Oo.create([]).rest(vc.create()),returns:i||vc.create(),typeName:g.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:g.ZodLazy,...cn(i)})};class hp extends pn{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return L(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}}hp.create=(n,i)=>{return new hp({value:n,typeName:g.ZodLiteral,...cn(i)})};function nS(n,i){return new wc({values:n,typeName:g.ZodEnum,...cn(i)})}class wc extends pn{constructor(){super(...arguments);Cx.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return L(i,{expected:Fn.joinValues(o),received:i.parsedType,code:U.invalid_type}),d}if(!Lf(this,Cx,"f"))tR(this,Cx,new Set(this._def.values),"f");if(!Lf(this,Cx,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return L(i,{received:i.data,code:U.invalid_enum_value,options:o}),d}return Vi(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 wc.create(n,{...this._def,...i})}exclude(n,i=this._def){return wc.create(this.options.filter((o)=>!n.includes(o)),{...this._def,...i})}}Cx=new WeakMap;wc.create=nS;class up extends pn{constructor(){super(...arguments);hx.set(this,void 0)}_parse(n){let i=Fn.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==C.string&&o.parsedType!==C.number){let c=Fn.objectValues(i);return L(o,{expected:Fn.joinValues(c),received:o.parsedType,code:U.invalid_type}),d}if(!Lf(this,hx,"f"))tR(this,hx,new Set(Fn.getValidEnumValues(this._def.values)),"f");if(!Lf(this,hx,"f").has(n.data)){let c=Fn.objectValues(i);return L(o,{received:o.data,code:U.invalid_enum_value,options:c}),d}return Vi(n.data)}get enum(){return this._def.values}}hx=new WeakMap;up.create=(n,i)=>{return new up({values:n,typeName:g.ZodNativeEnum,...cn(i)})};class uc extends pn{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==C.promise&&i.common.async===!1)return L(i,{code:U.invalid_type,expected:C.promise,received:i.parsedType}),d;let o=i.parsedType===C.promise?i.data:Promise.resolve(i.data);return Vi(o.then((c)=>{return this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})}))}}uc.create=(n,i)=>{return new uc({type:n,typeName:g.ZodPromise,...cn(i)})};class io extends pn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.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(L(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 f=await this._def.schema._parseAsync({data:m,path:o.path,parent:o});if(f.status==="aborted")return d;if(f.status==="dirty")return Vp(f.value);if(i.value==="dirty")return Vp(f.value);return f});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 Vp(m.value);if(i.value==="dirty")return Vp(m.value);return m}}if(c.type==="refinement"){let x=(m)=>{let f=c.refinement(m,p);if(o.common.async)return Promise.resolve(f);if(f 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(!Dc(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(!Dc(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:g.ZodEffects,effect:i,...cn(o)})};io.createWithPreprocess=(n,i,o)=>{return new io({schema:i,effect:{type:"preprocess",transform:n},typeName:g.ZodEffects,...cn(o)})};class Ro extends pn{_parse(n){if(this._getType(n)===C.undefined)return Vi(void 0);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Ro.create=(n,i)=>{return new Ro({innerType:n,typeName:g.ZodOptional,...cn(i)})};class uo extends pn{_parse(n){if(this._getType(n)===C.null)return Vi(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}uo.create=(n,i)=>{return new uo({innerType:n,typeName:g.ZodNullable,...cn(i)})};class Ip extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;if(i.parsedType===C.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}Ip.create=(n,i)=>{return new Ip({innerType:n,typeName:g.ZodDefault,defaultValue:typeof i.default==="function"?i.default:()=>i.default,...cn(i)})};class yp 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(ux(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}}yp.create=(n,i)=>{return new yp({innerType:n,typeName:g.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...cn(i)})};class qx extends pn{_parse(n){if(this._getType(n)!==C.nan){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.nan,received:o.parsedType}),d}return{status:"valid",value:n.data}}}qx.create=(n)=>{return new qx({typeName:g.ZodNaN,...cn(n)})};var dG=Symbol("zod_brand");class Nf 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(),Vp(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:g.ZodPipeline})}}class kp extends pn{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(Dc(c))c.value=Object.freeze(c.value);return c};return ux(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}kp.create=(n,i)=>{return new kp({innerType:n,typeName:g.ZodReadonly,...cn(i)})};function PR(n,i){let o=typeof n==="function"?n(i):typeof n==="string"?{message:n}:n;return typeof o==="string"?{message:o}:o}function iS(n,i={},o){if(n)return Cc.create().superRefine((c,p)=>{var x,m;let f=n(c);if(f instanceof Promise)return f.then((a)=>{var $,v;if(!a){let A=PR(i,c),J=(v=($=A.fatal)!==null&&$!==void 0?$:o)!==null&&v!==void 0?v:!0;p.addIssue({code:"custom",...A,fatal:J})}});if(!f){let a=PR(i,c),$=(m=(x=a.fatal)!==null&&x!==void 0?x:o)!==null&&m!==void 0?m:!0;p.addIssue({code:"custom",...a,fatal:$})}return});return Cc.create()}var eG={object:un.lazycreate},g;(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"})(g||(g={}));var n2=(n,i={message:`Input not instance of ${n.name}`})=>iS((o)=>o instanceof n,i),oS=To.create,cS=Ac.create,i2=qx.create,o2=Jc.create,pS=jp.create,c2=Nc.create,p2=Ix.create,x2=bp.create,m2=Lp.create,f2=Cc.create,a2=vc.create,$2=Qo.create,v2=yx.create,A2=Fo.create,J2=un.create,w2=un.strictCreate,T2=Dp.create,F2=Df.create,R2=Np.create,S2=Oo.create,W2=kx.create,X2=Zx.create,K2=hc.create,G2=_p.create,Y2=Cp.create,z2=hp.create,M2=wc.create,l2=up.create,H2=uc.create,sR=io.create,Q2=Ro.create,O2=uo.create,E2=io.createWithPreprocess,U2=Px.create,V2=()=>oS().optional(),_2=()=>cS().optional(),B2=()=>pS().optional(),j2={string:(n)=>To.create({...n,coerce:!0}),number:(n)=>Ac.create({...n,coerce:!0}),boolean:(n)=>jp.create({...n,coerce:!0}),bigint:(n)=>Jc.create({...n,coerce:!0}),date:(n)=>Nc.create({...n,coerce:!0})},b2=d,Xn=Object.freeze({__proto__:null,defaultErrorMap:Bp,setErrorMap:EG,getErrorMap:jf,makeIssue:bf,EMPTY_PATH:UG,addIssueToContext:L,ParseStatus:Hi,INVALID:d,DIRTY:Vp,OK:Vi,isAborted:z$,isDirty:M$,isValid:Dc,isAsync:ux,get util(){return Fn},get objectUtil(){return Y$},ZodParsedType:C,getParsedType:ho,ZodType:pn,datetimeRegex:eR,ZodString:To,ZodNumber:Ac,ZodBigInt:Jc,ZodBoolean:jp,ZodDate:Nc,ZodSymbol:Ix,ZodUndefined:bp,ZodNull:Lp,ZodAny:Cc,ZodUnknown:vc,ZodNever:Qo,ZodVoid:yx,ZodArray:Fo,ZodObject:un,ZodUnion:Dp,ZodDiscriminatedUnion:Df,ZodIntersection:Np,ZodTuple:Oo,ZodRecord:kx,ZodMap:Zx,ZodSet:hc,ZodFunction:_p,ZodLazy:Cp,ZodLiteral:hp,ZodEnum:wc,ZodNativeEnum:up,ZodPromise:uc,ZodEffects:io,ZodTransformer:io,ZodOptional:Ro,ZodNullable:uo,ZodDefault:Ip,ZodCatch:yp,ZodNaN:qx,BRAND:dG,ZodBranded:Nf,ZodPipeline:Px,ZodReadonly:kp,custom:iS,Schema:pn,ZodSchema:pn,late:eG,get ZodFirstPartyTypeKind(){return g},coerce:j2,any:f2,array:A2,bigint:o2,boolean:pS,date:c2,discriminatedUnion:F2,effect:sR,enum:M2,function:G2,instanceof:n2,intersection:R2,lazy:Y2,literal:z2,map:X2,nan:i2,nativeEnum:l2,never:$2,null:m2,nullable:O2,number:cS,object:J2,oboolean:B2,onumber:_2,optional:Q2,ostring:V2,pipeline:U2,preprocess:E2,promise:H2,record:W2,set:K2,strictObject:w2,string:oS,symbol:p2,transformer:sR,tuple:S2,undefined:x2,union:T2,unknown:a2,void:v2,NEVER:b2,ZodIssueCode:U,quotelessJson:OG,ZodError:yi});var L2="__vite_start_time"in globalThis,D2=typeof window!=="undefined",DN="vitest"in globalThis,sn=ZR({isServer:!L2&&!D2,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 mS=H$(import.meta.dirname,"../dev"),Q$=sn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:xS(H$(mS,"./cert.pem"),"utf-8"),key:xS(H$(mS,"./key.pem"),"utf-8")}:void 0;var Tc=new Ea,fn=sn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:Tc.logger;t.STORE.loggers[0]=new Sc("warn",void 0,fn);if(fn!==console)Object.assign(console,fn,{log:fn.info});import{spawn as N2}from"child_process";import{resolve as C2}from"path";function O$(n,i,o=n.logger){let c=sn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",m=[C2(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")m.push("--experimental-strip-types");let f=N2(p,m);return new Jx(f,i,o)}var fS=va(a0(),1);var h2=604800000,Cf=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new fS.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>h2)c.delete(x);if(c.size===0)n.delete(o)}});i.start(),process.on("exit",()=>{i.stop(),fn.info("\uD83D\uDEEC autoExpiry stopped")})}return n})();import _Y from"path";import vY from"os";import AY from"fs";var hf=new Map,E$=new Map,U$=Symbol("OriginError"),Zp={};class oo extends Promise{constructor(n,i,o,c,p={}){let x,m;super((f,a)=>{x=f,m=a});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=(f)=>(this.active=!1,x(f)),this.reject=(f)=>(this.active=!1,m(f)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[U$]=this.handler.debug?new Error:this.tagged&&u2(this.strings)}get origin(){return(this.handler.debug?this[U$].stack:this.tagged&&E$.has(this.strings)?E$.get(this.strings):E$.set(this.strings,this[U$].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((f)=>o=f)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(m)=>(this.active=!1,x(m))});return this.execute(),c},return(){return o&&o(Zp),{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 u2(n){if(hf.has(n))return hf.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,hf.set(n,new Error),Error.stackTraceLimit=i,hf.get(n)}class qp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var gn={connection:aS,postgres:$S,generic:vS,notSupported:AS};function aS(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,aS),x}function $S(n){let i=new qp(n);return Error.captureStackTrace(i,$S),i}function vS(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,vS),o}function AS(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,AS),i}var I2={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 yf{then(){V$()}catch(){V$()}finally(){V$()}}class gx extends yf{constructor(n){super();this.value=qf(n)}}class Eo extends yf{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class kf extends yf{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=y2.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 Zf(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 gn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+o.push(n instanceof Eo?(i.push(n.value),n.array?n.array[n.type||If(n.value)]||n.type||FS(n.value):n.type):(i.push(n),If(n)))}var wS=SS(I2);function j$(n,i,o,c,p,x){for(let m=1;m<n.strings.length;m++)i+=b$(i,o,c,p,x)+n.strings[m],o=n.args[m];return i}function b$(n,i,o,c,p){return i instanceof kf?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),""):Zf(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 TS(n,i,o,c,p){return n.map((x)=>"("+c.map((m)=>b$("values",x[m],i,o,p)).join(",")+")").join(",")}function JS(n,i,o,c,p){let x=Array.isArray(n[0]),m=i.length?i.flat():Object.keys(x?n[0]:n);return TS(x?n:[n],o,c,m,p)}function uf(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((f)=>{return x=n[f],(x instanceof oo?B$(x,o,c,p):x instanceof gx?x.value:Zf(x,o,c,p))+" as "+qf(p.transform.column.to?p.transform.column.to(f):f)}).join(",")}var y2=Object.entries({values:JS,in:(...n)=>{let i=JS(...n);return i==="()"?"(null)":i},select:uf,as:uf,returning:uf,"\\(":uf,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((x)=>qf(p.transform.column.to?p.transform.column.to(x):x)+"="+b$("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"+TS(Array.isArray(n)?n:[n],o,c,x,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function V$(){throw gn.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:k2,parsers:Z2}=wS;function FS(n){if(Array.isArray(n))return FS(n[0]);return typeof n==="string"?1009:0}var RS=function(n){let i=SS(n||{});return{serializers:Object.assign({},k2,i.serializers),parsers:Object.assign({},Z2,i.parsers)}};function SS(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)=>qf(i.to?i.to(o):o)).join(",")}var qf=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},If=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},q2=/\\/g,P2=/"/g;function s2(n){return n.replace(q2,"\\\\").replace(P2,"\\\"")}var WS=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((f)=>n(f,o,c,p)).join(m)+"}";return"{"+i.map((f)=>{if(f===void 0){if(f=c.transform.undefined,f===void 0)throw gn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return f===null?"null":'"'+s2(o?o(f.type?f.value:f):""+f)+'"'}).join(m)+"}"},_$={i:0,char:null,str:"",quoted:!1,last:0},XS=function n(i,o,c){return _$.i=_$.last=0,KS(_$,i,o,c)};function KS(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(KS(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 Ic=(n)=>{let i=n[0];for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},yc=(n)=>{let i=n[0].toUpperCase();for(let o=1;o<n.length;o++)i+=n[o]==="_"?n[++o].toUpperCase():n[o];return i},kc=(n)=>n.replace(/_/g,"-"),sx=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),rx=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),tx=(n)=>n.replace(/-/g,"_");function D$(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}}Ic.column={from:Ic};Ic.value={from:D$(Ic)};sx.column={to:sx};var N$={...Ic};N$.column.to=sx;yc.column={from:yc};yc.value={from:D$(yc)};rx.column={to:rx};var C$={...yc};C$.column.to=rx;kc.column={from:kc};kc.value={from:D$(kc)};tx.column={to:tx};var h$={...kc};h$.column.to=tx;import GS from"net";import d2 from"tls";import dx from"crypto";import u$ from"stream";import{performance as YS}from"perf_hooks";class Zc 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=r2;function r2(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 Qi=Buffer.allocUnsafe(256),t2="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return Qi[0]=o,Hn.i=5,Hn},n},{}),Hn=Object.assign(g2,t2,{N:String.fromCharCode(0),i:0,inc(n){return Hn.i+=n,Hn},str(n){let i=Buffer.byteLength(n);return Pf(i),Hn.i+=Qi.write(n,Hn.i,i,"utf8"),Hn},i16(n){return Pf(2),Qi.writeUInt16BE(n,Hn.i),Hn.i+=2,Hn},i32(n,i){if(i||i===0)return Qi.writeUInt32BE(n,i),Hn;return Pf(4),Qi.writeUInt32BE(n,Hn.i),Hn.i+=4,Hn},z(n){return Pf(n),Qi.fill(0,Hn.i,Hn.i+n),Hn.i+=n,Hn},raw(n){return Qi=Buffer.concat([Qi.subarray(0,Hn.i),n]),Hn.i=Qi.length,Hn},end(n=1){Qi.writeUInt32BE(Hn.i-n,n);let i=Qi.subarray(0,Hn.i);return Hn.i=0,Qi=Buffer.allocUnsafe(256),i}}),P=Hn;function Pf(n){if(Qi.length-Hn.i<n){let i=Qi,o=i.length;Qi=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(Qi)}}function g2(){return Hn.i=0,Hn}var k$=lS,e2=1,Fc=P().S().end(),zS=P().H().end(),nY=P().i32(8).i32(80877103).end(8),iY=Buffer.concat([P().E().str(P.N).i32(0).end(),Fc]),oY=P().D().str("S").str(P.N).end(),Pp=()=>{},cY=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),pY={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 lS(n,i={},{onopen:o=Pp,onend:c=Pp,onclose:p=Pp}={}){let{ssl:x,max:m,user:f,host:a,port:$,database:v,parsers:A,transform:J,onnotice:S,onnotify:W,onparameter:R,max_pipeline:K,keep_alive:z,backoff:M,target_session_attrs:h}=n,G=ki(),H=e2++,O={pid:null,secret:null},Q=y$(fa,n.idle_timeout),j=y$(fa,n.max_lifetime),y=y$(p6,n.connect_timeout),l=null,an,Z=new Zc,$n=Buffer.alloc(0),Qn=n.fetch_types,dn={},Bi={},Uo=Math.random().toString(36).slice(2),E=1,q=0,Rn=0,Ln=0,en=0,vn=0,Vn=0,rn=0,Cn=null,jn=null,Fi=!1,_n=null,co=null,Ri=null,Io=null,ni=null,bn=null,po=null,Xo=null,_=null,dp=null,Si={queue:i.closed,idleTimer:Q,connect(w){Ri=w||!0,S1()},terminate:nx,execute:ep,cancel:n6,end:fa,count:0,id:H};return i.closed&&i.closed.push(Si),Si;async function eS(){let w;try{w=n.socket?await Promise.resolve(n.socket(n)):new GS.Socket}catch(X){rc(X);return}return w.on("error",rc),w.on("close",W1),w.on("drain",F1),w}async function n6({pid:w,secret:X},s,Sn){try{an=P().i32(16).i32(80877102).i32(w).i32(X).end(16),await R1(),l.once("error",Sn),l.once("close",s)}catch(In){Sn(In)}}function ep(w){if(Fi)return xm(w,gn.connection("CONNECTION_DESTROYED",n));if(w.cancelled)return;try{return w.state=O,_?G.push(w):(_=w,_.active=!0),c6(w),Ai(i6(w))&&!w.describeFirst&&!w.cursorFn&&G.length<K&&(!w.options.onexecute||w.options.onexecute(Si))}catch(X){return G.length===0&&Ai(Fc),Ko(X),!0}}function i6(w){if(w.parameters.length>=65534)throw gn.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return w.options.simple?P().Q().str(w.statement.string+P.N).end():w.describeFirst?Buffer.concat([J1(w),zS]):w.prepare?w.prepared?pm(w):Buffer.concat([J1(w),pm(w)]):o6(w)}function J1(w){return Buffer.concat([K1(w.statement.string,w.parameters,w.statement.types,w.statement.name),I6("S",w.statement.name)])}function pm(w){return Buffer.concat([u6(w.parameters,w.statement.types,w.statement.name,w.cursorName),w.cursorFn?G1("",w.cursorRows):iY])}function o6(w){return Buffer.concat([K1(w.statement.string,w.parameters,w.statement.types),oY,pm(w)])}function c6(w){let X=[],s=[],Sn=j$(w,w.strings[0],w.args[0],X,s,n);!w.tagged&&w.args.forEach((In)=>Zf(In,X,s,n)),w.prepare=n.prepare&&("prepare"in w.options?w.options.prepare:!0),w.string=Sn,w.signature=w.prepare&&s+Sn,w.onlyDescribe&&delete Bi[w.signature],w.parameters=w.parameters||X,w.prepared=w.prepare&&w.signature in Bi,w.describeFirst=w.onlyDescribe||X.length&&!w.prepared,w.statement=w.prepared?Bi[w.signature]:{string:Sn,types:s,name:w.prepare?Uo+E++:""},typeof n.debug==="function"&&n.debug(H,Sn,X,s)}function Ai(w,X){if(bn=bn?Buffer.concat([bn,w]):Buffer.from(w),X||bn.length>=1024)return w1(X);return jn===null&&(jn=setImmediate(w1)),!0}function w1(w){let X=l.write(bn,w);return jn!==null&&clearImmediate(jn),bn=jn=null,X}function p6(){Ko(gn.connection("CONNECT_TIMEOUT",n,l)),l.destroy()}async function T1(){if(Ai(nY),!await new Promise((X)=>l.once("data",(s)=>X(s[0]===83)))&&x==="prefer")return sc();l.removeAllListeners(),l=d2.connect({socket:l,servername:GS.isIP(l.host)?void 0:l.host,...x==="require"||x==="allow"||x==="prefer"?{rejectUnauthorized:!1}:x==="verify-full"?{}:typeof x==="object"?x:{}}),l.on("secureConnect",sc),l.on("error",rc),l.on("close",W1),l.on("drain",F1)}function F1(){!_&&o(Si)}function ma(w){if(_n){if(_n.push(w),Rn-=w.length,Rn>=0)return}$n=_n?Buffer.concat(_n,vn-Rn):$n.length===0?w:Buffer.concat([$n,w],$n.length+w.length);while($n.length>4){if(vn=$n.readUInt32BE(1),vn>=$n.length){Rn=vn-$n.length,_n=[$n];break}try{x6($n.subarray(0,vn+1))}catch(X){_&&(_.cursorFn||_.describeFirst)&&Ai(Fc),Ko(X)}$n=$n.subarray(vn+1),Rn=0,_n=null}}async function R1(){if(Fi=!1,dn={},l||(l=await eS()),!l)return;if(y.start(),n.socket)return x?T1():sc();if(l.on("connect",x?T1:sc),n.path)return l.connect(n.path);l.ssl=x,l.connect($[Ln],a[Ln]),l.host=a[Ln],l.port=$[Ln],Ln=(Ln+1)%$.length}function S1(){setTimeout(R1,q?q+Vn-YS.now():0)}function sc(){try{Bi={},Qn=n.fetch_types,Uo=Math.random().toString(36).slice(2),E=1,j.start(),l.on("data",ma),z&&l.setKeepAlive&&l.setKeepAlive(!0,1000*z);let w=k6();Ai(w)}catch(w){rc(w)}}function rc(w){if(Si.queue===i.connecting&&n.host[en+1])return;Ko(w);while(G.length)xm(G.shift(),w)}function Ko(w){ni&&(ni.destroy(w),ni=null),_&&xm(_,w),Ri&&(xm(Ri,w),Ri=null)}function xm(w,X){"query"in X||"parameters"in X||Object.defineProperties(X,{stack:{value:X.stack+w.origin.replace(/.*\n/,`
|
|
61
|
-
`),enumerable:n.debug},query:{value:w.string,enumerable:n.debug},parameters:{value:w.parameters,enumerable:n.debug},args:{value:w.args,enumerable:n.debug},types:{value:w.statement&&w.statement.types,enumerable:n.debug}}),w.reject(X)}function fa(){return Io||(!Si.reserved&&c(Si),!Si.reserved&&!Ri&&!_&&G.length===0?(nx(),new Promise((w)=>l&&l.readyState!=="closed"?l.once("close",w):w())):Io=new Promise((w)=>po=w))}function nx(){if(Fi=!0,ni||_||Ri||G.length)rc(gn.connection("CONNECTION_DESTROYED",n));if(clearImmediate(jn),l)l.removeListener("data",ma),l.removeListener("connect",sc),l.readyState==="open"&&l.end(P().X().end());po&&(po(),Io=po=null)}async function W1(w){if($n=Buffer.alloc(0),Rn=0,_n=null,clearImmediate(jn),l.removeListener("data",ma),l.removeListener("connect",sc),Q.cancel(),j.cancel(),y.cancel(),l.removeAllListeners(),l=null,Ri)return S1();!w&&(_||G.length)&&rc(gn.connection("CONNECTION_CLOSED",n,l)),q=YS.now(),w&&n.shared.retries++,Vn=(typeof M==="function"?M(n.shared.retries):M)*1000,p(Si,gn.connection("CONNECTION_CLOSED",n,l))}function x6(w,X=w[0]){(X===68?m6:X===100?B6:X===65?Q6:X===83?f6:X===90?a6:X===67?$6:X===50?X1:X===49?v6:X===116?A6:X===84?J6:X===82?w6:X===110?X6:X===75?K6:X===69?l6:X===115?O6:X===51?E6:X===71?U6:X===78?b6:X===72?V6:X===99?j6:X===73?L6:X===86?D6:X===118?N6:X===87?_6:C6)(w)}function m6(w){let X=7,s,Sn,In,Wi=_.isRaw?new Array(_.statement.columns.length):{};for(let Oi=0;Oi<_.statement.columns.length;Oi++)Sn=_.statement.columns[Oi],s=w.readInt32BE(X),X+=4,In=s===-1?null:_.isRaw===!0?w.subarray(X,X+=s):Sn.parser===void 0?w.toString("utf8",X,X+=s):Sn.parser.array===!0?Sn.parser(w.toString("utf8",X+1,X+=s)):Sn.parser(w.toString("utf8",X,X+=s)),_.isRaw?Wi[Oi]=_.isRaw===!0?In:J.value.from?J.value.from(In,Sn):In:Wi[Sn.name]=J.value.from?J.value.from(In,Sn):In;_.forEachFn?_.forEachFn(J.row.from?J.row.from(Wi):Wi,Z):Z[rn++]=J.row.from?J.row.from(Wi):Wi}function f6(w){let[X,s]=w.toString("utf8",5,w.length-1).split(P.N);if(dn[X]=s,n.parameters[X]!==s)n.parameters[X]=s,R&&R(X,s)}function a6(w){if(_&&_.options.simple&&_.resolve(co||Z),_=co=null,Z=new Zc,y.cancel(),Ri){if(h){if(!dn.in_hot_standby||!dn.default_transaction_read_only)return M6();else if(z6(h,dn))return nx()}if(Qn)return Ri===!0&&(Ri=null),G6();Ri!==!0&&ep(Ri),n.shared.retries=en=0,Ri=null;return}while(G.length&&(_=G.shift())&&(_.active=!0,_.cancelled))lS(n).cancel(_.state,_.cancelled.resolve,_.cancelled.reject);if(_)return;Si.reserved?!Si.reserved.release&&w[5]===73?Io?nx():(Si.reserved=null,o(Si)):Si.reserved():Io?nx():o(Si)}function $6(w){rn=0;for(let X=w.length-1;X>0;X--){if(w[X]===32&&w[X+1]<58&&Z.count===null)Z.count=+w.toString("utf8",X+1,w.length-1);if(w[X-1]>=65){Z.command=w.toString("utf8",5,X),Z.state=O;break}}if(dp&&(dp(),dp=null),Z.command==="BEGIN"&&m!==1&&!Si.reserved)return Ko(gn.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(_.options.simple)return X1();if(_.cursorFn)Z.count&&_.cursorFn(Z),Ai(Fc);_.resolve(Z)}function v6(){_.parsing=!1}function X1(){!Z.statement&&(Z.statement=_.statement),Z.columns=_.statement.columns}function A6(w){let X=w.readUInt16BE(5);for(let s=0;s<X;++s)!_.statement.types[s]&&(_.statement.types[s]=w.readUInt32BE(7+s*4));_.prepare&&(Bi[_.signature]=_.statement),_.describeFirst&&!_.onlyDescribe&&(Ai(pm(_)),_.describeFirst=!1)}function J6(w){if(Z.command)co=co||[Z],co.push(Z=new Zc),Z.count=null,_.statement.columns=null;let X=w.readUInt16BE(5),s=7,Sn;_.statement.columns=Array(X);for(let In=0;In<X;++In){Sn=s;while(w[s++]!==0);let Wi=w.readUInt32BE(s),Oi=w.readUInt16BE(s+4),yo=w.readUInt32BE(s+6);_.statement.columns[In]={name:J.column.from?J.column.from(w.toString("utf8",Sn,s-1)):w.toString("utf8",Sn,s-1),parser:A[yo],table:Wi,number:Oi,type:yo},s+=18}if(Z.statement=_.statement,_.onlyDescribe)return _.resolve(_.statement),Ai(Fc)}async function w6(w,X=w.readUInt32BE(5)){(X===3?T6:X===5?F6:X===10?R6:X===11?S6:X===12?W6:X!==0?h6:Pp)(w,X)}async function T6(){let w=await aa();Ai(P().p().str(w).z(1).end())}async function F6(w){let X="md5"+await MS(Buffer.concat([Buffer.from(await MS(await aa()+f)),w.subarray(9)]));Ai(P().p().str(X).z(1).end())}async function R6(){Xo=(await dx.randomBytes(18)).toString("base64"),P().p().str("SCRAM-SHA-256"+P.N);let w=P.i;Ai(P.inc(4).str("n,,n=*,r="+Xo).i32(P.i-w-4,w).end())}async function S6(w){let X=w.toString("utf8",9).split(",").reduce((Oi,yo)=>(Oi[yo[0]]=yo.slice(2),Oi),{}),s=await dx.pbkdf2Sync(await aa(),Buffer.from(X.s,"base64"),parseInt(X.i),32,"sha256"),Sn=await sf(s,"Client Key"),In="n=*,r="+Xo+",r="+X.r+",s="+X.s+",i="+X.i+",c=biws,r="+X.r;Cn=(await sf(await sf(s,"Server Key"),In)).toString("base64");let Wi="c=biws,r="+X.r+",p="+mY(Sn,Buffer.from(await sf(await xY(Sn),In))).toString("base64");Ai(P().p().str(Wi).end())}function W6(w){if(w.toString("utf8",9).split(P.N,1)[0].slice(2)===Cn)return;Ko(gn.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),l.destroy()}function aa(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function X6(){if(Z.statement=_.statement,Z.statement.columns=[],_.onlyDescribe)return _.resolve(_.statement),Ai(Fc)}function K6(w){O.pid=w.readUInt32BE(5),O.secret=w.readUInt32BE(9)}async function G6(){Qn=!1,(await new oo([`
|
|
59
|
+
${J.trace}`:`No previous disposal trace for ${f} was found.`),o}let v=n.moleculeGraph.getRelationEntries({downstreamMoleculeKey:m.stringKey}).filter(([,{source:J}])=>J!==p).map(([J])=>mi(J));if(c)x.moleculeGraph.delete(p);x.moleculeGraph.set({upstreamMoleculeKey:a.stringKey,downstreamMoleculeKey:m.stringKey},{source:a.stringKey});let $={type:"molecule_transfer",key:m.key,from:v,to:[a.key]};if(Gn(x)&&x.transactionMeta.phase==="building")x.transactionMeta.update.updates.push($);return o}function Ta(n,i,o){switch(i){case"newValue":{y$(n,o);break}case"oldValue":{Xc(o,n.token);break}}}function Fa(n,i,o){switch(i){case"newValue":{Xc(o,n.token);break}case"oldValue":{if(y$(n,o),n.subType==="atom")o.valueMap.set(n.token.key,n.value);break}}}function y$(n,i){let{family:o}=n.token;if(o){let c=i.families.get(o.key);if(c)r(i,c,mi(o.subKey))}}function k$(n,i,o){switch(i){case"newValue":Fc(o,n.provenance,n.key);break;case"oldValue":Rc(o,n.key);break}}function Z$(n,i,o){switch(i){case"newValue":Rc(o,n.key);break;case"oldValue":{let c=n.provenance.map(mi);Fc(o,c,n.key);for(let[p,x]of n.values){let m=o.families.get(p);if(m){r(o,m,n.key);let f=`${p}(${wn(n.key)})`;o.valueMap.set(f,x)}}}break}}function q$(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":Ta(p,n,o);break;case"state_disposal":Fa(p,n,o);break;case"molecule_creation":k$(p,n,o);break;case"molecule_disposal":Z$(p,n,o);break;case"molecule_transfer":q$(p,n,o);break;case"transaction_update":wm(n,p,o);break}}function P$(n,i,o){if(oi(n)&&i)n.transactionMeta.epoch.set(i,o)}function s$(n,i,o){if(!oi(n))return;let p=n.transactionMeta.actionContinuities.getRelatedKey(i);if(p!==void 0)n.transactionMeta.epoch.set(p,o)}var r$=(n,i)=>{let o=B(i),{parent:c}=o;if(c===null||!Gn(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),oi(c))s$(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(Gn(c))c.transactionMeta.update.updates.push(o.transactionMeta.update);c.on.transactionApplying.next(null)};function t$(n,i,o){if(!oi(n))return;let{epoch:p,actionContinuities:x}=n.transactionMeta;if(x.set(i,o),!p.has(i))p.set(i,-1)}function g$(n){return{store:n}}function Hn(n,...i){let o,c,p;if(i.length===1)o=i[0];else c=i[0],p=i[1],o=r(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((f)=>f?.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 f=Fn(n,c).default(x);return n.defaults.set(c.key,f),f}}}return yo(n,Fn(n,o))}class Zi extends Map{source;deleted=new Set;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 d$=(n,i,o,c)=>{let p=B(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=e$(n,i),f={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)=>Hn(a,...v),set:(...v)=>{On(a,...v)},run:(v,$=mm())=>gc(a,v,$),find:(v,$)=>r(a,v,$),json:(v)=>ni(a,v),dispose:(...v)=>{Xc(a,...v)},env:()=>g$(a)}},a=Object.assign(x,{transactionMeta:f});return p.child=a,n.logger.info("\uD83D\uDEEB","transaction",i,"Building transaction with params:",o),a};function Ra(n,i){let o={key:i.key,type:"transaction",run:(x,m)=>{let f=d$(n,i.key,x,m);try{let a=B(n),{toolkit:v}=f.transactionMeta,$=i.do(v,...x);return r$($,a),$}catch(a){throw Q$(c),n.logger.warn("\uD83D\uDCA5","transaction",i.key,"caught:",a),a}},install:(x)=>Ra(x,i),subject:new $n},c=B(n);c.transactions.set(o.key,o);let p=So(o);return n.on.transactionCreation.next(p),p}function e$(n,i){let o=oi(n),c=o?n.transactionMeta.actionContinuities.getRelatedKey(i):void 0;return o&&c!==void 0?n.transactionMeta.epoch.get(c):void 0}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 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 Ja(null),operationClose:new $n,moleculeCreation:new $n,moleculeDisposal:new $n};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Wc("warn",(n,i,o)=>!o.includes("\uD83D\uDD0D"))];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},oi(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 i1(n,i,o){let c=n.families.get(i.key);if(c===void 0)throw new Tc(i,n);let p=c(o),x=B(n);if(p.family){if(oi(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(Gn(x)&&x.on.transactionApplying.state===null)x.transactionMeta.update.updates.push({type:"state_creation",token:p})}return p}function o1(n,i,o){let c=wn(o),p=`${i.key}(${c})`,x=B(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 So(m);return m}function r(n,i,o){let c=o1(n,i,o);if(c)return c;let p=wn(o),x=n.molecules.get(p);if(!x&&n.config.lifespan==="immortal"){let m=l$(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=i1(n,i,o),x)B(n).moleculeData.set(p,i.key);return c}function Xc(n,...i){let o;if(i.length===1)o=i[0];else{let c=i[0],p=i[1];o=r(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":Xa(n,o);break;case"selector":case"readonly_selector":c1(n,o);break}}var Jm=(n,i)=>B(n).atoms.has(i),n7=(n,i)=>B(n).selectors.has(i),i7=(n,i)=>B(n).readonlySelectors.has(i),p1=(n,i)=>Jm(n,i)||n7(n,i)||i7(n,i);var Am=(n,i)=>{return B(i).selectorGraph.getRelationEntries({downstreamSelectorKey:n}).filter(([c,{source:p}])=>p!==n).map(([c,{source:p}])=>p).filter((c)=>p1(i,c))};var Wa=(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},x1=(n,i)=>{let o=n.key,c=Am(o,i),p=new Set;return c.flatMap((x)=>Jm(i,x)?x:Wa(x,p,i))};var m1=(n,i,o,c)=>{let p=B(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=Wa(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=B(o),x;if(c.length===2){let[a,v]=c;x=r(o,a,v)}else[x]=c;let m=Fn(o,x),f=yo(o,m);return o.logger.info("\uD83D\uDD0C","selector",n,`registers dependency ( "${x.key}" =`,f,")"),p.selectorGraph.set({upstreamSelectorKey:x.key,downstreamSelectorKey:n},{source:x.key}),m1(n,x,i,o),f},set:(...c)=>{let p,x;if(c.length===2)p=c[0],x=c[1];else{let a=c[0],v=c[1];x=c[2],p=r(o,a,v)}let m=B(o),f=Fn(m,p);vm(m,f,x)},find:(c,p)=>r(o,c,p),json:(c)=>ni(o,c)});var xx=(n,i,o)=>{let c=B(n),p=new $n,x=new Set,{get:m,find:f,json:a}=Tm(i.key,x,c),v=()=>{let X=i.get({get:m,find:f,json:a});return ki(B(n),i.key,X,p),x.clear(),X},$={...i,subject:p,install:(X)=>xx(X,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 ax=(n,i,o)=>{let c=B(n),p=new $n,x=new Set,m=Tm(i.key,x,c),{find:f,get:a,json:v}=m,$={find:f,get:a,json:v},w=(S=i.get,H=B(n))=>{let M=S($);return ki(H,i.key,M,p),x.clear(),M},X={...i,subject:p,install:(S)=>ax(S,i,o),get:w,set:(S)=>{let H=B(n),M=w(i.get,H),I=am(S)(M);if(n.logger.info("\uD83D\uDCDD","selector",i.key,"set (",M,"->",I,")"),ki(H,i.key,I,p),dc(H,i.key),oi(H))p.next({newValue:I,oldValue:M});i.set(m,I)},type:"selector",...o&&{family:o}};c.selectors.set(i.key,X);let W=w();n.logger.info("\u2728",X.type,X.key,"=",W);let R={key:i.key,type:"selector"};if(o)R.family=o;return R};function wa(n,i){if("set"in i){let p=ax(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 c1(n,i){let o=B(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"),Gn(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,f=Object.assign((a)=>{let v=wn(a),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=B(n),X=ax(J,{key:w,get:i.get(a),set:i.set(a)},$);return x.next({type:"state_creation",token:X}),X},c,{internalRoles:o,subject:x,install:(a)=>mx(a,i),default:(a)=>{return i.get(a)({get:(...$)=>Hn(n,...$),find:($,w)=>r(n,$,w),json:($)=>ni(n,$)})}});return n.families.set(i.key,f),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 mi=(n)=>JSON.parse(n),wn=(n)=>JSON.stringify(n),_Q=[Array.prototype,Boolean.prototype,Number.prototype,Object.prototype,String.prototype];var a1=(n,i)=>{let o=B(n);if(o.operation.open)return o.operation.prev.get(i.key);return o.valueMap.get(i.key)};var Ga=(n,i)=>{let o=B(n);return x1(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 f=a1(o,i),a=yo(o,i);n.logger.info("\u2728",i.type,i.key,"went",f,"->",a),i.subject.next({newValue:a,oldValue:f})})})};function Wi(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",f=null,a=p;if(m)f=Ga(n,x),a=(w)=>{if(f)f.length=0,f.push(...Ga(n,x));p(w)};let v=x.subject.subscribe(o,a);return()=>{if(n.logger.info("\uD83D\uDE48",x.type,x.key,`Removing subscription "${o}"`),v(),f)for(let w of f)w()}}var Ka=(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 Sa=(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 Kc{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}:${Gn(o)?o.transactionMeta.update.key:"main"}:${n.key}`,p=Hn(o,n);this.unsubscribeFromInnerValue=p.subscribe(c,(x)=>{On(o,i,x)}),this.unsubscribeFromState=Wi(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}:${Gn(o)?o.transactionMeta.update.key:"main"}:${n.key}`;Wi(o,i,c,({newValue:p,oldValue:x})=>{let m=o.timelineTopics.getRelatedKey(i.key);if(m){if(o.timelines.get(m)?.timeTraveling){let v=Ka(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 f=o.on.operationClose.subscribe(c,()=>{f();let a=Hn(o,n),v=p===null?-1:a.getUpdateNumber(p),$=v-a.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 ${a.cacheUpdateNumber+1}, but got ${v}`)})})}mutableState;latestUpdateState;[Symbol.dispose];constructor(n,i){this.mutableState=n;let o=B(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=B(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."),So(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 f=i.default();c.atoms.set(m.key,m),Fm(n,i.key),ki(c,i.key,f,x);let a=So(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(X)=>{On(n,a,X)},onSet:(X)=>Wi(n,a,`effect[${v}]`,X)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}if(new Kc(a,n),!o)H$(a,i,n);return a}class Ya{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=mi(x.family.subKey);switch(p){case"state_creation":this.trackers.set(m,new Kc(x,i));break;case"state_disposal":{let f=this.trackers.get(m);if(f)f[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,f=Object.assign((a)=>{let v=wn(a),$={key:i.key,subKey:v},w=`${i.key}(${v})`,J=B(n),X={key:w,default:()=>i.default(a),toJson:i.toJson,fromJson:i.fromJson,mutable:!0};if(i.effects)X.effects=i.effects(a);let W=vx(J,X,$);return x.next({type:"state_creation",token:W}),W},c,{subject:x,install:(a)=>px(a,i),toJson:i.toJson,fromJson:i.fromJson,internalRoles:o});return n.families.set(i.key,f),f1(n,f,i),new Ya(f,n),c}var Ha=(n,i)=>{let o=B(i),c=`${n.key}:JSON`;return o.families.get(c)};var ni=(n,i)=>{if(i.family){let c=B(n),x={key:`${i.family.key}:JSON`,type:"selector_family"},m=Fn(c,x),f=JSON.parse(i.family.subKey);return r(n,m,f)}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 b$(n){return typeof n==="object"&&n!==null&&"do"in n&&"undo"in n&&"subscribe"in n}function fx(n,i,o){let c=o.valueMap.get(i.key),p=n.valueMap.get(i.key);if(c===p){if(c===void 0)return typeof i.default==="function"?i.default():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 Kc(i,o),m}return p}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 E$=(n,i)=>{let o=i.valueMap.get(n.key);if(n.type==="mutable_atom"&&Gn(i)){let{parent:c}=i;o=fx(i,n,c)}return o},B$=(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 D$=(n,i)=>{return B(n).atomsThatAreDefault.has(i)},Fm=(n,i)=>{let o=B(n);o.atomsThatAreDefault=new Set(o.atomsThatAreDefault).add(i)},N$=(n,i)=>{let o=B(n);o.atomsThatAreDefault=new Set(B(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=B(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."),So(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 f=i.default;if(i.default instanceof Function)f=i.default();c.atoms.set(m.key,m),Fm(n,i.key),ki(c,i.key,f,x);let a=So(m);if(i.effects){let v=0,$=[];for(let w of i.effects){let J=w({setSelf:(X)=>{On(n,a,X)},onSet:(X)=>Wi(n,a,`effect[${v}]`,X)});if(J)$.push(J);++v}m.cleanup=()=>{for(let w of $)w()}}return a}function v1(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 Xa(n,i){let o=B(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),f=Fn(n,{key:p.key,type:"atom_family"}),a={type:"state_disposal",subType:"atom",token:i,value:m};f.subject.next(a);let v=Gn(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);Xa(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(([X])=>X===x.family?.key)))o.transactionMeta.update.updates.push(a)}else n.on.atomDisposal.next(i)}}class ci extends Set{mode="record";subject=new $n;cacheLimit=0;cache=[];cacheIdx=-1;cacheUpdateNumber=-1;constructor(n,i=0){super(n);if(n instanceof ci)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 ci(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 ci(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 f=!1;while(!f){this.cacheIdx%=this.cacheLimit;let v=this.cache[this.cacheIdx];if(this.cacheIdx--,!v)return"OUT_OF_RANGE";this.undo(v),f=this.cacheIdx===x-1}let a=n.substring(i+1);return this.doStep(a),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 Ma(o),this.options=n,this.defaultContent=i,this.store.miscResources.set(`join:${n.key}`,this),this.realm.allocate("root",n.key),this.toolkit={get:(...Y)=>Hn(o,...Y),set:(...Y)=>{On(o,...Y)},find:(...Y)=>r(o,...Y),json:(Y)=>ni(o,Y)};let c=n.between[0],p=n.between[1],x=px(o,{key:`${n.key}/relatedKeys`,default:()=>new ci,mutable:!0,fromJson:(Y)=>ci.fromJSON(Y),toJson:(Y)=>Y.toJSON()},["join","relations"]);this.core={relatedKeysAtoms:x};let m=({get:Y},l)=>Y(x,l),f=({set:Y},l,E)=>{if(!this.store.molecules.has(wn(l)))this.realm.allocate(n.key,l);Y(x,l,(Q)=>Q.add(E)),Y(x,E,(Q)=>Q.add(l))},a=({set:Y},l,E)=>{Y(x,l,(Q)=>{return Q.delete(E),Q}),Y(x,E,(Q)=>{return Q.delete(l),Q})},v=(Y,l,E)=>{let{find:Q,get:j,set:y}=Y,z=Q(x,l),fn=j(z);for(let Z of fn){if(E.includes(Z))continue;y(x,Z,(En)=>{return En.delete(l),En})}y(z,(Z)=>{return Z.transaction((an)=>{an.clear();for(let En of E){let gn=m(Y,En),_i=gn.has(l);if(this.relations.cardinality==="1:n"){let Oo=[];for(let O of gn){if(O===l)continue;let q=m(Y,O);if(q.delete(En),q.size===0)Oo.push(O)}if(!_i&&gn.size>0)gn.clear();for(let O of Oo){let q=[En,O].sort(),Rn=`"${q[0]}:${q[1]}"`;this.molecules.delete(Rn)}}if(!_i)gn.add(l);an.add(En)}return!0}),Z})},$=(Y,l,E)=>{let{set:Q}=Y;Q(x,l,(j)=>{return j.transaction((y)=>{for(let z of E)y.add(z);return!0}),j});for(let j of E)Q(x,j,(y)=>{return y.add(l),y});return!0},w=(Y,l,E)=>{let Q=m(Y,l);return E?Q.has(E):Q.size>0},J={getRelatedKeys:(Y)=>m(this.toolkit,Y),addRelation:(Y,l)=>{this.store.moleculeJoins.set(Y,n.key),this.store.moleculeJoins.set(l,n.key),f(this.toolkit,Y,l)},deleteRelation:(Y,l)=>{a(this.toolkit,Y,l)},replaceRelationsSafely:(Y,l)=>{v(this.toolkit,Y,l)},replaceRelationsUnsafely:(Y,l)=>{$(this.toolkit,Y,l)},has:(Y,l)=>w(this.toolkit,Y,l)},X,W;if(i){W=Jc(o,{key:`${n.key}/content`,default:i},["join","content"]);let Y=({get:Q},j)=>Q(W,j),l=({set:Q},j,y)=>{Q(W,j,y)};X=Object.assign(J,{getContent:(Q)=>{return Y(this.toolkit,Q)},setContent:(Q,j)=>{l(this.toolkit,Q,j)},deleteContent:(Q)=>{this.realm.deallocate(Q)}})}else X=J;let R=new ii(n,{externalStore:X,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...Y)=>{let[l,E]=Y,Q=Y.sort(),j=`${Q[0]}:${Q[1]}`,y=o.molecules.get(wn(l)),z=o.molecules.get(wn(E));if(!y)this.realm.allocate(n.key,l);if(!z)this.realm.allocate(n.key,E);return this.realm.allocate(l,j,"all"),this.realm.claim(E,j),this.store.moleculeJoins.set(j,n.key),j}}),S=()=>Io(o,{key:`${n.key}/singleRelatedKey`,get:(Y)=>({get:l})=>{let E=l(x,Y);for(let Q of E)return Q;return null}},["join","keys"]),H=()=>{return Io(o,{key:`${n.key}/multipleRelatedKeys`,get:(Y)=>({get:l})=>{let E=Ha(x,o);return l(E,Y).members}},["join","keys"])},M=()=>Io(o,{key:`${n.key}/singleRelatedEntry`,get:(Y)=>({get:l})=>{let E=l(x,Y);for(let Q of E){let j=R.isAType?.(Y)?Y:void 0,y=j===void 0?Y:void 0;j??=Q,y??=Q;let z=R.makeContentKey(j,y),fn=l(W,z);return[Q,fn]}return null}},["join","entries"]),I=()=>Io(o,{key:`${n.key}/multipleRelatedEntries`,get:(Y)=>({get:l})=>{let E=Ha(x,o);return l(E,Y).members.map((j)=>{let y=R.isAType?.(Y)?Y:void 0,z=y===void 0?Y:void 0;y??=j,z??=j;let fn=R.makeContentKey(y,z),Z=l(W,fn);return[j,Z]})}},["join","entries"]);switch(n.cardinality){case"1:1":{let Y=S(),l=`${c}KeyOf${Mn(p)}`,E=`${p}KeyOf${Mn(c)}`,Q={[l]:Y,[E]:Y},j;if(i){let y=M(),z=`${c}EntryOf${Mn(p)}`,fn=`${p}EntryOf${Mn(c)}`,Z={[z]:y,[fn]:y};j=Object.assign(Q,Z)}else j=Q;this.relations=R,this.states=j;break}case"1:n":{let Y=S(),l=H(),E=`${c}KeyOf${Mn(p)}`,Q=`${p}KeysOf${Mn(c)}`,j={[E]:Y,[Q]:l},y;if(i){let z=M(),fn=I(),Z=`${c}EntryOf${Mn(p)}`,an=`${p}EntriesOf${Mn(c)}`,En={[Z]:z,[an]:fn};y=Object.assign(j,En)}else y=j;this.relations=R,this.states=y;break}default:{let Y=H(),l=`${c}KeysOf${Mn(p)}`,E=`${p}KeysOf${Mn(c)}`,Q={[l]:Y,[E]:Y},j;if(i){let y=I(),z=`${c}EntriesOf${Mn(p)}`,fn=`${p}EntriesOf${Mn(c)}`,Z={[z]:y,[fn]:y};j=Object.assign(Q,Z)}else j=Q;this.relations=R,this.states=j}}}}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=B(o);if(Gn(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 a=c.states[x];return r(o,a,i)},get[m](){let a=c.states[m];return r(o,a,i)}};let f=`${n.a}EntryOf${Mn(n.b)}`;if(f in c.states){let a=`${n.b}EntryOf${Mn(n.a)}`;Object.assign(p,{get[f](){let v=c.states[f];return r(o,v,i)},get[a](){let v=c.states[a];return r(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 a=c.states[x];return r(o,a,i)},get[m](){let a=c.states[m];return r(o,a,i)}};let f=`${n.a}EntryOf${Mn(n.b)}`;if(f in c.states){let a=`${n.b}EntriesOf${Mn(n.a)}`;Object.assign(p,{get[f](){let v=c.states[f];return r(o,v,i)},get[a](){let v=c.states[a];return r(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 a=c.states[x];return r(o,a,i)},get[m](){let a=c.states[m];return r(o,a,i)}};let f=`${n.a}EntriesOf${Mn(n.b)}`;if(f in c.states){let a=`${n.b}EntriesOf${Mn(n.a)}`;Object.assign(p,{get[f](){let v=c.states[f];return r(o,v,i)},get[a](){let v=c.states[a];return r(o,v,i)}})}}}return p}function $1(n,i){return np(n,i).core.relatedKeysAtoms}function Zo(n){return v1(d.STORE,n)}function Sc(n){return M$(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 w1(n){return $1(n,d.STORE)}var za=(n)=>(i,o,c,p,...x)=>{console[n](`${i} ${o} "${c}" ${p}`,...x)},o7={error:za("error"),info:za("info"),warn:za("warn")};class Wc{logLevel;filter;logger;constructor(n,i,o=o7){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 dU=Symbol("claim");class J1{store;constructor(n=d.STORE){this.store=n,u$("root",n)}allocate(n,i,o){return Fc(this.store,n,i,o)}fuse(n,i,o){return I$(this.store,n,i,o)}deallocate(n){Rc(this.store,n)}claim(n,i,o){return ec(this.store,n,i,o)}}class Ma{store;realm;constructor(n=d.STORE){this.store=n,this.realm=new J1(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 Xm(n){return z$(d.STORE,n)}function Gc(n){return Ra(d.STORE,n)}class A1 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{key;type="continuity";globals=[];actions=[];perspectives=[];constructor(n){this.key=n}static existing=new A1;static create(n,i){let o=new Wm(n),{type:c,globals:p,actions:x,perspectives:m}=i(o),f={type:c,key:n,globals:p,actions:x,perspectives:m};return Wm.existing.set(n,f),f}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":{let[o,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:o,viewAtoms:c})}break}return this}}function T1(n){let{key:i,config:o}=n,c=Wm.create(i,o),{actions:p}=c;for(let x of p)t$(d.STORE,i,x.key);return P$(d.STORE,i,-1),c}var aV=Zo({key:"usersInRoomIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),la=Zo({key:"roomIndex",default:()=>new ci,mutable:!0,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),c7={enteredAtEpoch:0},wx=Rm({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:(n)=>typeof n==="string",isBType:(n)=>typeof n==="string"},c7),vV=Xm({key:"usersInMyRoomView",get:(n)=>({find:i})=>{let o=w1(wx);return[i(o,n)]}});import{spawn as p7}from"child_process";class op{emit;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";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}}}constructor(n,i,o){super((c,...p)=>{let x=JSON.stringify([c,...p])+"\x03",m=(f)=>{if(f.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=mi(this.incompleteData);this.handleEvent(...m);while(this.unprocessedEvents.length>0){let f=this.unprocessedEvents.shift();if(f){if(this.unprocessedEvents.length===0)this.incompleteData=f;m=mi(f),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=mi(this.incompleteLog);this.handleLog(m);while(this.unprocessedLogs.length>0)if(this.incompleteLog=this.unprocessedLogs.shift()??"",this.incompleteLog)m=mi(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 F1 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 Qa extends op{incompleteData="";unprocessedEvents=[];relays;relayServices;process;id="#####";log(...n){this.process.stderr.write(wn(n.map((i)=>i instanceof ci?`{ ${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=mi(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=mi(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 F1(`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 Ea=Sc({key:"roomArguments",default:["echo",["Hello World!"]]}),R1=Xm({key:"room",get:(n)=>async({get:i,find:o})=>{let c=o(Ea,n),p=i(c),[x,m]=p,f=await new Promise((a)=>{let v=p7(x,m,{env:process.env}),$=(w)=>{if(w.toString()==="ALIVE")v.stdout.off("data",$),a(v)};v.stdout.on("data",$)});return new Jx(f,n)}});var LV=Gc({key:"createRoom",do:({get:n,set:i,find:o},c,p,x)=>{let m=x?[p,x]:[p],f=o(Ea,c);i(f,m),i(la,($)=>$.add(c));let a=o(R1,c);return n(a)}}),DV=Gc({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=Gc({key:"leaveRoom",do:(n,i,o)=>{ko(wx,(c)=>{c.delete({room:i,user:o})},n.env().store)}}),CV=Gc({key:"destroyRoom",do:(n,i)=>{ko(wx,(o)=>{o.delete({room:i})},n.env().store),n.set(la,(o)=>(o.delete(i),o))}});function Oa(n,i){return i.map((o)=>{switch(o.type){case"transaction_update":{let c=Oa(n,o.updates);return{...o,updates:c}}default:return o}}).filter((o)=>{switch(o.type){case"atom_update":case"selector_update":return n.includes(o.key);case"state_creation":return n.includes(o.token.key);case"molecule_creation":return!0;case"transaction_update":return!0}})}var IV=Sc({key:"redactor",default:{occlude:(n)=>n}}),cp=Sc({key:"unacknowledgedUpdates",default:()=>[]});var Km=Sc({key:"sockets",default:null}),Ua=Zo({key:"socketsIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),Va=Zo({key:"usersIndex",mutable:!0,default:()=>new ci,toJson:(n)=>n.toJSON(),fromJson:(n)=>ci.fromJSON(n)}),Yc=Rm({key:"usersOfSockets",between:["user","socket"],cardinality:"1:1",isAType:(n)=>n.startsWith("user::"),isBType:(n)=>n.startsWith("socket::")});function X1(n,i,o,c){let p=i.key;return function x(){let m=[];for(let a of i.globals){let v=a.type==="mutable_atom"?ni(n,a):a,$=Hn(n,v);m.push(v,$)}for(let a of i.perspectives){let{viewAtoms:v,resourceAtoms:$}=a,w=r(n,v,o),J=Hn(n,w);n.logger.info("\uD83D\uDC41","atom",$.key,`${o} can see`,{viewAtoms:v,resourceAtoms:$,userView:J});for(let X of J){let W=X.type==="mutable_atom"?ni(n,X):X,R=Hn(n,W);m.push(W,R)}}let f=oi(n)?n.transactionMeta.epoch.get(p)??null:null;c?.emit(`continuity-init:${p}`,f,m)}}function W1(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:f}=x,a=`tx-run:${m}:${f}`,v=`${a}:start`,$=`${a}:end`;performance.mark(v);try{gc(n,{type:"transaction",key:m},f)(...x.params)}catch(J){if(J instanceof Error)n.logger.error("\u274C","continuity",c,`failed to run transaction ${m} from ${o} with update ${f}`,J.message)}performance.mark($);let w=performance.measure(a,v,$);n?.logger.info("\uD83D\uDE80","transaction",m,f,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,(a)=>{return a.shift(),n.logger.info("\uD83D\uDC4D","continuity",p,`${o} unacknowledged update queue now has`,a.length,"items"),a})}}function S1(n,i,o,c){let p=i.key,x=[];for(let m of i.actions){let f=Sa(n,m,`sync-continuity:${p}:${o}`,(a)=>{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:X}=J,W=r(n,X,o);return Hn(n,W).map((S)=>{return S.type==="mutable_atom"?"*"+S.key:S.key})})),$=Oa(v,a.updates),w={...a,updates:$};On(n,cp,o,(J)=>{if(w)J.push(w),J.sort((X,W)=>X.epoch-W.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(f)}return x}function G1(n,i,o,c){let p=i.key,x=[];for(let m of i.perspectives){let{viewAtoms:f}=m,a=r(n,f,o),v=Wi(n,a,`sync-continuity:${p}:${o}:perspective:${m.resourceAtoms.key}`,({oldValue:$,newValue:w})=>{let J=$.map((S)=>S.key),X=w.map((S)=>S.key),W=$.filter((S)=>!X.includes(S.key)),R=w.filter((S)=>!J.includes(S.key)).flatMap((S)=>{let H=S.type==="mutable_atom"?ni(n,S):S,M=Hn(n,H);return[H,M]});if(n.logger.info("\uD83D\uDC41","atom",m.resourceAtoms.key,`${o} has a new perspective`,{oldKeys:J,newKeys:X,revealed:R,concealed:W}),R.length>0)c?.emit(`reveal:${p}`,R);if(W.length>0)c?.emit(`conceal:${p}`,W)});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(Yc,`socket::${p.id}`,i).userKeyOfSocket,f=Hn(i,m);if(!f)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 a=ip(Yc,f,i).socketKeyOfUser,v=Wi(i,a,`sync-continuity:${x}:${f}`,({newValue:H})=>{if(i.logger.info("\uD83D\uDC4B","continuity",x,`seeing ${f} on new socket ${H}`),H===null){i.logger.warn("\u274C","continuity",x,`User (${f}) is not connected to a socket, waiting for them to reappear.`);return}let M=r(i,Km,H);p=Hn(i,M);for(let Y of $)p?.emit(`tx-new:${x}`,Y)}),$=Hn(i,cp,f),w=[],J=G1(i,c,f,p),X=S1(i,c,f,p);w.push(...J,...X);let W=X1(i,c,f,n);p.off(`get:${x}`,W),p.on(`get:${x}`,W);let R=W1(i,c,f);p.off(`tx-run:${x}`,R),p.on(`tx-run:${x}`,R);let S=K1(i,c,f,$);return p?.on(`ack:${x}`,S),()=>{for(let H of w)H();p?.off(`ack:${x}`,S),p?.off(`get:${x}`,W),p?.off(`tx-run:${x}`,R)}}}var eR=$a(av(),1);var T=Symbol.for("drizzle:entityKind"),e_=Symbol.for("drizzle:hasOwnEntityKind");function G(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 vv{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 fo=Symbol.for("drizzle:Name");class $v{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 WJ(n,this)}}class WJ{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[fo],...c,o[0].table[fo],...p];return n??`${x.join("_")}_fk`}}function um(n,...i){return n(...i)}function KJ(n,i){return`${n[fo]}_${i.join("_")}_unique`}function SJ(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[a,v]=SJ(n,c+1,!0);o.push(a),c=v;continue}if(x==="}")return[o,c+1];if(x==="{"){let[a,v]=GJ(n,c+1);o.push(a),c=v;continue}let[m,f]=SJ(n,c,!1);o.push(m),c=f}return[o,c]}function YJ(n){let[i]=GJ(n,1);return i}function wv(n){return`{${n.map((i)=>{if(Array.isArray(i))return wv(i);if(typeof i==="string")return`"${i.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${i}`}).join(",")}}`}class u extends vv{foreignKeyConfigs=[];static[T]="PgColumnBuilder";array(n){return new MJ(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 um((p,x)=>{let m=new $v(()=>{let f=p();return{columns:[n],foreignColumns:[f]}});if(x.onUpdate)m.onUpdate(x.onUpdate);if(x.onDelete)m.onDelete(x.onDelete);return m.build(i)},o,c)})}buildExtraConfigColumn(n){return new HJ(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 HJ 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 Hx{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 MJ extends u{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 Jv(n,this.config,i)}}class Jv 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:G(this.baseColumn,Jv)?this.baseColumn.mapToDriverValue(c,!0):this.baseColumn.mapToDriverValue(c));if(i)return o;return wv(o)}}var Av=Symbol.for("drizzle:isPgEnum");function zJ(n){return!!n&&typeof n==="function"&&Av in n&&n[Av]===!0}class lJ extends u{static[T]="PgEnumColumnBuilder";constructor(n,i){super(n,"string","PgEnumColumn");this.config.enum=i}build(n){return new QJ(n,this.config)}}class QJ 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 MW(n,i,void 0)}function MW(n,i,o){let c=Object.assign((p)=>new lJ(p??"",c),{enumName:n,enumValues:i,schema:o,[Av]:!0});return c}class pi{static[T]="Subquery";constructor(n,i,o,c=!1){this._={brand:"Subquery",sql:n,selectedFields:i,alias:o,isWith:c}}}class Mx extends pi{static[T]="WithSubquery"}var EJ="0.39.3";var Tv,Fv,Vn={startActiveSpan(n,i){if(!Tv)return i();if(!Fv)Fv=Tv.trace.getTracer("drizzle-orm",EJ);return um((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()}}),Tv,Fv)}};var jn=Symbol.for("drizzle:ViewBaseConfig");var ym=Symbol.for("drizzle:Schema"),km=Symbol.for("drizzle:Columns"),OJ=Symbol.for("drizzle:ExtraConfigColumns"),Rv=Symbol.for("drizzle:OriginalName"),Xv=Symbol.for("drizzle:BaseName"),zx=Symbol.for("drizzle:IsAlias"),UJ=Symbol.for("drizzle:ExtraConfigBuilder"),zW=Symbol.for("drizzle:IsDrizzleTable");class D{static[T]="Table";static Symbol={Name:fo,Schema:ym,OriginalName:Rv,Columns:km,ExtraConfigColumns:OJ,BaseName:Xv,IsAlias:zx,ExtraConfigBuilder:UJ};[fo];[Rv];[ym];[km];[OJ];[Xv];[zx]=!1;[zW]=!0;[UJ]=void 0;constructor(n,i,o){this[fo]=this[Rv]=n,this[ym]=i,this[Xv]=o}}function fi(n){return n[fo]}function Ec(n){return`${n[ym]??"public"}.${n[fo]}`}function Wv(n){return n!==null&&n!==void 0&&typeof n.getSQL==="function"}function lW(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 xi{static[T]="StringChunk";value;constructor(n){this.value=Array.isArray(n)?n:[n]}getSQL(){return new N([this])}}class N{constructor(n){this.queryChunks=n}static[T]="SQL";decoder=_J;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:f,paramStartIndex:a}=o;return lW(n.map((v)=>{if(G(v,xi))return{sql:v.value.join(""),params:[]};if(G(v,Zm))return{sql:p(v.value),params:[]};if(v===void 0)return{sql:"",params:[]};if(Array.isArray(v)){let $=[new xi("(")];for(let[w,J]of v.entries())if($.push(J),w<v.length-1)$.push(new xi(", "));return $.push(new xi(")")),this.buildQueryFromSourceParams($,o)}if(G(v,N))return this.buildQueryFromSourceParams(v.queryChunks,{...o,inlineParams:f||v.shouldInlineParams});if(G(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(G(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(G(v,Bi)){let $=v[jn].schema,w=v[jn].name;return{sql:$===void 0||v[jn].isAlias?p(w):p($)+"."+p(w),params:[]}}if(G(v,Di)){if(G(v.value,go))return{sql:x(a.value++,v),params:[v],typings:["none"]};let $=v.value===null?null:v.encoder.mapToDriverValue(v.value);if(G($,N))return this.buildQueryFromSourceParams([$],o);if(f)return{sql:this.mapInlineParam($,o),params:[]};let w=["none"];if(m)w=[m(v.encoder)];return{sql:x(a.value++,$),params:[$],typings:w}}if(G(v,go))return{sql:x(a.value++,v),params:[v],typings:["none"]};if(G(v,N.Aliased)&&v.fieldAlias!==void 0)return{sql:p(v.fieldAlias),params:[]};if(G(v,pi)){if(v._.isWith)return{sql:p(v._.alias),params:[]};return this.buildQueryFromSourceParams([new xi("("),v._.sql,new xi(") "),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(Wv(v)){if(v.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([v.getSQL()],o);return this.buildQueryFromSourceParams([new xi("("),v.getSQL(),new xi(")")],o)}if(f)return{sql:this.mapInlineParam(v,o),params:[]};return{sql:x(a.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 N.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 N([this])}}function VJ(n){return typeof n==="object"&&n!==null&&"mapToDriverValue"in n&&typeof n.mapToDriverValue==="function"}var _J={mapFromDriverValue:(n)=>n},BJ={mapToDriverValue:(n)=>n},uB={..._J,...BJ};class Di{constructor(n,i=BJ){this.value=n,this.encoder=i}static[T]="Param";brand;getSQL(){return new N([this])}}function F(n,...i){let o=[];if(i.length>0||n.length>0&&n[0]!=="")o.push(new xi(n[0]));for(let[c,p]of i.entries())o.push(p,new xi(n[c+1]));return new N(o)}((n)=>{function i(){return new N([])}n.empty=i;function o(a){return new N(a)}n.fromList=o;function c(a){return new N([new xi(a)])}n.raw=c;function p(a,v){let $=[];for(let[w,J]of a.entries()){if(w>0&&v!==void 0)$.push(v);$.push(J)}return new N($)}n.join=p;function x(a){return new Zm(a)}n.identifier=x;function m(a){return new go(a)}n.placeholder=m;function f(a,v){return new Di(a,v)}n.param=f})(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})(N||(N={}));class go{constructor(n){this.name=n}static[T]="Placeholder";getSQL(){return new N([this])}}function Kv(n,i){return n.map((o)=>{if(G(o,go)){if(!(o.name in i))throw new Error(`No value for placeholder "${o.name}" was provided`);return i[o.name]}if(G(o,Di)&&G(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 QW=Symbol.for("drizzle:IsDrizzleView");class Bi{static[T]="View";[jn];[QW]=!0;constructor({name:n,schema:i,selectedFields:o,query:c}){this[jn]={name:n,originalName:n,schema:i,selectedFields:o,query:c,isExisting:!c,isAlias:!1}}getSQL(){return new N([this])}}Un.prototype.getSQL=function(){return new N([this])};D.prototype.getSQL=function(){return new N([this])};pi.prototype.getSQL=function(){return new N([this])};class Xp{constructor(n){this.table=n}static[T]="ColumnAliasProxyHandler";get(n,i){if(i==="table")return this.table;return n[i]}}class lx{constructor(n,i){this.alias=n,this.replaceOriginalName=i}static[T]="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===jn)return{...n[jn],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 Xp(new Proxy(n,this)))}),p}let o=n[i];if(G(o,Un))return new Proxy(o,new Xp(new Proxy(n,this)));return o}}function qm(n,i){return new Proxy(n,new lx(i,!1))}function Ho(n,i){return new Proxy(n,new Xp(new Proxy(n.table,new lx(i,!1))))}function Sv(n,i){return new N.Aliased(Qx(n.sql,i),n.fieldAlias)}function Qx(n,i){return F.join(n.queryChunks.map((o)=>{if(G(o,Un))return Ho(o,i);if(G(o,N))return Qx(o,i);if(G(o,N.Aliased))return Sv(o,i);return o}))}class Pm extends Error{static[T]="DrizzleError";constructor({message:n,cause:i}){super(n);this.name="DrizzleError",this.cause=i}}class Gv extends Pm{static[T]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}function ji(n,i){if(VJ(i)&&!Wv(n)&&!G(n,Di)&&!G(n,go)&&!G(n,Un)&&!G(n,D)&&!G(n,Bi))return new Di(n,i);return n}var Mo=(n,i)=>{return F`${n} = ${ji(i,n)}`},jJ=(n,i)=>{return F`${n} <> ${ji(i,n)}`};function Oc(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new N(i);return new N([new xi("("),F.join(i,new xi(" and ")),new xi(")")])}function bJ(...n){let i=n.filter((o)=>o!==void 0);if(i.length===0)return;if(i.length===1)return new N(i);return new N([new xi("("),F.join(i,new xi(" or ")),new xi(")")])}function LJ(n){return F`not ${n}`}var sm=(n,i)=>{return F`${n} > ${ji(i,n)}`},DJ=(n,i)=>{return F`${n} >= ${ji(i,n)}`},NJ=(n,i)=>{return F`${n} < ${ji(i,n)}`},CJ=(n,i)=>{return F`${n} <= ${ji(i,n)}`};function hJ(n,i){if(Array.isArray(i)){if(i.length===0)return F`false`;return F`${n} in ${i.map((o)=>ji(o,n))}`}return F`${n} in ${ji(i,n)}`}function uJ(n,i){if(Array.isArray(i)){if(i.length===0)return F`true`;return F`${n} not in ${i.map((o)=>ji(o,n))}`}return F`${n} not in ${ji(i,n)}`}function IJ(n){return F`${n} is null`}function yJ(n){return F`${n} is not null`}function kJ(n){return F`exists ${n}`}function ZJ(n){return F`not exists ${n}`}function qJ(n,i,o){return F`${n} between ${ji(i,n)} and ${ji(o,n)}`}function PJ(n,i,o){return F`${n} not between ${ji(i,n)} and ${ji(o,n)}`}function sJ(n,i){return F`${n} like ${i}`}function rJ(n,i){return F`${n} not like ${i}`}function tJ(n,i){return F`${n} ilike ${i}`}function gJ(n,i){return F`${n} not ilike ${i}`}function dJ(n){return F`${n} asc`}function eJ(n){return F`${n} desc`}class nA{static[T]="ConsoleLogWriter";write(n){console.log(n)}}class Yv{static[T]="DefaultLogger";writer;constructor(n){this.writer=n?.writer??new nA}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[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 iA(n,i,o){let c={},p=n.reduce((x,{path:m,field:f},a)=>{let v;if(G(f,Un))v=f;else if(G(f,N))v=f.decoder;else v=f.sql.decoder;let $=x;for(let[w,J]of m.entries())if(w<m.length-1){if(!(J in $))$[J]={};$=$[J]}else{let X=i[a],W=$[J]=X===null?null:v.mapFromDriverValue(X);if(o&&G(f,Un)&&m.length===2){let R=m[0];if(!(R in c))c[R]=W===null?fi(f.table):!1;else if(typeof c[R]==="string"&&c[R]!==fi(f.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 ti(n,i){return Object.entries(n).reduce((o,[c,p])=>{if(typeof c!=="string")return o;let x=i?[...i,c]:[c];if(G(p,Un)||G(p,N)||G(p,N.Aliased))o.push({path:x,field:p});else if(G(p,D))o.push(...ti(p[D.Symbol.Columns],x));else o.push(...ti(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 rm(n,i){let o=Object.entries(i).filter(([,c])=>c!==void 0).map(([c,p])=>{if(G(p,N)||G(p,Un))return[c,p];else return[c,new Di(p,n[D.Symbol.Columns][c])]});if(o.length===0)throw new Error("No values to set");return Object.fromEntries(o)}function oA(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 cA(n){return n[D.Symbol.Columns]}function _o(n){return G(n,pi)?n._.alias:G(n,Bi)?n[jn].name:G(n,N)?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 pA(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 u{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 xA extends eo{static[T]="PgBigInt53Builder";constructor(n){super(n,"number","PgBigInt53")}build(n){return new mA(n,this.config)}}class mA 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 aA(n,this.config)}}class aA extends V{static[T]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(n){return BigInt(n)}}function vA(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new xA(o);return new fA(o)}class $A extends u{static[T]="PgBigSerial53Builder";constructor(n){super(n,"number","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new wA(n,this.config)}}class wA extends V{static[T]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(n){if(typeof n==="number")return n;return Number(n)}}class JA extends u{static[T]="PgBigSerial64Builder";constructor(n){super(n,"bigint","PgBigSerial64");this.config.hasDefault=!0}build(n){return new AA(n,this.config)}}class AA extends V{static[T]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(n){return BigInt(n)}}function TA(n,i){let{name:o,config:c}=Jn(n,i);if(c.mode==="number")return new $A(o);return new JA(o)}class FA extends u{static[T]="PgBooleanBuilder";constructor(n){super(n,"boolean","PgBoolean")}build(n){return new RA(n,this.config)}}class RA extends V{static[T]="PgBoolean";getSQLType(){return"boolean"}}function Ox(n){return new FA(n??"")}class XA extends u{static[T]="PgCharBuilder";constructor(n,i){super(n,"string","PgChar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new WA(n,this.config)}}class WA 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 XA(o,c)}class SA extends u{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 SA(n??"")}class HA extends u{static[T]="PgCustomColumnBuilder";constructor(n,i,o){super(n,"custom","PgCustomColumn");this.config.fieldConfig=i,this.config.customTypeParams=o}build(n){return new MA(n,this.config)}}class MA 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 HA(c,p,n)}}class Bo extends u{static[T]="PgDateColumnBaseBuilder";defaultNow(){return this.default(F`now()`)}}class lA extends Bo{static[T]="PgDateBuilder";constructor(n){super(n,"date","PgDate")}build(n){return new tm(n,this.config)}}class tm extends V{static[T]="PgDate";getSQLType(){return"date"}mapFromDriverValue(n){return new Date(n)}mapToDriverValue(n){return n.toISOString()}}class QA 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 EA(n,i){let{name:o,config:c}=Jn(n,i);if(c?.mode==="date")return new lA(o);return new QA(o)}class OA extends u{static[T]="PgDoublePrecisionBuilder";constructor(n){super(n,"number","PgDoublePrecision")}build(n){return new UA(n,this.config)}}class UA extends V{static[T]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(n){if(typeof n==="string")return Number.parseFloat(n);return n}}function VA(n){return new OA(n??"")}class _A extends u{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 _A(n??"")}class bA 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 bA(n??"")}class DA extends u{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 CA(n,i={}){let{name:o,config:c}=Jn(n,i);return new DA(o,c)}class hA extends u{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 uA(n){return new hA(n??"")}class IA extends u{static[T]="PgJsonbBuilder";constructor(n){super(n,"json","PgJsonb")}build(n){return new nf(n,this.config)}}class nf 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 yA(n){return new IA(n??"")}class kA extends u{static[T]="PgLineBuilder";constructor(n){super(n,"array","PgLine")}build(n){return new ZA(n,this.config)}}class ZA 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 u{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 sA(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new kA(o);return new qA(o)}class rA extends u{static[T]="PgMacaddrBuilder";constructor(n){super(n,"string","PgMacaddr")}build(n){return new tA(n,this.config)}}class tA extends V{static[T]="PgMacaddr";getSQLType(){return"macaddr"}}function gA(n){return new rA(n??"")}class dA extends u{static[T]="PgMacaddr8Builder";constructor(n){super(n,"string","PgMacaddr8")}build(n){return new eA(n,this.config)}}class eA extends V{static[T]="PgMacaddr8";getSQLType(){return"macaddr8"}}function nT(n){return new dA(n??"")}class iT extends u{static[T]="PgNumericBuilder";constructor(n,i,o){super(n,"string","PgNumeric");this.config.precision=i,this.config.scale=o}build(n){return new of(n,this.config)}}class of 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 oT(n,i){let{name:o,config:c}=Jn(n,i);return new iT(o,c?.precision,c?.scale)}class cT extends u{static[T]="PgPointTupleBuilder";constructor(n){super(n,"array","PgPointTuple")}build(n){return new pT(n,this.config)}}class pT 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 xT extends u{static[T]="PgPointObjectBuilder";constructor(n){super(n,"json","PgPointObject")}build(n){return new mT(n,this.config)}}class mT 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 cT(o);return new xT(o)}function EW(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 aT(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 Mv(n){let i=EW(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 f=aT(i,o);o+=8;let a=aT(i,o);return o+=8,[f,a]}throw new Error("Unsupported geometry type")}class vT extends u{static[T]="PgGeometryBuilder";constructor(n){super(n,"array","PgGeometry")}build(n){return new $T(n,this.config)}}class $T extends V{static[T]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){return Mv(n)}mapToDriverValue(n){return`point(${n[0]} ${n[1]})`}}class wT extends u{static[T]="PgGeometryObjectBuilder";constructor(n){super(n,"json","PgGeometryObject")}build(n){return new JT(n,this.config)}}class JT extends V{static[T]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(n){let i=Mv(n);return{x:i[0],y:i[1]}}mapToDriverValue(n){return`point(${n.x} ${n.y})`}}function AT(n,i){let{name:o,config:c}=Jn(n,i);if(!c?.mode||c.mode==="tuple")return new vT(o);return new wT(o)}class TT extends u{static[T]="PgRealBuilder";constructor(n,i){super(n,"number","PgReal");this.config.length=i}build(n){return new FT(n,this.config)}}class FT 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 RT(n){return new TT(n??"")}class XT extends u{static[T]="PgSerialBuilder";constructor(n){super(n,"number","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new WT(n,this.config)}}class WT extends V{static[T]="PgSerial";getSQLType(){return"serial"}}function KT(n){return new XT(n??"")}class ST 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 ST(n??"")}class HT extends u{static[T]="PgSmallSerialBuilder";constructor(n){super(n,"number","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(n){return new MT(n,this.config)}}class MT extends V{static[T]="PgSmallSerial";getSQLType(){return"smallserial"}}function zT(n){return new HT(n??"")}class lT extends u{static[T]="PgTextBuilder";constructor(n,i){super(n,"string","PgText");this.config.enumValues=i.enum}build(n){return new QT(n,this.config)}}class QT extends V{static[T]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function ET(n,i={}){let{name:o,config:c}=Jn(n,i);return new lT(o,c)}class OT 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 cf(n,this.config)}}class cf 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 UT(n,i={}){let{name:o,config:c}=Jn(n,i);return new OT(o,c.withTimezone??!1,c.precision)}class VT 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 pf(n,this.config)}}class pf 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 _T 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 xf(n,this.config)}}class xf 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 ao(n,i={}){let{name:o,config:c}=Jn(n,i);if(c?.mode==="string")return new _T(o,c.withTimezone??!1,c.precision);return new VT(o,c?.withTimezone??!1,c?.precision)}class BT extends u{static[T]="PgUUIDBuilder";constructor(n){super(n,"string","PgUUID")}defaultRandom(){return this.default(F`gen_random_uuid()`)}build(n){return new mf(n,this.config)}}class mf extends V{static[T]="PgUUID";getSQLType(){return"uuid"}}function Ni(n){return new BT(n??"")}class jT extends u{static[T]="PgVarcharBuilder";constructor(n,i){super(n,"string","PgVarchar");this.config.length=i.length,this.config.enumValues=i.enum}build(n){return new bT(n,this.config)}}class bT 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 u{static[T]="PgBinaryVectorBuilder";constructor(n,i){super(n,"string","PgBinaryVector");this.config.dimensions=i.dimensions}build(n){return new DT(n,this.config)}}class DT 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 CT extends u{static[T]="PgHalfVectorBuilder";constructor(n,i){super(n,"array","PgHalfVector");this.config.dimensions=i.dimensions}build(n){return new hT(n,this.config)}}class hT 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 uT(n,i){let{name:o,config:c}=Jn(n,i);return new CT(o,c)}class IT extends u{static[T]="PgSparseVectorBuilder";constructor(n,i){super(n,"string","PgSparseVector");this.config.dimensions=i.dimensions}build(n){return new yT(n,this.config)}}class yT extends V{static[T]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function kT(n,i){let{name:o,config:c}=Jn(n,i);return new IT(o,c)}class ZT extends u{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 ZT(o,c)}function sT(){return{bigint:vA,bigserial:TA,boolean:Ox,char:KA,cidr:YA,customType:zA,date:EA,doublePrecision:VA,inet:jA,integer:dm,interval:CA,json:uA,jsonb:yA,line:sA,macaddr:gA,macaddr8:nT,numeric:oT,point:fT,geometry:AT,real:RT,serial:KT,smallint:YT,smallserial:zT,text:ET,time:UT,timestamp:ao,uuid:Ni,varchar:Ji,bit:NT,halfvec:uT,sparsevec:kT,vector:PT}}var zv=Symbol.for("drizzle:PgInlineForeignKeys"),rT=Symbol.for("drizzle:EnableRLS");class Ai extends D{static[T]="PgTable";static Symbol=Object.assign({},D.Symbol,{InlineForeignKeys:zv,EnableRLS:rT});[zv]=[];[rT]=!1;[D.Symbol.ExtraConfigBuilder]=void 0}function OW(n,i,o,c,p=n){let x=new Ai(n,c,p),m=typeof i==="function"?i(sT()):i,f=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let X=J.build(x);return x[zv].push(...J.buildForeignKeys(X,x)),[$,X]})),a=Object.fromEntries(Object.entries(m).map(([$,w])=>{let J=w;J.setName($);let X=J.buildExtraConfigColumn(x);return[$,X]})),v=Object.assign(x,f);if(v[D.Symbol.Columns]=f,v[D.Symbol.ExtraConfigColumns]=a,o)v[Ai.Symbol.ExtraConfigBuilder]=o;return Object.assign(v,{enableRLS:()=>{return v[Ai.Symbol.EnableRLS]=!0,v}})}var nc=(n,i,o)=>{return OW(n,i,o,void 0)};function tT(...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 gT(n,this.columns,this.name)}}class gT{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 lv{constructor(n,i,o){this.sourceTable=n,this.referencedTable=i,this.relationName=o,this.referencedTableName=i[D.Symbol.Name]}static[T]="Relation";referencedTableName;fieldName}class dT{constructor(n,i){this.table=n,this.config=i}static[T]="Relations"}class ic extends lv{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 lv{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 eT(){return{and:Oc,between:qJ,eq:Mo,exists:kJ,gt:sm,gte:DJ,ilike:tJ,inArray:hJ,isNull:IJ,isNotNull:yJ,like:sJ,lt:NJ,lte:CJ,ne:jJ,not:LJ,notBetween:PJ,notExists:ZJ,notLike:rJ,notIlike:gJ,notInArray:uJ,or:bJ,sql:F}}function nF(){return{sql:F,asc:dJ,desc:eJ}}function iF(n,i){if(Object.keys(n).length===1&&"default"in n&&!G(n.default,D))n=n.default;let o={},c={},p={};for(let[x,m]of Object.entries(n))if(G(m,D)){let f=Ec(m),a=c[f];o[f]=x,p[x]={tsName:x,dbName:m[D.Symbol.Name],schema:m[D.Symbol.Schema],columns:m[D.Symbol.Columns],relations:a?.relations??{},primaryKey:a?.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(G($,Ux))p[x].primaryKey.push(...$.columns)}}else if(G(m,dT)){let f=Ec(m.table),a=o[f],v=m.config(i(m.table)),$;for(let[w,J]of Object.entries(v))if(a){let X=p[a];if(X.relations[w]=J,$)X.primaryKey.push(...$)}else{if(!(f in c))c[f]={relations:{},primaryKey:$};c[f].relations[w]=J}}return{tables:p,tableNamesMap:o}}function UW(n){return function i(o,c){return new ic(n,o,c,c?.fields.reduce((p,x)=>p&&x.notNull,!0)??!1)}}function VW(n){return function i(o,c){return new Vx(n,o,c)}}function oF(n,i,o){if(G(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 f=[];for(let a of Object.values(p.relations))if(o.relationName&&o!==a&&a.relationName===o.relationName||!o.relationName&&a.referencedTable===o.sourceTable)f.push(a);if(f.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(f[0]&&G(f[0],ic)&&f[0].config)return{fields:f[0].config.references,references:f[0].config.fields};throw new Error(`There is not enough information to infer relation "${m}.${o.fieldName}"`)}function cF(n){return{one:UW(n),many:VW(n)}}function ff(n,i,o,c,p=(x)=>x){let x={};for(let[m,f]of c.entries())if(f.isJson){let a=i.relations[f.tsKey],v=o[m],$=typeof v==="string"?JSON.parse(v):v;x[f.tsKey]=G(a,ic)?$&&ff(n,n[f.relationTableTsKey],$,f.selection,p):$.map((w)=>ff(n,n[f.relationTableTsKey],w,f.selection,p))}else{let a=p(o[m]),v=f.field,$;if(G(v,Un))$=v;else if(G(v,N))$=v.decoder;else $=v.sql.decoder;x[f.tsKey]=a===null?null:$.mapFromDriverValue(a)}return x}var Z6=$a(k6(),1),{Server:q6,Namespace:IN,Socket:yN}=Z6.default;import{readFileSync as fR}from"fs";import{resolve as l0}from"path";function QG(n,i){let o={},c=[];for(let p in n){let x=n[p],m=i[p],f=x["~standard"].validate(m);if(f instanceof Promise)throw new Error(`Validation must be synchronous, but ${p} returned a Promise.`);if(f.issues){c.push(...f.issues.map((a)=>({...a,path:[p,...a.path??[]]})));continue}o[p]=f.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:{},f=n.isServer??(typeof window==="undefined"||("Deno"in window)),a=f?{...x,...m,...p}:{...p,...m},v=QG(a,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)},X=(M)=>{return f||!J(M)},W=(M)=>{return M==="__esModule"||M==="$$typeof"},R=(n.extends??[]).reduce((M,I)=>{return Object.assign(M,I)},{}),S=Object.assign(v.value,R);return new Proxy(S,{get(M,I){if(typeof I!=="string")return;if(W(I))return;if(!X(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((f)=>typeof p[p[f]]!=="number"),m={};for(let f of x)m[f]=p[f];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 Y0;(function(n){n.mergeShapes=(i,o)=>{return{...i,...o}}})(Y0||(Y0={}));var C=Tn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),No=(n)=>{switch(typeof n){case"undefined":return C.undefined;case"string":return C.string;case"number":return isNaN(n)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":if(Array.isArray(n))return C.array;if(n===null)return C.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return C.promise;if(typeof Map!=="undefined"&&n instanceof Map)return C.map;if(typeof Set!=="undefined"&&n instanceof Set)return C.set;if(typeof Date!=="undefined"&&n instanceof Date)return C.date;return C.object;default:return C.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"]),EG=(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,f=0;while(f<x.path.length){let a=x.path[f];if(f!==x.path.length-1)m[a]=m[a]||{_errors:[]};else m[a]=m[a]||{_errors:[]},m[a]._errors.push(i(x));m=m[a],f++}}};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 bp=(n,i)=>{let o;switch(n.code){case U.invalid_type:if(n.received===C.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}},g6=bp;function OG(n){g6=n}function jf(){return g6}var bf=(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 f="",a=c.filter((v)=>!!v).slice().reverse();for(let v of a)f=v(m,{data:i,defaultError:f}).message;return{...p,path:x,message:f}},UG=[];function L(n,i){let o=jf(),c=bf({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 zi{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 zi.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}),H0=(n)=>n.status==="aborted",M0=(n)=>n.status==="dirty",Nc=(n)=>n.status==="valid",ux=(n)=>typeof Promise!=="undefined"&&n instanceof Promise;function Lf(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 d6(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 Cx,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 s6=(n,i)=>{if(Nc(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,f)=>{var a,v;let{message:$}=n;if(m.code==="invalid_enum_value")return{message:$!==null&&$!==void 0?$:f.defaultError};if(typeof f.data==="undefined")return{message:(a=$!==null&&$!==void 0?$:c)!==null&&a!==void 0?a:f.defaultError};if(m.code!=="invalid_type")return{message:f.defaultError};return{message:(v=$!==null&&$!==void 0?$:o)!==null&&v!==void 0?v:f.defaultError}},description:p}}class pn{get description(){return this._def.description}_getType(n){return No(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:No(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new zi,ctx:{common:n.parent.common,data:n.data,parsedType:No(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let i=this._parse(n);if(ux(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:No(n)},p=this._parseSync({data:n,path:c.path,parent:c});return s6(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:No(n)};if(!this["~standard"].async)try{let p=this._parseSync({data:n,path:[],parent:c});return Nc(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)=>Nc(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:No(n)},c=this._parse({data:n,path:o.path,parent:o}),p=await(ux(c)?c:Promise.resolve(c));return s6(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((f)=>{if(!f)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:t.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 Co.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ao.create(this)}promise(){return Ic.create(this,this._def)}or(n){return Cp.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:t.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:t.ZodDefault})}brand(){return new Nf({typeName:t.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:t.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 VG=/^c[^\s-]{8,}$/i,_G=/^[0-9a-z]+$/,BG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jG=/^[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,bG=/^[a-z0-9_-]{21}$/i,LG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DG=/^[-+]?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)?)??$/,NG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,CG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",G0,hG=/^(?:(?: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])$/,uG=/^(?:(?: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])$/,IG=/^(([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]))$/,yG=/^(([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])$/,kG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ZG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,e6="((\\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])))",qG=new RegExp(`^${e6}$`);function nR(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 PG(n){return new RegExp(`^${nR(n)}$`)}function iR(n){let i=`${e6}T${nR(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 sG(n,i){if((i==="v4"||!i)&&hG.test(n))return!0;if((i==="v6"||!i)&&IG.test(n))return!0;return!1}function rG(n,i){if(!LG.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 tG(n,i){if((i==="v4"||!i)&&uG.test(n))return!0;if((i==="v6"||!i)&&yG.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)!==C.string){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_type,expected:C.string,received:p.parsedType}),g}let o=new zi,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),L(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),L(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)L(c,{code:U.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message});else if(m)L(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(!NG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"email",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="emoji"){if(!G0)G0=new RegExp(CG,"u");if(!G0.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"emoji",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="uuid"){if(!jG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"uuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="nanoid"){if(!bG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"nanoid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid"){if(!VG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"cuid",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cuid2"){if(!_G.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"cuid2",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ulid"){if(!BG.test(n.data))c=this._getOrReturnCtx(n,c),L(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),L(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),L(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),L(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),L(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),L(c,{code:U.invalid_string,validation:{endsWith:p.value},message:p.message}),o.dirty()}else if(p.kind==="datetime"){if(!iR(p).test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:"datetime",message:p.message}),o.dirty()}else if(p.kind==="date"){if(!qG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:"date",message:p.message}),o.dirty()}else if(p.kind==="time"){if(!PG(p).test(n.data))c=this._getOrReturnCtx(n,c),L(c,{code:U.invalid_string,validation:"time",message:p.message}),o.dirty()}else if(p.kind==="duration"){if(!DG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"duration",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="ip"){if(!sG(n.data,p.version))c=this._getOrReturnCtx(n,c),L(c,{validation:"ip",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="jwt"){if(!rG(n.data,p.alg))c=this._getOrReturnCtx(n,c),L(c,{validation:"jwt",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="cidr"){if(!tG(n.data,p.version))c=this._getOrReturnCtx(n,c),L(c,{validation:"cidr",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64"){if(!kG.test(n.data))c=this._getOrReturnCtx(n,c),L(c,{validation:"base64",code:U.invalid_string,message:p.message}),o.dirty()}else if(p.kind==="base64url"){if(!ZG.test(n.data))c=this._getOrReturnCtx(n,c),L(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:t.ZodString,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};function gG(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 fc 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)!==C.number){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_type,expected:C.number,received:p.parsedType}),g}let o=void 0,c=new zi;for(let p of this._def.checks)if(p.kind==="int"){if(!Tn.isInteger(n.data))o=this._getOrReturnCtx(n,o),L(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),L(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),L(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(gG(n.data,p.value)!==0)o=this._getOrReturnCtx(n,o),L(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),L(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 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]})}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)}}fc.create=(n)=>{return new fc({checks:[],typeName:t.ZodNumber,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class ac 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)!==C.bigint)return this._getInvalidInput(n);let o=void 0,c=new zi;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),L(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),L(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),L(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 L(i,{code:U.invalid_type,expected:C.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 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]})}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}}ac.create=(n)=>{var i;return new ac({checks:[],typeName:t.ZodBigInt,coerce:(i=n===null||n===void 0?void 0:n.coerce)!==null&&i!==void 0?i:!1,...cn(n)})};class Lp extends pn{_parse(n){if(this._def.coerce)n.data=Boolean(n.data);if(this._getType(n)!==C.boolean){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.boolean,received:o.parsedType}),g}return Ui(n.data)}}Lp.create=(n)=>{return new Lp({typeName:t.ZodBoolean,coerce:(n===null||n===void 0?void 0:n.coerce)||!1,...cn(n)})};class Cc extends pn{_parse(n){if(this._def.coerce)n.data=new Date(n.data);if(this._getType(n)!==C.date){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_type,expected:C.date,received:p.parsedType}),g}if(isNaN(n.data.getTime())){let p=this._getOrReturnCtx(n);return L(p,{code:U.invalid_date}),g}let o=new zi,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),L(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),L(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 Cc({...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}}Cc.create=(n)=>{return new Cc({checks:[],coerce:(n===null||n===void 0?void 0:n.coerce)||!1,typeName:t.ZodDate,...cn(n)})};class Ix extends pn{_parse(n){if(this._getType(n)!==C.symbol){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.symbol,received:o.parsedType}),g}return Ui(n.data)}}Ix.create=(n)=>{return new Ix({typeName:t.ZodSymbol,...cn(n)})};class Dp extends pn{_parse(n){if(this._getType(n)!==C.undefined){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.undefined,received:o.parsedType}),g}return Ui(n.data)}}Dp.create=(n)=>{return new Dp({typeName:t.ZodUndefined,...cn(n)})};class Np extends pn{_parse(n){if(this._getType(n)!==C.null){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.null,received:o.parsedType}),g}return Ui(n.data)}}Np.create=(n)=>{return new Np({typeName:t.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:t.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:t.ZodUnknown,...cn(n)})};class lo extends pn{_parse(n){let i=this._getOrReturnCtx(n);return L(i,{code:U.invalid_type,expected:C.never,received:i.parsedType}),g}}lo.create=(n)=>{return new lo({typeName:t.ZodNever,...cn(n)})};class yx extends pn{_parse(n){if(this._getType(n)!==C.undefined){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.void,received:o.parsedType}),g}return Ui(n.data)}}yx.create=(n)=>{return new yx({typeName:t.ZodVoid,...cn(n)})};class Ao extends pn{_parse(n){let{ctx:i,status:o}=this._processInputParams(n),c=this._def;if(i.parsedType!==C.array)return L(i,{code:U.invalid_type,expected:C.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)L(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)L(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)L(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 zi.mergeArray(o,x)});let p=[...i.data].map((x,m)=>{return c.type._parseSync(new Fo(i,x,i.path,m))});return zi.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:t.ZodArray,...cn(i)})};function _p(n){if(n instanceof un){let i={};for(let o in n.shape){let c=n.shape[o];i[o]=To.create(_p(c))}return new un({...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 Co)return Co.create(_p(n.unwrap()));else if(n instanceof Qo)return Qo.create(n.items.map((i)=>_p(i)));else return n}class un 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)!==C.object){let a=this._getOrReturnCtx(n);return L(a,{code:U.invalid_type,expected:C.object,received:a.parsedType}),g}let{status:o,ctx:c}=this._processInputParams(n),{shape:p,keys:x}=this._getCached(),m=[];if(!(this._def.catchall instanceof lo&&this._def.unknownKeys==="strip")){for(let a in c.data)if(!x.includes(a))m.push(a)}let f=[];for(let a of x){let v=p[a],$=c.data[a];f.push({key:{status:"valid",value:a},value:v._parse(new Fo(c,$,c.path,a)),alwaysSet:a in c.data})}if(this._def.catchall instanceof lo){let a=this._def.unknownKeys;if(a==="passthrough")for(let v of m)f.push({key:{status:"valid",value:v},value:{status:"valid",value:c.data[v]}});else if(a==="strict"){if(m.length>0)L(c,{code:U.unrecognized_keys,keys:m}),o.dirty()}else if(a==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let a=this._def.catchall;for(let v of m){let $=c.data[v];f.push({key:{status:"valid",value:v},value:a._parse(new Fo(c,$,c.path,v)),alwaysSet:v in c.data})}}if(c.common.async)return Promise.resolve().then(async()=>{let a=[];for(let v of f){let $=await v.key,w=await v.value;a.push({key:$,value:w,alwaysSet:v.alwaysSet})}return a}).then((a)=>{return zi.mergeObjectSync(o,a)});else return zi.mergeObjectSync(o,f)}get shape(){return this._def.shape()}strict(n){return k.errToObj,new un({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,o)=>{var c,p,x,m;let f=(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:f};return{message:f}}}:{}})}strip(){return new un({...this._def,unknownKeys:"strip"})}passthrough(){return new un({...this._def,unknownKeys:"passthrough"})}extend(n){return new un({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new un({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:t.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new un({...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 un({...this._def,shape:()=>i})}omit(n){let i={};return Tn.objectKeys(this.shape).forEach((o)=>{if(!n[o])i[o]=this.shape[o]}),new un({...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 un({...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 un({...this._def,shape:()=>i})}keyof(){return oR(Tn.objectKeys(this.shape))}}un.create=(n,i)=>{return new un({shape:()=>n,unknownKeys:"strip",catchall:lo.create(),typeName:t.ZodObject,...cn(i)})};un.strictCreate=(n,i)=>{return new un({shape:()=>n,unknownKeys:"strict",catchall:lo.create(),typeName:t.ZodObject,...cn(i)})};un.lazycreate=(n,i)=>{return new un({shape:n,unknownKeys:"strip",catchall:lo.create(),typeName:t.ZodObject,...cn(i)})};class Cp 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 L(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 f of o){let a={...i,common:{...i.common,issues:[]},parent:null},v=f._parseSync({data:i.data,path:i.path,parent:a});if(v.status==="valid")return v;else if(v.status==="dirty"&&!p)p={result:v,ctx:a};if(a.common.issues.length)x.push(a.common.issues)}if(p)return i.common.issues.push(...p.ctx.common.issues),p.result;let m=x.map((f)=>new Ii(f));return L(i,{code:U.invalid_union,unionErrors:m}),g}}get options(){return this._def.options}}Cp.create=(n,i)=>{return new Cp({options:n,typeName:t.ZodUnion,...cn(i)})};var Do=(n)=>{if(n instanceof up)return Do(n.schema);else if(n instanceof no)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 Tn.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 Np)return[null];else if(n instanceof To)return[void 0,...Do(n.unwrap())];else if(n instanceof Co)return[null,...Do(n.unwrap())];else if(n instanceof Nf)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 Df extends pn{_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==C.object)return L(i,{code:U.invalid_type,expected:C.object,received:i.parsedType}),g;let o=this.discriminator,c=i.data[o],p=this.optionsMap.get(c);if(!p)return L(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=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 Df({typeName:t.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...cn(o)})}}function z0(n,i){let o=No(n),c=No(i);if(n===i)return{valid:!0,data:n};else if(o===C.object&&c===C.object){let p=Tn.objectKeys(i),x=Tn.objectKeys(n).filter((f)=>p.indexOf(f)!==-1),m={...n,...i};for(let f of x){let a=z0(n[f],i[f]);if(!a.valid)return{valid:!1};m[f]=a.data}return{valid:!0,data:m}}else if(o===C.array&&c===C.array){if(n.length!==i.length)return{valid:!1};let p=[];for(let x=0;x<n.length;x++){let m=n[x],f=i[x],a=z0(m,f);if(!a.valid)return{valid:!1};p.push(a.data)}return{valid:!0,data:p}}else if(o===C.date&&c===C.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(H0(p)||H0(x))return g;let m=z0(p.value,x.value);if(!m.valid)return L(o,{code:U.invalid_intersection_types}),g;if(M0(p)||M0(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:t.ZodIntersection,...cn(o)})};class Qo extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==C.array)return L(o,{code:U.invalid_type,expected:C.array,received:o.parsedType}),g;if(o.data.length<this._def.items.length)return L(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)L(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 f=this._def.items[m]||this._def.rest;if(!f)return null;return f._parse(new Fo(o,x,o.path,m))}).filter((x)=>!!x);if(o.common.async)return Promise.all(p).then((x)=>{return zi.mergeArray(i,x)});else return zi.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:t.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!==C.object)return L(o,{code:U.invalid_type,expected:C.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 zi.mergeObjectAsync(i,c);else return zi.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:t.ZodRecord,...cn(o)});return new kx({keyType:Jo.create(),valueType:n,typeName:t.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!==C.map)return L(o,{code:U.invalid_type,expected:C.map,received:o.parsedType}),g;let c=this._def.keyType,p=this._def.valueType,x=[...o.data.entries()].map(([m,f],a)=>{return{key:c._parse(new Fo(o,m,o.path,[a,"key"])),value:p._parse(new Fo(o,f,o.path,[a,"value"]))}});if(o.common.async){let m=new Map;return Promise.resolve().then(async()=>{for(let f of x){let a=await f.key,v=await f.value;if(a.status==="aborted"||v.status==="aborted")return g;if(a.status==="dirty"||v.status==="dirty")i.dirty();m.set(a.value,v.value)}return{status:i.value,value:m}})}else{let m=new Map;for(let f of x){let{key:a,value:v}=f;if(a.status==="aborted"||v.status==="aborted")return g;if(a.status==="dirty"||v.status==="dirty")i.dirty();m.set(a.value,v.value)}return{status:i.value,value:m}}}}Zx.create=(n,i,o)=>{return new Zx({valueType:i,keyType:n,typeName:t.ZodMap,...cn(o)})};class uc extends pn{_parse(n){let{status:i,ctx:o}=this._processInputParams(n);if(o.parsedType!==C.set)return L(o,{code:U.invalid_type,expected:C.set,received:o.parsedType}),g;let c=this._def;if(c.minSize!==null){if(o.data.size<c.minSize.value)L(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)L(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(f){let a=new Set;for(let v of f){if(v.status==="aborted")return g;if(v.status==="dirty")i.dirty();a.add(v.value)}return{status:i.value,value:a}}let m=[...o.data.values()].map((f,a)=>p._parse(new Fo(o,f,o.path,a)));if(o.common.async)return Promise.all(m).then((f)=>x(f));else return x(m)}min(n,i){return new uc({...this._def,minSize:{value:n,message:k.toString(i)}})}max(n,i){return new uc({...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)}}uc.create=(n,i)=>{return new uc({valueType:n,minSize:null,maxSize:null,typeName:t.ZodSet,...cn(i)})};class jp extends pn{constructor(){super(...arguments);this.validate=this.implement}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==C.function)return L(i,{code:U.invalid_type,expected:C.function,received:i.parsedType}),g;function o(m,f){return bf({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,jf(),bp].filter((a)=>!!a),issueData:{code:U.invalid_arguments,argumentsError:f}})}function c(m,f){return bf({data:m,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,jf(),bp].filter((a)=>!!a),issueData:{code:U.invalid_return_type,returnTypeError:f}})}let p={errorMap:i.common.contextualErrorMap},x=i.data;if(this._def.returns instanceof Ic){let m=this;return Ui(async function(...f){let a=new Ii([]),v=await m._def.args.parseAsync(f,p).catch((J)=>{throw a.addIssue(o(f,J)),a}),$=await Reflect.apply(x,this,v);return await m._def.returns._def.type.parseAsync($,p).catch((J)=>{throw a.addIssue(c($,J)),a})})}else{let m=this;return Ui(function(...f){let a=m._def.args.safeParse(f,p);if(!a.success)throw new Ii([o(f,a.error)]);let v=Reflect.apply(x,this,a.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 jp({...this._def,args:Qo.create(n).rest(mc.create())})}returns(n){return new jp({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,o){return new jp({args:n?n:Qo.create([]).rest(mc.create()),returns:i||mc.create(),typeName:t.ZodFunction,...cn(o)})}}class up 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})}}up.create=(n,i)=>{return new up({getter:n,typeName:t.ZodLazy,...cn(i)})};class Ip extends pn{_parse(n){if(n.data!==this._def.value){let i=this._getOrReturnCtx(n);return L(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:t.ZodLiteral,...cn(i)})};function oR(n,i){return new vc({values:n,typeName:t.ZodEnum,...cn(i)})}class vc extends pn{constructor(){super(...arguments);Cx.set(this,void 0)}_parse(n){if(typeof n.data!=="string"){let i=this._getOrReturnCtx(n),o=this._def.values;return L(i,{expected:Tn.joinValues(o),received:i.parsedType,code:U.invalid_type}),g}if(!Lf(this,Cx,"f"))d6(this,Cx,new Set(this._def.values),"f");if(!Lf(this,Cx,"f").has(n.data)){let i=this._getOrReturnCtx(n),o=this._def.values;return L(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})}}Cx=new WeakMap;vc.create=oR;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!==C.string&&o.parsedType!==C.number){let c=Tn.objectValues(i);return L(o,{expected:Tn.joinValues(c),received:o.parsedType,code:U.invalid_type}),g}if(!Lf(this,hx,"f"))d6(this,hx,new Set(Tn.getValidEnumValues(this._def.values)),"f");if(!Lf(this,hx,"f").has(n.data)){let c=Tn.objectValues(i);return L(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:t.ZodNativeEnum,...cn(i)})};class Ic extends pn{unwrap(){return this._def.type}_parse(n){let{ctx:i}=this._processInputParams(n);if(i.parsedType!==C.promise&&i.common.async===!1)return L(i,{code:U.invalid_type,expected:C.promise,received:i.parsedType}),g;let o=i.parsedType===C.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:t.ZodPromise,...cn(i)})};class no extends pn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===t.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(L(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 f=await this._def.schema._parseAsync({data:m,path:o.path,parent:o});if(f.status==="aborted")return g;if(f.status==="dirty")return Bp(f.value);if(i.value==="dirty")return Bp(f.value);return f});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 f=c.refinement(m,p);if(o.common.async)return Promise.resolve(f);if(f 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(!Nc(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(!Nc(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:t.ZodEffects,effect:i,...cn(o)})};no.createWithPreprocess=(n,i,o)=>{return new no({schema:i,effect:{type:"preprocess",transform:n},typeName:t.ZodEffects,...cn(o)})};class To extends pn{_parse(n){if(this._getType(n)===C.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:t.ZodOptional,...cn(i)})};class Co extends pn{_parse(n){if(this._getType(n)===C.null)return Ui(null);return this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Co.create=(n,i)=>{return new Co({innerType:n,typeName:t.ZodNullable,...cn(i)})};class kp extends pn{_parse(n){let{ctx:i}=this._processInputParams(n),o=i.data;if(i.parsedType===C.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:t.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(ux(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:t.ZodCatch,catchValue:typeof i.catch==="function"?i.catch:()=>i.catch,...cn(i)})};class qx extends pn{_parse(n){if(this._getType(n)!==C.nan){let o=this._getOrReturnCtx(n);return L(o,{code:U.invalid_type,expected:C.nan,received:o.parsedType}),g}return{status:"valid",value:n.data}}}qx.create=(n)=>{return new qx({typeName:t.ZodNaN,...cn(n)})};var dG=Symbol("zod_brand");class Nf 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 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 Px({in:n,out:i,typeName:t.ZodPipeline})}}class qp extends pn{_parse(n){let i=this._def.innerType._parse(n),o=(c)=>{if(Nc(c))c.value=Object.freeze(c.value);return c};return ux(i)?i.then((c)=>o(c)):o(i)}unwrap(){return this._def.innerType}}qp.create=(n,i)=>{return new qp({innerType:n,typeName:t.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 cR(n,i={},o){if(n)return hc.create().superRefine((c,p)=>{var x,m;let f=n(c);if(f instanceof Promise)return f.then((a)=>{var v,$;if(!a){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(!f){let a=r6(i,c),v=(m=(x=a.fatal)!==null&&x!==void 0?x:o)!==null&&m!==void 0?m:!0;p.addIssue({code:"custom",...a,fatal:v})}return});return hc.create()}var eG={object:un.lazycreate},t;(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"})(t||(t={}));var nY=(n,i={message:`Input not instance of ${n.name}`})=>cR((o)=>o instanceof n,i),pR=Jo.create,xR=fc.create,iY=qx.create,oY=ac.create,mR=Lp.create,cY=Cc.create,pY=Ix.create,xY=Dp.create,mY=Np.create,fY=hc.create,aY=mc.create,vY=lo.create,$Y=yx.create,wY=Ao.create,JY=un.create,AY=un.strictCreate,TY=Cp.create,FY=Df.create,RY=hp.create,XY=Qo.create,WY=kx.create,KY=Zx.create,SY=uc.create,GY=jp.create,YY=up.create,HY=Ip.create,MY=vc.create,zY=yp.create,lY=Ic.create,t6=no.create,QY=To.create,EY=Co.create,OY=no.createWithPreprocess,UY=Px.create,VY=()=>pR().optional(),_Y=()=>xR().optional(),BY=()=>mR().optional(),jY={string:(n)=>Jo.create({...n,coerce:!0}),number:(n)=>fc.create({...n,coerce:!0}),boolean:(n)=>Lp.create({...n,coerce:!0}),bigint:(n)=>ac.create({...n,coerce:!0}),date:(n)=>Cc.create({...n,coerce:!0})},bY=g,Kn=Object.freeze({__proto__:null,defaultErrorMap:bp,setErrorMap:OG,getErrorMap:jf,makeIssue:bf,EMPTY_PATH:UG,addIssueToContext:L,ParseStatus:zi,INVALID:g,DIRTY:Bp,OK:Ui,isAborted:H0,isDirty:M0,isValid:Nc,isAsync:ux,get util(){return Tn},get objectUtil(){return Y0},ZodParsedType:C,getParsedType:No,ZodType:pn,datetimeRegex:iR,ZodString:Jo,ZodNumber:fc,ZodBigInt:ac,ZodBoolean:Lp,ZodDate:Cc,ZodSymbol:Ix,ZodUndefined:Dp,ZodNull:Np,ZodAny:hc,ZodUnknown:mc,ZodNever:lo,ZodVoid:yx,ZodArray:Ao,ZodObject:un,ZodUnion:Cp,ZodDiscriminatedUnion:Df,ZodIntersection:hp,ZodTuple:Qo,ZodRecord:kx,ZodMap:Zx,ZodSet:uc,ZodFunction:jp,ZodLazy:up,ZodLiteral:Ip,ZodEnum:vc,ZodNativeEnum:yp,ZodPromise:Ic,ZodEffects:no,ZodTransformer:no,ZodOptional:To,ZodNullable:Co,ZodDefault:kp,ZodCatch:Zp,ZodNaN:qx,BRAND:dG,ZodBranded:Nf,ZodPipeline:Px,ZodReadonly:qp,custom:cR,Schema:pn,ZodSchema:pn,late:eG,get ZodFirstPartyTypeKind(){return t},coerce:jY,any:fY,array:wY,bigint:oY,boolean:mR,date:cY,discriminatedUnion:FY,effect:t6,enum:MY,function:GY,instanceof:nY,intersection:RY,lazy:YY,literal:HY,map:KY,nan:iY,nativeEnum:zY,never:vY,null:mY,nullable:EY,number:xR,object:JY,oboolean:BY,onumber:_Y,optional:QY,ostring:VY,pipeline:UY,preprocess:OY,promise:lY,record:WY,set:SY,strictObject:AY,string:pR,symbol:pY,transformer:t6,tuple:XY,undefined:xY,union:TY,unknown:aY,void:$Y,NEVER:bY,ZodIssueCode:U,quotelessJson:EG,ZodError:Ii});var LY="__vite_start_time"in globalThis,DY=typeof window!=="undefined",rN="vitest"in globalThis,Pn=P6({isServer:!LY&&!DY,server:{CI:Kn.string().transform((n)=>!0).optional(),POSTGRES_USER:Kn.string(),POSTGRES_PASSWORD:Kn.string(),POSTGRES_DATABASE:Kn.string(),POSTGRES_HOST:Kn.string(),POSTGRES_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),BACKEND_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),RUN_WORKERS_FROM_SOURCE:Kn.union([Kn.literal("true"),Kn.literal("false")]).optional().transform((n)=>n==="true"),FRONTEND_PORT:Kn.string().transform((n)=>Number.parseInt(n,10)),FRONTEND_ORIGINS:Kn.string().transform((n)=>JSON.parse(n)).pipe(Kn.array(Kn.string())),OPENAI_API_KEY:Kn.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Kn.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Kn.union([Kn.literal("true"),Kn.literal("false")]).optional().transform((n)=>n==="true")},runtimeEnv:import.meta.env,emptyStringAsUndefined:!0});var aR=l0(import.meta.dirname,"../dev"),Q0=Pn.VITE_USE_SELF_SIGNED_CERTIFICATE?{cert:fR(l0(aR,"./cert.pem"),"utf-8"),key:fR(l0(aR,"./key.pem"),"utf-8")}:void 0;var $c=new Qa,mn=Pn.VITE_USE_SELF_SIGNED_CERTIFICATE?console:$c.logger;d.STORE.loggers[0]=new Wc("warn",void 0,mn);if(mn!==console)Object.assign(console,mn,{log:mn.info});import{spawn as NY}from"child_process";import{resolve as CY}from"path";function E0(n,i,o=n.logger){let c=Pn.RUN_WORKERS_FROM_SOURCE?"ts":"js",p=i.endsWith(".bun")?"bun":"node",m=[CY(import.meta.dir,`${i}.${c}`)];if(p==="node"&&c==="ts")m.push("--experimental-strip-types");let f=NY(p,m);return new Jx(f,i,o)}var vR=$a(av(),1);var hY=604800000,Cf=(()=>{let{__userSessionMap:n}=globalThis;if(!n){n=globalThis.__userSessionMap=new Map;let i=new vR.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>hY)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 _2 from"path";import $2 from"os";import w2 from"fs";var hf=new Map,O0=new Map,U0=Symbol("OriginError"),Pp={};class io extends Promise{constructor(n,i,o,c,p={}){let x,m;super((f,a)=>{x=f,m=a});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=(f)=>(this.active=!1,x(f)),this.reject=(f)=>(this.active=!1,m(f)),this.active=!1,this.cancelled=null,this.executed=!1,this.signature="",this[U0]=this.handler.debug?new Error:this.tagged&&uY(this.strings)}get origin(){return(this.handler.debug?this[U0].stack:this.tagged&&O0.has(this.strings)?O0.get(this.strings):O0.set(this.strings,this[U0].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((f)=>o=f)},this.resolve=()=>(this.active=!1,p({done:!0})),this.reject=(m)=>(this.active=!1,x(m))});return this.execute(),c},return(){return o&&o(Pp),{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 uY(n){if(hf.has(n))return hf.get(n);let i=Error.stackTraceLimit;return Error.stackTraceLimit=4,hf.set(n,new Error),Error.stackTraceLimit=i,hf.get(n)}class sp extends Error{constructor(n){super(n.message);this.name=this.constructor.name,Object.assign(this,n)}}var tn={connection:$R,postgres:wR,generic:JR,notSupported:AR};function $R(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,$R),x}function wR(n){let i=new sp(n);return Error.captureStackTrace(i,wR),i}function JR(n,i){let o=Object.assign(new Error(n+": "+i),{code:n});return Error.captureStackTrace(o,JR),o}function AR(n){let i=Object.assign(new Error(n+" (B) is not supported"),{code:"MESSAGE_NOT_SUPPORTED",name:n});return Error.captureStackTrace(i,AR),i}var IY={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 yf{then(){V0()}catch(){V0()}finally(){V0()}}class gx extends yf{constructor(n){super();this.value=qf(n)}}class Eo extends yf{constructor(n,i,o){super();this.value=n,this.type=i,this.array=o}}class kf extends yf{constructor(n,i){super();this.first=n,this.rest=i}build(n,i,o,c){let p=yY.map(([x,m])=>({fn:m,i:n.search(x)})).sort((x,m)=>x.i-m.i).pop();return p.i===-1?L0(this.first,c):p.fn(this.first,this.rest,i,o,c)}}function Zf(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 tn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return"$"+o.push(n instanceof Eo?(i.push(n.value),n.array?n.array[n.type||If(n.value)]||n.type||XR(n.value):n.type):(i.push(n),If(n)))}var FR=KR(IY);function j0(n,i,o,c,p,x){for(let m=1;m<n.strings.length;m++)i+=b0(i,o,c,p,x)+n.strings[m],o=n.args[m];return i}function b0(n,i,o,c,p){return i instanceof kf?i.build(n,o,c,p):i instanceof io?B0(i,o,c,p):i instanceof gx?i.value:i&&i[0]instanceof io?i.reduce((x,m)=>x+" "+B0(m,o,c,p),""):Zf(i,o,c,p)}function B0(n,i,o,c){return n.fragment=!0,j0(n,n.strings[0],n.args[0],i,o,c)}function RR(n,i,o,c,p){return n.map((x)=>"("+c.map((m)=>b0("values",x[m],i,o,p)).join(",")+")").join(",")}function TR(n,i,o,c,p){let x=Array.isArray(n[0]),m=i.length?i.flat():Object.keys(x?n[0]:n);return RR(x?n:[n],o,c,m,p)}function uf(n,i,o,c,p){if(typeof n==="string"&&(n=[n].concat(i)),Array.isArray(n))return L0(n,p);let x;return(i.length?i.flat():Object.keys(n)).map((f)=>{return x=n[f],(x instanceof io?B0(x,o,c,p):x instanceof gx?x.value:Zf(x,o,c,p))+" as "+qf(p.transform.column.to?p.transform.column.to(f):f)}).join(",")}var yY=Object.entries({values:TR,in:(...n)=>{let i=TR(...n);return i==="()"?"(null)":i},select:uf,as:uf,returning:uf,"\\(":uf,update(n,i,o,c,p){return(i.length?i.flat():Object.keys(n)).map((x)=>qf(p.transform.column.to?p.transform.column.to(x):x)+"="+b0("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"("+L0(x,p)+")values"+RR(Array.isArray(n)?n:[n],o,c,x,p)}}).map(([n,i])=>[new RegExp("((?:^|[\\s(])"+n+"(?:$|[\\s(]))(?![\\s\\S]*\\1)","i"),i]);function V0(){throw tn.generic("NOT_TAGGED_CALL","Query not called as a tagged template literal")}var{serializers:kY,parsers:ZY}=FR;function XR(n){if(Array.isArray(n))return XR(n[0]);return typeof n==="string"?1009:0}var WR=function(n){let i=KR(n||{});return{serializers:Object.assign({},kY,i.serializers),parsers:Object.assign({},ZY,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 L0(n,{transform:{column:i}}){return n.map((o)=>qf(i.to?i.to(o):o)).join(",")}var qf=function n(i){return'"'+i.replace(/"/g,'""').replace(/\./g,'"."')+'"'},If=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},qY=/\\/g,PY=/"/g;function sY(n){return n.replace(qY,"\\\\").replace(PY,"\\\"")}var SR=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((f)=>n(f,o,c,p)).join(m)+"}";return"{"+i.map((f)=>{if(f===void 0){if(f=c.transform.undefined,f===void 0)throw tn.generic("UNDEFINED_VALUE","Undefined values are not allowed")}return f===null?"null":'"'+sY(o?o(f.type?f.value:f):""+f)+'"'}).join(m)+"}"},_0={i:0,char:null,str:"",quoted:!1,last:0},GR=function n(i,o,c){return _0.i=_0.last=0,YR(_0,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,"-"),sx=(n)=>n.replace(/([A-Z])/g,"_$1").toLowerCase(),rx=(n)=>(n.slice(0,1)+n.slice(1).replace(/([A-Z])/g,"_$1")).toLowerCase(),tx=(n)=>n.replace(/-/g,"_");function D0(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:D0(yc)};sx.column={to:sx};var N0={...yc};N0.column.to=sx;kc.column={from:kc};kc.value={from:D0(kc)};rx.column={to:rx};var C0={...kc};C0.column.to=rx;Zc.column={from:Zc};Zc.value={from:D0(Zc)};tx.column={to:tx};var h0={...Zc};h0.column.to=tx;import HR from"net";import dY from"tls";import dx from"crypto";import u0 from"stream";import{performance as MR}from"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 yi=rY;function rY(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 li=Buffer.allocUnsafe(256),tY="BCcDdEFfHPpQSX".split("").reduce((n,i)=>{let o=i.charCodeAt(0);return n[i]=()=>{return li[0]=o,Qn.i=5,Qn},n},{}),Qn=Object.assign(gY,tY,{N:String.fromCharCode(0),i:0,inc(n){return Qn.i+=n,Qn},str(n){let i=Buffer.byteLength(n);return Pf(i),Qn.i+=li.write(n,Qn.i,i,"utf8"),Qn},i16(n){return Pf(2),li.writeUInt16BE(n,Qn.i),Qn.i+=2,Qn},i32(n,i){if(i||i===0)return li.writeUInt32BE(n,i),Qn;return Pf(4),li.writeUInt32BE(n,Qn.i),Qn.i+=4,Qn},z(n){return Pf(n),li.fill(0,Qn.i,Qn.i+n),Qn.i+=n,Qn},raw(n){return li=Buffer.concat([li.subarray(0,Qn.i),n]),Qn.i=li.length,Qn},end(n=1){li.writeUInt32BE(Qn.i-n,n);let i=li.subarray(0,Qn.i);return Qn.i=0,li=Buffer.allocUnsafe(256),i}}),P=Qn;function Pf(n){if(li.length-Qn.i<n){let i=li,o=i.length;li=Buffer.allocUnsafe(o+(o>>1)+n),i.copy(li)}}function gY(){return Qn.i=0,Qn}var k0=QR,eY=1,wc=P().S().end(),zR=P().H().end(),n2=P().i32(8).i32(80877103).end(8),i2=Buffer.concat([P().E().str(P.N).i32(0).end(),wc]),o2=P().D().str("S").str(P.N).end(),rp=()=>{},c2=new Set(["FetchPreparedStatement","RevalidateCachedQuery","transformAssignedExpr"]),p2={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 QR(n,i={},{onopen:o=rp,onend:c=rp,onclose:p=rp}={}){let{ssl:x,max:m,user:f,host:a,port:v,database:$,parsers:w,transform:J,onnotice:X,onnotify:W,onparameter:R,max_pipeline:S,keep_alive:H,backoff:M,target_session_attrs:I}=n,Y=yi(),l=eY++,E={pid:null,secret:null},Q=y0(fa,n.idle_timeout),j=y0(fa,n.max_lifetime),y=y0(m3,n.connect_timeout),z=null,fn,Z=new qc,an=Buffer.alloc(0),En=n.fetch_types,gn={},_i={},Oo=Math.random().toString(36).slice(2),O=1,q=0,Rn=0,Dn=0,dn=0,vn=0,_n=0,sn=0,Cn=null,bn=null,Ti=!1,Bn=null,oo=null,Fi=null,ho=null,en=null,Ln=null,co=null,Xo=null,_=null,nx=null,Ri={queue:i.closed,idleTimer:Q,connect(A){Fi=A||!0,X$()},terminate:ox,execute:ix,cancel:o3,end:fa,count:0,id:l};return i.closed&&i.closed.push(Ri),Ri;async function i3(){let A;try{A=n.socket?await Promise.resolve(n.socket(n)):new HR.Socket}catch(K){tc(K);return}return A.on("error",tc),A.on("close",W$),A.on("drain",F$),A}async function o3({pid:A,secret:K},s,Xn){try{fn=P().i32(16).i32(80877102).i32(A).i32(K).end(16),await R$(),z.once("error",Xn),z.once("close",s)}catch(In){Xn(In)}}function ix(A){if(Ti)return xm(A,tn.connection("CONNECTION_DESTROYED",n));if(A.cancelled)return;try{return A.state=E,_?Y.push(A):(_=A,_.active=!0),x3(A),$i(c3(A))&&!A.describeFirst&&!A.cursorFn&&Y.length<S&&(!A.options.onexecute||A.options.onexecute(Ri))}catch(K){return Y.length===0&&$i(wc),Wo(K),!0}}function c3(A){if(A.parameters.length>=65534)throw tn.generic("MAX_PARAMETERS_EXCEEDED","Max number of parameters (65534) exceeded");return A.options.simple?P().Q().str(A.statement.string+P.N).end():A.describeFirst?Buffer.concat([J$(A),zR]):A.prepare?A.prepared?pm(A):Buffer.concat([J$(A),pm(A)]):p3(A)}function J$(A){return Buffer.concat([S$(A.statement.string,A.parameters,A.statement.types,A.statement.name),k3("S",A.statement.name)])}function pm(A){return Buffer.concat([y3(A.parameters,A.statement.types,A.statement.name,A.cursorName),A.cursorFn?G$("",A.cursorRows):i2])}function p3(A){return Buffer.concat([S$(A.statement.string,A.parameters,A.statement.types),o2,pm(A)])}function x3(A){let K=[],s=[],Xn=j0(A,A.strings[0],A.args[0],K,s,n);!A.tagged&&A.args.forEach((In)=>Zf(In,K,s,n)),A.prepare=n.prepare&&("prepare"in A.options?A.options.prepare:!0),A.string=Xn,A.signature=A.prepare&&s+Xn,A.onlyDescribe&&delete _i[A.signature],A.parameters=A.parameters||K,A.prepared=A.prepare&&A.signature in _i,A.describeFirst=A.onlyDescribe||K.length&&!A.prepared,A.statement=A.prepared?_i[A.signature]:{string:Xn,types:s,name:A.prepare?Oo+O++:""},typeof n.debug==="function"&&n.debug(l,Xn,K,s)}function $i(A,K){if(Ln=Ln?Buffer.concat([Ln,A]):Buffer.from(A),K||Ln.length>=1024)return A$(K);return bn===null&&(bn=setImmediate(A$)),!0}function A$(A){let K=z.write(Ln,A);return bn!==null&&clearImmediate(bn),Ln=bn=null,K}function m3(){Wo(tn.connection("CONNECT_TIMEOUT",n,z)),z.destroy()}async function T$(){if($i(n2),!await new Promise((K)=>z.once("data",(s)=>K(s[0]===83)))&&x==="prefer")return rc();z.removeAllListeners(),z=dY.connect({socket:z,servername:HR.isIP(z.host)?void 0:z.host,...x==="require"||x==="allow"||x==="prefer"?{rejectUnauthorized:!1}:x==="verify-full"?{}:typeof x==="object"?x:{}}),z.on("secureConnect",rc),z.on("error",tc),z.on("close",W$),z.on("drain",F$)}function F$(){!_&&o(Ri)}function ma(A){if(Bn){if(Bn.push(A),Rn-=A.length,Rn>=0)return}an=Bn?Buffer.concat(Bn,vn-Rn):an.length===0?A:Buffer.concat([an,A],an.length+A.length);while(an.length>4){if(vn=an.readUInt32BE(1),vn>=an.length){Rn=vn-an.length,Bn=[an];break}try{f3(an.subarray(0,vn+1))}catch(K){_&&(_.cursorFn||_.describeFirst)&&$i(wc),Wo(K)}an=an.subarray(vn+1),Rn=0,Bn=null}}async function R$(){if(Ti=!1,gn={},z||(z=await i3()),!z)return;if(y.start(),n.socket)return x?T$():rc();if(z.on("connect",x?T$:rc),n.path)return z.connect(n.path);z.ssl=x,z.connect(v[Dn],a[Dn]),z.host=a[Dn],z.port=v[Dn],Dn=(Dn+1)%v.length}function X$(){setTimeout(R$,q?q+_n-MR.now():0)}function rc(){try{_i={},En=n.fetch_types,Oo=Math.random().toString(36).slice(2),O=1,j.start(),z.on("data",ma),H&&z.setKeepAlive&&z.setKeepAlive(!0,1000*H);let A=q3();$i(A)}catch(A){tc(A)}}function tc(A){if(Ri.queue===i.connecting&&n.host[dn+1])return;Wo(A);while(Y.length)xm(Y.shift(),A)}function Wo(A){en&&(en.destroy(A),en=null),_&&xm(_,A),Fi&&(xm(Fi,A),Fi=null)}function xm(A,K){"query"in K||"parameters"in K||Object.defineProperties(K,{stack:{value:K.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(K)}function fa(){return ho||(!Ri.reserved&&c(Ri),!Ri.reserved&&!Fi&&!_&&Y.length===0?(ox(),new Promise((A)=>z&&z.readyState!=="closed"?z.once("close",A):A())):ho=new Promise((A)=>co=A))}function ox(){if(Ti=!0,en||_||Fi||Y.length)tc(tn.connection("CONNECTION_DESTROYED",n));if(clearImmediate(bn),z)z.removeListener("data",ma),z.removeListener("connect",rc),z.readyState==="open"&&z.end(P().X().end());co&&(co(),ho=co=null)}async function W$(A){if(an=Buffer.alloc(0),Rn=0,Bn=null,clearImmediate(bn),z.removeListener("data",ma),z.removeListener("connect",rc),Q.cancel(),j.cancel(),y.cancel(),z.removeAllListeners(),z=null,Fi)return X$();!A&&(_||Y.length)&&tc(tn.connection("CONNECTION_CLOSED",n,z)),q=MR.now(),A&&n.shared.retries++,_n=(typeof M==="function"?M(n.shared.retries):M)*1000,p(Ri,tn.connection("CONNECTION_CLOSED",n,z))}function f3(A,K=A[0]){(K===68?a3:K===100?b3:K===65?O3:K===83?v3:K===90?$3:K===67?w3:K===50?K$:K===49?J3:K===116?A3:K===84?T3:K===82?F3:K===110?G3:K===75?Y3:K===69?Q3:K===115?U3:K===51?V3:K===71?_3:K===78?D3:K===72?B3:K===99?L3:K===73?N3:K===86?C3:K===118?h3:K===87?j3:u3)(A)}function a3(A){let K=7,s,Xn,In,Xi=_.isRaw?new Array(_.statement.columns.length):{};for(let Qi=0;Qi<_.statement.columns.length;Qi++)Xn=_.statement.columns[Qi],s=A.readInt32BE(K),K+=4,In=s===-1?null:_.isRaw===!0?A.subarray(K,K+=s):Xn.parser===void 0?A.toString("utf8",K,K+=s):Xn.parser.array===!0?Xn.parser(A.toString("utf8",K+1,K+=s)):Xn.parser(A.toString("utf8",K,K+=s)),_.isRaw?Xi[Qi]=_.isRaw===!0?In:J.value.from?J.value.from(In,Xn):In:Xi[Xn.name]=J.value.from?J.value.from(In,Xn):In;_.forEachFn?_.forEachFn(J.row.from?J.row.from(Xi):Xi,Z):Z[sn++]=J.row.from?J.row.from(Xi):Xi}function v3(A){let[K,s]=A.toString("utf8",5,A.length-1).split(P.N);if(gn[K]=s,n.parameters[K]!==s)n.parameters[K]=s,R&&R(K,s)}function $3(A){if(_&&_.options.simple&&_.resolve(oo||Z),_=oo=null,Z=new qc,y.cancel(),Fi){if(I){if(!gn.in_hot_standby||!gn.default_transaction_read_only)return l3();else if(z3(I,gn))return ox()}if(En)return Fi===!0&&(Fi=null),H3();Fi!==!0&&ix(Fi),n.shared.retries=dn=0,Fi=null;return}while(Y.length&&(_=Y.shift())&&(_.active=!0,_.cancelled))QR(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 w3(A){sn=0;for(let K=A.length-1;K>0;K--){if(A[K]===32&&A[K+1]<58&&Z.count===null)Z.count=+A.toString("utf8",K+1,A.length-1);if(A[K-1]>=65){Z.command=A.toString("utf8",5,K),Z.state=E;break}}if(nx&&(nx(),nx=null),Z.command==="BEGIN"&&m!==1&&!Ri.reserved)return Wo(tn.generic("UNSAFE_TRANSACTION","Only use sql.begin, sql.reserved or max: 1"));if(_.options.simple)return K$();if(_.cursorFn)Z.count&&_.cursorFn(Z),$i(wc);_.resolve(Z)}function J3(){_.parsing=!1}function K$(){!Z.statement&&(Z.statement=_.statement),Z.columns=_.statement.columns}function A3(A){let K=A.readUInt16BE(5);for(let s=0;s<K;++s)!_.statement.types[s]&&(_.statement.types[s]=A.readUInt32BE(7+s*4));_.prepare&&(_i[_.signature]=_.statement),_.describeFirst&&!_.onlyDescribe&&($i(pm(_)),_.describeFirst=!1)}function T3(A){if(Z.command)oo=oo||[Z],oo.push(Z=new qc),Z.count=null,_.statement.columns=null;let K=A.readUInt16BE(5),s=7,Xn;_.statement.columns=Array(K);for(let In=0;In<K;++In){Xn=s;while(A[s++]!==0);let Xi=A.readUInt32BE(s),Qi=A.readUInt16BE(s+4),uo=A.readUInt32BE(s+6);_.statement.columns[In]={name:J.column.from?J.column.from(A.toString("utf8",Xn,s-1)):A.toString("utf8",Xn,s-1),parser:w[uo],table:Xi,number:Qi,type:uo},s+=18}if(Z.statement=_.statement,_.onlyDescribe)return _.resolve(_.statement),$i(wc)}async function F3(A,K=A.readUInt32BE(5)){(K===3?R3:K===5?X3:K===10?W3:K===11?K3:K===12?S3:K!==0?I3:rp)(A,K)}async function R3(){let A=await aa();$i(P().p().str(A).z(1).end())}async function X3(A){let K="md5"+await lR(Buffer.concat([Buffer.from(await lR(await aa()+f)),A.subarray(9)]));$i(P().p().str(K).z(1).end())}async function W3(){Xo=(await dx.randomBytes(18)).toString("base64"),P().p().str("SCRAM-SHA-256"+P.N);let A=P.i;$i(P.inc(4).str("n,,n=*,r="+Xo).i32(P.i-A-4,A).end())}async function K3(A){let K=A.toString("utf8",9).split(",").reduce((Qi,uo)=>(Qi[uo[0]]=uo.slice(2),Qi),{}),s=await dx.pbkdf2Sync(await aa(),Buffer.from(K.s,"base64"),parseInt(K.i),32,"sha256"),Xn=await sf(s,"Client Key"),In="n=*,r="+Xo+",r="+K.r+",s="+K.s+",i="+K.i+",c=biws,r="+K.r;Cn=(await sf(await sf(s,"Server Key"),In)).toString("base64");let Xi="c=biws,r="+K.r+",p="+m2(Xn,Buffer.from(await sf(await x2(Xn),In))).toString("base64");$i(P().p().str(Xi).end())}function S3(A){if(A.toString("utf8",9).split(P.N,1)[0].slice(2)===Cn)return;Wo(tn.generic("SASL_SIGNATURE_MISMATCH","The server did not return the correct signature")),z.destroy()}function aa(){return Promise.resolve(typeof n.pass==="function"?n.pass():n.pass)}function G3(){if(Z.statement=_.statement,Z.statement.columns=[],_.onlyDescribe)return _.resolve(_.statement),$i(wc)}function Y3(A){E.pid=A.readUInt32BE(5),E.secret=A.readUInt32BE(9)}async function H3(){En=!1,(await new io([`
|
|
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
|
-
`],[],
|
|
68
|
+
`],[],ix)).forEach(({oid:K,typarray:s})=>M3(K,s))}function M3(A,K){if(!!n.parsers[K]&&!!n.serializers[K])return;let s=n.parsers[A];n.shared.typeArrayMap[A]=K,n.parsers[K]=(Xn)=>GR(Xn,s,K),n.parsers[K].array=!0,n.serializers[K]=(Xn)=>SR(Xn,n.serializers[A],n,K)}function z3(A,K){return A==="read-write"&&K.default_transaction_read_only==="on"||A==="read-only"&&K.default_transaction_read_only==="off"||A==="primary"&&K.in_hot_standby==="on"||A==="standby"&&K.in_hot_standby==="off"||A==="prefer-standby"&&K.in_hot_standby==="off"&&n.host[dn]}function l3(){let A=new io([`
|
|
69
69
|
show transaction_read_only;
|
|
70
70
|
select pg_catalog.pg_is_in_recovery()
|
|
71
|
-
`],[],
|
|
71
|
+
`],[],ix,null,{simple:!0});A.resolve=([[K],[s]])=>{gn.default_transaction_read_only=K.transaction_read_only,gn.in_hot_standby=s.pg_is_in_recovery?"on":"off"},A.execute()}function Q3(A){_&&(_.cursorFn||_.describeFirst)&&$i(wc);let K=tn.postgres(I0(A));_&&_.retried?Wo(_.retried):_&&_.prepared&&c2.has(K.routine)?E3(_,K):Wo(K)}function E3(A,K){delete _i[A.signature],A.retried=K,ix(A)}function O3(A){if(!W)return;let K=9;while(A[K++]!==0);W(A.toString("utf8",9,K-1),A.toString("utf8",K,A.length-1))}async function U3(){try{let A=await Promise.resolve(_.cursorFn(Z));sn=0,A===Pp?$i(Z3(_.portal)):(Z=new qc,$i(G$("",_.cursorRows)))}catch(A){$i(wc),_.reject(A)}}function V3(){Z.count&&_.cursorFn(Z),_.resolve(Z)}function _3(){en=new u0.Writable({autoDestroy:!0,write(A,K,s){z.write(P().d().raw(A).end(),s)},destroy(A,K){K(A),z.write(P().f().str(A+P.N).end()),en=null},final(A){z.write(P().c().end()),nx=A}}),_.resolve(en)}function B3(){en=new u0.Readable({read(){z.resume()}}),_.resolve(en)}function j3(){en=new u0.Duplex({autoDestroy:!0,read(){z.resume()},write(A,K,s){z.write(P().d().raw(A).end(),s)},destroy(A,K){K(A),z.write(P().f().str(A+P.N).end()),en=null},final(A){z.write(P().c().end()),nx=A}}),_.resolve(en)}function b3(A){en&&(en.push(A.subarray(5))||z.pause())}function L3(){en&&en.push(null),en=null}function D3(A){X?X(I0(A)):console.log(I0(A))}function N3(){}function C3(){Wo(tn.notSupported("FunctionCallResponse"))}function h3(){Wo(tn.notSupported("NegotiateProtocolVersion"))}function u3(A){console.error("Postgres.js : Unknown Message:",A[0])}function I3(A,K){console.error("Postgres.js : Unknown Auth:",K)}function y3(A,K,s="",Xn=""){let In,Xi;return P().B().str(Xn+P.N).str(s+P.N).i16(0).i16(A.length),A.forEach((Qi,uo)=>{if(Qi===null)return P.i32(4294967295);Xi=K[uo],A[uo]=Qi=Xi in n.serializers?n.serializers[Xi](Qi):""+Qi,In=P.i,P.inc(4).str(Qi).i32(P.i-In-4,In)}),P.i16(0),P.end()}function S$(A,K,s,Xn=""){return P().P().str(Xn+P.N).str(A+P.N).i16(K.length),K.forEach((In,Xi)=>P.i32(s[Xi]||0)),P.end()}function k3(A,K=""){return P().D().str(A).str(K+P.N).end()}function G$(A="",K=0){return Buffer.concat([P().E().str(A+P.N).i32(K).end(),zR])}function Z3(A=""){return Buffer.concat([P().C().str("P").str(A+P.N).end(),P().S().end()])}function q3(){return fn||P().inc(4).i16(3).z(2).str(Object.entries(Object.assign({user:f,database:$,client_encoding:"UTF8"},n.connection)).filter(([,A])=>A).map(([A,K])=>A+P.N+K).join(P.N)).z(2).end(0)}}function I0(n){let i={},o=5;for(let c=5;c<n.length-1;c++)if(n[c]===0)i[p2[n[o]]]=n.toString("utf8",o+1,c),o=c+1;return i}function lR(n){return dx.createHash("md5").update(n).digest("hex")}function sf(n,i){return dx.createHmac("sha256",n).update(i).digest()}function x2(n){return dx.createHash("sha256").update(n).digest()}function m2(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 y0(n,i){if(i=typeof i==="function"?i():i,!i)return{cancel:rp,start:rp};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 ER=()=>{};function Z0(n,i){let o=new Map,c="postgresjs_"+Math.random().toString(36).slice(2),p={},x,m,f=!1,a=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(f)return;m=null,p.pid=p.secret=void 0,J(await X(a,c,i.publications)),o.forEach((R)=>R.forEach(({onsubscribe:S})=>S()))},no_subscribe:!0}),v=a.end,$=a.close;return a.end=async()=>{return f=!0,m&&await new Promise((R)=>(m.once("close",R),m.end())),v()},a.close=async()=>{return m&&await new Promise((R)=>(m.once("close",R),m.end())),$()},w;async function w(R,S,H=ER,M=ER){if(R=v2(R),!x)x=X(a,c,i.publications);let I={fn:S,onsubscribe:H},Y=o.has(R)?o.get(R).add(I):o.set(R,new Set([I])).get(R),l=()=>{Y.delete(I),Y.size===0&&o.delete(R)};return x.then((E)=>{return J(E),H(),m&&m.on("error",M),{unsubscribe:l,state:p,sql:a}})}function J(R){m=R.stream,p.pid=R.state.pid,p.secret=R.state.secret}async function X(R,S,H){if(!H)throw new Error("Missing publication names");let M=await R.unsafe(`CREATE_REPLICATION_SLOT ${S} TEMPORARY LOGICAL pgoutput NOEXPORT_SNAPSHOT`),[I]=M,Y=await R.unsafe(`START_REPLICATION SLOT ${S} LOGICAL ${I.consistent_point} (proto_version '1', publication_names '${H}')`).writable(),l={lsn:Buffer.concat(I.consistent_point.split("/").map((z)=>Buffer.from(("00000000"+z).slice(-8),"hex")))};return Y.on("data",Q),Y.on("error",E),Y.on("close",R.close),{stream:Y,state:M.state};function E(z){console.error("Unexpected error during logical streaming - reconnecting",z)}function Q(z){if(z[0]===119)a2(z.subarray(25),l,R.options.parsers,j,i.transform);else if(z[0]===107&&z[17])l.lsn=z.subarray(1,9),y()}function j(z,fn){let Z=fn.relation.schema+"."+fn.relation.table;W("*",z,fn),W("*:"+Z,z,fn),fn.relation.keys.length&&W("*:"+Z+"="+fn.relation.keys.map((an)=>z[an.name]),z,fn),W(fn.command,z,fn),W(fn.command+":"+Z,z,fn),fn.relation.keys.length&&W(fn.command+":"+Z+"="+fn.relation.keys.map((an)=>z[an.name]),z,fn)}function y(){let z=Buffer.alloc(34);z[0]=114,z.fill(l.lsn,1),z.writeBigInt64BE(BigInt(Date.now()-Date.UTC(2000,0,1))*BigInt(1000),25),Y.write(z)}}function W(R,S,H){o.has(R)&&o.get(R).forEach(({fn:M})=>M(S,H,R))}}function f2(n){return new Date(Date.UTC(2000,0,1)+Number(n/BigInt(1000)))}function a2(n,i,o,c,p){let x=(m,[f,a])=>(m[f.charCodeAt(0)]=a,m);Object.entries({R:(m)=>{let f=1,a=i[m.readUInt32BE(f)]={schema:m.toString("utf8",f+=4,f=m.indexOf(0,f))||"pg_catalog",table:m.toString("utf8",f+1,f=m.indexOf(0,f+1)),columns:Array(m.readUInt16BE(f+=2)),keys:[]};f+=2;let v=0,$;while(f<m.length)$=a.columns[v++]={key:m[f++],name:p.column.from?p.column.from(m.toString("utf8",f,f=m.indexOf(0,f))):m.toString("utf8",f,f=m.indexOf(0,f)),type:m.readUInt32BE(f+=1),parser:o[m.readUInt32BE(f)],atttypmod:m.readUInt32BE(f+=4)},$.key&&a.keys.push($),f+=4},Y:()=>{},O:()=>{},B:(m)=>{i.date=f2(m.readBigInt64BE(9)),i.lsn=m.subarray(1,9)},I:(m)=>{let f=1,a=i[m.readUInt32BE(f)],{row:v}=rf(m,a.columns,f+=7,p);c(v,{command:"insert",relation:a})},D:(m)=>{let f=1,a=i[m.readUInt32BE(f)];f+=4;let v=m[f]===75;c(v||m[f]===79?rf(m,a.columns,f+=3,p).row:null,{command:"delete",relation:a,key:v})},U:(m)=>{let f=1,a=i[m.readUInt32BE(f)];f+=4;let v=m[f]===75,$=v||m[f]===79?rf(m,a.columns,f+=3,p):null;$&&(f=$.i);let{row:w}=rf(m,a.columns,f+3,p);c(w,{command:"update",relation:a,key:v,old:$&&$.row})},T:()=>{},C:()=>{}}).reduce(x,{})[n[0]](n)}function rf(n,i,o,c){let p,x,m,f=c.raw?new Array(i.length):{};for(let a=0;a<i.length;a++)p=n[o++],x=i[a],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?f[a]=c.raw===!0?m:c.value.from?c.value.from(m,x):m:f[x.name]=c.value.from?c.value.from(m,x):m;return{i:o,row:c.row.from?c.row.from(f):f}}function v2(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 OR from"stream";function q0(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:f}]=await x`select lo_open(${i}, ${o}) as fd`,a={writable:$,readable:v,close:()=>x`select lo_close(${f})`.then(m),tell:()=>x`select lo_tell64(${f})`,read:(w)=>x`select loread(${f}, ${w}) as data`,write:(w)=>x`select lowrite(${f}, ${w})`,truncate:(w)=>x`select lo_truncate64(${f}, ${w})`,seek:(w,J=0)=>x`select lo_lseek64(${f}, ${w}, ${J})`,size:()=>x`
|
|
72
72
|
select
|
|
73
73
|
lo_lseek64(${f}, location, 0) as position,
|
|
74
74
|
seek.size
|
|
@@ -78,10 +78,10 @@ ${J.trace}`:`No previous disposal trace for ${f} was found.`),o}let $=n.molecule
|
|
|
78
78
|
tell.location
|
|
79
79
|
from (select lo_tell64($1) as location) tell
|
|
80
80
|
) seek
|
|
81
|
-
`};return c(a),new Promise(async(A)=>m=A);async function $({highWaterMark:A=16384,start:J=0,end:S=1/0}={}){let W=S-J;return J&&await a.seek(J),new QS.Readable({highWaterMark:A,async read(R){let K=R>W?R-W:R;W-=R;let[{data:z}]=await a.read(K);if(this.push(z),z.length<R)this.push(null)}})}async function v({highWaterMark:A=16384,start:J=0}={}){return J&&await a.seek(J),new QS.Writable({highWaterMark:A,write(S,W,R){a.write(S).then(()=>R(),R)}})}}).catch(p)})}Object.assign(tf,{PostgresError:qp,toPascal:yc,pascal:C$,toCamel:Ic,camel:N$,toKebab:kc,kebab:h$,fromPascal:rx,fromCamel:sx,fromKebab:tx,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var sp=tf;function tf(n,i){let o=JY(n,i),c=o.no_subscribe||Z$(tf,{...o}),p=!1,x=ki(),m=ki(),f=ki(),a=ki(),$=ki(),v=ki(),A=ki(),J=ki(),S={connecting:m,reserved:f,closed:a,ended:$,open:v,busy:A,full:J},W=[...Array(o.max)].map(()=>k$(o,S,{onopen:Bi,onend:dn,onclose:Uo})),R=K(j);return Object.assign(R,{get parameters(){return o.parameters},largeObject:q$.bind(null,R),subscribe:c,CLOSE:Zp,END:Zp,PostgresError:qp,options:o,reserve:h,listen:z,begin:G,close:Z,end:an}),R;function K(E){return E.debug=o.debug,Object.entries(o.types).reduce((vn,[Vn,rn])=>{return vn[Vn]=(Cn)=>new Eo(Cn,rn.to),vn},q),Object.assign(Rn,{types:q,typed:q,unsafe:Ln,notify:M,array:Q,json:O,file:en}),Rn;function q(vn,Vn){return new Eo(vn,Vn)}function Rn(vn,...Vn){return vn&&Array.isArray(vn.raw)?new oo(vn,Vn,E,l):typeof vn==="string"&&!Vn.length?new gx(o.transform.column.to?o.transform.column.to(vn):vn):new kf(vn,Vn)}function Ln(vn,Vn=[],rn={}){return arguments.length===2&&!Array.isArray(Vn)&&(rn=Vn,Vn=[]),new oo([vn],Vn,E,l,{prepare:!1,...rn,simple:"simple"in rn?rn.simple:Vn.length===0})}function en(vn,Vn=[],rn={}){return arguments.length===2&&!Array.isArray(Vn)&&(rn=Vn,Vn=[]),new oo([],Vn,(jn)=>{AY.readFile(vn,"utf8",(Fi,_n)=>{if(Fi)return jn.reject(Fi);jn.strings=[_n],E(jn)})},l,{...rn,simple:"simple"in rn?rn.simple:Vn.length===0})}}async function z(E,q,Rn){let Ln={fn:q,onlisten:Rn},en=z.sql||(z.sql=tf({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(z.channels).forEach(([jn,{listeners:Fi}])=>{delete z.channels[jn],Promise.all(Fi.map((_n)=>z(jn,_n.fn,_n.onlisten).catch(()=>{})))})},onnotify(jn,Fi){jn in z.channels&&z.channels[jn].listeners.forEach((_n)=>_n.fn(Fi))}})),vn=z.channels||(z.channels={});if(E in vn){vn[E].listeners.push(Ln);let jn=await vn[E].result;return Ln.onlisten&&Ln.onlisten(),{state:jn.state,unlisten:Cn}}vn[E]={result:en`listen ${en.unsafe('"'+E.replace(/"/g,'""')+'"')}`,listeners:[Ln]};let rn=await vn[E].result;return Ln.onlisten&&Ln.onlisten(),{state:rn.state,unlisten:Cn};async function Cn(){if(E in vn===!1)return;if(vn[E].listeners=vn[E].listeners.filter((jn)=>jn!==Ln),vn[E].listeners.length)return;return delete vn[E],en`unlisten ${en.unsafe('"'+E.replace(/"/g,'""')+'"')}`}}async function M(E,q){return await R`select pg_notify(${E}, ${""+q})`}async function h(){let E=ki(),q=v.length?v.shift():await new Promise((en)=>{x.push({reserve:en}),a.length&&Qn(a.shift())});H(q,f),q.reserved=()=>E.length?q.execute(E.shift()):H(q,f),q.reserved.release=!0;let Rn=K(Ln);return Rn.release=()=>{q.reserved=null,Bi(q)},Rn;function Ln(en){q.queue===J?E.push(en):q.execute(en)||H(q,J)}}async function G(E,q){!q&&(q=E,E="");let Rn=ki(),Ln=0,en,vn=null;try{return await R.unsafe("begin "+E.replace(/[^a-z ]/ig,""),[],{onexecute:rn}).execute(),await Promise.race([Vn(en,q),new Promise((Cn,jn)=>en.onclose=jn)])}catch(Cn){throw Cn}async function Vn(Cn,jn,Fi){let _n=K(ni);_n.savepoint=Io,_n.prepare=(bn)=>vn=bn.replace(/[^a-z0-9$-_. ]/gi);let co,Ri;Fi&&await _n`savepoint ${_n(Fi)}`;try{if(Ri=await new Promise((bn,po)=>{let Xo=jn(_n);Promise.resolve(Array.isArray(Xo)?Promise.all(Xo):Xo).then(bn,po)}),co)throw co}catch(bn){throw await(Fi?_n`rollback to ${_n(Fi)}`:_n`rollback`),bn instanceof qp&&bn.code==="25P02"&&co||bn}if(!Fi)vn?await _n`prepare transaction '${_n.unsafe(vn)}'`:await _n`commit`;return Ri;function Io(bn,po){if(bn&&Array.isArray(bn.raw))return Io((Xo)=>Xo.apply(Xo,arguments));return arguments.length===1&&(po=bn,bn=null),Vn(Cn,po,"s"+Ln+++(bn?"_"+bn:""))}function ni(bn){bn.catch((po)=>co||(co=po)),Cn.queue===J?Rn.push(bn):Cn.execute(bn)||H(Cn,J)}}function rn(Cn){en=Cn,H(Cn,f),Cn.reserved=()=>Rn.length?Cn.execute(Rn.shift()):H(Cn,f)}}function H(E,q){return E.queue.remove(E),q.push(E),E.queue=q,q===v?E.idleTimer.start():E.idleTimer.cancel(),E}function O(E){return new Eo(E,3802)}function Q(E,q){if(!Array.isArray(E))return Q(Array.from(arguments));return new Eo(E,q||(E.length?If(E)||25:0),o.shared.typeArrayMap)}function j(E){if(p)return E.reject(gn.connection("CONNECTION_ENDED",o,o));if(v.length)return y(v.shift(),E);if(a.length)return Qn(a.shift(),E);A.length?y(A.shift(),E):x.push(E)}function y(E,q){return E.execute(q)?H(E,A):H(E,J)}function l(E){return new Promise((q,Rn)=>{E.state?E.active?k$(o).cancel(E.state,q,Rn):E.cancelled={resolve:q,reject:Rn}:(x.remove(E),E.cancelled=!0,E.reject(gn.generic("57014","canceling statement due to user request")),q())})}async function an({timeout:E=null}={}){if(p)return p;await 1;let q;return p=Promise.race([new Promise((Rn)=>E!==null&&(q=setTimeout($n,E*1000,Rn))),Promise.all(W.map((Rn)=>Rn.end()).concat(z.sql?z.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(q))}async function Z(){await Promise.all(W.map((E)=>E.end()))}async function $n(E){await Promise.all(W.map((q)=>q.terminate()));while(x.length)x.shift().reject(gn.connection("CONNECTION_DESTROYED",o));E()}function Qn(E,q){return H(E,m),E.connect(q),E}function dn(E){H(E,$)}function Bi(E){if(x.length===0)return H(E,v);let q=Math.ceil(x.length/(m.length+1)),Rn=!0;while(Rn&&x.length&&q-- >0){let Ln=x.shift();if(Ln.reserve)return Ln.reserve(E);Rn=E.execute(Ln)}Rn?H(E,A):H(E,J)}function Uo(E,q){H(E,a),E.reserved=null,E.onclose&&(E.onclose(q),E.onclose=null),o.onclose&&o.onclose(E.id),x.length&&Qn(E,x.shift())}}function JY(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,[S,W])=>(J[S]=W,J),{}),f=c.hostname||c.host||x||p.hostname||o.PGHOST||"localhost",a=c.port||p.port||o.PGPORT||5432,$=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||WY();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 v=["idle_timeout","connect_timeout","max_lifetime","max_pipeline","backoff","keep_alive"],A={max:10,ssl:!1,idle_timeout:null,connect_timeout:30,max_lifetime:FY,max_pipeline:100,backoff:TY,keep_alive:60,prepare:!0,debug:!1,fetch_types:!0,publications:"alltables",target_session_attrs:null};return{host:Array.isArray(f)?f:f.split(",").map((J)=>J.split(":")[0]),port:Array.isArray(a)?a:f.split(",").map((J)=>parseInt(J.split(":")[1]||a)),path:c.path||f.indexOf("/")>-1&&f+"/.s.PGSQL."+a,database:c.database||c.db||(p.pathname||"").slice(1)||o.PGDATABASE||$,user:$,pass:c.pass||c.password||p.password||o.PGPASSWORD||"",...Object.entries(A).reduce((J,[S,W])=>{let R=S in c?c[S]:(S in m)?m[S]==="disable"||m[S]==="false"?!1:m[S]:o["PG"+S.toUpperCase()]||W;return J[S]=typeof R==="string"&&v.includes(S)?+R:R,J},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(m).reduce((J,[S,W])=>((S in A)||(J[S]=W),J),{})},types:c.types||{},target_session_attrs:wY(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:RY(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...RS(c.types)}}function wY(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 TY(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function FY(){return 60*(30+Math.random()*30)}function RY(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 WY(){try{return vY.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=(Y(n,xi)?n._.selectedFields:Y(n,ji)?n[Bn].selectedFields:n)[i];if(Y(c,N.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(Y(c,N)){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(Y(c,En)){if(this.config.alias)return new Proxy(c,new Fp(new Proxy(c.table,new Hx(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 gf 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[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=gi(n),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:n,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(n){return Un.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 Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:ai(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}function XY(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((o)=>o.toLowerCase()).join("_")}function KY(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"?XY:n==="camelCase"?KY:GY}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 ex extends ji{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`
|
|
81
|
+
`};return c(a),new Promise(async(w)=>m=w);async function v({highWaterMark:w=16384,start:J=0,end:X=1/0}={}){let W=X-J;return J&&await a.seek(J),new OR.Readable({highWaterMark:w,async read(R){let S=R>W?R-W:R;W-=R;let[{data:H}]=await a.read(S);if(this.push(H),H.length<R)this.push(null)}})}async function $({highWaterMark:w=16384,start:J=0}={}){return J&&await a.seek(J),new OR.Writable({highWaterMark:w,write(X,W,R){a.write(X).then(()=>R(),R)}})}}).catch(p)})}Object.assign(tf,{PostgresError:sp,toPascal:kc,pascal:C0,toCamel:yc,camel:N0,toKebab:Zc,kebab:h0,fromPascal:rx,fromCamel:sx,fromKebab:tx,BigInt:{to:20,from:[20],parse:(n)=>BigInt(n),serialize:(n)=>n.toString()}});var tp=tf;function tf(n,i){let o=J2(n,i),c=o.no_subscribe||Z0(tf,{...o}),p=!1,x=yi(),m=yi(),f=yi(),a=yi(),v=yi(),$=yi(),w=yi(),J=yi(),X={connecting:m,reserved:f,closed:a,ended:v,open:$,busy:w,full:J},W=[...Array(o.max)].map(()=>k0(o,X,{onopen:_i,onend:gn,onclose:Oo})),R=S(j);return Object.assign(R,{get parameters(){return o.parameters},largeObject:q0.bind(null,R),subscribe:c,CLOSE:Pp,END:Pp,PostgresError:sp,options:o,reserve:I,listen:H,begin:Y,close:Z,end:fn}),R;function S(O){return O.debug=o.debug,Object.entries(o.types).reduce((vn,[_n,sn])=>{return vn[_n]=(Cn)=>new Eo(Cn,sn.to),vn},q),Object.assign(Rn,{types:q,typed:q,unsafe:Dn,notify:M,array:Q,json:E,file:dn}),Rn;function q(vn,_n){return new Eo(vn,_n)}function Rn(vn,..._n){return vn&&Array.isArray(vn.raw)?new io(vn,_n,O,z):typeof vn==="string"&&!_n.length?new gx(o.transform.column.to?o.transform.column.to(vn):vn):new kf(vn,_n)}function Dn(vn,_n=[],sn={}){return arguments.length===2&&!Array.isArray(_n)&&(sn=_n,_n=[]),new io([vn],_n,O,z,{prepare:!1,...sn,simple:"simple"in sn?sn.simple:_n.length===0})}function dn(vn,_n=[],sn={}){return arguments.length===2&&!Array.isArray(_n)&&(sn=_n,_n=[]),new io([],_n,(bn)=>{w2.readFile(vn,"utf8",(Ti,Bn)=>{if(Ti)return bn.reject(Ti);bn.strings=[Bn],O(bn)})},z,{...sn,simple:"simple"in sn?sn.simple:_n.length===0})}}async function H(O,q,Rn){let Dn={fn:q,onlisten:Rn},dn=H.sql||(H.sql=tf({...o,max:1,idle_timeout:null,max_lifetime:null,fetch_types:!1,onclose(){Object.entries(H.channels).forEach(([bn,{listeners:Ti}])=>{delete H.channels[bn],Promise.all(Ti.map((Bn)=>H(bn,Bn.fn,Bn.onlisten).catch(()=>{})))})},onnotify(bn,Ti){bn in H.channels&&H.channels[bn].listeners.forEach((Bn)=>Bn.fn(Ti))}})),vn=H.channels||(H.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:Cn}}vn[O]={result:dn`listen ${dn.unsafe('"'+O.replace(/"/g,'""')+'"')}`,listeners:[Dn]};let sn=await vn[O].result;return Dn.onlisten&&Dn.onlisten(),{state:sn.state,unlisten:Cn};async function Cn(){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],dn`unlisten ${dn.unsafe('"'+O.replace(/"/g,'""')+'"')}`}}async function M(O,q){return await R`select pg_notify(${O}, ${""+q})`}async function I(){let O=yi(),q=$.length?$.shift():await new Promise((dn)=>{x.push({reserve:dn}),a.length&&En(a.shift())});l(q,f),q.reserved=()=>O.length?q.execute(O.shift()):l(q,f),q.reserved.release=!0;let Rn=S(Dn);return Rn.release=()=>{q.reserved=null,_i(q)},Rn;function Dn(dn){q.queue===J?O.push(dn):q.execute(dn)||l(q,J)}}async function Y(O,q){!q&&(q=O,O="");let Rn=yi(),Dn=0,dn,vn=null;try{return await R.unsafe("begin "+O.replace(/[^a-z ]/ig,""),[],{onexecute:sn}).execute(),await Promise.race([_n(dn,q),new Promise((Cn,bn)=>dn.onclose=bn)])}catch(Cn){throw Cn}async function _n(Cn,bn,Ti){let Bn=S(en);Bn.savepoint=ho,Bn.prepare=(Ln)=>vn=Ln.replace(/[^a-z0-9$-_. ]/gi);let oo,Fi;Ti&&await Bn`savepoint ${Bn(Ti)}`;try{if(Fi=await new Promise((Ln,co)=>{let Xo=bn(Bn);Promise.resolve(Array.isArray(Xo)?Promise.all(Xo):Xo).then(Ln,co)}),oo)throw oo}catch(Ln){throw await(Ti?Bn`rollback to ${Bn(Ti)}`:Bn`rollback`),Ln instanceof sp&&Ln.code==="25P02"&&oo||Ln}if(!Ti)vn?await Bn`prepare transaction '${Bn.unsafe(vn)}'`:await Bn`commit`;return Fi;function ho(Ln,co){if(Ln&&Array.isArray(Ln.raw))return ho((Xo)=>Xo.apply(Xo,arguments));return arguments.length===1&&(co=Ln,Ln=null),_n(Cn,co,"s"+Dn+++(Ln?"_"+Ln:""))}function en(Ln){Ln.catch((co)=>oo||(oo=co)),Cn.queue===J?Rn.push(Ln):Cn.execute(Ln)||l(Cn,J)}}function sn(Cn){dn=Cn,l(Cn,f),Cn.reserved=()=>Rn.length?Cn.execute(Rn.shift()):l(Cn,f)}}function l(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?If(O)||25:0),o.shared.typeArrayMap)}function j(O){if(p)return O.reject(tn.connection("CONNECTION_ENDED",o,o));if($.length)return y($.shift(),O);if(a.length)return En(a.shift(),O);w.length?y(w.shift(),O):x.push(O)}function y(O,q){return O.execute(q)?l(O,w):l(O,J)}function z(O){return new Promise((q,Rn)=>{O.state?O.active?k0(o).cancel(O.state,q,Rn):O.cancelled={resolve:q,reject:Rn}:(x.remove(O),O.cancelled=!0,O.reject(tn.generic("57014","canceling statement due to user request")),q())})}async function fn({timeout:O=null}={}){if(p)return p;await 1;let q;return p=Promise.race([new Promise((Rn)=>O!==null&&(q=setTimeout(an,O*1000,Rn))),Promise.all(W.map((Rn)=>Rn.end()).concat(H.sql?H.sql.end({timeout:0}):[],c.sql?c.sql.end({timeout:0}):[]))]).then(()=>clearTimeout(q))}async function Z(){await Promise.all(W.map((O)=>O.end()))}async function an(O){await Promise.all(W.map((q)=>q.terminate()));while(x.length)x.shift().reject(tn.connection("CONNECTION_DESTROYED",o));O()}function En(O,q){return l(O,m),O.connect(q),O}function gn(O){l(O,v)}function _i(O){if(x.length===0)return l(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?l(O,w):l(O,J)}function Oo(O,q){l(O,a),O.reserved=null,O.onclose&&(O.onclose(q),O.onclose=null),o.onclose&&o.onclose(O.id),x.length&&En(O,x.shift())}}function J2(n,i){if(n&&n.shared)return n;let o=process.env,c=(!n||typeof n==="string"?i:n)||{},{url:p,multihost:x}=X2(n),m=[...p.searchParams].reduce((J,[X,W])=>(J[X]=W,J),{}),f=c.hostname||c.host||x||p.hostname||o.PGHOST||"localhost",a=c.port||p.port||o.PGPORT||5432,v=c.user||c.username||p.username||o.PGUSERNAME||o.PGUSER||W2();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:F2,max_pipeline:100,backoff:T2,keep_alive:60,prepare:!0,debug:!1,fetch_types:!0,publications:"alltables",target_session_attrs:null};return{host:Array.isArray(f)?f:f.split(",").map((J)=>J.split(":")[0]),port:Array.isArray(a)?a:f.split(",").map((J)=>parseInt(J.split(":")[1]||a)),path:c.path||f.indexOf("/")>-1&&f+"/.s.PGSQL."+a,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,[X,W])=>{let R=X in c?c[X]:(X in m)?m[X]==="disable"||m[X]==="false"?!1:m[X]:o["PG"+X.toUpperCase()]||W;return J[X]=typeof R==="string"&&$.includes(X)?+R:R,J},{}),connection:{application_name:"postgres.js",...c.connection,...Object.entries(m).reduce((J,[X,W])=>((X in w)||(J[X]=W),J),{})},types:c.types||{},target_session_attrs:A2(c,p,o),onnotice:c.onnotice,onnotify:c.onnotify,onclose:c.onclose,onparameter:c.onparameter,socket:c.socket,transform:R2(c.transform||{undefined:void 0}),parameters:{},shared:{retries:0,typeArrayMap:{}},...WR(c.types)}}function A2(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 T2(n){return(0.5+Math.random()/2)*Math.min(3**n/100,20)}function F2(){return 60*(30+Math.random()*30)}function R2(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 X2(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 W2(){try{return $2.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===jn)return{...n[jn],selectedFields:new Proxy(n[jn].selectedFields,this)};if(typeof i==="symbol")return n[i];let c=(G(n,pi)?n._.selectedFields:G(n,Bi)?n[jn].selectedFields:n)[i];if(G(c,N.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!c.isSelectionField)return c.sql;let p=c.clone();return p.isSelectionField=!0,p}if(G(c,N)){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(G(c,Un)){if(this.config.alias)return new Proxy(c,new Xp(new Proxy(c.table,new lx(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 gf 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[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=ti(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:fi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}function K2(n){return(n.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((o)=>o.toLowerCase()).join("_")}function S2(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 G2(n){return n}class P0{static[T]="CasingCache";cache={};cachedTables={};convert;constructor(n){this.convert=n==="snake_case"?K2:n==="camelCase"?S2:G2}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 ex extends Bi{static[T]="PgViewBase"}class Pc{static[T]="PgDialect";casing;constructor(n){this.casing=new P0(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
82
|
CREATE TABLE IF NOT EXISTS ${F.identifier(p)}.${F.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 f=(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(a)=>{for await(let $ of n)if(!f||Number(f.created_at)<$.folderMillis){for(let v of $.sql)await a.execute(F.raw(v));await a.execute(F`insert into ${F.identifier(p)}.${F.identifier(c)} ("hash", "created_at") values(${$.hash}, ${$.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[D.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 f=o[x],a=i[x]??F.param(f.onUpdateFn(),f),$=F`${F.identifier(this.casing.getColumnCasing(f))} = ${a}`;if(m<p-1)return[$,F.raw(", ")];return[$]}))}buildUpdateQuery({table:n,set:i,where:o,returning:c,withList:p,from:x,joins:m}){let f=this.buildWithCTE(p),a=n[Ti.Symbol.Name],$=n[Ti.Symbol.Schema],v=n[Ti.Symbol.OriginalName],A=a===v?void 0:a,J=F`${$?F`${F.identifier($)}.`:void 0}${F.identifier(v)}${A&&F` ${F.identifier(A)}`}`,S=this.buildUpdateSet(n,i),W=x&&F.join([F.raw(" from "),this.buildFromTable(x)]),R=this.buildJoins(m),K=c?F` returning ${this.buildSelection(c,{isSingleTable:!x})}`:void 0,z=o?F` where ${o}`:void 0;return F`${f}update ${J} set ${S}${W}${R}${z}${K}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},x)=>{let m=[];if(Y(p,N.Aliased)&&p.isSelectionField)m.push(F.identifier(p.fieldAlias));else if(Y(p,N.Aliased)||Y(p,N)){let f=Y(p,N.Aliased)?p.sql:p;if(i)m.push(new N(f.queryChunks.map((a)=>{if(Y(a,V))return F.identifier(this.casing.getColumnCasing(a));return a})));else m.push(f);if(Y(p,N.Aliased))m.push(F` as ${F.identifier(p.fieldAlias)}`)}else if(Y(p,En))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(Y(p,Ti)){let m=p[Ti.Symbol.Name],f=p[Ti.Symbol.Schema],a=p[Ti.Symbol.OriginalName],$=m===a?void 0:c.alias;i.push(F`${F.raw(c.joinType)} join${x} ${f?F`${F.identifier(f)}.`:void 0}${F.identifier(a)}${$&&F` ${F.identifier($)}`} on ${c.on}`)}else if(Y(p,ji)){let m=p[Bn].name,f=p[Bn].schema,a=p[Bn].originalName,$=m===a?void 0:c.alias;i.push(F`${F.raw(c.joinType)} join${x} ${f?F`${F.identifier(f)}.`:void 0}${F.identifier(a)}${$&&F` ${F.identifier($)}`} 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(Y(n,D)&&n[D.Symbol.OriginalName]!==n[D.Symbol.Name]){let i=F`${F.identifier(n[D.Symbol.OriginalName])}`;if(n[D.Symbol.Schema])i=F`${F.identifier(n[D.Symbol.Schema])}.${i}`;return F`${i} ${F.identifier(n[D.Symbol.Name])}`}return n}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:x,joins:m,orderBy:f,groupBy:a,limit:$,offset:v,lockingClause:A,distinct:J,setOperators:S}){let W=o??gi(i);for(let $n of W)if(Y($n.field,En)&&ai($n.field.table)!==(Y(x,xi)?x._.alias:Y(x,ex)?x[Bn].name:Y(x,N)?void 0:ai(x))&&!((Qn)=>m?.some(({alias:dn})=>dn===(Qn[D.Symbol.IsAlias]?ai(Qn):Qn[D.Symbol.BaseName])))($n.field.table)){let Qn=ai($n.field.table);throw new Error(`Your "${$n.path.join("->")}" field references a column "${Qn}"."${$n.field.name}", but the table "${Qn}" is not part of the query! Did you forget to join it?`)}let R=!m||m.length===0,K=this.buildWithCTE(n),z;if(J)z=J===!0?F` distinct`:F` distinct on (${F.join(J.on,F`, `)})`;let M=this.buildSelection(W,{isSingleTable:R}),h=this.buildFromTable(x),G=this.buildJoins(m),H=c?F` where ${c}`:void 0,O=p?F` having ${p}`:void 0,Q;if(f&&f.length>0)Q=F` order by ${F.join(f,F`, `)}`;let j;if(a&&a.length>0)j=F` group by ${F.join(a,F`, `)}`;let y=typeof $==="object"||typeof $==="number"&&$>=0?F` limit ${$}`:void 0,l=v?F` offset ${v}`:void 0,an=F.empty();if(A){let $n=F` for ${F.raw(A.strength)}`;if(A.config.of)$n.append(F` of ${F.join(Array.isArray(A.config.of)?A.config.of:[A.config.of],F`, `)}`);if(A.config.noWait)$n.append(F` no wait`);else if(A.config.skipLocked)$n.append(F` skip locked`);an.append($n)}let Z=F`${K}select${z} ${M} from ${h}${G}${H}${j}${O}${Q}${y}${l}${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 f=F`(${n.getSQL()}) `,a=F`(${c.getSQL()})`,$;if(x&&x.length>0){let S=[];for(let W of x)if(Y(W,V))S.push(F.identifier(W.name));else if(Y(W,N)){for(let R=0;R<W.queryChunks.length;R++){let K=W.queryChunks[R];if(Y(K,V))W.queryChunks[R]=F.identifier(K.name)}S.push(F`${W}`)}else S.push(F`${W}`);$=F` order by ${F.join(S,F`, `)} `}let v=typeof p==="object"||typeof p==="number"&&p>=0?F` limit ${p}`:void 0,A=F.raw(`${i} ${o?"all ":""}`),J=m?F` offset ${m}`:void 0;return F`${f}${A}${a}${$}${v}${J}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p,select:x,overridingSystemValue_:m}){let f=[],a=n[D.Symbol.Columns],$=Object.entries(a).filter(([K,z])=>!z.shouldDisableInsert()),v=$.map(([,K])=>F.identifier(this.casing.getColumnCasing(K)));if(x){let K=i;if(Y(K,N))f.push(K);else f.push(K.getSQL())}else{let K=i;f.push(F.raw("values "));for(let[z,M]of K.entries()){let h=[];for(let[G,H]of $){let O=M[G];if(O===void 0||Y(O,Ni)&&O.value===void 0)if(H.defaultFn!==void 0){let Q=H.defaultFn(),j=Y(Q,N)?Q:F.param(Q,H);h.push(j)}else if(!H.default&&H.onUpdateFn!==void 0){let Q=H.onUpdateFn(),j=Y(Q,N)?Q:F.param(Q,H);h.push(j)}else h.push(F`default`);else h.push(O)}if(f.push(h),z<K.length-1)f.push(F`, `)}}let A=this.buildWithCTE(p),J=F.join(f),S=c?F` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,W=o?F` on conflict ${o}`:void 0,R=m===!0?F`overriding system value `:void 0;return F`${A}insert into ${n} ${v} ${R}${J}${W}${S}`}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(Y(n,nf)||Y(n,em))return"json";else if(Y(n,of))return"decimal";else if(Y(n,cf))return"time";else if(Y(n,pf)||Y(n,xf))return"timestamp";else if(Y(n,tm)||Y(n,gm))return"date";else if(Y(n,mf))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:f,joinOn:a}){let $=[],v,A,J=[],S,W=[];if(x===!0)$=Object.entries(p.columns).map(([z,M])=>({dbKey:M.name,tsKey:z,field:Mo(M,m),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let K=Object.fromEntries(Object.entries(p.columns).map(([O,Q])=>[O,Mo(Q,m)]));if(x.where){let O=typeof x.where==="function"?x.where(K,gT()):x.where;S=O&&Qx(O,m)}let z=[],M=[];if(x.columns){let O=!1;for(let[Q,j]of Object.entries(x.columns)){if(j===void 0)continue;if(Q in p.columns){if(!O&&j===!0)O=!0;M.push(Q)}}if(M.length>0)M=O?M.filter((Q)=>x.columns?.[Q]===!0):Object.keys(p.columns).filter((Q)=>!M.includes(Q))}else M=Object.keys(p.columns);for(let O of M){let Q=p.columns[O];z.push({tsKey:O,value:Q})}let h=[];if(x.with)h=Object.entries(x.with).filter((O)=>!!O[1]).map(([O,Q])=>({tsKey:O,queryConfig:Q,relation:p.relations[O]}));let G;if(x.extras){G=typeof x.extras==="function"?x.extras(K,{sql:F}):x.extras;for(let[O,Q]of Object.entries(G))z.push({tsKey:O,value:K0(Q,m)})}for(let{tsKey:O,value:Q}of z)$.push({dbKey:Y(Q,N.Aliased)?Q.fieldAlias:p.columns[O].name,tsKey:O,field:Y(Q,En)?Mo(Q,m):Q,relationTableTsKey:void 0,isJson:!1,selection:[]});let H=typeof x.orderBy==="function"?x.orderBy(K,dT()):x.orderBy??[];if(!Array.isArray(H))H=[H];J=H.map((O)=>{if(Y(O,En))return Mo(O,m);return Qx(O,m)}),v=x.limit,A=x.offset;for(let{tsKey:O,queryConfig:Q,relation:j}of h){let y=nF(i,o,j),l=Qc(j.referencedTable),an=o[l],Z=`${m}_${O}`,$n=Oc(...y.fields.map((Bi,Uo)=>lo(Mo(y.references[Uo],Z),Mo(Bi,m)))),Qn=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[an],tableConfig:i[an],queryConfig:Y(j,xc)?Q===!0?{limit:1}:{...Q,limit:1}:Q,tableAlias:Z,joinOn:$n,nestedQueryRelation:j}),dn=F`${F.identifier(Z)}.${F.identifier("data")}`.as(O);W.push({on:F`true`,table:new xi(Qn.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),$.push({dbKey:O,tsKey:O,field:dn,relationTableTsKey:an,isJson:!0,selection:Qn.selection})}}if($.length===0)throw new Pm({message:`No fields selected for table "${p.tsName}" ("${m}")`});let R;if(S=Oc(a,S),f){let K=F`json_build_array(${F.join($.map(({field:h,tsKey:G,isJson:H})=>H?F`${F.identifier(`${m}_${G}`)}.${F.identifier("data")}`:Y(h,N.Aliased)?h.sql:h),F`, `)})`;if(Y(f,Vx))K=F`coalesce(json_agg(${K}${J.length>0?F` order by ${F.join(J,F`, `)}`:void 0}), '[]'::json)`;let z=[{dbKey:"data",tsKey:"data",field:K.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:$}];if(v!==void 0||A!==void 0||J.length>0)R=this.buildSelectQuery({table:qm(c,m),fields:{},fieldsFlat:[{path:[],field:F.raw("*")}],where:S,limit:v,offset:A,orderBy:J,setOperators:[]}),S=void 0,v=void 0,A=void 0,J=[];else R=qm(c,m);R=this.buildSelectQuery({table:Y(R,Ti)?R:new xi(R,{},m),fields:{},fieldsFlat:z.map(({field:h})=>({path:[],field:Y(h,En)?Mo(h,m):h})),joins:W,where:S,limit:v,offset:A,orderBy:J,setOperators:[]})}else R=this.buildSelectQuery({table:qm(c,m),fields:{},fieldsFlat:$.map(({field:K})=>({path:[],field:Y(K,En)?Mo(K,m):K})),joins:W,where:S,limit:v,offset:A,orderBy:J,setOperators:[]});return{tableTsKey:p.tsName,sql:R,selection:$}}}class s${static[T]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}class _i{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(Y(o,xi))c=Object.fromEntries(Object.keys(o._.selectedFields).map((p)=>[p,o[p]]));else if(Y(o,ex))c=o[Bn].selectedFields;else if(Y(o,N))c={};else c=iw(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 OS extends s${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=jo(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}createJoin(n){return(i,o)=>{let c=this.tableName,p=jo(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"&&!Y(i,N)){let x=Y(i,xi)?i._.selectedFields:Y(i,ji)?i[Bn].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(YY()):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 xi(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 OS{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 Un.startActiveSpan("drizzle.prepareQuery",()=>{let m=gi(o.fields),f=i.prepareQuery(c.sqlToQuery(this.getSQL()),m,n,!0);return f.joinsNotNullableMap=p,f.setToken(x)})}prepare(n){return this._prepare(n)}authToken;setToken(n){return this.authToken=n,this}execute=(n)=>{return Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}nw(r$,[Ei]);function rp(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 YY=()=>({union:zY,unionAll:MY,intersect:lY,intersectAll:HY,except:QY,exceptAll:OY}),zY=rp("union",!1),MY=rp("union",!0),lY=rp("intersect",!1),HY=rp("intersect",!0),QY=rp("except",!1),OY=rp("except",!0);class nm{static[T]="PgQueryBuilder";dialect;dialectConfig;constructor(n){this.dialect=Y(n,qc)?n:void 0,this.dialectConfig=Y(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 _i({fields:x??void 0,session:void 0,dialect:i.getDialect(),withList:n})}function c(x){return new _i({fields:x??void 0,session:void 0,dialect:i.getDialect(),distinct:!0})}function p(x,m){return new _i({fields:m??void 0,session:void 0,dialect:i.getDialect(),distinct:{on:x}})}return{select:o,selectDistinct:c,selectDistinctOn:p}}select(n){return new _i({fields:n??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(n){return new _i({fields:n??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(n,i){return new _i({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 df{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[D.Symbol.Columns];for(let x of Object.keys(o)){let m=o[x];c[x]=Y(m,N)?m:new Ni(m,p[x])}return c});return new t$(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(!Y(i,N)&&!Ox(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 t$(this.table,i,this.session,this.dialect,this.withList,!0)}}class t$ 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[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=gi(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,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=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 Un.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 Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})};getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new kn({alias:ai(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class g$ 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 Un.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 Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(n,this.authToken)})}}class ef{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 ES(this.table,rm(this.table,n),this.session,this.dialect,this.withList).setToken(this.authToken)}}class ES 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=jo(n),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{}}static[T]="PgUpdate";config;tableName;joinsNotNullableMap;from(n){let i=n,o=jo(i);if(typeof o==="string")this.joinsNotNullableMap[o]=!0;return this.config.from=i,this}getTableLikeFields(n){if(Y(n,Ti))return n[D.Symbol.Columns];else if(Y(n,xi))return n._.selectedFields;return n[Bn].selectedFields}createJoin(n){return(i,o)=>{let c=jo(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&&!Y(this.config.from,N)?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=jo(this.config.from);if(typeof i==="string"&&this.config.from&&!Y(this.config.from,N)){let o=this.getTableLikeFields(this.config.from);n[i]=o}for(let o of this.config.joins){let c=jo(o.table);if(typeof c==="string"&&!Y(o.table,N)){let p=this.getTableLikeFields(o.table);n[c]=p}}}}return this.config.returningFields=n,this.config.returning=gi(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:ai(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class im extends N{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 e${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 d$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new d$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class d$ extends Ei{constructor(n,i,o,c,p,x,m,f,a){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m,this.config=f,this.mode=a}static[T]="PgRelationalQuery";_prepare(n){return Un.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)=>ff(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 Un.startActiveSpan("drizzle.operation",()=>{return this._prepare().execute(void 0,this.authToken)})}}class n1 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 e$(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(a){return new _i({fields:a??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(a){return new _i({fields:a??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(a,$){return new _i({fields:$??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:a}})}function x(a){return new ef(a,i.session,i.dialect,n)}function m(a){return new df(a,i.session,i.dialect,n)}function f(a){return new gf(a,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:x,insert:m,delete:f}}select(n){return new _i({fields:n??void 0,session:this.session,dialect:this.dialect})}selectDistinct(n){return new _i({fields:n??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(n,i){return new _i({fields:i??void 0,session:this.session,dialect:this.dialect,distinct:{on:n}})}update(n){return new ef(n,this.session,this.dialect)}insert(n){return new df(n,this.session,this.dialect)}delete(n){return new gf(n,this.session,this.dialect)}refreshMaterializedView(n){return new g$(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 n1(()=>c.execute(void 0,this.authToken),i,o,(p)=>c.mapResult(p,!0))}transaction(n,i){return this.session.transaction(n,i)}}class US{constructor(n,i){this.unique=n,this.name=i}static[T]="PgIndexBuilderOn";on(...n){return new na(n.map((i)=>{if(Y(i,N))return i;i=i;let o=new zx(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 na(n.map((i)=>{if(Y(i,N))return i;i=i;let o=new zx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new na(i.map((o)=>{if(Y(o,N))return o;o=o;let c=new zx(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 na{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 VS(this.config,n)}}class VS{static[T]="PgIndex";config;constructor(n,i){this.config={...n,table:i}}}function i1(n){return new US(!0,n)}class o1{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 c1{constructor(n){this.dialect=n}static[T]="PgSession";execute(n,i){return Un.startActiveSpan("drizzle.operation",()=>{return Un.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 p1 extends om{constructor(n,i,o,c=0){super(n,i,o);this.schema=o,this.nestedIndex=c}static[T]="PgTransaction";rollback(){throw new G0}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 _S extends o1{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 Un.startActiveSpan("drizzle.execute",async(i)=>{let o=X0(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:f}=this;if(!c&&!f)return Un.startActiveSpan("drizzle.driver.execute",()=>{return x.unsafe(p,o)});let a=await Un.startActiveSpan("drizzle.driver.execute",()=>{return i?.setAttributes({"drizzle.query.text":p,"drizzle.query.params":JSON.stringify(o)}),x.unsafe(p,o).values()});return Un.startActiveSpan("drizzle.mapResponse",()=>{return f?f(a):a.map(($)=>eJ(c,$,m))})})}all(n={}){return Un.startActiveSpan("drizzle.execute",async(i)=>{let o=X0(this.params,n);return i?.setAttributes({"drizzle.query.text":this.queryString,"drizzle.query.params":JSON.stringify(o)}),this.logger.logQuery(this.queryString,o),Un.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 c1{constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new z0}static[T]="PostgresJsSession";logger;prepareQuery(n,i,o,c,p){return new _S(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 x1(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class x1 extends p1{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 x1(this.dialect,o,this.schema);return n(c)})}}class BS extends om{static[T]="PostgresJsDatabase"}function tp(n,i={}){let o=(a)=>a;for(let a of["1184","1082","1083","1114"])n.options.parsers[a]=o,n.options.serializers[a]=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 Y0;else if(i.logger!==!1)p=i.logger;let x;if(i.schema){let a=eT(i.schema,iF);x={fullSchema:i.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}let m=new cm(n,c,x,{logger:p}),f=new BS(c,m,x);return f.$client=n,f}function ia(...n){if(typeof n[0]==="string"){let i=sp(n[0]);return tp(i,n[1])}if(ow(n[0])){let{connection:i,client:o,...c}=n[0];if(o)return tp(o,c);if(typeof i==="object"&&i.url!==void 0){let{url:x,...m}=i,f=sp(x,m);return tp(f,c)}let p=sp(i);return tp(p,c)}return tp(n[0],n[1])}((n)=>{function i(o){return tp({options:{parsers:{},serializers:{}}},o)}n.mock=i})(ia||(ia={}));var f1={};r6(f1,{users:()=>Wo,userChanges:()=>UY,untrackedUserColumnNames:()=>EY,twoFactorMethod:()=>NS,trackedUserColumnName:()=>DS,trackableUserColumnNames:()=>LS,role:()=>bS,players:()=>m1,passwordResetAttempts:()=>VY,loginHistory:()=>gp,games:()=>oa,banishedIps:()=>ca});function jS(n){return F`lower(${n})`}var bS=Im("role",["admin","user"]),Wo=pc("users",{id:Ci().primaryKey().defaultRandom(),username:wi({length:16}).notNull(),email:wi({length:254}).notNull(),hash:wi({length:64}).notNull(),salt:wi({length:36}).notNull(),createdAt:vo({withTimezone:!0}).notNull().defaultNow(),createdIp:wi({length:45}).notNull(),isActive:Ex().notNull().default(!1),verifiedAt:vo({withTimezone:!0}),userRole:bS().default("user")},(n)=>[i1("usernameUniqueIndex").on(jS(n.username)),i1("emailUniqueIndex").on(jS(n.email))]),EY=["id","createdAt","createdIp","isActive","salt","verifiedAt"],LS=["username","email","hash","userRole"],DS=Im("trackedUserColumnName",LS),UY=pc("userChanges",{id:Ci().primaryKey().defaultRandom(),userId:Ci().notNull().references(()=>Wo.id),changedAt:vo({withTimezone:!0}).notNull().defaultNow(),changedIp:wi({length:45}).notNull(),changedColumn:DS().notNull(),oldValue:wi({length:255}),newValue:wi({length:255})}),oa=pc("games",{id:Ci().primaryKey().defaultRandom()}),m1=pc("players",{userId:Ci().notNull().references(()=>Wo.id),gameId:Ci().notNull().references(()=>oa.id),score:dm().notNull()},(n)=>[sT({name:"players_userId_gameId_pk",columns:[n.userId,n.gameId]})]),gp=pc("loginHistory",{id:Ci().primaryKey().defaultRandom(),userId:Ci().references(()=>Wo.id),loginTime:vo({withTimezone:!0}).notNull().defaultNow(),ipAddress:wi({length:45}).notNull(),userAgent:wi({length:1024}),successful:Ex().notNull().default(!1)}),NS=Im("twoFactorMethod",["email","phone"]),VY=pc("passwordResetAttempts",{id:Ci().primaryKey().defaultRandom(),userId:Ci().notNull().references(()=>Wo.id),requestedIp:wi({length:45}).notNull(),requestedAt:vo({withTimezone:!0}).notNull().defaultNow(),succeededIp:wi({length:45}),succeededAt:vo({withTimezone:!0}),verificationMethod:NS().notNull()}),ca=pc("banishedIps",{ip:wi({length:45}).primaryKey(),reason:wi({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 a1{options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(_Y.resolve(__dirname,"notify_update.sql"));let n=[ai(Wo),ai(oa),ai(m1)];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=sp(i),this.drizzle=ia(this.sql,{schema:f1,logger:n})}observe(n,i){if(!this.observers.has(n))this.observers.set(n,new An);this.observers.get(n).subscribe("SINGLETON",i)}}import{createHash as BY}from"crypto";function $1(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 CS=["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,bY=15,LY=/^[a-zA-Z0-9_-]+$/,IS=Xn.string().min(jY).max(bY).regex(LY),hS=20,uS={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function DY(n){let i="";for(let o of n)if(o in uS)i+=uS[o];else i+=o;return i}function NY(n){let i=n.toLocaleLowerCase(),o=DY(i);for(let c of CS){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function CY(n){let i=new Set(n).size;return n.length*Math.log2(i)}function hY(n){let i=0,o=100;if(NY(n))i-=o;return i+=CY(n)*0.5,Math.max(i,0)}var yS=Xn.string().refine((n)=>{return hY(n)>=hS},{message:`Password does not meet the minimum complexity of ${hS}.`}).brand("password"),kS=Xn.object({username:IS,password:yS}).strict(),uY=Xn.string().email().brand("email"),ZS=Xn.object({username:IS,password:yS,email:uY}).strict();var pa={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"},v1=Y1(pa).map(([n])=>Xn.literal(Number(n))),IY=Xn.union([v1[0],v1[1],...v1]),qS=Xn.tuple([IY,Xn.string()]);var PS=ro({key:"count",default:0}),yY=Xc({key:"incrementTX",do:({set:n})=>{n(PS,(i)=>i+1)}}),sS=vv({key:"countContinuity",config:(n)=>n.add(PS).add(yY)});var tS=O$(Tc,"backend.worker.game.bun",fn),Pc=new a1({logQuery(n,i){fn.info("\uD83D\uDCDD query",n,i)}});t.STORE.loggers[0]=new Sc("info",void 0,fn);var II=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new gS.CronJob("00 15 * * * *",()=>{O$(Tc,"backend.worker.tribunal.bun",fn)}),n.start(),process.on("exit",()=>{n.stop(),fn.info("\u231B tribunal daily cronjob stopped")}),fn.info("\u23F3 tribunal daily cronjob started");return n})();function qY(n){if(Q$)return ZY(Q$,n);return kY({},n)}var dS=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,sn.VITE_BACKEND_ORIGIN);fn.info(x,p,n.method,m.pathname);let f=await Pc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:lo(ca.ip,p)}),a=f?.banishedUntil===null,$=f?.banishedUntil&&f.banishedUntil>x;if(a||$){fn.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-${$1("sign-up")}`:{let v=Buffer.concat(o).toString(),A=JSON.parse(v),J=ZS.safeParse(A);if(!J.success){fn.warn("signup parsed",J.error.issues);return}let{username:S,password:W,email:R}=J.data;if(fn.info(`\uD83D\uDD11 attempting to sign up: ${S}`),await Pc.drizzle.query.users.findFirst({columns:{id:!0},where:lo(Wo.email,R)}))throw[400,"User already exists"];let z=crypto.randomUUID(),M=rS("sha256").update(W+z).digest("hex");await Pc.drizzle.insert(Wo).values({username:S,email:R,hash:M,salt:z,createdIp:p}),fn.info(`\uD83D\uDD11 user created: ${S}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end(pa[201])}break;case`/login-${$1("login")}`:{let v=!1,A=null;try{let J=new Date(+x-600000);fn.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(lo(gp.ipAddress,p),lo(gp.successful,!1),sm(gp.loginTime,J)),limit:10});fn.info(`\uD83D\uDD11 ${S.length}/10 recent failed logins from ${p}`);let W=10-S.length;if(W<1)throw fn.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await Pc.drizzle.insert(ca).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),z=kS.safeParse(K);if(!z.success)throw fn.warn("login parsed",z.error.issues),[400,`${W} attempts remaining.`];let{username:M,password:h}=z.data,G=await Pc.drizzle.query.users.findFirst({columns:{id:!0,hash:!0,salt:!0},where:lo(Wo.username,M)});if(fn.info("\uD83D\uDD11 login attempt as user",M),!G)throw fn.info(`\uD83D\uDD11 user ${M} does not exist`),[400,`${W} attempts remaining.`];let{hash:H,salt:O}=G;if(A=G.id,rS("sha256").update(h+O).digest("hex")===H){let j=crypto.randomUUID(),y=Cf.get(M);if(!y)y=new Map,Cf.set(M,y);y.set(j,Number(x)),v=!0,fn.info("\uD83D\uDD11 login successful as",M),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end(`${M} ${j}`)}}finally{await Pc.drizzle.insert(gp).values({userId:A,successful:v,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),fn.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}}}}catch(p){let x=qS.safeParse(p);if(x.success){let[m,f]=x.data,$=`${pa[m]}. ${f}`;fn.info(`\u274C ${m}: ${$}`),i.writeHead(m,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end($)}else fn.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${sn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),A1=dS.listen(sn.BACKEND_PORT).address(),PY=typeof A1==="string"?null:A1===null?null:A1.port;if(PY===null)throw new Error("Could not determine port for test server");new kR(dS,{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(Cf.get(o)?.has(c)){let f=r(t.STORE,Xm,x);On(t.STORE,f,n),Kc(Gc,(a)=>{a.set(p,x)},t.STORE),On(t.STORE,Ba,(a)=>a.add(p)),On(t.STORE,_a,(a)=>a.add(x)),fn.info(`${o} connected on ${n.id}`),i()}else fn.info(`${o} couldn't authenticate`),i(new Error("Authentication error"))}).on("connection",(n)=>{let o=Wv({socket:n,store:t.STORE})(sS);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=vx(Gc,c,t.STORE).userKeyOfSocket,x=zn(t.STORE,p);if(Kc(Gc,(m)=>{m.delete(c)},t.STORE),x)On(t.STORE,Ba,(m)=>(m.delete(x),m));On(t.STORE,_a,(m)=>(m.delete(c),m)),fn.info(`${n.id} disconnected`),o()})});async function xa(){fn.info("\uD83E\uDDF9 closing workers");let n=new Promise((i)=>tS.process.once("close",i));tS.emit("timeToStop"),await n,fn.info("\uD83D\uDEEC backend server exiting"),process.exit(0)}process.on("SIGINT",async()=>{fn.info("\u2757 received SIGINT; exiting gracefully"),await xa()});process.on("SIGTERM",async()=>{fn.info("\u2757 received SIGTERM; exiting gracefully"),await xa()});process.on("exit",async()=>{fn.info("\u2757 received exit; exiting gracefully"),await xa()});Tc.on("updatesReady",()=>{fn.info('\u2757 backend server received signal "updatesReady"'),Tc.emit("readyToUpdate"),fn.info('\u2757 backend server has sent signal "readyToUpdate"; now awaits signal "timeToStop"'),Tc.on("timeToStop",async()=>{fn.info('\u2757 backend server received signal "timeToStop"; exiting gracefully'),await xa()})});fn.info(`\uD83D\uDEEB backend server ready on port ${sn.BACKEND_PORT}`);Tc.emit("alive");export{II as tribunalDaily};
|
|
87
|
+
`;await i.execute(F`CREATE SCHEMA IF NOT EXISTS ${F.identifier(p)}`),await i.execute(x);let f=(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(a)=>{for await(let v of n)if(!f||Number(f.created_at)<v.folderMillis){for(let $ of v.sql)await a.execute(F.raw($));await a.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[D.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 f=o[x],a=i[x]??F.param(f.onUpdateFn(),f),v=F`${F.identifier(this.casing.getColumnCasing(f))} = ${a}`;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 f=this.buildWithCTE(p),a=n[Ai.Symbol.Name],v=n[Ai.Symbol.Schema],$=n[Ai.Symbol.OriginalName],w=a===$?void 0:a,J=F`${v?F`${F.identifier(v)}.`:void 0}${F.identifier($)}${w&&F` ${F.identifier(w)}`}`,X=this.buildUpdateSet(n,i),W=x&&F.join([F.raw(" from "),this.buildFromTable(x)]),R=this.buildJoins(m),S=c?F` returning ${this.buildSelection(c,{isSingleTable:!x})}`:void 0,H=o?F` where ${o}`:void 0;return F`${f}update ${J} set ${X}${W}${R}${H}${S}`}buildSelection(n,{isSingleTable:i=!1}={}){let o=n.length,c=n.flatMap(({field:p},x)=>{let m=[];if(G(p,N.Aliased)&&p.isSelectionField)m.push(F.identifier(p.fieldAlias));else if(G(p,N.Aliased)||G(p,N)){let f=G(p,N.Aliased)?p.sql:p;if(i)m.push(new N(f.queryChunks.map((a)=>{if(G(a,V))return F.identifier(this.casing.getColumnCasing(a));return a})));else m.push(f);if(G(p,N.Aliased))m.push(F` as ${F.identifier(p.fieldAlias)}`)}else if(G(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(G(p,Ai)){let m=p[Ai.Symbol.Name],f=p[Ai.Symbol.Schema],a=p[Ai.Symbol.OriginalName],v=m===a?void 0:c.alias;i.push(F`${F.raw(c.joinType)} join${x} ${f?F`${F.identifier(f)}.`:void 0}${F.identifier(a)}${v&&F` ${F.identifier(v)}`} on ${c.on}`)}else if(G(p,Bi)){let m=p[jn].name,f=p[jn].schema,a=p[jn].originalName,v=m===a?void 0:c.alias;i.push(F`${F.raw(c.joinType)} join${x} ${f?F`${F.identifier(f)}.`:void 0}${F.identifier(a)}${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(G(n,D)&&n[D.Symbol.OriginalName]!==n[D.Symbol.Name]){let i=F`${F.identifier(n[D.Symbol.OriginalName])}`;if(n[D.Symbol.Schema])i=F`${F.identifier(n[D.Symbol.Schema])}.${i}`;return F`${i} ${F.identifier(n[D.Symbol.Name])}`}return n}buildSelectQuery({withList:n,fields:i,fieldsFlat:o,where:c,having:p,table:x,joins:m,orderBy:f,groupBy:a,limit:v,offset:$,lockingClause:w,distinct:J,setOperators:X}){let W=o??ti(i);for(let an of W)if(G(an.field,Un)&&fi(an.field.table)!==(G(x,pi)?x._.alias:G(x,ex)?x[jn].name:G(x,N)?void 0:fi(x))&&!((En)=>m?.some(({alias:gn})=>gn===(En[D.Symbol.IsAlias]?fi(En):En[D.Symbol.BaseName])))(an.field.table)){let En=fi(an.field.table);throw new Error(`Your "${an.path.join("->")}" field references a column "${En}"."${an.field.name}", but the table "${En}" is not part of the query! Did you forget to join it?`)}let R=!m||m.length===0,S=this.buildWithCTE(n),H;if(J)H=J===!0?F` distinct`:F` distinct on (${F.join(J.on,F`, `)})`;let M=this.buildSelection(W,{isSingleTable:R}),I=this.buildFromTable(x),Y=this.buildJoins(m),l=c?F` where ${c}`:void 0,E=p?F` having ${p}`:void 0,Q;if(f&&f.length>0)Q=F` order by ${F.join(f,F`, `)}`;let j;if(a&&a.length>0)j=F` group by ${F.join(a,F`, `)}`;let y=typeof v==="object"||typeof v==="number"&&v>=0?F` limit ${v}`:void 0,z=$?F` offset ${$}`:void 0,fn=F.empty();if(w){let an=F` for ${F.raw(w.strength)}`;if(w.config.of)an.append(F` of ${F.join(Array.isArray(w.config.of)?w.config.of:[w.config.of],F`, `)}`);if(w.config.noWait)an.append(F` no wait`);else if(w.config.skipLocked)an.append(F` skip locked`);fn.append(an)}let Z=F`${S}select${H} ${M} from ${I}${Y}${l}${j}${E}${Q}${y}${z}${fn}`;if(X.length>0)return this.buildSetOperations(Z,X);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 f=F`(${n.getSQL()}) `,a=F`(${c.getSQL()})`,v;if(x&&x.length>0){let X=[];for(let W of x)if(G(W,V))X.push(F.identifier(W.name));else if(G(W,N)){for(let R=0;R<W.queryChunks.length;R++){let S=W.queryChunks[R];if(G(S,V))W.queryChunks[R]=F.identifier(S.name)}X.push(F`${W}`)}else X.push(F`${W}`);v=F` order by ${F.join(X,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`${f}${w}${a}${v}${$}${J}`}buildInsertQuery({table:n,values:i,onConflict:o,returning:c,withList:p,select:x,overridingSystemValue_:m}){let f=[],a=n[D.Symbol.Columns],v=Object.entries(a).filter(([S,H])=>!H.shouldDisableInsert()),$=v.map(([,S])=>F.identifier(this.casing.getColumnCasing(S)));if(x){let S=i;if(G(S,N))f.push(S);else f.push(S.getSQL())}else{let S=i;f.push(F.raw("values "));for(let[H,M]of S.entries()){let I=[];for(let[Y,l]of v){let E=M[Y];if(E===void 0||G(E,Di)&&E.value===void 0)if(l.defaultFn!==void 0){let Q=l.defaultFn(),j=G(Q,N)?Q:F.param(Q,l);I.push(j)}else if(!l.default&&l.onUpdateFn!==void 0){let Q=l.onUpdateFn(),j=G(Q,N)?Q:F.param(Q,l);I.push(j)}else I.push(F`default`);else I.push(E)}if(f.push(I),H<S.length-1)f.push(F`, `)}}let w=this.buildWithCTE(p),J=F.join(f),X=c?F` returning ${this.buildSelection(c,{isSingleTable:!0})}`:void 0,W=o?F` on conflict ${o}`:void 0,R=m===!0?F`overriding system value `:void 0;return F`${w}insert into ${n} ${$} ${R}${J}${W}${X}`}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(G(n,nf)||G(n,em))return"json";else if(G(n,of))return"decimal";else if(G(n,cf))return"time";else if(G(n,pf)||G(n,xf))return"timestamp";else if(G(n,tm)||G(n,gm))return"date";else if(G(n,mf))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:f,joinOn:a}){let v=[],$,w,J=[],X,W=[];if(x===!0)v=Object.entries(p.columns).map(([H,M])=>({dbKey:M.name,tsKey:H,field:Ho(M,m),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let S=Object.fromEntries(Object.entries(p.columns).map(([E,Q])=>[E,Ho(Q,m)]));if(x.where){let E=typeof x.where==="function"?x.where(S,eT()):x.where;X=E&&Qx(E,m)}let H=[],M=[];if(x.columns){let E=!1;for(let[Q,j]of Object.entries(x.columns)){if(j===void 0)continue;if(Q in p.columns){if(!E&&j===!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];H.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 Y;if(x.extras){Y=typeof x.extras==="function"?x.extras(S,{sql:F}):x.extras;for(let[E,Q]of Object.entries(Y))H.push({tsKey:E,value:Sv(Q,m)})}for(let{tsKey:E,value:Q}of H)v.push({dbKey:G(Q,N.Aliased)?Q.fieldAlias:p.columns[E].name,tsKey:E,field:G(Q,Un)?Ho(Q,m):Q,relationTableTsKey:void 0,isJson:!1,selection:[]});let l=typeof x.orderBy==="function"?x.orderBy(S,nF()):x.orderBy??[];if(!Array.isArray(l))l=[l];J=l.map((E)=>{if(G(E,Un))return Ho(E,m);return Qx(E,m)}),$=x.limit,w=x.offset;for(let{tsKey:E,queryConfig:Q,relation:j}of I){let y=oF(i,o,j),z=Ec(j.referencedTable),fn=o[z],Z=`${m}_${E}`,an=Oc(...y.fields.map((_i,Oo)=>Mo(Ho(y.references[Oo],Z),Ho(_i,m)))),En=this.buildRelationalQueryWithoutPK({fullSchema:n,schema:i,tableNamesMap:o,table:n[fn],tableConfig:i[fn],queryConfig:G(j,ic)?Q===!0?{limit:1}:{...Q,limit:1}:Q,tableAlias:Z,joinOn:an,nestedQueryRelation:j}),gn=F`${F.identifier(Z)}.${F.identifier("data")}`.as(E);W.push({on:F`true`,table:new pi(En.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),v.push({dbKey:E,tsKey:E,field:gn,relationTableTsKey:fn,isJson:!0,selection:En.selection})}}if(v.length===0)throw new Pm({message:`No fields selected for table "${p.tsName}" ("${m}")`});let R;if(X=Oc(a,X),f){let S=F`json_build_array(${F.join(v.map(({field:I,tsKey:Y,isJson:l})=>l?F`${F.identifier(`${m}_${Y}`)}.${F.identifier("data")}`:G(I,N.Aliased)?I.sql:I),F`, `)})`;if(G(f,Vx))S=F`coalesce(json_agg(${S}${J.length>0?F` order by ${F.join(J,F`, `)}`:void 0}), '[]'::json)`;let H=[{dbKey:"data",tsKey:"data",field:S.as("data"),isJson:!0,relationTableTsKey:p.tsName,selection:v}];if($!==void 0||w!==void 0||J.length>0)R=this.buildSelectQuery({table:qm(c,m),fields:{},fieldsFlat:[{path:[],field:F.raw("*")}],where:X,limit:$,offset:w,orderBy:J,setOperators:[]}),X=void 0,$=void 0,w=void 0,J=[];else R=qm(c,m);R=this.buildSelectQuery({table:G(R,Ai)?R:new pi(R,{},m),fields:{},fieldsFlat:H.map(({field:I})=>({path:[],field:G(I,Un)?Ho(I,m):I})),joins:W,where:X,limit:$,offset:w,orderBy:J,setOperators:[]})}else R=this.buildSelectQuery({table:qm(c,m),fields:{},fieldsFlat:v.map(({field:S})=>({path:[],field:G(S,Un)?Ho(S,m):S})),joins:W,where:X,limit:$,offset:w,orderBy:J,setOperators:[]});return{tableTsKey:p.tsName,sql:R,selection:v}}}class s0{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(G(o,pi))c=Object.fromEntries(Object.keys(o._.selectedFields).map((p)=>[p,o[p]]));else if(G(o,ex))c=o[jn].selectedFields;else if(G(o,N))c={};else c=cA(o);return new r0({table:o,fields:c,isPartialSelect:i,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}class UR extends s0{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"&&!G(i,N)){let x=G(i,pi)?i._.selectedFields:G(i,Bi)?i[jn].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(Y2()):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 pi(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 r0 extends UR{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=ti(o.fields),f=i.prepareQuery(c.sqlToQuery(this.getSQL()),m,n,!0);return f.joinsNotNullableMap=p,f.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)})}}oA(r0,[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 Y2=()=>({union:H2,unionAll:M2,intersect:z2,intersectAll:l2,except:Q2,exceptAll:E2}),H2=gp("union",!1),M2=gp("union",!0),z2=gp("intersect",!1),l2=gp("intersect",!0),Q2=gp("except",!1),E2=gp("except",!0);class nm{static[T]="PgQueryBuilder";dialect;dialectConfig;constructor(n){this.dialect=G(n,Pc)?n:void 0,this.dialectConfig=G(n,Pc)?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 Pc(this.dialectConfig);return this.dialect}}class df{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[D.Symbol.Columns];for(let x of Object.keys(o)){let m=o[x];c[x]=G(m,N)?m:new Di(m,p[x])}return c});return new t0(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(!G(i,N)&&!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 t0(this.table,i,this.session,this.dialect,this.withList,!0)}}class t0 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[D.Symbol.Columns]){return this.config.returningFields=n,this.config.returning=ti(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,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=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:fi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class g0 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 ef{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 VR(this.table,rm(this.table,n),this.session,this.dialect,this.withList).setToken(this.authToken)}}class VR 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(G(n,Ai))return n[D.Symbol.Columns];else if(G(n,pi))return n._.selectedFields;return n[jn].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&&!G(this.config.from,N)?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&&!G(this.config.from,N)){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"&&!G(o.table,N)){let p=this.getTableLikeFields(o.table);n[c]=p}}}}return this.config.returningFields=n,this.config.returning=ti(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:fi(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}class im extends N{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 e0{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 d0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?n:{},"many")}findFirst(n){return new d0(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,n?{...n,limit:1}:{limit:1},"first")}}class d0 extends Ei{constructor(n,i,o,c,p,x,m,f,a){super();this.fullSchema=n,this.schema=i,this.tableNamesMap=o,this.table=c,this.tableConfig=p,this.dialect=x,this.session=m,this.config=f,this.mode=a}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)=>ff(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 n$ 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 e0(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(a){return new Vi({fields:a??void 0,session:i.session,dialect:i.dialect,withList:n})}function c(a){return new Vi({fields:a??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:!0})}function p(a,v){return new Vi({fields:v??void 0,session:i.session,dialect:i.dialect,withList:n,distinct:{on:a}})}function x(a){return new ef(a,i.session,i.dialect,n)}function m(a){return new df(a,i.session,i.dialect,n)}function f(a){return new gf(a,i.session,i.dialect,n)}return{select:o,selectDistinct:c,selectDistinctOn:p,update:x,insert:m,delete:f}}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 ef(n,this.session,this.dialect)}insert(n){return new df(n,this.session,this.dialect)}delete(n){return new gf(n,this.session,this.dialect)}refreshMaterializedView(n){return new g0(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 n$(()=>c.execute(void 0,this.authToken),i,o,(p)=>c.mapResult(p,!0))}transaction(n,i){return this.session.transaction(n,i)}}class _R{constructor(n,i){this.unique=n,this.name=i}static[T]="PgIndexBuilderOn";on(...n){return new na(n.map((i)=>{if(G(i,N))return i;i=i;let o=new Hx(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 na(n.map((i)=>{if(G(i,N))return i;i=i;let o=new Hx(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=i.defaultConfig,o}),this.unique,!0,this.name)}using(n,...i){return new na(i.map((o)=>{if(G(o,N))return o;o=o;let c=new Hx(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 na{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 i$(n){return new _R(!0,n)}class o${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 c${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 p$ 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 o${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:f}=this;if(!c&&!f)return Vn.startActiveSpan("drizzle.driver.execute",()=>{return x.unsafe(p,o)});let a=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 f?f(a):a.map((v)=>iA(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 c${constructor(n,i,o,c={}){super(i);this.client=n,this.schema=o,this.options=c,this.logger=c.logger??new Hv}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 x$(this.dialect,c,this.schema);if(i)await p.setTransaction(i);return n(p)})}}class x$ extends p${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 x$(this.dialect,o,this.schema);return n(c)})}}class bR extends om{static[T]="PostgresJsDatabase"}function dp(n,i={}){let o=(a)=>a;for(let a of["1184","1082","1083","1114"])n.options.parsers[a]=o,n.options.serializers[a]=o;n.options.serializers["114"]=o,n.options.serializers["3802"]=o;let c=new Pc({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 a=iF(i.schema,cF);x={fullSchema:i.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}let m=new cm(n,c,x,{logger:p}),f=new bR(c,m,x);return f.$client=n,f}function ia(...n){if(typeof n[0]==="string"){let i=tp(n[0]);return dp(i,n[1])}if(pA(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,f=tp(x,m);return dp(f,c)}let p=tp(i);return dp(p,c)}return dp(n[0],n[1])}((n)=>{function i(o){return dp({options:{parsers:{},serializers:{}}},o)}n.mock=i})(ia||(ia={}));var f$={};g3(f$,{users:()=>Ro,userChanges:()=>U2,untrackedUserColumnNames:()=>O2,twoFactorMethod:()=>hR,trackedUserColumnName:()=>CR,trackableUserColumnNames:()=>NR,role:()=>DR,players:()=>m$,passwordResetAttempts:()=>V2,loginHistory:()=>ep,games:()=>oa,banishedIps:()=>ca});function LR(n){return F`lower(${n})`}var DR=Im("role",["admin","user"]),Ro=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:ao({withTimezone:!0}).notNull().defaultNow(),createdIp:Ji({length:45}).notNull(),isActive:Ox().notNull().default(!1),verifiedAt:ao({withTimezone:!0}),userRole:DR().default("user")},(n)=>[i$("usernameUniqueIndex").on(LR(n.username)),i$("emailUniqueIndex").on(LR(n.email))]),O2=["id","createdAt","createdIp","isActive","salt","verifiedAt"],NR=["username","email","hash","userRole"],CR=Im("trackedUserColumnName",NR),U2=nc("userChanges",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Ro.id),changedAt:ao({withTimezone:!0}).notNull().defaultNow(),changedIp:Ji({length:45}).notNull(),changedColumn:CR().notNull(),oldValue:Ji({length:255}),newValue:Ji({length:255})}),oa=nc("games",{id:Ni().primaryKey().defaultRandom()}),m$=nc("players",{userId:Ni().notNull().references(()=>Ro.id),gameId:Ni().notNull().references(()=>oa.id),score:dm().notNull()},(n)=>[tT({name:"players_userId_gameId_pk",columns:[n.userId,n.gameId]})]),ep=nc("loginHistory",{id:Ni().primaryKey().defaultRandom(),userId:Ni().references(()=>Ro.id),loginTime:ao({withTimezone:!0}).notNull().defaultNow(),ipAddress:Ji({length:45}).notNull(),userAgent:Ji({length:1024}),successful:Ox().notNull().default(!1)}),hR=Im("twoFactorMethod",["email","phone"]),V2=nc("passwordResetAttempts",{id:Ni().primaryKey().defaultRandom(),userId:Ni().notNull().references(()=>Ro.id),requestedIp:Ji({length:45}).notNull(),requestedAt:ao({withTimezone:!0}).notNull().defaultNow(),succeededIp:Ji({length:45}),succeededAt:ao({withTimezone:!0}),verificationMethod:hR().notNull()}),ca=nc("banishedIps",{ip:Ji({length:45}).primaryKey(),reason:Ji({length:2048}).notNull(),banishedAt:ao({withTimezone:!0}).notNull().defaultNow(),banishedUntil:ao({withTimezone:!0})});var __dirname="/home/runner/work/wayforge/wayforge/apps/tempest.games/src/database";class a${options;sql;drizzle;observers=new Map;async setupTriggersAndNotifications(){await this.sql.file(_2.resolve(__dirname,"notify_update.sql"));let n=[fi(Ro),fi(oa),fi(m$)];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:Pn.POSTGRES_HOST,port:Pn.POSTGRES_PORT,user:Pn.POSTGRES_USER,password:Pn.POSTGRES_PASSWORD,database:Pn.POSTGRES_DATABASE}){this.options=i,this.sql=tp(i),this.drizzle=ia(this.sql,{schema:f$,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 B2}from"crypto";function v$(n){let i=B2("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 uR=["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 j2=3,b2=15,L2=/^[a-zA-Z0-9_-]+$/,kR=Kn.string().min(j2).max(b2).regex(L2),IR=20,yR={"0":"o","1":"l","3":"e","4":"a","5":"s","7":"t","@":"a",$:"s","!":"i"};function D2(n){let i="";for(let o of n)if(o in yR)i+=yR[o];else i+=o;return i}function N2(n){let i=n.toLocaleLowerCase(),o=D2(i);for(let c of uR){if(o.includes(c))return!0;if(i.includes(c))return!0}return!1}function C2(n){let i=new Set(n).size;return n.length*Math.log2(i)}function h2(n){let i=0,o=100;if(N2(n))i-=o;return i+=C2(n)*0.5,Math.max(i,0)}var ZR=Kn.string().refine((n)=>{return h2(n)>=IR},{message:`Password does not meet the minimum complexity of ${IR}.`}).brand("password"),qR=Kn.object({username:kR,password:ZR}).strict(),u2=Kn.string().email().brand("email"),PR=Kn.object({username:kR,password:ZR,email:u2}).strict();var pa={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"},$$=Y$(pa).map(([n])=>Kn.literal(Number(n))),I2=Kn.union([$$[0],$$[1],...$$]),sR=Kn.tuple([I2,Kn.string()]);var rR=Zo({key:"count",default:0}),y2=Gc({key:"incrementTX",do:({set:n})=>{n(rR,(i)=>i+1)}}),tR=T1({key:"countContinuity",config:(n)=>n.add(rR).add(y2)});var dR=E0($c,"backend.worker.game.bun",mn),sc=new a$({logQuery(n,i){mn.info("\uD83D\uDCDD query",n,i)}});d.STORE.loggers[0]=new Wc("info",void 0,mn);var eI=(()=>{let{__tribunalDaily:n}=globalThis;if(!n)n=new eR.CronJob("00 15 * * * *",()=>{E0($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 q2(n){if(Q0)return Z2(Q0,n);return k2({},n)}var n3=q2((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,Pn.VITE_BACKEND_ORIGIN);mn.info(x,p,n.method,m.pathname);let f=await sc.drizzle.query.banishedIps.findFirst({columns:{banishedUntil:!0},where:Mo(ca.ip,p)}),a=f?.banishedUntil===null,v=f?.banishedUntil&&f.banishedUntil>x;if(a||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-${v$("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:X,password:W,email:R}=J.data;if(mn.info(`\uD83D\uDD11 attempting to sign up: ${X}`),await sc.drizzle.query.users.findFirst({columns:{id:!0},where:Mo(Ro.email,R)}))throw[400,"User already exists"];let H=crypto.randomUUID(),M=gR("sha256").update(W+H).digest("hex");await sc.drizzle.insert(Ro).values({username:X,email:R,hash:M,salt:H,createdIp:p}),mn.info(`\uD83D\uDD11 user created: ${X}`),i.writeHead(201,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${Pn.FRONTEND_ORIGINS[0]}`}),i.end(pa[201])}break;case`/login-${v$("login")}`:{let $=!1,w=null;try{let J=new Date(+x-600000);mn.info("\uD83D\uDD11 ten minutes ago",{tenMinutesAgo:J,now:x});let X=await sc.drizzle.query.loginHistory.findMany({columns:{userId:!0,successful:!0},where:Oc(Mo(ep.ipAddress,p),Mo(ep.successful,!1),sm(ep.loginTime,J)),limit:10});mn.info(`\uD83D\uDD11 ${X.length}/10 recent failed logins from ${p}`);let W=10-X.length;if(W<1)throw mn.info(`\uD83D\uDD11 too many recent failed logins from ${p}`),await sc.drizzle.insert(ca).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(),S=JSON.parse(R),H=qR.safeParse(S);if(!H.success)throw mn.warn("login parsed",H.error.issues),[400,`${W} attempts remaining.`];let{username:M,password:I}=H.data,Y=await sc.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),!Y)throw mn.info(`\uD83D\uDD11 user ${M} does not exist`),[400,`${W} attempts remaining.`];let{hash:l,salt:E}=Y;if(w=Y.id,gR("sha256").update(I+E).digest("hex")===l){let j=crypto.randomUUID(),y=Cf.get(M);if(!y)y=new Map,Cf.set(M,y);y.set(j,Number(x)),$=!0,mn.info("\uD83D\uDD11 login successful as",M),i.writeHead(200,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${Pn.FRONTEND_ORIGINS[0]}`}),i.end(`${M} ${j}`)}}finally{await sc.drizzle.insert(ep).values({userId:w,successful:$,ipAddress:p,userAgent:n.headers["user-agent"]??"Withheld"}),mn.info(`\uD83D\uDD11 recorded login attempt from ${p}`)}}}}}catch(p){let x=sR.safeParse(p);if(x.success){let[m,f]=x.data,v=`${pa[m]}. ${f}`;mn.info(`\u274C ${m}: ${v}`),i.writeHead(m,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${Pn.FRONTEND_ORIGINS[0]}`}),i.end(v)}else mn.error(p),i.writeHead(500,{"Content-Type":"text/plain","Access-Control-Allow-Origin":`${Pn.FRONTEND_ORIGINS[0]}`}),i.end("Internal Server Error")}})}),w$=n3.listen(Pn.BACKEND_PORT).address(),P2=typeof w$==="string"?null:w$===null?null:w$.port;if(P2===null)throw new Error("Could not determine port for test server");new q6(n3,{cors:{origin:Pn.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(Cf.get(o)?.has(c)){let f=r(d.STORE,Km,x);On(d.STORE,f,n),ko(Yc,(a)=>{a.set(p,x)},d.STORE),On(d.STORE,Va,(a)=>a.add(p)),On(d.STORE,Ua,(a)=>a.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})(tR);n.on("disconnect",()=>{let c=`socket::${n.id}`,p=ip(Yc,c,d.STORE).userKeyOfSocket,x=Hn(d.STORE,p);if(ko(Yc,(m)=>{m.delete(c)},d.STORE),x)On(d.STORE,Va,(m)=>(m.delete(x),m));On(d.STORE,Ua,(m)=>(m.delete(c),m)),mn.info(`${n.id} disconnected`),o()})});async function xa(){mn.info("\uD83E\uDDF9 closing workers");let n=new Promise((i)=>dR.process.once("close",i));dR.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 xa()});process.on("SIGTERM",async()=>{mn.info("\u2757 received SIGTERM; exiting gracefully"),await xa()});process.on("exit",async()=>{mn.info("\u2757 received exit; exiting gracefully"),await xa()});$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 xa()})});mn.info(`\uD83D\uDEEB backend server ready on port ${Pn.BACKEND_PORT}`);$c.emit("alive");export{eI as tribunalDaily};
|