@wovin/connect-ucan-store-proxy 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- import{b as Ki,d as wt,e as $s}from"./chunk-OWXA5F6K.min.js";import{a as Vi,b as Cs,c as Us}from"./chunk-EHSVSU5O.min.js";var Qc=Vi((Px,Yc)=>{"use strict";Yc.exports=zs;var Xc=128,lh=127,dh=~lh,ph=Math.pow(2,31);function zs(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw zs.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=ph;)t[r++]=e&255|Xc,e/=128;for(;e&dh;)t[r++]=e&255|Xc,e>>>=7;return t[r]=e|0,zs.bytes=r-n+1,t}});var tf=Vi((Rx,ef)=>{"use strict";ef.exports=qs;var yh=128,Zc=127;function qs(e,n){var r=0,n=n||0,i=0,o=n,s,a=e.length;do{if(o>=a||i>49)throw qs.bytes=0,new RangeError("Could not decode varint");s=e[o++],r+=i<28?(s&Zc)<<i:(s&Zc)*Math.pow(2,i),i+=7}while(s>=yh);return qs.bytes=o-n,r}});var nf=Vi((Cx,rf)=>{"use strict";var hh=Math.pow(2,7),gh=Math.pow(2,14),mh=Math.pow(2,21),bh=Math.pow(2,28),vh=Math.pow(2,35),_h=Math.pow(2,42),wh=Math.pow(2,49),Th=Math.pow(2,56),Ah=Math.pow(2,63);rf.exports=function(e){return e<hh?1:e<gh?2:e<mh?3:e<bh?4:e<vh?5:e<_h?6:e<wh?7:e<Th?8:e<Ah?9:10}});var no=Vi(($x,of)=>{"use strict";of.exports={encode:Qc(),decode:tf(),encodingLength:nf()}});var Cy=["string","number","bigint","symbol"],$y=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function qu(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(Cy.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Uy(e))return"Buffer";let r=By(e);return r||"Object"}function Uy(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function By(e){let t=Object.prototype.toString.call(e).slice(8,-1);if($y.includes(t))return t}var V=class{constructor(t,r,n){this.major=t,this.majorEncoded=t<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(t){return this.major<t.major?-1:this.major>t.major?1:0}};V.uint=new V(0,"uint",!0);V.negint=new V(1,"negint",!0);V.bytes=new V(2,"bytes",!0);V.string=new V(3,"string",!0);V.array=new V(4,"array",!1);V.map=new V(5,"map",!1);V.tag=new V(6,"tag",!1);V.float=new V(7,"float",!0);V.false=new V(7,"false",!0);V.true=new V(7,"true",!0);V.null=new V(7,"null",!0);V.undefined=new V(7,"undefined",!0);V.break=new V(7,"break",!0);var ce=class{constructor(t,r,n){this.type=t,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var yn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",My=new TextDecoder,ky=new TextEncoder;function zi(e){return yn&&globalThis.Buffer.isBuffer(e)}function Ju(e){return e instanceof Uint8Array?zi(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var Xu=yn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Wu(e,t,r):(e,t,r)=>r-t>64?My.decode(e.subarray(t,r)):Wu(e,t,r),Yu=yn?e=>e.length>64?globalThis.Buffer.from(e):Gu(e):e=>e.length>64?ky.encode(e):Gu(e);var hn=yn?(e,t,r)=>zi(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Qu=yn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),Ju(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},Zu=yn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function ec(e,t){if(zi(e)&&zi(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function Gu(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function Wu(e,t,r){let n=[];for(;t<r;){let i=e[t],o=null,s=i>239?4:i>223?3:i>191?2:1;if(t+s<=r){let a,c,f,l;switch(s){case 1:i<128&&(o=i);break;case 2:a=e[t+1],(a&192)===128&&(l=(i&31)<<6|a&63,l>127&&(o=l));break;case 3:a=e[t+1],c=e[t+2],(a&192)===128&&(c&192)===128&&(l=(i&15)<<12|(a&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:a=e[t+1],c=e[t+2],f=e[t+3],(a&192)===128&&(c&192)===128&&(f&192)===128&&(l=(i&15)<<18|(a&63)<<12|(c&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),t+=s}return Dy(n)}var Hu=4096;function Dy(e){let t=e.length;if(t<=Hu)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Hu));return r}var Ly=256,qi=class{constructor(t=Ly){this.chunkSize=t,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(t){let r=this.chunks[this.chunks.length-1];if(this.cursor+t.length<=this.maxCursor+1){let i=r.length-(this.maxCursor-this.cursor)-1;r.set(t,i)}else{if(r){let i=r.length-(this.maxCursor-this.cursor)-1;i<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,i),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=Zu(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(t,0)):(this.chunks.push(t),this.maxCursor+=t.length)}this.cursor+=t.length}toBytes(t=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];t&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=hn(n,0,this.cursor)}else r=Qu(this.chunks,this.cursor);return t&&this.reset(),r}};var ve="CBOR decode error:",Bs="CBOR encode error:",Xn=[];Xn[23]=1;Xn[24]=2;Xn[25]=3;Xn[26]=5;Xn[27]=9;function sr(e,t,r){if(e.length-t<r)throw new Error(`${ve} not enough data for type`)}var Ge=[24,256,65536,4294967296,BigInt("18446744073709551616")];function ut(e,t,r){sr(e,t,1);let n=e[t];if(r.strict===!0&&n<Ge[0])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function ct(e,t,r){sr(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Ge[1])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function ft(e,t,r){sr(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Ge[2])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function lt(e,t,r){sr(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&o<Ge[3])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(r.allowBigInt===!0)return o;throw new Error(`${ve} integers outside of the safe integer range are not supported`)}function tc(e,t,r,n){return new ce(V.uint,ut(e,t+1,n),2)}function rc(e,t,r,n){return new ce(V.uint,ct(e,t+1,n),3)}function nc(e,t,r,n){return new ce(V.uint,ft(e,t+1,n),5)}function ic(e,t,r,n){return new ce(V.uint,lt(e,t+1,n),9)}function Tt(e,t){return Je(e,0,t.value)}function Je(e,t,r){if(r<Ge[0]){let n=Number(r);e.push([t|n])}else if(r<Ge[1]){let n=Number(r);e.push([t|24,n])}else if(r<Ge[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Ge[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Ge[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),s=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=o&255,o=o>>8,i[7]=o&255,o=o>>8,i[6]=o&255,o=o>>8,i[5]=o&255,i[4]=s&255,s=s>>8,i[3]=s&255,s=s>>8,i[2]=s&255,s=s>>8,i[1]=s&255,e.push(i)}else throw new Error(`${ve} encountered BigInt larger than allowable range`)}}Tt.encodedSize=function(t){return Je.encodedSize(t.value)};Je.encodedSize=function(t){return t<Ge[0]?1:t<Ge[1]?2:t<Ge[2]?3:t<Ge[3]?5:9};Tt.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function oc(e,t,r,n){return new ce(V.negint,-1-ut(e,t+1,n),2)}function sc(e,t,r,n){return new ce(V.negint,-1-ct(e,t+1,n),3)}function ac(e,t,r,n){return new ce(V.negint,-1-ft(e,t+1,n),5)}var Ms=BigInt(-1),uc=BigInt(1);function cc(e,t,r,n){let i=lt(e,t+1,n);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new ce(V.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${ve} integers outside of the safe integer range are not supported`);return new ce(V.negint,Ms-BigInt(i),9)}function Gi(e,t){let r=t.value,n=typeof r=="bigint"?r*Ms-uc:r*-1-1;Je(e,t.type.majorEncoded,n)}Gi.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Ms-uc:r*-1-1;return n<Ge[0]?1:n<Ge[1]?2:n<Ge[2]?3:n<Ge[3]?5:9};Gi.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function Yn(e,t,r,n){sr(e,t,r+n);let i=hn(e,t+r,t+r+n);return new ce(V.bytes,i,r+n)}function fc(e,t,r,n){return Yn(e,t,1,r)}function lc(e,t,r,n){return Yn(e,t,2,ut(e,t+1,n))}function dc(e,t,r,n){return Yn(e,t,3,ct(e,t+1,n))}function pc(e,t,r,n){return Yn(e,t,5,ft(e,t+1,n))}function yc(e,t,r,n){let i=lt(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer bytes lengths not supported`);return Yn(e,t,9,i)}function Wi(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===V.string?Yu(e.value):e.value),e.encodedBytes}function gn(e,t){let r=Wi(t);Je(e,t.type.majorEncoded,r.length),e.push(r)}gn.encodedSize=function(t){let r=Wi(t);return Je.encodedSize(r.length)+r.length};gn.compareTokens=function(t,r){return Fy(Wi(t),Wi(r))};function Fy(e,t){return e.length<t.length?-1:e.length>t.length?1:ec(e,t)}function Qn(e,t,r,n,i){let o=r+n;sr(e,t,o);let s=new ce(V.string,Xu(e,t+r,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=hn(e,t+r,t+o)),s}function hc(e,t,r,n){return Qn(e,t,1,r,n)}function gc(e,t,r,n){return Qn(e,t,2,ut(e,t+1,n),n)}function mc(e,t,r,n){return Qn(e,t,3,ct(e,t+1,n),n)}function bc(e,t,r,n){return Qn(e,t,5,ft(e,t+1,n),n)}function vc(e,t,r,n){let i=lt(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer string lengths not supported`);return Qn(e,t,9,i,n)}var _c=gn;function mn(e,t,r,n){return new ce(V.array,n,r)}function wc(e,t,r,n){return mn(e,t,1,r)}function Tc(e,t,r,n){return mn(e,t,2,ut(e,t+1,n))}function Ac(e,t,r,n){return mn(e,t,3,ct(e,t+1,n))}function Oc(e,t,r,n){return mn(e,t,5,ft(e,t+1,n))}function Ic(e,t,r,n){let i=lt(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer array lengths not supported`);return mn(e,t,9,i)}function Ec(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return mn(e,t,1,1/0)}function Hi(e,t){Je(e,V.array.majorEncoded,t.value)}Hi.compareTokens=Tt.compareTokens;Hi.encodedSize=function(t){return Je.encodedSize(t.value)};function bn(e,t,r,n){return new ce(V.map,n,r)}function Sc(e,t,r,n){return bn(e,t,1,r)}function xc(e,t,r,n){return bn(e,t,2,ut(e,t+1,n))}function Nc(e,t,r,n){return bn(e,t,3,ct(e,t+1,n))}function Pc(e,t,r,n){return bn(e,t,5,ft(e,t+1,n))}function Rc(e,t,r,n){let i=lt(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer map lengths not supported`);return bn(e,t,9,i)}function Cc(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return bn(e,t,1,1/0)}function Ji(e,t){Je(e,V.map.majorEncoded,t.value)}Ji.compareTokens=Tt.compareTokens;Ji.encodedSize=function(t){return Je.encodedSize(t.value)};function $c(e,t,r,n){return new ce(V.tag,r,1)}function Uc(e,t,r,n){return new ce(V.tag,ut(e,t+1,n),2)}function Bc(e,t,r,n){return new ce(V.tag,ct(e,t+1,n),3)}function Mc(e,t,r,n){return new ce(V.tag,ft(e,t+1,n),5)}function kc(e,t,r,n){return new ce(V.tag,lt(e,t+1,n),9)}function Xi(e,t){Je(e,V.tag.majorEncoded,t.value)}Xi.compareTokens=Tt.compareTokens;Xi.encodedSize=function(t){return Je.encodedSize(t.value)};var Wy=20,Hy=21,Jy=22,Xy=23;function Dc(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${ve} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new ce(V.null,null,1):new ce(V.undefined,void 0,1)}function Lc(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return new ce(V.break,void 0,1)}function ks(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${ve} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${ve} Infinity values are not supported`)}return new ce(V.float,e,t)}function jc(e,t,r,n){return ks(Ds(e,t+1),3,n)}function Fc(e,t,r,n){return ks(Ls(e,t+1),5,n)}function Vc(e,t,r,n){return ks(Gc(e,t+1),9,n)}function Yi(e,t,r){let n=t.value;if(n===!1)e.push([V.float.majorEncoded|Wy]);else if(n===!0)e.push([V.float.majorEncoded|Hy]);else if(n===null)e.push([V.float.majorEncoded|Jy]);else if(n===void 0)e.push([V.float.majorEncoded|Xy]);else{let i,o=!1;(!r||r.float64!==!0)&&(zc(n),i=Ds(Dt,1),n===i||Number.isNaN(n)?(Dt[0]=249,e.push(Dt.slice(0,3)),o=!0):(qc(n),i=Ls(Dt,1),n===i&&(Dt[0]=250,e.push(Dt.slice(0,5)),o=!0))),o||(Yy(n),i=Gc(Dt,1),Dt[0]=251,e.push(Dt.slice(0,9)))}}Yi.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){zc(n);let i=Ds(Dt,1);if(n===i||Number.isNaN(n))return 3;if(qc(n),i=Ls(Dt,1),n===i)return 5}return 9};var Kc=new ArrayBuffer(9),At=new DataView(Kc,1),Dt=new Uint8Array(Kc,0);function zc(e){if(e===1/0)At.setUint16(0,31744,!1);else if(e===-1/0)At.setUint16(0,64512,!1);else if(Number.isNaN(e))At.setUint16(0,32256,!1);else{At.setFloat32(0,e);let t=At.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)At.setUint16(0,31744,!1);else if(r===0)At.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?At.setUint16(0,0):i<-14?At.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):At.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Ds(e,t){if(e.length-t<2)throw new Error(`${ve} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,o;return n===0?o=i*2**-24:n!==31?o=(i+1024)*2**(n-25):o=i===0?1/0:NaN,r&32768?-o:o}function qc(e){At.setFloat32(0,e,!1)}function Ls(e,t){if(e.length-t<4)throw new Error(`${ve} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function Yy(e){At.setFloat64(0,e,!1)}function Gc(e,t){if(e.length-t<8)throw new Error(`${ve} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}Yi.compareTokens=Tt.compareTokens;function Ie(e,t,r){throw new Error(`${ve} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function Qi(e){return()=>{throw new Error(`${ve} ${e}`)}}var oe=[];for(let e=0;e<=23;e++)oe[e]=Ie;oe[24]=tc;oe[25]=rc;oe[26]=nc;oe[27]=ic;oe[28]=Ie;oe[29]=Ie;oe[30]=Ie;oe[31]=Ie;for(let e=32;e<=55;e++)oe[e]=Ie;oe[56]=oc;oe[57]=sc;oe[58]=ac;oe[59]=cc;oe[60]=Ie;oe[61]=Ie;oe[62]=Ie;oe[63]=Ie;for(let e=64;e<=87;e++)oe[e]=fc;oe[88]=lc;oe[89]=dc;oe[90]=pc;oe[91]=yc;oe[92]=Ie;oe[93]=Ie;oe[94]=Ie;oe[95]=Qi("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)oe[e]=hc;oe[120]=gc;oe[121]=mc;oe[122]=bc;oe[123]=vc;oe[124]=Ie;oe[125]=Ie;oe[126]=Ie;oe[127]=Qi("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)oe[e]=wc;oe[152]=Tc;oe[153]=Ac;oe[154]=Oc;oe[155]=Ic;oe[156]=Ie;oe[157]=Ie;oe[158]=Ie;oe[159]=Ec;for(let e=160;e<=183;e++)oe[e]=Sc;oe[184]=xc;oe[185]=Nc;oe[186]=Pc;oe[187]=Rc;oe[188]=Ie;oe[189]=Ie;oe[190]=Ie;oe[191]=Cc;for(let e=192;e<=215;e++)oe[e]=$c;oe[216]=Uc;oe[217]=Bc;oe[218]=Mc;oe[219]=kc;oe[220]=Ie;oe[221]=Ie;oe[222]=Ie;oe[223]=Ie;for(let e=224;e<=243;e++)oe[e]=Qi("simple values are not supported");oe[244]=Ie;oe[245]=Ie;oe[246]=Ie;oe[247]=Dc;oe[248]=Qi("simple values are not supported");oe[249]=jc;oe[250]=Fc;oe[251]=Vc;oe[252]=Ie;oe[253]=Ie;oe[254]=Ie;oe[255]=Lc;var Lt=[];for(let e=0;e<24;e++)Lt[e]=new ce(V.uint,e,1);for(let e=-1;e>=-24;e--)Lt[31-e]=new ce(V.negint,e,1);Lt[64]=new ce(V.bytes,new Uint8Array(0),1);Lt[96]=new ce(V.string,"",1);Lt[128]=new ce(V.array,0,1);Lt[160]=new ce(V.map,0,1);Lt[244]=new ce(V.false,!1,1);Lt[245]=new ce(V.true,!0,1);Lt[246]=new ce(V.null,null,1);function js(){let e=[];return e[V.uint.major]=Tt,e[V.negint.major]=Gi,e[V.bytes.major]=gn,e[V.string.major]=_c,e[V.array.major]=Hi,e[V.map.major]=Ji,e[V.tag.major]=Xi,e[V.float.major]=Yi,e}var mx=js(),bx=new qi,eo=class e{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${Bs} object contains circular references`);return new e(r,t)}},mr={null:new ce(V.null,null),undefined:new ce(V.undefined,void 0),true:new ce(V.true,!0),false:new ce(V.false,!1),emptyArray:new ce(V.array,0),emptyMap:new ce(V.map,0)},br={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new ce(V.float,e):e>=0?new ce(V.uint,e):new ce(V.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new ce(V.uint,e):new ce(V.negint,e)},Uint8Array(e,t,r,n){return new ce(V.bytes,e)},string(e,t,r,n){return new ce(V.string,e)},boolean(e,t,r,n){return e?mr.true:mr.false},null(e,t,r,n){return mr.null},undefined(e,t,r,n){return mr.undefined},ArrayBuffer(e,t,r,n){return new ce(V.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new ce(V.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[mr.emptyArray,new ce(V.break)]:mr.emptyArray;n=eo.createCheck(n,e);let i=[],o=0;for(let s of e)i[o++]=Zi(s,r,n);return r.addBreakTokens?[new ce(V.array,e.length),i,new ce(V.break)]:[new ce(V.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",o=i?e.keys():Object.keys(e),s=i?e.size:o.length;if(!s)return r.addBreakTokens===!0?[mr.emptyMap,new ce(V.break)]:mr.emptyMap;n=eo.createCheck(n,e);let a=[],c=0;for(let f of o)a[c++]=[Zi(f,r,n),Zi(i?e.get(f):e[f],r,n)];return eh(a,r),r.addBreakTokens?[new ce(V.map,s),a,new ce(V.break)]:[new ce(V.map,s),a]}};br.Map=br.Object;br.Buffer=br.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))br[`${e}Array`]=br.DataView;function Zi(e,t={},r){let n=qu(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||br[n];if(typeof i=="function"){let s=i(e,n,t,r);if(s!=null)return s}let o=br[n];if(!o)throw new Error(`${Bs} unsupported type: ${n}`);return o(e,n,t,r)}function eh(e,t){t.mapSorter&&e.sort(t.mapSorter)}var th={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Fs=class{constructor(t,r={}){this._pos=0,this.data=t,this.options=r}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let t=this.data[this._pos],r=Lt[t];if(r===void 0){let n=oe[t];if(!n)throw new Error(`${ve} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let i=t&31;r=n(this.data,this._pos,i,this.options)}return this._pos+=r.encodedLength,r}},Zn=Symbol.for("DONE"),to=Symbol.for("BREAK");function rh(e,t,r){let n=[];for(let i=0;i<e.value;i++){let o=ei(t,r);if(o===to){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed array`)}if(o===Zn)throw new Error(`${ve} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=o}return n}function nh(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},o=n?new Map:void 0;for(let s=0;s<e.value;s++){let a=ei(t,r);if(a===to){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed map`)}if(a===Zn)throw new Error(`${ve} found map but not enough entries (got ${s} [no key], expected ${e.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${ve} non-string keys not supported (got ${typeof a})`);if(r.rejectDuplicateMapKeys===!0&&(n&&o.has(a)||!n&&a in i))throw new Error(`${ve} found repeat map key "${a}"`);let c=ei(t,r);if(c===Zn)throw new Error(`${ve} found map but not enough entries (got ${s} [no value], expected ${e.value})`);n?o.set(a,c):i[a]=c}return n?o:i}function ei(e,t){if(e.done())return Zn;let r=e.next();if(r.type===V.break)return to;if(r.type.terminal)return r.value;if(r.type===V.array)return rh(r,e,t);if(r.type===V.map)return nh(r,e,t);if(r.type===V.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=ei(e,t);return t.tags[r.value](n)}throw new Error(`${ve} tag not supported (${r.value})`)}throw new Error("unsupported")}function Wc(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ve} data to decode must be a Uint8Array`);t=Object.assign({},th,t);let r=t.tokenizer||new Fs(e,t),n=ei(r,t);if(n===Zn)throw new Error(`${ve} did not find any content to decode`);if(n===to)throw new Error(`${ve} got unexpected break`);return[n,e.subarray(r.pos())]}function Vs(e,t){let[r,n]=Wc(e,t);if(n.length>0)throw new Error(`${ve} too many terminals, data makes no sense`);return r}var Jc=42;function sh(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=wt.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new ce(V.tag,Jc),new ce(V.bytes,r)]}function ah(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function uh(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var Hc={float64:!0,typeEncoders:{Object:sh,undefined:ah,number:uh}},xx={...Hc,typeEncoders:{...Hc.typeEncoders}};function ch(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return wt.decode(e.subarray(1))}var ro={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};ro.tags[Jc]=ch;var Nx={...ro,tags:ro.tags.slice()};var Ks=e=>Vs(e,ro);var vr=Cs(no(),1),ti={SHA2_256:18,LENGTH:32,DAG_PB:112},Gs=40;function vn(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=vr.default.decode(e);return t.seek(vr.default.decode.bytes),r}function Ws(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;return{version:2,characteristics:[t.getBigUint64(r,!0),t.getBigUint64(r+=8,!0)],dataOffset:Number(t.getBigUint64(r+=8,!0)),dataSize:Number(t.getBigUint64(r+=8,!0)),indexOffset:Number(t.getBigUint64(r+=8,!0))}}function Hs(e){vr.default.decode(e);let t=vr.default.decode.bytes,r=vr.default.decode(e.subarray(vr.default.decode.bytes)),n=vr.default.decode.bytes;return t+n+r}var _r={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},ri={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":_r.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(_r.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=ri["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=ri["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:_r.Int,CarV1HeaderOrV2Pragma:e=>{if(_r.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=ri["CarV1HeaderOrV2Pragma > roots (anon)"](e[o]);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.roots=a}}break;case"version":{n--;let a=ri.Int(e[o]);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},ni={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":_r.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(_r.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=ni["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=ni["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:_r.Int,CarV1HeaderOrV2Pragma:e=>{if(_r.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=ni["CarV1HeaderOrV2Pragma > roots (anon)"](s);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.roots=a}}break;case"version":{n--;let a=ni.Int(s);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},Js={toTyped:ri.CarV1HeaderOrV2Pragma,toRepresentation:ni.CarV1HeaderOrV2Pragma};var zx=js();var Sh=Cs(no(),1);var Jx=[new ce(V.map,2),new ce(V.string,"version"),new ce(V.uint,1),new ce(V.string,"roots")],Xx=new ce(V.tag,42);async function Xs(e,t){let r=vn(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=Ks(n);if(Js.toTyped(i)===void 0)throw new Error("Invalid CAR header format");if(i.version!==1&&i.version!==2||t!==void 0&&i.version!==t)throw new Error(`Invalid CAR version: ${i.version}${t!==void 0?` (expected ${t})`:""}`);if(i.version===1){if(!Array.isArray(i.roots))throw new Error("Invalid CAR header format");return i}if(i.roots!==void 0)throw new Error("Invalid CAR header format");let o=Ws(await e.exactly(Gs,!0));e.seek(o.dataOffset-e.pos);let s=await Xs(e,1);return Object.assign(s,o)}async function Nh(e){let t=await e.exactly(2,!1);if(t[0]===ti.SHA2_256&&t[1]===ti.LENGTH){let s=await e.exactly(34,!0),a=Ki(s);return wt.create(0,ti.DAG_PB,a)}let r=vn(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=vn(await e.upTo(8),e),i=await e.exactly(Hs(await e.upTo(8)),!0),o=Ki(i);return wt.create(r,n,o)}async function sf(e){let t=e.pos,r=vn(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await Nh(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function Ph(e){let{cid:t,blockLength:r}=await sf(e);return{bytes:await e.exactly(r,!0),cid:t}}async function Rh(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await sf(e),o={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(o.blockLength),o}function io(e){let t=(async()=>{let r=await Xs(e);if(r.version===2){let n=e.pos-r.dataOffset;e=$h(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await Ph(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await Rh(e)}}}function ii(e){let t=0;return{async upTo(r){return e.subarray(t,t+Math.min(r,e.length-t))},async exactly(r,n=!1){if(r>e.length-t)throw new Error("Unexpected end of data");let i=e.subarray(t,t+r);return n&&(t+=r),i},seek(r){t+=r},get pos(){return t}}}function Ch(e){let t=0,r=0,n=0,i=new Uint8Array(0),o=async s=>{r=i.length-n;let a=[i.subarray(n)];for(;r<s;){let f=await e();if(f==null)break;r<0?f.length>r&&a.push(f.subarray(-r)):a.push(f),r+=f.length}i=new Uint8Array(a.reduce((f,l)=>f+l.length,0));let c=0;for(let f of a)i.set(f,c),c+=f.length;n=0};return{async upTo(s){return i.length-n<s&&await o(s),i.subarray(n,n+Math.min(i.length-n,s))},async exactly(s,a=!1){if(i.length-n<s&&await o(s),i.length-n<s)throw new Error("Unexpected end of data");let c=i.subarray(n,n+s);return a&&(t+=s,n+=s),c},seek(s){t+=s,n+=s},get pos(){return t}}}function oo(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return Ch(r)}function $h(e,t){let r=0;return{async upTo(n){let i=await e.upTo(n);return i.length+r>t&&(i=i.subarray(0,t-r)),i},async exactly(n,i=!1){let o=await e.exactly(n,i);if(o.length+r>t)throw new Error("Unexpected end of data");return i&&(r+=n),o},seek(n){r+=n,e.seek(n)},get pos(){return e.pos}}}var jr=class{constructor(t,r){this._header=t,this._blocks=r,this._keys=r.map(n=>n.cid.toString())}get version(){return this._header.version}async getRoots(){return this._header.roots}async has(t){return this._keys.indexOf(t.toString())>-1}async get(t){let r=this._keys.indexOf(t.toString());return r>-1?this._blocks[r]:void 0}async*blocks(){for(let t of this._blocks)yield t}async*cids(){for(let t of this._blocks)yield t.cid}static async fromBytes(t){if(!(t instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return af(ii(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return af(oo(t))}};async function af(e){let t=io(e),r=await t.header(),n=[];for await(let i of t.blocks())n.push(i);return new jr(r,n)}var Bh=Cs(no(),1);var Mh={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,r){return"Cannot apply '"+t+"' to '"+r.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,r){return"[mobx.array] Index out of bounds, "+t+" is larger than "+r},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,r){return"the entry '"+t+"' does not exist in the observable map '"+r+"'"},26:"please specify a property",27:function(t,r){return"no observable property '"+t.toString()+"' found on the observable object '"+r+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,r){return"Cycle detected in computation "+t+": "+r},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},kh=Mh;function fe(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=typeof e=="string"?e:kh[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var Dh={};function Ao(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Dh}var Ef=Object.assign,yo=Object.getOwnPropertyDescriptor,Yt=Object.defineProperty,ci=Object.prototype,ho=[];Object.freeze(ho);var fa={};Object.freeze(fa);var Lh=typeof Proxy<"u",jh=Object.toString();function Sf(){Lh||fe("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function oi(e){J.verifyProxies&&fe("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function Ct(){return++J.mobxGuid}function la(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var wn=function(){};function je(e){return typeof e=="function"}function Vr(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Oo(e){return e!==null&&typeof e=="object"}function zt(e){if(!Oo(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===jh}function xf(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Io(e,t,r){Yt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Nf(e,t,r){Yt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function Or(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Oo(n)&&n[r]===!0}}function In(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function Fh(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function ar(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Pf=typeof Object.getOwnPropertySymbols<"u";function Vh(e){var t=Object.keys(e);if(!Pf)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return ci.propertyIsEnumerable.call(e,n)})):t}var Eo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Pf?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Zs(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Rf(e){return e===null?null:typeof e=="object"?""+e:e}function xt(e,t){return ci.hasOwnProperty.call(e,t)}var Kh=Object.getOwnPropertyDescriptors||function(t){var r={};return Eo(t).forEach(function(n){r[n]=yo(t,n)}),r};function dt(e,t){return!!(e&t)}function pt(e,t,r){return r?e|=t:e&=~t,e}function uf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function cf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qh(n.key),n)}}function En(e,t,r){return t&&cf(e.prototype,t),r&&cf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Gh(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fr.apply(null,arguments)}function Cf(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ea(e,t)}function ea(e,t){return ea=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},ea(e,t)}function zh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qh(e){var t=zh(e,"string");return typeof t=="symbol"?t:t+""}function Gh(e,t){if(e){if(typeof e=="string")return uf(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uf(e,t):void 0}}var it=Symbol("mobx-stored-annotations");function Qt(e){function t(r,n){if(li(n))return e.decorate_20223_(r,n);fi(r,n,e)}return Object.assign(t,e)}function fi(e,t,r){if(xt(e,it)||Io(e,it,fr({},e[it])),go(r)&&!xt(e[it],t)){var n=e.constructor.name+".prototype."+t.toString();fe("'"+n+"' is decorated with 'override', but no such decorated member was found on prototype.")}Wh(e,r,t),go(r)||(e[it][t]=r)}function Wh(e,t,r){if(!go(t)&&xt(e[it],r)){var n=e.constructor.name+".prototype."+r.toString(),i=e[it][r].annotationType_,o=t.annotationType_;fe("Cannot apply '@"+o+"' to '"+n+"':"+(`
1
+ import{b as zi,d as wt,e as $s}from"./chunk-OWXA5F6K.min.js";import{a as Ki,b as Cs,c as Us}from"./chunk-EHSVSU5O.min.js";var Qc=Ki((Px,Yc)=>{"use strict";Yc.exports=zs;var Xc=128,lh=127,dh=~lh,ph=Math.pow(2,31);function zs(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw zs.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=ph;)t[r++]=e&255|Xc,e/=128;for(;e&dh;)t[r++]=e&255|Xc,e>>>=7;return t[r]=e|0,zs.bytes=r-n+1,t}});var tf=Ki((Rx,ef)=>{"use strict";ef.exports=qs;var yh=128,Zc=127;function qs(e,n){var r=0,n=n||0,i=0,o=n,s,a=e.length;do{if(o>=a||i>49)throw qs.bytes=0,new RangeError("Could not decode varint");s=e[o++],r+=i<28?(s&Zc)<<i:(s&Zc)*Math.pow(2,i),i+=7}while(s>=yh);return qs.bytes=o-n,r}});var nf=Ki((Cx,rf)=>{"use strict";var hh=Math.pow(2,7),gh=Math.pow(2,14),mh=Math.pow(2,21),bh=Math.pow(2,28),vh=Math.pow(2,35),_h=Math.pow(2,42),wh=Math.pow(2,49),Th=Math.pow(2,56),Ah=Math.pow(2,63);rf.exports=function(e){return e<hh?1:e<gh?2:e<mh?3:e<bh?4:e<vh?5:e<_h?6:e<wh?7:e<Th?8:e<Ah?9:10}});var io=Ki(($x,of)=>{"use strict";of.exports={encode:Qc(),decode:tf(),encodingLength:nf()}});var Cy=["string","number","bigint","symbol"],$y=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function qu(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(Cy.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(Uy(e))return"Buffer";let r=By(e);return r||"Object"}function Uy(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function By(e){let t=Object.prototype.toString.call(e).slice(8,-1);if($y.includes(t))return t}var V=class{constructor(t,r,n){this.major=t,this.majorEncoded=t<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(t){return this.major<t.major?-1:this.major>t.major?1:0}};V.uint=new V(0,"uint",!0);V.negint=new V(1,"negint",!0);V.bytes=new V(2,"bytes",!0);V.string=new V(3,"string",!0);V.array=new V(4,"array",!1);V.map=new V(5,"map",!1);V.tag=new V(6,"tag",!1);V.float=new V(7,"float",!0);V.false=new V(7,"false",!0);V.true=new V(7,"true",!0);V.null=new V(7,"null",!0);V.undefined=new V(7,"undefined",!0);V.break=new V(7,"break",!0);var ce=class{constructor(t,r,n){this.type=t,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};var hn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",My=new TextDecoder,ky=new TextEncoder;function qi(e){return hn&&globalThis.Buffer.isBuffer(e)}function Ju(e){return e instanceof Uint8Array?qi(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var Xu=hn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Wu(e,t,r):(e,t,r)=>r-t>64?My.decode(e.subarray(t,r)):Wu(e,t,r),Yu=hn?e=>e.length>64?globalThis.Buffer.from(e):Gu(e):e=>e.length>64?ky.encode(e):Gu(e);var gn=hn?(e,t,r)=>qi(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Qu=hn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),Ju(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},Zu=hn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function ec(e,t){if(qi(e)&&qi(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function Gu(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function Wu(e,t,r){let n=[];for(;t<r;){let i=e[t],o=null,s=i>239?4:i>223?3:i>191?2:1;if(t+s<=r){let a,c,f,l;switch(s){case 1:i<128&&(o=i);break;case 2:a=e[t+1],(a&192)===128&&(l=(i&31)<<6|a&63,l>127&&(o=l));break;case 3:a=e[t+1],c=e[t+2],(a&192)===128&&(c&192)===128&&(l=(i&15)<<12|(a&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:a=e[t+1],c=e[t+2],f=e[t+3],(a&192)===128&&(c&192)===128&&(f&192)===128&&(l=(i&15)<<18|(a&63)<<12|(c&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),t+=s}return Dy(n)}var Hu=4096;function Dy(e){let t=e.length;if(t<=Hu)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Hu));return r}var Ly=256,Gi=class{constructor(t=Ly){this.chunkSize=t,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(t){let r=this.chunks[this.chunks.length-1];if(this.cursor+t.length<=this.maxCursor+1){let i=r.length-(this.maxCursor-this.cursor)-1;r.set(t,i)}else{if(r){let i=r.length-(this.maxCursor-this.cursor)-1;i<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,i),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=Zu(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(t,0)):(this.chunks.push(t),this.maxCursor+=t.length)}this.cursor+=t.length}toBytes(t=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];t&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=gn(n,0,this.cursor)}else r=Qu(this.chunks,this.cursor);return t&&this.reset(),r}};var ve="CBOR decode error:",Bs="CBOR encode error:",Xn=[];Xn[23]=1;Xn[24]=2;Xn[25]=3;Xn[26]=5;Xn[27]=9;function sr(e,t,r){if(e.length-t<r)throw new Error(`${ve} not enough data for type`)}var Ge=[24,256,65536,4294967296,BigInt("18446744073709551616")];function ut(e,t,r){sr(e,t,1);let n=e[t];if(r.strict===!0&&n<Ge[0])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function ct(e,t,r){sr(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Ge[1])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function ft(e,t,r){sr(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Ge[2])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);return n}function lt(e,t,r){sr(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&o<Ge[3])throw new Error(`${ve} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(r.allowBigInt===!0)return o;throw new Error(`${ve} integers outside of the safe integer range are not supported`)}function tc(e,t,r,n){return new ce(V.uint,ut(e,t+1,n),2)}function rc(e,t,r,n){return new ce(V.uint,ct(e,t+1,n),3)}function nc(e,t,r,n){return new ce(V.uint,ft(e,t+1,n),5)}function ic(e,t,r,n){return new ce(V.uint,lt(e,t+1,n),9)}function Tt(e,t){return Je(e,0,t.value)}function Je(e,t,r){if(r<Ge[0]){let n=Number(r);e.push([t|n])}else if(r<Ge[1]){let n=Number(r);e.push([t|24,n])}else if(r<Ge[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Ge[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Ge[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),s=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=o&255,o=o>>8,i[7]=o&255,o=o>>8,i[6]=o&255,o=o>>8,i[5]=o&255,i[4]=s&255,s=s>>8,i[3]=s&255,s=s>>8,i[2]=s&255,s=s>>8,i[1]=s&255,e.push(i)}else throw new Error(`${ve} encountered BigInt larger than allowable range`)}}Tt.encodedSize=function(t){return Je.encodedSize(t.value)};Je.encodedSize=function(t){return t<Ge[0]?1:t<Ge[1]?2:t<Ge[2]?3:t<Ge[3]?5:9};Tt.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function oc(e,t,r,n){return new ce(V.negint,-1-ut(e,t+1,n),2)}function sc(e,t,r,n){return new ce(V.negint,-1-ct(e,t+1,n),3)}function ac(e,t,r,n){return new ce(V.negint,-1-ft(e,t+1,n),5)}var Ms=BigInt(-1),uc=BigInt(1);function cc(e,t,r,n){let i=lt(e,t+1,n);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new ce(V.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${ve} integers outside of the safe integer range are not supported`);return new ce(V.negint,Ms-BigInt(i),9)}function Wi(e,t){let r=t.value,n=typeof r=="bigint"?r*Ms-uc:r*-1-1;Je(e,t.type.majorEncoded,n)}Wi.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Ms-uc:r*-1-1;return n<Ge[0]?1:n<Ge[1]?2:n<Ge[2]?3:n<Ge[3]?5:9};Wi.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function Yn(e,t,r,n){sr(e,t,r+n);let i=gn(e,t+r,t+r+n);return new ce(V.bytes,i,r+n)}function fc(e,t,r,n){return Yn(e,t,1,r)}function lc(e,t,r,n){return Yn(e,t,2,ut(e,t+1,n))}function dc(e,t,r,n){return Yn(e,t,3,ct(e,t+1,n))}function pc(e,t,r,n){return Yn(e,t,5,ft(e,t+1,n))}function yc(e,t,r,n){let i=lt(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer bytes lengths not supported`);return Yn(e,t,9,i)}function Hi(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===V.string?Yu(e.value):e.value),e.encodedBytes}function mn(e,t){let r=Hi(t);Je(e,t.type.majorEncoded,r.length),e.push(r)}mn.encodedSize=function(t){let r=Hi(t);return Je.encodedSize(r.length)+r.length};mn.compareTokens=function(t,r){return Fy(Hi(t),Hi(r))};function Fy(e,t){return e.length<t.length?-1:e.length>t.length?1:ec(e,t)}function Qn(e,t,r,n,i){let o=r+n;sr(e,t,o);let s=new ce(V.string,Xu(e,t+r,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=gn(e,t+r,t+o)),s}function hc(e,t,r,n){return Qn(e,t,1,r,n)}function gc(e,t,r,n){return Qn(e,t,2,ut(e,t+1,n),n)}function mc(e,t,r,n){return Qn(e,t,3,ct(e,t+1,n),n)}function bc(e,t,r,n){return Qn(e,t,5,ft(e,t+1,n),n)}function vc(e,t,r,n){let i=lt(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer string lengths not supported`);return Qn(e,t,9,i,n)}var _c=mn;function bn(e,t,r,n){return new ce(V.array,n,r)}function wc(e,t,r,n){return bn(e,t,1,r)}function Tc(e,t,r,n){return bn(e,t,2,ut(e,t+1,n))}function Ac(e,t,r,n){return bn(e,t,3,ct(e,t+1,n))}function Oc(e,t,r,n){return bn(e,t,5,ft(e,t+1,n))}function Ic(e,t,r,n){let i=lt(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer array lengths not supported`);return bn(e,t,9,i)}function Ec(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return bn(e,t,1,1/0)}function Ji(e,t){Je(e,V.array.majorEncoded,t.value)}Ji.compareTokens=Tt.compareTokens;Ji.encodedSize=function(t){return Je.encodedSize(t.value)};function vn(e,t,r,n){return new ce(V.map,n,r)}function Sc(e,t,r,n){return vn(e,t,1,r)}function xc(e,t,r,n){return vn(e,t,2,ut(e,t+1,n))}function Nc(e,t,r,n){return vn(e,t,3,ct(e,t+1,n))}function Pc(e,t,r,n){return vn(e,t,5,ft(e,t+1,n))}function Rc(e,t,r,n){let i=lt(e,t+1,n);if(typeof i=="bigint")throw new Error(`${ve} 64-bit integer map lengths not supported`);return vn(e,t,9,i)}function Cc(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return vn(e,t,1,1/0)}function Xi(e,t){Je(e,V.map.majorEncoded,t.value)}Xi.compareTokens=Tt.compareTokens;Xi.encodedSize=function(t){return Je.encodedSize(t.value)};function $c(e,t,r,n){return new ce(V.tag,r,1)}function Uc(e,t,r,n){return new ce(V.tag,ut(e,t+1,n),2)}function Bc(e,t,r,n){return new ce(V.tag,ct(e,t+1,n),3)}function Mc(e,t,r,n){return new ce(V.tag,ft(e,t+1,n),5)}function kc(e,t,r,n){return new ce(V.tag,lt(e,t+1,n),9)}function Yi(e,t){Je(e,V.tag.majorEncoded,t.value)}Yi.compareTokens=Tt.compareTokens;Yi.encodedSize=function(t){return Je.encodedSize(t.value)};var Wy=20,Hy=21,Jy=22,Xy=23;function Dc(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${ve} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new ce(V.null,null,1):new ce(V.undefined,void 0,1)}function Lc(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${ve} indefinite length items not allowed`);return new ce(V.break,void 0,1)}function ks(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${ve} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${ve} Infinity values are not supported`)}return new ce(V.float,e,t)}function jc(e,t,r,n){return ks(Ds(e,t+1),3,n)}function Fc(e,t,r,n){return ks(Ls(e,t+1),5,n)}function Vc(e,t,r,n){return ks(Gc(e,t+1),9,n)}function Qi(e,t,r){let n=t.value;if(n===!1)e.push([V.float.majorEncoded|Wy]);else if(n===!0)e.push([V.float.majorEncoded|Hy]);else if(n===null)e.push([V.float.majorEncoded|Jy]);else if(n===void 0)e.push([V.float.majorEncoded|Xy]);else{let i,o=!1;(!r||r.float64!==!0)&&(zc(n),i=Ds(Dt,1),n===i||Number.isNaN(n)?(Dt[0]=249,e.push(Dt.slice(0,3)),o=!0):(qc(n),i=Ls(Dt,1),n===i&&(Dt[0]=250,e.push(Dt.slice(0,5)),o=!0))),o||(Yy(n),i=Gc(Dt,1),Dt[0]=251,e.push(Dt.slice(0,9)))}}Qi.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){zc(n);let i=Ds(Dt,1);if(n===i||Number.isNaN(n))return 3;if(qc(n),i=Ls(Dt,1),n===i)return 5}return 9};var Kc=new ArrayBuffer(9),At=new DataView(Kc,1),Dt=new Uint8Array(Kc,0);function zc(e){if(e===1/0)At.setUint16(0,31744,!1);else if(e===-1/0)At.setUint16(0,64512,!1);else if(Number.isNaN(e))At.setUint16(0,32256,!1);else{At.setFloat32(0,e);let t=At.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)At.setUint16(0,31744,!1);else if(r===0)At.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?At.setUint16(0,0):i<-14?At.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):At.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Ds(e,t){if(e.length-t<2)throw new Error(`${ve} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,o;return n===0?o=i*2**-24:n!==31?o=(i+1024)*2**(n-25):o=i===0?1/0:NaN,r&32768?-o:o}function qc(e){At.setFloat32(0,e,!1)}function Ls(e,t){if(e.length-t<4)throw new Error(`${ve} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function Yy(e){At.setFloat64(0,e,!1)}function Gc(e,t){if(e.length-t<8)throw new Error(`${ve} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}Qi.compareTokens=Tt.compareTokens;function Ie(e,t,r){throw new Error(`${ve} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function Zi(e){return()=>{throw new Error(`${ve} ${e}`)}}var oe=[];for(let e=0;e<=23;e++)oe[e]=Ie;oe[24]=tc;oe[25]=rc;oe[26]=nc;oe[27]=ic;oe[28]=Ie;oe[29]=Ie;oe[30]=Ie;oe[31]=Ie;for(let e=32;e<=55;e++)oe[e]=Ie;oe[56]=oc;oe[57]=sc;oe[58]=ac;oe[59]=cc;oe[60]=Ie;oe[61]=Ie;oe[62]=Ie;oe[63]=Ie;for(let e=64;e<=87;e++)oe[e]=fc;oe[88]=lc;oe[89]=dc;oe[90]=pc;oe[91]=yc;oe[92]=Ie;oe[93]=Ie;oe[94]=Ie;oe[95]=Zi("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)oe[e]=hc;oe[120]=gc;oe[121]=mc;oe[122]=bc;oe[123]=vc;oe[124]=Ie;oe[125]=Ie;oe[126]=Ie;oe[127]=Zi("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)oe[e]=wc;oe[152]=Tc;oe[153]=Ac;oe[154]=Oc;oe[155]=Ic;oe[156]=Ie;oe[157]=Ie;oe[158]=Ie;oe[159]=Ec;for(let e=160;e<=183;e++)oe[e]=Sc;oe[184]=xc;oe[185]=Nc;oe[186]=Pc;oe[187]=Rc;oe[188]=Ie;oe[189]=Ie;oe[190]=Ie;oe[191]=Cc;for(let e=192;e<=215;e++)oe[e]=$c;oe[216]=Uc;oe[217]=Bc;oe[218]=Mc;oe[219]=kc;oe[220]=Ie;oe[221]=Ie;oe[222]=Ie;oe[223]=Ie;for(let e=224;e<=243;e++)oe[e]=Zi("simple values are not supported");oe[244]=Ie;oe[245]=Ie;oe[246]=Ie;oe[247]=Dc;oe[248]=Zi("simple values are not supported");oe[249]=jc;oe[250]=Fc;oe[251]=Vc;oe[252]=Ie;oe[253]=Ie;oe[254]=Ie;oe[255]=Lc;var Lt=[];for(let e=0;e<24;e++)Lt[e]=new ce(V.uint,e,1);for(let e=-1;e>=-24;e--)Lt[31-e]=new ce(V.negint,e,1);Lt[64]=new ce(V.bytes,new Uint8Array(0),1);Lt[96]=new ce(V.string,"",1);Lt[128]=new ce(V.array,0,1);Lt[160]=new ce(V.map,0,1);Lt[244]=new ce(V.false,!1,1);Lt[245]=new ce(V.true,!0,1);Lt[246]=new ce(V.null,null,1);function js(){let e=[];return e[V.uint.major]=Tt,e[V.negint.major]=Wi,e[V.bytes.major]=mn,e[V.string.major]=_c,e[V.array.major]=Ji,e[V.map.major]=Xi,e[V.tag.major]=Yi,e[V.float.major]=Qi,e}var mx=js(),bx=new Gi,to=class e{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${Bs} object contains circular references`);return new e(r,t)}},mr={null:new ce(V.null,null),undefined:new ce(V.undefined,void 0),true:new ce(V.true,!0),false:new ce(V.false,!1),emptyArray:new ce(V.array,0),emptyMap:new ce(V.map,0)},br={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new ce(V.float,e):e>=0?new ce(V.uint,e):new ce(V.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new ce(V.uint,e):new ce(V.negint,e)},Uint8Array(e,t,r,n){return new ce(V.bytes,e)},string(e,t,r,n){return new ce(V.string,e)},boolean(e,t,r,n){return e?mr.true:mr.false},null(e,t,r,n){return mr.null},undefined(e,t,r,n){return mr.undefined},ArrayBuffer(e,t,r,n){return new ce(V.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new ce(V.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[mr.emptyArray,new ce(V.break)]:mr.emptyArray;n=to.createCheck(n,e);let i=[],o=0;for(let s of e)i[o++]=eo(s,r,n);return r.addBreakTokens?[new ce(V.array,e.length),i,new ce(V.break)]:[new ce(V.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",o=i?e.keys():Object.keys(e),s=i?e.size:o.length;if(!s)return r.addBreakTokens===!0?[mr.emptyMap,new ce(V.break)]:mr.emptyMap;n=to.createCheck(n,e);let a=[],c=0;for(let f of o)a[c++]=[eo(f,r,n),eo(i?e.get(f):e[f],r,n)];return eh(a,r),r.addBreakTokens?[new ce(V.map,s),a,new ce(V.break)]:[new ce(V.map,s),a]}};br.Map=br.Object;br.Buffer=br.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))br[`${e}Array`]=br.DataView;function eo(e,t={},r){let n=qu(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||br[n];if(typeof i=="function"){let s=i(e,n,t,r);if(s!=null)return s}let o=br[n];if(!o)throw new Error(`${Bs} unsupported type: ${n}`);return o(e,n,t,r)}function eh(e,t){t.mapSorter&&e.sort(t.mapSorter)}var th={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Fs=class{constructor(t,r={}){this._pos=0,this.data=t,this.options=r}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let t=this.data[this._pos],r=Lt[t];if(r===void 0){let n=oe[t];if(!n)throw new Error(`${ve} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let i=t&31;r=n(this.data,this._pos,i,this.options)}return this._pos+=r.encodedLength,r}},Zn=Symbol.for("DONE"),ro=Symbol.for("BREAK");function rh(e,t,r){let n=[];for(let i=0;i<e.value;i++){let o=ei(t,r);if(o===ro){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed array`)}if(o===Zn)throw new Error(`${ve} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=o}return n}function nh(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},o=n?new Map:void 0;for(let s=0;s<e.value;s++){let a=ei(t,r);if(a===ro){if(e.value===1/0)break;throw new Error(`${ve} got unexpected break to lengthed map`)}if(a===Zn)throw new Error(`${ve} found map but not enough entries (got ${s} [no key], expected ${e.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${ve} non-string keys not supported (got ${typeof a})`);if(r.rejectDuplicateMapKeys===!0&&(n&&o.has(a)||!n&&a in i))throw new Error(`${ve} found repeat map key "${a}"`);let c=ei(t,r);if(c===Zn)throw new Error(`${ve} found map but not enough entries (got ${s} [no value], expected ${e.value})`);n?o.set(a,c):i[a]=c}return n?o:i}function ei(e,t){if(e.done())return Zn;let r=e.next();if(r.type===V.break)return ro;if(r.type.terminal)return r.value;if(r.type===V.array)return rh(r,e,t);if(r.type===V.map)return nh(r,e,t);if(r.type===V.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=ei(e,t);return t.tags[r.value](n)}throw new Error(`${ve} tag not supported (${r.value})`)}throw new Error("unsupported")}function Wc(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ve} data to decode must be a Uint8Array`);t=Object.assign({},th,t);let r=t.tokenizer||new Fs(e,t),n=ei(r,t);if(n===Zn)throw new Error(`${ve} did not find any content to decode`);if(n===ro)throw new Error(`${ve} got unexpected break`);return[n,e.subarray(r.pos())]}function Vs(e,t){let[r,n]=Wc(e,t);if(n.length>0)throw new Error(`${ve} too many terminals, data makes no sense`);return r}var Jc=42;function sh(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=wt.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new ce(V.tag,Jc),new ce(V.bytes,r)]}function ah(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function uh(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var Hc={float64:!0,typeEncoders:{Object:sh,undefined:ah,number:uh}},xx={...Hc,typeEncoders:{...Hc.typeEncoders}};function ch(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return wt.decode(e.subarray(1))}var no={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};no.tags[Jc]=ch;var Nx={...no,tags:no.tags.slice()};var Ks=e=>Vs(e,no);var vr=Cs(io(),1),ti={SHA2_256:18,LENGTH:32,DAG_PB:112},Gs=40;function _n(e,t){if(!e.length)throw new Error("Unexpected end of data");let r=vr.default.decode(e);return t.seek(vr.default.decode.bytes),r}function Ws(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;return{version:2,characteristics:[t.getBigUint64(r,!0),t.getBigUint64(r+=8,!0)],dataOffset:Number(t.getBigUint64(r+=8,!0)),dataSize:Number(t.getBigUint64(r+=8,!0)),indexOffset:Number(t.getBigUint64(r+=8,!0))}}function Hs(e){vr.default.decode(e);let t=vr.default.decode.bytes,r=vr.default.decode(e.subarray(vr.default.decode.bytes)),n=vr.default.decode.bytes;return t+n+r}var _r={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},ri={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":_r.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(_r.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=ri["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=ri["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:_r.Int,CarV1HeaderOrV2Pragma:e=>{if(_r.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=ri["CarV1HeaderOrV2Pragma > roots (anon)"](e[o]);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.roots=a}}break;case"version":{n--;let a=ri.Int(e[o]);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},ni={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":_r.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(_r.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=ni["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=ni["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:_r.Int,CarV1HeaderOrV2Pragma:e=>{if(_r.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=ni["CarV1HeaderOrV2Pragma > roots (anon)"](s);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.roots=a}}break;case"version":{n--;let a=ni.Int(s);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},Js={toTyped:ri.CarV1HeaderOrV2Pragma,toRepresentation:ni.CarV1HeaderOrV2Pragma};var zx=js();var Sh=Cs(io(),1);var Jx=[new ce(V.map,2),new ce(V.string,"version"),new ce(V.uint,1),new ce(V.string,"roots")],Xx=new ce(V.tag,42);async function Xs(e,t){let r=_n(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR header (zero length)");let n=await e.exactly(r,!0),i=Ks(n);if(Js.toTyped(i)===void 0)throw new Error("Invalid CAR header format");if(i.version!==1&&i.version!==2||t!==void 0&&i.version!==t)throw new Error(`Invalid CAR version: ${i.version}${t!==void 0?` (expected ${t})`:""}`);if(i.version===1){if(!Array.isArray(i.roots))throw new Error("Invalid CAR header format");return i}if(i.roots!==void 0)throw new Error("Invalid CAR header format");let o=Ws(await e.exactly(Gs,!0));e.seek(o.dataOffset-e.pos);let s=await Xs(e,1);return Object.assign(s,o)}async function Nh(e){let t=await e.exactly(2,!1);if(t[0]===ti.SHA2_256&&t[1]===ti.LENGTH){let s=await e.exactly(34,!0),a=zi(s);return wt.create(0,ti.DAG_PB,a)}let r=_n(await e.upTo(8),e);if(r!==1)throw new Error(`Unexpected CID version (${r})`);let n=_n(await e.upTo(8),e),i=await e.exactly(Hs(await e.upTo(8)),!0),o=zi(i);return wt.create(r,n,o)}async function sf(e){let t=e.pos,r=_n(await e.upTo(8),e);if(r===0)throw new Error("Invalid CAR section (zero length)");r+=e.pos-t;let n=await Nh(e),i=r-Number(e.pos-t);return{cid:n,length:r,blockLength:i}}async function Ph(e){let{cid:t,blockLength:r}=await sf(e);return{bytes:await e.exactly(r,!0),cid:t}}async function Rh(e){let t=e.pos,{cid:r,length:n,blockLength:i}=await sf(e),o={cid:r,length:n,blockLength:i,offset:t,blockOffset:e.pos};return e.seek(o.blockLength),o}function oo(e){let t=(async()=>{let r=await Xs(e);if(r.version===2){let n=e.pos-r.dataOffset;e=$h(e,r.dataSize-n)}return r})();return{header:()=>t,async*blocks(){for(await t;(await e.upTo(8)).length>0;)yield await Ph(e)},async*blocksIndex(){for(await t;(await e.upTo(8)).length>0;)yield await Rh(e)}}}function ii(e){let t=0;return{async upTo(r){return e.subarray(t,t+Math.min(r,e.length-t))},async exactly(r,n=!1){if(r>e.length-t)throw new Error("Unexpected end of data");let i=e.subarray(t,t+r);return n&&(t+=r),i},seek(r){t+=r},get pos(){return t}}}function Ch(e){let t=0,r=0,n=0,i=new Uint8Array(0),o=async s=>{r=i.length-n;let a=[i.subarray(n)];for(;r<s;){let f=await e();if(f==null)break;r<0?f.length>r&&a.push(f.subarray(-r)):a.push(f),r+=f.length}i=new Uint8Array(a.reduce((f,l)=>f+l.length,0));let c=0;for(let f of a)i.set(f,c),c+=f.length;n=0};return{async upTo(s){return i.length-n<s&&await o(s),i.subarray(n,n+Math.min(i.length-n,s))},async exactly(s,a=!1){if(i.length-n<s&&await o(s),i.length-n<s)throw new Error("Unexpected end of data");let c=i.subarray(n,n+s);return a&&(t+=s,n+=s),c},seek(s){t+=s,n+=s},get pos(){return t}}}function so(e){let t=e[Symbol.asyncIterator]();async function r(){let n=await t.next();return n.done?null:n.value}return Ch(r)}function $h(e,t){let r=0;return{async upTo(n){let i=await e.upTo(n);return i.length+r>t&&(i=i.subarray(0,t-r)),i},async exactly(n,i=!1){let o=await e.exactly(n,i);if(o.length+r>t)throw new Error("Unexpected end of data");return i&&(r+=n),o},seek(n){r+=n,e.seek(n)},get pos(){return e.pos}}}var jr=class{constructor(t,r){this._header=t,this._blocks=r,this._keys=r.map(n=>n.cid.toString())}get version(){return this._header.version}async getRoots(){return this._header.roots}async has(t){return this._keys.indexOf(t.toString())>-1}async get(t){let r=this._keys.indexOf(t.toString());return r>-1?this._blocks[r]:void 0}async*blocks(){for(let t of this._blocks)yield t}async*cids(){for(let t of this._blocks)yield t.cid}static async fromBytes(t){if(!(t instanceof Uint8Array))throw new TypeError("fromBytes() requires a Uint8Array");return af(ii(t))}static async fromIterable(t){if(!t||typeof t[Symbol.asyncIterator]!="function")throw new TypeError("fromIterable() requires an async iterable");return af(so(t))}};async function af(e){let t=oo(e),r=await t.header(),n=[];for await(let i of t.blocks())n.push(i);return new jr(r,n)}var Bh=Cs(io(),1);var Mh={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,r){return"Cannot apply '"+t+"' to '"+r.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,r){return"[mobx.array] Index out of bounds, "+t+" is larger than "+r},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,r){return"the entry '"+t+"' does not exist in the observable map '"+r+"'"},26:"please specify a property",27:function(t,r){return"no observable property '"+t.toString()+"' found on the observable object '"+r+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,r){return"Cycle detected in computation "+t+": "+r},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},kh=Mh;function fe(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=typeof e=="string"?e:kh[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var Dh={};function Oo(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Dh}var Ef=Object.assign,ho=Object.getOwnPropertyDescriptor,Yt=Object.defineProperty,ci=Object.prototype,go=[];Object.freeze(go);var fa={};Object.freeze(fa);var Lh=typeof Proxy<"u",jh=Object.toString();function Sf(){Lh||fe("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function oi(e){J.verifyProxies&&fe("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function Ct(){return++J.mobxGuid}function la(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Tn=function(){};function je(e){return typeof e=="function"}function Vr(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Io(e){return e!==null&&typeof e=="object"}function zt(e){if(!Io(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===jh}function xf(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Eo(e,t,r){Yt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Nf(e,t,r){Yt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function Or(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Io(n)&&n[r]===!0}}function En(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function Fh(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function ar(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Pf=typeof Object.getOwnPropertySymbols<"u";function Vh(e){var t=Object.keys(e);if(!Pf)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return ci.propertyIsEnumerable.call(e,n)})):t}var So=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Pf?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Zs(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Rf(e){return e===null?null:typeof e=="object"?""+e:e}function xt(e,t){return ci.hasOwnProperty.call(e,t)}var Kh=Object.getOwnPropertyDescriptors||function(t){var r={};return So(t).forEach(function(n){r[n]=ho(t,n)}),r};function dt(e,t){return!!(e&t)}function pt(e,t,r){return r?e|=t:e&=~t,e}function uf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function cf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qh(n.key),n)}}function Sn(e,t,r){return t&&cf(e.prototype,t),r&&cf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function An(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Gh(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fr.apply(null,arguments)}function Cf(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ea(e,t)}function ea(e,t){return ea=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},ea(e,t)}function zh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qh(e){var t=zh(e,"string");return typeof t=="symbol"?t:t+""}function Gh(e,t){if(e){if(typeof e=="string")return uf(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uf(e,t):void 0}}var it=Symbol("mobx-stored-annotations");function Qt(e){function t(r,n){if(li(n))return e.decorate_20223_(r,n);fi(r,n,e)}return Object.assign(t,e)}function fi(e,t,r){if(xt(e,it)||Eo(e,it,fr({},e[it])),mo(r)&&!xt(e[it],t)){var n=e.constructor.name+".prototype."+t.toString();fe("'"+n+"' is decorated with 'override', but no such decorated member was found on prototype.")}Wh(e,r,t),mo(r)||(e[it][t]=r)}function Wh(e,t,r){if(!mo(t)&&xt(e[it],r)){var n=e.constructor.name+".prototype."+r.toString(),i=e[it][r].annotationType_,o=t.annotationType_;fe("Cannot apply '@"+o+"' to '"+n+"':"+(`
3
3
  The field is already decorated with '@`+i+"'.")+`
4
4
  Re-decorating fields is not allowed.
5
- Use '@override' decorator for methods overridden by subclass.`)}}function Hh(e){return xt(e,it)||Io(e,it,fr({},e[it])),e[it]}function li(e){return typeof e=="object"&&typeof e.kind=="string"}function So(e,t){t.includes(e.kind)||fe("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var be=Symbol("mobx administration"),Ir=function(){function e(r){r===void 0&&(r="Atom@"+Ct()),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Ee.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return Xf(this)},t.reportChanged=function(){Et(),Yf(this),St()},t.toString=function(){return this.name_},En(e,[{key:"isBeingObserved",get:function(){return dt(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=pt(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return dt(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=pt(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return dt(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=pt(this.flags_,e.diffValueMask_,n===1)}}])}();Ir.isBeingObservedMask_=1;Ir.isPendingUnobservationMask_=2;Ir.diffValueMask_=4;var da=Or("Atom",Ir);function $f(e,t,r){t===void 0&&(t=wn),r===void 0&&(r=wn);var n=new Ir(e);return t!==wn&&xn(n,t),r!==wn&&Hr(n,r),n}function Jh(e,t){return e===t}function Xh(e,t){return _a(e,t)}function Yh(e,t){return _a(e,t,1)}function Qh(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ve={identity:Jh,structural:Xh,default:Qh,shallow:Yh};function Kr(e,t,r){return On(e)?e:Array.isArray(e)?$e.array(e,{name:r}):zt(e)?$e.object(e,void 0,{name:r}):In(e)?$e.map(e,{name:r}):ar(e)?$e.set(e,{name:r}):typeof e=="function"&&!Ar(e)&&!ui(e)?xf(e)?An(e):ai(r,e):e}function Zh(e,t,r){if(e==null||Gr(e)||Nn(e)||Zt(e)||jt(e))return e;if(Array.isArray(e))return $e.array(e,{name:r,deep:!1});if(zt(e))return $e.object(e,void 0,{name:r,deep:!1});if(In(e))return $e.map(e,{name:r,deep:!1});if(ar(e))return $e.set(e,{name:r,deep:!1});fe("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function xo(e){return e}function eg(e,t){return On(e)&&fe("observable.struct should not be used with observable values"),_a(e,t)?t:e}var tg="override";function go(e){return e.annotationType_===tg}function di(e,t){return{annotationType_:e,options_:t,make_:rg,extend_:ng,decorate_20223_:ig}}function rg(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(Ar(r.value))return 1;var o=Uf(e,this,t,r,!1);return Yt(n,t,o),2}function ng(e,t,r,n){var i=Uf(e,this,t,r);return e.defineProperty_(t,i,n)}function ig(e,t){So(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,o=this,s=function(f){var l,g,P,E;return zr((l=(g=o.options_)==null?void 0:g.name)!=null?l:n.toString(),f,(P=(E=o.options_)==null?void 0:E.autoAction)!=null?P:!1)};if(r=="field")return function(c){var f,l=c;return Ar(l)||(l=s(l)),(f=o.options_)!=null&&f.bound&&(l=l.bind(this),l.isMobxAction=!0),l};if(r=="method"){var a;return Ar(e)||(e=s(e)),(a=this.options_)!=null&&a.bound&&i(function(){var c=this,f=c[n].bind(c);f.isMobxAction=!0,c[n]=f}),e}fe("Cannot apply '"+o.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
5
+ Use '@override' decorator for methods overridden by subclass.`)}}function Hh(e){return xt(e,it)||Eo(e,it,fr({},e[it])),e[it]}function li(e){return typeof e=="object"&&typeof e.kind=="string"}function xo(e,t){t.includes(e.kind)||fe("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var be=Symbol("mobx administration"),Ir=function(){function e(r){r===void 0&&(r="Atom@"+Ct()),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Ee.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return Xf(this)},t.reportChanged=function(){Et(),Yf(this),St()},t.toString=function(){return this.name_},Sn(e,[{key:"isBeingObserved",get:function(){return dt(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=pt(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return dt(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=pt(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return dt(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=pt(this.flags_,e.diffValueMask_,n===1)}}])}();Ir.isBeingObservedMask_=1;Ir.isPendingUnobservationMask_=2;Ir.diffValueMask_=4;var da=Or("Atom",Ir);function $f(e,t,r){t===void 0&&(t=Tn),r===void 0&&(r=Tn);var n=new Ir(e);return t!==Tn&&Nn(n,t),r!==Tn&&Hr(n,r),n}function Jh(e,t){return e===t}function Xh(e,t){return _a(e,t)}function Yh(e,t){return _a(e,t,1)}function Qh(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ve={identity:Jh,structural:Xh,default:Qh,shallow:Yh};function Kr(e,t,r){return In(e)?e:Array.isArray(e)?$e.array(e,{name:r}):zt(e)?$e.object(e,void 0,{name:r}):En(e)?$e.map(e,{name:r}):ar(e)?$e.set(e,{name:r}):typeof e=="function"&&!Ar(e)&&!ui(e)?xf(e)?On(e):ai(r,e):e}function Zh(e,t,r){if(e==null||Gr(e)||Pn(e)||Zt(e)||jt(e))return e;if(Array.isArray(e))return $e.array(e,{name:r,deep:!1});if(zt(e))return $e.object(e,void 0,{name:r,deep:!1});if(En(e))return $e.map(e,{name:r,deep:!1});if(ar(e))return $e.set(e,{name:r,deep:!1});fe("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function No(e){return e}function eg(e,t){return In(e)&&fe("observable.struct should not be used with observable values"),_a(e,t)?t:e}var tg="override";function mo(e){return e.annotationType_===tg}function di(e,t){return{annotationType_:e,options_:t,make_:rg,extend_:ng,decorate_20223_:ig}}function rg(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(Ar(r.value))return 1;var o=Uf(e,this,t,r,!1);return Yt(n,t,o),2}function ng(e,t,r,n){var i=Uf(e,this,t,r);return e.defineProperty_(t,i,n)}function ig(e,t){xo(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,o=this,s=function(f){var l,g,P,E;return zr((l=(g=o.options_)==null?void 0:g.name)!=null?l:n.toString(),f,(P=(E=o.options_)==null?void 0:E.autoAction)!=null?P:!1)};if(r=="field")return function(c){var f,l=c;return Ar(l)||(l=s(l)),(f=o.options_)!=null&&f.bound&&(l=l.bind(this),l.isMobxAction=!0),l};if(r=="method"){var a;return Ar(e)||(e=s(e)),(a=this.options_)!=null&&a.bound&&i(function(){var c=this,f=c[n].bind(c);f.isMobxAction=!0,c[n]=f}),e}fe("Cannot apply '"+o.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
6
6
  '`+o.annotationType_+"' can only be used on properties with a function value."))}function og(e,t,r,n){var i=t.annotationType_,o=n.value;je(o)||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
7
- '`+i+"' can only be used on properties with a function value."))}function Uf(e,t,r,n,i){var o,s,a,c,f,l,g;i===void 0&&(i=J.safeDescriptors),og(e,t,r,n);var P=n.value;if((o=t.options_)!=null&&o.bound){var E;P=P.bind((E=e.proxy_)!=null?E:e.target_)}return{value:zr((s=(a=t.options_)==null?void 0:a.name)!=null?s:r.toString(),P,(c=(f=t.options_)==null?void 0:f.autoAction)!=null?c:!1,(l=t.options_)!=null&&l.bound?(g=e.proxy_)!=null?g:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Bf(e,t){return{annotationType_:e,options_:t,make_:sg,extend_:ag,decorate_20223_:ug}}function sg(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!xt(e.target_,t)||!ui(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(ui(r.value))return 1;var o=Mf(e,this,t,r,!1,!1);return Yt(n,t,o),2}function ag(e,t,r,n){var i,o=Mf(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,o,n)}function ug(e,t){var r;So(t,["method"]);var n=t.name,i=t.addInitializer;return ui(e)||(e=An(e)),(r=this.options_)!=null&&r.bound&&i(function(){var o=this,s=o[n].bind(o);s.isMobXFlow=!0,o[n]=s}),e}function cg(e,t,r,n){var i=t.annotationType_,o=n.value;je(o)||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
8
- '`+i+"' can only be used on properties with a generator function value."))}function Mf(e,t,r,n,i,o){o===void 0&&(o=J.safeDescriptors),cg(e,t,r,n);var s=n.value;if(ui(s)||(s=An(s)),i){var a;s=s.bind((a=e.proxy_)!=null?a:e.target_),s.isMobXFlow=!0}return{value:s,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function pa(e,t){return{annotationType_:e,options_:t,make_:fg,extend_:lg,decorate_20223_:dg}}function fg(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function lg(e,t,r,n){return pg(e,this,t,r),e.defineComputedProperty_(t,fr({},this.options_,{get:r.get,set:r.set}),n)}function dg(e,t){So(t,["getter"]);var r=this,n=t.name,i=t.addInitializer;return i(function(){var o=Pn(this)[be],s=fr({},r.options_,{get:e,context:this});s.name||(s.name=o.name_+"."+n.toString()),o.values_.set(n,new Pt(s))}),function(){return this[be].getObservablePropValue_(n)}}function pg(e,t,r,n){var i=t.annotationType_,o=n.get;o||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
9
- '`+i+"' can only be used on getter(+setter) properties."))}function No(e,t){return{annotationType_:e,options_:t,make_:yg,extend_:hg,decorate_20223_:gg}}function yg(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function hg(e,t,r,n){var i,o;return mg(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(o=this.options_)==null?void 0:o.enhancer)!=null?i:Kr,n)}function gg(e,t){if(t.kind==="field")throw fe("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");So(t,["accessor"]);var r=this,n=t.kind,i=t.name,o=new WeakSet;function s(a,c){var f,l,g=Pn(a)[be],P=new Tr(c,(f=(l=r.options_)==null?void 0:l.enhancer)!=null?f:Kr,g.name_+"."+i.toString(),!1);g.values_.set(i,P),o.add(a)}if(n=="accessor")return{get:function(){return o.has(this)||s(this,e.get.call(this)),this[be].getObservablePropValue_(i)},set:function(c){return o.has(this)||s(this,c),this[be].setObservablePropValue_(i,c)},init:function(c){return o.has(this)||s(this,c),c}}}function mg(e,t,r,n){var i=t.annotationType_;"value"in n||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
10
- '`+i+"' cannot be used on getter/setter properties"))}var bg="true",vg=kf();function kf(e){return{annotationType_:bg,options_:e,make_:_g,extend_:wg,decorate_20223_:Tg}}function _g(e,t,r,n){var i,o;if(r.get)return ke.make_(e,t,r,n);if(r.set){var s=zr(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(Yt(n,t,{configurable:!0,set:s}),2)}if(n!==e.target_&&typeof r.value=="function"){var a;if(xf(r.value)){var c,f=(c=this.options_)!=null&&c.autoBind?An.bound:An;return f.make_(e,t,r,n)}var l=(a=this.options_)!=null&&a.autoBind?ai.bound:ai;return l.make_(e,t,r,n)}var g=((i=this.options_)==null?void 0:i.deep)===!1?$e.ref:$e;if(typeof r.value=="function"&&(o=this.options_)!=null&&o.autoBind){var P;r.value=r.value.bind((P=e.proxy_)!=null?P:e.target_)}return g.make_(e,t,r,n)}function wg(e,t,r,n){var i,o;if(r.get)return ke.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:zr(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var s;r.value=r.value.bind((s=e.proxy_)!=null?s:e.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?$e.ref:$e;return a.extend_(e,t,r,n)}function Tg(e,t){fe("'"+this.annotationType_+"' cannot be used as a decorator")}var Ag="observable",Og="observable.ref",Ig="observable.shallow",Eg="observable.struct",Df={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Df);function so(e){return e||Df}var ta=No(Ag),Sg=No(Og,{enhancer:xo}),xg=No(Ig,{enhancer:Zh}),Ng=No(Eg,{enhancer:eg}),Lf=Qt(ta);function ao(e){return e.deep===!0?Kr:e.deep===!1?xo:Rg(e.defaultDecorator)}function Pg(e){var t;return e?(t=e.defaultDecorator)!=null?t:kf(e):void 0}function Rg(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Kr}function jf(e,t,r){if(li(t))return ta.decorate_20223_(e,t);if(Vr(t)){fi(e,t,ta);return}return On(e)?e:zt(e)?$e.object(e,t,r):Array.isArray(e)?$e.array(e,t):In(e)?$e.map(e,t):ar(e)?$e.set(e,t):typeof e=="object"&&e!==null?e:$e.box(e,t)}Ef(jf,Lf);var Cg={box:function(t,r){var n=so(r);return new Tr(t,ao(n),n.name,!0,n.equals)},array:function(t,r){var n=so(r);return(J.useProxies===!1||n.proxy===!1?Cm:Tm)(t,ao(n),n.name)},map:function(t,r){var n=so(r);return new dl(t,ao(n),n.name)},set:function(t,r){var n=so(r);return new pl(t,ao(n),n.name)},object:function(t,r,n){return Jr(function(){return lm(J.useProxies===!1||n?.proxy===!1?Pn({},n):vm({},n),t,r)})},ref:Qt(Sg),shallow:Qt(xg),deep:Lf,struct:Qt(Ng)},$e=Ef(jf,Cg),Ff="computed",$g="computed.struct",ra=pa(Ff),Ug=pa($g,{equals:Ve.structural}),ke=function(t,r){if(li(r))return ra.decorate_20223_(t,r);if(Vr(r))return fi(t,r,ra);if(zt(t))return Qt(pa(Ff,t));je(t)||fe("First argument to `computed` should be an expression."),je(r)&&fe("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var n=zt(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Pt(n)};Object.assign(ke,ra);ke.struct=Qt(Ug);var ff,lf,mo=0,Bg=1,Mg=(ff=(lf=yo(function(){},"name"))==null?void 0:lf.configurable)!=null?ff:!1,df={value:"action",configurable:!0,writable:!1,enumerable:!1};function zr(e,t,r,n){r===void 0&&(r=!1),je(t)||fe("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&fe("actions should have valid names, got: '"+e+"'");function i(){return Vf(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Mg&&(df.value=e,Yt(i,"name",df)),i}function Vf(e,t,r,n,i){var o=kg(e,t,n,i);try{return r.apply(n,i)}catch(s){throw o.error_=s,s}finally{Dg(o)}}function kg(e,t,r,n){var i=Xe()&&!!e,o=0;if(i){o=Date.now();var s=n?Array.from(n):ho;yt({type:ha,name:e,object:r,arguments:s})}var a=J.trackingDerivation,c=!t||!a;Et();var f=J.allowStateChanges;c&&(Wr(),f=Po(!0));var l=ya(!0),g={runAsAction_:c,prevDerivation_:a,prevAllowStateChanges_:f,prevAllowStateReads_:l,notifySpy_:i,startTime_:o,actionId_:Bg++,parentActionId_:mo};return mo=g.actionId_,g}function Dg(e){mo!==e.actionId_&&fe(30),mo=e.parentActionId_,e.error_!==void 0&&(J.suppressReactionErrors=!0),Ro(e.prevAllowStateChanges_),si(e.prevAllowStateReads_),St(),e.runAsAction_&&cr(e.prevDerivation_),e.notifySpy_&&ht({time:Date.now()-e.startTime_}),J.suppressReactionErrors=!1}function Lg(e,t){var r=Po(e);try{return t()}finally{Ro(r)}}function Po(e){var t=J.allowStateChanges;return J.allowStateChanges=e,t}function Ro(e){J.allowStateChanges=e}var jg="create",Tr=function(e){function t(n,i,o,s,a){var c;return o===void 0&&(o="ObservableValue@"+Ct()),s===void 0&&(s=!0),a===void 0&&(a=Ve.default),c=e.call(this,o)||this,c.enhancer=void 0,c.name_=void 0,c.equals=void 0,c.hasUnreportedChange_=!1,c.interceptors_=void 0,c.changeListeners_=void 0,c.value_=void 0,c.dehancer=void 0,c.enhancer=i,c.name_=o,c.equals=a,c.value_=i(n,void 0,o),s&&Xe()&&qr({type:jg,object:c,observableKind:"value",debugObjectName:c.name_,newValue:""+c.value_}),c}Cf(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){var o=this.value_;if(i=this.prepareNewValue_(i),i!==J.UNCHANGED){var s=Xe();s&&yt({type:Ft,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:o}),this.setNewValue_(i),s&&ht()}},r.prepareNewValue_=function(i){if(Xt(this),Ot(this)){var o=It(this,{object:this,type:Ft,newValue:i});if(!o)return J.UNCHANGED;i=o.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?J.UNCHANGED:i},r.setNewValue_=function(i){var o=this.value_;this.value_=i,this.reportChanged(),Vt(this)&&Kt(this,{type:Ft,object:this,newValue:i,oldValue:o})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return gi(this,i)},r.observe_=function(i,o){return o&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Ft,newValue:this.value_,oldValue:void 0}),mi(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Rf(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(Ir),Fg=Or("ObservableValue",Tr),Pt=function(){function e(r){this.dependenciesState_=Ee.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ee.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new bo(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Nt.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||fe(31),this.derivation=r.get,this.name_=r.name||"ComputedValue@"+Ct(),r.set&&(this.setter_=zr(this.name_+"-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Ve.structural:Ve.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Xg(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&fe(32,this.name_,this.derivation),J.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)na(this)&&(this.warnAboutUntrackedRead_(),Et(),this.value_=this.computeValue_(!1),St());else if(Xf(this),na(this)){var n=J.trackingContext;this.keepAlive_&&!n&&(J.trackingContext=this),this.trackAndCompute()&&Jg(this),J.trackingContext=n}var i=this.value_;if(fo(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&fe(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else fe(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Ee.NOT_TRACKING_,o=this.computeValue_(!0),s=i||fo(n)||fo(o)||!this.equals_(n,o);return s&&(this.value_=o,Xe()&&qr({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:n,newValue:o})),s},t.computeValue_=function(n){this.isComputing=!0;var i=Po(!1),o;if(n)o=zf(this,this.derivation,this.scope_);else if(J.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(s){o=new bo(s)}return Ro(i),this.isComputing=!1,o},t.suspend_=function(){this.keepAlive_||(ia(this),this.value_=void 0,this.isTracing_!==Nt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(n,i){var o=this,s=!0,a=void 0;return $t(function(){var c=o.get();if(!s||i){var f=Wr();n({observableKind:"computed",debugObjectName:o.name_,type:Ft,object:o,newValue:c,oldValue:a}),cr(f)}s=!1,a=c})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==Nt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:J.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute.")},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Rf(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},En(e,[{key:"isComputing",get:function(){return dt(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=pt(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return dt(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=pt(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return dt(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=pt(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return dt(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=pt(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return dt(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=pt(this.flags_,e.diffValueMask_,n===1)}}])}();Pt.isComputingMask_=1;Pt.isRunningSetterMask_=2;Pt.isBeingObservedMask_=4;Pt.isPendingUnobservationMask_=8;Pt.diffValueMask_=16;var pi=Or("ComputedValue",Pt),Ee;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Ee||(Ee={}));var Nt;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Nt||(Nt={}));var bo=function(t){this.cause=void 0,this.cause=t};function fo(e){return e instanceof bo}function na(e){switch(e.dependenciesState_){case Ee.UP_TO_DATE_:return!1;case Ee.NOT_TRACKING_:case Ee.STALE_:return!0;case Ee.POSSIBLY_STALE_:{for(var t=ya(!0),r=Wr(),n=e.observing_,i=n.length,o=0;o<i;o++){var s=n[o];if(pi(s)){if(J.disableErrorBoundaries)s.get();else try{s.get()}catch{return cr(r),si(t),!0}if(e.dependenciesState_===Ee.STALE_)return cr(r),si(t),!0}}return qf(e),cr(r),si(t),!1}}}function Kf(){return J.trackingDerivation!==null}function Xt(e){var t=e.observers_.size>0;!J.allowStateChanges&&(t||J.enforceActions==="always")&&console.warn("[MobX] "+(J.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}function Vg(e){!J.allowStateReads&&J.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function zf(e,t,r){var n=ya(!0);qf(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++J.runId;var i=J.trackingDerivation;J.trackingDerivation=e,J.inBatch++;var o;if(J.disableErrorBoundaries===!0)o=t.call(r);else try{o=t.call(r)}catch(s){o=new bo(s)}return J.inBatch--,J.trackingDerivation=i,zg(e),Kg(e),si(n),o}function Kg(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:J.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function zg(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Ee.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,s=0;s<o;s++){var a=r[s];a.diffValue===0&&(a.diffValue=1,i!==s&&(r[i]=a),i++),a.dependenciesState_>n&&(n=a.dependenciesState_)}for(r.length=i,e.newObserving_=null,o=t.length;o--;){var c=t[o];c.diffValue===0&&Hf(c,e),c.diffValue=0}for(;i--;){var f=r[i];f.diffValue===1&&(f.diffValue=0,Hg(f,e))}n!==Ee.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function ia(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Hf(t[r],e);e.dependenciesState_=Ee.NOT_TRACKING_}function Re(e){var t=Wr();try{return e()}finally{cr(t)}}function Wr(){var e=J.trackingDerivation;return J.trackingDerivation=null,e}function cr(e){J.trackingDerivation=e}function ya(e){var t=J.allowStateReads;return J.allowStateReads=e,t}function si(e){J.allowStateReads=e}function qf(e){if(e.dependenciesState_!==Ee.UP_TO_DATE_){e.dependenciesState_=Ee.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Ee.UP_TO_DATE_}}var lo=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},po=!0,Gf=!1,J=function(){var e=Ao();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(po=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new lo().version&&(po=!1),po?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new lo):(setTimeout(function(){Gf||fe(35)},1),new lo)}();function qg(){if((J.pendingReactions.length||J.inBatch||J.isRunningReactions)&&fe(36),Gf=!0,po){var e=Ao();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),J=new lo}}function Wf(){return J}function Gg(e){return e.observers_&&e.observers_.size>0}function Wg(e){return e.observers_}function Hg(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Hf(e,t){e.observers_.delete(t),e.observers_.size===0&&Jf(e)}function Jf(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,J.pendingUnobservations.push(e))}function Et(){J.inBatch++}function St(){if(--J.inBatch===0){el();for(var e=J.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof Pt&&r.suspend_())}J.pendingUnobservations=[]}}function Xf(e){Vg(e);var t=J.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&J.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&J.inBatch>0&&Jf(e),!1)}function Yf(e){e.lowestObserverState_!==Ee.STALE_&&(e.lowestObserverState_=Ee.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ee.UP_TO_DATE_&&(t.isTracing_!==Nt.NONE&&Qf(t,e),t.onBecomeStale_()),t.dependenciesState_=Ee.STALE_}))}function Jg(e){e.lowestObserverState_!==Ee.STALE_&&(e.lowestObserverState_=Ee.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ee.POSSIBLY_STALE_?(t.dependenciesState_=Ee.STALE_,t.isTracing_!==Nt.NONE&&Qf(t,e)):t.dependenciesState_===Ee.UP_TO_DATE_&&(e.lowestObserverState_=Ee.UP_TO_DATE_)}))}function Xg(e){e.lowestObserverState_===Ee.UP_TO_DATE_&&(e.lowestObserverState_=Ee.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ee.UP_TO_DATE_&&(t.dependenciesState_=Ee.POSSIBLY_STALE_,t.onBecomeStale_())}))}function Qf(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===Nt.BREAK){var r=[];Zf(yi(e),r,1),new Function(`debugger;
7
+ '`+i+"' can only be used on properties with a function value."))}function Uf(e,t,r,n,i){var o,s,a,c,f,l,g;i===void 0&&(i=J.safeDescriptors),og(e,t,r,n);var P=n.value;if((o=t.options_)!=null&&o.bound){var E;P=P.bind((E=e.proxy_)!=null?E:e.target_)}return{value:zr((s=(a=t.options_)==null?void 0:a.name)!=null?s:r.toString(),P,(c=(f=t.options_)==null?void 0:f.autoAction)!=null?c:!1,(l=t.options_)!=null&&l.bound?(g=e.proxy_)!=null?g:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Bf(e,t){return{annotationType_:e,options_:t,make_:sg,extend_:ag,decorate_20223_:ug}}function sg(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!xt(e.target_,t)||!ui(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(ui(r.value))return 1;var o=Mf(e,this,t,r,!1,!1);return Yt(n,t,o),2}function ag(e,t,r,n){var i,o=Mf(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,o,n)}function ug(e,t){var r;xo(t,["method"]);var n=t.name,i=t.addInitializer;return ui(e)||(e=On(e)),(r=this.options_)!=null&&r.bound&&i(function(){var o=this,s=o[n].bind(o);s.isMobXFlow=!0,o[n]=s}),e}function cg(e,t,r,n){var i=t.annotationType_,o=n.value;je(o)||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
8
+ '`+i+"' can only be used on properties with a generator function value."))}function Mf(e,t,r,n,i,o){o===void 0&&(o=J.safeDescriptors),cg(e,t,r,n);var s=n.value;if(ui(s)||(s=On(s)),i){var a;s=s.bind((a=e.proxy_)!=null?a:e.target_),s.isMobXFlow=!0}return{value:s,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function pa(e,t){return{annotationType_:e,options_:t,make_:fg,extend_:lg,decorate_20223_:dg}}function fg(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function lg(e,t,r,n){return pg(e,this,t,r),e.defineComputedProperty_(t,fr({},this.options_,{get:r.get,set:r.set}),n)}function dg(e,t){xo(t,["getter"]);var r=this,n=t.name,i=t.addInitializer;return i(function(){var o=Rn(this)[be],s=fr({},r.options_,{get:e,context:this});s.name||(s.name=o.name_+"."+n.toString()),o.values_.set(n,new Pt(s))}),function(){return this[be].getObservablePropValue_(n)}}function pg(e,t,r,n){var i=t.annotationType_,o=n.get;o||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
9
+ '`+i+"' can only be used on getter(+setter) properties."))}function Po(e,t){return{annotationType_:e,options_:t,make_:yg,extend_:hg,decorate_20223_:gg}}function yg(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function hg(e,t,r,n){var i,o;return mg(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(o=this.options_)==null?void 0:o.enhancer)!=null?i:Kr,n)}function gg(e,t){if(t.kind==="field")throw fe("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");xo(t,["accessor"]);var r=this,n=t.kind,i=t.name,o=new WeakSet;function s(a,c){var f,l,g=Rn(a)[be],P=new Tr(c,(f=(l=r.options_)==null?void 0:l.enhancer)!=null?f:Kr,g.name_+"."+i.toString(),!1);g.values_.set(i,P),o.add(a)}if(n=="accessor")return{get:function(){return o.has(this)||s(this,e.get.call(this)),this[be].getObservablePropValue_(i)},set:function(c){return o.has(this)||s(this,c),this[be].setObservablePropValue_(i,c)},init:function(c){return o.has(this)||s(this,c),c}}}function mg(e,t,r,n){var i=t.annotationType_;"value"in n||fe("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
10
+ '`+i+"' cannot be used on getter/setter properties"))}var bg="true",vg=kf();function kf(e){return{annotationType_:bg,options_:e,make_:_g,extend_:wg,decorate_20223_:Tg}}function _g(e,t,r,n){var i,o;if(r.get)return ke.make_(e,t,r,n);if(r.set){var s=zr(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(Yt(n,t,{configurable:!0,set:s}),2)}if(n!==e.target_&&typeof r.value=="function"){var a;if(xf(r.value)){var c,f=(c=this.options_)!=null&&c.autoBind?On.bound:On;return f.make_(e,t,r,n)}var l=(a=this.options_)!=null&&a.autoBind?ai.bound:ai;return l.make_(e,t,r,n)}var g=((i=this.options_)==null?void 0:i.deep)===!1?$e.ref:$e;if(typeof r.value=="function"&&(o=this.options_)!=null&&o.autoBind){var P;r.value=r.value.bind((P=e.proxy_)!=null?P:e.target_)}return g.make_(e,t,r,n)}function wg(e,t,r,n){var i,o;if(r.get)return ke.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:zr(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var s;r.value=r.value.bind((s=e.proxy_)!=null?s:e.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?$e.ref:$e;return a.extend_(e,t,r,n)}function Tg(e,t){fe("'"+this.annotationType_+"' cannot be used as a decorator")}var Ag="observable",Og="observable.ref",Ig="observable.shallow",Eg="observable.struct",Df={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Df);function ao(e){return e||Df}var ta=Po(Ag),Sg=Po(Og,{enhancer:No}),xg=Po(Ig,{enhancer:Zh}),Ng=Po(Eg,{enhancer:eg}),Lf=Qt(ta);function uo(e){return e.deep===!0?Kr:e.deep===!1?No:Rg(e.defaultDecorator)}function Pg(e){var t;return e?(t=e.defaultDecorator)!=null?t:kf(e):void 0}function Rg(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Kr}function jf(e,t,r){if(li(t))return ta.decorate_20223_(e,t);if(Vr(t)){fi(e,t,ta);return}return In(e)?e:zt(e)?$e.object(e,t,r):Array.isArray(e)?$e.array(e,t):En(e)?$e.map(e,t):ar(e)?$e.set(e,t):typeof e=="object"&&e!==null?e:$e.box(e,t)}Ef(jf,Lf);var Cg={box:function(t,r){var n=ao(r);return new Tr(t,uo(n),n.name,!0,n.equals)},array:function(t,r){var n=ao(r);return(J.useProxies===!1||n.proxy===!1?Cm:Tm)(t,uo(n),n.name)},map:function(t,r){var n=ao(r);return new dl(t,uo(n),n.name)},set:function(t,r){var n=ao(r);return new pl(t,uo(n),n.name)},object:function(t,r,n){return Jr(function(){return lm(J.useProxies===!1||n?.proxy===!1?Rn({},n):vm({},n),t,r)})},ref:Qt(Sg),shallow:Qt(xg),deep:Lf,struct:Qt(Ng)},$e=Ef(jf,Cg),Ff="computed",$g="computed.struct",ra=pa(Ff),Ug=pa($g,{equals:Ve.structural}),ke=function(t,r){if(li(r))return ra.decorate_20223_(t,r);if(Vr(r))return fi(t,r,ra);if(zt(t))return Qt(pa(Ff,t));je(t)||fe("First argument to `computed` should be an expression."),je(r)&&fe("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var n=zt(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Pt(n)};Object.assign(ke,ra);ke.struct=Qt(Ug);var ff,lf,bo=0,Bg=1,Mg=(ff=(lf=ho(function(){},"name"))==null?void 0:lf.configurable)!=null?ff:!1,df={value:"action",configurable:!0,writable:!1,enumerable:!1};function zr(e,t,r,n){r===void 0&&(r=!1),je(t)||fe("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&fe("actions should have valid names, got: '"+e+"'");function i(){return Vf(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Mg&&(df.value=e,Yt(i,"name",df)),i}function Vf(e,t,r,n,i){var o=kg(e,t,n,i);try{return r.apply(n,i)}catch(s){throw o.error_=s,s}finally{Dg(o)}}function kg(e,t,r,n){var i=Xe()&&!!e,o=0;if(i){o=Date.now();var s=n?Array.from(n):go;yt({type:ha,name:e,object:r,arguments:s})}var a=J.trackingDerivation,c=!t||!a;Et();var f=J.allowStateChanges;c&&(Wr(),f=Ro(!0));var l=ya(!0),g={runAsAction_:c,prevDerivation_:a,prevAllowStateChanges_:f,prevAllowStateReads_:l,notifySpy_:i,startTime_:o,actionId_:Bg++,parentActionId_:bo};return bo=g.actionId_,g}function Dg(e){bo!==e.actionId_&&fe(30),bo=e.parentActionId_,e.error_!==void 0&&(J.suppressReactionErrors=!0),Co(e.prevAllowStateChanges_),si(e.prevAllowStateReads_),St(),e.runAsAction_&&cr(e.prevDerivation_),e.notifySpy_&&ht({time:Date.now()-e.startTime_}),J.suppressReactionErrors=!1}function Lg(e,t){var r=Ro(e);try{return t()}finally{Co(r)}}function Ro(e){var t=J.allowStateChanges;return J.allowStateChanges=e,t}function Co(e){J.allowStateChanges=e}var jg="create",Tr=function(e){function t(n,i,o,s,a){var c;return o===void 0&&(o="ObservableValue@"+Ct()),s===void 0&&(s=!0),a===void 0&&(a=Ve.default),c=e.call(this,o)||this,c.enhancer=void 0,c.name_=void 0,c.equals=void 0,c.hasUnreportedChange_=!1,c.interceptors_=void 0,c.changeListeners_=void 0,c.value_=void 0,c.dehancer=void 0,c.enhancer=i,c.name_=o,c.equals=a,c.value_=i(n,void 0,o),s&&Xe()&&qr({type:jg,object:c,observableKind:"value",debugObjectName:c.name_,newValue:""+c.value_}),c}Cf(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){var o=this.value_;if(i=this.prepareNewValue_(i),i!==J.UNCHANGED){var s=Xe();s&&yt({type:Ft,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:o}),this.setNewValue_(i),s&&ht()}},r.prepareNewValue_=function(i){if(Xt(this),Ot(this)){var o=It(this,{object:this,type:Ft,newValue:i});if(!o)return J.UNCHANGED;i=o.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?J.UNCHANGED:i},r.setNewValue_=function(i){var o=this.value_;this.value_=i,this.reportChanged(),Vt(this)&&Kt(this,{type:Ft,object:this,newValue:i,oldValue:o})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return gi(this,i)},r.observe_=function(i,o){return o&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Ft,newValue:this.value_,oldValue:void 0}),mi(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Rf(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(Ir),Fg=Or("ObservableValue",Tr),Pt=function(){function e(r){this.dependenciesState_=Ee.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ee.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new vo(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Nt.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||fe(31),this.derivation=r.get,this.name_=r.name||"ComputedValue@"+Ct(),r.set&&(this.setter_=zr(this.name_+"-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Ve.structural:Ve.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Xg(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&fe(32,this.name_,this.derivation),J.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)na(this)&&(this.warnAboutUntrackedRead_(),Et(),this.value_=this.computeValue_(!1),St());else if(Xf(this),na(this)){var n=J.trackingContext;this.keepAlive_&&!n&&(J.trackingContext=this),this.trackAndCompute()&&Jg(this),J.trackingContext=n}var i=this.value_;if(lo(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&fe(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else fe(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Ee.NOT_TRACKING_,o=this.computeValue_(!0),s=i||lo(n)||lo(o)||!this.equals_(n,o);return s&&(this.value_=o,Xe()&&qr({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:n,newValue:o})),s},t.computeValue_=function(n){this.isComputing=!0;var i=Ro(!1),o;if(n)o=zf(this,this.derivation,this.scope_);else if(J.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(s){o=new vo(s)}return Co(i),this.isComputing=!1,o},t.suspend_=function(){this.keepAlive_||(ia(this),this.value_=void 0,this.isTracing_!==Nt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(n,i){var o=this,s=!0,a=void 0;return $t(function(){var c=o.get();if(!s||i){var f=Wr();n({observableKind:"computed",debugObjectName:o.name_,type:Ft,object:o,newValue:c,oldValue:a}),cr(f)}s=!1,a=c})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==Nt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:J.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute.")},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Rf(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Sn(e,[{key:"isComputing",get:function(){return dt(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=pt(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return dt(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=pt(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return dt(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=pt(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return dt(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=pt(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return dt(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=pt(this.flags_,e.diffValueMask_,n===1)}}])}();Pt.isComputingMask_=1;Pt.isRunningSetterMask_=2;Pt.isBeingObservedMask_=4;Pt.isPendingUnobservationMask_=8;Pt.diffValueMask_=16;var pi=Or("ComputedValue",Pt),Ee;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Ee||(Ee={}));var Nt;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Nt||(Nt={}));var vo=function(t){this.cause=void 0,this.cause=t};function lo(e){return e instanceof vo}function na(e){switch(e.dependenciesState_){case Ee.UP_TO_DATE_:return!1;case Ee.NOT_TRACKING_:case Ee.STALE_:return!0;case Ee.POSSIBLY_STALE_:{for(var t=ya(!0),r=Wr(),n=e.observing_,i=n.length,o=0;o<i;o++){var s=n[o];if(pi(s)){if(J.disableErrorBoundaries)s.get();else try{s.get()}catch{return cr(r),si(t),!0}if(e.dependenciesState_===Ee.STALE_)return cr(r),si(t),!0}}return qf(e),cr(r),si(t),!1}}}function Kf(){return J.trackingDerivation!==null}function Xt(e){var t=e.observers_.size>0;!J.allowStateChanges&&(t||J.enforceActions==="always")&&console.warn("[MobX] "+(J.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}function Vg(e){!J.allowStateReads&&J.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function zf(e,t,r){var n=ya(!0);qf(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++J.runId;var i=J.trackingDerivation;J.trackingDerivation=e,J.inBatch++;var o;if(J.disableErrorBoundaries===!0)o=t.call(r);else try{o=t.call(r)}catch(s){o=new vo(s)}return J.inBatch--,J.trackingDerivation=i,zg(e),Kg(e),si(n),o}function Kg(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:J.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function zg(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Ee.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,s=0;s<o;s++){var a=r[s];a.diffValue===0&&(a.diffValue=1,i!==s&&(r[i]=a),i++),a.dependenciesState_>n&&(n=a.dependenciesState_)}for(r.length=i,e.newObserving_=null,o=t.length;o--;){var c=t[o];c.diffValue===0&&Hf(c,e),c.diffValue=0}for(;i--;){var f=r[i];f.diffValue===1&&(f.diffValue=0,Hg(f,e))}n!==Ee.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function ia(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Hf(t[r],e);e.dependenciesState_=Ee.NOT_TRACKING_}function Re(e){var t=Wr();try{return e()}finally{cr(t)}}function Wr(){var e=J.trackingDerivation;return J.trackingDerivation=null,e}function cr(e){J.trackingDerivation=e}function ya(e){var t=J.allowStateReads;return J.allowStateReads=e,t}function si(e){J.allowStateReads=e}function qf(e){if(e.dependenciesState_!==Ee.UP_TO_DATE_){e.dependenciesState_=Ee.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Ee.UP_TO_DATE_}}var po=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},yo=!0,Gf=!1,J=function(){var e=Oo();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(yo=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new po().version&&(yo=!1),yo?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new po):(setTimeout(function(){Gf||fe(35)},1),new po)}();function qg(){if((J.pendingReactions.length||J.inBatch||J.isRunningReactions)&&fe(36),Gf=!0,yo){var e=Oo();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),J=new po}}function Wf(){return J}function Gg(e){return e.observers_&&e.observers_.size>0}function Wg(e){return e.observers_}function Hg(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Hf(e,t){e.observers_.delete(t),e.observers_.size===0&&Jf(e)}function Jf(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,J.pendingUnobservations.push(e))}function Et(){J.inBatch++}function St(){if(--J.inBatch===0){el();for(var e=J.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof Pt&&r.suspend_())}J.pendingUnobservations=[]}}function Xf(e){Vg(e);var t=J.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&J.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&J.inBatch>0&&Jf(e),!1)}function Yf(e){e.lowestObserverState_!==Ee.STALE_&&(e.lowestObserverState_=Ee.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ee.UP_TO_DATE_&&(t.isTracing_!==Nt.NONE&&Qf(t,e),t.onBecomeStale_()),t.dependenciesState_=Ee.STALE_}))}function Jg(e){e.lowestObserverState_!==Ee.STALE_&&(e.lowestObserverState_=Ee.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ee.POSSIBLY_STALE_?(t.dependenciesState_=Ee.STALE_,t.isTracing_!==Nt.NONE&&Qf(t,e)):t.dependenciesState_===Ee.UP_TO_DATE_&&(e.lowestObserverState_=Ee.UP_TO_DATE_)}))}function Xg(e){e.lowestObserverState_===Ee.UP_TO_DATE_&&(e.lowestObserverState_=Ee.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Ee.UP_TO_DATE_&&(t.dependenciesState_=Ee.POSSIBLY_STALE_,t.onBecomeStale_())}))}function Qf(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===Nt.BREAK){var r=[];Zf(yi(e),r,1),new Function(`debugger;
11
11
  /*
12
12
  Tracing '`+e.name_+`'
13
13
 
@@ -22,12 +22,12 @@ The dependencies for this derivation are:
22
22
  `+r.join(`
23
23
  `)+`
24
24
  */
25
- `)()}}function Zf(e,t,r){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(r-1)+e.name),e.dependencies&&e.dependencies.forEach(function(n){return Zf(n,t,r+1)})}var qt=function(){function e(r,n,i,o){r===void 0&&(r="Reaction@"+Ct()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Ee.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Nt.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=o}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,J.pendingReactions.push(this),el())},t.runReaction_=function(){if(!this.isDisposed){Et(),this.isScheduled=!1;var n=J.trackingContext;if(J.trackingContext=this,na(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&Xe()&&qr({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}J.trackingContext=n,St()}},t.track=function(n){if(!this.isDisposed){Et();var i=Xe(),o;i&&(o=Date.now(),yt({name:this.name_,type:"reaction"})),this.isRunning=!0;var s=J.trackingContext;J.trackingContext=this;var a=zf(this,n,void 0);J.trackingContext=s,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&ia(this),fo(a)&&this.reportExceptionInDerivation_(a.cause),i&&ht({time:Date.now()-o}),St()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(J.disableErrorBoundaries)throw n;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";J.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(o,n),Xe()&&qr({type:"error",name:this.name_,message:o,error:""+n}),J.globalReactionErrorHandlers.forEach(function(s){return s(n,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Et(),ia(this),St()))},t.getDisposer_=function(n){var i=this,o=function s(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",s)};return n==null||n.addEventListener==null||n.addEventListener("abort",o),o[be]=this,o},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){n===void 0&&(n=!1),ga(this,n)},En(e,[{key:"isDisposed",get:function(){return dt(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=pt(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return dt(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=pt(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return dt(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=pt(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return dt(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=pt(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return dt(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=pt(this.flags_,e.diffValueMask_,n===1)}}])}();qt.isDisposedMask_=1;qt.isScheduledMask_=2;qt.isTrackPendingMask_=4;qt.isRunningMask_=8;qt.diffValueMask_=16;var pf=100,oa=function(t){return t()};function el(){J.inBatch>0||J.isRunningReactions||oa(Yg)}function Yg(){J.isRunningReactions=!0;for(var e=J.pendingReactions,t=0;e.length>0;){++t===pf&&(console.error("Reaction doesn't converge to a stable state after "+pf+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}J.isRunningReactions=!1}var vo=Or("Reaction",qt);function Qg(e){var t=oa;oa=function(n){return e(function(){return t(n)})}}function Xe(){return!!J.spyListeners.length}function qr(e){if(J.spyListeners.length)for(var t=J.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function yt(e){var t=fr({},e,{spyReportStart:!0});qr(t)}var Zg={type:"report-end",spyReportEnd:!0};function ht(e){qr(e?fr({},e,{type:"report-end",spyReportEnd:!0}):Zg)}function em(e){return J.spyListeners.push(e),la(function(){J.spyListeners=J.spyListeners.filter(function(t){return t!==e})})}var ha="action",tm="action.bound",tl="autoAction",rm="autoAction.bound",rl="<unnamed action>",sa=di(ha),nm=di(tm,{bound:!0}),aa=di(tl,{autoAction:!0}),im=di(rm,{autoAction:!0,bound:!0});function nl(e){var t=function(n,i){if(je(n))return zr(n.name||rl,n,e);if(je(i))return zr(n,i,e);if(li(i))return(e?aa:sa).decorate_20223_(n,i);if(Vr(i))return fi(n,i,e?aa:sa);if(Vr(n))return Qt(di(e?tl:ha,{name:n,autoAction:e}));fe("Invalid arguments for `action`")};return t}var ot=nl(!1);Object.assign(ot,sa);var ai=nl(!0);Object.assign(ai,aa);ot.bound=Qt(nm);ai.bound=Qt(im);function Sn(e){return Vf(e.name||rl,!1,e,this,void 0)}function Ar(e){return je(e)&&e.isMobxAction===!0}function $t(e,t){var r,n,i,o;t===void 0&&(t=fa),je(e)||fe("Autorun expects a function as first argument"),Ar(e)&&fe("Autorun does not accept actions since actions are untrackable");var s=(r=(n=t)==null?void 0:n.name)!=null?r:e.name||"Autorun@"+Ct(),a=!t.scheduler&&!t.delay,c;if(a)c=new qt(s,function(){this.track(g)},t.onError,t.requiresObservable);else{var f=il(t),l=!1;c=new qt(s,function(){l||(l=!0,f(function(){l=!1,c.isDisposed||c.track(g)}))},t.onError,t.requiresObservable)}function g(){e(c)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||c.schedule_(),c.getDisposer_((o=t)==null?void 0:o.signal)}var om=function(t){return t()};function il(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:om}function ol(e,t,r){var n,i,o;r===void 0&&(r=fa),(!je(e)||!je(t))&&fe("First and second argument to reaction should be functions"),zt(r)||fe("Third argument of reactions should be an object");var s=(n=r.name)!=null?n:"Reaction@"+Ct(),a=ot(s,r.onError?sm(r.onError,t):t),c=!r.scheduler&&!r.delay,f=il(r),l=!0,g=!1,P,E=r.compareStructural?Ve.structural:r.equals||Ve.default,M=new qt(s,function(){l||c?z():g||(g=!0,f(z))},r.onError,r.requiresObservable);function z(){if(g=!1,!M.isDisposed){var Q=!1,F=P;M.track(function(){var L=Lg(!1,function(){return e(M)});Q=l||!E(P,L),P=L}),(l&&r.fireImmediately||!l&&Q)&&a(P,F,M),l=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||M.schedule_(),M.getDisposer_((o=r)==null?void 0:o.signal)}function sm(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var am="onBO",um="onBUO";function xn(e,t,r){return sl(am,e,t,r)}function Hr(e,t,r){return sl(um,e,t,r)}function sl(e,t,r,n){var i=typeof n=="function"?Rt(t,r):Rt(t),o=je(n)?n:r,s=e+"L";return i[s]?i[s].add(o):i[s]=new Set([o]),function(){var a=i[s];a&&(a.delete(o),a.size===0&&delete i[s])}}var cm="never",uo="always",fm="observed";function al(e){e.isolateGlobalState===!0&&qg();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(J.useProxies=t===uo?!0:t===cm?!1:typeof Proxy<"u"),t==="ifavailable"&&(J.verifyProxies=!0),r!==void 0){var n=r===uo?uo:r===fm;J.enforceActions=n,J.allowStateChanges=!(n===!0||n===uo)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(J[i]=!!e[i])}),J.allowStateReads=!J.observableRequiresReaction,J.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&Qg(e.reactionScheduler)}function lm(e,t,r,n){arguments.length>4&&fe("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&fe("'extendObservable' expects an object as first argument"),Zt(e)&&fe("'extendObservable' should not be used on maps, use map.merge instead"),zt(t)||fe("'extendObservable' only accepts plain objects as second argument"),(On(t)||On(r))&&fe("Extending an object with another observable (object) is not supported");var i=Kh(t);return Jr(function(){var o=Pn(e,n)[be];Eo(i).forEach(function(s){o.extend_(s,i[s],r&&s in r?r[s]:!0)})}),e}function yi(e,t){return ul(Rt(e,t))}function ul(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=dm(e.observing_).map(ul)),t}function hi(e,t){return cl(Rt(e,t))}function cl(e){var t={name:e.name_};return Gg(e)&&(t.observers=Array.from(Wg(e)).map(cl)),t}function dm(e){return Array.from(new Set(e))}var pm=0;function fl(){this.message="FLOW_CANCELLED"}fl.prototype=Object.create(Error.prototype);var Ys=Bf("flow"),ym=Bf("flow.bound",{bound:!0}),An=Object.assign(function(t,r){if(li(r))return Ys.decorate_20223_(t,r);if(Vr(r))return fi(t,r,Ys);arguments.length!==1&&fe("Flow expects single argument with generator function");var n=t,i=n.name||"<unnamed flow>",o=function(){var a=this,c=arguments,f=++pm,l=ot(i+" - runid: "+f+" - init",n).apply(a,c),g,P=void 0,E=new Promise(function(M,z){var Q=0;g=z;function F(H){P=void 0;var j;try{j=ot(i+" - runid: "+f+" - yield "+Q++,l.next).call(l,H)}catch(re){return z(re)}G(j)}function L(H){P=void 0;var j;try{j=ot(i+" - runid: "+f+" - yield "+Q++,l.throw).call(l,H)}catch(re){return z(re)}G(j)}function G(H){if(je(H?.then)){H.then(G,z);return}return H.done?M(H.value):(P=Promise.resolve(H.value),P.then(F,L))}F(void 0)});return E.cancel=ot(i+" - runid: "+f+" - cancel",function(){try{P&&yf(P);var M=l.return(void 0),z=Promise.resolve(M.value);z.then(wn,wn),yf(z),g(new fl)}catch(Q){g(Q)}}),E};return o.isMobXFlow=!0,o},Ys);An.bound=Qt(ym);function yf(e){je(e.cancel)&&e.cancel()}function ui(e){return e?.isMobXFlow===!0}function hm(e,t){return e?t!==void 0?Zt(e)||Nn(e)?fe("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):Gr(e)?e[be].values_.has(t):!1:Gr(e)||!!e[be]||da(e)||vo(e)||pi(e):!1}function On(e){return arguments.length!==1&&fe("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),hm(e)}function gm(e){if(Gr(e))return e[be].ownKeys_();fe(38)}function co(e,t,r){return e.set(t,r),r}function _n(e,t){if(e==null||typeof e!="object"||e instanceof Date||!On(e))return e;if(Fg(e)||pi(e))return _n(e.get(),t);if(t.has(e))return t.get(e);if(Nn(e)){var r=co(t,e,new Array(e.length));return e.forEach(function(s,a){r[a]=_n(s,t)}),r}if(jt(e)){var n=co(t,e,new Set);return e.forEach(function(s){n.add(_n(s,t))}),n}if(Zt(e)){var i=co(t,e,new Map);return e.forEach(function(s,a){i.set(a,_n(s,t))}),i}else{var o=co(t,e,{});return gm(e).forEach(function(s){ci.propertyIsEnumerable.call(e,s)&&(o[s]=_n(e[s],t))}),o}}function lr(e,t){return t&&fe("toJS no longer supports options"),_n(e,new Map)}function ga(){for(var e=!1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[r.length-1]=="boolean"&&(e=r.pop());var i=mm(r);if(!i)return fe("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===Nt.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?Nt.BREAK:Nt.LOG}function mm(e){switch(e.length){case 0:return J.trackingDerivation;case 1:return Rt(e[0]);case 2:return Rt(e[0],e[1])}}function ur(e,t){t===void 0&&(t=void 0),Et();try{return e.apply(t)}finally{St()}}function Fr(e){return e[be]}var bm={has:function(t,r){return J.trackingDerivation&&oi("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Fr(t).has_(r)},get:function(t,r){return Fr(t).get_(r)},set:function(t,r,n){var i;return Vr(r)?(Fr(t).values_.has(r)||oi("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=Fr(t).set_(r,n,!0))!=null?i:!0):!1},deleteProperty:function(t,r){var n;return oi("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Vr(r)?(n=Fr(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return oi("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=Fr(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return J.trackingDerivation&&oi("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Fr(t).ownKeys_()},preventExtensions:function(t){fe(13)}};function vm(e,t){var r,n;return Sf(),e=Pn(e,t),(n=(r=e[be]).proxy_)!=null?n:r.proxy_=new Proxy(e,bm)}function Ot(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function gi(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),la(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function It(e,t){var r=Wr();try{for(var n=[].concat(e.interceptors_||[]),i=0,o=n.length;i<o&&(t=n[i](t),t&&!t.type&&fe(14),!!t);i++);return t}finally{cr(r)}}function Vt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function mi(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),la(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Kt(e,t){var r=Wr(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,o=n.length;i<o;i++)n[i](t);cr(r)}}function Er(e,t,r){return Jr(function(){var n,i=Pn(e,r)[be];t&&e[it]&&fe("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(n=t)!=null||(t=Hh(e)),Eo(t).forEach(function(o){return i.make_(o,t[o])})}),e}var hf="splice",Ft="update",_m=1e4,wm={get:function(t,r){var n=t[be];return r===be?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):xt(_o,r)?_o[r]:t[r]},set:function(t,r,n){var i=t[be];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){fe(15)}},ma=function(){function e(r,n,i,o){r===void 0&&(r="ObservableArray@"+Ct()),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=o,this.atom_=new Ir(r),this.enhancer_=function(s,a){return n(s,a,r+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return gi(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),mi(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&fe("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var o=new Array(n-i),s=0;s<n-i;s++)o[s]=void 0;this.spliceWithArray_(i,0,o)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&fe(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&gl(n+i+1)},t.spliceWithArray_=function(n,i,o){var s=this;Xt(this.atom_);var a=this.values_.length;if(n===void 0?n=0:n>a?n=a:n<0&&(n=Math.max(0,a+n)),arguments.length===1?i=a-n:i==null?i=0:i=Math.max(0,Math.min(i,a-n)),o===void 0&&(o=ho),Ot(this)){var c=It(this,{object:this.proxy_,type:hf,index:n,removedCount:i,added:o});if(!c)return ho;i=c.removedCount,o=c.added}o=o.length===0?o:o.map(function(g){return s.enhancer_(g,void 0)}),this.legacyMode_;var f=o.length-i;this.updateArrayLength_(a,f);var l=this.spliceItemsIntoValues_(n,i,o);return(i!==0||o.length!==0)&&this.notifyArraySplice_(n,o,l),this.dehanceValues_(l)},t.spliceItemsIntoValues_=function(n,i,o){if(o.length<_m){var s;return(s=this.values_).splice.apply(s,[n,i].concat(o))}else{var a=this.values_.slice(n,n+i),c=this.values_.slice(n+i);this.values_.length+=o.length-i;for(var f=0;f<o.length;f++)this.values_[n+f]=o[f];for(var l=0;l<c.length;l++)this.values_[n+o.length+l]=c[l];return a}},t.notifyArrayChildUpdate_=function(n,i,o){var s=!this.owned_&&Xe(),a=Vt(this),c=a||s?{observableKind:"array",object:this.proxy_,type:Ft,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:o}:null;s&&yt(c),this.atom_.reportChanged(),a&&Kt(this,c),s&&ht()},t.notifyArraySplice_=function(n,i,o){var s=!this.owned_&&Xe(),a=Vt(this),c=a||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:hf,index:n,removed:o,added:i,removedCount:o.length,addedCount:i.length}:null;s&&yt(c),this.atom_.reportChanged(),a&&Kt(this,c),s&&ht()},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+n+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX");return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var o=this.values_;if(this.legacyMode_&&n>o.length&&fe(17,n,o.length),n<o.length){Xt(this.atom_);var s=o[n];if(Ot(this)){var a=It(this,{type:Ft,object:this.proxy_,index:n,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,s);var c=i!==s;c&&(o[n]=i,this.notifyArrayChildUpdate_(n,i,s))}else{for(var f=new Array(n+1-o.length),l=0;l<f.length-1;l++)f[l]=void 0;f[f.length-1]=i,this.spliceWithArray_(o.length,0,f)}},e}();function Tm(e,t,r,n){return r===void 0&&(r="ObservableArray@"+Ct()),n===void 0&&(n=!1),Sf(),Jr(function(){var i=new ma(r,t,n,!1);Nf(i.values_,be,i);var o=new Proxy(i.values_,wm);return i.proxy_=o,e&&e.length&&i.spliceWithArray_(0,0,e),o})}var _o={clear:function(){return this.splice(0)},replace:function(t){var r=this[be];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];var s=this[be];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(t);case 2:return s.spliceWithArray_(t,r)}return s.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[be].spliceWithArray_(t,r,n)},push:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[be].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return J.trackingDerivation&&fe(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){J.trackingDerivation&&fe(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[be],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Ue("at",gt);Ue("concat",gt);Ue("flat",gt);Ue("includes",gt);Ue("indexOf",gt);Ue("join",gt);Ue("lastIndexOf",gt);Ue("slice",gt);Ue("toString",gt);Ue("toLocaleString",gt);Ue("toSorted",gt);Ue("toSpliced",gt);Ue("with",gt);Ue("every",Gt);Ue("filter",Gt);Ue("find",Gt);Ue("findIndex",Gt);Ue("findLast",Gt);Ue("findLastIndex",Gt);Ue("flatMap",Gt);Ue("forEach",Gt);Ue("map",Gt);Ue("some",Gt);Ue("toReversed",Gt);Ue("reduce",ll);Ue("reduceRight",ll);function Ue(e,t){typeof Array.prototype[e]=="function"&&(_o[e]=t(e))}function gt(e){return function(){var t=this[be];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Gt(e){return function(t,r){var n=this,i=this[be];i.atom_.reportObserved();var o=i.dehanceValues_(i.values_);return o[e](function(s,a){return t.call(r,s,a,n)})}}function ll(e){return function(){var t=this,r=this[be];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(o,s,a){return i(o,s,a,t)},n[e].apply(n,arguments)}}var Am=Or("ObservableArrayAdministration",ma);function Nn(e){return Oo(e)&&Am(e[be])}var Om={},wr="add",wo="delete",dl=function(){function e(r,n,i){var o=this;n===void 0&&(n=Kr),i===void 0&&(i="ObservableMap@"+Ct()),this.enhancer_=void 0,this.name_=void 0,this[be]=Om,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,je(Map)||fe(18),Jr(function(){o.keysAtom_=$f(o.name_+".keys()"),o.data_=new Map,o.hasMap_=new Map,r&&o.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!J.trackingDerivation)return this.has_(n);var o=this.hasMap_.get(n);if(!o){var s=o=new Tr(this.has_(n),xo,this.name_+"."+Zs(n)+"?",!1);this.hasMap_.set(n,s),Hr(s,function(){return i.hasMap_.delete(n)})}return o.get()},t.set=function(n,i){var o=this.has_(n);if(Ot(this)){var s=It(this,{type:o?Ft:wr,object:this,newValue:i,name:n});if(!s)return this;i=s.newValue}return o?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(Xt(this.keysAtom_),Ot(this)){var o=It(this,{type:wo,object:this,name:n});if(!o)return!1}if(this.has_(n)){var s=Xe(),a=Vt(this),c=a||s?{observableKind:"map",debugObjectName:this.name_,type:wo,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return s&&yt(c),ur(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var l=i.data_.get(n);l.setNewValue_(void 0),i.data_.delete(n)}),a&&Kt(this,c),s&&ht(),!0}return!1},t.updateValue_=function(n,i){var o=this.data_.get(n);if(i=o.prepareNewValue_(i),i!==J.UNCHANGED){var s=Xe(),a=Vt(this),c=a||s?{observableKind:"map",debugObjectName:this.name_,type:Ft,object:this,oldValue:o.value_,name:n,newValue:i}:null;s&&yt(c),o.setNewValue_(i),a&&Kt(this,c),s&&ht()}},t.addValue_=function(n,i){var o=this;Xt(this.keysAtom_),ur(function(){var f,l=new Tr(i,o.enhancer_,o.name_+"."+Zs(n),!1);o.data_.set(n,l),i=l.value_,(f=o.hasMap_.get(n))==null||f.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=Xe(),a=Vt(this),c=a||s?{observableKind:"map",debugObjectName:this.name_,type:wr,object:this,name:n,newValue:i}:null;s&&yt(c),a&&Kt(this,c),s&&ht()},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return gf({next:function(){var s=i.next(),a=s.done,c=s.value;return{done:a,value:a?void 0:n.get(c)}}})},t.entries=function(){var n=this,i=this.keys();return gf({next:function(){var s=i.next(),a=s.done,c=s.value;return{done:a,value:a?void 0:[c,n.get(c)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var o=Tn(this),s;!(s=o()).done;){var a=s.value,c=a[0],f=a[1];n.call(i,f,c,this)}},t.merge=function(n){var i=this;return Zt(n)&&(n=new Map(n)),ur(function(){zt(n)?Vh(n).forEach(function(o){return i.set(o,n[o])}):Array.isArray(n)?n.forEach(function(o){var s=o[0],a=o[1];return i.set(s,a)}):In(n)?(Fh(n)||fe(19,n),n.forEach(function(o,s){return i.set(s,o)})):n!=null&&fe(20,n)}),this},t.clear=function(){var n=this;ur(function(){Re(function(){for(var i=Tn(n.keys()),o;!(o=i()).done;){var s=o.value;n.delete(s)}})})},t.replace=function(n){var i=this;return ur(function(){for(var o=Im(n),s=new Map,a=!1,c=Tn(i.data_.keys()),f;!(f=c()).done;){var l=f.value;if(!o.has(l)){var g=i.delete(l);if(g)a=!0;else{var P=i.data_.get(l);s.set(l,P)}}}for(var E=Tn(o.entries()),M;!(M=E()).done;){var z=M.value,Q=z[0],F=z[1],L=i.data_.has(Q);if(i.set(Q,F),i.data_.has(Q)){var G=i.data_.get(Q);s.set(Q,G),L||(a=!0)}}if(!a)if(i.data_.size!==s.size)i.keysAtom_.reportChanged();else for(var H=i.data_.keys(),j=s.keys(),re=H.next(),W=j.next();!re.done;){if(re.value!==W.value){i.keysAtom_.reportChanged();break}re=H.next(),W=j.next()}i.data_=s}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support fireImmediately=true in combination with maps."),mi(this,n)},t.intercept_=function(n){return gi(this,n)},En(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Zt=Or("ObservableMap",dl);function gf(e){return e[Symbol.toStringTag]="MapIterator",wa(e)}function Im(e){if(In(e)||Zt(e))return e;if(Array.isArray(e))return new Map(e);if(zt(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return fe(21,e)}var Em={},pl=function(){function e(r,n,i){var o=this;n===void 0&&(n=Kr),i===void 0&&(i="ObservableSet@"+Ct()),this.name_=void 0,this[be]=Em,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,je(Set)||fe(22),this.enhancer_=function(s,a){return n(s,a,i)},Jr(function(){o.atom_=$f(o.name_),r&&o.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;ur(function(){Re(function(){for(var i=Tn(n.data_.values()),o;!(o=i()).done;){var s=o.value;n.delete(s)}})})},t.forEach=function(n,i){for(var o=Tn(this),s;!(s=o()).done;){var a=s.value;n.call(i,a,a,this)}},t.add=function(n){var i=this;if(Xt(this.atom_),Ot(this)){var o=It(this,{type:wr,object:this,newValue:n});if(!o)return this;n=o.newValue}if(!this.has(n)){ur(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var s=Xe(),a=Vt(this),c=a||s?{observableKind:"set",debugObjectName:this.name_,type:wr,object:this,newValue:n}:null;s&&yt(c),a&&Kt(this,c),s&&ht()}return this},t.delete=function(n){var i=this;if(Ot(this)){var o=It(this,{type:wo,object:this,oldValue:n});if(!o)return!1}if(this.has(n)){var s=Xe(),a=Vt(this),c=a||s?{observableKind:"set",debugObjectName:this.name_,type:wo,object:this,oldValue:n}:null;return s&&yt(c),ur(function(){i.atom_.reportChanged(),i.data_.delete(n)}),a&&Kt(this,c),s&&ht(),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=this.values();return mf({next:function(){var o=n.next(),s=o.value,a=o.done;return a?{value:void 0,done:a}:{value:[s,s],done:a}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=this.data_.values();return mf({next:function(){var s=i.next(),a=s.value,c=s.done;return c?{value:void 0,done:c}:{value:n.dehanceValue_(a),done:c}}})},t.intersection=function(n){if(ar(n)&&!jt(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(ar(n)&&!jt(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(ar(n)&&!jt(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(ar(n)&&!jt(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return jt(n)&&(n=new Set(n)),ur(function(){Array.isArray(n)?(i.clear(),n.forEach(function(o){return i.add(o)})):ar(n)?(i.clear(),n.forEach(function(o){return i.add(o)})):n!=null&&fe("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support fireImmediately=true in combination with sets."),mi(this,n)},t.intercept_=function(n){return gi(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},En(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),jt=Or("ObservableSet",pl);function mf(e){return e[Symbol.toStringTag]="SetIterator",wa(e)}var bf=Object.create(null),vf="remove",ua=function(){function e(r,n,i,o){n===void 0&&(n=new Map),o===void 0&&(o=vg),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=o,this.keysAtom_=new Ir(this.name_+".keys"),this.isPlainObject_=zt(this.target_),ml(this.defaultAnnotation_)||fe("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var o=this.values_.get(n);if(o instanceof Pt)return o.set(i),!0;if(Ot(this)){var s=It(this,{type:Ft,object:this.proxy_||this.target_,name:n,newValue:i});if(!s)return null;i=s.newValue}if(i=o.prepareNewValue_(i),i!==J.UNCHANGED){var a=Vt(this),c=Xe(),f=a||c?{type:Ft,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:n,newValue:i}:null;c&&yt(f),o.setNewValue_(i),a&&Kt(this,f),c&&ht()}return!0},t.get_=function(n){return J.trackingDerivation&&!xt(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,o){return o===void 0&&(o=!1),xt(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):o?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},t.has_=function(n){if(!J.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new Tr(n in this.target_,xo,this.name_+"."+Zs(n)+"?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Tf(this,i,n),!(n in this.target_)){var o;if((o=this.target_[it])!=null&&o[n])return;fe(1,i.annotationType_,this.name_+"."+n.toString())}for(var s=this.target_;s&&s!==ci;){var a=yo(s,n);if(a){var c=i.make_(this,n,a,s);if(c===0)return;if(c===1)break}s=Object.getPrototypeOf(s)}wf(this,i,n)}},t.extend_=function(n,i,o,s){if(s===void 0&&(s=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(n,i,s);Tf(this,o,n);var a=o.extend_(this,n,i,s);return a&&wf(this,o,n),a},t.defineProperty_=function(n,i,o){o===void 0&&(o=!1),Xt(this.keysAtom_);try{Et();var s=this.delete_(n);if(!s)return s;if(Ot(this)){var a=It(this,{object:this.proxy_||this.target_,name:n,type:wr,newValue:i.value});if(!a)return null;var c=a.newValue;i.value!==c&&(i=fr({},i,{value:c}))}if(o){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Yt(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{St()}return!0},t.defineObservableProperty_=function(n,i,o,s){s===void 0&&(s=!1),Xt(this.keysAtom_);try{Et();var a=this.delete_(n);if(!a)return a;if(Ot(this)){var c=It(this,{object:this.proxy_||this.target_,name:n,type:wr,newValue:i});if(!c)return null;i=c.newValue}var f=_f(n),l={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,n,l))return!1}else Yt(this.target_,n,l);var g=new Tr(i,o,this.name_+"."+n.toString(),!1);this.values_.set(n,g),this.notifyPropertyAddition_(n,g.value_)}finally{St()}return!0},t.defineComputedProperty_=function(n,i,o){o===void 0&&(o=!1),Xt(this.keysAtom_);try{Et();var s=this.delete_(n);if(!s)return s;if(Ot(this)){var a=It(this,{object:this.proxy_||this.target_,name:n,type:wr,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+n.toString()),i.context=this.proxy_||this.target_;var c=_f(n),f={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,n,f))return!1}else Yt(this.target_,n,f);this.values_.set(n,new Pt(i)),this.notifyPropertyAddition_(n,void 0)}finally{St()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),Xt(this.keysAtom_),!xt(this.target_,n))return!0;if(Ot(this)){var o=It(this,{object:this.proxy_||this.target_,name:n,type:vf});if(!o)return null}try{var s;Et();var a=Vt(this),c=Xe(),f=this.values_.get(n),l=void 0;if(!f&&(a||c)){var g;l=(g=yo(this.target_,n))==null?void 0:g.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(delete this.appliedAnnotations_[n],f&&(this.values_.delete(n),f instanceof Tr&&(l=f.value_),Yf(f)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(n))==null||s.set(n in this.target_),a||c){var P={type:vf,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:l,name:n};c&&yt(P),a&&Kt(this,P),c&&ht()}}finally{St()}return!0},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support the fire immediately property for observable objects."),mi(this,n)},t.intercept_=function(n){return gi(this,n)},t.notifyPropertyAddition_=function(n,i){var o,s=Vt(this),a=Xe();if(s||a){var c=s||a?{type:wr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;a&&yt(c),s&&Kt(this,c),a&&ht()}(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Eo(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Pn(e,t){var r;if(t&&Gr(e)&&fe("Options can't be provided for already observable objects."),xt(e,be))return va(e)instanceof ua||fe("Cannot convert '"+To(e)+`' into observable object:
25
+ `)()}}function Zf(e,t,r){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(r-1)+e.name),e.dependencies&&e.dependencies.forEach(function(n){return Zf(n,t,r+1)})}var qt=function(){function e(r,n,i,o){r===void 0&&(r="Reaction@"+Ct()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Ee.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Nt.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=o}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,J.pendingReactions.push(this),el())},t.runReaction_=function(){if(!this.isDisposed){Et(),this.isScheduled=!1;var n=J.trackingContext;if(J.trackingContext=this,na(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&Xe()&&qr({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}J.trackingContext=n,St()}},t.track=function(n){if(!this.isDisposed){Et();var i=Xe(),o;i&&(o=Date.now(),yt({name:this.name_,type:"reaction"})),this.isRunning=!0;var s=J.trackingContext;J.trackingContext=this;var a=zf(this,n,void 0);J.trackingContext=s,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&ia(this),lo(a)&&this.reportExceptionInDerivation_(a.cause),i&&ht({time:Date.now()-o}),St()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(J.disableErrorBoundaries)throw n;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";J.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(o,n),Xe()&&qr({type:"error",name:this.name_,message:o,error:""+n}),J.globalReactionErrorHandlers.forEach(function(s){return s(n,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Et(),ia(this),St()))},t.getDisposer_=function(n){var i=this,o=function s(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",s)};return n==null||n.addEventListener==null||n.addEventListener("abort",o),o[be]=this,o},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){n===void 0&&(n=!1),ga(this,n)},Sn(e,[{key:"isDisposed",get:function(){return dt(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=pt(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return dt(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=pt(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return dt(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=pt(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return dt(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=pt(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return dt(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=pt(this.flags_,e.diffValueMask_,n===1)}}])}();qt.isDisposedMask_=1;qt.isScheduledMask_=2;qt.isTrackPendingMask_=4;qt.isRunningMask_=8;qt.diffValueMask_=16;var pf=100,oa=function(t){return t()};function el(){J.inBatch>0||J.isRunningReactions||oa(Yg)}function Yg(){J.isRunningReactions=!0;for(var e=J.pendingReactions,t=0;e.length>0;){++t===pf&&(console.error("Reaction doesn't converge to a stable state after "+pf+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}J.isRunningReactions=!1}var _o=Or("Reaction",qt);function Qg(e){var t=oa;oa=function(n){return e(function(){return t(n)})}}function Xe(){return!!J.spyListeners.length}function qr(e){if(J.spyListeners.length)for(var t=J.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function yt(e){var t=fr({},e,{spyReportStart:!0});qr(t)}var Zg={type:"report-end",spyReportEnd:!0};function ht(e){qr(e?fr({},e,{type:"report-end",spyReportEnd:!0}):Zg)}function em(e){return J.spyListeners.push(e),la(function(){J.spyListeners=J.spyListeners.filter(function(t){return t!==e})})}var ha="action",tm="action.bound",tl="autoAction",rm="autoAction.bound",rl="<unnamed action>",sa=di(ha),nm=di(tm,{bound:!0}),aa=di(tl,{autoAction:!0}),im=di(rm,{autoAction:!0,bound:!0});function nl(e){var t=function(n,i){if(je(n))return zr(n.name||rl,n,e);if(je(i))return zr(n,i,e);if(li(i))return(e?aa:sa).decorate_20223_(n,i);if(Vr(i))return fi(n,i,e?aa:sa);if(Vr(n))return Qt(di(e?tl:ha,{name:n,autoAction:e}));fe("Invalid arguments for `action`")};return t}var ot=nl(!1);Object.assign(ot,sa);var ai=nl(!0);Object.assign(ai,aa);ot.bound=Qt(nm);ai.bound=Qt(im);function xn(e){return Vf(e.name||rl,!1,e,this,void 0)}function Ar(e){return je(e)&&e.isMobxAction===!0}function $t(e,t){var r,n,i,o;t===void 0&&(t=fa),je(e)||fe("Autorun expects a function as first argument"),Ar(e)&&fe("Autorun does not accept actions since actions are untrackable");var s=(r=(n=t)==null?void 0:n.name)!=null?r:e.name||"Autorun@"+Ct(),a=!t.scheduler&&!t.delay,c;if(a)c=new qt(s,function(){this.track(g)},t.onError,t.requiresObservable);else{var f=il(t),l=!1;c=new qt(s,function(){l||(l=!0,f(function(){l=!1,c.isDisposed||c.track(g)}))},t.onError,t.requiresObservable)}function g(){e(c)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||c.schedule_(),c.getDisposer_((o=t)==null?void 0:o.signal)}var om=function(t){return t()};function il(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:om}function ol(e,t,r){var n,i,o;r===void 0&&(r=fa),(!je(e)||!je(t))&&fe("First and second argument to reaction should be functions"),zt(r)||fe("Third argument of reactions should be an object");var s=(n=r.name)!=null?n:"Reaction@"+Ct(),a=ot(s,r.onError?sm(r.onError,t):t),c=!r.scheduler&&!r.delay,f=il(r),l=!0,g=!1,P,E=r.compareStructural?Ve.structural:r.equals||Ve.default,M=new qt(s,function(){l||c?z():g||(g=!0,f(z))},r.onError,r.requiresObservable);function z(){if(g=!1,!M.isDisposed){var Q=!1,F=P;M.track(function(){var L=Lg(!1,function(){return e(M)});Q=l||!E(P,L),P=L}),(l&&r.fireImmediately||!l&&Q)&&a(P,F,M),l=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||M.schedule_(),M.getDisposer_((o=r)==null?void 0:o.signal)}function sm(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var am="onBO",um="onBUO";function Nn(e,t,r){return sl(am,e,t,r)}function Hr(e,t,r){return sl(um,e,t,r)}function sl(e,t,r,n){var i=typeof n=="function"?Rt(t,r):Rt(t),o=je(n)?n:r,s=e+"L";return i[s]?i[s].add(o):i[s]=new Set([o]),function(){var a=i[s];a&&(a.delete(o),a.size===0&&delete i[s])}}var cm="never",co="always",fm="observed";function al(e){e.isolateGlobalState===!0&&qg();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(J.useProxies=t===co?!0:t===cm?!1:typeof Proxy<"u"),t==="ifavailable"&&(J.verifyProxies=!0),r!==void 0){var n=r===co?co:r===fm;J.enforceActions=n,J.allowStateChanges=!(n===!0||n===co)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(J[i]=!!e[i])}),J.allowStateReads=!J.observableRequiresReaction,J.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&Qg(e.reactionScheduler)}function lm(e,t,r,n){arguments.length>4&&fe("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&fe("'extendObservable' expects an object as first argument"),Zt(e)&&fe("'extendObservable' should not be used on maps, use map.merge instead"),zt(t)||fe("'extendObservable' only accepts plain objects as second argument"),(In(t)||In(r))&&fe("Extending an object with another observable (object) is not supported");var i=Kh(t);return Jr(function(){var o=Rn(e,n)[be];So(i).forEach(function(s){o.extend_(s,i[s],r&&s in r?r[s]:!0)})}),e}function yi(e,t){return ul(Rt(e,t))}function ul(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=dm(e.observing_).map(ul)),t}function hi(e,t){return cl(Rt(e,t))}function cl(e){var t={name:e.name_};return Gg(e)&&(t.observers=Array.from(Wg(e)).map(cl)),t}function dm(e){return Array.from(new Set(e))}var pm=0;function fl(){this.message="FLOW_CANCELLED"}fl.prototype=Object.create(Error.prototype);var Ys=Bf("flow"),ym=Bf("flow.bound",{bound:!0}),On=Object.assign(function(t,r){if(li(r))return Ys.decorate_20223_(t,r);if(Vr(r))return fi(t,r,Ys);arguments.length!==1&&fe("Flow expects single argument with generator function");var n=t,i=n.name||"<unnamed flow>",o=function(){var a=this,c=arguments,f=++pm,l=ot(i+" - runid: "+f+" - init",n).apply(a,c),g,P=void 0,E=new Promise(function(M,z){var Q=0;g=z;function F(H){P=void 0;var j;try{j=ot(i+" - runid: "+f+" - yield "+Q++,l.next).call(l,H)}catch(re){return z(re)}G(j)}function L(H){P=void 0;var j;try{j=ot(i+" - runid: "+f+" - yield "+Q++,l.throw).call(l,H)}catch(re){return z(re)}G(j)}function G(H){if(je(H?.then)){H.then(G,z);return}return H.done?M(H.value):(P=Promise.resolve(H.value),P.then(F,L))}F(void 0)});return E.cancel=ot(i+" - runid: "+f+" - cancel",function(){try{P&&yf(P);var M=l.return(void 0),z=Promise.resolve(M.value);z.then(Tn,Tn),yf(z),g(new fl)}catch(Q){g(Q)}}),E};return o.isMobXFlow=!0,o},Ys);On.bound=Qt(ym);function yf(e){je(e.cancel)&&e.cancel()}function ui(e){return e?.isMobXFlow===!0}function hm(e,t){return e?t!==void 0?Zt(e)||Pn(e)?fe("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):Gr(e)?e[be].values_.has(t):!1:Gr(e)||!!e[be]||da(e)||_o(e)||pi(e):!1}function In(e){return arguments.length!==1&&fe("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),hm(e)}function gm(e){if(Gr(e))return e[be].ownKeys_();fe(38)}function fo(e,t,r){return e.set(t,r),r}function wn(e,t){if(e==null||typeof e!="object"||e instanceof Date||!In(e))return e;if(Fg(e)||pi(e))return wn(e.get(),t);if(t.has(e))return t.get(e);if(Pn(e)){var r=fo(t,e,new Array(e.length));return e.forEach(function(s,a){r[a]=wn(s,t)}),r}if(jt(e)){var n=fo(t,e,new Set);return e.forEach(function(s){n.add(wn(s,t))}),n}if(Zt(e)){var i=fo(t,e,new Map);return e.forEach(function(s,a){i.set(a,wn(s,t))}),i}else{var o=fo(t,e,{});return gm(e).forEach(function(s){ci.propertyIsEnumerable.call(e,s)&&(o[s]=wn(e[s],t))}),o}}function lr(e,t){return t&&fe("toJS no longer supports options"),wn(e,new Map)}function ga(){for(var e=!1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[r.length-1]=="boolean"&&(e=r.pop());var i=mm(r);if(!i)return fe("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===Nt.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?Nt.BREAK:Nt.LOG}function mm(e){switch(e.length){case 0:return J.trackingDerivation;case 1:return Rt(e[0]);case 2:return Rt(e[0],e[1])}}function ur(e,t){t===void 0&&(t=void 0),Et();try{return e.apply(t)}finally{St()}}function Fr(e){return e[be]}var bm={has:function(t,r){return J.trackingDerivation&&oi("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Fr(t).has_(r)},get:function(t,r){return Fr(t).get_(r)},set:function(t,r,n){var i;return Vr(r)?(Fr(t).values_.has(r)||oi("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=Fr(t).set_(r,n,!0))!=null?i:!0):!1},deleteProperty:function(t,r){var n;return oi("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Vr(r)?(n=Fr(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return oi("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=Fr(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return J.trackingDerivation&&oi("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Fr(t).ownKeys_()},preventExtensions:function(t){fe(13)}};function vm(e,t){var r,n;return Sf(),e=Rn(e,t),(n=(r=e[be]).proxy_)!=null?n:r.proxy_=new Proxy(e,bm)}function Ot(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function gi(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),la(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function It(e,t){var r=Wr();try{for(var n=[].concat(e.interceptors_||[]),i=0,o=n.length;i<o&&(t=n[i](t),t&&!t.type&&fe(14),!!t);i++);return t}finally{cr(r)}}function Vt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function mi(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),la(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Kt(e,t){var r=Wr(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,o=n.length;i<o;i++)n[i](t);cr(r)}}function Er(e,t,r){return Jr(function(){var n,i=Rn(e,r)[be];t&&e[it]&&fe("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(n=t)!=null||(t=Hh(e)),So(t).forEach(function(o){return i.make_(o,t[o])})}),e}var hf="splice",Ft="update",_m=1e4,wm={get:function(t,r){var n=t[be];return r===be?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):xt(wo,r)?wo[r]:t[r]},set:function(t,r,n){var i=t[be];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){fe(15)}},ma=function(){function e(r,n,i,o){r===void 0&&(r="ObservableArray@"+Ct()),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=o,this.atom_=new Ir(r),this.enhancer_=function(s,a){return n(s,a,r+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return gi(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),mi(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&fe("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var o=new Array(n-i),s=0;s<n-i;s++)o[s]=void 0;this.spliceWithArray_(i,0,o)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&fe(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&gl(n+i+1)},t.spliceWithArray_=function(n,i,o){var s=this;Xt(this.atom_);var a=this.values_.length;if(n===void 0?n=0:n>a?n=a:n<0&&(n=Math.max(0,a+n)),arguments.length===1?i=a-n:i==null?i=0:i=Math.max(0,Math.min(i,a-n)),o===void 0&&(o=go),Ot(this)){var c=It(this,{object:this.proxy_,type:hf,index:n,removedCount:i,added:o});if(!c)return go;i=c.removedCount,o=c.added}o=o.length===0?o:o.map(function(g){return s.enhancer_(g,void 0)}),this.legacyMode_;var f=o.length-i;this.updateArrayLength_(a,f);var l=this.spliceItemsIntoValues_(n,i,o);return(i!==0||o.length!==0)&&this.notifyArraySplice_(n,o,l),this.dehanceValues_(l)},t.spliceItemsIntoValues_=function(n,i,o){if(o.length<_m){var s;return(s=this.values_).splice.apply(s,[n,i].concat(o))}else{var a=this.values_.slice(n,n+i),c=this.values_.slice(n+i);this.values_.length+=o.length-i;for(var f=0;f<o.length;f++)this.values_[n+f]=o[f];for(var l=0;l<c.length;l++)this.values_[n+o.length+l]=c[l];return a}},t.notifyArrayChildUpdate_=function(n,i,o){var s=!this.owned_&&Xe(),a=Vt(this),c=a||s?{observableKind:"array",object:this.proxy_,type:Ft,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:o}:null;s&&yt(c),this.atom_.reportChanged(),a&&Kt(this,c),s&&ht()},t.notifyArraySplice_=function(n,i,o){var s=!this.owned_&&Xe(),a=Vt(this),c=a||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:hf,index:n,removed:o,added:i,removedCount:o.length,addedCount:i.length}:null;s&&yt(c),this.atom_.reportChanged(),a&&Kt(this,c),s&&ht()},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+n+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX");return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var o=this.values_;if(this.legacyMode_&&n>o.length&&fe(17,n,o.length),n<o.length){Xt(this.atom_);var s=o[n];if(Ot(this)){var a=It(this,{type:Ft,object:this.proxy_,index:n,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,s);var c=i!==s;c&&(o[n]=i,this.notifyArrayChildUpdate_(n,i,s))}else{for(var f=new Array(n+1-o.length),l=0;l<f.length-1;l++)f[l]=void 0;f[f.length-1]=i,this.spliceWithArray_(o.length,0,f)}},e}();function Tm(e,t,r,n){return r===void 0&&(r="ObservableArray@"+Ct()),n===void 0&&(n=!1),Sf(),Jr(function(){var i=new ma(r,t,n,!1);Nf(i.values_,be,i);var o=new Proxy(i.values_,wm);return i.proxy_=o,e&&e.length&&i.spliceWithArray_(0,0,e),o})}var wo={clear:function(){return this.splice(0)},replace:function(t){var r=this[be];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];var s=this[be];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(t);case 2:return s.spliceWithArray_(t,r)}return s.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[be].spliceWithArray_(t,r,n)},push:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[be].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[be],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return J.trackingDerivation&&fe(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){J.trackingDerivation&&fe(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[be],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Ue("at",gt);Ue("concat",gt);Ue("flat",gt);Ue("includes",gt);Ue("indexOf",gt);Ue("join",gt);Ue("lastIndexOf",gt);Ue("slice",gt);Ue("toString",gt);Ue("toLocaleString",gt);Ue("toSorted",gt);Ue("toSpliced",gt);Ue("with",gt);Ue("every",Gt);Ue("filter",Gt);Ue("find",Gt);Ue("findIndex",Gt);Ue("findLast",Gt);Ue("findLastIndex",Gt);Ue("flatMap",Gt);Ue("forEach",Gt);Ue("map",Gt);Ue("some",Gt);Ue("toReversed",Gt);Ue("reduce",ll);Ue("reduceRight",ll);function Ue(e,t){typeof Array.prototype[e]=="function"&&(wo[e]=t(e))}function gt(e){return function(){var t=this[be];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Gt(e){return function(t,r){var n=this,i=this[be];i.atom_.reportObserved();var o=i.dehanceValues_(i.values_);return o[e](function(s,a){return t.call(r,s,a,n)})}}function ll(e){return function(){var t=this,r=this[be];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(o,s,a){return i(o,s,a,t)},n[e].apply(n,arguments)}}var Am=Or("ObservableArrayAdministration",ma);function Pn(e){return Io(e)&&Am(e[be])}var Om={},wr="add",To="delete",dl=function(){function e(r,n,i){var o=this;n===void 0&&(n=Kr),i===void 0&&(i="ObservableMap@"+Ct()),this.enhancer_=void 0,this.name_=void 0,this[be]=Om,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,je(Map)||fe(18),Jr(function(){o.keysAtom_=$f(o.name_+".keys()"),o.data_=new Map,o.hasMap_=new Map,r&&o.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!J.trackingDerivation)return this.has_(n);var o=this.hasMap_.get(n);if(!o){var s=o=new Tr(this.has_(n),No,this.name_+"."+Zs(n)+"?",!1);this.hasMap_.set(n,s),Hr(s,function(){return i.hasMap_.delete(n)})}return o.get()},t.set=function(n,i){var o=this.has_(n);if(Ot(this)){var s=It(this,{type:o?Ft:wr,object:this,newValue:i,name:n});if(!s)return this;i=s.newValue}return o?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(Xt(this.keysAtom_),Ot(this)){var o=It(this,{type:To,object:this,name:n});if(!o)return!1}if(this.has_(n)){var s=Xe(),a=Vt(this),c=a||s?{observableKind:"map",debugObjectName:this.name_,type:To,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return s&&yt(c),ur(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var l=i.data_.get(n);l.setNewValue_(void 0),i.data_.delete(n)}),a&&Kt(this,c),s&&ht(),!0}return!1},t.updateValue_=function(n,i){var o=this.data_.get(n);if(i=o.prepareNewValue_(i),i!==J.UNCHANGED){var s=Xe(),a=Vt(this),c=a||s?{observableKind:"map",debugObjectName:this.name_,type:Ft,object:this,oldValue:o.value_,name:n,newValue:i}:null;s&&yt(c),o.setNewValue_(i),a&&Kt(this,c),s&&ht()}},t.addValue_=function(n,i){var o=this;Xt(this.keysAtom_),ur(function(){var f,l=new Tr(i,o.enhancer_,o.name_+"."+Zs(n),!1);o.data_.set(n,l),i=l.value_,(f=o.hasMap_.get(n))==null||f.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=Xe(),a=Vt(this),c=a||s?{observableKind:"map",debugObjectName:this.name_,type:wr,object:this,name:n,newValue:i}:null;s&&yt(c),a&&Kt(this,c),s&&ht()},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return gf({next:function(){var s=i.next(),a=s.done,c=s.value;return{done:a,value:a?void 0:n.get(c)}}})},t.entries=function(){var n=this,i=this.keys();return gf({next:function(){var s=i.next(),a=s.done,c=s.value;return{done:a,value:a?void 0:[c,n.get(c)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var o=An(this),s;!(s=o()).done;){var a=s.value,c=a[0],f=a[1];n.call(i,f,c,this)}},t.merge=function(n){var i=this;return Zt(n)&&(n=new Map(n)),ur(function(){zt(n)?Vh(n).forEach(function(o){return i.set(o,n[o])}):Array.isArray(n)?n.forEach(function(o){var s=o[0],a=o[1];return i.set(s,a)}):En(n)?(Fh(n)||fe(19,n),n.forEach(function(o,s){return i.set(s,o)})):n!=null&&fe(20,n)}),this},t.clear=function(){var n=this;ur(function(){Re(function(){for(var i=An(n.keys()),o;!(o=i()).done;){var s=o.value;n.delete(s)}})})},t.replace=function(n){var i=this;return ur(function(){for(var o=Im(n),s=new Map,a=!1,c=An(i.data_.keys()),f;!(f=c()).done;){var l=f.value;if(!o.has(l)){var g=i.delete(l);if(g)a=!0;else{var P=i.data_.get(l);s.set(l,P)}}}for(var E=An(o.entries()),M;!(M=E()).done;){var z=M.value,Q=z[0],F=z[1],L=i.data_.has(Q);if(i.set(Q,F),i.data_.has(Q)){var G=i.data_.get(Q);s.set(Q,G),L||(a=!0)}}if(!a)if(i.data_.size!==s.size)i.keysAtom_.reportChanged();else for(var H=i.data_.keys(),j=s.keys(),re=H.next(),W=j.next();!re.done;){if(re.value!==W.value){i.keysAtom_.reportChanged();break}re=H.next(),W=j.next()}i.data_=s}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support fireImmediately=true in combination with maps."),mi(this,n)},t.intercept_=function(n){return gi(this,n)},Sn(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Zt=Or("ObservableMap",dl);function gf(e){return e[Symbol.toStringTag]="MapIterator",wa(e)}function Im(e){if(En(e)||Zt(e))return e;if(Array.isArray(e))return new Map(e);if(zt(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return fe(21,e)}var Em={},pl=function(){function e(r,n,i){var o=this;n===void 0&&(n=Kr),i===void 0&&(i="ObservableSet@"+Ct()),this.name_=void 0,this[be]=Em,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,je(Set)||fe(22),this.enhancer_=function(s,a){return n(s,a,i)},Jr(function(){o.atom_=$f(o.name_),r&&o.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;ur(function(){Re(function(){for(var i=An(n.data_.values()),o;!(o=i()).done;){var s=o.value;n.delete(s)}})})},t.forEach=function(n,i){for(var o=An(this),s;!(s=o()).done;){var a=s.value;n.call(i,a,a,this)}},t.add=function(n){var i=this;if(Xt(this.atom_),Ot(this)){var o=It(this,{type:wr,object:this,newValue:n});if(!o)return this;n=o.newValue}if(!this.has(n)){ur(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var s=Xe(),a=Vt(this),c=a||s?{observableKind:"set",debugObjectName:this.name_,type:wr,object:this,newValue:n}:null;s&&yt(c),a&&Kt(this,c),s&&ht()}return this},t.delete=function(n){var i=this;if(Ot(this)){var o=It(this,{type:To,object:this,oldValue:n});if(!o)return!1}if(this.has(n)){var s=Xe(),a=Vt(this),c=a||s?{observableKind:"set",debugObjectName:this.name_,type:To,object:this,oldValue:n}:null;return s&&yt(c),ur(function(){i.atom_.reportChanged(),i.data_.delete(n)}),a&&Kt(this,c),s&&ht(),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=this.values();return mf({next:function(){var o=n.next(),s=o.value,a=o.done;return a?{value:void 0,done:a}:{value:[s,s],done:a}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=this.data_.values();return mf({next:function(){var s=i.next(),a=s.value,c=s.done;return c?{value:void 0,done:c}:{value:n.dehanceValue_(a),done:c}}})},t.intersection=function(n){if(ar(n)&&!jt(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(ar(n)&&!jt(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(ar(n)&&!jt(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(ar(n)&&!jt(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return jt(n)&&(n=new Set(n)),ur(function(){Array.isArray(n)?(i.clear(),n.forEach(function(o){return i.add(o)})):ar(n)?(i.clear(),n.forEach(function(o){return i.add(o)})):n!=null&&fe("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support fireImmediately=true in combination with sets."),mi(this,n)},t.intercept_=function(n){return gi(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Sn(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),jt=Or("ObservableSet",pl);function mf(e){return e[Symbol.toStringTag]="SetIterator",wa(e)}var bf=Object.create(null),vf="remove",ua=function(){function e(r,n,i,o){n===void 0&&(n=new Map),o===void 0&&(o=vg),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=o,this.keysAtom_=new Ir(this.name_+".keys"),this.isPlainObject_=zt(this.target_),ml(this.defaultAnnotation_)||fe("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var o=this.values_.get(n);if(o instanceof Pt)return o.set(i),!0;if(Ot(this)){var s=It(this,{type:Ft,object:this.proxy_||this.target_,name:n,newValue:i});if(!s)return null;i=s.newValue}if(i=o.prepareNewValue_(i),i!==J.UNCHANGED){var a=Vt(this),c=Xe(),f=a||c?{type:Ft,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:n,newValue:i}:null;c&&yt(f),o.setNewValue_(i),a&&Kt(this,f),c&&ht()}return!0},t.get_=function(n){return J.trackingDerivation&&!xt(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,o){return o===void 0&&(o=!1),xt(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):o?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},t.has_=function(n){if(!J.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new Tr(n in this.target_,No,this.name_+"."+Zs(n)+"?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Tf(this,i,n),!(n in this.target_)){var o;if((o=this.target_[it])!=null&&o[n])return;fe(1,i.annotationType_,this.name_+"."+n.toString())}for(var s=this.target_;s&&s!==ci;){var a=ho(s,n);if(a){var c=i.make_(this,n,a,s);if(c===0)return;if(c===1)break}s=Object.getPrototypeOf(s)}wf(this,i,n)}},t.extend_=function(n,i,o,s){if(s===void 0&&(s=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(n,i,s);Tf(this,o,n);var a=o.extend_(this,n,i,s);return a&&wf(this,o,n),a},t.defineProperty_=function(n,i,o){o===void 0&&(o=!1),Xt(this.keysAtom_);try{Et();var s=this.delete_(n);if(!s)return s;if(Ot(this)){var a=It(this,{object:this.proxy_||this.target_,name:n,type:wr,newValue:i.value});if(!a)return null;var c=a.newValue;i.value!==c&&(i=fr({},i,{value:c}))}if(o){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Yt(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{St()}return!0},t.defineObservableProperty_=function(n,i,o,s){s===void 0&&(s=!1),Xt(this.keysAtom_);try{Et();var a=this.delete_(n);if(!a)return a;if(Ot(this)){var c=It(this,{object:this.proxy_||this.target_,name:n,type:wr,newValue:i});if(!c)return null;i=c.newValue}var f=_f(n),l={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,n,l))return!1}else Yt(this.target_,n,l);var g=new Tr(i,o,this.name_+"."+n.toString(),!1);this.values_.set(n,g),this.notifyPropertyAddition_(n,g.value_)}finally{St()}return!0},t.defineComputedProperty_=function(n,i,o){o===void 0&&(o=!1),Xt(this.keysAtom_);try{Et();var s=this.delete_(n);if(!s)return s;if(Ot(this)){var a=It(this,{object:this.proxy_||this.target_,name:n,type:wr,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+n.toString()),i.context=this.proxy_||this.target_;var c=_f(n),f={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,n,f))return!1}else Yt(this.target_,n,f);this.values_.set(n,new Pt(i)),this.notifyPropertyAddition_(n,void 0)}finally{St()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),Xt(this.keysAtom_),!xt(this.target_,n))return!0;if(Ot(this)){var o=It(this,{object:this.proxy_||this.target_,name:n,type:vf});if(!o)return null}try{var s;Et();var a=Vt(this),c=Xe(),f=this.values_.get(n),l=void 0;if(!f&&(a||c)){var g;l=(g=ho(this.target_,n))==null?void 0:g.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(delete this.appliedAnnotations_[n],f&&(this.values_.delete(n),f instanceof Tr&&(l=f.value_),Yf(f)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(n))==null||s.set(n in this.target_),a||c){var P={type:vf,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:l,name:n};c&&yt(P),a&&Kt(this,P),c&&ht()}}finally{St()}return!0},t.observe_=function(n,i){return i===!0&&fe("`observe` doesn't support the fire immediately property for observable objects."),mi(this,n)},t.intercept_=function(n){return gi(this,n)},t.notifyPropertyAddition_=function(n,i){var o,s=Vt(this),a=Xe();if(s||a){var c=s||a?{type:wr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;a&&yt(c),s&&Kt(this,c),a&&ht()}(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),So(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Rn(e,t){var r;if(t&&Gr(e)&&fe("Options can't be provided for already observable objects."),xt(e,be))return va(e)instanceof ua||fe("Cannot convert '"+Ao(e)+`' into observable object:
26
26
  The target is already observable of different type.
27
- Extending builtins is not supported.`),e;Object.isExtensible(e)||fe("Cannot make the designated object observable; it is not extensible");var n=(r=t?.name)!=null?r:(zt(e)?"ObservableObject":e.constructor.name)+"@"+Ct(),i=new ua(e,new Map,String(n),Pg(t));return Io(e,be,i),e}var Sm=Or("ObservableObjectAdministration",ua);function _f(e){return bf[e]||(bf[e]={get:function(){return this[be].getObservablePropValue_(e)},set:function(r){return this[be].setObservablePropValue_(e,r)}})}function Gr(e){return Oo(e)?Sm(e[be]):!1}function wf(e,t,r){var n;e.appliedAnnotations_[r]=t,(n=e.target_[it])==null||delete n[r]}function Tf(e,t,r){if(ml(t)||fe("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),!go(t)&&xt(e.appliedAnnotations_,r)){var n=e.name_+"."+r.toString(),i=e.appliedAnnotations_[r].annotationType_,o=t.annotationType_;fe("Cannot apply '"+o+"' to '"+n+"':"+(`
27
+ Extending builtins is not supported.`),e;Object.isExtensible(e)||fe("Cannot make the designated object observable; it is not extensible");var n=(r=t?.name)!=null?r:(zt(e)?"ObservableObject":e.constructor.name)+"@"+Ct(),i=new ua(e,new Map,String(n),Pg(t));return Eo(e,be,i),e}var Sm=Or("ObservableObjectAdministration",ua);function _f(e){return bf[e]||(bf[e]={get:function(){return this[be].getObservablePropValue_(e)},set:function(r){return this[be].setObservablePropValue_(e,r)}})}function Gr(e){return Io(e)?Sm(e[be]):!1}function wf(e,t,r){var n;e.appliedAnnotations_[r]=t,(n=e.target_[it])==null||delete n[r]}function Tf(e,t,r){if(ml(t)||fe("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),!mo(t)&&xt(e.appliedAnnotations_,r)){var n=e.name_+"."+r.toString(),i=e.appliedAnnotations_[r].annotationType_,o=t.annotationType_;fe("Cannot apply '"+o+"' to '"+n+"':"+(`
28
28
  The field is already annotated with '`+i+"'.")+`
29
29
  Re-annotating fields is not allowed.
30
- Use 'override' annotation for methods overridden by subclass.`)}}var xm=hl(0),Nm=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Qs=0,yl=function(){};function Pm(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Pm(yl,Array.prototype);var ba=function(e){function t(n,i,o,s){var a;return o===void 0&&(o="ObservableArray@"+Ct()),s===void 0&&(s=!1),a=e.call(this)||this,Jr(function(){var c=new ma(o,i,s,!0);c.proxy_=a,Nf(a,be,c),n&&n.length&&a.spliceWithArray(0,0,n),Nm&&Object.defineProperty(a,"0",xm)}),a}Cf(t,e);var r=t.prototype;return r.concat=function(){this[be].atom_.reportObserved();for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),o.map(function(a){return Nn(a)?a.slice():a}))},r[Symbol.iterator]=function(){var n=this,i=0;return wa({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},En(t,[{key:"length",get:function(){return this[be].getArrayLength_()},set:function(i){this[be].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(yl);Object.entries(_o).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Io(ba.prototype,t,r)});function hl(e){return{enumerable:!1,configurable:!0,get:function(){return this[be].get_(e)},set:function(r){this[be].set_(e,r)}}}function Rm(e){Yt(ba.prototype,""+e,hl(e))}function gl(e){if(e>Qs){for(var t=Qs;t<e+100;t++)Rm(t);Qs=e}}gl(1e3);function Cm(e,t,r){return new ba(e,t,r)}function Rt(e,t){if(typeof e=="object"&&e!==null){if(Nn(e))return t!==void 0&&fe(23),e[be].atom_;if(jt(e))return e.atom_;if(Zt(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||fe(25,t,To(e)),r}if(Gr(e)){if(!t)return fe(26);var n=e[be].values_.get(t);return n||fe(27,t,To(e)),n}if(da(e)||pi(e)||vo(e))return e}else if(je(e)&&vo(e[be]))return e[be];fe(28)}function va(e,t){if(e||fe(29),t!==void 0)return va(Rt(e,t));if(da(e)||pi(e)||vo(e)||Zt(e)||jt(e))return e;if(e[be])return e[be];fe(24,e)}function To(e,t){var r;if(t!==void 0)r=Rt(e,t);else{if(Ar(e))return e.name;Gr(e)||Zt(e)||jt(e)?r=va(e):r=Rt(e)}return r.name_}function Jr(e){var t=Wr(),r=Po(!0);Et();try{return e()}finally{St(),Ro(r),cr(t)}}var Af=ci.toString;function _a(e,t,r){return r===void 0&&(r=-1),ca(e,t,r)}function ca(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var o=typeof e;if(o!=="function"&&o!=="object"&&typeof t!="object")return!1;var s=Af.call(e);if(s!==Af.call(t))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=Of(e),t=Of(t);var a=s==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var c=e.constructor,f=t.constructor;if(c!==f&&!(je(c)&&c instanceof c&&je(f)&&f instanceof f)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var l=n.length;l--;)if(n[l]===e)return i[l]===t;if(n.push(e),i.push(t),a){if(l=e.length,l!==t.length)return!1;for(;l--;)if(!ca(e[l],t[l],r-1,n,i))return!1}else{var g=Object.keys(e),P=g.length;if(Object.keys(t).length!==P)return!1;for(var E=0;E<P;E++){var M=g[E];if(!(xt(t,M)&&ca(e[M],t[M],r-1,n,i)))return!1}}return n.pop(),i.pop(),!0}function Of(e){return Nn(e)?e.slice():In(e)||Zt(e)||ar(e)||jt(e)?Array.from(e.entries()):e}var If,$m=((If=Ao().Iterator)==null?void 0:If.prototype)||{};function wa(e){return e[Symbol.iterator]=Um,Object.assign(Object.create($m),e)}function Um(){return this}function ml(e){return e instanceof Object&&typeof e.annotationType_=="string"&&je(e.make_)&&je(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Ao();typeof t[e]>"u"&&fe("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:em,extras:{getDebugName:To},$mobx:be});var Bm=Object.create,Ta=Object.defineProperty,Mm=Object.getOwnPropertyDescriptor,bl=Object.getOwnPropertyNames,km=Object.getPrototypeOf,Dm=Object.prototype.hasOwnProperty,De=(e,t)=>function(){return t||(0,e[bl(e)[0]])((t={exports:{}}).exports,t),t.exports},Aa=(e,t)=>{for(var r in t)Ta(e,r,{get:t[r],enumerable:!0})},Lm=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bl(t))!Dm.call(e,i)&&i!==r&&Ta(e,i,{get:()=>t[i],enumerable:!(n=Mm(t,i))||n.enumerable});return e},Ut=(e,t,r)=>(r=e!=null?Bm(km(e)):{},Lm(t||!e||!e.__esModule?Ta(r,"default",{value:e,enumerable:!0}):r,e));var dr=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/typebox.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`;var t;(function(d){let _=new Map;function I(){return new Map(_)}d.Entries=I;function U(){return _.clear()}d.Clear=U;function R(w){return _.delete(w)}d.Delete=R;function S(w){return _.has(w)}d.Has=S;function h(w,u){_.set(w,u)}d.Set=h;function T(w){return _.get(w)}d.Get=T})(t||(e.TypeRegistry=t={}));var r=class extends Error{constructor(d){super(d)}};e.TypeBoxError=r;var n;(function(d){let _=new Map;function I(){return new Map(_)}d.Entries=I;function U(){return _.clear()}d.Clear=U;function R(w){return _.delete(w)}d.Delete=R;function S(w){return _.has(w)}d.Has=S;function h(w,u){_.set(w,u)}d.Set=h;function T(w){return _.get(w)}d.Get=T})(n||(e.FormatRegistry=n={}));var i;(function(d){function _(v){return Array.isArray(v)}d.IsArray=_;function I(v){return typeof v=="bigint"}d.IsBigInt=I;function U(v){return typeof v=="boolean"}d.IsBoolean=U;function R(v){return v instanceof globalThis.Date}d.IsDate=R;function S(v){return v===null}d.IsNull=S;function h(v){return typeof v=="number"}d.IsNumber=h;function T(v){return typeof v=="object"&&v!==null}d.IsObject=T;function w(v){return typeof v=="string"}d.IsString=w;function u(v){return v instanceof globalThis.Uint8Array}d.IsUint8Array=u;function A(v){return v===void 0}d.IsUndefined=A})(i||(e.ValueGuard=i={}));var o=class extends r{};e.TypeGuardUnknownTypeError=o;var s;(function(d){function _(m){try{return new RegExp(m),!0}catch{return!1}}function I(m){if(!i.IsString(m))return!1;for(let Pe=0;Pe<m.length;Pe++){let _t=m.charCodeAt(Pe);if(_t>=7&&_t<=13||_t===27||_t===127)return!1}return!0}function U(m){return h(m)||ze(m)}function R(m){return i.IsUndefined(m)||i.IsBigInt(m)}function S(m){return i.IsUndefined(m)||i.IsNumber(m)}function h(m){return i.IsUndefined(m)||i.IsBoolean(m)}function T(m){return i.IsUndefined(m)||i.IsString(m)}function w(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)&&_(m)}function u(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)}function A(m){return i.IsUndefined(m)||ze(m)}function v(m){return we(m,"Any")&&T(m.$id)}d.TAny=v;function b(m){return we(m,"Array")&&m.type==="array"&&T(m.$id)&&ze(m.items)&&S(m.minItems)&&S(m.maxItems)&&h(m.uniqueItems)&&A(m.contains)&&S(m.minContains)&&S(m.maxContains)}d.TArray=b;function x(m){return we(m,"AsyncIterator")&&m.type==="AsyncIterator"&&T(m.$id)&&ze(m.items)}d.TAsyncIterator=x;function K(m){return we(m,"BigInt")&&m.type==="bigint"&&T(m.$id)&&R(m.exclusiveMaximum)&&R(m.exclusiveMinimum)&&R(m.maximum)&&R(m.minimum)&&R(m.multipleOf)}d.TBigInt=K;function te(m){return we(m,"Boolean")&&m.type==="boolean"&&T(m.$id)}d.TBoolean=te;function ne(m){return we(m,"Constructor")&&m.type==="Constructor"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Pe=>ze(Pe))&&ze(m.returns)}d.TConstructor=ne;function ge(m){return we(m,"Date")&&m.type==="Date"&&T(m.$id)&&S(m.exclusiveMaximumTimestamp)&&S(m.exclusiveMinimumTimestamp)&&S(m.maximumTimestamp)&&S(m.minimumTimestamp)&&S(m.multipleOfTimestamp)}d.TDate=ge;function _e(m){return we(m,"Function")&&m.type==="Function"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Pe=>ze(Pe))&&ze(m.returns)}d.TFunction=_e;function Be(m){return we(m,"Integer")&&m.type==="integer"&&T(m.$id)&&S(m.exclusiveMaximum)&&S(m.exclusiveMinimum)&&S(m.maximum)&&S(m.minimum)&&S(m.multipleOf)}d.TInteger=Be;function Fe(m){return we(m,"Intersect")&&!(i.IsString(m.type)&&m.type!=="object")&&i.IsArray(m.allOf)&&m.allOf.every(Pe=>ze(Pe)&&!Hn(Pe))&&T(m.type)&&(h(m.unevaluatedProperties)||A(m.unevaluatedProperties))&&T(m.$id)}d.TIntersect=Fe;function Br(m){return we(m,"Iterator")&&m.type==="Iterator"&&T(m.$id)&&ze(m.items)}d.TIterator=Br;function we(m,Pe){return gr(m)&&m[e.Kind]===Pe}d.TKindOf=we;function gr(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}d.TKind=gr;function Mr(m){return N(m)&&i.IsString(m.const)}d.TLiteralString=Mr;function O(m){return N(m)&&i.IsNumber(m.const)}d.TLiteralNumber=O;function le(m){return N(m)&&i.IsBoolean(m.const)}d.TLiteralBoolean=le;function N(m){return we(m,"Literal")&&T(m.$id)&&(i.IsBoolean(m.const)||i.IsNumber(m.const)||i.IsString(m.const))}d.TLiteral=N;function me(m){return we(m,"Never")&&i.IsObject(m.not)&&Object.getOwnPropertyNames(m.not).length===0}d.TNever=me;function ie(m){return we(m,"Not")&&ze(m.not)}d.TNot=ie;function de(m){return we(m,"Null")&&m.type==="null"&&T(m.$id)}d.TNull=de;function xe(m){return we(m,"Number")&&m.type==="number"&&T(m.$id)&&S(m.exclusiveMaximum)&&S(m.exclusiveMinimum)&&S(m.maximum)&&S(m.minimum)&&S(m.multipleOf)}d.TNumber=xe;function Le(m){return we(m,"Object")&&m.type==="object"&&T(m.$id)&&i.IsObject(m.properties)&&U(m.additionalProperties)&&S(m.minProperties)&&S(m.maxProperties)&&Object.entries(m.properties).every(([Pe,_t])=>I(Pe)&&ze(_t))}d.TObject=Le;function tt(m){return we(m,"Promise")&&m.type==="Promise"&&T(m.$id)&&ze(m.item)}d.TPromise=tt;function Ze(m){return we(m,"Record")&&m.type==="object"&&T(m.$id)&&U(m.additionalProperties)&&i.IsObject(m.patternProperties)&&(Pe=>{let _t=Object.getOwnPropertyNames(Pe.patternProperties);return _t.length===1&&_(_t[0])&&i.IsObject(Pe.patternProperties)&&ze(Pe.patternProperties[_t[0]])})(m)}d.TRecord=Ze;function nt(m){return i.IsObject(m)&&e.Hint in m&&m[e.Hint]==="Recursive"}d.TRecursive=nt;function or(m){return we(m,"Ref")&&T(m.$id)&&i.IsString(m.$ref)}d.TRef=or;function ln(m){return we(m,"String")&&m.type==="string"&&T(m.$id)&&S(m.minLength)&&S(m.maxLength)&&w(m.pattern)&&u(m.format)}d.TString=ln;function dn(m){return we(m,"Symbol")&&m.type==="symbol"&&T(m.$id)}d.TSymbol=dn;function kr(m){return we(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}d.TTemplateLiteral=kr;function Li(m){return we(m,"This")&&T(m.$id)&&i.IsString(m.$ref)}d.TThis=Li;function Hn(m){return i.IsObject(m)&&e.Transform in m}d.TTransform=Hn;function Ke(m){return we(m,"Tuple")&&m.type==="array"&&T(m.$id)&&i.IsNumber(m.minItems)&&i.IsNumber(m.maxItems)&&m.minItems===m.maxItems&&(i.IsUndefined(m.items)&&i.IsUndefined(m.additionalItems)&&m.minItems===0||i.IsArray(m.items)&&m.items.every(Pe=>ze(Pe)))}d.TTuple=Ke;function ji(m){return we(m,"Undefined")&&m.type==="undefined"&&T(m.$id)}d.TUndefined=ji;function xs(m){return Dr(m)&&m.anyOf.every(Pe=>Mr(Pe)||O(Pe))}d.TUnionLiteral=xs;function Dr(m){return we(m,"Union")&&T(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every(Pe=>ze(Pe))}d.TUnion=Dr;function pn(m){return we(m,"Uint8Array")&&m.type==="Uint8Array"&&T(m.$id)&&S(m.minByteLength)&&S(m.maxByteLength)}d.TUint8Array=pn;function rt(m){return we(m,"Unknown")&&T(m.$id)}d.TUnknown=rt;function Fi(m){return we(m,"Unsafe")}d.TUnsafe=Fi;function Jn(m){return we(m,"Void")&&m.type==="void"&&T(m.$id)}d.TVoid=Jn;function Ns(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}d.TReadonly=Ns;function Ps(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}d.TOptional=Ps;function ze(m){return i.IsObject(m)&&(v(m)||b(m)||te(m)||K(m)||x(m)||ne(m)||ge(m)||_e(m)||Be(m)||Fe(m)||Br(m)||N(m)||me(m)||ie(m)||de(m)||xe(m)||Le(m)||tt(m)||Ze(m)||or(m)||ln(m)||dn(m)||kr(m)||Li(m)||Ke(m)||ji(m)||Dr(m)||pn(m)||rt(m)||Fi(m)||Jn(m)||gr(m)&&t.Has(m[e.Kind]))}d.TSchema=ze})(s||(e.TypeGuard=s={}));var a;(function(d){function _(I){return I[e.Kind]==="Intersect"?I.allOf.every(U=>_(U)):I[e.Kind]==="Union"?I.anyOf.some(U=>_(U)):I[e.Kind]==="Undefined"?!0:I[e.Kind]==="Not"?!_(I.not):!1}d.Check=_})(a||(e.ExtendsUndefined=a={}));var c=class extends r{};e.TypeExtendsError=c;var f;(function(d){d[d.Union=0]="Union",d[d.True=1]="True",d[d.False=2]="False"})(f||(e.TypeExtendsResult=f={}));var l;(function(d){function _(p){return p===f.False?p:f.True}function I(p){throw new c(p)}function U(p){return s.TNever(p)||s.TIntersect(p)||s.TUnion(p)||s.TUnknown(p)||s.TAny(p)}function R(p,y){return s.TNever(y)?we(p,y):s.TIntersect(y)?_e(p,y):s.TUnion(y)?Rs(p,y):s.TUnknown(y)?zu(p,y):s.TAny(y)?S(p,y):I("StructuralRight")}function S(p,y){return f.True}function h(p,y){return s.TIntersect(y)?_e(p,y):s.TUnion(y)&&y.anyOf.some(Oe=>s.TAny(Oe)||s.TUnknown(Oe))?f.True:s.TUnion(y)?f.Union:s.TUnknown(y)||s.TAny(y)?f.True:f.Union}function T(p,y){return s.TUnknown(p)?f.False:s.TAny(p)?f.Union:s.TNever(p)?f.True:f.False}function w(p,y){return s.TObject(y)&&kr(y)?f.True:U(y)?R(p,y):s.TArray(y)?_(Ne(p.items,y.items)):f.False}function u(p,y){return U(y)?R(p,y):s.TAsyncIterator(y)?_(Ne(p.items,y.items)):f.False}function A(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TBigInt(y)?f.True:f.False}function v(p,y){return s.TLiteral(p)&&i.IsBoolean(p.const)||s.TBoolean(p)?f.True:f.False}function b(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TBoolean(y)?f.True:f.False}function x(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TConstructor(y)?p.parameters.length>y.parameters.length?f.False:p.parameters.every((Oe,kt)=>_(Ne(y.parameters[kt],Oe))===f.True)?_(Ne(p.returns,y.returns)):f.False:f.False}function K(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TDate(y)?f.True:f.False}function te(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TFunction(y)?p.parameters.length>y.parameters.length?f.False:p.parameters.every((Oe,kt)=>_(Ne(y.parameters[kt],Oe))===f.True)?_(Ne(p.returns,y.returns)):f.False:f.False}function ne(p,y){return s.TLiteral(p)&&i.IsNumber(p.const)||s.TNumber(p)||s.TInteger(p)?f.True:f.False}function ge(p,y){return s.TInteger(y)||s.TNumber(y)?f.True:U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):f.False}function _e(p,y){return y.allOf.every(Oe=>Ne(p,Oe)===f.True)?f.True:f.False}function Be(p,y){return p.allOf.some(Oe=>Ne(Oe,y)===f.True)?f.True:f.False}function Fe(p,y){return U(y)?R(p,y):s.TIterator(y)?_(Ne(p.items,y.items)):f.False}function Br(p,y){return s.TLiteral(y)&&y.const===p.const?f.True:U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TString(y)?Jn(p,y):s.TNumber(y)?N(p,y):s.TInteger(y)?ne(p,y):s.TBoolean(y)?v(p,y):f.False}function we(p,y){return f.False}function gr(p,y){return f.True}function Mr(p){let[y,Oe]=[p,0];for(;s.TNot(y);)y=y.not,Oe+=1;return Oe%2===0?y:e.Type.Unknown()}function O(p,y){return s.TNot(p)?Ne(Mr(p),y):s.TNot(y)?Ne(p,Mr(y)):I("Invalid fallthrough for Not")}function le(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TNull(y)?f.True:f.False}function N(p,y){return s.TLiteralNumber(p)||s.TNumber(p)||s.TInteger(p)?f.True:f.False}function me(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TInteger(y)||s.TNumber(y)?f.True:f.False}function ie(p,y){return Object.getOwnPropertyNames(p.properties).length===y}function de(p){return kr(p)}function xe(p){return ie(p,0)||ie(p,1)&&"description"in p.properties&&s.TUnion(p.properties.description)&&p.properties.description.anyOf.length===2&&(s.TString(p.properties.description.anyOf[0])&&s.TUndefined(p.properties.description.anyOf[1])||s.TString(p.properties.description.anyOf[1])&&s.TUndefined(p.properties.description.anyOf[0]))}function Le(p){return ie(p,0)}function tt(p){return ie(p,0)}function Ze(p){return ie(p,0)}function nt(p){return ie(p,0)}function or(p){return kr(p)}function ln(p){let y=e.Type.Number();return ie(p,0)||ie(p,1)&&"length"in p.properties&&_(Ne(p.properties.length,y))===f.True}function dn(p){return ie(p,0)}function kr(p){let y=e.Type.Number();return ie(p,0)||ie(p,1)&&"length"in p.properties&&_(Ne(p.properties.length,y))===f.True}function Li(p){let y=e.Type.Function([e.Type.Any()],e.Type.Any());return ie(p,0)||ie(p,1)&&"then"in p.properties&&_(Ne(p.properties.then,y))===f.True}function Hn(p,y){return Ne(p,y)===f.False||s.TOptional(p)&&!s.TOptional(y)?f.False:f.True}function Ke(p,y){return s.TUnknown(p)?f.False:s.TAny(p)?f.Union:s.TNever(p)||s.TLiteralString(p)&&de(y)||s.TLiteralNumber(p)&&Le(y)||s.TLiteralBoolean(p)&&tt(y)||s.TSymbol(p)&&xe(y)||s.TBigInt(p)&&Ze(y)||s.TString(p)&&de(y)||s.TSymbol(p)&&xe(y)||s.TNumber(p)&&Le(y)||s.TInteger(p)&&Le(y)||s.TBoolean(p)&&tt(y)||s.TUint8Array(p)&&or(y)||s.TDate(p)&&nt(y)||s.TConstructor(p)&&dn(y)||s.TFunction(p)&&ln(y)?f.True:s.TRecord(p)&&s.TString(Dr(p))?y[e.Hint]==="Record"?f.True:f.False:s.TRecord(p)&&s.TNumber(Dr(p))?ie(y,0)?f.True:f.False:f.False}function ji(p,y){return U(y)?R(p,y):s.TRecord(y)?rt(p,y):s.TObject(y)?(()=>{for(let Oe of Object.getOwnPropertyNames(y.properties)){if(!(Oe in p.properties)&&!s.TOptional(y.properties[Oe]))return f.False;if(s.TOptional(y.properties[Oe]))return f.True;if(Hn(p.properties[Oe],y.properties[Oe])===f.False)return f.False}return f.True})():f.False}function xs(p,y){return U(y)?R(p,y):s.TObject(y)&&Li(y)?f.True:s.TPromise(y)?_(Ne(p.item,y.item)):f.False}function Dr(p){return e.PatternNumberExact in p.patternProperties?e.Type.Number():e.PatternStringExact in p.patternProperties?e.Type.String():I("Unknown record key pattern")}function pn(p){return e.PatternNumberExact in p.patternProperties?p.patternProperties[e.PatternNumberExact]:e.PatternStringExact in p.patternProperties?p.patternProperties[e.PatternStringExact]:I("Unable to get record value schema")}function rt(p,y){let[Oe,kt]=[Dr(y),pn(y)];return s.TLiteralString(p)&&s.TNumber(Oe)&&_(Ne(p,kt))===f.True?f.True:s.TUint8Array(p)&&s.TNumber(Oe)||s.TString(p)&&s.TNumber(Oe)||s.TArray(p)&&s.TNumber(Oe)?Ne(p,kt):s.TObject(p)?(()=>{for(let Ry of Object.getOwnPropertyNames(p.properties))if(Hn(kt,p.properties[Ry])===f.False)return f.False;return f.True})():f.False}function Fi(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?Ne(pn(p),pn(y)):f.False}function Jn(p,y){return s.TLiteral(p)&&i.IsString(p.const)||s.TString(p)?f.True:f.False}function Ns(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TString(y)?f.True:f.False}function Ps(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TSymbol(y)?f.True:f.False}function ze(p,y){return s.TTemplateLiteral(p)?Ne(j.Resolve(p),y):s.TTemplateLiteral(y)?Ne(p,j.Resolve(y)):I("Invalid fallthrough for TemplateLiteral")}function m(p,y){return s.TArray(y)&&p.items!==void 0&&p.items.every(Oe=>Ne(Oe,y.items)===f.True)}function Pe(p,y){return s.TNever(p)?f.True:s.TUnknown(p)?f.False:s.TAny(p)?f.Union:f.False}function _t(p,y){return U(y)?R(p,y):s.TObject(y)&&kr(y)||s.TArray(y)&&m(p,y)?f.True:s.TTuple(y)?i.IsUndefined(p.items)&&!i.IsUndefined(y.items)||!i.IsUndefined(p.items)&&i.IsUndefined(y.items)?f.False:i.IsUndefined(p.items)&&!i.IsUndefined(y.items)||p.items.every((Oe,kt)=>Ne(Oe,y.items[kt])===f.True)?f.True:f.False:f.False}function Oy(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TUint8Array(y)?f.True:f.False}function Iy(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TVoid(y)?xy(p,y):s.TUndefined(y)?f.True:f.False}function Rs(p,y){return y.anyOf.some(Oe=>Ne(p,Oe)===f.True)?f.True:f.False}function Ey(p,y){return p.anyOf.every(Oe=>Ne(Oe,y)===f.True)?f.True:f.False}function zu(p,y){return f.True}function Sy(p,y){return s.TNever(y)?we(p,y):s.TIntersect(y)?_e(p,y):s.TUnion(y)?Rs(p,y):s.TAny(y)?S(p,y):s.TString(y)?Jn(p,y):s.TNumber(y)?N(p,y):s.TInteger(y)?ne(p,y):s.TBoolean(y)?v(p,y):s.TArray(y)?T(p,y):s.TTuple(y)?Pe(p,y):s.TObject(y)?Ke(p,y):s.TUnknown(y)?f.True:f.False}function xy(p,y){return s.TUndefined(p)||s.TUndefined(p)?f.True:f.False}function Ny(p,y){return s.TIntersect(y)?_e(p,y):s.TUnion(y)?Rs(p,y):s.TUnknown(y)?zu(p,y):s.TAny(y)?S(p,y):s.TObject(y)?Ke(p,y):s.TVoid(y)?f.True:f.False}function Ne(p,y){return s.TTemplateLiteral(p)||s.TTemplateLiteral(y)?ze(p,y):s.TNot(p)||s.TNot(y)?O(p,y):s.TAny(p)?h(p,y):s.TArray(p)?w(p,y):s.TBigInt(p)?A(p,y):s.TBoolean(p)?b(p,y):s.TAsyncIterator(p)?u(p,y):s.TConstructor(p)?x(p,y):s.TDate(p)?K(p,y):s.TFunction(p)?te(p,y):s.TInteger(p)?ge(p,y):s.TIntersect(p)?Be(p,y):s.TIterator(p)?Fe(p,y):s.TLiteral(p)?Br(p,y):s.TNever(p)?gr(p,y):s.TNull(p)?le(p,y):s.TNumber(p)?me(p,y):s.TObject(p)?ji(p,y):s.TRecord(p)?Fi(p,y):s.TString(p)?Ns(p,y):s.TSymbol(p)?Ps(p,y):s.TTuple(p)?_t(p,y):s.TPromise(p)?xs(p,y):s.TUint8Array(p)?Oy(p,y):s.TUndefined(p)?Iy(p,y):s.TUnion(p)?Ey(p,y):s.TUnknown(p)?Sy(p,y):s.TVoid(p)?Ny(p,y):I(`Unknown left type operand '${p[e.Kind]}'`)}function Py(p,y){return Ne(p,y)}d.Extends=Py})(l||(e.TypeExtends=l={}));var g;(function(d){function _(w){return w.map(u=>S(u))}function I(w){return new Date(w.getTime())}function U(w){return new Uint8Array(w)}function R(w){let u=Object.getOwnPropertyNames(w).reduce((v,b)=>({...v,[b]:S(w[b])}),{}),A=Object.getOwnPropertySymbols(w).reduce((v,b)=>({...v,[b]:S(w[b])}),{});return{...u,...A}}function S(w){return i.IsArray(w)?_(w):i.IsDate(w)?I(w):i.IsUint8Array(w)?U(w):i.IsObject(w)?R(w):w}function h(w){return w.map(u=>T(u))}d.Rest=h;function T(w,u={}){return{...S(w),...u}}d.Type=T})(g||(e.TypeClone=g={}));var P;(function(d){function _(x){return x.map(K=>{let{[e.Optional]:te,...ne}=g.Type(K);return ne})}function I(x){return x.every(K=>s.TOptional(K))}function U(x){return x.some(K=>s.TOptional(K))}function R(x){return I(x.allOf)?e.Type.Optional(e.Type.Intersect(_(x.allOf))):x}function S(x){return U(x.anyOf)?e.Type.Optional(e.Type.Union(_(x.anyOf))):x}function h(x){return x[e.Kind]==="Intersect"?R(x):x[e.Kind]==="Union"?S(x):x}function T(x,K){let te=x.allOf.reduce((ne,ge)=>{let _e=v(ge,K);return _e[e.Kind]==="Never"?ne:[...ne,_e]},[]);return h(e.Type.Intersect(te))}function w(x,K){let te=x.anyOf.map(ne=>v(ne,K));return h(e.Type.Union(te))}function u(x,K){let te=x.properties[K];return i.IsUndefined(te)?e.Type.Never():e.Type.Union([te])}function A(x,K){let te=x.items;if(i.IsUndefined(te))return e.Type.Never();let ne=te[K];return i.IsUndefined(ne)?e.Type.Never():ne}function v(x,K){return x[e.Kind]==="Intersect"?T(x,K):x[e.Kind]==="Union"?w(x,K):x[e.Kind]==="Object"?u(x,K):x[e.Kind]==="Tuple"?A(x,K):e.Type.Never()}function b(x,K,te={}){let ne=K.map(ge=>v(x,ge.toString()));return h(e.Type.Union(ne,te))}d.Resolve=b})(P||(e.IndexedAccessor=P={}));var E;(function(d){function _(A){let[v,b]=[A.slice(0,1),A.slice(1)];return`${v.toLowerCase()}${b}`}function I(A){let[v,b]=[A.slice(0,1),A.slice(1)];return`${v.toUpperCase()}${b}`}function U(A){return A.toUpperCase()}function R(A){return A.toLowerCase()}function S(A,v){let b=W.ParseExact(A.pattern);if(!$.Check(b))return{...A,pattern:h(A.pattern,v)};let te=[...D.Generate(b)].map(_e=>e.Type.Literal(_e)),ne=T(te,v),ge=e.Type.Union(ne);return e.Type.TemplateLiteral([ge])}function h(A,v){return typeof A=="string"?v==="Uncapitalize"?_(A):v==="Capitalize"?I(A):v==="Uppercase"?U(A):v==="Lowercase"?R(A):A:A.toString()}function T(A,v){if(A.length===0)return[];let[b,...x]=A;return[u(b,v),...T(x,v)]}function w(A,v){return s.TTemplateLiteral(A)?S(A,v):s.TUnion(A)?e.Type.Union(T(A.anyOf,v)):s.TLiteral(A)?e.Type.Literal(h(A.const,v)):A}function u(A,v){return w(A,v)}d.Map=u})(E||(e.Intrinsic=E={}));var M;(function(d){function _(h,T){return e.Type.Intersect(h.allOf.map(w=>R(w,T)),{...h})}function I(h,T){return e.Type.Union(h.anyOf.map(w=>R(w,T)),{...h})}function U(h,T){return T(h)}function R(h,T){return h[e.Kind]==="Intersect"?_(h,T):h[e.Kind]==="Union"?I(h,T):h[e.Kind]==="Object"?U(h,T):h}function S(h,T,w){return{...R(g.Type(h),T),...w}}d.Map=S})(M||(e.ObjectMap=M={}));var z;(function(d){function _(u){return u[0]==="^"&&u[u.length-1]==="$"?u.slice(1,u.length-1):u}function I(u,A){return u.allOf.reduce((v,b)=>[...v,...h(b,A)],[])}function U(u,A){let v=u.anyOf.map(b=>h(b,A));return[...v.reduce((b,x)=>x.map(K=>v.every(te=>te.includes(K))?b.add(K):b)[0],new Set)]}function R(u,A){return Object.getOwnPropertyNames(u.properties)}function S(u,A){return A.includePatterns?Object.getOwnPropertyNames(u.patternProperties):[]}function h(u,A){return s.TIntersect(u)?I(u,A):s.TUnion(u)?U(u,A):s.TObject(u)?R(u,A):s.TRecord(u)?S(u,A):[]}function T(u,A){return[...new Set(h(u,A))]}d.ResolveKeys=T;function w(u){return`^(${T(u,{includePatterns:!0}).map(b=>`(${_(b)})`).join("|")})$`}d.ResolvePattern=w})(z||(e.KeyResolver=z={}));var Q=class extends r{};e.KeyArrayResolverError=Q;var F;(function(d){function _(I){return Array.isArray(I)?I:s.TUnionLiteral(I)?I.anyOf.map(U=>U.const.toString()):s.TLiteral(I)?[I.const]:s.TTemplateLiteral(I)?(()=>{let U=W.ParseExact(I.pattern);if(!$.Check(U))throw new Q("Cannot resolve keys from infinite template expression");return[...D.Generate(U)]})():[]}d.Resolve=_})(F||(e.KeyArrayResolver=F={}));var L;(function(d){function*_(U){for(let R of U.anyOf)R[e.Kind]==="Union"?yield*_(R):yield R}function I(U){return e.Type.Union([..._(U)],{...U})}d.Resolve=I})(L||(e.UnionResolver=L={}));var G=class extends r{};e.TemplateLiteralPatternError=G;var H;(function(d){function _(S){throw new G(S)}function I(S){return S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U(S,h){return s.TTemplateLiteral(S)?S.pattern.slice(1,S.pattern.length-1):s.TUnion(S)?`(${S.anyOf.map(T=>U(T,h)).join("|")})`:s.TNumber(S)?`${h}${e.PatternNumber}`:s.TInteger(S)?`${h}${e.PatternNumber}`:s.TBigInt(S)?`${h}${e.PatternNumber}`:s.TString(S)?`${h}${e.PatternString}`:s.TLiteral(S)?`${h}${I(S.const.toString())}`:s.TBoolean(S)?`${h}${e.PatternBoolean}`:_(`Unexpected Kind '${S[e.Kind]}'`)}function R(S){return`^${S.map(h=>U(h,"")).join("")}$`}d.Create=R})(H||(e.TemplateLiteralPattern=H={}));var j;(function(d){function _(I){let U=W.ParseExact(I.pattern);if(!$.Check(U))return e.Type.String();let R=[...D.Generate(U)].map(S=>e.Type.Literal(S));return e.Type.Union(R)}d.Resolve=_})(j||(e.TemplateLiteralResolver=j={}));var re=class extends r{};e.TemplateLiteralParserError=re;var W;(function(d){function _(x,K,te){return x[K]===te&&x.charCodeAt(K-1)!==92}function I(x,K){return _(x,K,"(")}function U(x,K){return _(x,K,")")}function R(x,K){return _(x,K,"|")}function S(x){if(!(I(x,0)&&U(x,x.length-1)))return!1;let K=0;for(let te=0;te<x.length;te++)if(I(x,te)&&(K+=1),U(x,te)&&(K-=1),K===0&&te!==x.length-1)return!1;return!0}function h(x){return x.slice(1,x.length-1)}function T(x){let K=0;for(let te=0;te<x.length;te++)if(I(x,te)&&(K+=1),U(x,te)&&(K-=1),R(x,te)&&K===0)return!0;return!1}function w(x){for(let K=0;K<x.length;K++)if(I(x,K))return!0;return!1}function u(x){let[K,te]=[0,0],ne=[];for(let _e=0;_e<x.length;_e++)if(I(x,_e)&&(K+=1),U(x,_e)&&(K-=1),R(x,_e)&&K===0){let Be=x.slice(te,_e);Be.length>0&&ne.push(v(Be)),te=_e+1}let ge=x.slice(te);return ge.length>0&&ne.push(v(ge)),ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"or",expr:ne}}function A(x){function K(ge,_e){if(!I(ge,_e))throw new re("TemplateLiteralParser: Index must point to open parens");let Be=0;for(let Fe=_e;Fe<ge.length;Fe++)if(I(ge,Fe)&&(Be+=1),U(ge,Fe)&&(Be-=1),Be===0)return[_e,Fe];throw new re("TemplateLiteralParser: Unclosed group parens in expression")}function te(ge,_e){for(let Be=_e;Be<ge.length;Be++)if(I(ge,Be))return[_e,Be];return[_e,ge.length]}let ne=[];for(let ge=0;ge<x.length;ge++)if(I(x,ge)){let[_e,Be]=K(x,ge),Fe=x.slice(_e,Be+1);ne.push(v(Fe)),ge=Be}else{let[_e,Be]=te(x,ge),Fe=x.slice(_e,Be);Fe.length>0&&ne.push(v(Fe)),ge=Be-1}return ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"and",expr:ne}}function v(x){return S(x)?v(h(x)):T(x)?u(x):w(x)?A(x):{type:"const",const:x}}d.Parse=v;function b(x){return v(x.slice(1,x.length-1))}d.ParseExact=b})(W||(e.TemplateLiteralParser=W={}));var pe=class extends r{};e.TemplateLiteralFiniteError=pe;var $;(function(d){function _(h){throw new pe(h)}function I(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="0"&&h.expr[1].type==="const"&&h.expr[1].const==="[1-9][0-9]*"}function U(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="true"&&h.expr[1].type==="const"&&h.expr[1].const==="false"}function R(h){return h.type==="const"&&h.const===".*"}function S(h){return U(h)?!0:I(h)||R(h)?!1:h.type==="and"?h.expr.every(T=>S(T)):h.type==="or"?h.expr.every(T=>S(T)):h.type==="const"?!0:_("Unknown expression type")}d.Check=S})($||(e.TemplateLiteralFinite=$={}));var B=class extends r{};e.TemplateLiteralGeneratorError=B;var D;(function(d){function*_(h){if(h.length===1)return yield*h[0];for(let T of h[0])for(let w of _(h.slice(1)))yield`${T}${w}`}function*I(h){return yield*_(h.expr.map(T=>[...S(T)]))}function*U(h){for(let T of h.expr)yield*S(T)}function*R(h){return yield h.const}function*S(h){return h.type==="and"?yield*I(h):h.type==="or"?yield*U(h):h.type==="const"?yield*R(h):(()=>{throw new B("Unknown expression")})()}d.Generate=S})(D||(e.TemplateLiteralGenerator=D={}));var Z;(function(d){function*_(S){let h=S.trim().replace(/"|'/g,"");return h==="boolean"?yield e.Type.Boolean():h==="number"?yield e.Type.Number():h==="bigint"?yield e.Type.BigInt():h==="string"?yield e.Type.String():yield(()=>{let T=h.split("|").map(w=>e.Type.Literal(w.trim()));return T.length===0?e.Type.Never():T.length===1?T[0]:e.Type.Union(T)})()}function*I(S){if(S[1]!=="{"){let h=e.Type.Literal("$"),T=U(S.slice(1));return yield*[h,...T]}for(let h=2;h<S.length;h++)if(S[h]==="}"){let T=_(S.slice(2,h)),w=U(S.slice(h+1));return yield*[...T,...w]}yield e.Type.Literal(S)}function*U(S){for(let h=0;h<S.length;h++)if(S[h]==="$"){let T=e.Type.Literal(S.slice(0,h)),w=I(S.slice(h));return yield*[T,...w]}yield e.Type.Literal(S)}function R(S){return[...U(S)]}d.Parse=R})(Z||(e.TemplateLiteralDslParser=Z={}));var se=class{constructor(d){this.schema=d}Decode(d){return new Y(this.schema,d)}};e.TransformDecodeBuilder=se;var Y=class{constructor(d,_){this.schema=d,this.decode=_}Encode(d){let _=g.Type(this.schema);return s.TTransform(_)?(()=>{let R={Encode:S=>_[e.Transform].Encode(d(S)),Decode:S=>this.decode(_[e.Transform].Decode(S))};return{..._,[e.Transform]:R}})():(()=>{let I={Decode:this.decode,Encode:d};return{..._,[e.Transform]:I}})()}};e.TransformEncodeBuilder=Y;var ue=0,k=class extends r{};e.TypeBuilderError=k;var q=class{Create(d){return d}Throw(d){throw new k(d)}Discard(d,_){return _.reduce((I,U)=>{let{[U]:R,...S}=I;return S},d)}Strict(d){return JSON.parse(JSON.stringify(d))}};e.TypeBuilder=q;var X=class extends q{ReadonlyOptional(d){return this.Readonly(this.Optional(d))}Readonly(d){return{...g.Type(d),[e.Readonly]:"Readonly"}}Optional(d){return{...g.Type(d),[e.Optional]:"Optional"}}Any(d={}){return this.Create({...d,[e.Kind]:"Any"})}Array(d,_={}){return this.Create({..._,[e.Kind]:"Array",type:"array",items:g.Type(d)})}Boolean(d={}){return this.Create({...d,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(d,_={}){return{...E.Map(g.Type(d),"Capitalize"),..._}}Composite(d,_){let I=e.Type.Intersect(d,{}),R=z.ResolveKeys(I,{includePatterns:!1}).reduce((S,h)=>({...S,[h]:e.Type.Index(I,[h])}),{});return e.Type.Object(R,_)}Enum(d,_={}){if(i.IsUndefined(d))return this.Throw("Enum undefined or empty");let I=Object.getOwnPropertyNames(d).filter(S=>isNaN(S)).map(S=>d[S]),R=[...new Set(I)].map(S=>e.Type.Literal(S));return this.Union(R,{..._,[e.Hint]:"Enum"})}Extends(d,_,I,U,R={}){switch(l.Extends(d,_)){case f.Union:return this.Union([g.Type(I,R),g.Type(U,R)]);case f.True:return g.Type(I,R);case f.False:return g.Type(U,R)}}Exclude(d,_,I={}){return s.TTemplateLiteral(d)?this.Exclude(j.Resolve(d),_,I):s.TTemplateLiteral(_)?this.Exclude(d,j.Resolve(_),I):s.TUnion(d)?(()=>{let U=d.anyOf.filter(R=>l.Extends(R,_)===f.False);return U.length===1?g.Type(U[0],I):this.Union(U,I)})():l.Extends(d,_)!==f.False?this.Never(I):g.Type(d,I)}Extract(d,_,I={}){return s.TTemplateLiteral(d)?this.Extract(j.Resolve(d),_,I):s.TTemplateLiteral(_)?this.Extract(d,j.Resolve(_),I):s.TUnion(d)?(()=>{let U=d.anyOf.filter(R=>l.Extends(R,_)!==f.False);return U.length===1?g.Type(U[0],I):this.Union(U,I)})():l.Extends(d,_)!==f.False?g.Type(d,I):this.Never(I)}Index(d,_,I={}){return s.TArray(d)&&s.TNumber(_)?g.Type(d.items,I):s.TTuple(d)&&s.TNumber(_)?(()=>{let R=(i.IsUndefined(d.items)?[]:d.items).map(S=>g.Type(S));return this.Union(R,I)})():(()=>{let U=F.Resolve(_),R=g.Type(d);return P.Resolve(R,U,I)})()}Integer(d={}){return this.Create({...d,[e.Kind]:"Integer",type:"integer"})}Intersect(d,_={}){if(d.length===0)return e.Type.Never();if(d.length===1)return g.Type(d[0],_);d.some(S=>s.TTransform(S))&&this.Throw("Cannot intersect transform types");let I=d.every(S=>s.TObject(S)),U=g.Rest(d),R=s.TSchema(_.unevaluatedProperties)?{unevaluatedProperties:g.Type(_.unevaluatedProperties)}:{};return _.unevaluatedProperties===!1||s.TSchema(_.unevaluatedProperties)||I?this.Create({..._,...R,[e.Kind]:"Intersect",type:"object",allOf:U}):this.Create({..._,...R,[e.Kind]:"Intersect",allOf:U})}KeyOf(d,_={}){return s.TRecord(d)?(()=>{let I=Object.getOwnPropertyNames(d.patternProperties)[0];return I===e.PatternNumberExact?this.Number(_):I===e.PatternStringExact?this.String(_):this.Throw("Unable to resolve key type from Record key pattern")})():s.TTuple(d)?(()=>{let U=(i.IsUndefined(d.items)?[]:d.items).map((R,S)=>e.Type.Literal(S.toString()));return this.Union(U,_)})():s.TArray(d)?this.Number(_):(()=>{let I=z.ResolveKeys(d,{includePatterns:!1});if(I.length===0)return this.Never(_);let U=I.map(R=>this.Literal(R));return this.Union(U,_)})()}Literal(d,_={}){return this.Create({..._,[e.Kind]:"Literal",const:d,type:typeof d})}Lowercase(d,_={}){return{...E.Map(g.Type(d),"Lowercase"),..._}}Never(d={}){return this.Create({...d,[e.Kind]:"Never",not:{}})}Not(d,_){return this.Create({..._,[e.Kind]:"Not",not:g.Type(d)})}Null(d={}){return this.Create({...d,[e.Kind]:"Null",type:"null"})}Number(d={}){return this.Create({...d,[e.Kind]:"Number",type:"number"})}Object(d,_={}){let I=Object.getOwnPropertyNames(d),U=I.filter(T=>s.TOptional(d[T])),R=I.filter(T=>!U.includes(T)),S=s.TSchema(_.additionalProperties)?{additionalProperties:g.Type(_.additionalProperties)}:{},h=I.reduce((T,w)=>({...T,[w]:g.Type(d[w])}),{});return R.length>0?this.Create({..._,...S,[e.Kind]:"Object",type:"object",properties:h,required:R}):this.Create({..._,...S,[e.Kind]:"Object",type:"object",properties:h})}Omit(d,_,I={}){let U=F.Resolve(_);return M.Map(this.Discard(g.Type(d),["$id",e.Transform]),R=>{i.IsArray(R.required)&&(R.required=R.required.filter(S=>!U.includes(S)),R.required.length===0&&delete R.required);for(let S of Object.getOwnPropertyNames(R.properties))U.includes(S)&&delete R.properties[S];return this.Create(R)},I)}Partial(d,_={}){return M.Map(this.Discard(g.Type(d),["$id",e.Transform]),I=>{let U=Object.getOwnPropertyNames(I.properties).reduce((R,S)=>({...R,[S]:this.Optional(I.properties[S])}),{});return this.Object(U,this.Discard(I,["required"]))},_)}Pick(d,_,I={}){let U=F.Resolve(_);return M.Map(this.Discard(g.Type(d),["$id",e.Transform]),R=>{i.IsArray(R.required)&&(R.required=R.required.filter(S=>U.includes(S)),R.required.length===0&&delete R.required);for(let S of Object.getOwnPropertyNames(R.properties))U.includes(S)||delete R.properties[S];return this.Create(R)},I)}Record(d,_,I={}){return s.TTemplateLiteral(d)?(()=>{let U=W.ParseExact(d.pattern);return $.Check(U)?this.Object([...D.Generate(U)].reduce((R,S)=>({...R,[S]:g.Type(_)}),{}),I):this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[d.pattern]:g.Type(_)}})})():s.TUnion(d)?(()=>{let U=L.Resolve(d);if(s.TUnionLiteral(U)){let R=U.anyOf.reduce((S,h)=>({...S,[h.const]:g.Type(_)}),{});return this.Object(R,{...I,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():s.TLiteral(d)?i.IsString(d.const)||i.IsNumber(d.const)?this.Object({[d.const]:g.Type(_)},I):this.Throw("Record key of type literal is not of type string or number"):s.TInteger(d)||s.TNumber(d)?this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:g.Type(_)}}):s.TString(d)?(()=>{let U=i.IsUndefined(d.pattern)?e.PatternStringExact:d.pattern;return this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[U]:g.Type(_)}})})():this.Never()}Recursive(d,_={}){i.IsUndefined(_.$id)&&(_.$id=`T${ue++}`);let I=d({[e.Kind]:"This",$ref:`${_.$id}`});return I.$id=_.$id,this.Create({..._,[e.Hint]:"Recursive",...I})}Ref(d,_={}){return i.IsString(d)?this.Create({..._,[e.Kind]:"Ref",$ref:d}):(i.IsUndefined(d.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({..._,[e.Kind]:"Ref",$ref:d.$id}))}Required(d,_={}){return M.Map(this.Discard(g.Type(d),["$id",e.Transform]),I=>{let U=Object.getOwnPropertyNames(I.properties).reduce((R,S)=>({...R,[S]:this.Discard(I.properties[S],[e.Optional])}),{});return this.Object(U,I)},_)}Rest(d){return s.TTuple(d)&&!i.IsUndefined(d.items)?g.Rest(d.items):s.TIntersect(d)?g.Rest(d.allOf):s.TUnion(d)?g.Rest(d.anyOf):[]}String(d={}){return this.Create({...d,[e.Kind]:"String",type:"string"})}TemplateLiteral(d,_={}){let I=i.IsString(d)?H.Create(Z.Parse(d)):H.Create(d);return this.Create({..._,[e.Kind]:"TemplateLiteral",type:"string",pattern:I})}Transform(d){return new se(d)}Tuple(d,_={}){let[I,U,R]=[!1,d.length,d.length],S=g.Rest(d),h=d.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:S,additionalItems:I,minItems:U,maxItems:R}:{..._,[e.Kind]:"Tuple",type:"array",minItems:U,maxItems:R};return this.Create(h)}Uncapitalize(d,_={}){return{...E.Map(g.Type(d),"Uncapitalize"),..._}}Union(d,_={}){return s.TTemplateLiteral(d)?j.Resolve(d):(()=>{let I=d;if(I.length===0)return this.Never(_);if(I.length===1)return this.Create(g.Type(I[0],_));let U=g.Rest(I);return this.Create({..._,[e.Kind]:"Union",anyOf:U})})()}Unknown(d={}){return this.Create({...d,[e.Kind]:"Unknown"})}Unsafe(d={}){return this.Create({...d,[e.Kind]:d[e.Kind]||"Unsafe"})}Uppercase(d,_={}){return{...E.Map(g.Type(d),"Uppercase"),..._}}};e.JsonTypeBuilder=X;var ye=class extends X{AsyncIterator(d,_={}){return this.Create({..._,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:g.Type(d)})}Awaited(d,_={}){let I=U=>U.length>0?(()=>{let[R,...S]=U;return[this.Awaited(R),...I(S)]})():U;return s.TIntersect(d)?e.Type.Intersect(I(d.allOf)):s.TUnion(d)?e.Type.Union(I(d.anyOf)):s.TPromise(d)?this.Awaited(d.item):g.Type(d,_)}BigInt(d={}){return this.Create({...d,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(d,_={}){return this.Tuple([...d.parameters],{..._})}Constructor(d,_,I){let[U,R]=[g.Rest(d),g.Type(_)];return this.Create({...I,[e.Kind]:"Constructor",type:"Constructor",parameters:U,returns:R})}Date(d={}){return this.Create({...d,[e.Kind]:"Date",type:"Date"})}Function(d,_,I){let[U,R]=[g.Rest(d),g.Type(_)];return this.Create({...I,[e.Kind]:"Function",type:"Function",parameters:U,returns:R})}InstanceType(d,_={}){return g.Type(d.returns,_)}Iterator(d,_={}){return this.Create({..._,[e.Kind]:"Iterator",type:"Iterator",items:g.Type(d)})}Parameters(d,_={}){return this.Tuple(d.parameters,{..._})}Promise(d,_={}){return this.Create({..._,[e.Kind]:"Promise",type:"Promise",item:g.Type(d)})}RegExp(d,_={}){let I=i.IsString(d)?d:d.source;return this.Create({..._,[e.Kind]:"String",type:"string",pattern:I})}RegEx(d,_={}){return this.RegExp(d,_)}ReturnType(d,_={}){return g.Type(d.returns,_)}Symbol(d){return this.Create({...d,[e.Kind]:"Symbol",type:"symbol"})}Undefined(d={}){return this.Create({...d,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(d={}){return this.Create({...d,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(d={}){return this.Create({...d,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=ye,e.JsonType=new X,e.Type=new ye}}),Rn=Ut(dr(),1),{String:jm,Optional:Fm,Boolean:Vm,Object:Km,Number:zm}=Rn.Type,qm=jm.bind(Rn.Type),Gm=zm.bind(Rn.Type),DN=Km.bind(Rn.Type),LN=Fm.bind(Rn.Type),Wm=Vm.bind(Rn.Type),jN=qm(),FN=Gm(),VN=Wm();function vl(e){return Array.isArray(e)?e:[e]}var Hm=De({"../../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},r=typeof window<"u"&&typeof window.document<"u",n=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(typeof self>"u"?"undefined":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",o=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),s=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=r,e.isWebWorker=i,e.isNode=n,e.isJsDom=o,e.isDeno=s}}),Jm=De({"../../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(e,t){"use strict";t.exports=function(r,n){n||(n={}),typeof n=="function"&&(n={cmp:n});var i=typeof n.cycles=="boolean"?n.cycles:!1,o=n.cmp&&function(a){return function(c){return function(f,l){var g={key:f,value:c[f]},P={key:l,value:c[l]};return a(g,P)}}}(n.cmp),s=[];return function a(c){if(c&&c.toJSON&&typeof c.toJSON=="function"&&(c=c.toJSON()),c!==void 0){if(typeof c=="number")return isFinite(c)?""+c:"null";if(typeof c!="object")return JSON.stringify(c);var f,l;if(Array.isArray(c)){for(l="[",f=0;f<c.length;f++)f&&(l+=","),l+=a(c[f])||"null";return l+"]"}if(c===null)return"null";if(s.indexOf(c)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=s.push(c)-1,P=Object.keys(c).sort(o&&o(c));for(l="",f=0;f<P.length;f++){var E=P[f],M=a(c[E]);M&&(l&&(l+=","),l+=JSON.stringify(E)+":"+M)}return s.splice(g,1),"{"+l+"}"}}(r)}}}),Xm=De({"../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:r}=Object.prototype,n=F();n.configure=F,n.stringify=n,n.default=n,e.stringify=n,e.configure=F,t.exports=n;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function o(L){return L.length<5e3&&!i.test(L)?`"${L}"`:JSON.stringify(L)}function s(L,G){if(L.length>200||G)return L.sort(G);for(let H=1;H<L.length;H++){let j=L[H],re=H;for(;re!==0&&L[re-1]>j;)L[re]=L[re-1],re--;L[re]=j}return L}var a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(L){return a.call(L)!==void 0&&L.length!==0}function f(L,G,H){L.length<H&&(H=L.length);let j=G===","?"":" ",re=`"0":${j}${L[0]}`;for(let W=1;W<H;W++)re+=`${G}"${W}":${j}${L[W]}`;return re}function l(L){if(r.call(L,"circularValue")){let G=L.circularValue;if(typeof G=="string")return`"${G}"`;if(G==null)return G;if(G===Error||G===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function g(L){let G;if(r.call(L,"deterministic")&&(G=L.deterministic,typeof G!="boolean"&&typeof G!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return G===void 0?!0:G}function P(L,G){let H;if(r.call(L,G)&&(H=L[G],typeof H!="boolean"))throw new TypeError(`The "${G}" argument must be of type boolean`);return H===void 0?!0:H}function E(L,G){let H;if(r.call(L,G)){if(H=L[G],typeof H!="number")throw new TypeError(`The "${G}" argument must be of type number`);if(!Number.isInteger(H))throw new TypeError(`The "${G}" argument must be an integer`);if(H<1)throw new RangeError(`The "${G}" argument must be >= 1`)}return H===void 0?1/0:H}function M(L){return L===1?"1 item":`${L} items`}function z(L){let G=new Set;for(let H of L)(typeof H=="string"||typeof H=="number")&&G.add(String(H));return G}function Q(L){if(r.call(L,"strict")){let G=L.strict;if(typeof G!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(G)return H=>{let j=`Object can not safely be stringified. Received type ${typeof H}`;throw typeof H!="function"&&(j+=` (${H.toString()})`),new Error(j)}}}function F(L){L={...L};let G=Q(L);G&&(L.bigint===void 0&&(L.bigint=!1),"circularValue"in L||(L.circularValue=Error));let H=l(L),j=P(L,"bigint"),re=g(L),W=typeof re=="function"?re:void 0,pe=E(L,"maximumDepth"),$=E(L,"maximumBreadth");function B(ue,k,q,X,ye,d){let _=k[ue];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(ue)),_=X.call(k,ue,_),typeof _){case"string":return o(_);case"object":{if(_===null)return"null";if(q.indexOf(_)!==-1)return H;let I="",U=",",R=d;if(Array.isArray(_)){if(_.length===0)return"[]";if(pe<q.length+1)return'"[Array]"';q.push(_),ye!==""&&(d+=ye,I+=`
30
+ Use 'override' annotation for methods overridden by subclass.`)}}var xm=hl(0),Nm=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Qs=0,yl=function(){};function Pm(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Pm(yl,Array.prototype);var ba=function(e){function t(n,i,o,s){var a;return o===void 0&&(o="ObservableArray@"+Ct()),s===void 0&&(s=!1),a=e.call(this)||this,Jr(function(){var c=new ma(o,i,s,!0);c.proxy_=a,Nf(a,be,c),n&&n.length&&a.spliceWithArray(0,0,n),Nm&&Object.defineProperty(a,"0",xm)}),a}Cf(t,e);var r=t.prototype;return r.concat=function(){this[be].atom_.reportObserved();for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),o.map(function(a){return Pn(a)?a.slice():a}))},r[Symbol.iterator]=function(){var n=this,i=0;return wa({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},Sn(t,[{key:"length",get:function(){return this[be].getArrayLength_()},set:function(i){this[be].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(yl);Object.entries(wo).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Eo(ba.prototype,t,r)});function hl(e){return{enumerable:!1,configurable:!0,get:function(){return this[be].get_(e)},set:function(r){this[be].set_(e,r)}}}function Rm(e){Yt(ba.prototype,""+e,hl(e))}function gl(e){if(e>Qs){for(var t=Qs;t<e+100;t++)Rm(t);Qs=e}}gl(1e3);function Cm(e,t,r){return new ba(e,t,r)}function Rt(e,t){if(typeof e=="object"&&e!==null){if(Pn(e))return t!==void 0&&fe(23),e[be].atom_;if(jt(e))return e.atom_;if(Zt(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||fe(25,t,Ao(e)),r}if(Gr(e)){if(!t)return fe(26);var n=e[be].values_.get(t);return n||fe(27,t,Ao(e)),n}if(da(e)||pi(e)||_o(e))return e}else if(je(e)&&_o(e[be]))return e[be];fe(28)}function va(e,t){if(e||fe(29),t!==void 0)return va(Rt(e,t));if(da(e)||pi(e)||_o(e)||Zt(e)||jt(e))return e;if(e[be])return e[be];fe(24,e)}function Ao(e,t){var r;if(t!==void 0)r=Rt(e,t);else{if(Ar(e))return e.name;Gr(e)||Zt(e)||jt(e)?r=va(e):r=Rt(e)}return r.name_}function Jr(e){var t=Wr(),r=Ro(!0);Et();try{return e()}finally{St(),Co(r),cr(t)}}var Af=ci.toString;function _a(e,t,r){return r===void 0&&(r=-1),ca(e,t,r)}function ca(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var o=typeof e;if(o!=="function"&&o!=="object"&&typeof t!="object")return!1;var s=Af.call(e);if(s!==Af.call(t))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=Of(e),t=Of(t);var a=s==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var c=e.constructor,f=t.constructor;if(c!==f&&!(je(c)&&c instanceof c&&je(f)&&f instanceof f)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var l=n.length;l--;)if(n[l]===e)return i[l]===t;if(n.push(e),i.push(t),a){if(l=e.length,l!==t.length)return!1;for(;l--;)if(!ca(e[l],t[l],r-1,n,i))return!1}else{var g=Object.keys(e),P=g.length;if(Object.keys(t).length!==P)return!1;for(var E=0;E<P;E++){var M=g[E];if(!(xt(t,M)&&ca(e[M],t[M],r-1,n,i)))return!1}}return n.pop(),i.pop(),!0}function Of(e){return Pn(e)?e.slice():En(e)||Zt(e)||ar(e)||jt(e)?Array.from(e.entries()):e}var If,$m=((If=Oo().Iterator)==null?void 0:If.prototype)||{};function wa(e){return e[Symbol.iterator]=Um,Object.assign(Object.create($m),e)}function Um(){return this}function ml(e){return e instanceof Object&&typeof e.annotationType_=="string"&&je(e.make_)&&je(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Oo();typeof t[e]>"u"&&fe("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:em,extras:{getDebugName:Ao},$mobx:be});var Bm=Object.create,Ta=Object.defineProperty,Mm=Object.getOwnPropertyDescriptor,bl=Object.getOwnPropertyNames,km=Object.getPrototypeOf,Dm=Object.prototype.hasOwnProperty,De=(e,t)=>function(){return t||(0,e[bl(e)[0]])((t={exports:{}}).exports,t),t.exports},Aa=(e,t)=>{for(var r in t)Ta(e,r,{get:t[r],enumerable:!0})},Lm=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bl(t))!Dm.call(e,i)&&i!==r&&Ta(e,i,{get:()=>t[i],enumerable:!(n=Mm(t,i))||n.enumerable});return e},Ut=(e,t,r)=>(r=e!=null?Bm(km(e)):{},Lm(t||!e||!e.__esModule?Ta(r,"default",{value:e,enumerable:!0}):r,e));var dr=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/typebox.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`;var t;(function(d){let _=new Map;function I(){return new Map(_)}d.Entries=I;function U(){return _.clear()}d.Clear=U;function R(w){return _.delete(w)}d.Delete=R;function S(w){return _.has(w)}d.Has=S;function h(w,u){_.set(w,u)}d.Set=h;function T(w){return _.get(w)}d.Get=T})(t||(e.TypeRegistry=t={}));var r=class extends Error{constructor(d){super(d)}};e.TypeBoxError=r;var n;(function(d){let _=new Map;function I(){return new Map(_)}d.Entries=I;function U(){return _.clear()}d.Clear=U;function R(w){return _.delete(w)}d.Delete=R;function S(w){return _.has(w)}d.Has=S;function h(w,u){_.set(w,u)}d.Set=h;function T(w){return _.get(w)}d.Get=T})(n||(e.FormatRegistry=n={}));var i;(function(d){function _(v){return Array.isArray(v)}d.IsArray=_;function I(v){return typeof v=="bigint"}d.IsBigInt=I;function U(v){return typeof v=="boolean"}d.IsBoolean=U;function R(v){return v instanceof globalThis.Date}d.IsDate=R;function S(v){return v===null}d.IsNull=S;function h(v){return typeof v=="number"}d.IsNumber=h;function T(v){return typeof v=="object"&&v!==null}d.IsObject=T;function w(v){return typeof v=="string"}d.IsString=w;function u(v){return v instanceof globalThis.Uint8Array}d.IsUint8Array=u;function A(v){return v===void 0}d.IsUndefined=A})(i||(e.ValueGuard=i={}));var o=class extends r{};e.TypeGuardUnknownTypeError=o;var s;(function(d){function _(m){try{return new RegExp(m),!0}catch{return!1}}function I(m){if(!i.IsString(m))return!1;for(let Pe=0;Pe<m.length;Pe++){let _t=m.charCodeAt(Pe);if(_t>=7&&_t<=13||_t===27||_t===127)return!1}return!0}function U(m){return h(m)||ze(m)}function R(m){return i.IsUndefined(m)||i.IsBigInt(m)}function S(m){return i.IsUndefined(m)||i.IsNumber(m)}function h(m){return i.IsUndefined(m)||i.IsBoolean(m)}function T(m){return i.IsUndefined(m)||i.IsString(m)}function w(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)&&_(m)}function u(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)}function A(m){return i.IsUndefined(m)||ze(m)}function v(m){return we(m,"Any")&&T(m.$id)}d.TAny=v;function b(m){return we(m,"Array")&&m.type==="array"&&T(m.$id)&&ze(m.items)&&S(m.minItems)&&S(m.maxItems)&&h(m.uniqueItems)&&A(m.contains)&&S(m.minContains)&&S(m.maxContains)}d.TArray=b;function x(m){return we(m,"AsyncIterator")&&m.type==="AsyncIterator"&&T(m.$id)&&ze(m.items)}d.TAsyncIterator=x;function K(m){return we(m,"BigInt")&&m.type==="bigint"&&T(m.$id)&&R(m.exclusiveMaximum)&&R(m.exclusiveMinimum)&&R(m.maximum)&&R(m.minimum)&&R(m.multipleOf)}d.TBigInt=K;function te(m){return we(m,"Boolean")&&m.type==="boolean"&&T(m.$id)}d.TBoolean=te;function ne(m){return we(m,"Constructor")&&m.type==="Constructor"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Pe=>ze(Pe))&&ze(m.returns)}d.TConstructor=ne;function ge(m){return we(m,"Date")&&m.type==="Date"&&T(m.$id)&&S(m.exclusiveMaximumTimestamp)&&S(m.exclusiveMinimumTimestamp)&&S(m.maximumTimestamp)&&S(m.minimumTimestamp)&&S(m.multipleOfTimestamp)}d.TDate=ge;function _e(m){return we(m,"Function")&&m.type==="Function"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Pe=>ze(Pe))&&ze(m.returns)}d.TFunction=_e;function Be(m){return we(m,"Integer")&&m.type==="integer"&&T(m.$id)&&S(m.exclusiveMaximum)&&S(m.exclusiveMinimum)&&S(m.maximum)&&S(m.minimum)&&S(m.multipleOf)}d.TInteger=Be;function Fe(m){return we(m,"Intersect")&&!(i.IsString(m.type)&&m.type!=="object")&&i.IsArray(m.allOf)&&m.allOf.every(Pe=>ze(Pe)&&!Hn(Pe))&&T(m.type)&&(h(m.unevaluatedProperties)||A(m.unevaluatedProperties))&&T(m.$id)}d.TIntersect=Fe;function Br(m){return we(m,"Iterator")&&m.type==="Iterator"&&T(m.$id)&&ze(m.items)}d.TIterator=Br;function we(m,Pe){return gr(m)&&m[e.Kind]===Pe}d.TKindOf=we;function gr(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}d.TKind=gr;function Mr(m){return N(m)&&i.IsString(m.const)}d.TLiteralString=Mr;function O(m){return N(m)&&i.IsNumber(m.const)}d.TLiteralNumber=O;function le(m){return N(m)&&i.IsBoolean(m.const)}d.TLiteralBoolean=le;function N(m){return we(m,"Literal")&&T(m.$id)&&(i.IsBoolean(m.const)||i.IsNumber(m.const)||i.IsString(m.const))}d.TLiteral=N;function me(m){return we(m,"Never")&&i.IsObject(m.not)&&Object.getOwnPropertyNames(m.not).length===0}d.TNever=me;function ie(m){return we(m,"Not")&&ze(m.not)}d.TNot=ie;function de(m){return we(m,"Null")&&m.type==="null"&&T(m.$id)}d.TNull=de;function xe(m){return we(m,"Number")&&m.type==="number"&&T(m.$id)&&S(m.exclusiveMaximum)&&S(m.exclusiveMinimum)&&S(m.maximum)&&S(m.minimum)&&S(m.multipleOf)}d.TNumber=xe;function Le(m){return we(m,"Object")&&m.type==="object"&&T(m.$id)&&i.IsObject(m.properties)&&U(m.additionalProperties)&&S(m.minProperties)&&S(m.maxProperties)&&Object.entries(m.properties).every(([Pe,_t])=>I(Pe)&&ze(_t))}d.TObject=Le;function tt(m){return we(m,"Promise")&&m.type==="Promise"&&T(m.$id)&&ze(m.item)}d.TPromise=tt;function Ze(m){return we(m,"Record")&&m.type==="object"&&T(m.$id)&&U(m.additionalProperties)&&i.IsObject(m.patternProperties)&&(Pe=>{let _t=Object.getOwnPropertyNames(Pe.patternProperties);return _t.length===1&&_(_t[0])&&i.IsObject(Pe.patternProperties)&&ze(Pe.patternProperties[_t[0]])})(m)}d.TRecord=Ze;function nt(m){return i.IsObject(m)&&e.Hint in m&&m[e.Hint]==="Recursive"}d.TRecursive=nt;function or(m){return we(m,"Ref")&&T(m.$id)&&i.IsString(m.$ref)}d.TRef=or;function dn(m){return we(m,"String")&&m.type==="string"&&T(m.$id)&&S(m.minLength)&&S(m.maxLength)&&w(m.pattern)&&u(m.format)}d.TString=dn;function pn(m){return we(m,"Symbol")&&m.type==="symbol"&&T(m.$id)}d.TSymbol=pn;function kr(m){return we(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}d.TTemplateLiteral=kr;function ji(m){return we(m,"This")&&T(m.$id)&&i.IsString(m.$ref)}d.TThis=ji;function Hn(m){return i.IsObject(m)&&e.Transform in m}d.TTransform=Hn;function Ke(m){return we(m,"Tuple")&&m.type==="array"&&T(m.$id)&&i.IsNumber(m.minItems)&&i.IsNumber(m.maxItems)&&m.minItems===m.maxItems&&(i.IsUndefined(m.items)&&i.IsUndefined(m.additionalItems)&&m.minItems===0||i.IsArray(m.items)&&m.items.every(Pe=>ze(Pe)))}d.TTuple=Ke;function Fi(m){return we(m,"Undefined")&&m.type==="undefined"&&T(m.$id)}d.TUndefined=Fi;function xs(m){return Dr(m)&&m.anyOf.every(Pe=>Mr(Pe)||O(Pe))}d.TUnionLiteral=xs;function Dr(m){return we(m,"Union")&&T(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every(Pe=>ze(Pe))}d.TUnion=Dr;function yn(m){return we(m,"Uint8Array")&&m.type==="Uint8Array"&&T(m.$id)&&S(m.minByteLength)&&S(m.maxByteLength)}d.TUint8Array=yn;function rt(m){return we(m,"Unknown")&&T(m.$id)}d.TUnknown=rt;function Vi(m){return we(m,"Unsafe")}d.TUnsafe=Vi;function Jn(m){return we(m,"Void")&&m.type==="void"&&T(m.$id)}d.TVoid=Jn;function Ns(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}d.TReadonly=Ns;function Ps(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}d.TOptional=Ps;function ze(m){return i.IsObject(m)&&(v(m)||b(m)||te(m)||K(m)||x(m)||ne(m)||ge(m)||_e(m)||Be(m)||Fe(m)||Br(m)||N(m)||me(m)||ie(m)||de(m)||xe(m)||Le(m)||tt(m)||Ze(m)||or(m)||dn(m)||pn(m)||kr(m)||ji(m)||Ke(m)||Fi(m)||Dr(m)||yn(m)||rt(m)||Vi(m)||Jn(m)||gr(m)&&t.Has(m[e.Kind]))}d.TSchema=ze})(s||(e.TypeGuard=s={}));var a;(function(d){function _(I){return I[e.Kind]==="Intersect"?I.allOf.every(U=>_(U)):I[e.Kind]==="Union"?I.anyOf.some(U=>_(U)):I[e.Kind]==="Undefined"?!0:I[e.Kind]==="Not"?!_(I.not):!1}d.Check=_})(a||(e.ExtendsUndefined=a={}));var c=class extends r{};e.TypeExtendsError=c;var f;(function(d){d[d.Union=0]="Union",d[d.True=1]="True",d[d.False=2]="False"})(f||(e.TypeExtendsResult=f={}));var l;(function(d){function _(p){return p===f.False?p:f.True}function I(p){throw new c(p)}function U(p){return s.TNever(p)||s.TIntersect(p)||s.TUnion(p)||s.TUnknown(p)||s.TAny(p)}function R(p,y){return s.TNever(y)?we(p,y):s.TIntersect(y)?_e(p,y):s.TUnion(y)?Rs(p,y):s.TUnknown(y)?zu(p,y):s.TAny(y)?S(p,y):I("StructuralRight")}function S(p,y){return f.True}function h(p,y){return s.TIntersect(y)?_e(p,y):s.TUnion(y)&&y.anyOf.some(Oe=>s.TAny(Oe)||s.TUnknown(Oe))?f.True:s.TUnion(y)?f.Union:s.TUnknown(y)||s.TAny(y)?f.True:f.Union}function T(p,y){return s.TUnknown(p)?f.False:s.TAny(p)?f.Union:s.TNever(p)?f.True:f.False}function w(p,y){return s.TObject(y)&&kr(y)?f.True:U(y)?R(p,y):s.TArray(y)?_(Ne(p.items,y.items)):f.False}function u(p,y){return U(y)?R(p,y):s.TAsyncIterator(y)?_(Ne(p.items,y.items)):f.False}function A(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TBigInt(y)?f.True:f.False}function v(p,y){return s.TLiteral(p)&&i.IsBoolean(p.const)||s.TBoolean(p)?f.True:f.False}function b(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TBoolean(y)?f.True:f.False}function x(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TConstructor(y)?p.parameters.length>y.parameters.length?f.False:p.parameters.every((Oe,kt)=>_(Ne(y.parameters[kt],Oe))===f.True)?_(Ne(p.returns,y.returns)):f.False:f.False}function K(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TDate(y)?f.True:f.False}function te(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TFunction(y)?p.parameters.length>y.parameters.length?f.False:p.parameters.every((Oe,kt)=>_(Ne(y.parameters[kt],Oe))===f.True)?_(Ne(p.returns,y.returns)):f.False:f.False}function ne(p,y){return s.TLiteral(p)&&i.IsNumber(p.const)||s.TNumber(p)||s.TInteger(p)?f.True:f.False}function ge(p,y){return s.TInteger(y)||s.TNumber(y)?f.True:U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):f.False}function _e(p,y){return y.allOf.every(Oe=>Ne(p,Oe)===f.True)?f.True:f.False}function Be(p,y){return p.allOf.some(Oe=>Ne(Oe,y)===f.True)?f.True:f.False}function Fe(p,y){return U(y)?R(p,y):s.TIterator(y)?_(Ne(p.items,y.items)):f.False}function Br(p,y){return s.TLiteral(y)&&y.const===p.const?f.True:U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TString(y)?Jn(p,y):s.TNumber(y)?N(p,y):s.TInteger(y)?ne(p,y):s.TBoolean(y)?v(p,y):f.False}function we(p,y){return f.False}function gr(p,y){return f.True}function Mr(p){let[y,Oe]=[p,0];for(;s.TNot(y);)y=y.not,Oe+=1;return Oe%2===0?y:e.Type.Unknown()}function O(p,y){return s.TNot(p)?Ne(Mr(p),y):s.TNot(y)?Ne(p,Mr(y)):I("Invalid fallthrough for Not")}function le(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TNull(y)?f.True:f.False}function N(p,y){return s.TLiteralNumber(p)||s.TNumber(p)||s.TInteger(p)?f.True:f.False}function me(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TInteger(y)||s.TNumber(y)?f.True:f.False}function ie(p,y){return Object.getOwnPropertyNames(p.properties).length===y}function de(p){return kr(p)}function xe(p){return ie(p,0)||ie(p,1)&&"description"in p.properties&&s.TUnion(p.properties.description)&&p.properties.description.anyOf.length===2&&(s.TString(p.properties.description.anyOf[0])&&s.TUndefined(p.properties.description.anyOf[1])||s.TString(p.properties.description.anyOf[1])&&s.TUndefined(p.properties.description.anyOf[0]))}function Le(p){return ie(p,0)}function tt(p){return ie(p,0)}function Ze(p){return ie(p,0)}function nt(p){return ie(p,0)}function or(p){return kr(p)}function dn(p){let y=e.Type.Number();return ie(p,0)||ie(p,1)&&"length"in p.properties&&_(Ne(p.properties.length,y))===f.True}function pn(p){return ie(p,0)}function kr(p){let y=e.Type.Number();return ie(p,0)||ie(p,1)&&"length"in p.properties&&_(Ne(p.properties.length,y))===f.True}function ji(p){let y=e.Type.Function([e.Type.Any()],e.Type.Any());return ie(p,0)||ie(p,1)&&"then"in p.properties&&_(Ne(p.properties.then,y))===f.True}function Hn(p,y){return Ne(p,y)===f.False||s.TOptional(p)&&!s.TOptional(y)?f.False:f.True}function Ke(p,y){return s.TUnknown(p)?f.False:s.TAny(p)?f.Union:s.TNever(p)||s.TLiteralString(p)&&de(y)||s.TLiteralNumber(p)&&Le(y)||s.TLiteralBoolean(p)&&tt(y)||s.TSymbol(p)&&xe(y)||s.TBigInt(p)&&Ze(y)||s.TString(p)&&de(y)||s.TSymbol(p)&&xe(y)||s.TNumber(p)&&Le(y)||s.TInteger(p)&&Le(y)||s.TBoolean(p)&&tt(y)||s.TUint8Array(p)&&or(y)||s.TDate(p)&&nt(y)||s.TConstructor(p)&&pn(y)||s.TFunction(p)&&dn(y)?f.True:s.TRecord(p)&&s.TString(Dr(p))?y[e.Hint]==="Record"?f.True:f.False:s.TRecord(p)&&s.TNumber(Dr(p))?ie(y,0)?f.True:f.False:f.False}function Fi(p,y){return U(y)?R(p,y):s.TRecord(y)?rt(p,y):s.TObject(y)?(()=>{for(let Oe of Object.getOwnPropertyNames(y.properties)){if(!(Oe in p.properties)&&!s.TOptional(y.properties[Oe]))return f.False;if(s.TOptional(y.properties[Oe]))return f.True;if(Hn(p.properties[Oe],y.properties[Oe])===f.False)return f.False}return f.True})():f.False}function xs(p,y){return U(y)?R(p,y):s.TObject(y)&&ji(y)?f.True:s.TPromise(y)?_(Ne(p.item,y.item)):f.False}function Dr(p){return e.PatternNumberExact in p.patternProperties?e.Type.Number():e.PatternStringExact in p.patternProperties?e.Type.String():I("Unknown record key pattern")}function yn(p){return e.PatternNumberExact in p.patternProperties?p.patternProperties[e.PatternNumberExact]:e.PatternStringExact in p.patternProperties?p.patternProperties[e.PatternStringExact]:I("Unable to get record value schema")}function rt(p,y){let[Oe,kt]=[Dr(y),yn(y)];return s.TLiteralString(p)&&s.TNumber(Oe)&&_(Ne(p,kt))===f.True?f.True:s.TUint8Array(p)&&s.TNumber(Oe)||s.TString(p)&&s.TNumber(Oe)||s.TArray(p)&&s.TNumber(Oe)?Ne(p,kt):s.TObject(p)?(()=>{for(let Ry of Object.getOwnPropertyNames(p.properties))if(Hn(kt,p.properties[Ry])===f.False)return f.False;return f.True})():f.False}function Vi(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?Ne(yn(p),yn(y)):f.False}function Jn(p,y){return s.TLiteral(p)&&i.IsString(p.const)||s.TString(p)?f.True:f.False}function Ns(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TString(y)?f.True:f.False}function Ps(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TSymbol(y)?f.True:f.False}function ze(p,y){return s.TTemplateLiteral(p)?Ne(j.Resolve(p),y):s.TTemplateLiteral(y)?Ne(p,j.Resolve(y)):I("Invalid fallthrough for TemplateLiteral")}function m(p,y){return s.TArray(y)&&p.items!==void 0&&p.items.every(Oe=>Ne(Oe,y.items)===f.True)}function Pe(p,y){return s.TNever(p)?f.True:s.TUnknown(p)?f.False:s.TAny(p)?f.Union:f.False}function _t(p,y){return U(y)?R(p,y):s.TObject(y)&&kr(y)||s.TArray(y)&&m(p,y)?f.True:s.TTuple(y)?i.IsUndefined(p.items)&&!i.IsUndefined(y.items)||!i.IsUndefined(p.items)&&i.IsUndefined(y.items)?f.False:i.IsUndefined(p.items)&&!i.IsUndefined(y.items)||p.items.every((Oe,kt)=>Ne(Oe,y.items[kt])===f.True)?f.True:f.False:f.False}function Oy(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TUint8Array(y)?f.True:f.False}function Iy(p,y){return U(y)?R(p,y):s.TObject(y)?Ke(p,y):s.TRecord(y)?rt(p,y):s.TVoid(y)?xy(p,y):s.TUndefined(y)?f.True:f.False}function Rs(p,y){return y.anyOf.some(Oe=>Ne(p,Oe)===f.True)?f.True:f.False}function Ey(p,y){return p.anyOf.every(Oe=>Ne(Oe,y)===f.True)?f.True:f.False}function zu(p,y){return f.True}function Sy(p,y){return s.TNever(y)?we(p,y):s.TIntersect(y)?_e(p,y):s.TUnion(y)?Rs(p,y):s.TAny(y)?S(p,y):s.TString(y)?Jn(p,y):s.TNumber(y)?N(p,y):s.TInteger(y)?ne(p,y):s.TBoolean(y)?v(p,y):s.TArray(y)?T(p,y):s.TTuple(y)?Pe(p,y):s.TObject(y)?Ke(p,y):s.TUnknown(y)?f.True:f.False}function xy(p,y){return s.TUndefined(p)||s.TUndefined(p)?f.True:f.False}function Ny(p,y){return s.TIntersect(y)?_e(p,y):s.TUnion(y)?Rs(p,y):s.TUnknown(y)?zu(p,y):s.TAny(y)?S(p,y):s.TObject(y)?Ke(p,y):s.TVoid(y)?f.True:f.False}function Ne(p,y){return s.TTemplateLiteral(p)||s.TTemplateLiteral(y)?ze(p,y):s.TNot(p)||s.TNot(y)?O(p,y):s.TAny(p)?h(p,y):s.TArray(p)?w(p,y):s.TBigInt(p)?A(p,y):s.TBoolean(p)?b(p,y):s.TAsyncIterator(p)?u(p,y):s.TConstructor(p)?x(p,y):s.TDate(p)?K(p,y):s.TFunction(p)?te(p,y):s.TInteger(p)?ge(p,y):s.TIntersect(p)?Be(p,y):s.TIterator(p)?Fe(p,y):s.TLiteral(p)?Br(p,y):s.TNever(p)?gr(p,y):s.TNull(p)?le(p,y):s.TNumber(p)?me(p,y):s.TObject(p)?Fi(p,y):s.TRecord(p)?Vi(p,y):s.TString(p)?Ns(p,y):s.TSymbol(p)?Ps(p,y):s.TTuple(p)?_t(p,y):s.TPromise(p)?xs(p,y):s.TUint8Array(p)?Oy(p,y):s.TUndefined(p)?Iy(p,y):s.TUnion(p)?Ey(p,y):s.TUnknown(p)?Sy(p,y):s.TVoid(p)?Ny(p,y):I(`Unknown left type operand '${p[e.Kind]}'`)}function Py(p,y){return Ne(p,y)}d.Extends=Py})(l||(e.TypeExtends=l={}));var g;(function(d){function _(w){return w.map(u=>S(u))}function I(w){return new Date(w.getTime())}function U(w){return new Uint8Array(w)}function R(w){let u=Object.getOwnPropertyNames(w).reduce((v,b)=>({...v,[b]:S(w[b])}),{}),A=Object.getOwnPropertySymbols(w).reduce((v,b)=>({...v,[b]:S(w[b])}),{});return{...u,...A}}function S(w){return i.IsArray(w)?_(w):i.IsDate(w)?I(w):i.IsUint8Array(w)?U(w):i.IsObject(w)?R(w):w}function h(w){return w.map(u=>T(u))}d.Rest=h;function T(w,u={}){return{...S(w),...u}}d.Type=T})(g||(e.TypeClone=g={}));var P;(function(d){function _(x){return x.map(K=>{let{[e.Optional]:te,...ne}=g.Type(K);return ne})}function I(x){return x.every(K=>s.TOptional(K))}function U(x){return x.some(K=>s.TOptional(K))}function R(x){return I(x.allOf)?e.Type.Optional(e.Type.Intersect(_(x.allOf))):x}function S(x){return U(x.anyOf)?e.Type.Optional(e.Type.Union(_(x.anyOf))):x}function h(x){return x[e.Kind]==="Intersect"?R(x):x[e.Kind]==="Union"?S(x):x}function T(x,K){let te=x.allOf.reduce((ne,ge)=>{let _e=v(ge,K);return _e[e.Kind]==="Never"?ne:[...ne,_e]},[]);return h(e.Type.Intersect(te))}function w(x,K){let te=x.anyOf.map(ne=>v(ne,K));return h(e.Type.Union(te))}function u(x,K){let te=x.properties[K];return i.IsUndefined(te)?e.Type.Never():e.Type.Union([te])}function A(x,K){let te=x.items;if(i.IsUndefined(te))return e.Type.Never();let ne=te[K];return i.IsUndefined(ne)?e.Type.Never():ne}function v(x,K){return x[e.Kind]==="Intersect"?T(x,K):x[e.Kind]==="Union"?w(x,K):x[e.Kind]==="Object"?u(x,K):x[e.Kind]==="Tuple"?A(x,K):e.Type.Never()}function b(x,K,te={}){let ne=K.map(ge=>v(x,ge.toString()));return h(e.Type.Union(ne,te))}d.Resolve=b})(P||(e.IndexedAccessor=P={}));var E;(function(d){function _(A){let[v,b]=[A.slice(0,1),A.slice(1)];return`${v.toLowerCase()}${b}`}function I(A){let[v,b]=[A.slice(0,1),A.slice(1)];return`${v.toUpperCase()}${b}`}function U(A){return A.toUpperCase()}function R(A){return A.toLowerCase()}function S(A,v){let b=W.ParseExact(A.pattern);if(!$.Check(b))return{...A,pattern:h(A.pattern,v)};let te=[...D.Generate(b)].map(_e=>e.Type.Literal(_e)),ne=T(te,v),ge=e.Type.Union(ne);return e.Type.TemplateLiteral([ge])}function h(A,v){return typeof A=="string"?v==="Uncapitalize"?_(A):v==="Capitalize"?I(A):v==="Uppercase"?U(A):v==="Lowercase"?R(A):A:A.toString()}function T(A,v){if(A.length===0)return[];let[b,...x]=A;return[u(b,v),...T(x,v)]}function w(A,v){return s.TTemplateLiteral(A)?S(A,v):s.TUnion(A)?e.Type.Union(T(A.anyOf,v)):s.TLiteral(A)?e.Type.Literal(h(A.const,v)):A}function u(A,v){return w(A,v)}d.Map=u})(E||(e.Intrinsic=E={}));var M;(function(d){function _(h,T){return e.Type.Intersect(h.allOf.map(w=>R(w,T)),{...h})}function I(h,T){return e.Type.Union(h.anyOf.map(w=>R(w,T)),{...h})}function U(h,T){return T(h)}function R(h,T){return h[e.Kind]==="Intersect"?_(h,T):h[e.Kind]==="Union"?I(h,T):h[e.Kind]==="Object"?U(h,T):h}function S(h,T,w){return{...R(g.Type(h),T),...w}}d.Map=S})(M||(e.ObjectMap=M={}));var z;(function(d){function _(u){return u[0]==="^"&&u[u.length-1]==="$"?u.slice(1,u.length-1):u}function I(u,A){return u.allOf.reduce((v,b)=>[...v,...h(b,A)],[])}function U(u,A){let v=u.anyOf.map(b=>h(b,A));return[...v.reduce((b,x)=>x.map(K=>v.every(te=>te.includes(K))?b.add(K):b)[0],new Set)]}function R(u,A){return Object.getOwnPropertyNames(u.properties)}function S(u,A){return A.includePatterns?Object.getOwnPropertyNames(u.patternProperties):[]}function h(u,A){return s.TIntersect(u)?I(u,A):s.TUnion(u)?U(u,A):s.TObject(u)?R(u,A):s.TRecord(u)?S(u,A):[]}function T(u,A){return[...new Set(h(u,A))]}d.ResolveKeys=T;function w(u){return`^(${T(u,{includePatterns:!0}).map(b=>`(${_(b)})`).join("|")})$`}d.ResolvePattern=w})(z||(e.KeyResolver=z={}));var Q=class extends r{};e.KeyArrayResolverError=Q;var F;(function(d){function _(I){return Array.isArray(I)?I:s.TUnionLiteral(I)?I.anyOf.map(U=>U.const.toString()):s.TLiteral(I)?[I.const]:s.TTemplateLiteral(I)?(()=>{let U=W.ParseExact(I.pattern);if(!$.Check(U))throw new Q("Cannot resolve keys from infinite template expression");return[...D.Generate(U)]})():[]}d.Resolve=_})(F||(e.KeyArrayResolver=F={}));var L;(function(d){function*_(U){for(let R of U.anyOf)R[e.Kind]==="Union"?yield*_(R):yield R}function I(U){return e.Type.Union([..._(U)],{...U})}d.Resolve=I})(L||(e.UnionResolver=L={}));var G=class extends r{};e.TemplateLiteralPatternError=G;var H;(function(d){function _(S){throw new G(S)}function I(S){return S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U(S,h){return s.TTemplateLiteral(S)?S.pattern.slice(1,S.pattern.length-1):s.TUnion(S)?`(${S.anyOf.map(T=>U(T,h)).join("|")})`:s.TNumber(S)?`${h}${e.PatternNumber}`:s.TInteger(S)?`${h}${e.PatternNumber}`:s.TBigInt(S)?`${h}${e.PatternNumber}`:s.TString(S)?`${h}${e.PatternString}`:s.TLiteral(S)?`${h}${I(S.const.toString())}`:s.TBoolean(S)?`${h}${e.PatternBoolean}`:_(`Unexpected Kind '${S[e.Kind]}'`)}function R(S){return`^${S.map(h=>U(h,"")).join("")}$`}d.Create=R})(H||(e.TemplateLiteralPattern=H={}));var j;(function(d){function _(I){let U=W.ParseExact(I.pattern);if(!$.Check(U))return e.Type.String();let R=[...D.Generate(U)].map(S=>e.Type.Literal(S));return e.Type.Union(R)}d.Resolve=_})(j||(e.TemplateLiteralResolver=j={}));var re=class extends r{};e.TemplateLiteralParserError=re;var W;(function(d){function _(x,K,te){return x[K]===te&&x.charCodeAt(K-1)!==92}function I(x,K){return _(x,K,"(")}function U(x,K){return _(x,K,")")}function R(x,K){return _(x,K,"|")}function S(x){if(!(I(x,0)&&U(x,x.length-1)))return!1;let K=0;for(let te=0;te<x.length;te++)if(I(x,te)&&(K+=1),U(x,te)&&(K-=1),K===0&&te!==x.length-1)return!1;return!0}function h(x){return x.slice(1,x.length-1)}function T(x){let K=0;for(let te=0;te<x.length;te++)if(I(x,te)&&(K+=1),U(x,te)&&(K-=1),R(x,te)&&K===0)return!0;return!1}function w(x){for(let K=0;K<x.length;K++)if(I(x,K))return!0;return!1}function u(x){let[K,te]=[0,0],ne=[];for(let _e=0;_e<x.length;_e++)if(I(x,_e)&&(K+=1),U(x,_e)&&(K-=1),R(x,_e)&&K===0){let Be=x.slice(te,_e);Be.length>0&&ne.push(v(Be)),te=_e+1}let ge=x.slice(te);return ge.length>0&&ne.push(v(ge)),ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"or",expr:ne}}function A(x){function K(ge,_e){if(!I(ge,_e))throw new re("TemplateLiteralParser: Index must point to open parens");let Be=0;for(let Fe=_e;Fe<ge.length;Fe++)if(I(ge,Fe)&&(Be+=1),U(ge,Fe)&&(Be-=1),Be===0)return[_e,Fe];throw new re("TemplateLiteralParser: Unclosed group parens in expression")}function te(ge,_e){for(let Be=_e;Be<ge.length;Be++)if(I(ge,Be))return[_e,Be];return[_e,ge.length]}let ne=[];for(let ge=0;ge<x.length;ge++)if(I(x,ge)){let[_e,Be]=K(x,ge),Fe=x.slice(_e,Be+1);ne.push(v(Fe)),ge=Be}else{let[_e,Be]=te(x,ge),Fe=x.slice(_e,Be);Fe.length>0&&ne.push(v(Fe)),ge=Be-1}return ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"and",expr:ne}}function v(x){return S(x)?v(h(x)):T(x)?u(x):w(x)?A(x):{type:"const",const:x}}d.Parse=v;function b(x){return v(x.slice(1,x.length-1))}d.ParseExact=b})(W||(e.TemplateLiteralParser=W={}));var pe=class extends r{};e.TemplateLiteralFiniteError=pe;var $;(function(d){function _(h){throw new pe(h)}function I(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="0"&&h.expr[1].type==="const"&&h.expr[1].const==="[1-9][0-9]*"}function U(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="true"&&h.expr[1].type==="const"&&h.expr[1].const==="false"}function R(h){return h.type==="const"&&h.const===".*"}function S(h){return U(h)?!0:I(h)||R(h)?!1:h.type==="and"?h.expr.every(T=>S(T)):h.type==="or"?h.expr.every(T=>S(T)):h.type==="const"?!0:_("Unknown expression type")}d.Check=S})($||(e.TemplateLiteralFinite=$={}));var B=class extends r{};e.TemplateLiteralGeneratorError=B;var D;(function(d){function*_(h){if(h.length===1)return yield*h[0];for(let T of h[0])for(let w of _(h.slice(1)))yield`${T}${w}`}function*I(h){return yield*_(h.expr.map(T=>[...S(T)]))}function*U(h){for(let T of h.expr)yield*S(T)}function*R(h){return yield h.const}function*S(h){return h.type==="and"?yield*I(h):h.type==="or"?yield*U(h):h.type==="const"?yield*R(h):(()=>{throw new B("Unknown expression")})()}d.Generate=S})(D||(e.TemplateLiteralGenerator=D={}));var Z;(function(d){function*_(S){let h=S.trim().replace(/"|'/g,"");return h==="boolean"?yield e.Type.Boolean():h==="number"?yield e.Type.Number():h==="bigint"?yield e.Type.BigInt():h==="string"?yield e.Type.String():yield(()=>{let T=h.split("|").map(w=>e.Type.Literal(w.trim()));return T.length===0?e.Type.Never():T.length===1?T[0]:e.Type.Union(T)})()}function*I(S){if(S[1]!=="{"){let h=e.Type.Literal("$"),T=U(S.slice(1));return yield*[h,...T]}for(let h=2;h<S.length;h++)if(S[h]==="}"){let T=_(S.slice(2,h)),w=U(S.slice(h+1));return yield*[...T,...w]}yield e.Type.Literal(S)}function*U(S){for(let h=0;h<S.length;h++)if(S[h]==="$"){let T=e.Type.Literal(S.slice(0,h)),w=I(S.slice(h));return yield*[T,...w]}yield e.Type.Literal(S)}function R(S){return[...U(S)]}d.Parse=R})(Z||(e.TemplateLiteralDslParser=Z={}));var se=class{constructor(d){this.schema=d}Decode(d){return new Y(this.schema,d)}};e.TransformDecodeBuilder=se;var Y=class{constructor(d,_){this.schema=d,this.decode=_}Encode(d){let _=g.Type(this.schema);return s.TTransform(_)?(()=>{let R={Encode:S=>_[e.Transform].Encode(d(S)),Decode:S=>this.decode(_[e.Transform].Decode(S))};return{..._,[e.Transform]:R}})():(()=>{let I={Decode:this.decode,Encode:d};return{..._,[e.Transform]:I}})()}};e.TransformEncodeBuilder=Y;var ue=0,k=class extends r{};e.TypeBuilderError=k;var q=class{Create(d){return d}Throw(d){throw new k(d)}Discard(d,_){return _.reduce((I,U)=>{let{[U]:R,...S}=I;return S},d)}Strict(d){return JSON.parse(JSON.stringify(d))}};e.TypeBuilder=q;var X=class extends q{ReadonlyOptional(d){return this.Readonly(this.Optional(d))}Readonly(d){return{...g.Type(d),[e.Readonly]:"Readonly"}}Optional(d){return{...g.Type(d),[e.Optional]:"Optional"}}Any(d={}){return this.Create({...d,[e.Kind]:"Any"})}Array(d,_={}){return this.Create({..._,[e.Kind]:"Array",type:"array",items:g.Type(d)})}Boolean(d={}){return this.Create({...d,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(d,_={}){return{...E.Map(g.Type(d),"Capitalize"),..._}}Composite(d,_){let I=e.Type.Intersect(d,{}),R=z.ResolveKeys(I,{includePatterns:!1}).reduce((S,h)=>({...S,[h]:e.Type.Index(I,[h])}),{});return e.Type.Object(R,_)}Enum(d,_={}){if(i.IsUndefined(d))return this.Throw("Enum undefined or empty");let I=Object.getOwnPropertyNames(d).filter(S=>isNaN(S)).map(S=>d[S]),R=[...new Set(I)].map(S=>e.Type.Literal(S));return this.Union(R,{..._,[e.Hint]:"Enum"})}Extends(d,_,I,U,R={}){switch(l.Extends(d,_)){case f.Union:return this.Union([g.Type(I,R),g.Type(U,R)]);case f.True:return g.Type(I,R);case f.False:return g.Type(U,R)}}Exclude(d,_,I={}){return s.TTemplateLiteral(d)?this.Exclude(j.Resolve(d),_,I):s.TTemplateLiteral(_)?this.Exclude(d,j.Resolve(_),I):s.TUnion(d)?(()=>{let U=d.anyOf.filter(R=>l.Extends(R,_)===f.False);return U.length===1?g.Type(U[0],I):this.Union(U,I)})():l.Extends(d,_)!==f.False?this.Never(I):g.Type(d,I)}Extract(d,_,I={}){return s.TTemplateLiteral(d)?this.Extract(j.Resolve(d),_,I):s.TTemplateLiteral(_)?this.Extract(d,j.Resolve(_),I):s.TUnion(d)?(()=>{let U=d.anyOf.filter(R=>l.Extends(R,_)!==f.False);return U.length===1?g.Type(U[0],I):this.Union(U,I)})():l.Extends(d,_)!==f.False?g.Type(d,I):this.Never(I)}Index(d,_,I={}){return s.TArray(d)&&s.TNumber(_)?g.Type(d.items,I):s.TTuple(d)&&s.TNumber(_)?(()=>{let R=(i.IsUndefined(d.items)?[]:d.items).map(S=>g.Type(S));return this.Union(R,I)})():(()=>{let U=F.Resolve(_),R=g.Type(d);return P.Resolve(R,U,I)})()}Integer(d={}){return this.Create({...d,[e.Kind]:"Integer",type:"integer"})}Intersect(d,_={}){if(d.length===0)return e.Type.Never();if(d.length===1)return g.Type(d[0],_);d.some(S=>s.TTransform(S))&&this.Throw("Cannot intersect transform types");let I=d.every(S=>s.TObject(S)),U=g.Rest(d),R=s.TSchema(_.unevaluatedProperties)?{unevaluatedProperties:g.Type(_.unevaluatedProperties)}:{};return _.unevaluatedProperties===!1||s.TSchema(_.unevaluatedProperties)||I?this.Create({..._,...R,[e.Kind]:"Intersect",type:"object",allOf:U}):this.Create({..._,...R,[e.Kind]:"Intersect",allOf:U})}KeyOf(d,_={}){return s.TRecord(d)?(()=>{let I=Object.getOwnPropertyNames(d.patternProperties)[0];return I===e.PatternNumberExact?this.Number(_):I===e.PatternStringExact?this.String(_):this.Throw("Unable to resolve key type from Record key pattern")})():s.TTuple(d)?(()=>{let U=(i.IsUndefined(d.items)?[]:d.items).map((R,S)=>e.Type.Literal(S.toString()));return this.Union(U,_)})():s.TArray(d)?this.Number(_):(()=>{let I=z.ResolveKeys(d,{includePatterns:!1});if(I.length===0)return this.Never(_);let U=I.map(R=>this.Literal(R));return this.Union(U,_)})()}Literal(d,_={}){return this.Create({..._,[e.Kind]:"Literal",const:d,type:typeof d})}Lowercase(d,_={}){return{...E.Map(g.Type(d),"Lowercase"),..._}}Never(d={}){return this.Create({...d,[e.Kind]:"Never",not:{}})}Not(d,_){return this.Create({..._,[e.Kind]:"Not",not:g.Type(d)})}Null(d={}){return this.Create({...d,[e.Kind]:"Null",type:"null"})}Number(d={}){return this.Create({...d,[e.Kind]:"Number",type:"number"})}Object(d,_={}){let I=Object.getOwnPropertyNames(d),U=I.filter(T=>s.TOptional(d[T])),R=I.filter(T=>!U.includes(T)),S=s.TSchema(_.additionalProperties)?{additionalProperties:g.Type(_.additionalProperties)}:{},h=I.reduce((T,w)=>({...T,[w]:g.Type(d[w])}),{});return R.length>0?this.Create({..._,...S,[e.Kind]:"Object",type:"object",properties:h,required:R}):this.Create({..._,...S,[e.Kind]:"Object",type:"object",properties:h})}Omit(d,_,I={}){let U=F.Resolve(_);return M.Map(this.Discard(g.Type(d),["$id",e.Transform]),R=>{i.IsArray(R.required)&&(R.required=R.required.filter(S=>!U.includes(S)),R.required.length===0&&delete R.required);for(let S of Object.getOwnPropertyNames(R.properties))U.includes(S)&&delete R.properties[S];return this.Create(R)},I)}Partial(d,_={}){return M.Map(this.Discard(g.Type(d),["$id",e.Transform]),I=>{let U=Object.getOwnPropertyNames(I.properties).reduce((R,S)=>({...R,[S]:this.Optional(I.properties[S])}),{});return this.Object(U,this.Discard(I,["required"]))},_)}Pick(d,_,I={}){let U=F.Resolve(_);return M.Map(this.Discard(g.Type(d),["$id",e.Transform]),R=>{i.IsArray(R.required)&&(R.required=R.required.filter(S=>U.includes(S)),R.required.length===0&&delete R.required);for(let S of Object.getOwnPropertyNames(R.properties))U.includes(S)||delete R.properties[S];return this.Create(R)},I)}Record(d,_,I={}){return s.TTemplateLiteral(d)?(()=>{let U=W.ParseExact(d.pattern);return $.Check(U)?this.Object([...D.Generate(U)].reduce((R,S)=>({...R,[S]:g.Type(_)}),{}),I):this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[d.pattern]:g.Type(_)}})})():s.TUnion(d)?(()=>{let U=L.Resolve(d);if(s.TUnionLiteral(U)){let R=U.anyOf.reduce((S,h)=>({...S,[h.const]:g.Type(_)}),{});return this.Object(R,{...I,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():s.TLiteral(d)?i.IsString(d.const)||i.IsNumber(d.const)?this.Object({[d.const]:g.Type(_)},I):this.Throw("Record key of type literal is not of type string or number"):s.TInteger(d)||s.TNumber(d)?this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:g.Type(_)}}):s.TString(d)?(()=>{let U=i.IsUndefined(d.pattern)?e.PatternStringExact:d.pattern;return this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[U]:g.Type(_)}})})():this.Never()}Recursive(d,_={}){i.IsUndefined(_.$id)&&(_.$id=`T${ue++}`);let I=d({[e.Kind]:"This",$ref:`${_.$id}`});return I.$id=_.$id,this.Create({..._,[e.Hint]:"Recursive",...I})}Ref(d,_={}){return i.IsString(d)?this.Create({..._,[e.Kind]:"Ref",$ref:d}):(i.IsUndefined(d.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({..._,[e.Kind]:"Ref",$ref:d.$id}))}Required(d,_={}){return M.Map(this.Discard(g.Type(d),["$id",e.Transform]),I=>{let U=Object.getOwnPropertyNames(I.properties).reduce((R,S)=>({...R,[S]:this.Discard(I.properties[S],[e.Optional])}),{});return this.Object(U,I)},_)}Rest(d){return s.TTuple(d)&&!i.IsUndefined(d.items)?g.Rest(d.items):s.TIntersect(d)?g.Rest(d.allOf):s.TUnion(d)?g.Rest(d.anyOf):[]}String(d={}){return this.Create({...d,[e.Kind]:"String",type:"string"})}TemplateLiteral(d,_={}){let I=i.IsString(d)?H.Create(Z.Parse(d)):H.Create(d);return this.Create({..._,[e.Kind]:"TemplateLiteral",type:"string",pattern:I})}Transform(d){return new se(d)}Tuple(d,_={}){let[I,U,R]=[!1,d.length,d.length],S=g.Rest(d),h=d.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:S,additionalItems:I,minItems:U,maxItems:R}:{..._,[e.Kind]:"Tuple",type:"array",minItems:U,maxItems:R};return this.Create(h)}Uncapitalize(d,_={}){return{...E.Map(g.Type(d),"Uncapitalize"),..._}}Union(d,_={}){return s.TTemplateLiteral(d)?j.Resolve(d):(()=>{let I=d;if(I.length===0)return this.Never(_);if(I.length===1)return this.Create(g.Type(I[0],_));let U=g.Rest(I);return this.Create({..._,[e.Kind]:"Union",anyOf:U})})()}Unknown(d={}){return this.Create({...d,[e.Kind]:"Unknown"})}Unsafe(d={}){return this.Create({...d,[e.Kind]:d[e.Kind]||"Unsafe"})}Uppercase(d,_={}){return{...E.Map(g.Type(d),"Uppercase"),..._}}};e.JsonTypeBuilder=X;var ye=class extends X{AsyncIterator(d,_={}){return this.Create({..._,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:g.Type(d)})}Awaited(d,_={}){let I=U=>U.length>0?(()=>{let[R,...S]=U;return[this.Awaited(R),...I(S)]})():U;return s.TIntersect(d)?e.Type.Intersect(I(d.allOf)):s.TUnion(d)?e.Type.Union(I(d.anyOf)):s.TPromise(d)?this.Awaited(d.item):g.Type(d,_)}BigInt(d={}){return this.Create({...d,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(d,_={}){return this.Tuple([...d.parameters],{..._})}Constructor(d,_,I){let[U,R]=[g.Rest(d),g.Type(_)];return this.Create({...I,[e.Kind]:"Constructor",type:"Constructor",parameters:U,returns:R})}Date(d={}){return this.Create({...d,[e.Kind]:"Date",type:"Date"})}Function(d,_,I){let[U,R]=[g.Rest(d),g.Type(_)];return this.Create({...I,[e.Kind]:"Function",type:"Function",parameters:U,returns:R})}InstanceType(d,_={}){return g.Type(d.returns,_)}Iterator(d,_={}){return this.Create({..._,[e.Kind]:"Iterator",type:"Iterator",items:g.Type(d)})}Parameters(d,_={}){return this.Tuple(d.parameters,{..._})}Promise(d,_={}){return this.Create({..._,[e.Kind]:"Promise",type:"Promise",item:g.Type(d)})}RegExp(d,_={}){let I=i.IsString(d)?d:d.source;return this.Create({..._,[e.Kind]:"String",type:"string",pattern:I})}RegEx(d,_={}){return this.RegExp(d,_)}ReturnType(d,_={}){return g.Type(d.returns,_)}Symbol(d){return this.Create({...d,[e.Kind]:"Symbol",type:"symbol"})}Undefined(d={}){return this.Create({...d,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(d={}){return this.Create({...d,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(d={}){return this.Create({...d,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=ye,e.JsonType=new X,e.Type=new ye}}),Cn=Ut(dr(),1),{String:jm,Optional:Fm,Boolean:Vm,Object:Km,Number:zm}=Cn.Type,qm=jm.bind(Cn.Type),Gm=zm.bind(Cn.Type),DN=Km.bind(Cn.Type),LN=Fm.bind(Cn.Type),Wm=Vm.bind(Cn.Type),jN=qm(),FN=Gm(),VN=Wm();function vl(e){return Array.isArray(e)?e:[e]}var Hm=De({"../../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},r=typeof window<"u"&&typeof window.document<"u",n=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(typeof self>"u"?"undefined":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",o=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),s=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=r,e.isWebWorker=i,e.isNode=n,e.isJsDom=o,e.isDeno=s}}),Jm=De({"../../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(e,t){"use strict";t.exports=function(r,n){n||(n={}),typeof n=="function"&&(n={cmp:n});var i=typeof n.cycles=="boolean"?n.cycles:!1,o=n.cmp&&function(a){return function(c){return function(f,l){var g={key:f,value:c[f]},P={key:l,value:c[l]};return a(g,P)}}}(n.cmp),s=[];return function a(c){if(c&&c.toJSON&&typeof c.toJSON=="function"&&(c=c.toJSON()),c!==void 0){if(typeof c=="number")return isFinite(c)?""+c:"null";if(typeof c!="object")return JSON.stringify(c);var f,l;if(Array.isArray(c)){for(l="[",f=0;f<c.length;f++)f&&(l+=","),l+=a(c[f])||"null";return l+"]"}if(c===null)return"null";if(s.indexOf(c)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=s.push(c)-1,P=Object.keys(c).sort(o&&o(c));for(l="",f=0;f<P.length;f++){var E=P[f],M=a(c[E]);M&&(l&&(l+=","),l+=JSON.stringify(E)+":"+M)}return s.splice(g,1),"{"+l+"}"}}(r)}}}),Xm=De({"../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:r}=Object.prototype,n=F();n.configure=F,n.stringify=n,n.default=n,e.stringify=n,e.configure=F,t.exports=n;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function o(L){return L.length<5e3&&!i.test(L)?`"${L}"`:JSON.stringify(L)}function s(L,G){if(L.length>200||G)return L.sort(G);for(let H=1;H<L.length;H++){let j=L[H],re=H;for(;re!==0&&L[re-1]>j;)L[re]=L[re-1],re--;L[re]=j}return L}var a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(L){return a.call(L)!==void 0&&L.length!==0}function f(L,G,H){L.length<H&&(H=L.length);let j=G===","?"":" ",re=`"0":${j}${L[0]}`;for(let W=1;W<H;W++)re+=`${G}"${W}":${j}${L[W]}`;return re}function l(L){if(r.call(L,"circularValue")){let G=L.circularValue;if(typeof G=="string")return`"${G}"`;if(G==null)return G;if(G===Error||G===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function g(L){let G;if(r.call(L,"deterministic")&&(G=L.deterministic,typeof G!="boolean"&&typeof G!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return G===void 0?!0:G}function P(L,G){let H;if(r.call(L,G)&&(H=L[G],typeof H!="boolean"))throw new TypeError(`The "${G}" argument must be of type boolean`);return H===void 0?!0:H}function E(L,G){let H;if(r.call(L,G)){if(H=L[G],typeof H!="number")throw new TypeError(`The "${G}" argument must be of type number`);if(!Number.isInteger(H))throw new TypeError(`The "${G}" argument must be an integer`);if(H<1)throw new RangeError(`The "${G}" argument must be >= 1`)}return H===void 0?1/0:H}function M(L){return L===1?"1 item":`${L} items`}function z(L){let G=new Set;for(let H of L)(typeof H=="string"||typeof H=="number")&&G.add(String(H));return G}function Q(L){if(r.call(L,"strict")){let G=L.strict;if(typeof G!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(G)return H=>{let j=`Object can not safely be stringified. Received type ${typeof H}`;throw typeof H!="function"&&(j+=` (${H.toString()})`),new Error(j)}}}function F(L){L={...L};let G=Q(L);G&&(L.bigint===void 0&&(L.bigint=!1),"circularValue"in L||(L.circularValue=Error));let H=l(L),j=P(L,"bigint"),re=g(L),W=typeof re=="function"?re:void 0,pe=E(L,"maximumDepth"),$=E(L,"maximumBreadth");function B(ue,k,q,X,ye,d){let _=k[ue];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(ue)),_=X.call(k,ue,_),typeof _){case"string":return o(_);case"object":{if(_===null)return"null";if(q.indexOf(_)!==-1)return H;let I="",U=",",R=d;if(Array.isArray(_)){if(_.length===0)return"[]";if(pe<q.length+1)return'"[Array]"';q.push(_),ye!==""&&(d+=ye,I+=`
31
31
  ${d}`,U=`,
32
32
  ${d}`);let A=Math.min(_.length,$),v=0;for(;v<A-1;v++){let x=B(String(v),_,q,X,ye,d);I+=x!==void 0?x:"null",I+=U}let b=B(String(v),_,q,X,ye,d);if(I+=b!==void 0?b:"null",_.length-1>$){let x=_.length-$-1;I+=`${U}"... ${M(x)} not stringified"`}return ye!==""&&(I+=`
33
33
  ${R}`),q.pop(),`[${I}]`}let S=Object.keys(_),h=S.length;if(h===0)return"{}";if(pe<q.length+1)return'"[Object]"';let T="",w="";ye!==""&&(d+=ye,U=`,
@@ -45,20 +45,20 @@ ${ye}`,u=Math.min(k.length,$),A=0;for(;A<u-1;A++){let b=Z(String(A),k[A],q,X,ye)
45
45
  ${d}`,q.pop(),`[${T}]`}let _=Object.keys(k),I=_.length;if(I===0)return"{}";if(pe<q.length+1)return'"[Object]"';ye+=X;let U=`,
46
46
  ${ye}`,R="",S="",h=Math.min(I,$);c(k)&&(R+=f(k,U,$),_=_.slice(k.length),h-=k.length,S=U),re&&(_=s(_,W)),q.push(k);for(let T=0;T<h;T++){let w=_[T],u=Z(w,k[w],q,X,ye);u!==void 0&&(R+=`${S}${o(w)}: ${u}`,S=U)}if(I>$){let T=I-$;R+=`${S}"...": "${M(T)} not stringified"`,S=U}return S!==""&&(R=`
47
47
  ${ye}${R}
48
- ${d}`),q.pop(),`{${R}}`}case"number":return isFinite(k)?String(k):G?G(k):"null";case"boolean":return k===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(k);default:return G?G(k):void 0}}function se(ue,k,q){switch(typeof k){case"string":return o(k);case"object":{if(k===null)return"null";if(typeof k.toJSON=="function"){if(k=k.toJSON(ue),typeof k!="object")return se(ue,k,q);if(k===null)return"null"}if(q.indexOf(k)!==-1)return H;let X="",ye=k.length!==void 0;if(ye&&Array.isArray(k)){if(k.length===0)return"[]";if(pe<q.length+1)return'"[Array]"';q.push(k);let R=Math.min(k.length,$),S=0;for(;S<R-1;S++){let T=se(String(S),k[S],q);X+=T!==void 0?T:"null",X+=","}let h=se(String(S),k[S],q);if(X+=h!==void 0?h:"null",k.length-1>$){let T=k.length-$-1;X+=`,"... ${M(T)} not stringified"`}return q.pop(),`[${X}]`}let d=Object.keys(k),_=d.length;if(_===0)return"{}";if(pe<q.length+1)return'"[Object]"';let I="",U=Math.min(_,$);ye&&c(k)&&(X+=f(k,",",$),d=d.slice(k.length),U-=k.length,I=","),re&&(d=s(d,W)),q.push(k);for(let R=0;R<U;R++){let S=d[R],h=se(S,k[S],q);h!==void 0&&(X+=`${I}${o(S)}:${h}`,I=",")}if(_>$){let R=_-$;X+=`${I}"...":"${M(R)} not stringified"`}return q.pop(),`{${X}}`}case"number":return isFinite(k)?String(k):G?G(k):"null";case"boolean":return k===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(k);default:return G?G(k):void 0}}function Y(ue,k,q){if(arguments.length>1){let X="";if(typeof q=="number"?X=" ".repeat(Math.min(q,10)):typeof q=="string"&&(X=q.slice(0,10)),k!=null){if(typeof k=="function")return B("",{"":ue},[],k,X,"");if(Array.isArray(k))return D("",ue,[],z(k),X,"")}if(X.length!==0)return Z("",ue,[],X,"")}return se("",ue,[])}return Y}}}),Un=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/guard.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IsValueType=e.IsSymbol=e.IsFunction=e.IsString=e.IsBigInt=e.IsInteger=e.IsNumber=e.IsBoolean=e.IsNull=e.IsUndefined=e.IsArray=e.IsObject=e.IsPlainObject=e.HasPropertyKey=e.IsDate=e.IsUint8Array=e.IsPromise=e.IsTypedArray=e.IsIterator=e.IsAsyncIterator=void 0;function t(j){return f(j)&&Symbol.asyncIterator in j}e.IsAsyncIterator=t;function r(j){return f(j)&&Symbol.iterator in j}e.IsIterator=r;function n(j){return ArrayBuffer.isView(j)}e.IsTypedArray=n;function i(j){return j instanceof Promise}e.IsPromise=i;function o(j){return j instanceof Uint8Array}e.IsUint8Array=o;function s(j){return j instanceof Date&&Number.isFinite(j.getTime())}e.IsDate=s;function a(j,re){return re in j}e.HasPropertyKey=a;function c(j){return f(j)&&L(j.constructor)&&j.constructor.name==="Object"}e.IsPlainObject=c;function f(j){return j!==null&&typeof j=="object"}e.IsObject=f;function l(j){return Array.isArray(j)&&!ArrayBuffer.isView(j)}e.IsArray=l;function g(j){return j===void 0}e.IsUndefined=g;function P(j){return j===null}e.IsNull=P;function E(j){return typeof j=="boolean"}e.IsBoolean=E;function M(j){return typeof j=="number"}e.IsNumber=M;function z(j){return M(j)&&Number.isInteger(j)}e.IsInteger=z;function Q(j){return typeof j=="bigint"}e.IsBigInt=Q;function F(j){return typeof j=="string"}e.IsString=F;function L(j){return typeof j=="function"}e.IsFunction=L;function G(j){return typeof j=="symbol"}e.IsSymbol=G;function H(j){return Q(j)||E(j)||P(j)||M(j)||F(j)||G(j)||g(j)}e.IsValueType=H}}),Sd=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/system.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultErrorFunction=e.TypeSystemPolicy=e.TypeSystemErrorFunction=e.TypeSystem=e.TypeSystemDuplicateFormat=e.TypeSystemDuplicateTypeKind=void 0;var t=Un(),r=ns(),n=dr(),i=class extends n.TypeBoxError{constructor(l){super(`Duplicate type kind '${l}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var o=class extends n.TypeBoxError{constructor(l){super(`Duplicate string format '${l}' detected`)}};e.TypeSystemDuplicateFormat=o;var s;(function(l){function g(E,M){if(n.TypeRegistry.Has(E))throw new i(E);return n.TypeRegistry.Set(E,M),(z={})=>n.Type.Unsafe({...z,[n.Kind]:E})}l.Type=g;function P(E,M){if(n.FormatRegistry.Has(E))throw new o(E);return n.FormatRegistry.Set(E,M),E}l.Format=P})(s||(e.TypeSystem=s={}));var a;(function(l){let g=f;function P(){g=f}l.Reset=P;function E(z){g=z}l.Set=E;function M(){return g}l.Get=M})(a||(e.TypeSystemErrorFunction=a={}));var c;(function(l){l.ExactOptionalPropertyTypes=!1,l.AllowArrayObject=!1,l.AllowNaN=!1,l.AllowNullVoid=!1;function g(Q,F){return l.ExactOptionalPropertyTypes?F in Q:Q[F]!==void 0}l.IsExactOptionalProperty=g;function P(Q){let F=(0,t.IsObject)(Q);return l.AllowArrayObject?F:F&&!(0,t.IsArray)(Q)}l.IsObjectLike=P;function E(Q){return P(Q)&&!(Q instanceof Date)&&!(Q instanceof Uint8Array)}l.IsRecordLike=E;function M(Q){let F=(0,t.IsNumber)(Q);return l.AllowNaN?F:F&&Number.isFinite(Q)}l.IsNumberLike=M;function z(Q){let F=(0,t.IsUndefined)(Q);return l.AllowNullVoid?F||Q===null:F}l.IsVoidLike=z})(c||(e.TypeSystemPolicy=c={}));function f(l,g){switch(g){case r.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case r.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${l.maxContains} matching values`;case r.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${l.minContains} matching values`;case r.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${l.maxItems}`;case r.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${l.minItems}`;case r.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case r.ValueErrorType.Array:return"Expected array";case r.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case r.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${l.exclusiveMaximum}`;case r.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${l.exclusiveMinimum}`;case r.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${l.maximum}`;case r.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${l.minimum}`;case r.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${l.multipleOf}`;case r.ValueErrorType.BigInt:return"Expected bigint";case r.ValueErrorType.Boolean:return"Expected boolean";case r.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${l.exclusiveMinimumTimestamp}`;case r.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${l.exclusiveMaximumTimestamp}`;case r.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${l.minimumTimestamp}`;case r.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${l.maximumTimestamp}`;case r.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${l.multipleOfTimestamp}`;case r.ValueErrorType.Date:return"Expected Date";case r.ValueErrorType.Function:return"Expected function";case r.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${l.exclusiveMaximum}`;case r.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${l.exclusiveMinimum}`;case r.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${l.maximum}`;case r.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${l.minimum}`;case r.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${l.multipleOf}`;case r.ValueErrorType.Integer:return"Expected integer";case r.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case r.ValueErrorType.Intersect:return"Expected all values to match";case r.ValueErrorType.Iterator:return"Expected Iterator";case r.ValueErrorType.Literal:return`Expected ${typeof l.const=="string"?`'${l.const}'`:l.const}`;case r.ValueErrorType.Never:return"Never";case r.ValueErrorType.Not:return"Value should not match";case r.ValueErrorType.Null:return"Expected null";case r.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${l.exclusiveMaximum}`;case r.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${l.exclusiveMinimum}`;case r.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${l.maximum}`;case r.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${l.minimum}`;case r.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${l.multipleOf}`;case r.ValueErrorType.Number:return"Expected number";case r.ValueErrorType.Object:return"Expected object";case r.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case r.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${l.maxProperties} properties`;case r.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${l.minProperties} properties`;case r.ValueErrorType.ObjectRequiredProperty:return"Required property";case r.ValueErrorType.Promise:return"Expected Promise";case r.ValueErrorType.StringFormatUnknown:return`Unknown format '${l.format}'`;case r.ValueErrorType.StringFormat:return`Expected string to match '${l.format}' format`;case r.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${l.maxLength}`;case r.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${l.minLength}`;case r.ValueErrorType.StringPattern:return`Expected string to match '${l.pattern}'`;case r.ValueErrorType.String:return"Expected string";case r.ValueErrorType.Symbol:return"Expected symbol";case r.ValueErrorType.TupleLength:return`Expected tuple to have ${l.maxItems||0} elements`;case r.ValueErrorType.Tuple:return"Expected tuple";case r.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${l.maxByteLength}`;case r.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${l.minByteLength}`;case r.ValueErrorType.Uint8Array:return"Expected Uint8Array";case r.ValueErrorType.Undefined:return"Expected undefined";case r.ValueErrorType.Union:return"Expected union value";case r.ValueErrorType.Void:return"Expected void";case r.ValueErrorType.Kind:return`Expected kind '${l[n.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=f}}),rs=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/deref.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Deref=e.TypeDereferenceError=void 0;var t=dr(),r=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=r;function n(i,o){let s=o.findIndex(a=>a.$id===i.$ref);if(s===-1)throw new r(i);return o[s]}e.Deref=n}}),Ja=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/hash.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.ByteMarker=e.ValueHashError=void 0;var t=Un(),r=class extends Error{constructor(B){super("Unable to hash value"),this.value=B}};e.ValueHashError=r;var n;(function(B){B[B.Undefined=0]="Undefined",B[B.Null=1]="Null",B[B.Boolean=2]="Boolean",B[B.Number=3]="Number",B[B.String=4]="String",B[B.Object=5]="Object",B[B.Array=6]="Array",B[B.Date=7]="Date",B[B.Uint8Array=8]="Uint8Array",B[B.Symbol=9]="Symbol",B[B.BigInt=10]="BigInt"})(n||(e.ByteMarker=n={}));var i=BigInt("14695981039346656037"),[o,s]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],a=Array.from({length:256}).map((B,D)=>BigInt(D)),c=new Float64Array(1),f=new DataView(c.buffer),l=new Uint8Array(c.buffer);function*g(B){let D=B===0?1:Math.ceil(Math.floor(Math.log2(B)+1)/8);for(let Z=0;Z<D;Z++)yield B>>8*(D-1-Z)&255}function P(B){pe(n.Array);for(let D of B)W(D)}function E(B){pe(n.Boolean),pe(B?1:0)}function M(B){pe(n.BigInt),f.setBigInt64(0,B);for(let D of l)pe(D)}function z(B){pe(n.Date),W(B.getTime())}function Q(B){pe(n.Null)}function F(B){pe(n.Number),f.setFloat64(0,B);for(let D of l)pe(D)}function L(B){pe(n.Object);for(let D of globalThis.Object.keys(B).sort())W(D),W(B[D])}function G(B){pe(n.String);for(let D=0;D<B.length;D++)for(let Z of g(B.charCodeAt(D)))pe(Z)}function H(B){pe(n.Symbol),W(B.description)}function j(B){pe(n.Uint8Array);for(let D=0;D<B.length;D++)pe(B[D])}function re(B){return pe(n.Undefined)}function W(B){if((0,t.IsArray)(B))return P(B);if((0,t.IsBoolean)(B))return E(B);if((0,t.IsBigInt)(B))return M(B);if((0,t.IsDate)(B))return z(B);if((0,t.IsNull)(B))return Q(B);if((0,t.IsNumber)(B))return F(B);if((0,t.IsPlainObject)(B))return L(B);if((0,t.IsString)(B))return G(B);if((0,t.IsSymbol)(B))return H(B);if((0,t.IsUint8Array)(B))return j(B);if((0,t.IsUndefined)(B))return re(B);throw new r(B)}function pe(B){i=i^a[B],i=i*o%s}function $(B){return i=BigInt("14695981039346656037"),W(B),i}e.Hash=$}}),ns=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/errors.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Errors=e.ValueErrorIterator=e.EscapeKey=e.ValueErrorsUnknownTypeError=e.ValueErrorType=void 0;var t=Un(),r=Sd(),n=rs(),i=Ja(),o=dr(),s;(function(u){u[u.ArrayContains=0]="ArrayContains",u[u.ArrayMaxContains=1]="ArrayMaxContains",u[u.ArrayMaxItems=2]="ArrayMaxItems",u[u.ArrayMinContains=3]="ArrayMinContains",u[u.ArrayMinItems=4]="ArrayMinItems",u[u.ArrayUniqueItems=5]="ArrayUniqueItems",u[u.Array=6]="Array",u[u.AsyncIterator=7]="AsyncIterator",u[u.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",u[u.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",u[u.BigIntMaximum=10]="BigIntMaximum",u[u.BigIntMinimum=11]="BigIntMinimum",u[u.BigIntMultipleOf=12]="BigIntMultipleOf",u[u.BigInt=13]="BigInt",u[u.Boolean=14]="Boolean",u[u.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",u[u.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",u[u.DateMaximumTimestamp=17]="DateMaximumTimestamp",u[u.DateMinimumTimestamp=18]="DateMinimumTimestamp",u[u.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",u[u.Date=20]="Date",u[u.Function=21]="Function",u[u.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",u[u.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",u[u.IntegerMaximum=24]="IntegerMaximum",u[u.IntegerMinimum=25]="IntegerMinimum",u[u.IntegerMultipleOf=26]="IntegerMultipleOf",u[u.Integer=27]="Integer",u[u.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",u[u.Intersect=29]="Intersect",u[u.Iterator=30]="Iterator",u[u.Kind=31]="Kind",u[u.Literal=32]="Literal",u[u.Never=33]="Never",u[u.Not=34]="Not",u[u.Null=35]="Null",u[u.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",u[u.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",u[u.NumberMaximum=38]="NumberMaximum",u[u.NumberMinimum=39]="NumberMinimum",u[u.NumberMultipleOf=40]="NumberMultipleOf",u[u.Number=41]="Number",u[u.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",u[u.ObjectMaxProperties=43]="ObjectMaxProperties",u[u.ObjectMinProperties=44]="ObjectMinProperties",u[u.ObjectRequiredProperty=45]="ObjectRequiredProperty",u[u.Object=46]="Object",u[u.Promise=47]="Promise",u[u.StringFormatUnknown=48]="StringFormatUnknown",u[u.StringFormat=49]="StringFormat",u[u.StringMaxLength=50]="StringMaxLength",u[u.StringMinLength=51]="StringMinLength",u[u.StringPattern=52]="StringPattern",u[u.String=53]="String",u[u.Symbol=54]="Symbol",u[u.TupleLength=55]="TupleLength",u[u.Tuple=56]="Tuple",u[u.Uint8ArrayMaxByteLength=57]="Uint8ArrayMaxByteLength",u[u.Uint8ArrayMinByteLength=58]="Uint8ArrayMinByteLength",u[u.Uint8Array=59]="Uint8Array",u[u.Undefined=60]="Undefined",u[u.Union=61]="Union",u[u.Void=62]="Void"})(s||(e.ValueErrorType=s={}));var a=class extends o.TypeBoxError{constructor(u){super("Unknown type"),this.schema=u}};e.ValueErrorsUnknownTypeError=a;function c(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=c;function f(u){return u!==void 0}var l=class{constructor(u){this.iterator=u}[Symbol.iterator](){return this.iterator}First(){let u=this.iterator.next();return u.done?void 0:u.value}};e.ValueErrorIterator=l;function g(u,A,v,b){return{type:u,schema:A,path:v,value:b,message:r.TypeSystemErrorFunction.Get()(A,u)}}function*P(u,A,v,b){}function*E(u,A,v,b){if(!(0,t.IsArray)(b))return yield g(s.Array,u,v,b);f(u.minItems)&&!(b.length>=u.minItems)&&(yield g(s.ArrayMinItems,u,v,b)),f(u.maxItems)&&!(b.length<=u.maxItems)&&(yield g(s.ArrayMaxItems,u,v,b));for(let te=0;te<b.length;te++)yield*T(u.items,A,`${v}/${te}`,b[te]);if(u.uniqueItems===!0&&!function(){let te=new Set;for(let ne of b){let ge=(0,i.Hash)(ne);if(te.has(ge))return!1;te.add(ge)}return!0}()&&(yield g(s.ArrayUniqueItems,u,v,b)),!(f(u.contains)||f(u.minContains)||f(u.maxContains)))return;let x=f(u.contains)?u.contains:o.Type.Never(),K=b.reduce((te,ne,ge)=>T(x,A,`${v}${ge}`,ne).next().done===!0?te+1:te,0);K===0&&(yield g(s.ArrayContains,u,v,b)),(0,t.IsNumber)(u.minContains)&&K<u.minContains&&(yield g(s.ArrayMinContains,u,v,b)),(0,t.IsNumber)(u.maxContains)&&K>u.maxContains&&(yield g(s.ArrayMaxContains,u,v,b))}function*M(u,A,v,b){(0,t.IsAsyncIterator)(b)||(yield g(s.AsyncIterator,u,v,b))}function*z(u,A,v,b){if(!(0,t.IsBigInt)(b))return yield g(s.BigInt,u,v,b);f(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(s.BigIntExclusiveMaximum,u,v,b)),f(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(s.BigIntExclusiveMinimum,u,v,b)),f(u.maximum)&&!(b<=u.maximum)&&(yield g(s.BigIntMaximum,u,v,b)),f(u.minimum)&&!(b>=u.minimum)&&(yield g(s.BigIntMinimum,u,v,b)),f(u.multipleOf)&&b%u.multipleOf!==BigInt(0)&&(yield g(s.BigIntMultipleOf,u,v,b))}function*Q(u,A,v,b){(0,t.IsBoolean)(b)||(yield g(s.Boolean,u,v,b))}function*F(u,A,v,b){yield*T(u.returns,A,v,b.prototype)}function*L(u,A,v,b){if(!(0,t.IsDate)(b))return yield g(s.Date,u,v,b);f(u.exclusiveMaximumTimestamp)&&!(b.getTime()<u.exclusiveMaximumTimestamp)&&(yield g(s.DateExclusiveMaximumTimestamp,u,v,b)),f(u.exclusiveMinimumTimestamp)&&!(b.getTime()>u.exclusiveMinimumTimestamp)&&(yield g(s.DateExclusiveMinimumTimestamp,u,v,b)),f(u.maximumTimestamp)&&!(b.getTime()<=u.maximumTimestamp)&&(yield g(s.DateMaximumTimestamp,u,v,b)),f(u.minimumTimestamp)&&!(b.getTime()>=u.minimumTimestamp)&&(yield g(s.DateMinimumTimestamp,u,v,b)),f(u.multipleOfTimestamp)&&b.getTime()%u.multipleOfTimestamp!==0&&(yield g(s.DateMultipleOfTimestamp,u,v,b))}function*G(u,A,v,b){(0,t.IsFunction)(b)||(yield g(s.Function,u,v,b))}function*H(u,A,v,b){if(!(0,t.IsInteger)(b))return yield g(s.Integer,u,v,b);f(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(s.IntegerExclusiveMaximum,u,v,b)),f(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(s.IntegerExclusiveMinimum,u,v,b)),f(u.maximum)&&!(b<=u.maximum)&&(yield g(s.IntegerMaximum,u,v,b)),f(u.minimum)&&!(b>=u.minimum)&&(yield g(s.IntegerMinimum,u,v,b)),f(u.multipleOf)&&b%u.multipleOf!==0&&(yield g(s.IntegerMultipleOf,u,v,b))}function*j(u,A,v,b){for(let x of u.allOf){let K=T(x,A,v,b).next();K.done||(yield g(s.Intersect,u,v,b),yield K.value)}if(u.unevaluatedProperties===!1){let x=new RegExp(o.KeyResolver.ResolvePattern(u));for(let K of Object.getOwnPropertyNames(b))x.test(K)||(yield g(s.IntersectUnevaluatedProperties,u,`${v}/${K}`,b))}if(typeof u.unevaluatedProperties=="object"){let x=new RegExp(o.KeyResolver.ResolvePattern(u));for(let K of Object.getOwnPropertyNames(b))if(!x.test(K)){let te=T(u.unevaluatedProperties,A,`${v}/${K}`,b[K]).next();te.done||(yield te.value)}}}function*re(u,A,v,b){(0,t.IsIterator)(b)||(yield g(s.Iterator,u,v,b))}function*W(u,A,v,b){b!==u.const&&(yield g(s.Literal,u,v,b))}function*pe(u,A,v,b){yield g(s.Never,u,v,b)}function*$(u,A,v,b){T(u.not,A,v,b).next().done===!0&&(yield g(s.Not,u,v,b))}function*B(u,A,v,b){(0,t.IsNull)(b)||(yield g(s.Null,u,v,b))}function*D(u,A,v,b){if(!r.TypeSystemPolicy.IsNumberLike(b))return yield g(s.Number,u,v,b);f(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(s.NumberExclusiveMaximum,u,v,b)),f(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(s.NumberExclusiveMinimum,u,v,b)),f(u.maximum)&&!(b<=u.maximum)&&(yield g(s.NumberMaximum,u,v,b)),f(u.minimum)&&!(b>=u.minimum)&&(yield g(s.NumberMinimum,u,v,b)),f(u.multipleOf)&&b%u.multipleOf!==0&&(yield g(s.NumberMultipleOf,u,v,b))}function*Z(u,A,v,b){if(!r.TypeSystemPolicy.IsObjectLike(b))return yield g(s.Object,u,v,b);f(u.minProperties)&&!(Object.getOwnPropertyNames(b).length>=u.minProperties)&&(yield g(s.ObjectMinProperties,u,v,b)),f(u.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=u.maxProperties)&&(yield g(s.ObjectMaxProperties,u,v,b));let x=Array.isArray(u.required)?u.required:[],K=Object.getOwnPropertyNames(u.properties),te=Object.getOwnPropertyNames(b);for(let ne of x)te.includes(ne)||(yield g(s.ObjectRequiredProperty,u.properties[ne],`${v}/${c(ne)}`,void 0));if(u.additionalProperties===!1)for(let ne of te)K.includes(ne)||(yield g(s.ObjectAdditionalProperties,u,`${v}/${c(ne)}`,b[ne]));if(typeof u.additionalProperties=="object")for(let ne of te)K.includes(ne)||(yield*T(u.additionalProperties,A,`${v}/${c(ne)}`,b[ne]));for(let ne of K){let ge=u.properties[ne];u.required&&u.required.includes(ne)?(yield*T(ge,A,`${v}/${c(ne)}`,b[ne]),o.ExtendsUndefined.Check(u)&&!(ne in b)&&(yield g(s.ObjectRequiredProperty,ge,`${v}/${c(ne)}`,void 0))):r.TypeSystemPolicy.IsExactOptionalProperty(b,ne)&&(yield*T(ge,A,`${v}/${c(ne)}`,b[ne]))}}function*se(u,A,v,b){(0,t.IsPromise)(b)||(yield g(s.Promise,u,v,b))}function*Y(u,A,v,b){if(!r.TypeSystemPolicy.IsRecordLike(b))return yield g(s.Object,u,v,b);f(u.minProperties)&&!(Object.getOwnPropertyNames(b).length>=u.minProperties)&&(yield g(s.ObjectMinProperties,u,v,b)),f(u.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=u.maxProperties)&&(yield g(s.ObjectMaxProperties,u,v,b));let[x,K]=Object.entries(u.patternProperties)[0],te=new RegExp(x);for(let[ne,ge]of Object.entries(b))te.test(ne)&&(yield*T(K,A,`${v}/${c(ne)}`,ge));if(typeof u.additionalProperties=="object")for(let[ne,ge]of Object.entries(b))te.test(ne)||(yield*T(u.additionalProperties,A,`${v}/${c(ne)}`,ge));if(u.additionalProperties===!1){for(let[ne,ge]of Object.entries(b))if(!te.test(ne))return yield g(s.ObjectAdditionalProperties,u,`${v}/${c(ne)}`,ge)}}function*ue(u,A,v,b){yield*T((0,n.Deref)(u,A),A,v,b)}function*k(u,A,v,b){if(!(0,t.IsString)(b))return yield g(s.String,u,v,b);f(u.minLength)&&!(b.length>=u.minLength)&&(yield g(s.StringMinLength,u,v,b)),f(u.maxLength)&&!(b.length<=u.maxLength)&&(yield g(s.StringMaxLength,u,v,b)),(0,t.IsString)(u.pattern)&&(new RegExp(u.pattern).test(b)||(yield g(s.StringPattern,u,v,b))),(0,t.IsString)(u.format)&&(o.FormatRegistry.Has(u.format)?o.FormatRegistry.Get(u.format)(b)||(yield g(s.StringFormat,u,v,b)):yield g(s.StringFormatUnknown,u,v,b))}function*q(u,A,v,b){(0,t.IsSymbol)(b)||(yield g(s.Symbol,u,v,b))}function*X(u,A,v,b){if(!(0,t.IsString)(b))return yield g(s.String,u,v,b);new RegExp(u.pattern).test(b)||(yield g(s.StringPattern,u,v,b))}function*ye(u,A,v,b){yield*T((0,n.Deref)(u,A),A,v,b)}function*d(u,A,v,b){if(!(0,t.IsArray)(b))return yield g(s.Tuple,u,v,b);if(u.items===void 0&&b.length!==0)return yield g(s.TupleLength,u,v,b);if(b.length!==u.maxItems)return yield g(s.TupleLength,u,v,b);if(u.items)for(let x=0;x<u.items.length;x++)yield*T(u.items[x],A,`${v}/${x}`,b[x])}function*_(u,A,v,b){(0,t.IsUndefined)(b)||(yield g(s.Undefined,u,v,b))}function*I(u,A,v,b){let x=0;for(let K of u.anyOf){let te=[...T(K,A,v,b)];if(te.length===0)return;x+=te.length}x>0&&(yield g(s.Union,u,v,b))}function*U(u,A,v,b){if(!(0,t.IsUint8Array)(b))return yield g(s.Uint8Array,u,v,b);f(u.maxByteLength)&&!(b.length<=u.maxByteLength)&&(yield g(s.Uint8ArrayMaxByteLength,u,v,b)),f(u.minByteLength)&&!(b.length>=u.minByteLength)&&(yield g(s.Uint8ArrayMinByteLength,u,v,b))}function*R(u,A,v,b){}function*S(u,A,v,b){r.TypeSystemPolicy.IsVoidLike(b)||(yield g(s.Void,u,v,b))}function*h(u,A,v,b){o.TypeRegistry.Get(u[o.Kind])(u,b)||(yield g(s.Kind,u,v,b))}function*T(u,A,v,b){let x=f(u.$id)?[...A,u]:A,K=u;switch(K[o.Kind]){case"Any":return yield*P(K,x,v,b);case"Array":return yield*E(K,x,v,b);case"AsyncIterator":return yield*M(K,x,v,b);case"BigInt":return yield*z(K,x,v,b);case"Boolean":return yield*Q(K,x,v,b);case"Constructor":return yield*F(K,x,v,b);case"Date":return yield*L(K,x,v,b);case"Function":return yield*G(K,x,v,b);case"Integer":return yield*H(K,x,v,b);case"Intersect":return yield*j(K,x,v,b);case"Iterator":return yield*re(K,x,v,b);case"Literal":return yield*W(K,x,v,b);case"Never":return yield*pe(K,x,v,b);case"Not":return yield*$(K,x,v,b);case"Null":return yield*B(K,x,v,b);case"Number":return yield*D(K,x,v,b);case"Object":return yield*Z(K,x,v,b);case"Promise":return yield*se(K,x,v,b);case"Record":return yield*Y(K,x,v,b);case"Ref":return yield*ue(K,x,v,b);case"String":return yield*k(K,x,v,b);case"Symbol":return yield*q(K,x,v,b);case"TemplateLiteral":return yield*X(K,x,v,b);case"This":return yield*ye(K,x,v,b);case"Tuple":return yield*d(K,x,v,b);case"Undefined":return yield*_(K,x,v,b);case"Union":return yield*I(K,x,v,b);case"Uint8Array":return yield*U(K,x,v,b);case"Unknown":return yield*R(K,x,v,b);case"Void":return yield*S(K,x,v,b);default:if(!o.TypeRegistry.Has(K[o.Kind]))throw new a(u);return yield*h(K,x,v,b)}}function w(...u){let A=u.length===3?T(u[0],u[1],"",u[2]):T(u[0],[],"",u[1]);return new l(A)}e.Errors=w}}),Ym=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(n,i,o,s){s===void 0&&(s=o);var a=Object.getOwnPropertyDescriptor(i,o);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,s,a)}:function(n,i,o,s){s===void 0&&(s=o),n[s]=i[o]}),r=e&&e.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(ns(),e)}}),xd=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,o,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(o,s);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,a,c)}:function(i,o,s,a){a===void 0&&(a=s),i[a]=o[s]}),r=e&&e.__exportStar||function(i,o){for(var s in i)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,i,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var n=ns();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(Sd(),e)}}),Qm=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/check.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Check=e.ValueCheckUnknownTypeError=void 0;var t=Un(),r=xd(),n=rs(),i=Ja(),o=dr(),s=class extends o.TypeBoxError{constructor(h){super("Unknown type"),this.schema=h}};e.ValueCheckUnknownTypeError=s;function a(h){return h[o.Kind]==="Any"||h[o.Kind]==="Unknown"}function c(h){return h!==void 0}function f(h,T,w){return!0}function l(h,T,w){if(!(0,t.IsArray)(w)||c(h.minItems)&&!(w.length>=h.minItems)||c(h.maxItems)&&!(w.length<=h.maxItems)||!w.every(v=>R(h.items,T,v))||h.uniqueItems===!0&&!function(){let v=new Set;for(let b of w){let x=(0,i.Hash)(b);if(v.has(x))return!1;v.add(x)}return!0}())return!1;if(!(c(h.contains)||(0,t.IsNumber)(h.minContains)||(0,t.IsNumber)(h.maxContains)))return!0;let u=c(h.contains)?h.contains:o.Type.Never(),A=w.reduce((v,b)=>R(u,T,b)?v+1:v,0);return!(A===0||(0,t.IsNumber)(h.minContains)&&A<h.minContains||(0,t.IsNumber)(h.maxContains)&&A>h.maxContains)}function g(h,T,w){return(0,t.IsAsyncIterator)(w)}function P(h,T,w){return!(!(0,t.IsBigInt)(w)||c(h.exclusiveMaximum)&&!(w<h.exclusiveMaximum)||c(h.exclusiveMinimum)&&!(w>h.exclusiveMinimum)||c(h.maximum)&&!(w<=h.maximum)||c(h.minimum)&&!(w>=h.minimum)||c(h.multipleOf)&&w%h.multipleOf!==BigInt(0))}function E(h,T,w){return(0,t.IsBoolean)(w)}function M(h,T,w){return R(h.returns,T,w.prototype)}function z(h,T,w){return!(!(0,t.IsDate)(w)||c(h.exclusiveMaximumTimestamp)&&!(w.getTime()<h.exclusiveMaximumTimestamp)||c(h.exclusiveMinimumTimestamp)&&!(w.getTime()>h.exclusiveMinimumTimestamp)||c(h.maximumTimestamp)&&!(w.getTime()<=h.maximumTimestamp)||c(h.minimumTimestamp)&&!(w.getTime()>=h.minimumTimestamp)||c(h.multipleOfTimestamp)&&w.getTime()%h.multipleOfTimestamp!==0)}function Q(h,T,w){return(0,t.IsFunction)(w)}function F(h,T,w){return!(!(0,t.IsInteger)(w)||c(h.exclusiveMaximum)&&!(w<h.exclusiveMaximum)||c(h.exclusiveMinimum)&&!(w>h.exclusiveMinimum)||c(h.maximum)&&!(w<=h.maximum)||c(h.minimum)&&!(w>=h.minimum)||c(h.multipleOf)&&w%h.multipleOf!==0)}function L(h,T,w){let u=h.allOf.every(A=>R(A,T,w));if(h.unevaluatedProperties===!1){let A=new RegExp(o.KeyResolver.ResolvePattern(h)),v=Object.getOwnPropertyNames(w).every(b=>A.test(b));return u&&v}else if(o.TypeGuard.TSchema(h.unevaluatedProperties)){let A=new RegExp(o.KeyResolver.ResolvePattern(h)),v=Object.getOwnPropertyNames(w).every(b=>A.test(b)||R(h.unevaluatedProperties,T,w[b]));return u&&v}else return u}function G(h,T,w){return(0,t.IsIterator)(w)}function H(h,T,w){return w===h.const}function j(h,T,w){return!1}function re(h,T,w){return!R(h.not,T,w)}function W(h,T,w){return(0,t.IsNull)(w)}function pe(h,T,w){return!(!r.TypeSystemPolicy.IsNumberLike(w)||c(h.exclusiveMaximum)&&!(w<h.exclusiveMaximum)||c(h.exclusiveMinimum)&&!(w>h.exclusiveMinimum)||c(h.minimum)&&!(w>=h.minimum)||c(h.maximum)&&!(w<=h.maximum)||c(h.multipleOf)&&w%h.multipleOf!==0)}function $(h,T,w){if(!r.TypeSystemPolicy.IsObjectLike(w)||c(h.minProperties)&&!(Object.getOwnPropertyNames(w).length>=h.minProperties)||c(h.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=h.maxProperties))return!1;let u=Object.getOwnPropertyNames(h.properties);for(let A of u){let v=h.properties[A];if(h.required&&h.required.includes(A)){if(!R(v,T,w[A])||(o.ExtendsUndefined.Check(v)||a(v))&&!(A in w))return!1}else if(r.TypeSystemPolicy.IsExactOptionalProperty(w,A)&&!R(v,T,w[A]))return!1}if(h.additionalProperties===!1){let A=Object.getOwnPropertyNames(w);return h.required&&h.required.length===u.length&&A.length===u.length?!0:A.every(v=>u.includes(v))}else return typeof h.additionalProperties=="object"?Object.getOwnPropertyNames(w).every(v=>u.includes(v)||R(h.additionalProperties,T,w[v])):!0}function B(h,T,w){return(0,t.IsPromise)(w)}function D(h,T,w){if(!r.TypeSystemPolicy.IsRecordLike(w)||c(h.minProperties)&&!(Object.getOwnPropertyNames(w).length>=h.minProperties)||c(h.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=h.maxProperties))return!1;let[u,A]=Object.entries(h.patternProperties)[0],v=new RegExp(u),b=Object.entries(w).every(([te,ne])=>v.test(te)?R(A,T,ne):!0),x=typeof h.additionalProperties=="object"?Object.entries(w).every(([te,ne])=>v.test(te)?!0:R(h.additionalProperties,T,ne)):!0,K=h.additionalProperties===!1?Object.getOwnPropertyNames(w).every(te=>v.test(te)):!0;return b&&x&&K}function Z(h,T,w){return R((0,n.Deref)(h,T),T,w)}function se(h,T,w){return!(0,t.IsString)(w)||c(h.minLength)&&!(w.length>=h.minLength)||c(h.maxLength)&&!(w.length<=h.maxLength)||c(h.pattern)&&!new RegExp(h.pattern).test(w)?!1:c(h.format)?o.FormatRegistry.Has(h.format)?o.FormatRegistry.Get(h.format)(w):!1:!0}function Y(h,T,w){return(0,t.IsSymbol)(w)}function ue(h,T,w){return(0,t.IsString)(w)&&new RegExp(h.pattern).test(w)}function k(h,T,w){return R((0,n.Deref)(h,T),T,w)}function q(h,T,w){if(!(0,t.IsArray)(w)||h.items===void 0&&w.length!==0||w.length!==h.maxItems)return!1;if(!h.items)return!0;for(let u=0;u<h.items.length;u++)if(!R(h.items[u],T,w[u]))return!1;return!0}function X(h,T,w){return(0,t.IsUndefined)(w)}function ye(h,T,w){return h.anyOf.some(u=>R(u,T,w))}function d(h,T,w){return!(!(0,t.IsUint8Array)(w)||c(h.maxByteLength)&&!(w.length<=h.maxByteLength)||c(h.minByteLength)&&!(w.length>=h.minByteLength))}function _(h,T,w){return!0}function I(h,T,w){return r.TypeSystemPolicy.IsVoidLike(w)}function U(h,T,w){return o.TypeRegistry.Has(h[o.Kind])?o.TypeRegistry.Get(h[o.Kind])(h,w):!1}function R(h,T,w){let u=c(h.$id)?[...T,h]:T,A=h;switch(A[o.Kind]){case"Any":return f(A,u,w);case"Array":return l(A,u,w);case"AsyncIterator":return g(A,u,w);case"BigInt":return P(A,u,w);case"Boolean":return E(A,u,w);case"Constructor":return M(A,u,w);case"Date":return z(A,u,w);case"Function":return Q(A,u,w);case"Integer":return F(A,u,w);case"Intersect":return L(A,u,w);case"Iterator":return G(A,u,w);case"Literal":return H(A,u,w);case"Never":return j(A,u,w);case"Not":return re(A,u,w);case"Null":return W(A,u,w);case"Number":return pe(A,u,w);case"Object":return $(A,u,w);case"Promise":return B(A,u,w);case"Record":return D(A,u,w);case"Ref":return Z(A,u,w);case"String":return se(A,u,w);case"Symbol":return Y(A,u,w);case"TemplateLiteral":return ue(A,u,w);case"This":return k(A,u,w);case"Tuple":return q(A,u,w);case"Undefined":return X(A,u,w);case"Union":return ye(A,u,w);case"Uint8Array":return d(A,u,w);case"Unknown":return _(A,u,w);case"Void":return I(A,u,w);default:if(!o.TypeRegistry.Has(A[o.Kind]))throw new s(A);return U(A,u,w)}}function S(...h){return h.length===3?R(h[0],h[1],h[2]):R(h[0],[],h[1])}e.Check=S}}),Zm=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/transform.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodeTransform=e.DecodeTransform=e.HasTransform=e.TransformEncodeError=e.TransformDecodeError=e.TransformEncodeCheckError=e.TransformDecodeCheckError=void 0;var t=Un(),r=rs(),n=Qm(),i=dr(),o=class extends i.TypeBoxError{constructor(P,E,M){super("Unable to decode due to invalid value"),this.schema=P,this.value=E,this.error=M}};e.TransformDecodeCheckError=o;var s=class extends i.TypeBoxError{constructor(P,E,M){super("Unable to encode due to invalid value"),this.schema=P,this.value=E,this.error=M}};e.TransformEncodeCheckError=s;var a=class extends i.TypeBoxError{constructor(P,E,M){super(`${M instanceof Error?M.message:"Unknown error"}`),this.schema=P,this.value=E}};e.TransformDecodeError=a;var c=class extends i.TypeBoxError{constructor(P,E,M){super(`${M instanceof Error?M.message:"Unknown error"}`),this.schema=P,this.value=E}};e.TransformEncodeError=c;var f;(function(P){function E(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.items,ue)}function M(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.items,ue)}function z(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.returns,ue)||Y.parameters.some(k=>D(k,ue))}function Q(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.returns,ue)||Y.parameters.some(k=>D(k,ue))}function F(Y,ue){return i.TypeGuard.TTransform(Y)||i.TypeGuard.TTransform(Y.unevaluatedProperties)||Y.allOf.some(k=>D(k,ue))}function L(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.items,ue)}function G(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.not,ue)}function H(Y,ue){return i.TypeGuard.TTransform(Y)||Object.values(Y.properties).some(k=>D(k,ue))||i.TypeGuard.TSchema(Y.additionalProperties)&&D(Y.additionalProperties,ue)}function j(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.item,ue)}function re(Y,ue){let k=Object.getOwnPropertyNames(Y.patternProperties)[0],q=Y.patternProperties[k];return i.TypeGuard.TTransform(Y)||D(q,ue)||i.TypeGuard.TSchema(Y.additionalProperties)&&i.TypeGuard.TTransform(Y.additionalProperties)}function W(Y,ue){return i.TypeGuard.TTransform(Y)?!0:D((0,r.Deref)(Y,ue),ue)}function pe(Y,ue){return i.TypeGuard.TTransform(Y)?!0:D((0,r.Deref)(Y,ue),ue)}function $(Y,ue){return i.TypeGuard.TTransform(Y)||!(0,t.IsUndefined)(Y.items)&&Y.items.some(k=>D(k,ue))}function B(Y,ue){return i.TypeGuard.TTransform(Y)||Y.anyOf.some(k=>D(k,ue))}function D(Y,ue){let k=(0,t.IsString)(Y.$id)?[...ue,Y]:ue,q=Y;if(Y.$id&&Z.has(Y.$id))return!1;switch(Y.$id&&Z.add(Y.$id),Y[i.Kind]){case"Array":return E(q,k);case"AsyncIterator":return M(q,k);case"Constructor":return z(q,k);case"Function":return Q(q,k);case"Intersect":return F(q,k);case"Iterator":return L(q,k);case"Not":return G(q,k);case"Object":return H(q,k);case"Promise":return j(q,k);case"Record":return re(q,k);case"Ref":return W(q,k);case"This":return pe(q,k);case"Tuple":return $(q,k);case"Union":return B(q,k);default:return i.TypeGuard.TTransform(Y)}}let Z=new Set;function se(Y,ue){return Z.clear(),D(Y,ue)}P.Has=se})(f||(e.HasTransform=f={}));var l;(function(P){function E($,B){try{return i.TypeGuard.TTransform($)?$[i.Transform].Decode(B):B}catch(D){throw new a($,B,D)}}function M($,B,D){return(0,t.IsArray)(D)?E($,D.map(Z=>W($.items,B,Z))):E($,D)}function z($,B,D){if(!(0,t.IsPlainObject)(D)||(0,t.IsValueType)(D))return E($,D);let Z=i.KeyResolver.ResolveKeys($,{includePatterns:!1}),se=Z.reduce((q,X)=>X in q?{...q,[X]:W(i.IndexedAccessor.Resolve($,[X]),B,q[X])}:q,D);if(!i.TypeGuard.TTransform($.unevaluatedProperties))return E($,se);let Y=Object.getOwnPropertyNames(se),ue=$.unevaluatedProperties,k=Y.reduce((q,X)=>Z.includes(X)?q:{...q,[X]:E(ue,q[X])},se);return E($,k)}function Q($,B,D){return E($,W($.not,B,D))}function F($,B,D){if(!(0,t.IsPlainObject)(D))return E($,D);let Z=i.KeyResolver.ResolveKeys($,{includePatterns:!1}),se=Z.reduce((q,X)=>X in q?{...q,[X]:W($.properties[X],B,q[X])}:q,D);if(!i.TypeGuard.TSchema($.additionalProperties))return E($,se);let Y=Object.getOwnPropertyNames(se),ue=$.additionalProperties,k=Y.reduce((q,X)=>Z.includes(X)?q:{...q,[X]:E(ue,q[X])},se);return E($,k)}function L($,B,D){if(!(0,t.IsPlainObject)(D))return E($,D);let Z=Object.getOwnPropertyNames($.patternProperties)[0],se=new RegExp(Z),Y=Object.getOwnPropertyNames(D).reduce((X,ye)=>se.test(ye)?{...X,[ye]:W($.patternProperties[Z],B,X[ye])}:X,D);if(!i.TypeGuard.TSchema($.additionalProperties))return E($,Y);let ue=Object.getOwnPropertyNames(Y),k=$.additionalProperties,q=ue.reduce((X,ye)=>se.test(ye)?X:{...X,[ye]:E(k,X[ye])},Y);return E($,q)}function G($,B,D){let Z=(0,r.Deref)($,B);return E($,W(Z,B,D))}function H($,B,D){let Z=(0,r.Deref)($,B);return E($,W(Z,B,D))}function j($,B,D){return(0,t.IsArray)(D)&&(0,t.IsArray)($.items)?E($,$.items.map((Z,se)=>W(Z,B,D[se]))):E($,D)}function re($,B,D){let Z=E($,D);for(let se of $.anyOf)if((0,n.Check)(se,B,Z))return W(se,B,Z);return Z}function W($,B,D){let Z=typeof $.$id=="string"?[...B,$]:B,se=$;switch($[i.Kind]){case"Array":return M(se,Z,D);case"Intersect":return z(se,Z,D);case"Not":return Q(se,Z,D);case"Object":return F(se,Z,D);case"Record":return L(se,Z,D);case"Ref":return G(se,Z,D);case"Symbol":return E(se,D);case"This":return H(se,Z,D);case"Tuple":return j(se,Z,D);case"Union":return re(se,Z,D);default:return E(se,D)}}function pe($,B,D){return W($,B,D)}P.Decode=pe})(l||(e.DecodeTransform=l={}));var g;(function(P){function E($,B){try{return i.TypeGuard.TTransform($)?$[i.Transform].Encode(B):B}catch(D){throw new c($,B,D)}}function M($,B,D){let Z=E($,D);return(0,t.IsArray)(Z)?Z.map(se=>W($.items,B,se)):Z}function z($,B,D){let Z=E($,D);if(!(0,t.IsPlainObject)(D)||(0,t.IsValueType)(D))return Z;let se=i.KeyResolver.ResolveKeys($,{includePatterns:!1}),Y=se.reduce((q,X)=>X in Z?{...q,[X]:W(i.IndexedAccessor.Resolve($,[X]),B,q[X])}:q,Z);if(!i.TypeGuard.TTransform($.unevaluatedProperties))return E($,Y);let ue=Object.getOwnPropertyNames(Y),k=$.unevaluatedProperties;return ue.reduce((q,X)=>se.includes(X)?q:{...q,[X]:E(k,q[X])},Y)}function Q($,B,D){return E($.not,E($,D))}function F($,B,D){let Z=E($,D);if(!(0,t.IsPlainObject)(D))return Z;let se=i.KeyResolver.ResolveKeys($,{includePatterns:!1}),Y=se.reduce((q,X)=>X in q?{...q,[X]:W($.properties[X],B,q[X])}:q,Z);if(!i.TypeGuard.TSchema($.additionalProperties))return Y;let ue=Object.getOwnPropertyNames(Y),k=$.additionalProperties;return ue.reduce((q,X)=>se.includes(X)?q:{...q,[X]:E(k,q[X])},Y)}function L($,B,D){let Z=E($,D);if(!(0,t.IsPlainObject)(D))return Z;let se=Object.getOwnPropertyNames($.patternProperties)[0],Y=new RegExp(se),ue=Object.getOwnPropertyNames(D).reduce((X,ye)=>Y.test(ye)?{...X,[ye]:W($.patternProperties[se],B,X[ye])}:X,Z);if(!i.TypeGuard.TSchema($.additionalProperties))return E($,ue);let k=Object.getOwnPropertyNames(ue),q=$.additionalProperties;return k.reduce((X,ye)=>Y.test(ye)?X:{...X,[ye]:E(q,X[ye])},ue)}function G($,B,D){let Z=(0,r.Deref)($,B),se=W(Z,B,D);return E($,se)}function H($,B,D){let Z=(0,r.Deref)($,B),se=W(Z,B,D);return E($,se)}function j($,B,D){let Z=E($,D);return(0,t.IsArray)($.items)?$.items.map((se,Y)=>W(se,B,Z[Y])):[]}function re($,B,D){for(let Z of $.anyOf){if(!(0,n.Check)(Z,B,D))continue;let se=W(Z,B,D);return E($,se)}for(let Z of $.anyOf){let se=W(Z,B,D);if((0,n.Check)($,B,se))return E($,se)}return E($,D)}function W($,B,D){let Z=typeof $.$id=="string"?[...B,$]:B,se=$;switch($[i.Kind]){case"Array":return M(se,Z,D);case"Intersect":return z(se,Z,D);case"Not":return Q(se,Z,D);case"Object":return F(se,Z,D);case"Record":return L(se,Z,D);case"Ref":return G(se,Z,D);case"This":return H(se,Z,D);case"Tuple":return j(se,Z,D);case"Union":return re(se,Z,D);default:return E(se,D)}}function pe($,B,D){return W($,B,D)}P.Encode=pe})(g||(e.EncodeTransform=g={}))}}),eb=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/compiler.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeCompiler=e.Policy=e.TypeCompilerTypeGuardError=e.TypeCompilerUnknownTypeError=e.TypeCheck=void 0;var t=Zm(),r=Un(),n=ns(),i=xd(),o=rs(),s=Ja(),a=dr(),c=class{constructor(F,L,G,H){this.schema=F,this.references=L,this.checkFunc=G,this.code=H,this.hasTransform=t.HasTransform.Has(F,L)}Code(){return this.code}Errors(F){return(0,n.Errors)(this.schema,this.references,F)}Check(F){return this.checkFunc(F)}Decode(F){if(!this.checkFunc(F))throw new t.TransformDecodeCheckError(this.schema,F,this.Errors(F).First());return this.hasTransform?t.DecodeTransform.Decode(this.schema,this.references,F):F}Encode(F){let L=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,F):F;if(!this.checkFunc(L))throw new t.TransformEncodeCheckError(this.schema,F,this.Errors(F).First());return L}};e.TypeCheck=c;var f;(function(F){function L(re){return re===36}F.DollarSign=L;function G(re){return re===95}F.IsUnderscore=G;function H(re){return re>=65&&re<=90||re>=97&&re<=122}F.IsAlpha=H;function j(re){return re>=48&&re<=57}F.IsNumeric=j})(f||(f={}));var l;(function(F){function L(re){return re.length===0?!1:f.IsNumeric(re.charCodeAt(0))}function G(re){if(L(re))return!1;for(let W=0;W<re.length;W++){let pe=re.charCodeAt(W);if(!(f.IsAlpha(pe)||f.IsNumeric(pe)||f.DollarSign(pe)||f.IsUnderscore(pe)))return!1}return!0}function H(re){return re.replace(/'/g,"\\'")}function j(re,W){return G(W)?`${re}.${W}`:`${re}['${H(W)}']`}F.Encode=j})(l||(l={}));var g;(function(F){function L(G){let H=[];for(let j=0;j<G.length;j++){let re=G.charCodeAt(j);f.IsNumeric(re)||f.IsAlpha(re)?H.push(G.charAt(j)):H.push(`_${re}_`)}return H.join("").replace(/__/g,"_")}F.Encode=L})(g||(g={}));var P;(function(F){function L(G){return G.replace(/'/g,"\\'")}F.Escape=L})(P||(P={}));var E=class extends a.TypeBoxError{constructor(F){super("Unknown type"),this.schema=F}};e.TypeCompilerUnknownTypeError=E;var M=class extends a.TypeBoxError{constructor(F){super("Preflight validation check failed to guard for the given schema"),this.schema=F}};e.TypeCompilerTypeGuardError=M;var z;(function(F){function L(W,pe,$){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${pe}' in ${W} ? ${$} : true)`:`(${l.Encode(W,pe)} !== undefined ? ${$} : true)`}F.IsExactOptionalProperty=L;function G(W){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${W} === 'object' && ${W} !== null)`:`(typeof ${W} === 'object' && ${W} !== null && !Array.isArray(${W}))`}F.IsObjectLike=G;function H(W){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${W} === 'object' && ${W} !== null && !(${W} instanceof Date) && !(${W} instanceof Uint8Array))`:`(typeof ${W} === 'object' && ${W} !== null && !Array.isArray(${W}) && !(${W} instanceof Date) && !(${W} instanceof Uint8Array))`}F.IsRecordLike=H;function j(W){return i.TypeSystemPolicy.AllowNaN?`typeof ${W} === 'number'`:`(typeof ${W} === 'number' && Number.isFinite(${W}))`}F.IsNumberLike=j;function re(W){return i.TypeSystemPolicy.AllowNullVoid?`(${W} === undefined || ${W} === null)`:`${W} === undefined`}F.IsVoidLike=re})(z||(e.Policy=z={}));var Q;(function(F){function L(O){return O[a.Kind]==="Any"||O[a.Kind]==="Unknown"}function*G(O,le,N){yield"true"}function*H(O,le,N){yield`Array.isArray(${N})`;let[me,ie]=[Fe("value","any"),Fe("acc","number")];(0,r.IsNumber)(O.maxItems)&&(yield`${N}.length <= ${O.maxItems}`),(0,r.IsNumber)(O.minItems)&&(yield`${N}.length >= ${O.minItems}`);let de=ne(O.items,le,"value");if(yield`${N}.every((${me}) => ${de})`,a.TypeGuard.TSchema(O.contains)||(0,r.IsNumber)(O.minContains)||(0,r.IsNumber)(O.maxContains)){let xe=a.TypeGuard.TSchema(O.contains)?O.contains:a.Type.Never(),Le=ne(xe,le,"value"),tt=(0,r.IsNumber)(O.minContains)?[`(count >= ${O.minContains})`]:[],Ze=(0,r.IsNumber)(O.maxContains)?[`(count <= ${O.maxContains})`]:[],nt=`const count = value.reduce((${ie}, ${me}) => ${Le} ? acc + 1 : acc, 0)`,or=["(count > 0)",...tt,...Ze].join(" && ");yield`((${me}) => { ${nt}; return ${or}})(${N})`}O.uniqueItems===!0&&(yield`((${me}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${N})`)}function*j(O,le,N){yield`(typeof value === 'object' && Symbol.asyncIterator in ${N})`}function*re(O,le,N){yield`(typeof ${N} === 'bigint')`,(0,r.IsBigInt)(O.exclusiveMaximum)&&(yield`${N} < BigInt(${O.exclusiveMaximum})`),(0,r.IsBigInt)(O.exclusiveMinimum)&&(yield`${N} > BigInt(${O.exclusiveMinimum})`),(0,r.IsBigInt)(O.maximum)&&(yield`${N} <= BigInt(${O.maximum})`),(0,r.IsBigInt)(O.minimum)&&(yield`${N} >= BigInt(${O.minimum})`),(0,r.IsBigInt)(O.multipleOf)&&(yield`(${N} % BigInt(${O.multipleOf})) === 0`)}function*W(O,le,N){yield`(typeof ${N} === 'boolean')`}function*pe(O,le,N){yield*K(O.returns,le,`${N}.prototype`)}function*$(O,le,N){yield`(${N} instanceof Date) && Number.isFinite(${N}.getTime())`,(0,r.IsNumber)(O.exclusiveMaximumTimestamp)&&(yield`${N}.getTime() < ${O.exclusiveMaximumTimestamp}`),(0,r.IsNumber)(O.exclusiveMinimumTimestamp)&&(yield`${N}.getTime() > ${O.exclusiveMinimumTimestamp}`),(0,r.IsNumber)(O.maximumTimestamp)&&(yield`${N}.getTime() <= ${O.maximumTimestamp}`),(0,r.IsNumber)(O.minimumTimestamp)&&(yield`${N}.getTime() >= ${O.minimumTimestamp}`),(0,r.IsNumber)(O.multipleOfTimestamp)&&(yield`(${N}.getTime() % ${O.multipleOfTimestamp}) === 0`)}function*B(O,le,N){yield`(typeof ${N} === 'function')`}function*D(O,le,N){yield`(typeof ${N} === 'number' && Number.isInteger(${N}))`,(0,r.IsNumber)(O.exclusiveMaximum)&&(yield`${N} < ${O.exclusiveMaximum}`),(0,r.IsNumber)(O.exclusiveMinimum)&&(yield`${N} > ${O.exclusiveMinimum}`),(0,r.IsNumber)(O.maximum)&&(yield`${N} <= ${O.maximum}`),(0,r.IsNumber)(O.minimum)&&(yield`${N} >= ${O.minimum}`),(0,r.IsNumber)(O.multipleOf)&&(yield`(${N} % ${O.multipleOf}) === 0`)}function*Z(O,le,N){let me=O.allOf.map(ie=>ne(ie,le,N)).join(" && ");if(O.unevaluatedProperties===!1){let ie=_e(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),de=`Object.getOwnPropertyNames(${N}).every(key => ${ie}.test(key))`;yield`(${me} && ${de})`}else if(a.TypeGuard.TSchema(O.unevaluatedProperties)){let ie=_e(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),de=`Object.getOwnPropertyNames(${N}).every(key => ${ie}.test(key) || ${ne(O.unevaluatedProperties,le,`${N}[key]`)})`;yield`(${me} && ${de})`}else yield`(${me})`}function*se(O,le,N){yield`(typeof value === 'object' && Symbol.iterator in ${N})`}function*Y(O,le,N){typeof O.const=="number"||typeof O.const=="boolean"?yield`(${N} === ${O.const})`:yield`(${N} === '${P.Escape(O.const)}')`}function*ue(O,le,N){yield"false"}function*k(O,le,N){yield`(!${ne(O.not,le,N)})`}function*q(O,le,N){yield`(${N} === null)`}function*X(O,le,N){yield z.IsNumberLike(N),(0,r.IsNumber)(O.exclusiveMaximum)&&(yield`${N} < ${O.exclusiveMaximum}`),(0,r.IsNumber)(O.exclusiveMinimum)&&(yield`${N} > ${O.exclusiveMinimum}`),(0,r.IsNumber)(O.maximum)&&(yield`${N} <= ${O.maximum}`),(0,r.IsNumber)(O.minimum)&&(yield`${N} >= ${O.minimum}`),(0,r.IsNumber)(O.multipleOf)&&(yield`(${N} % ${O.multipleOf}) === 0`)}function*ye(O,le,N){yield z.IsObjectLike(N),(0,r.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${N}).length >= ${O.minProperties}`),(0,r.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${N}).length <= ${O.maxProperties}`);let me=Object.getOwnPropertyNames(O.properties);for(let ie of me){let de=l.Encode(N,ie),xe=O.properties[ie];if(O.required&&O.required.includes(ie))yield*K(xe,le,de),(a.ExtendsUndefined.Check(xe)||L(xe))&&(yield`('${ie}' in ${N})`);else{let Le=ne(xe,le,de);yield z.IsExactOptionalProperty(N,ie,Le)}}if(O.additionalProperties===!1)if(O.required&&O.required.length===me.length)yield`Object.getOwnPropertyNames(${N}).length === ${me.length}`;else{let ie=`[${me.map(de=>`'${de}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${N}).every(key => ${ie}.includes(key))`}if(typeof O.additionalProperties=="object"){let ie=ne(O.additionalProperties,le,`${N}[key]`),de=`[${me.map(xe=>`'${xe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${N}).every(key => ${de}.includes(key) || ${ie}))`}}function*d(O,le,N){yield`(typeof value === 'object' && typeof ${N}.then === 'function')`}function*_(O,le,N){yield z.IsRecordLike(N),(0,r.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${N}).length >= ${O.minProperties}`),(0,r.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${N}).length <= ${O.maxProperties}`);let[me,ie]=Object.entries(O.patternProperties)[0],de=_e(`${new RegExp(me)}`),xe=ne(ie,le,"value"),Le=a.TypeGuard.TSchema(O.additionalProperties)?ne(O.additionalProperties,le,N):O.additionalProperties===!1?"false":"true",tt=`(${de}.test(key) ? ${xe} : ${Le})`;yield`(Object.entries(${N}).every(([key, value]) => ${tt}))`}function*I(O,le,N){let me=(0,o.Deref)(O,le);if(te.functions.has(O.$ref))return yield`${ge(O.$ref)}(${N})`;yield*K(me,le,N)}function*U(O,le,N){yield`(typeof ${N} === 'string')`,(0,r.IsNumber)(O.maxLength)&&(yield`${N}.length <= ${O.maxLength}`),(0,r.IsNumber)(O.minLength)&&(yield`${N}.length >= ${O.minLength}`),O.pattern!==void 0&&(yield`${_e(`${new RegExp(O.pattern)};`)}.test(${N})`),O.format!==void 0&&(yield`format('${O.format}', ${N})`)}function*R(O,le,N){yield`(typeof ${N} === 'symbol')`}function*S(O,le,N){yield`(typeof ${N} === 'string')`,yield`${_e(`${new RegExp(O.pattern)};`)}.test(${N})`}function*h(O,le,N){yield`${ge(O.$ref)}(${N})`}function*T(O,le,N){if(yield`Array.isArray(${N})`,O.items===void 0)return yield`${N}.length === 0`;yield`(${N}.length === ${O.maxItems})`;for(let me=0;me<O.items.length;me++)yield`${ne(O.items[me],le,`${N}[${me}]`)}`}function*w(O,le,N){yield`${N} === undefined`}function*u(O,le,N){yield`(${O.anyOf.map(ie=>ne(ie,le,N)).join(" || ")})`}function*A(O,le,N){yield`${N} instanceof Uint8Array`,(0,r.IsNumber)(O.maxByteLength)&&(yield`(${N}.length <= ${O.maxByteLength})`),(0,r.IsNumber)(O.minByteLength)&&(yield`(${N}.length >= ${O.minByteLength})`)}function*v(O,le,N){yield"true"}function*b(O,le,N){yield z.IsVoidLike(N)}function*x(O,le,N){let me=te.instances.size;te.instances.set(me,O),yield`kind('${O[a.Kind]}', ${me}, ${N})`}function*K(O,le,N,me=!0){let ie=(0,r.IsString)(O.$id)?[...le,O]:le,de=O;if(me&&(0,r.IsString)(O.$id)){let xe=ge(O.$id);if(te.functions.has(xe))return yield`${xe}(${N})`;{let Le=Be(xe,O,le,"value",!1);return te.functions.set(xe,Le),yield`${xe}(${N})`}}switch(de[a.Kind]){case"Any":return yield*G(de,ie,N);case"Array":return yield*H(de,ie,N);case"AsyncIterator":return yield*j(de,ie,N);case"BigInt":return yield*re(de,ie,N);case"Boolean":return yield*W(de,ie,N);case"Constructor":return yield*pe(de,ie,N);case"Date":return yield*$(de,ie,N);case"Function":return yield*B(de,ie,N);case"Integer":return yield*D(de,ie,N);case"Intersect":return yield*Z(de,ie,N);case"Iterator":return yield*se(de,ie,N);case"Literal":return yield*Y(de,ie,N);case"Never":return yield*ue(de,ie,N);case"Not":return yield*k(de,ie,N);case"Null":return yield*q(de,ie,N);case"Number":return yield*X(de,ie,N);case"Object":return yield*ye(de,ie,N);case"Promise":return yield*d(de,ie,N);case"Record":return yield*_(de,ie,N);case"Ref":return yield*I(de,ie,N);case"String":return yield*U(de,ie,N);case"Symbol":return yield*R(de,ie,N);case"TemplateLiteral":return yield*S(de,ie,N);case"This":return yield*h(de,ie,N);case"Tuple":return yield*T(de,ie,N);case"Undefined":return yield*w(de,ie,N);case"Union":return yield*u(de,ie,N);case"Uint8Array":return yield*A(de,ie,N);case"Unknown":return yield*v(de,ie,N);case"Void":return yield*b(de,ie,N);default:if(!a.TypeRegistry.Has(de[a.Kind]))throw new E(O);return yield*x(de,ie,N)}}let te={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function ne(O,le,N,me=!0){return`(${[...K(O,le,N,me)].join(" && ")})`}function ge(O){return`check_${g.Encode(O)}`}function _e(O){let le=`local_${te.variables.size}`;return te.variables.set(le,`const ${le} = ${O}`),le}function Be(O,le,N,me,ie=!0){let[de,xe]=[`
48
+ ${d}`),q.pop(),`{${R}}`}case"number":return isFinite(k)?String(k):G?G(k):"null";case"boolean":return k===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(k);default:return G?G(k):void 0}}function se(ue,k,q){switch(typeof k){case"string":return o(k);case"object":{if(k===null)return"null";if(typeof k.toJSON=="function"){if(k=k.toJSON(ue),typeof k!="object")return se(ue,k,q);if(k===null)return"null"}if(q.indexOf(k)!==-1)return H;let X="",ye=k.length!==void 0;if(ye&&Array.isArray(k)){if(k.length===0)return"[]";if(pe<q.length+1)return'"[Array]"';q.push(k);let R=Math.min(k.length,$),S=0;for(;S<R-1;S++){let T=se(String(S),k[S],q);X+=T!==void 0?T:"null",X+=","}let h=se(String(S),k[S],q);if(X+=h!==void 0?h:"null",k.length-1>$){let T=k.length-$-1;X+=`,"... ${M(T)} not stringified"`}return q.pop(),`[${X}]`}let d=Object.keys(k),_=d.length;if(_===0)return"{}";if(pe<q.length+1)return'"[Object]"';let I="",U=Math.min(_,$);ye&&c(k)&&(X+=f(k,",",$),d=d.slice(k.length),U-=k.length,I=","),re&&(d=s(d,W)),q.push(k);for(let R=0;R<U;R++){let S=d[R],h=se(S,k[S],q);h!==void 0&&(X+=`${I}${o(S)}:${h}`,I=",")}if(_>$){let R=_-$;X+=`${I}"...":"${M(R)} not stringified"`}return q.pop(),`{${X}}`}case"number":return isFinite(k)?String(k):G?G(k):"null";case"boolean":return k===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(k);default:return G?G(k):void 0}}function Y(ue,k,q){if(arguments.length>1){let X="";if(typeof q=="number"?X=" ".repeat(Math.min(q,10)):typeof q=="string"&&(X=q.slice(0,10)),k!=null){if(typeof k=="function")return B("",{"":ue},[],k,X,"");if(Array.isArray(k))return D("",ue,[],z(k),X,"")}if(X.length!==0)return Z("",ue,[],X,"")}return se("",ue,[])}return Y}}}),Bn=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/guard.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IsValueType=e.IsSymbol=e.IsFunction=e.IsString=e.IsBigInt=e.IsInteger=e.IsNumber=e.IsBoolean=e.IsNull=e.IsUndefined=e.IsArray=e.IsObject=e.IsPlainObject=e.HasPropertyKey=e.IsDate=e.IsUint8Array=e.IsPromise=e.IsTypedArray=e.IsIterator=e.IsAsyncIterator=void 0;function t(j){return f(j)&&Symbol.asyncIterator in j}e.IsAsyncIterator=t;function r(j){return f(j)&&Symbol.iterator in j}e.IsIterator=r;function n(j){return ArrayBuffer.isView(j)}e.IsTypedArray=n;function i(j){return j instanceof Promise}e.IsPromise=i;function o(j){return j instanceof Uint8Array}e.IsUint8Array=o;function s(j){return j instanceof Date&&Number.isFinite(j.getTime())}e.IsDate=s;function a(j,re){return re in j}e.HasPropertyKey=a;function c(j){return f(j)&&L(j.constructor)&&j.constructor.name==="Object"}e.IsPlainObject=c;function f(j){return j!==null&&typeof j=="object"}e.IsObject=f;function l(j){return Array.isArray(j)&&!ArrayBuffer.isView(j)}e.IsArray=l;function g(j){return j===void 0}e.IsUndefined=g;function P(j){return j===null}e.IsNull=P;function E(j){return typeof j=="boolean"}e.IsBoolean=E;function M(j){return typeof j=="number"}e.IsNumber=M;function z(j){return M(j)&&Number.isInteger(j)}e.IsInteger=z;function Q(j){return typeof j=="bigint"}e.IsBigInt=Q;function F(j){return typeof j=="string"}e.IsString=F;function L(j){return typeof j=="function"}e.IsFunction=L;function G(j){return typeof j=="symbol"}e.IsSymbol=G;function H(j){return Q(j)||E(j)||P(j)||M(j)||F(j)||G(j)||g(j)}e.IsValueType=H}}),Sd=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/system.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultErrorFunction=e.TypeSystemPolicy=e.TypeSystemErrorFunction=e.TypeSystem=e.TypeSystemDuplicateFormat=e.TypeSystemDuplicateTypeKind=void 0;var t=Bn(),r=is(),n=dr(),i=class extends n.TypeBoxError{constructor(l){super(`Duplicate type kind '${l}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var o=class extends n.TypeBoxError{constructor(l){super(`Duplicate string format '${l}' detected`)}};e.TypeSystemDuplicateFormat=o;var s;(function(l){function g(E,M){if(n.TypeRegistry.Has(E))throw new i(E);return n.TypeRegistry.Set(E,M),(z={})=>n.Type.Unsafe({...z,[n.Kind]:E})}l.Type=g;function P(E,M){if(n.FormatRegistry.Has(E))throw new o(E);return n.FormatRegistry.Set(E,M),E}l.Format=P})(s||(e.TypeSystem=s={}));var a;(function(l){let g=f;function P(){g=f}l.Reset=P;function E(z){g=z}l.Set=E;function M(){return g}l.Get=M})(a||(e.TypeSystemErrorFunction=a={}));var c;(function(l){l.ExactOptionalPropertyTypes=!1,l.AllowArrayObject=!1,l.AllowNaN=!1,l.AllowNullVoid=!1;function g(Q,F){return l.ExactOptionalPropertyTypes?F in Q:Q[F]!==void 0}l.IsExactOptionalProperty=g;function P(Q){let F=(0,t.IsObject)(Q);return l.AllowArrayObject?F:F&&!(0,t.IsArray)(Q)}l.IsObjectLike=P;function E(Q){return P(Q)&&!(Q instanceof Date)&&!(Q instanceof Uint8Array)}l.IsRecordLike=E;function M(Q){let F=(0,t.IsNumber)(Q);return l.AllowNaN?F:F&&Number.isFinite(Q)}l.IsNumberLike=M;function z(Q){let F=(0,t.IsUndefined)(Q);return l.AllowNullVoid?F||Q===null:F}l.IsVoidLike=z})(c||(e.TypeSystemPolicy=c={}));function f(l,g){switch(g){case r.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case r.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${l.maxContains} matching values`;case r.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${l.minContains} matching values`;case r.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${l.maxItems}`;case r.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${l.minItems}`;case r.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case r.ValueErrorType.Array:return"Expected array";case r.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case r.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${l.exclusiveMaximum}`;case r.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${l.exclusiveMinimum}`;case r.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${l.maximum}`;case r.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${l.minimum}`;case r.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${l.multipleOf}`;case r.ValueErrorType.BigInt:return"Expected bigint";case r.ValueErrorType.Boolean:return"Expected boolean";case r.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${l.exclusiveMinimumTimestamp}`;case r.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${l.exclusiveMaximumTimestamp}`;case r.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${l.minimumTimestamp}`;case r.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${l.maximumTimestamp}`;case r.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${l.multipleOfTimestamp}`;case r.ValueErrorType.Date:return"Expected Date";case r.ValueErrorType.Function:return"Expected function";case r.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${l.exclusiveMaximum}`;case r.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${l.exclusiveMinimum}`;case r.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${l.maximum}`;case r.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${l.minimum}`;case r.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${l.multipleOf}`;case r.ValueErrorType.Integer:return"Expected integer";case r.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case r.ValueErrorType.Intersect:return"Expected all values to match";case r.ValueErrorType.Iterator:return"Expected Iterator";case r.ValueErrorType.Literal:return`Expected ${typeof l.const=="string"?`'${l.const}'`:l.const}`;case r.ValueErrorType.Never:return"Never";case r.ValueErrorType.Not:return"Value should not match";case r.ValueErrorType.Null:return"Expected null";case r.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${l.exclusiveMaximum}`;case r.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${l.exclusiveMinimum}`;case r.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${l.maximum}`;case r.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${l.minimum}`;case r.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${l.multipleOf}`;case r.ValueErrorType.Number:return"Expected number";case r.ValueErrorType.Object:return"Expected object";case r.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case r.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${l.maxProperties} properties`;case r.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${l.minProperties} properties`;case r.ValueErrorType.ObjectRequiredProperty:return"Required property";case r.ValueErrorType.Promise:return"Expected Promise";case r.ValueErrorType.StringFormatUnknown:return`Unknown format '${l.format}'`;case r.ValueErrorType.StringFormat:return`Expected string to match '${l.format}' format`;case r.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${l.maxLength}`;case r.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${l.minLength}`;case r.ValueErrorType.StringPattern:return`Expected string to match '${l.pattern}'`;case r.ValueErrorType.String:return"Expected string";case r.ValueErrorType.Symbol:return"Expected symbol";case r.ValueErrorType.TupleLength:return`Expected tuple to have ${l.maxItems||0} elements`;case r.ValueErrorType.Tuple:return"Expected tuple";case r.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${l.maxByteLength}`;case r.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${l.minByteLength}`;case r.ValueErrorType.Uint8Array:return"Expected Uint8Array";case r.ValueErrorType.Undefined:return"Expected undefined";case r.ValueErrorType.Union:return"Expected union value";case r.ValueErrorType.Void:return"Expected void";case r.ValueErrorType.Kind:return`Expected kind '${l[n.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=f}}),ns=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/deref.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Deref=e.TypeDereferenceError=void 0;var t=dr(),r=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=r;function n(i,o){let s=o.findIndex(a=>a.$id===i.$ref);if(s===-1)throw new r(i);return o[s]}e.Deref=n}}),Ja=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/hash.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.ByteMarker=e.ValueHashError=void 0;var t=Bn(),r=class extends Error{constructor(B){super("Unable to hash value"),this.value=B}};e.ValueHashError=r;var n;(function(B){B[B.Undefined=0]="Undefined",B[B.Null=1]="Null",B[B.Boolean=2]="Boolean",B[B.Number=3]="Number",B[B.String=4]="String",B[B.Object=5]="Object",B[B.Array=6]="Array",B[B.Date=7]="Date",B[B.Uint8Array=8]="Uint8Array",B[B.Symbol=9]="Symbol",B[B.BigInt=10]="BigInt"})(n||(e.ByteMarker=n={}));var i=BigInt("14695981039346656037"),[o,s]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],a=Array.from({length:256}).map((B,D)=>BigInt(D)),c=new Float64Array(1),f=new DataView(c.buffer),l=new Uint8Array(c.buffer);function*g(B){let D=B===0?1:Math.ceil(Math.floor(Math.log2(B)+1)/8);for(let Z=0;Z<D;Z++)yield B>>8*(D-1-Z)&255}function P(B){pe(n.Array);for(let D of B)W(D)}function E(B){pe(n.Boolean),pe(B?1:0)}function M(B){pe(n.BigInt),f.setBigInt64(0,B);for(let D of l)pe(D)}function z(B){pe(n.Date),W(B.getTime())}function Q(B){pe(n.Null)}function F(B){pe(n.Number),f.setFloat64(0,B);for(let D of l)pe(D)}function L(B){pe(n.Object);for(let D of globalThis.Object.keys(B).sort())W(D),W(B[D])}function G(B){pe(n.String);for(let D=0;D<B.length;D++)for(let Z of g(B.charCodeAt(D)))pe(Z)}function H(B){pe(n.Symbol),W(B.description)}function j(B){pe(n.Uint8Array);for(let D=0;D<B.length;D++)pe(B[D])}function re(B){return pe(n.Undefined)}function W(B){if((0,t.IsArray)(B))return P(B);if((0,t.IsBoolean)(B))return E(B);if((0,t.IsBigInt)(B))return M(B);if((0,t.IsDate)(B))return z(B);if((0,t.IsNull)(B))return Q(B);if((0,t.IsNumber)(B))return F(B);if((0,t.IsPlainObject)(B))return L(B);if((0,t.IsString)(B))return G(B);if((0,t.IsSymbol)(B))return H(B);if((0,t.IsUint8Array)(B))return j(B);if((0,t.IsUndefined)(B))return re(B);throw new r(B)}function pe(B){i=i^a[B],i=i*o%s}function $(B){return i=BigInt("14695981039346656037"),W(B),i}e.Hash=$}}),is=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/errors.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Errors=e.ValueErrorIterator=e.EscapeKey=e.ValueErrorsUnknownTypeError=e.ValueErrorType=void 0;var t=Bn(),r=Sd(),n=ns(),i=Ja(),o=dr(),s;(function(u){u[u.ArrayContains=0]="ArrayContains",u[u.ArrayMaxContains=1]="ArrayMaxContains",u[u.ArrayMaxItems=2]="ArrayMaxItems",u[u.ArrayMinContains=3]="ArrayMinContains",u[u.ArrayMinItems=4]="ArrayMinItems",u[u.ArrayUniqueItems=5]="ArrayUniqueItems",u[u.Array=6]="Array",u[u.AsyncIterator=7]="AsyncIterator",u[u.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",u[u.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",u[u.BigIntMaximum=10]="BigIntMaximum",u[u.BigIntMinimum=11]="BigIntMinimum",u[u.BigIntMultipleOf=12]="BigIntMultipleOf",u[u.BigInt=13]="BigInt",u[u.Boolean=14]="Boolean",u[u.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",u[u.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",u[u.DateMaximumTimestamp=17]="DateMaximumTimestamp",u[u.DateMinimumTimestamp=18]="DateMinimumTimestamp",u[u.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",u[u.Date=20]="Date",u[u.Function=21]="Function",u[u.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",u[u.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",u[u.IntegerMaximum=24]="IntegerMaximum",u[u.IntegerMinimum=25]="IntegerMinimum",u[u.IntegerMultipleOf=26]="IntegerMultipleOf",u[u.Integer=27]="Integer",u[u.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",u[u.Intersect=29]="Intersect",u[u.Iterator=30]="Iterator",u[u.Kind=31]="Kind",u[u.Literal=32]="Literal",u[u.Never=33]="Never",u[u.Not=34]="Not",u[u.Null=35]="Null",u[u.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",u[u.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",u[u.NumberMaximum=38]="NumberMaximum",u[u.NumberMinimum=39]="NumberMinimum",u[u.NumberMultipleOf=40]="NumberMultipleOf",u[u.Number=41]="Number",u[u.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",u[u.ObjectMaxProperties=43]="ObjectMaxProperties",u[u.ObjectMinProperties=44]="ObjectMinProperties",u[u.ObjectRequiredProperty=45]="ObjectRequiredProperty",u[u.Object=46]="Object",u[u.Promise=47]="Promise",u[u.StringFormatUnknown=48]="StringFormatUnknown",u[u.StringFormat=49]="StringFormat",u[u.StringMaxLength=50]="StringMaxLength",u[u.StringMinLength=51]="StringMinLength",u[u.StringPattern=52]="StringPattern",u[u.String=53]="String",u[u.Symbol=54]="Symbol",u[u.TupleLength=55]="TupleLength",u[u.Tuple=56]="Tuple",u[u.Uint8ArrayMaxByteLength=57]="Uint8ArrayMaxByteLength",u[u.Uint8ArrayMinByteLength=58]="Uint8ArrayMinByteLength",u[u.Uint8Array=59]="Uint8Array",u[u.Undefined=60]="Undefined",u[u.Union=61]="Union",u[u.Void=62]="Void"})(s||(e.ValueErrorType=s={}));var a=class extends o.TypeBoxError{constructor(u){super("Unknown type"),this.schema=u}};e.ValueErrorsUnknownTypeError=a;function c(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=c;function f(u){return u!==void 0}var l=class{constructor(u){this.iterator=u}[Symbol.iterator](){return this.iterator}First(){let u=this.iterator.next();return u.done?void 0:u.value}};e.ValueErrorIterator=l;function g(u,A,v,b){return{type:u,schema:A,path:v,value:b,message:r.TypeSystemErrorFunction.Get()(A,u)}}function*P(u,A,v,b){}function*E(u,A,v,b){if(!(0,t.IsArray)(b))return yield g(s.Array,u,v,b);f(u.minItems)&&!(b.length>=u.minItems)&&(yield g(s.ArrayMinItems,u,v,b)),f(u.maxItems)&&!(b.length<=u.maxItems)&&(yield g(s.ArrayMaxItems,u,v,b));for(let te=0;te<b.length;te++)yield*T(u.items,A,`${v}/${te}`,b[te]);if(u.uniqueItems===!0&&!function(){let te=new Set;for(let ne of b){let ge=(0,i.Hash)(ne);if(te.has(ge))return!1;te.add(ge)}return!0}()&&(yield g(s.ArrayUniqueItems,u,v,b)),!(f(u.contains)||f(u.minContains)||f(u.maxContains)))return;let x=f(u.contains)?u.contains:o.Type.Never(),K=b.reduce((te,ne,ge)=>T(x,A,`${v}${ge}`,ne).next().done===!0?te+1:te,0);K===0&&(yield g(s.ArrayContains,u,v,b)),(0,t.IsNumber)(u.minContains)&&K<u.minContains&&(yield g(s.ArrayMinContains,u,v,b)),(0,t.IsNumber)(u.maxContains)&&K>u.maxContains&&(yield g(s.ArrayMaxContains,u,v,b))}function*M(u,A,v,b){(0,t.IsAsyncIterator)(b)||(yield g(s.AsyncIterator,u,v,b))}function*z(u,A,v,b){if(!(0,t.IsBigInt)(b))return yield g(s.BigInt,u,v,b);f(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(s.BigIntExclusiveMaximum,u,v,b)),f(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(s.BigIntExclusiveMinimum,u,v,b)),f(u.maximum)&&!(b<=u.maximum)&&(yield g(s.BigIntMaximum,u,v,b)),f(u.minimum)&&!(b>=u.minimum)&&(yield g(s.BigIntMinimum,u,v,b)),f(u.multipleOf)&&b%u.multipleOf!==BigInt(0)&&(yield g(s.BigIntMultipleOf,u,v,b))}function*Q(u,A,v,b){(0,t.IsBoolean)(b)||(yield g(s.Boolean,u,v,b))}function*F(u,A,v,b){yield*T(u.returns,A,v,b.prototype)}function*L(u,A,v,b){if(!(0,t.IsDate)(b))return yield g(s.Date,u,v,b);f(u.exclusiveMaximumTimestamp)&&!(b.getTime()<u.exclusiveMaximumTimestamp)&&(yield g(s.DateExclusiveMaximumTimestamp,u,v,b)),f(u.exclusiveMinimumTimestamp)&&!(b.getTime()>u.exclusiveMinimumTimestamp)&&(yield g(s.DateExclusiveMinimumTimestamp,u,v,b)),f(u.maximumTimestamp)&&!(b.getTime()<=u.maximumTimestamp)&&(yield g(s.DateMaximumTimestamp,u,v,b)),f(u.minimumTimestamp)&&!(b.getTime()>=u.minimumTimestamp)&&(yield g(s.DateMinimumTimestamp,u,v,b)),f(u.multipleOfTimestamp)&&b.getTime()%u.multipleOfTimestamp!==0&&(yield g(s.DateMultipleOfTimestamp,u,v,b))}function*G(u,A,v,b){(0,t.IsFunction)(b)||(yield g(s.Function,u,v,b))}function*H(u,A,v,b){if(!(0,t.IsInteger)(b))return yield g(s.Integer,u,v,b);f(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(s.IntegerExclusiveMaximum,u,v,b)),f(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(s.IntegerExclusiveMinimum,u,v,b)),f(u.maximum)&&!(b<=u.maximum)&&(yield g(s.IntegerMaximum,u,v,b)),f(u.minimum)&&!(b>=u.minimum)&&(yield g(s.IntegerMinimum,u,v,b)),f(u.multipleOf)&&b%u.multipleOf!==0&&(yield g(s.IntegerMultipleOf,u,v,b))}function*j(u,A,v,b){for(let x of u.allOf){let K=T(x,A,v,b).next();K.done||(yield g(s.Intersect,u,v,b),yield K.value)}if(u.unevaluatedProperties===!1){let x=new RegExp(o.KeyResolver.ResolvePattern(u));for(let K of Object.getOwnPropertyNames(b))x.test(K)||(yield g(s.IntersectUnevaluatedProperties,u,`${v}/${K}`,b))}if(typeof u.unevaluatedProperties=="object"){let x=new RegExp(o.KeyResolver.ResolvePattern(u));for(let K of Object.getOwnPropertyNames(b))if(!x.test(K)){let te=T(u.unevaluatedProperties,A,`${v}/${K}`,b[K]).next();te.done||(yield te.value)}}}function*re(u,A,v,b){(0,t.IsIterator)(b)||(yield g(s.Iterator,u,v,b))}function*W(u,A,v,b){b!==u.const&&(yield g(s.Literal,u,v,b))}function*pe(u,A,v,b){yield g(s.Never,u,v,b)}function*$(u,A,v,b){T(u.not,A,v,b).next().done===!0&&(yield g(s.Not,u,v,b))}function*B(u,A,v,b){(0,t.IsNull)(b)||(yield g(s.Null,u,v,b))}function*D(u,A,v,b){if(!r.TypeSystemPolicy.IsNumberLike(b))return yield g(s.Number,u,v,b);f(u.exclusiveMaximum)&&!(b<u.exclusiveMaximum)&&(yield g(s.NumberExclusiveMaximum,u,v,b)),f(u.exclusiveMinimum)&&!(b>u.exclusiveMinimum)&&(yield g(s.NumberExclusiveMinimum,u,v,b)),f(u.maximum)&&!(b<=u.maximum)&&(yield g(s.NumberMaximum,u,v,b)),f(u.minimum)&&!(b>=u.minimum)&&(yield g(s.NumberMinimum,u,v,b)),f(u.multipleOf)&&b%u.multipleOf!==0&&(yield g(s.NumberMultipleOf,u,v,b))}function*Z(u,A,v,b){if(!r.TypeSystemPolicy.IsObjectLike(b))return yield g(s.Object,u,v,b);f(u.minProperties)&&!(Object.getOwnPropertyNames(b).length>=u.minProperties)&&(yield g(s.ObjectMinProperties,u,v,b)),f(u.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=u.maxProperties)&&(yield g(s.ObjectMaxProperties,u,v,b));let x=Array.isArray(u.required)?u.required:[],K=Object.getOwnPropertyNames(u.properties),te=Object.getOwnPropertyNames(b);for(let ne of x)te.includes(ne)||(yield g(s.ObjectRequiredProperty,u.properties[ne],`${v}/${c(ne)}`,void 0));if(u.additionalProperties===!1)for(let ne of te)K.includes(ne)||(yield g(s.ObjectAdditionalProperties,u,`${v}/${c(ne)}`,b[ne]));if(typeof u.additionalProperties=="object")for(let ne of te)K.includes(ne)||(yield*T(u.additionalProperties,A,`${v}/${c(ne)}`,b[ne]));for(let ne of K){let ge=u.properties[ne];u.required&&u.required.includes(ne)?(yield*T(ge,A,`${v}/${c(ne)}`,b[ne]),o.ExtendsUndefined.Check(u)&&!(ne in b)&&(yield g(s.ObjectRequiredProperty,ge,`${v}/${c(ne)}`,void 0))):r.TypeSystemPolicy.IsExactOptionalProperty(b,ne)&&(yield*T(ge,A,`${v}/${c(ne)}`,b[ne]))}}function*se(u,A,v,b){(0,t.IsPromise)(b)||(yield g(s.Promise,u,v,b))}function*Y(u,A,v,b){if(!r.TypeSystemPolicy.IsRecordLike(b))return yield g(s.Object,u,v,b);f(u.minProperties)&&!(Object.getOwnPropertyNames(b).length>=u.minProperties)&&(yield g(s.ObjectMinProperties,u,v,b)),f(u.maxProperties)&&!(Object.getOwnPropertyNames(b).length<=u.maxProperties)&&(yield g(s.ObjectMaxProperties,u,v,b));let[x,K]=Object.entries(u.patternProperties)[0],te=new RegExp(x);for(let[ne,ge]of Object.entries(b))te.test(ne)&&(yield*T(K,A,`${v}/${c(ne)}`,ge));if(typeof u.additionalProperties=="object")for(let[ne,ge]of Object.entries(b))te.test(ne)||(yield*T(u.additionalProperties,A,`${v}/${c(ne)}`,ge));if(u.additionalProperties===!1){for(let[ne,ge]of Object.entries(b))if(!te.test(ne))return yield g(s.ObjectAdditionalProperties,u,`${v}/${c(ne)}`,ge)}}function*ue(u,A,v,b){yield*T((0,n.Deref)(u,A),A,v,b)}function*k(u,A,v,b){if(!(0,t.IsString)(b))return yield g(s.String,u,v,b);f(u.minLength)&&!(b.length>=u.minLength)&&(yield g(s.StringMinLength,u,v,b)),f(u.maxLength)&&!(b.length<=u.maxLength)&&(yield g(s.StringMaxLength,u,v,b)),(0,t.IsString)(u.pattern)&&(new RegExp(u.pattern).test(b)||(yield g(s.StringPattern,u,v,b))),(0,t.IsString)(u.format)&&(o.FormatRegistry.Has(u.format)?o.FormatRegistry.Get(u.format)(b)||(yield g(s.StringFormat,u,v,b)):yield g(s.StringFormatUnknown,u,v,b))}function*q(u,A,v,b){(0,t.IsSymbol)(b)||(yield g(s.Symbol,u,v,b))}function*X(u,A,v,b){if(!(0,t.IsString)(b))return yield g(s.String,u,v,b);new RegExp(u.pattern).test(b)||(yield g(s.StringPattern,u,v,b))}function*ye(u,A,v,b){yield*T((0,n.Deref)(u,A),A,v,b)}function*d(u,A,v,b){if(!(0,t.IsArray)(b))return yield g(s.Tuple,u,v,b);if(u.items===void 0&&b.length!==0)return yield g(s.TupleLength,u,v,b);if(b.length!==u.maxItems)return yield g(s.TupleLength,u,v,b);if(u.items)for(let x=0;x<u.items.length;x++)yield*T(u.items[x],A,`${v}/${x}`,b[x])}function*_(u,A,v,b){(0,t.IsUndefined)(b)||(yield g(s.Undefined,u,v,b))}function*I(u,A,v,b){let x=0;for(let K of u.anyOf){let te=[...T(K,A,v,b)];if(te.length===0)return;x+=te.length}x>0&&(yield g(s.Union,u,v,b))}function*U(u,A,v,b){if(!(0,t.IsUint8Array)(b))return yield g(s.Uint8Array,u,v,b);f(u.maxByteLength)&&!(b.length<=u.maxByteLength)&&(yield g(s.Uint8ArrayMaxByteLength,u,v,b)),f(u.minByteLength)&&!(b.length>=u.minByteLength)&&(yield g(s.Uint8ArrayMinByteLength,u,v,b))}function*R(u,A,v,b){}function*S(u,A,v,b){r.TypeSystemPolicy.IsVoidLike(b)||(yield g(s.Void,u,v,b))}function*h(u,A,v,b){o.TypeRegistry.Get(u[o.Kind])(u,b)||(yield g(s.Kind,u,v,b))}function*T(u,A,v,b){let x=f(u.$id)?[...A,u]:A,K=u;switch(K[o.Kind]){case"Any":return yield*P(K,x,v,b);case"Array":return yield*E(K,x,v,b);case"AsyncIterator":return yield*M(K,x,v,b);case"BigInt":return yield*z(K,x,v,b);case"Boolean":return yield*Q(K,x,v,b);case"Constructor":return yield*F(K,x,v,b);case"Date":return yield*L(K,x,v,b);case"Function":return yield*G(K,x,v,b);case"Integer":return yield*H(K,x,v,b);case"Intersect":return yield*j(K,x,v,b);case"Iterator":return yield*re(K,x,v,b);case"Literal":return yield*W(K,x,v,b);case"Never":return yield*pe(K,x,v,b);case"Not":return yield*$(K,x,v,b);case"Null":return yield*B(K,x,v,b);case"Number":return yield*D(K,x,v,b);case"Object":return yield*Z(K,x,v,b);case"Promise":return yield*se(K,x,v,b);case"Record":return yield*Y(K,x,v,b);case"Ref":return yield*ue(K,x,v,b);case"String":return yield*k(K,x,v,b);case"Symbol":return yield*q(K,x,v,b);case"TemplateLiteral":return yield*X(K,x,v,b);case"This":return yield*ye(K,x,v,b);case"Tuple":return yield*d(K,x,v,b);case"Undefined":return yield*_(K,x,v,b);case"Union":return yield*I(K,x,v,b);case"Uint8Array":return yield*U(K,x,v,b);case"Unknown":return yield*R(K,x,v,b);case"Void":return yield*S(K,x,v,b);default:if(!o.TypeRegistry.Has(K[o.Kind]))throw new a(u);return yield*h(K,x,v,b)}}function w(...u){let A=u.length===3?T(u[0],u[1],"",u[2]):T(u[0],[],"",u[1]);return new l(A)}e.Errors=w}}),Ym=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(n,i,o,s){s===void 0&&(s=o);var a=Object.getOwnPropertyDescriptor(i,o);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,s,a)}:function(n,i,o,s){s===void 0&&(s=o),n[s]=i[o]}),r=e&&e.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(is(),e)}}),xd=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,o,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(o,s);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,a,c)}:function(i,o,s,a){a===void 0&&(a=s),i[a]=o[s]}),r=e&&e.__exportStar||function(i,o){for(var s in i)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,i,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var n=is();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(Sd(),e)}}),Qm=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/check.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Check=e.ValueCheckUnknownTypeError=void 0;var t=Bn(),r=xd(),n=ns(),i=Ja(),o=dr(),s=class extends o.TypeBoxError{constructor(h){super("Unknown type"),this.schema=h}};e.ValueCheckUnknownTypeError=s;function a(h){return h[o.Kind]==="Any"||h[o.Kind]==="Unknown"}function c(h){return h!==void 0}function f(h,T,w){return!0}function l(h,T,w){if(!(0,t.IsArray)(w)||c(h.minItems)&&!(w.length>=h.minItems)||c(h.maxItems)&&!(w.length<=h.maxItems)||!w.every(v=>R(h.items,T,v))||h.uniqueItems===!0&&!function(){let v=new Set;for(let b of w){let x=(0,i.Hash)(b);if(v.has(x))return!1;v.add(x)}return!0}())return!1;if(!(c(h.contains)||(0,t.IsNumber)(h.minContains)||(0,t.IsNumber)(h.maxContains)))return!0;let u=c(h.contains)?h.contains:o.Type.Never(),A=w.reduce((v,b)=>R(u,T,b)?v+1:v,0);return!(A===0||(0,t.IsNumber)(h.minContains)&&A<h.minContains||(0,t.IsNumber)(h.maxContains)&&A>h.maxContains)}function g(h,T,w){return(0,t.IsAsyncIterator)(w)}function P(h,T,w){return!(!(0,t.IsBigInt)(w)||c(h.exclusiveMaximum)&&!(w<h.exclusiveMaximum)||c(h.exclusiveMinimum)&&!(w>h.exclusiveMinimum)||c(h.maximum)&&!(w<=h.maximum)||c(h.minimum)&&!(w>=h.minimum)||c(h.multipleOf)&&w%h.multipleOf!==BigInt(0))}function E(h,T,w){return(0,t.IsBoolean)(w)}function M(h,T,w){return R(h.returns,T,w.prototype)}function z(h,T,w){return!(!(0,t.IsDate)(w)||c(h.exclusiveMaximumTimestamp)&&!(w.getTime()<h.exclusiveMaximumTimestamp)||c(h.exclusiveMinimumTimestamp)&&!(w.getTime()>h.exclusiveMinimumTimestamp)||c(h.maximumTimestamp)&&!(w.getTime()<=h.maximumTimestamp)||c(h.minimumTimestamp)&&!(w.getTime()>=h.minimumTimestamp)||c(h.multipleOfTimestamp)&&w.getTime()%h.multipleOfTimestamp!==0)}function Q(h,T,w){return(0,t.IsFunction)(w)}function F(h,T,w){return!(!(0,t.IsInteger)(w)||c(h.exclusiveMaximum)&&!(w<h.exclusiveMaximum)||c(h.exclusiveMinimum)&&!(w>h.exclusiveMinimum)||c(h.maximum)&&!(w<=h.maximum)||c(h.minimum)&&!(w>=h.minimum)||c(h.multipleOf)&&w%h.multipleOf!==0)}function L(h,T,w){let u=h.allOf.every(A=>R(A,T,w));if(h.unevaluatedProperties===!1){let A=new RegExp(o.KeyResolver.ResolvePattern(h)),v=Object.getOwnPropertyNames(w).every(b=>A.test(b));return u&&v}else if(o.TypeGuard.TSchema(h.unevaluatedProperties)){let A=new RegExp(o.KeyResolver.ResolvePattern(h)),v=Object.getOwnPropertyNames(w).every(b=>A.test(b)||R(h.unevaluatedProperties,T,w[b]));return u&&v}else return u}function G(h,T,w){return(0,t.IsIterator)(w)}function H(h,T,w){return w===h.const}function j(h,T,w){return!1}function re(h,T,w){return!R(h.not,T,w)}function W(h,T,w){return(0,t.IsNull)(w)}function pe(h,T,w){return!(!r.TypeSystemPolicy.IsNumberLike(w)||c(h.exclusiveMaximum)&&!(w<h.exclusiveMaximum)||c(h.exclusiveMinimum)&&!(w>h.exclusiveMinimum)||c(h.minimum)&&!(w>=h.minimum)||c(h.maximum)&&!(w<=h.maximum)||c(h.multipleOf)&&w%h.multipleOf!==0)}function $(h,T,w){if(!r.TypeSystemPolicy.IsObjectLike(w)||c(h.minProperties)&&!(Object.getOwnPropertyNames(w).length>=h.minProperties)||c(h.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=h.maxProperties))return!1;let u=Object.getOwnPropertyNames(h.properties);for(let A of u){let v=h.properties[A];if(h.required&&h.required.includes(A)){if(!R(v,T,w[A])||(o.ExtendsUndefined.Check(v)||a(v))&&!(A in w))return!1}else if(r.TypeSystemPolicy.IsExactOptionalProperty(w,A)&&!R(v,T,w[A]))return!1}if(h.additionalProperties===!1){let A=Object.getOwnPropertyNames(w);return h.required&&h.required.length===u.length&&A.length===u.length?!0:A.every(v=>u.includes(v))}else return typeof h.additionalProperties=="object"?Object.getOwnPropertyNames(w).every(v=>u.includes(v)||R(h.additionalProperties,T,w[v])):!0}function B(h,T,w){return(0,t.IsPromise)(w)}function D(h,T,w){if(!r.TypeSystemPolicy.IsRecordLike(w)||c(h.minProperties)&&!(Object.getOwnPropertyNames(w).length>=h.minProperties)||c(h.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=h.maxProperties))return!1;let[u,A]=Object.entries(h.patternProperties)[0],v=new RegExp(u),b=Object.entries(w).every(([te,ne])=>v.test(te)?R(A,T,ne):!0),x=typeof h.additionalProperties=="object"?Object.entries(w).every(([te,ne])=>v.test(te)?!0:R(h.additionalProperties,T,ne)):!0,K=h.additionalProperties===!1?Object.getOwnPropertyNames(w).every(te=>v.test(te)):!0;return b&&x&&K}function Z(h,T,w){return R((0,n.Deref)(h,T),T,w)}function se(h,T,w){return!(0,t.IsString)(w)||c(h.minLength)&&!(w.length>=h.minLength)||c(h.maxLength)&&!(w.length<=h.maxLength)||c(h.pattern)&&!new RegExp(h.pattern).test(w)?!1:c(h.format)?o.FormatRegistry.Has(h.format)?o.FormatRegistry.Get(h.format)(w):!1:!0}function Y(h,T,w){return(0,t.IsSymbol)(w)}function ue(h,T,w){return(0,t.IsString)(w)&&new RegExp(h.pattern).test(w)}function k(h,T,w){return R((0,n.Deref)(h,T),T,w)}function q(h,T,w){if(!(0,t.IsArray)(w)||h.items===void 0&&w.length!==0||w.length!==h.maxItems)return!1;if(!h.items)return!0;for(let u=0;u<h.items.length;u++)if(!R(h.items[u],T,w[u]))return!1;return!0}function X(h,T,w){return(0,t.IsUndefined)(w)}function ye(h,T,w){return h.anyOf.some(u=>R(u,T,w))}function d(h,T,w){return!(!(0,t.IsUint8Array)(w)||c(h.maxByteLength)&&!(w.length<=h.maxByteLength)||c(h.minByteLength)&&!(w.length>=h.minByteLength))}function _(h,T,w){return!0}function I(h,T,w){return r.TypeSystemPolicy.IsVoidLike(w)}function U(h,T,w){return o.TypeRegistry.Has(h[o.Kind])?o.TypeRegistry.Get(h[o.Kind])(h,w):!1}function R(h,T,w){let u=c(h.$id)?[...T,h]:T,A=h;switch(A[o.Kind]){case"Any":return f(A,u,w);case"Array":return l(A,u,w);case"AsyncIterator":return g(A,u,w);case"BigInt":return P(A,u,w);case"Boolean":return E(A,u,w);case"Constructor":return M(A,u,w);case"Date":return z(A,u,w);case"Function":return Q(A,u,w);case"Integer":return F(A,u,w);case"Intersect":return L(A,u,w);case"Iterator":return G(A,u,w);case"Literal":return H(A,u,w);case"Never":return j(A,u,w);case"Not":return re(A,u,w);case"Null":return W(A,u,w);case"Number":return pe(A,u,w);case"Object":return $(A,u,w);case"Promise":return B(A,u,w);case"Record":return D(A,u,w);case"Ref":return Z(A,u,w);case"String":return se(A,u,w);case"Symbol":return Y(A,u,w);case"TemplateLiteral":return ue(A,u,w);case"This":return k(A,u,w);case"Tuple":return q(A,u,w);case"Undefined":return X(A,u,w);case"Union":return ye(A,u,w);case"Uint8Array":return d(A,u,w);case"Unknown":return _(A,u,w);case"Void":return I(A,u,w);default:if(!o.TypeRegistry.Has(A[o.Kind]))throw new s(A);return U(A,u,w)}}function S(...h){return h.length===3?R(h[0],h[1],h[2]):R(h[0],[],h[1])}e.Check=S}}),Zm=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/transform.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodeTransform=e.DecodeTransform=e.HasTransform=e.TransformEncodeError=e.TransformDecodeError=e.TransformEncodeCheckError=e.TransformDecodeCheckError=void 0;var t=Bn(),r=ns(),n=Qm(),i=dr(),o=class extends i.TypeBoxError{constructor(P,E,M){super("Unable to decode due to invalid value"),this.schema=P,this.value=E,this.error=M}};e.TransformDecodeCheckError=o;var s=class extends i.TypeBoxError{constructor(P,E,M){super("Unable to encode due to invalid value"),this.schema=P,this.value=E,this.error=M}};e.TransformEncodeCheckError=s;var a=class extends i.TypeBoxError{constructor(P,E,M){super(`${M instanceof Error?M.message:"Unknown error"}`),this.schema=P,this.value=E}};e.TransformDecodeError=a;var c=class extends i.TypeBoxError{constructor(P,E,M){super(`${M instanceof Error?M.message:"Unknown error"}`),this.schema=P,this.value=E}};e.TransformEncodeError=c;var f;(function(P){function E(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.items,ue)}function M(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.items,ue)}function z(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.returns,ue)||Y.parameters.some(k=>D(k,ue))}function Q(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.returns,ue)||Y.parameters.some(k=>D(k,ue))}function F(Y,ue){return i.TypeGuard.TTransform(Y)||i.TypeGuard.TTransform(Y.unevaluatedProperties)||Y.allOf.some(k=>D(k,ue))}function L(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.items,ue)}function G(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.not,ue)}function H(Y,ue){return i.TypeGuard.TTransform(Y)||Object.values(Y.properties).some(k=>D(k,ue))||i.TypeGuard.TSchema(Y.additionalProperties)&&D(Y.additionalProperties,ue)}function j(Y,ue){return i.TypeGuard.TTransform(Y)||D(Y.item,ue)}function re(Y,ue){let k=Object.getOwnPropertyNames(Y.patternProperties)[0],q=Y.patternProperties[k];return i.TypeGuard.TTransform(Y)||D(q,ue)||i.TypeGuard.TSchema(Y.additionalProperties)&&i.TypeGuard.TTransform(Y.additionalProperties)}function W(Y,ue){return i.TypeGuard.TTransform(Y)?!0:D((0,r.Deref)(Y,ue),ue)}function pe(Y,ue){return i.TypeGuard.TTransform(Y)?!0:D((0,r.Deref)(Y,ue),ue)}function $(Y,ue){return i.TypeGuard.TTransform(Y)||!(0,t.IsUndefined)(Y.items)&&Y.items.some(k=>D(k,ue))}function B(Y,ue){return i.TypeGuard.TTransform(Y)||Y.anyOf.some(k=>D(k,ue))}function D(Y,ue){let k=(0,t.IsString)(Y.$id)?[...ue,Y]:ue,q=Y;if(Y.$id&&Z.has(Y.$id))return!1;switch(Y.$id&&Z.add(Y.$id),Y[i.Kind]){case"Array":return E(q,k);case"AsyncIterator":return M(q,k);case"Constructor":return z(q,k);case"Function":return Q(q,k);case"Intersect":return F(q,k);case"Iterator":return L(q,k);case"Not":return G(q,k);case"Object":return H(q,k);case"Promise":return j(q,k);case"Record":return re(q,k);case"Ref":return W(q,k);case"This":return pe(q,k);case"Tuple":return $(q,k);case"Union":return B(q,k);default:return i.TypeGuard.TTransform(Y)}}let Z=new Set;function se(Y,ue){return Z.clear(),D(Y,ue)}P.Has=se})(f||(e.HasTransform=f={}));var l;(function(P){function E($,B){try{return i.TypeGuard.TTransform($)?$[i.Transform].Decode(B):B}catch(D){throw new a($,B,D)}}function M($,B,D){return(0,t.IsArray)(D)?E($,D.map(Z=>W($.items,B,Z))):E($,D)}function z($,B,D){if(!(0,t.IsPlainObject)(D)||(0,t.IsValueType)(D))return E($,D);let Z=i.KeyResolver.ResolveKeys($,{includePatterns:!1}),se=Z.reduce((q,X)=>X in q?{...q,[X]:W(i.IndexedAccessor.Resolve($,[X]),B,q[X])}:q,D);if(!i.TypeGuard.TTransform($.unevaluatedProperties))return E($,se);let Y=Object.getOwnPropertyNames(se),ue=$.unevaluatedProperties,k=Y.reduce((q,X)=>Z.includes(X)?q:{...q,[X]:E(ue,q[X])},se);return E($,k)}function Q($,B,D){return E($,W($.not,B,D))}function F($,B,D){if(!(0,t.IsPlainObject)(D))return E($,D);let Z=i.KeyResolver.ResolveKeys($,{includePatterns:!1}),se=Z.reduce((q,X)=>X in q?{...q,[X]:W($.properties[X],B,q[X])}:q,D);if(!i.TypeGuard.TSchema($.additionalProperties))return E($,se);let Y=Object.getOwnPropertyNames(se),ue=$.additionalProperties,k=Y.reduce((q,X)=>Z.includes(X)?q:{...q,[X]:E(ue,q[X])},se);return E($,k)}function L($,B,D){if(!(0,t.IsPlainObject)(D))return E($,D);let Z=Object.getOwnPropertyNames($.patternProperties)[0],se=new RegExp(Z),Y=Object.getOwnPropertyNames(D).reduce((X,ye)=>se.test(ye)?{...X,[ye]:W($.patternProperties[Z],B,X[ye])}:X,D);if(!i.TypeGuard.TSchema($.additionalProperties))return E($,Y);let ue=Object.getOwnPropertyNames(Y),k=$.additionalProperties,q=ue.reduce((X,ye)=>se.test(ye)?X:{...X,[ye]:E(k,X[ye])},Y);return E($,q)}function G($,B,D){let Z=(0,r.Deref)($,B);return E($,W(Z,B,D))}function H($,B,D){let Z=(0,r.Deref)($,B);return E($,W(Z,B,D))}function j($,B,D){return(0,t.IsArray)(D)&&(0,t.IsArray)($.items)?E($,$.items.map((Z,se)=>W(Z,B,D[se]))):E($,D)}function re($,B,D){let Z=E($,D);for(let se of $.anyOf)if((0,n.Check)(se,B,Z))return W(se,B,Z);return Z}function W($,B,D){let Z=typeof $.$id=="string"?[...B,$]:B,se=$;switch($[i.Kind]){case"Array":return M(se,Z,D);case"Intersect":return z(se,Z,D);case"Not":return Q(se,Z,D);case"Object":return F(se,Z,D);case"Record":return L(se,Z,D);case"Ref":return G(se,Z,D);case"Symbol":return E(se,D);case"This":return H(se,Z,D);case"Tuple":return j(se,Z,D);case"Union":return re(se,Z,D);default:return E(se,D)}}function pe($,B,D){return W($,B,D)}P.Decode=pe})(l||(e.DecodeTransform=l={}));var g;(function(P){function E($,B){try{return i.TypeGuard.TTransform($)?$[i.Transform].Encode(B):B}catch(D){throw new c($,B,D)}}function M($,B,D){let Z=E($,D);return(0,t.IsArray)(Z)?Z.map(se=>W($.items,B,se)):Z}function z($,B,D){let Z=E($,D);if(!(0,t.IsPlainObject)(D)||(0,t.IsValueType)(D))return Z;let se=i.KeyResolver.ResolveKeys($,{includePatterns:!1}),Y=se.reduce((q,X)=>X in Z?{...q,[X]:W(i.IndexedAccessor.Resolve($,[X]),B,q[X])}:q,Z);if(!i.TypeGuard.TTransform($.unevaluatedProperties))return E($,Y);let ue=Object.getOwnPropertyNames(Y),k=$.unevaluatedProperties;return ue.reduce((q,X)=>se.includes(X)?q:{...q,[X]:E(k,q[X])},Y)}function Q($,B,D){return E($.not,E($,D))}function F($,B,D){let Z=E($,D);if(!(0,t.IsPlainObject)(D))return Z;let se=i.KeyResolver.ResolveKeys($,{includePatterns:!1}),Y=se.reduce((q,X)=>X in q?{...q,[X]:W($.properties[X],B,q[X])}:q,Z);if(!i.TypeGuard.TSchema($.additionalProperties))return Y;let ue=Object.getOwnPropertyNames(Y),k=$.additionalProperties;return ue.reduce((q,X)=>se.includes(X)?q:{...q,[X]:E(k,q[X])},Y)}function L($,B,D){let Z=E($,D);if(!(0,t.IsPlainObject)(D))return Z;let se=Object.getOwnPropertyNames($.patternProperties)[0],Y=new RegExp(se),ue=Object.getOwnPropertyNames(D).reduce((X,ye)=>Y.test(ye)?{...X,[ye]:W($.patternProperties[se],B,X[ye])}:X,Z);if(!i.TypeGuard.TSchema($.additionalProperties))return E($,ue);let k=Object.getOwnPropertyNames(ue),q=$.additionalProperties;return k.reduce((X,ye)=>Y.test(ye)?X:{...X,[ye]:E(q,X[ye])},ue)}function G($,B,D){let Z=(0,r.Deref)($,B),se=W(Z,B,D);return E($,se)}function H($,B,D){let Z=(0,r.Deref)($,B),se=W(Z,B,D);return E($,se)}function j($,B,D){let Z=E($,D);return(0,t.IsArray)($.items)?$.items.map((se,Y)=>W(se,B,Z[Y])):[]}function re($,B,D){for(let Z of $.anyOf){if(!(0,n.Check)(Z,B,D))continue;let se=W(Z,B,D);return E($,se)}for(let Z of $.anyOf){let se=W(Z,B,D);if((0,n.Check)($,B,se))return E($,se)}return E($,D)}function W($,B,D){let Z=typeof $.$id=="string"?[...B,$]:B,se=$;switch($[i.Kind]){case"Array":return M(se,Z,D);case"Intersect":return z(se,Z,D);case"Not":return Q(se,Z,D);case"Object":return F(se,Z,D);case"Record":return L(se,Z,D);case"Ref":return G(se,Z,D);case"This":return H(se,Z,D);case"Tuple":return j(se,Z,D);case"Union":return re(se,Z,D);default:return E(se,D)}}function pe($,B,D){return W($,B,D)}P.Encode=pe})(g||(e.EncodeTransform=g={}))}}),eb=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/compiler.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeCompiler=e.Policy=e.TypeCompilerTypeGuardError=e.TypeCompilerUnknownTypeError=e.TypeCheck=void 0;var t=Zm(),r=Bn(),n=is(),i=xd(),o=ns(),s=Ja(),a=dr(),c=class{constructor(F,L,G,H){this.schema=F,this.references=L,this.checkFunc=G,this.code=H,this.hasTransform=t.HasTransform.Has(F,L)}Code(){return this.code}Errors(F){return(0,n.Errors)(this.schema,this.references,F)}Check(F){return this.checkFunc(F)}Decode(F){if(!this.checkFunc(F))throw new t.TransformDecodeCheckError(this.schema,F,this.Errors(F).First());return this.hasTransform?t.DecodeTransform.Decode(this.schema,this.references,F):F}Encode(F){let L=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,F):F;if(!this.checkFunc(L))throw new t.TransformEncodeCheckError(this.schema,F,this.Errors(F).First());return L}};e.TypeCheck=c;var f;(function(F){function L(re){return re===36}F.DollarSign=L;function G(re){return re===95}F.IsUnderscore=G;function H(re){return re>=65&&re<=90||re>=97&&re<=122}F.IsAlpha=H;function j(re){return re>=48&&re<=57}F.IsNumeric=j})(f||(f={}));var l;(function(F){function L(re){return re.length===0?!1:f.IsNumeric(re.charCodeAt(0))}function G(re){if(L(re))return!1;for(let W=0;W<re.length;W++){let pe=re.charCodeAt(W);if(!(f.IsAlpha(pe)||f.IsNumeric(pe)||f.DollarSign(pe)||f.IsUnderscore(pe)))return!1}return!0}function H(re){return re.replace(/'/g,"\\'")}function j(re,W){return G(W)?`${re}.${W}`:`${re}['${H(W)}']`}F.Encode=j})(l||(l={}));var g;(function(F){function L(G){let H=[];for(let j=0;j<G.length;j++){let re=G.charCodeAt(j);f.IsNumeric(re)||f.IsAlpha(re)?H.push(G.charAt(j)):H.push(`_${re}_`)}return H.join("").replace(/__/g,"_")}F.Encode=L})(g||(g={}));var P;(function(F){function L(G){return G.replace(/'/g,"\\'")}F.Escape=L})(P||(P={}));var E=class extends a.TypeBoxError{constructor(F){super("Unknown type"),this.schema=F}};e.TypeCompilerUnknownTypeError=E;var M=class extends a.TypeBoxError{constructor(F){super("Preflight validation check failed to guard for the given schema"),this.schema=F}};e.TypeCompilerTypeGuardError=M;var z;(function(F){function L(W,pe,$){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${pe}' in ${W} ? ${$} : true)`:`(${l.Encode(W,pe)} !== undefined ? ${$} : true)`}F.IsExactOptionalProperty=L;function G(W){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${W} === 'object' && ${W} !== null)`:`(typeof ${W} === 'object' && ${W} !== null && !Array.isArray(${W}))`}F.IsObjectLike=G;function H(W){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${W} === 'object' && ${W} !== null && !(${W} instanceof Date) && !(${W} instanceof Uint8Array))`:`(typeof ${W} === 'object' && ${W} !== null && !Array.isArray(${W}) && !(${W} instanceof Date) && !(${W} instanceof Uint8Array))`}F.IsRecordLike=H;function j(W){return i.TypeSystemPolicy.AllowNaN?`typeof ${W} === 'number'`:`(typeof ${W} === 'number' && Number.isFinite(${W}))`}F.IsNumberLike=j;function re(W){return i.TypeSystemPolicy.AllowNullVoid?`(${W} === undefined || ${W} === null)`:`${W} === undefined`}F.IsVoidLike=re})(z||(e.Policy=z={}));var Q;(function(F){function L(O){return O[a.Kind]==="Any"||O[a.Kind]==="Unknown"}function*G(O,le,N){yield"true"}function*H(O,le,N){yield`Array.isArray(${N})`;let[me,ie]=[Fe("value","any"),Fe("acc","number")];(0,r.IsNumber)(O.maxItems)&&(yield`${N}.length <= ${O.maxItems}`),(0,r.IsNumber)(O.minItems)&&(yield`${N}.length >= ${O.minItems}`);let de=ne(O.items,le,"value");if(yield`${N}.every((${me}) => ${de})`,a.TypeGuard.TSchema(O.contains)||(0,r.IsNumber)(O.minContains)||(0,r.IsNumber)(O.maxContains)){let xe=a.TypeGuard.TSchema(O.contains)?O.contains:a.Type.Never(),Le=ne(xe,le,"value"),tt=(0,r.IsNumber)(O.minContains)?[`(count >= ${O.minContains})`]:[],Ze=(0,r.IsNumber)(O.maxContains)?[`(count <= ${O.maxContains})`]:[],nt=`const count = value.reduce((${ie}, ${me}) => ${Le} ? acc + 1 : acc, 0)`,or=["(count > 0)",...tt,...Ze].join(" && ");yield`((${me}) => { ${nt}; return ${or}})(${N})`}O.uniqueItems===!0&&(yield`((${me}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${N})`)}function*j(O,le,N){yield`(typeof value === 'object' && Symbol.asyncIterator in ${N})`}function*re(O,le,N){yield`(typeof ${N} === 'bigint')`,(0,r.IsBigInt)(O.exclusiveMaximum)&&(yield`${N} < BigInt(${O.exclusiveMaximum})`),(0,r.IsBigInt)(O.exclusiveMinimum)&&(yield`${N} > BigInt(${O.exclusiveMinimum})`),(0,r.IsBigInt)(O.maximum)&&(yield`${N} <= BigInt(${O.maximum})`),(0,r.IsBigInt)(O.minimum)&&(yield`${N} >= BigInt(${O.minimum})`),(0,r.IsBigInt)(O.multipleOf)&&(yield`(${N} % BigInt(${O.multipleOf})) === 0`)}function*W(O,le,N){yield`(typeof ${N} === 'boolean')`}function*pe(O,le,N){yield*K(O.returns,le,`${N}.prototype`)}function*$(O,le,N){yield`(${N} instanceof Date) && Number.isFinite(${N}.getTime())`,(0,r.IsNumber)(O.exclusiveMaximumTimestamp)&&(yield`${N}.getTime() < ${O.exclusiveMaximumTimestamp}`),(0,r.IsNumber)(O.exclusiveMinimumTimestamp)&&(yield`${N}.getTime() > ${O.exclusiveMinimumTimestamp}`),(0,r.IsNumber)(O.maximumTimestamp)&&(yield`${N}.getTime() <= ${O.maximumTimestamp}`),(0,r.IsNumber)(O.minimumTimestamp)&&(yield`${N}.getTime() >= ${O.minimumTimestamp}`),(0,r.IsNumber)(O.multipleOfTimestamp)&&(yield`(${N}.getTime() % ${O.multipleOfTimestamp}) === 0`)}function*B(O,le,N){yield`(typeof ${N} === 'function')`}function*D(O,le,N){yield`(typeof ${N} === 'number' && Number.isInteger(${N}))`,(0,r.IsNumber)(O.exclusiveMaximum)&&(yield`${N} < ${O.exclusiveMaximum}`),(0,r.IsNumber)(O.exclusiveMinimum)&&(yield`${N} > ${O.exclusiveMinimum}`),(0,r.IsNumber)(O.maximum)&&(yield`${N} <= ${O.maximum}`),(0,r.IsNumber)(O.minimum)&&(yield`${N} >= ${O.minimum}`),(0,r.IsNumber)(O.multipleOf)&&(yield`(${N} % ${O.multipleOf}) === 0`)}function*Z(O,le,N){let me=O.allOf.map(ie=>ne(ie,le,N)).join(" && ");if(O.unevaluatedProperties===!1){let ie=_e(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),de=`Object.getOwnPropertyNames(${N}).every(key => ${ie}.test(key))`;yield`(${me} && ${de})`}else if(a.TypeGuard.TSchema(O.unevaluatedProperties)){let ie=_e(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),de=`Object.getOwnPropertyNames(${N}).every(key => ${ie}.test(key) || ${ne(O.unevaluatedProperties,le,`${N}[key]`)})`;yield`(${me} && ${de})`}else yield`(${me})`}function*se(O,le,N){yield`(typeof value === 'object' && Symbol.iterator in ${N})`}function*Y(O,le,N){typeof O.const=="number"||typeof O.const=="boolean"?yield`(${N} === ${O.const})`:yield`(${N} === '${P.Escape(O.const)}')`}function*ue(O,le,N){yield"false"}function*k(O,le,N){yield`(!${ne(O.not,le,N)})`}function*q(O,le,N){yield`(${N} === null)`}function*X(O,le,N){yield z.IsNumberLike(N),(0,r.IsNumber)(O.exclusiveMaximum)&&(yield`${N} < ${O.exclusiveMaximum}`),(0,r.IsNumber)(O.exclusiveMinimum)&&(yield`${N} > ${O.exclusiveMinimum}`),(0,r.IsNumber)(O.maximum)&&(yield`${N} <= ${O.maximum}`),(0,r.IsNumber)(O.minimum)&&(yield`${N} >= ${O.minimum}`),(0,r.IsNumber)(O.multipleOf)&&(yield`(${N} % ${O.multipleOf}) === 0`)}function*ye(O,le,N){yield z.IsObjectLike(N),(0,r.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${N}).length >= ${O.minProperties}`),(0,r.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${N}).length <= ${O.maxProperties}`);let me=Object.getOwnPropertyNames(O.properties);for(let ie of me){let de=l.Encode(N,ie),xe=O.properties[ie];if(O.required&&O.required.includes(ie))yield*K(xe,le,de),(a.ExtendsUndefined.Check(xe)||L(xe))&&(yield`('${ie}' in ${N})`);else{let Le=ne(xe,le,de);yield z.IsExactOptionalProperty(N,ie,Le)}}if(O.additionalProperties===!1)if(O.required&&O.required.length===me.length)yield`Object.getOwnPropertyNames(${N}).length === ${me.length}`;else{let ie=`[${me.map(de=>`'${de}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${N}).every(key => ${ie}.includes(key))`}if(typeof O.additionalProperties=="object"){let ie=ne(O.additionalProperties,le,`${N}[key]`),de=`[${me.map(xe=>`'${xe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${N}).every(key => ${de}.includes(key) || ${ie}))`}}function*d(O,le,N){yield`(typeof value === 'object' && typeof ${N}.then === 'function')`}function*_(O,le,N){yield z.IsRecordLike(N),(0,r.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${N}).length >= ${O.minProperties}`),(0,r.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${N}).length <= ${O.maxProperties}`);let[me,ie]=Object.entries(O.patternProperties)[0],de=_e(`${new RegExp(me)}`),xe=ne(ie,le,"value"),Le=a.TypeGuard.TSchema(O.additionalProperties)?ne(O.additionalProperties,le,N):O.additionalProperties===!1?"false":"true",tt=`(${de}.test(key) ? ${xe} : ${Le})`;yield`(Object.entries(${N}).every(([key, value]) => ${tt}))`}function*I(O,le,N){let me=(0,o.Deref)(O,le);if(te.functions.has(O.$ref))return yield`${ge(O.$ref)}(${N})`;yield*K(me,le,N)}function*U(O,le,N){yield`(typeof ${N} === 'string')`,(0,r.IsNumber)(O.maxLength)&&(yield`${N}.length <= ${O.maxLength}`),(0,r.IsNumber)(O.minLength)&&(yield`${N}.length >= ${O.minLength}`),O.pattern!==void 0&&(yield`${_e(`${new RegExp(O.pattern)};`)}.test(${N})`),O.format!==void 0&&(yield`format('${O.format}', ${N})`)}function*R(O,le,N){yield`(typeof ${N} === 'symbol')`}function*S(O,le,N){yield`(typeof ${N} === 'string')`,yield`${_e(`${new RegExp(O.pattern)};`)}.test(${N})`}function*h(O,le,N){yield`${ge(O.$ref)}(${N})`}function*T(O,le,N){if(yield`Array.isArray(${N})`,O.items===void 0)return yield`${N}.length === 0`;yield`(${N}.length === ${O.maxItems})`;for(let me=0;me<O.items.length;me++)yield`${ne(O.items[me],le,`${N}[${me}]`)}`}function*w(O,le,N){yield`${N} === undefined`}function*u(O,le,N){yield`(${O.anyOf.map(ie=>ne(ie,le,N)).join(" || ")})`}function*A(O,le,N){yield`${N} instanceof Uint8Array`,(0,r.IsNumber)(O.maxByteLength)&&(yield`(${N}.length <= ${O.maxByteLength})`),(0,r.IsNumber)(O.minByteLength)&&(yield`(${N}.length >= ${O.minByteLength})`)}function*v(O,le,N){yield"true"}function*b(O,le,N){yield z.IsVoidLike(N)}function*x(O,le,N){let me=te.instances.size;te.instances.set(me,O),yield`kind('${O[a.Kind]}', ${me}, ${N})`}function*K(O,le,N,me=!0){let ie=(0,r.IsString)(O.$id)?[...le,O]:le,de=O;if(me&&(0,r.IsString)(O.$id)){let xe=ge(O.$id);if(te.functions.has(xe))return yield`${xe}(${N})`;{let Le=Be(xe,O,le,"value",!1);return te.functions.set(xe,Le),yield`${xe}(${N})`}}switch(de[a.Kind]){case"Any":return yield*G(de,ie,N);case"Array":return yield*H(de,ie,N);case"AsyncIterator":return yield*j(de,ie,N);case"BigInt":return yield*re(de,ie,N);case"Boolean":return yield*W(de,ie,N);case"Constructor":return yield*pe(de,ie,N);case"Date":return yield*$(de,ie,N);case"Function":return yield*B(de,ie,N);case"Integer":return yield*D(de,ie,N);case"Intersect":return yield*Z(de,ie,N);case"Iterator":return yield*se(de,ie,N);case"Literal":return yield*Y(de,ie,N);case"Never":return yield*ue(de,ie,N);case"Not":return yield*k(de,ie,N);case"Null":return yield*q(de,ie,N);case"Number":return yield*X(de,ie,N);case"Object":return yield*ye(de,ie,N);case"Promise":return yield*d(de,ie,N);case"Record":return yield*_(de,ie,N);case"Ref":return yield*I(de,ie,N);case"String":return yield*U(de,ie,N);case"Symbol":return yield*R(de,ie,N);case"TemplateLiteral":return yield*S(de,ie,N);case"This":return yield*h(de,ie,N);case"Tuple":return yield*T(de,ie,N);case"Undefined":return yield*w(de,ie,N);case"Union":return yield*u(de,ie,N);case"Uint8Array":return yield*A(de,ie,N);case"Unknown":return yield*v(de,ie,N);case"Void":return yield*b(de,ie,N);default:if(!a.TypeRegistry.Has(de[a.Kind]))throw new E(O);return yield*x(de,ie,N)}}let te={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function ne(O,le,N,me=!0){return`(${[...K(O,le,N,me)].join(" && ")})`}function ge(O){return`check_${g.Encode(O)}`}function _e(O){let le=`local_${te.variables.size}`;return te.variables.set(le,`const ${le} = ${O}`),le}function Be(O,le,N,me,ie=!0){let[de,xe]=[`
49
49
  `,nt=>"".padStart(nt," ")],Le=Fe("value","any"),tt=Br("boolean"),Ze=[...K(le,N,me,ie)].map(nt=>`${xe(4)}${nt}`).join(` &&${de}`);return`function ${O}(${Le})${tt} {${de}${xe(2)}return (${de}${Ze}${de}${xe(2)})
50
50
  }`}function Fe(O,le){let N=te.language==="typescript"?`: ${le}`:"";return`${O}${N}`}function Br(O){return te.language==="typescript"?`: ${O}`:""}function we(O,le,N){let me=Be("check",O,le,"value"),ie=Fe("value","any"),de=Br("boolean"),xe=[...te.functions.values()],Le=[...te.variables.values()],tt=(0,r.IsString)(O.$id)?`return function check(${ie})${de} {
51
51
  return ${ge(O.$id)}(value)
52
52
  }`:`return ${me}`;return[...Le,...xe,tt].join(`
53
- `)}function gr(...O){let le={language:"javascript"},[N,me,ie]=O.length===2&&(0,r.IsArray)(O[1])?[O[0],O[1],le]:O.length===2&&!(0,r.IsArray)(O[1])?[O[0],[],O[1]]:O.length===3?[O[0],O[1],O[2]]:O.length===1?[O[0],[],le]:[null,[],le];if(te.language=ie.language,te.variables.clear(),te.functions.clear(),te.instances.clear(),!a.TypeGuard.TSchema(N))throw new M(N);for(let de of me)if(!a.TypeGuard.TSchema(de))throw new M(de);return we(N,me,ie)}F.Code=gr;function Mr(O,le=[]){let N=gr(O,le,{language:"javascript"}),me=globalThis.Function("kind","format","hash",N),ie=new Map(te.instances);function de(Ze,nt,or){if(!a.TypeRegistry.Has(Ze)||!ie.has(nt))return!1;let ln=a.TypeRegistry.Get(Ze),dn=ie.get(nt);return ln(dn,or)}function xe(Ze,nt){return a.FormatRegistry.Has(Ze)?a.FormatRegistry.Get(Ze)(nt):!1}function Le(Ze){return(0,s.Hash)(Ze)}let tt=me(de,xe,Le);return new c(O,le,tt,N)}F.Compile=Mr})(Q||(e.TypeCompiler=Q={}))}}),tb=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,o,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(o,s);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,a,c)}:function(i,o,s,a){a===void 0&&(a=s),i[a]=o[s]}),r=e&&e.__exportStar||function(i,o){for(var s in i)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,i,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorIterator=e.ValueErrorType=void 0;var n=Ym();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return n.ValueErrorIterator}}),r(eb(),e)}}),Lo=Ut(Hm(),1),rb=Ut(Jm(),1),Nd=!1,Pd=!1;Lo.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(Nd=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(Pd=process?.env?.LOGGER_PERF_PREFIX==="true"));var nb={prefix:void 0,time:Nd,delta:Pd,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},Oa=[],Rd=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,r,n){Object.assign(this,{sinceFirst:e,sinceLast:t,time:r,delta:n})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),r=this.sinceLast<1e3?`${this.sinceLast.toFixed(0)}`.padStart(5," "):`${`${(this.sinceLast*.001).toFixed(this.sinceLast<1e4?1:0)}`.padStart(4," ")}s`;return`[${[this.time?t:null,this.delta?r:null].filter(n=>n!=null).join(",")}]`}},Cd=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},wi=!1,Ce=class st{static ERROR=2;static WARN=4;static INFO=6;static LOG=6;static DEBUG=8;static VERBOSE=10;static firstLog=0;static lastLog=0;static setup(t=st.INFO,r={}){r=Object.assign({},nb,r),t>10&&console.debug("setup logger",{config:r});let n=this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}),i=(...c)=>{typeof window<"u"&&window?.FORCE_DISABLE_LOGLEVEL&&n(...c)};i.isDisabled=!0,i.isEnabled=!1;let o=this.wrapLog(console.groupCollapsed,r),s=(c,f)=>{function l(...P){let E=P[P.length-1];return E===i?E():(o(...P.slice(0,-1)),(async()=>{try{let M=E();return M instanceof Promise?await M:M}finally{console.groupEnd()}})())}let g=Object.assign(f.bind({}),{isEnabled:c,isDisabled:!c,group:l,force:f});return c?g:Object.assign(i.bind({}),{isEnabled:c,isDisabled:!c,group:l,force:g})},a=s(t>=st.ERROR,this.wrapLog(console.error,r));return{ERROR:(...c)=>(a(...c),new Error(c.map(f=>typeof f=="string"?f:(0,rb.default)(f)).join(" "))),WARN:s(t>=st.WARN,this.wrapLog(console.warn,r)),LOG:s(t>=st.INFO,this.wrapLog(console.log,r)),DEBUG:s(t>=st.DEBUG,this.wrapLog(console.log,{...r,dim:r.dimDebugOnServer})),VERBOSE:s(t>=st.VERBOSE,this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}))}}static wrapLog(t,r){if(Lo.isNode)return t.bind(console);{let n=[];if(r.time||r.delta){let i=Lo.isBrowser&&navigator.userAgent.includes("Chrome")?["",st.timeStr(!!r.time,!!r.delta)]:[];n.push(...i)}return r.prefix&&(wi?n.push(new Cd("dim",r.prefix)):n.push(r.prefix)),t.bind(console,...n)}}static timeStr(t,r,n=0){if(!performance.now)return;let i=performance.now();st.firstLog||(st.firstLog=i,st.lastLog=i);let o=new Rd(i-st.firstLog,i-st.lastLog,t,r);return st.lastLog=i,n?o.toString():o}static getOriginFromStack(t){let r=!1;for(let n of t.split(`
54
- `)){let i=n.match(/^\s+at\s+(.*)/);if(i){if(r)return i[1].trim().replace(__dirname,"");r=!0}}}};Lo.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Oa&&Oa.length){for(let t of Oa)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof Rd))return null;wi||(wi=!0);let t=Ce.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof Cd?(wi||(wi=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var ib=typeof global=="object"&&global&&global.Object===Object&&global,$d=ib,ob=typeof self=="object"&&self&&self.Object===Object&&self,sb=$d||ob||Function("return this")(),bt=sb,ab=bt.Symbol,tr=ab,Ud=Object.prototype,ub=Ud.hasOwnProperty,cb=Ud.toString,bi=tr?tr.toStringTag:void 0;function fb(e){var t=ub.call(e,bi),r=e[bi];try{e[bi]=void 0;var n=!0}catch{}var i=cb.call(e);return n&&(t?e[bi]=r:delete e[bi]),i}var lb=fb,db=Object.prototype,pb=db.toString;function yb(e){return pb.call(e)}var hb=yb,gb="[object Null]",mb="[object Undefined]",_l=tr?tr.toStringTag:void 0;function bb(e){return e==null?e===void 0?mb:gb:_l&&_l in Object(e)?lb(e):hb(e)}var Bn=bb;function vb(e){return e!=null&&typeof e=="object"}var Rr=vb,_b="[object Symbol]";function wb(e){return typeof e=="symbol"||Rr(e)&&Bn(e)==_b}var $n=wb;function Tb(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Bd=Tb,Ab=Array.isArray,Jt=Ab,Ob=1/0,wl=tr?tr.prototype:void 0,Tl=wl?wl.toString:void 0;function Md(e){if(typeof e=="string")return e;if(Jt(e))return Bd(e,Md)+"";if($n(e))return Tl?Tl.call(e):"";var t=e+"";return t=="0"&&1/e==-Ob?"-0":t}var Ib=Md,Eb=/\s/;function Sb(e){for(var t=e.length;t--&&Eb.test(e.charAt(t)););return t}var xb=Sb,Nb=/^\s+/;function Pb(e){return e&&e.slice(0,xb(e)+1).replace(Nb,"")}var Rb=Pb;function Cb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pr=Cb,Al=NaN,$b=/^[-+]0x[0-9a-f]+$/i,Ub=/^0b[01]+$/i,Bb=/^0o[0-7]+$/i,Mb=parseInt;function kb(e){if(typeof e=="number")return e;if($n(e))return Al;if(pr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=pr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Rb(e);var r=Ub.test(e);return r||Bb.test(e)?Mb(e.slice(2),r?2:8):$b.test(e)?Al:+e}var Db=kb,Ol=1/0,Lb=17976931348623157e292;function jb(e){if(!e)return e===0?e:0;if(e=Db(e),e===Ol||e===-Ol){var t=e<0?-1:1;return t*Lb}return e===e?e:0}var Fb=jb;function Vb(e){var t=Fb(e),r=t%1;return t===t?r?t-r:t:0}var Il=Vb;function Kb(e){return e}var is=Kb,zb="[object AsyncFunction]",qb="[object Function]",Gb="[object GeneratorFunction]",Wb="[object Proxy]";function Hb(e){if(!pr(e))return!1;var t=Bn(e);return t==qb||t==Gb||t==zb||t==Wb}var kd=Hb,Jb=bt["__core-js_shared__"],Ia=Jb,El=function(){var e=/[^.]+$/.exec(Ia&&Ia.keys&&Ia.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Xb(e){return!!El&&El in e}var Yb=Xb,Qb=Function.prototype,Zb=Qb.toString;function ev(e){if(e!=null){try{return Zb.call(e)}catch{}try{return e+""}catch{}}return""}var rn=ev,tv=/[\\^$.*+?()[\]{}|]/g,rv=/^\[object .+?Constructor\]$/,nv=Function.prototype,iv=Object.prototype,ov=nv.toString,sv=iv.hasOwnProperty,av=RegExp("^"+ov.call(sv).replace(tv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uv(e){if(!pr(e)||Yb(e))return!1;var t=kd(e)?av:rv;return t.test(rn(e))}var cv=uv;function fv(e,t){return e?.[t]}var lv=fv;function dv(e,t){var r=lv(e,t);return cv(r)?r:void 0}var nn=dv,pv=nn(bt,"WeakMap"),Ai=pv,yv=Ai&&new Ai,jo=yv,hv=jo?function(e,t){return jo.set(e,t),e}:is,Dd=hv,Sl=Object.create,gv=function(){function e(){}return function(t){if(!pr(t))return{};if(Sl)return Sl(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Xa=gv;function mv(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Xa(e.prototype),n=e.apply(r,t);return pr(n)?n:r}}var Oi=mv,bv=1;function vv(e,t,r){var n=t&bv,i=Oi(e);function o(){var s=this&&this!==bt&&this instanceof o?i:e;return s.apply(n?r:this,arguments)}return o}var _v=vv;function wv(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Ya=wv,Tv=Math.max;function Av(e,t,r,n){for(var i=-1,o=e.length,s=r.length,a=-1,c=t.length,f=Tv(o-s,0),l=Array(c+f),g=!n;++a<c;)l[a]=t[a];for(;++i<s;)(g||i<o)&&(l[r[i]]=e[i]);for(;f--;)l[a++]=e[i++];return l}var Ld=Av,Ov=Math.max;function Iv(e,t,r,n){for(var i=-1,o=e.length,s=-1,a=r.length,c=-1,f=t.length,l=Ov(o-a,0),g=Array(l+f),P=!n;++i<l;)g[i]=e[i];for(var E=i;++c<f;)g[E+c]=t[c];for(;++s<a;)(P||i<o)&&(g[E+r[s]]=e[i++]);return g}var jd=Iv;function Ev(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Sv=Ev;function xv(){}var Qa=xv,Nv=4294967295;function Fo(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Nv,this.__views__=[]}Fo.prototype=Xa(Qa.prototype);Fo.prototype.constructor=Fo;var Za=Fo;function Pv(){}var Fd=Pv,Rv=jo?function(e){return jo.get(e)}:Fd,Vd=Rv,Cv={},xl=Cv,$v=Object.prototype,Uv=$v.hasOwnProperty;function Bv(e){for(var t=e.name+"",r=xl[t],n=Uv.call(xl,t)?r.length:0;n--;){var i=r[n],o=i.func;if(o==null||o==e)return i.name}return t}var Mv=Bv;function Vo(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Vo.prototype=Xa(Qa.prototype);Vo.prototype.constructor=Vo;var Ma=Vo;function kv(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Kd=kv;function Dv(e){if(e instanceof Za)return e.clone();var t=new Ma(e.__wrapped__,e.__chain__);return t.__actions__=Kd(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lv=Dv,jv=Object.prototype,Fv=jv.hasOwnProperty;function Ko(e){if(Rr(e)&&!Jt(e)&&!(e instanceof Za)){if(e instanceof Ma)return e;if(Fv.call(e,"__wrapped__"))return Lv(e)}return new Ma(e)}Ko.prototype=Qa.prototype;Ko.prototype.constructor=Ko;var Vv=Ko;function Kv(e){var t=Mv(e),r=Vv[t];if(typeof r!="function"||!(t in Za.prototype))return!1;if(e===r)return!0;var n=Vd(r);return!!n&&e===n[0]}var zv=Kv,qv=800,Gv=16,Wv=Date.now;function Hv(e){var t=0,r=0;return function(){var n=Wv(),i=Gv-(n-r);if(r=n,i>0){if(++t>=qv)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var zd=Hv,Jv=zd(Dd),qd=Jv,Xv=/\{\n\/\* \[wrapped with (.+)\] \*/,Yv=/,? & /;function Qv(e){var t=e.match(Xv);return t?t[1].split(Yv):[]}var Zv=Qv,e_=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function t_(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(e_,`{
53
+ `)}function gr(...O){let le={language:"javascript"},[N,me,ie]=O.length===2&&(0,r.IsArray)(O[1])?[O[0],O[1],le]:O.length===2&&!(0,r.IsArray)(O[1])?[O[0],[],O[1]]:O.length===3?[O[0],O[1],O[2]]:O.length===1?[O[0],[],le]:[null,[],le];if(te.language=ie.language,te.variables.clear(),te.functions.clear(),te.instances.clear(),!a.TypeGuard.TSchema(N))throw new M(N);for(let de of me)if(!a.TypeGuard.TSchema(de))throw new M(de);return we(N,me,ie)}F.Code=gr;function Mr(O,le=[]){let N=gr(O,le,{language:"javascript"}),me=globalThis.Function("kind","format","hash",N),ie=new Map(te.instances);function de(Ze,nt,or){if(!a.TypeRegistry.Has(Ze)||!ie.has(nt))return!1;let dn=a.TypeRegistry.Get(Ze),pn=ie.get(nt);return dn(pn,or)}function xe(Ze,nt){return a.FormatRegistry.Has(Ze)?a.FormatRegistry.Get(Ze)(nt):!1}function Le(Ze){return(0,s.Hash)(Ze)}let tt=me(de,xe,Le);return new c(O,le,tt,N)}F.Compile=Mr})(Q||(e.TypeCompiler=Q={}))}}),tb=De({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,o,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(o,s);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,a,c)}:function(i,o,s,a){a===void 0&&(a=s),i[a]=o[s]}),r=e&&e.__exportStar||function(i,o){for(var s in i)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,i,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorIterator=e.ValueErrorType=void 0;var n=Ym();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return n.ValueErrorIterator}}),r(eb(),e)}}),jo=Ut(Hm(),1),rb=Ut(Jm(),1),Nd=!1,Pd=!1;jo.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(Nd=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(Pd=process?.env?.LOGGER_PERF_PREFIX==="true"));var nb={prefix:void 0,time:Nd,delta:Pd,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},Oa=[],Rd=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,r,n){Object.assign(this,{sinceFirst:e,sinceLast:t,time:r,delta:n})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),r=this.sinceLast<1e3?`${this.sinceLast.toFixed(0)}`.padStart(5," "):`${`${(this.sinceLast*.001).toFixed(this.sinceLast<1e4?1:0)}`.padStart(4," ")}s`;return`[${[this.time?t:null,this.delta?r:null].filter(n=>n!=null).join(",")}]`}},Cd=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},wi=!1,Ce=class st{static ERROR=2;static WARN=4;static INFO=6;static LOG=6;static DEBUG=8;static VERBOSE=10;static firstLog=0;static lastLog=0;static setup(t=st.INFO,r={}){r=Object.assign({},nb,r),t>10&&console.debug("setup logger",{config:r});let n=this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}),i=(...c)=>{typeof window<"u"&&window?.FORCE_DISABLE_LOGLEVEL&&n(...c)};i.isDisabled=!0,i.isEnabled=!1;let o=this.wrapLog(console.groupCollapsed,r),s=(c,f)=>{function l(...P){let E=P[P.length-1];return E===i?E():(o(...P.slice(0,-1)),(async()=>{try{let M=E();return M instanceof Promise?await M:M}finally{console.groupEnd()}})())}let g=Object.assign(f.bind({}),{isEnabled:c,isDisabled:!c,group:l,force:f});return c?g:Object.assign(i.bind({}),{isEnabled:c,isDisabled:!c,group:l,force:g})},a=s(t>=st.ERROR,this.wrapLog(console.error,r));return{ERROR:(...c)=>(a(...c),new Error(c.map(f=>typeof f=="string"?f:(0,rb.default)(f)).join(" "))),WARN:s(t>=st.WARN,this.wrapLog(console.warn,r)),LOG:s(t>=st.INFO,this.wrapLog(console.log,r)),DEBUG:s(t>=st.DEBUG,this.wrapLog(console.log,{...r,dim:r.dimDebugOnServer})),VERBOSE:s(t>=st.VERBOSE,this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}))}}static wrapLog(t,r){if(jo.isNode)return t.bind(console);{let n=[];if(r.time||r.delta){let i=jo.isBrowser&&navigator.userAgent.includes("Chrome")?["",st.timeStr(!!r.time,!!r.delta)]:[];n.push(...i)}return r.prefix&&(wi?n.push(new Cd("dim",r.prefix)):n.push(r.prefix)),t.bind(console,...n)}}static timeStr(t,r,n=0){if(!performance.now)return;let i=performance.now();st.firstLog||(st.firstLog=i,st.lastLog=i);let o=new Rd(i-st.firstLog,i-st.lastLog,t,r);return st.lastLog=i,n?o.toString():o}static getOriginFromStack(t){let r=!1;for(let n of t.split(`
54
+ `)){let i=n.match(/^\s+at\s+(.*)/);if(i){if(r)return i[1].trim().replace(__dirname,"");r=!0}}}};jo.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Oa&&Oa.length){for(let t of Oa)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof Rd))return null;wi||(wi=!0);let t=Ce.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof Cd?(wi||(wi=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var ib=typeof global=="object"&&global&&global.Object===Object&&global,$d=ib,ob=typeof self=="object"&&self&&self.Object===Object&&self,sb=$d||ob||Function("return this")(),bt=sb,ab=bt.Symbol,tr=ab,Ud=Object.prototype,ub=Ud.hasOwnProperty,cb=Ud.toString,bi=tr?tr.toStringTag:void 0;function fb(e){var t=ub.call(e,bi),r=e[bi];try{e[bi]=void 0;var n=!0}catch{}var i=cb.call(e);return n&&(t?e[bi]=r:delete e[bi]),i}var lb=fb,db=Object.prototype,pb=db.toString;function yb(e){return pb.call(e)}var hb=yb,gb="[object Null]",mb="[object Undefined]",_l=tr?tr.toStringTag:void 0;function bb(e){return e==null?e===void 0?mb:gb:_l&&_l in Object(e)?lb(e):hb(e)}var Mn=bb;function vb(e){return e!=null&&typeof e=="object"}var Rr=vb,_b="[object Symbol]";function wb(e){return typeof e=="symbol"||Rr(e)&&Mn(e)==_b}var Un=wb;function Tb(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Bd=Tb,Ab=Array.isArray,Jt=Ab,Ob=1/0,wl=tr?tr.prototype:void 0,Tl=wl?wl.toString:void 0;function Md(e){if(typeof e=="string")return e;if(Jt(e))return Bd(e,Md)+"";if(Un(e))return Tl?Tl.call(e):"";var t=e+"";return t=="0"&&1/e==-Ob?"-0":t}var Ib=Md,Eb=/\s/;function Sb(e){for(var t=e.length;t--&&Eb.test(e.charAt(t)););return t}var xb=Sb,Nb=/^\s+/;function Pb(e){return e&&e.slice(0,xb(e)+1).replace(Nb,"")}var Rb=Pb;function Cb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pr=Cb,Al=NaN,$b=/^[-+]0x[0-9a-f]+$/i,Ub=/^0b[01]+$/i,Bb=/^0o[0-7]+$/i,Mb=parseInt;function kb(e){if(typeof e=="number")return e;if(Un(e))return Al;if(pr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=pr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Rb(e);var r=Ub.test(e);return r||Bb.test(e)?Mb(e.slice(2),r?2:8):$b.test(e)?Al:+e}var Db=kb,Ol=1/0,Lb=17976931348623157e292;function jb(e){if(!e)return e===0?e:0;if(e=Db(e),e===Ol||e===-Ol){var t=e<0?-1:1;return t*Lb}return e===e?e:0}var Fb=jb;function Vb(e){var t=Fb(e),r=t%1;return t===t?r?t-r:t:0}var Il=Vb;function Kb(e){return e}var os=Kb,zb="[object AsyncFunction]",qb="[object Function]",Gb="[object GeneratorFunction]",Wb="[object Proxy]";function Hb(e){if(!pr(e))return!1;var t=Mn(e);return t==qb||t==Gb||t==zb||t==Wb}var kd=Hb,Jb=bt["__core-js_shared__"],Ia=Jb,El=function(){var e=/[^.]+$/.exec(Ia&&Ia.keys&&Ia.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Xb(e){return!!El&&El in e}var Yb=Xb,Qb=Function.prototype,Zb=Qb.toString;function ev(e){if(e!=null){try{return Zb.call(e)}catch{}try{return e+""}catch{}}return""}var rn=ev,tv=/[\\^$.*+?()[\]{}|]/g,rv=/^\[object .+?Constructor\]$/,nv=Function.prototype,iv=Object.prototype,ov=nv.toString,sv=iv.hasOwnProperty,av=RegExp("^"+ov.call(sv).replace(tv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uv(e){if(!pr(e)||Yb(e))return!1;var t=kd(e)?av:rv;return t.test(rn(e))}var cv=uv;function fv(e,t){return e?.[t]}var lv=fv;function dv(e,t){var r=lv(e,t);return cv(r)?r:void 0}var nn=dv,pv=nn(bt,"WeakMap"),Ai=pv,yv=Ai&&new Ai,Fo=yv,hv=Fo?function(e,t){return Fo.set(e,t),e}:os,Dd=hv,Sl=Object.create,gv=function(){function e(){}return function(t){if(!pr(t))return{};if(Sl)return Sl(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Xa=gv;function mv(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Xa(e.prototype),n=e.apply(r,t);return pr(n)?n:r}}var Oi=mv,bv=1;function vv(e,t,r){var n=t&bv,i=Oi(e);function o(){var s=this&&this!==bt&&this instanceof o?i:e;return s.apply(n?r:this,arguments)}return o}var _v=vv;function wv(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Ya=wv,Tv=Math.max;function Av(e,t,r,n){for(var i=-1,o=e.length,s=r.length,a=-1,c=t.length,f=Tv(o-s,0),l=Array(c+f),g=!n;++a<c;)l[a]=t[a];for(;++i<s;)(g||i<o)&&(l[r[i]]=e[i]);for(;f--;)l[a++]=e[i++];return l}var Ld=Av,Ov=Math.max;function Iv(e,t,r,n){for(var i=-1,o=e.length,s=-1,a=r.length,c=-1,f=t.length,l=Ov(o-a,0),g=Array(l+f),P=!n;++i<l;)g[i]=e[i];for(var E=i;++c<f;)g[E+c]=t[c];for(;++s<a;)(P||i<o)&&(g[E+r[s]]=e[i++]);return g}var jd=Iv;function Ev(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Sv=Ev;function xv(){}var Qa=xv,Nv=4294967295;function Vo(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Nv,this.__views__=[]}Vo.prototype=Xa(Qa.prototype);Vo.prototype.constructor=Vo;var Za=Vo;function Pv(){}var Fd=Pv,Rv=Fo?function(e){return Fo.get(e)}:Fd,Vd=Rv,Cv={},xl=Cv,$v=Object.prototype,Uv=$v.hasOwnProperty;function Bv(e){for(var t=e.name+"",r=xl[t],n=Uv.call(xl,t)?r.length:0;n--;){var i=r[n],o=i.func;if(o==null||o==e)return i.name}return t}var Mv=Bv;function Ko(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Ko.prototype=Xa(Qa.prototype);Ko.prototype.constructor=Ko;var Ma=Ko;function kv(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Kd=kv;function Dv(e){if(e instanceof Za)return e.clone();var t=new Ma(e.__wrapped__,e.__chain__);return t.__actions__=Kd(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lv=Dv,jv=Object.prototype,Fv=jv.hasOwnProperty;function zo(e){if(Rr(e)&&!Jt(e)&&!(e instanceof Za)){if(e instanceof Ma)return e;if(Fv.call(e,"__wrapped__"))return Lv(e)}return new Ma(e)}zo.prototype=Qa.prototype;zo.prototype.constructor=zo;var Vv=zo;function Kv(e){var t=Mv(e),r=Vv[t];if(typeof r!="function"||!(t in Za.prototype))return!1;if(e===r)return!0;var n=Vd(r);return!!n&&e===n[0]}var zv=Kv,qv=800,Gv=16,Wv=Date.now;function Hv(e){var t=0,r=0;return function(){var n=Wv(),i=Gv-(n-r);if(r=n,i>0){if(++t>=qv)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var zd=Hv,Jv=zd(Dd),qd=Jv,Xv=/\{\n\/\* \[wrapped with (.+)\] \*/,Yv=/,? & /;function Qv(e){var t=e.match(Xv);return t?t[1].split(Yv):[]}var Zv=Qv,e_=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function t_(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(e_,`{
55
55
  /* [wrapped with `+t+`] */
56
- `)}var r_=t_;function n_(e){return function(){return e}}var i_=n_,o_=function(){try{var e=nn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),zo=o_,s_=zo?function(e,t){return zo(e,"toString",{configurable:!0,enumerable:!1,value:i_(t),writable:!0})}:is,a_=s_,u_=zd(a_),eu=u_;function c_(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var f_=c_;function l_(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var d_=l_;function p_(e){return e!==e}var y_=p_;function h_(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var g_=h_;function m_(e,t,r){return t===t?g_(e,t,r):d_(e,y_,r)}var b_=m_;function v_(e,t){var r=e==null?0:e.length;return!!r&&b_(e,t,0)>-1}var Gd=v_,__=1,w_=2,T_=8,A_=16,O_=32,I_=64,E_=128,S_=256,x_=512,N_=[["ary",E_],["bind",__],["bindKey",w_],["curry",T_],["curryRight",A_],["flip",x_],["partial",O_],["partialRight",I_],["rearg",S_]];function P_(e,t){return f_(N_,function(r){var n="_."+r[0];t&r[1]&&!Gd(e,n)&&e.push(n)}),e.sort()}var R_=P_;function C_(e,t,r){var n=t+"";return eu(e,r_(n,R_(Zv(n),r)))}var Wd=C_,$_=1,U_=2,B_=4,M_=8,Nl=32,Pl=64;function k_(e,t,r,n,i,o,s,a,c,f){var l=t&M_,g=l?s:void 0,P=l?void 0:s,E=l?o:void 0,M=l?void 0:o;t|=l?Nl:Pl,t&=~(l?Pl:Nl),t&B_||(t&=~($_|U_));var z=[e,t,i,E,g,M,P,a,c,f],Q=r.apply(void 0,z);return zv(e)&&qd(Q,z),Q.placeholder=n,Wd(Q,e,t)}var Hd=k_;function D_(e){var t=e;return t.placeholder}var tu=D_,L_=9007199254740991,j_=/^(?:0|[1-9]\d*)$/;function F_(e,t){var r=typeof e;return t=t??L_,!!t&&(r=="number"||r!="symbol"&&j_.test(e))&&e>-1&&e%1==0&&e<t}var os=F_,V_=Math.min;function K_(e,t){for(var r=e.length,n=V_(t.length,r),i=Kd(e);n--;){var o=t[n];e[n]=os(o,r)?i[o]:void 0}return e}var z_=K_,Rl="__lodash_placeholder__";function q_(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];(s===t||s===Rl)&&(e[r]=Rl,o[i++]=r)}return o}var Ii=q_,G_=1,W_=2,H_=8,J_=16,X_=128,Y_=512;function Jd(e,t,r,n,i,o,s,a,c,f){var l=t&X_,g=t&G_,P=t&W_,E=t&(H_|J_),M=t&Y_,z=P?void 0:Oi(e);function Q(){for(var F=arguments.length,L=Array(F),G=F;G--;)L[G]=arguments[G];if(E)var H=tu(Q),j=Sv(L,H);if(n&&(L=Ld(L,n,i,E)),o&&(L=jd(L,o,s,E)),F-=j,E&&F<f){var re=Ii(L,H);return Hd(e,t,Jd,Q.placeholder,r,L,re,a,c,f-F)}var W=g?r:this,pe=P?W[e]:e;return F=L.length,a?L=z_(L,a):M&&F>1&&L.reverse(),l&&c<F&&(L.length=c),this&&this!==bt&&this instanceof Q&&(pe=z||Oi(pe)),pe.apply(W,L)}return Q}var Xd=Jd;function Q_(e,t,r){var n=Oi(e);function i(){for(var o=arguments.length,s=Array(o),a=o,c=tu(i);a--;)s[a]=arguments[a];var f=o<3&&s[0]!==c&&s[o-1]!==c?[]:Ii(s,c);if(o-=f.length,o<r)return Hd(e,t,Xd,i.placeholder,void 0,s,f,void 0,void 0,r-o);var l=this&&this!==bt&&this instanceof i?n:e;return Ya(l,this,s)}return i}var Z_=Q_,ew=1;function tw(e,t,r,n){var i=t&ew,o=Oi(e);function s(){for(var a=-1,c=arguments.length,f=-1,l=n.length,g=Array(l+c),P=this&&this!==bt&&this instanceof s?o:e;++f<l;)g[f]=n[f];for(;c--;)g[f++]=arguments[++a];return Ya(P,i?r:this,g)}return s}var rw=tw,Cl="__lodash_placeholder__",Ea=1,nw=2,iw=4,$l=8,vi=128,Ul=256,ow=Math.min;function sw(e,t){var r=e[1],n=t[1],i=r|n,o=i<(Ea|nw|vi),s=n==vi&&r==$l||n==vi&&r==Ul&&e[7].length<=t[8]||n==(vi|Ul)&&t[7].length<=t[8]&&r==$l;if(!(o||s))return e;n&Ea&&(e[2]=t[2],i|=r&Ea?0:iw);var a=t[3];if(a){var c=e[3];e[3]=c?Ld(c,a,t[4]):a,e[4]=c?Ii(e[3],Cl):t[4]}return a=t[5],a&&(c=e[5],e[5]=c?jd(c,a,t[6]):a,e[6]=c?Ii(e[5],Cl):t[6]),a=t[7],a&&(e[7]=a),n&vi&&(e[8]=e[8]==null?t[8]:ow(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var aw=sw,uw="Expected a function",Bl=1,cw=2,Sa=8,xa=16,Na=32,Ml=64,kl=Math.max;function fw(e,t,r,n,i,o,s,a){var c=t&cw;if(!c&&typeof e!="function")throw new TypeError(uw);var f=n?n.length:0;if(f||(t&=~(Na|Ml),n=i=void 0),s=s===void 0?s:kl(Il(s),0),a=a===void 0?a:Il(a),f-=i?i.length:0,t&Ml){var l=n,g=i;n=i=void 0}var P=c?void 0:Vd(e),E=[e,t,r,n,i,l,g,o,s,a];if(P&&aw(E,P),e=E[0],t=E[1],r=E[2],n=E[3],i=E[4],a=E[9]=E[9]===void 0?c?0:e.length:kl(E[9]-f,0),!a&&t&(Sa|xa)&&(t&=~(Sa|xa)),!t||t==Bl)var M=_v(e,t,r);else t==Sa||t==xa?M=Z_(e,t,a):(t==Na||t==(Bl|Na))&&!i.length?M=rw(e,t,r,n):M=Xd.apply(void 0,E);var z=P?Dd:qd;return Wd(z(M,E),e,t)}var lw=fw;function dw(e,t,r){t=="__proto__"&&zo?zo(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var pw=dw;function yw(e,t){return e===t||e!==e&&t!==t}var ru=yw,hw=Object.prototype,gw=hw.hasOwnProperty;function mw(e,t,r){var n=e[t];(!(gw.call(e,t)&&ru(n,r))||r===void 0&&!(t in e))&&pw(e,t,r)}var bw=mw,Dl=Math.max;function vw(e,t,r){return t=Dl(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=Dl(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(s),Ya(e,this,a)}}var Yd=vw;function _w(e,t){return eu(Yd(e,t,is),e+"")}var Qd=_w,ww=9007199254740991;function Tw(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ww}var nu=Tw;function Aw(e){return e!=null&&nu(e.length)&&!kd(e)}var Zd=Aw,Ow=Object.prototype;function Iw(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ow;return e===r}var Ew=Iw;function Sw(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var xw=Sw,Nw="[object Arguments]";function Pw(e){return Rr(e)&&Bn(e)==Nw}var Ll=Pw,ep=Object.prototype,Rw=ep.hasOwnProperty,Cw=ep.propertyIsEnumerable,$w=Ll(function(){return arguments}())?Ll:function(e){return Rr(e)&&Rw.call(e,"callee")&&!Cw.call(e,"callee")},iu=$w;function Uw(){return!1}var Bw=Uw,tp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jl=tp&&typeof module=="object"&&module&&!module.nodeType&&module,Mw=jl&&jl.exports===tp,Fl=Mw?bt.Buffer:void 0,kw=Fl?Fl.isBuffer:void 0,Dw=kw||Bw,ka=Dw,Lw="[object Arguments]",jw="[object Array]",Fw="[object Boolean]",Vw="[object Date]",Kw="[object Error]",zw="[object Function]",qw="[object Map]",Gw="[object Number]",Ww="[object Object]",Hw="[object RegExp]",Jw="[object Set]",Xw="[object String]",Yw="[object WeakMap]",Qw="[object ArrayBuffer]",Zw="[object DataView]",e0="[object Float32Array]",t0="[object Float64Array]",r0="[object Int8Array]",n0="[object Int16Array]",i0="[object Int32Array]",o0="[object Uint8Array]",s0="[object Uint8ClampedArray]",a0="[object Uint16Array]",u0="[object Uint32Array]",Me={};Me[e0]=Me[t0]=Me[r0]=Me[n0]=Me[i0]=Me[o0]=Me[s0]=Me[a0]=Me[u0]=!0;Me[Lw]=Me[jw]=Me[Qw]=Me[Fw]=Me[Zw]=Me[Vw]=Me[Kw]=Me[zw]=Me[qw]=Me[Gw]=Me[Ww]=Me[Hw]=Me[Jw]=Me[Xw]=Me[Yw]=!1;function c0(e){return Rr(e)&&nu(e.length)&&!!Me[Bn(e)]}var f0=c0;function l0(e){return function(t){return e(t)}}var rp=l0,np=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ti=np&&typeof module=="object"&&module&&!module.nodeType&&module,d0=Ti&&Ti.exports===np,Pa=d0&&$d.process,p0=function(){try{var e=Ti&&Ti.require&&Ti.require("util").types;return e||Pa&&Pa.binding&&Pa.binding("util")}catch{}}(),Vl=p0,Kl=Vl&&Vl.isTypedArray,y0=Kl?rp(Kl):f0,ip=y0,h0=Object.prototype,g0=h0.hasOwnProperty;function m0(e,t){var r=Jt(e),n=!r&&iu(e),i=!r&&!n&&ka(e),o=!r&&!n&&!i&&ip(e),s=r||n||i||o,a=s?xw(e.length,String):[],c=a.length;for(var f in e)(t||g0.call(e,f))&&!(s&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||os(f,c)))&&a.push(f);return a}var b0=m0;function v0(e,t){return function(r){return e(t(r))}}var _0=v0,w0=_0(Object.keys,Object),T0=w0,A0=Object.prototype,O0=A0.hasOwnProperty;function I0(e){if(!Ew(e))return T0(e);var t=[];for(var r in Object(e))O0.call(e,r)&&r!="constructor"&&t.push(r);return t}var E0=I0;function S0(e){return Zd(e)?b0(e):E0(e)}var op=S0,x0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N0=/^\w*$/;function P0(e,t){if(Jt(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||$n(e)?!0:N0.test(e)||!x0.test(e)||t!=null&&e in Object(t)}var ou=P0,R0=nn(Object,"create"),Ei=R0;function C0(){this.__data__=Ei?Ei(null):{},this.size=0}var $0=C0;function U0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var B0=U0,M0="__lodash_hash_undefined__",k0=Object.prototype,D0=k0.hasOwnProperty;function L0(e){var t=this.__data__;if(Ei){var r=t[e];return r===M0?void 0:r}return D0.call(t,e)?t[e]:void 0}var j0=L0,F0=Object.prototype,V0=F0.hasOwnProperty;function K0(e){var t=this.__data__;return Ei?t[e]!==void 0:V0.call(t,e)}var z0=K0,q0="__lodash_hash_undefined__";function G0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ei&&t===void 0?q0:t,this}var W0=G0;function Mn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Mn.prototype.clear=$0;Mn.prototype.delete=B0;Mn.prototype.get=j0;Mn.prototype.has=z0;Mn.prototype.set=W0;var zl=Mn;function H0(){this.__data__=[],this.size=0}var J0=H0;function X0(e,t){for(var r=e.length;r--;)if(ru(e[r][0],t))return r;return-1}var ss=X0,Y0=Array.prototype,Q0=Y0.splice;function Z0(e){var t=this.__data__,r=ss(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Q0.call(t,r,1),--this.size,!0}var eT=Z0;function tT(e){var t=this.__data__,r=ss(t,e);return r<0?void 0:t[r][1]}var rT=tT;function nT(e){return ss(this.__data__,e)>-1}var iT=nT;function oT(e,t){var r=this.__data__,n=ss(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var sT=oT;function kn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}kn.prototype.clear=J0;kn.prototype.delete=eT;kn.prototype.get=rT;kn.prototype.has=iT;kn.prototype.set=sT;var as=kn,aT=nn(bt,"Map"),Si=aT;function uT(){this.size=0,this.__data__={hash:new zl,map:new(Si||as),string:new zl}}var cT=uT;function fT(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var lT=fT;function dT(e,t){var r=e.__data__;return lT(t)?r[typeof t=="string"?"string":"hash"]:r.map}var us=dT;function pT(e){var t=us(this,e).delete(e);return this.size-=t?1:0,t}var yT=pT;function hT(e){return us(this,e).get(e)}var gT=hT;function mT(e){return us(this,e).has(e)}var bT=mT;function vT(e,t){var r=us(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var _T=vT;function Dn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Dn.prototype.clear=cT;Dn.prototype.delete=yT;Dn.prototype.get=gT;Dn.prototype.has=bT;Dn.prototype.set=_T;var cs=Dn,wT="Expected a function";function su(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(wT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(su.Cache||cs),r}su.Cache=cs;var TT=su,AT=500;function OT(e){var t=TT(e,function(n){return r.size===AT&&r.clear(),n}),r=t.cache;return t}var IT=OT,ET=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ST=/\\(\\)?/g,xT=IT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ET,function(r,n,i,o){t.push(i?o.replace(ST,"$1"):n||r)}),t}),NT=xT;function PT(e){return e==null?"":Ib(e)}var RT=PT;function CT(e,t){return Jt(e)?e:ou(e,t)?[e]:NT(RT(e))}var fs=CT,$T=1/0;function UT(e){if(typeof e=="string"||$n(e))return e;var t=e+"";return t=="0"&&1/e==-$T?"-0":t}var Pi=UT;function BT(e,t){t=fs(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Pi(t[r++])];return r&&r==n?e:void 0}var au=BT;function MT(e,t,r){var n=e==null?void 0:au(e,t);return n===void 0?r:n}var kT=MT;function DT(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var sp=DT,ql=tr?tr.isConcatSpreadable:void 0;function LT(e){return Jt(e)||iu(e)||!!(ql&&e&&e[ql])}var jT=LT;function ap(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=jT),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?ap(a,t-1,r,n,i):sp(i,a):n||(i[i.length]=a)}return i}var FT=ap;function VT(e){var t=e==null?0:e.length;return t?FT(e,1):[]}var KT=VT;function zT(e){return eu(Yd(e,void 0,KT),e+"")}var qT=zT;function GT(){this.__data__=new as,this.size=0}var WT=GT;function HT(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var JT=HT;function XT(e){return this.__data__.get(e)}var YT=XT;function QT(e){return this.__data__.has(e)}var ZT=QT,eA=200;function tA(e,t){var r=this.__data__;if(r instanceof as){var n=r.__data__;if(!Si||n.length<eA-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new cs(n)}return r.set(e,t),this.size=r.size,this}var rA=tA;function Ln(e){var t=this.__data__=new as(e);this.size=t.size}Ln.prototype.clear=WT;Ln.prototype.delete=JT;Ln.prototype.get=YT;Ln.prototype.has=ZT;Ln.prototype.set=rA;var $o=Ln;function nA(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}var iA=nA;function oA(){return[]}var sA=oA,aA=Object.prototype,uA=aA.propertyIsEnumerable,Gl=Object.getOwnPropertySymbols,cA=Gl?function(e){return e==null?[]:(e=Object(e),iA(Gl(e),function(t){return uA.call(e,t)}))}:sA,fA=cA;function lA(e,t,r){var n=t(e);return Jt(e)?n:sp(n,r(e))}var dA=lA;function pA(e){return dA(e,op,fA)}var Wl=pA,yA=nn(bt,"DataView"),Da=yA,hA=nn(bt,"Promise"),La=hA,gA=nn(bt,"Set"),Cn=gA,Hl="[object Map]",mA="[object Object]",Jl="[object Promise]",Xl="[object Set]",Yl="[object WeakMap]",Ql="[object DataView]",bA=rn(Da),vA=rn(Si),_A=rn(La),wA=rn(Cn),TA=rn(Ai),Qr=Bn;(Da&&Qr(new Da(new ArrayBuffer(1)))!=Ql||Si&&Qr(new Si)!=Hl||La&&Qr(La.resolve())!=Jl||Cn&&Qr(new Cn)!=Xl||Ai&&Qr(new Ai)!=Yl)&&(Qr=function(e){var t=Bn(e),r=t==mA?e.constructor:void 0,n=r?rn(r):"";if(n)switch(n){case bA:return Ql;case vA:return Hl;case _A:return Jl;case wA:return Xl;case TA:return Yl}return t});var Zl=Qr,AA=bt.Uint8Array,ed=AA,OA="__lodash_hash_undefined__";function IA(e){return this.__data__.set(e,OA),this}var EA=IA;function SA(e){return this.__data__.has(e)}var xA=SA;function qo(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new cs;++t<r;)this.add(e[t])}qo.prototype.add=qo.prototype.push=EA;qo.prototype.has=xA;var up=qo;function NA(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var PA=NA;function RA(e,t){return e.has(t)}var cp=RA,CA=1,$A=2;function UA(e,t,r,n,i,o){var s=r&CA,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var f=o.get(e),l=o.get(t);if(f&&l)return f==t&&l==e;var g=-1,P=!0,E=r&$A?new up:void 0;for(o.set(e,t),o.set(t,e);++g<a;){var M=e[g],z=t[g];if(n)var Q=s?n(z,M,g,t,e,o):n(M,z,g,e,t,o);if(Q!==void 0){if(Q)continue;P=!1;break}if(E){if(!PA(t,function(F,L){if(!cp(E,L)&&(M===F||i(M,F,r,n,o)))return E.push(L)})){P=!1;break}}else if(!(M===z||i(M,z,r,n,o))){P=!1;break}}return o.delete(e),o.delete(t),P}var fp=UA;function BA(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var MA=BA;function kA(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var lp=kA,DA=1,LA=2,jA="[object Boolean]",FA="[object Date]",VA="[object Error]",KA="[object Map]",zA="[object Number]",qA="[object RegExp]",GA="[object Set]",WA="[object String]",HA="[object Symbol]",JA="[object ArrayBuffer]",XA="[object DataView]",td=tr?tr.prototype:void 0,Ra=td?td.valueOf:void 0;function YA(e,t,r,n,i,o,s){switch(r){case XA:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case JA:return!(e.byteLength!=t.byteLength||!o(new ed(e),new ed(t)));case jA:case FA:case zA:return ru(+e,+t);case VA:return e.name==t.name&&e.message==t.message;case qA:case WA:return e==t+"";case KA:var a=MA;case GA:var c=n&DA;if(a||(a=lp),e.size!=t.size&&!c)return!1;var f=s.get(e);if(f)return f==t;n|=LA,s.set(e,t);var l=fp(a(e),a(t),n,i,o,s);return s.delete(e),l;case HA:if(Ra)return Ra.call(e)==Ra.call(t)}return!1}var QA=YA,ZA=1,eO=Object.prototype,tO=eO.hasOwnProperty;function rO(e,t,r,n,i,o){var s=r&ZA,a=Wl(e),c=a.length,f=Wl(t),l=f.length;if(c!=l&&!s)return!1;for(var g=c;g--;){var P=a[g];if(!(s?P in t:tO.call(t,P)))return!1}var E=o.get(e),M=o.get(t);if(E&&M)return E==t&&M==e;var z=!0;o.set(e,t),o.set(t,e);for(var Q=s;++g<c;){P=a[g];var F=e[P],L=t[P];if(n)var G=s?n(L,F,P,t,e,o):n(F,L,P,e,t,o);if(!(G===void 0?F===L||i(F,L,r,n,o):G)){z=!1;break}Q||(Q=P=="constructor")}if(z&&!Q){var H=e.constructor,j=t.constructor;H!=j&&"constructor"in e&&"constructor"in t&&!(typeof H=="function"&&H instanceof H&&typeof j=="function"&&j instanceof j)&&(z=!1)}return o.delete(e),o.delete(t),z}var nO=rO,iO=1,rd="[object Arguments]",nd="[object Array]",Co="[object Object]",oO=Object.prototype,id=oO.hasOwnProperty;function sO(e,t,r,n,i,o){var s=Jt(e),a=Jt(t),c=s?nd:Zl(e),f=a?nd:Zl(t);c=c==rd?Co:c,f=f==rd?Co:f;var l=c==Co,g=f==Co,P=c==f;if(P&&ka(e)){if(!ka(t))return!1;s=!0,l=!1}if(P&&!l)return o||(o=new $o),s||ip(e)?fp(e,t,r,n,i,o):QA(e,t,c,r,n,i,o);if(!(r&iO)){var E=l&&id.call(e,"__wrapped__"),M=g&&id.call(t,"__wrapped__");if(E||M){var z=E?e.value():e,Q=M?t.value():t;return o||(o=new $o),i(z,Q,r,n,o)}}return P?(o||(o=new $o),nO(e,t,r,n,i,o)):!1}var aO=sO;function dp(e,t,r,n,i){return e===t?!0:e==null||t==null||!Rr(e)&&!Rr(t)?e!==e&&t!==t:aO(e,t,r,n,dp,i)}var pp=dp,uO=1,cO=2;function fO(e,t,r,n){var i=r.length,o=i,s=!n;if(e==null)return!o;for(e=Object(e);i--;){var a=r[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=r[i];var c=a[0],f=e[c],l=a[1];if(s&&a[2]){if(f===void 0&&!(c in e))return!1}else{var g=new $o;if(n)var P=n(f,l,c,e,t,g);if(!(P===void 0?pp(l,f,uO|cO,n,g):P))return!1}}return!0}var lO=fO;function dO(e){return e===e&&!pr(e)}var yp=dO;function pO(e){for(var t=op(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,yp(i)]}return t}var yO=pO;function hO(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var hp=hO;function gO(e){var t=yO(e);return t.length==1&&t[0][2]?hp(t[0][0],t[0][1]):function(r){return r===e||lO(r,e,t)}}var mO=gO;function bO(e,t){return e!=null&&t in Object(e)}var vO=bO;function _O(e,t,r){t=fs(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=Pi(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&nu(i)&&os(s,i)&&(Jt(e)||iu(e)))}var wO=_O;function TO(e,t){return e!=null&&wO(e,t,vO)}var gp=TO,AO=1,OO=2;function IO(e,t){return ou(e)&&yp(t)?hp(Pi(e),t):function(r){var n=kT(r,e);return n===void 0&&n===t?gp(r,e):pp(t,n,AO|OO)}}var EO=IO;function SO(e){return function(t){return t?.[e]}}var xO=SO;function NO(e){return function(t){return au(t,e)}}var PO=NO;function RO(e){return ou(e)?xO(Pi(e)):PO(e)}var CO=RO;function $O(e){return typeof e=="function"?e:e==null?is:typeof e=="object"?Jt(e)?EO(e[0],e[1]):mO(e):CO(e)}var UO=$O;function BO(e){return Rr(e)&&Zd(e)}var MO=BO;function kO(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var DO=kO,LO=200;function jO(e,t,r,n){var i=-1,o=Gd,s=!0,a=e.length,c=[],f=t.length;if(!a)return c;r&&(t=Bd(t,rp(r))),n?(o=DO,s=!1):t.length>=LO&&(o=cp,s=!1,t=new up(t));e:for(;++i<a;){var l=e[i],g=r==null?l:r(l);if(l=n||l!==0?l:0,s&&g===g){for(var P=f;P--;)if(t[P]===g)continue e;c.push(l)}else o(t,g,n)||c.push(l)}return c}var FO=jO;function VO(e,t,r,n){if(!pr(e))return e;t=fs(t,e);for(var i=-1,o=t.length,s=o-1,a=e;a!=null&&++i<o;){var c=Pi(t[i]),f=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(i!=s){var l=a[c];f=n?n(l,c,a):void 0,f===void 0&&(f=pr(l)?l:os(t[i+1])?[]:{})}bw(a,c,f),a=a[c]}return e}var KO=VO;function zO(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=au(e,s);r(a,s)&&KO(o,fs(s,e),a)}return o}var qO=zO,GO=32,uu=Qd(function(e,t){var r=Ii(t,tu(uu));return lw(e,GO,void 0,t,r)});uu.placeholder={};var WO=uu;function HO(e,t){return qO(e,t,function(r,n){return gp(e,n)})}var JO=HO,XO=qT(function(e,t){return e==null?{}:JO(e,t)}),od=XO,YO=4294967295,QO=YO-1,ZO=Math.floor,e1=Math.min;function t1(e,t,r,n){var i=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,a=t===null,c=$n(t),f=t===void 0;i<o;){var l=ZO((i+o)/2),g=r(e[l]),P=g!==void 0,E=g===null,M=g===g,z=$n(g);if(s)var Q=n||M;else f?Q=M&&(n||P):a?Q=M&&P&&(n||!E):c?Q=M&&P&&!E&&(n||!z):E||z?Q=!1:Q=n?g<=t:g<t;Q?i=l+1:o=l}return e1(o,QO)}var r1=t1;function n1(e,t,r){return r1(e,t,UO(r,2))}var i1=n1,o1=1/0,aP=Cn&&1/lp(new Cn([,-0]))[1]==o1?function(e){return new Cn(e)}:Fd;var s1=Qd(function(e,t){return MO(e)?FO(e,t):[]}),sd=s1,mp=Ut(Xm(),1),uP=mp.default.configure,en=mp.default,Ca=100,{WARN:a1,LOG:cP,DEBUG:qe,VERBOSE:Te,ERROR:fP}=Ce.setup(Ce.INFO),Go=$e.set();al({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var He=({caller:e,thread:t,pattern:r,args:n})=>Re(()=>(n=n||r,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${n?`{${typeof n=="string"?n:en(n)}}`:""}`));function bp(e,t){return Re(()=>Ve.structural(e.get(),t.get()))}function jn(e,t){return Ve.shallow(e.applogs,t.applogs)}function ls(e,t){if(e.size!==t.size)return!1;for(let r=0;r<e.size;r++){let n=e.nodes[r],i=t.nodes[r];if(Te.isEnabled&&Te("queryNodesComparer",r,n,i),!Ve.structural(n.variables,i.variables))return Te.isEnabled&&Te("[queryNodesComparer] changed vars:",r,n,i),!1;if(!jn(n.logsOfThisNode,i.logsOfThisNode))return Te.isEnabled&&Te("[queryNodesComparer] changed logsOfThisNode:",r,n,i),!1}return Te.isEnabled&&Te("[queryNodesComparer] equal:",{a:e,b:t}),!0}var u1=0;function nr(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++u1}{${t}}`;Te.isEnabled&&Te(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,o=_p(e,a=>{i?Re(()=>(r??Ve.structural)(i,a))?qe.isEnabled&&qe(`[${n}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),qe.isEnabled&&qe(`[${n}] updated`,{updatedItems:a,observableArr:i})):i=$e.array(a,{deep:!1,name:t,equals:r})},{name:n});if(n.includes("useRoots")){var s=Rt(i);qe(`[${n}] deps`,{disposeAutorun:o,rootsAtom:s,observableArr:i,observers:hi(i)}),Sn(()=>Go.add(s))}return Te.isEnabled&&xn(i,()=>{Te(`[${n}] observed`,hi(i),{rootsAtom:s,observableArr:i})}),Hr(i,()=>{Te.isEnabled&&Te(`[${n}] dispose`),s&&Sn(()=>Go.delete(s)),o()}),i}var c1=0;function vp(e,{name:t}={}){let r=`observableSetMap@${++c1}{${t}}`;Te.isEnabled&&Te(`[${r}] create`,{fnname:e.name,fn:e,name:t});let n,i=_p(e,s=>{if(!n)n=$e.set(s,{deep:!1,name:t});else{let{deleted:a,added:c}=Re(()=>{let f=new Set(n.values()),l=new Set;for(let g of s)n.has(g)?(Te.isEnabled&&Te(`[${r}] unchanged`,g,{updatedItems:s,observableSet:n}),f.delete(g)):l.add(g);return qe.isEnabled&&qe(`[${r}] updated:`,{unseen:f,added:l,updatedItems:s,observableSet:n}),{added:l,deleted:f}});for(let f of a)n.delete(f);for(let f of c)n.add(f)}},{name:r});if(r.includes("useRoots")){var o=Rt(n);qe.isEnabled&&qe(`[${r}] deps`,{disposeAutorun:i,rootsAtom:o,observableSet:n,observers:hi(n)}),Sn(()=>Go.add(o))}return Te.isEnabled&&xn(n,()=>{Te(`[${r}] observed`,hi(n),{rootsAtom:o,observableSet:n})}),Hr(n,()=>{Te.isEnabled&&Te(`[${r}] dispose`),o&&Sn(()=>Go.delete(o)),i()}),n}function _p(e,t=null,{name:r}={}){qe.isEnabled&&qe("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:r});let n=`${r}.autorunImm`,i,o=new qt(n,function(...f){qe.isEnabled&&qe(`[${n}] reaction.invalidate`,f),s()});function s(){o.track(function(){let f=Ca&&performance.now();qe.isEnabled&&qe(`[${n}] runAndTrack:`,{name:r??e.name,fn:e}),i=e(),qe.isEnabled&&qe(`[${n}] runAndTrack =>`,i),Sn(()=>{t?.(i)}),Ca&&performance.now()-f>Ca&&a1(`[${n}] took ${performance.now()-f}ms`)})}return s(),qe.isEnabled&&qe(`[${n}] deps of reaction`,{reaction:o,result:i,deps:yi(o)}),()=>{Te.isEnabled&&Te(`[${n}] dispose`),setTimeout(()=>o.dispose())}}function Qe(e,t,r=!1){if(Ar(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let n=!1,i=0,o=typeof r=="boolean"?{keepAlive:r}:r,s=new Map;return function(...a){let c,f=Re(()=>{let E=a;for(let M=0;M<a.length;M++)a[M]instanceof tn&&a===E&&(E=a.slice());return E}),l=`computedFnDeepCompare(${e||t.name}#${++i})${o.argsDebugName?`{${o.argsDebugName(...a)}}`:""}`;for(let[E,M]of s.entries())if(l1(E,f)){c=M;break}else if(Te.isEnabled)for(let z=0;z<E.length;z++)E[z]instanceof tn&&E[z].name===a[z].name&&Ve.structural(sd(E,E[z]),sd(f,f[z]))&&Te.force(`[${l}] threadState mismatch => cachebust`,{diffFields:Object.keys(E[z]).filter(Q=>!Ve.structural(E[z][Q],a[z][Q])),cacheArg:E[z],freshArg:a[z]});if(c){let E=c.get();return Te.isEnabled&&Te(`[${l}] cache hit`,{untrackedArgs:f,cachedResult:E}),E}if(!o.keepAlive&&!Kf())return!n&&Wf().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),n=!0),t.apply(this,a);Te.isEnabled&&Te(`[${l}] new computation`,{untrackedArgs:f});let g,P=ke(()=>(Te.isEnabled&&Te(`[${l}] update->rerun`,Re(()=>({args:a})),t),Te.isEnabled&&ga(),g=t.apply(this,a)),{...o,name:l});if(Te.isEnabled&&Te(`[${l}] deps`,yi(P),{untrackedArgs:f}),s.set(f,P),!o.keepAlive){let E=Hr(P,()=>{Te.isEnabled&&Te(`[${l}] dispose`,P),E(),s.delete(f),o.onCleanup&&o.onCleanup(g,...a),g=void 0})}return P.get()}}function f1(e){let t=0,r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("?r+=o+`
56
+ `)}var r_=t_;function n_(e){return function(){return e}}var i_=n_,o_=function(){try{var e=nn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),qo=o_,s_=qo?function(e,t){return qo(e,"toString",{configurable:!0,enumerable:!1,value:i_(t),writable:!0})}:os,a_=s_,u_=zd(a_),eu=u_;function c_(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var f_=c_;function l_(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var d_=l_;function p_(e){return e!==e}var y_=p_;function h_(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var g_=h_;function m_(e,t,r){return t===t?g_(e,t,r):d_(e,y_,r)}var b_=m_;function v_(e,t){var r=e==null?0:e.length;return!!r&&b_(e,t,0)>-1}var Gd=v_,__=1,w_=2,T_=8,A_=16,O_=32,I_=64,E_=128,S_=256,x_=512,N_=[["ary",E_],["bind",__],["bindKey",w_],["curry",T_],["curryRight",A_],["flip",x_],["partial",O_],["partialRight",I_],["rearg",S_]];function P_(e,t){return f_(N_,function(r){var n="_."+r[0];t&r[1]&&!Gd(e,n)&&e.push(n)}),e.sort()}var R_=P_;function C_(e,t,r){var n=t+"";return eu(e,r_(n,R_(Zv(n),r)))}var Wd=C_,$_=1,U_=2,B_=4,M_=8,Nl=32,Pl=64;function k_(e,t,r,n,i,o,s,a,c,f){var l=t&M_,g=l?s:void 0,P=l?void 0:s,E=l?o:void 0,M=l?void 0:o;t|=l?Nl:Pl,t&=~(l?Pl:Nl),t&B_||(t&=~($_|U_));var z=[e,t,i,E,g,M,P,a,c,f],Q=r.apply(void 0,z);return zv(e)&&qd(Q,z),Q.placeholder=n,Wd(Q,e,t)}var Hd=k_;function D_(e){var t=e;return t.placeholder}var tu=D_,L_=9007199254740991,j_=/^(?:0|[1-9]\d*)$/;function F_(e,t){var r=typeof e;return t=t??L_,!!t&&(r=="number"||r!="symbol"&&j_.test(e))&&e>-1&&e%1==0&&e<t}var ss=F_,V_=Math.min;function K_(e,t){for(var r=e.length,n=V_(t.length,r),i=Kd(e);n--;){var o=t[n];e[n]=ss(o,r)?i[o]:void 0}return e}var z_=K_,Rl="__lodash_placeholder__";function q_(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];(s===t||s===Rl)&&(e[r]=Rl,o[i++]=r)}return o}var Ii=q_,G_=1,W_=2,H_=8,J_=16,X_=128,Y_=512;function Jd(e,t,r,n,i,o,s,a,c,f){var l=t&X_,g=t&G_,P=t&W_,E=t&(H_|J_),M=t&Y_,z=P?void 0:Oi(e);function Q(){for(var F=arguments.length,L=Array(F),G=F;G--;)L[G]=arguments[G];if(E)var H=tu(Q),j=Sv(L,H);if(n&&(L=Ld(L,n,i,E)),o&&(L=jd(L,o,s,E)),F-=j,E&&F<f){var re=Ii(L,H);return Hd(e,t,Jd,Q.placeholder,r,L,re,a,c,f-F)}var W=g?r:this,pe=P?W[e]:e;return F=L.length,a?L=z_(L,a):M&&F>1&&L.reverse(),l&&c<F&&(L.length=c),this&&this!==bt&&this instanceof Q&&(pe=z||Oi(pe)),pe.apply(W,L)}return Q}var Xd=Jd;function Q_(e,t,r){var n=Oi(e);function i(){for(var o=arguments.length,s=Array(o),a=o,c=tu(i);a--;)s[a]=arguments[a];var f=o<3&&s[0]!==c&&s[o-1]!==c?[]:Ii(s,c);if(o-=f.length,o<r)return Hd(e,t,Xd,i.placeholder,void 0,s,f,void 0,void 0,r-o);var l=this&&this!==bt&&this instanceof i?n:e;return Ya(l,this,s)}return i}var Z_=Q_,ew=1;function tw(e,t,r,n){var i=t&ew,o=Oi(e);function s(){for(var a=-1,c=arguments.length,f=-1,l=n.length,g=Array(l+c),P=this&&this!==bt&&this instanceof s?o:e;++f<l;)g[f]=n[f];for(;c--;)g[f++]=arguments[++a];return Ya(P,i?r:this,g)}return s}var rw=tw,Cl="__lodash_placeholder__",Ea=1,nw=2,iw=4,$l=8,vi=128,Ul=256,ow=Math.min;function sw(e,t){var r=e[1],n=t[1],i=r|n,o=i<(Ea|nw|vi),s=n==vi&&r==$l||n==vi&&r==Ul&&e[7].length<=t[8]||n==(vi|Ul)&&t[7].length<=t[8]&&r==$l;if(!(o||s))return e;n&Ea&&(e[2]=t[2],i|=r&Ea?0:iw);var a=t[3];if(a){var c=e[3];e[3]=c?Ld(c,a,t[4]):a,e[4]=c?Ii(e[3],Cl):t[4]}return a=t[5],a&&(c=e[5],e[5]=c?jd(c,a,t[6]):a,e[6]=c?Ii(e[5],Cl):t[6]),a=t[7],a&&(e[7]=a),n&vi&&(e[8]=e[8]==null?t[8]:ow(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var aw=sw,uw="Expected a function",Bl=1,cw=2,Sa=8,xa=16,Na=32,Ml=64,kl=Math.max;function fw(e,t,r,n,i,o,s,a){var c=t&cw;if(!c&&typeof e!="function")throw new TypeError(uw);var f=n?n.length:0;if(f||(t&=~(Na|Ml),n=i=void 0),s=s===void 0?s:kl(Il(s),0),a=a===void 0?a:Il(a),f-=i?i.length:0,t&Ml){var l=n,g=i;n=i=void 0}var P=c?void 0:Vd(e),E=[e,t,r,n,i,l,g,o,s,a];if(P&&aw(E,P),e=E[0],t=E[1],r=E[2],n=E[3],i=E[4],a=E[9]=E[9]===void 0?c?0:e.length:kl(E[9]-f,0),!a&&t&(Sa|xa)&&(t&=~(Sa|xa)),!t||t==Bl)var M=_v(e,t,r);else t==Sa||t==xa?M=Z_(e,t,a):(t==Na||t==(Bl|Na))&&!i.length?M=rw(e,t,r,n):M=Xd.apply(void 0,E);var z=P?Dd:qd;return Wd(z(M,E),e,t)}var lw=fw;function dw(e,t,r){t=="__proto__"&&qo?qo(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var pw=dw;function yw(e,t){return e===t||e!==e&&t!==t}var ru=yw,hw=Object.prototype,gw=hw.hasOwnProperty;function mw(e,t,r){var n=e[t];(!(gw.call(e,t)&&ru(n,r))||r===void 0&&!(t in e))&&pw(e,t,r)}var bw=mw,Dl=Math.max;function vw(e,t,r){return t=Dl(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=Dl(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(s),Ya(e,this,a)}}var Yd=vw;function _w(e,t){return eu(Yd(e,t,os),e+"")}var Qd=_w,ww=9007199254740991;function Tw(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ww}var nu=Tw;function Aw(e){return e!=null&&nu(e.length)&&!kd(e)}var Zd=Aw,Ow=Object.prototype;function Iw(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ow;return e===r}var Ew=Iw;function Sw(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var xw=Sw,Nw="[object Arguments]";function Pw(e){return Rr(e)&&Mn(e)==Nw}var Ll=Pw,ep=Object.prototype,Rw=ep.hasOwnProperty,Cw=ep.propertyIsEnumerable,$w=Ll(function(){return arguments}())?Ll:function(e){return Rr(e)&&Rw.call(e,"callee")&&!Cw.call(e,"callee")},iu=$w;function Uw(){return!1}var Bw=Uw,tp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jl=tp&&typeof module=="object"&&module&&!module.nodeType&&module,Mw=jl&&jl.exports===tp,Fl=Mw?bt.Buffer:void 0,kw=Fl?Fl.isBuffer:void 0,Dw=kw||Bw,ka=Dw,Lw="[object Arguments]",jw="[object Array]",Fw="[object Boolean]",Vw="[object Date]",Kw="[object Error]",zw="[object Function]",qw="[object Map]",Gw="[object Number]",Ww="[object Object]",Hw="[object RegExp]",Jw="[object Set]",Xw="[object String]",Yw="[object WeakMap]",Qw="[object ArrayBuffer]",Zw="[object DataView]",e0="[object Float32Array]",t0="[object Float64Array]",r0="[object Int8Array]",n0="[object Int16Array]",i0="[object Int32Array]",o0="[object Uint8Array]",s0="[object Uint8ClampedArray]",a0="[object Uint16Array]",u0="[object Uint32Array]",Me={};Me[e0]=Me[t0]=Me[r0]=Me[n0]=Me[i0]=Me[o0]=Me[s0]=Me[a0]=Me[u0]=!0;Me[Lw]=Me[jw]=Me[Qw]=Me[Fw]=Me[Zw]=Me[Vw]=Me[Kw]=Me[zw]=Me[qw]=Me[Gw]=Me[Ww]=Me[Hw]=Me[Jw]=Me[Xw]=Me[Yw]=!1;function c0(e){return Rr(e)&&nu(e.length)&&!!Me[Mn(e)]}var f0=c0;function l0(e){return function(t){return e(t)}}var rp=l0,np=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ti=np&&typeof module=="object"&&module&&!module.nodeType&&module,d0=Ti&&Ti.exports===np,Pa=d0&&$d.process,p0=function(){try{var e=Ti&&Ti.require&&Ti.require("util").types;return e||Pa&&Pa.binding&&Pa.binding("util")}catch{}}(),Vl=p0,Kl=Vl&&Vl.isTypedArray,y0=Kl?rp(Kl):f0,ip=y0,h0=Object.prototype,g0=h0.hasOwnProperty;function m0(e,t){var r=Jt(e),n=!r&&iu(e),i=!r&&!n&&ka(e),o=!r&&!n&&!i&&ip(e),s=r||n||i||o,a=s?xw(e.length,String):[],c=a.length;for(var f in e)(t||g0.call(e,f))&&!(s&&(f=="length"||i&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ss(f,c)))&&a.push(f);return a}var b0=m0;function v0(e,t){return function(r){return e(t(r))}}var _0=v0,w0=_0(Object.keys,Object),T0=w0,A0=Object.prototype,O0=A0.hasOwnProperty;function I0(e){if(!Ew(e))return T0(e);var t=[];for(var r in Object(e))O0.call(e,r)&&r!="constructor"&&t.push(r);return t}var E0=I0;function S0(e){return Zd(e)?b0(e):E0(e)}var op=S0,x0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N0=/^\w*$/;function P0(e,t){if(Jt(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Un(e)?!0:N0.test(e)||!x0.test(e)||t!=null&&e in Object(t)}var ou=P0,R0=nn(Object,"create"),Ei=R0;function C0(){this.__data__=Ei?Ei(null):{},this.size=0}var $0=C0;function U0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var B0=U0,M0="__lodash_hash_undefined__",k0=Object.prototype,D0=k0.hasOwnProperty;function L0(e){var t=this.__data__;if(Ei){var r=t[e];return r===M0?void 0:r}return D0.call(t,e)?t[e]:void 0}var j0=L0,F0=Object.prototype,V0=F0.hasOwnProperty;function K0(e){var t=this.__data__;return Ei?t[e]!==void 0:V0.call(t,e)}var z0=K0,q0="__lodash_hash_undefined__";function G0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ei&&t===void 0?q0:t,this}var W0=G0;function kn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}kn.prototype.clear=$0;kn.prototype.delete=B0;kn.prototype.get=j0;kn.prototype.has=z0;kn.prototype.set=W0;var zl=kn;function H0(){this.__data__=[],this.size=0}var J0=H0;function X0(e,t){for(var r=e.length;r--;)if(ru(e[r][0],t))return r;return-1}var as=X0,Y0=Array.prototype,Q0=Y0.splice;function Z0(e){var t=this.__data__,r=as(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Q0.call(t,r,1),--this.size,!0}var eT=Z0;function tT(e){var t=this.__data__,r=as(t,e);return r<0?void 0:t[r][1]}var rT=tT;function nT(e){return as(this.__data__,e)>-1}var iT=nT;function oT(e,t){var r=this.__data__,n=as(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var sT=oT;function Dn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Dn.prototype.clear=J0;Dn.prototype.delete=eT;Dn.prototype.get=rT;Dn.prototype.has=iT;Dn.prototype.set=sT;var us=Dn,aT=nn(bt,"Map"),Si=aT;function uT(){this.size=0,this.__data__={hash:new zl,map:new(Si||us),string:new zl}}var cT=uT;function fT(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var lT=fT;function dT(e,t){var r=e.__data__;return lT(t)?r[typeof t=="string"?"string":"hash"]:r.map}var cs=dT;function pT(e){var t=cs(this,e).delete(e);return this.size-=t?1:0,t}var yT=pT;function hT(e){return cs(this,e).get(e)}var gT=hT;function mT(e){return cs(this,e).has(e)}var bT=mT;function vT(e,t){var r=cs(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var _T=vT;function Ln(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ln.prototype.clear=cT;Ln.prototype.delete=yT;Ln.prototype.get=gT;Ln.prototype.has=bT;Ln.prototype.set=_T;var fs=Ln,wT="Expected a function";function su(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(wT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(su.Cache||fs),r}su.Cache=fs;var TT=su,AT=500;function OT(e){var t=TT(e,function(n){return r.size===AT&&r.clear(),n}),r=t.cache;return t}var IT=OT,ET=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ST=/\\(\\)?/g,xT=IT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ET,function(r,n,i,o){t.push(i?o.replace(ST,"$1"):n||r)}),t}),NT=xT;function PT(e){return e==null?"":Ib(e)}var RT=PT;function CT(e,t){return Jt(e)?e:ou(e,t)?[e]:NT(RT(e))}var ls=CT,$T=1/0;function UT(e){if(typeof e=="string"||Un(e))return e;var t=e+"";return t=="0"&&1/e==-$T?"-0":t}var Pi=UT;function BT(e,t){t=ls(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Pi(t[r++])];return r&&r==n?e:void 0}var au=BT;function MT(e,t,r){var n=e==null?void 0:au(e,t);return n===void 0?r:n}var kT=MT;function DT(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var sp=DT,ql=tr?tr.isConcatSpreadable:void 0;function LT(e){return Jt(e)||iu(e)||!!(ql&&e&&e[ql])}var jT=LT;function ap(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=jT),i||(i=[]);++o<s;){var a=e[o];t>0&&r(a)?t>1?ap(a,t-1,r,n,i):sp(i,a):n||(i[i.length]=a)}return i}var FT=ap;function VT(e){var t=e==null?0:e.length;return t?FT(e,1):[]}var KT=VT;function zT(e){return eu(Yd(e,void 0,KT),e+"")}var qT=zT;function GT(){this.__data__=new us,this.size=0}var WT=GT;function HT(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var JT=HT;function XT(e){return this.__data__.get(e)}var YT=XT;function QT(e){return this.__data__.has(e)}var ZT=QT,eA=200;function tA(e,t){var r=this.__data__;if(r instanceof us){var n=r.__data__;if(!Si||n.length<eA-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new fs(n)}return r.set(e,t),this.size=r.size,this}var rA=tA;function jn(e){var t=this.__data__=new us(e);this.size=t.size}jn.prototype.clear=WT;jn.prototype.delete=JT;jn.prototype.get=YT;jn.prototype.has=ZT;jn.prototype.set=rA;var Uo=jn;function nA(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}var iA=nA;function oA(){return[]}var sA=oA,aA=Object.prototype,uA=aA.propertyIsEnumerable,Gl=Object.getOwnPropertySymbols,cA=Gl?function(e){return e==null?[]:(e=Object(e),iA(Gl(e),function(t){return uA.call(e,t)}))}:sA,fA=cA;function lA(e,t,r){var n=t(e);return Jt(e)?n:sp(n,r(e))}var dA=lA;function pA(e){return dA(e,op,fA)}var Wl=pA,yA=nn(bt,"DataView"),Da=yA,hA=nn(bt,"Promise"),La=hA,gA=nn(bt,"Set"),$n=gA,Hl="[object Map]",mA="[object Object]",Jl="[object Promise]",Xl="[object Set]",Yl="[object WeakMap]",Ql="[object DataView]",bA=rn(Da),vA=rn(Si),_A=rn(La),wA=rn($n),TA=rn(Ai),Qr=Mn;(Da&&Qr(new Da(new ArrayBuffer(1)))!=Ql||Si&&Qr(new Si)!=Hl||La&&Qr(La.resolve())!=Jl||$n&&Qr(new $n)!=Xl||Ai&&Qr(new Ai)!=Yl)&&(Qr=function(e){var t=Mn(e),r=t==mA?e.constructor:void 0,n=r?rn(r):"";if(n)switch(n){case bA:return Ql;case vA:return Hl;case _A:return Jl;case wA:return Xl;case TA:return Yl}return t});var Zl=Qr,AA=bt.Uint8Array,ed=AA,OA="__lodash_hash_undefined__";function IA(e){return this.__data__.set(e,OA),this}var EA=IA;function SA(e){return this.__data__.has(e)}var xA=SA;function Go(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new fs;++t<r;)this.add(e[t])}Go.prototype.add=Go.prototype.push=EA;Go.prototype.has=xA;var up=Go;function NA(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var PA=NA;function RA(e,t){return e.has(t)}var cp=RA,CA=1,$A=2;function UA(e,t,r,n,i,o){var s=r&CA,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var f=o.get(e),l=o.get(t);if(f&&l)return f==t&&l==e;var g=-1,P=!0,E=r&$A?new up:void 0;for(o.set(e,t),o.set(t,e);++g<a;){var M=e[g],z=t[g];if(n)var Q=s?n(z,M,g,t,e,o):n(M,z,g,e,t,o);if(Q!==void 0){if(Q)continue;P=!1;break}if(E){if(!PA(t,function(F,L){if(!cp(E,L)&&(M===F||i(M,F,r,n,o)))return E.push(L)})){P=!1;break}}else if(!(M===z||i(M,z,r,n,o))){P=!1;break}}return o.delete(e),o.delete(t),P}var fp=UA;function BA(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var MA=BA;function kA(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var lp=kA,DA=1,LA=2,jA="[object Boolean]",FA="[object Date]",VA="[object Error]",KA="[object Map]",zA="[object Number]",qA="[object RegExp]",GA="[object Set]",WA="[object String]",HA="[object Symbol]",JA="[object ArrayBuffer]",XA="[object DataView]",td=tr?tr.prototype:void 0,Ra=td?td.valueOf:void 0;function YA(e,t,r,n,i,o,s){switch(r){case XA:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case JA:return!(e.byteLength!=t.byteLength||!o(new ed(e),new ed(t)));case jA:case FA:case zA:return ru(+e,+t);case VA:return e.name==t.name&&e.message==t.message;case qA:case WA:return e==t+"";case KA:var a=MA;case GA:var c=n&DA;if(a||(a=lp),e.size!=t.size&&!c)return!1;var f=s.get(e);if(f)return f==t;n|=LA,s.set(e,t);var l=fp(a(e),a(t),n,i,o,s);return s.delete(e),l;case HA:if(Ra)return Ra.call(e)==Ra.call(t)}return!1}var QA=YA,ZA=1,eO=Object.prototype,tO=eO.hasOwnProperty;function rO(e,t,r,n,i,o){var s=r&ZA,a=Wl(e),c=a.length,f=Wl(t),l=f.length;if(c!=l&&!s)return!1;for(var g=c;g--;){var P=a[g];if(!(s?P in t:tO.call(t,P)))return!1}var E=o.get(e),M=o.get(t);if(E&&M)return E==t&&M==e;var z=!0;o.set(e,t),o.set(t,e);for(var Q=s;++g<c;){P=a[g];var F=e[P],L=t[P];if(n)var G=s?n(L,F,P,t,e,o):n(F,L,P,e,t,o);if(!(G===void 0?F===L||i(F,L,r,n,o):G)){z=!1;break}Q||(Q=P=="constructor")}if(z&&!Q){var H=e.constructor,j=t.constructor;H!=j&&"constructor"in e&&"constructor"in t&&!(typeof H=="function"&&H instanceof H&&typeof j=="function"&&j instanceof j)&&(z=!1)}return o.delete(e),o.delete(t),z}var nO=rO,iO=1,rd="[object Arguments]",nd="[object Array]",$o="[object Object]",oO=Object.prototype,id=oO.hasOwnProperty;function sO(e,t,r,n,i,o){var s=Jt(e),a=Jt(t),c=s?nd:Zl(e),f=a?nd:Zl(t);c=c==rd?$o:c,f=f==rd?$o:f;var l=c==$o,g=f==$o,P=c==f;if(P&&ka(e)){if(!ka(t))return!1;s=!0,l=!1}if(P&&!l)return o||(o=new Uo),s||ip(e)?fp(e,t,r,n,i,o):QA(e,t,c,r,n,i,o);if(!(r&iO)){var E=l&&id.call(e,"__wrapped__"),M=g&&id.call(t,"__wrapped__");if(E||M){var z=E?e.value():e,Q=M?t.value():t;return o||(o=new Uo),i(z,Q,r,n,o)}}return P?(o||(o=new Uo),nO(e,t,r,n,i,o)):!1}var aO=sO;function dp(e,t,r,n,i){return e===t?!0:e==null||t==null||!Rr(e)&&!Rr(t)?e!==e&&t!==t:aO(e,t,r,n,dp,i)}var pp=dp,uO=1,cO=2;function fO(e,t,r,n){var i=r.length,o=i,s=!n;if(e==null)return!o;for(e=Object(e);i--;){var a=r[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=r[i];var c=a[0],f=e[c],l=a[1];if(s&&a[2]){if(f===void 0&&!(c in e))return!1}else{var g=new Uo;if(n)var P=n(f,l,c,e,t,g);if(!(P===void 0?pp(l,f,uO|cO,n,g):P))return!1}}return!0}var lO=fO;function dO(e){return e===e&&!pr(e)}var yp=dO;function pO(e){for(var t=op(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,yp(i)]}return t}var yO=pO;function hO(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var hp=hO;function gO(e){var t=yO(e);return t.length==1&&t[0][2]?hp(t[0][0],t[0][1]):function(r){return r===e||lO(r,e,t)}}var mO=gO;function bO(e,t){return e!=null&&t in Object(e)}var vO=bO;function _O(e,t,r){t=ls(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=Pi(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&nu(i)&&ss(s,i)&&(Jt(e)||iu(e)))}var wO=_O;function TO(e,t){return e!=null&&wO(e,t,vO)}var gp=TO,AO=1,OO=2;function IO(e,t){return ou(e)&&yp(t)?hp(Pi(e),t):function(r){var n=kT(r,e);return n===void 0&&n===t?gp(r,e):pp(t,n,AO|OO)}}var EO=IO;function SO(e){return function(t){return t?.[e]}}var xO=SO;function NO(e){return function(t){return au(t,e)}}var PO=NO;function RO(e){return ou(e)?xO(Pi(e)):PO(e)}var CO=RO;function $O(e){return typeof e=="function"?e:e==null?os:typeof e=="object"?Jt(e)?EO(e[0],e[1]):mO(e):CO(e)}var UO=$O;function BO(e){return Rr(e)&&Zd(e)}var MO=BO;function kO(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var DO=kO,LO=200;function jO(e,t,r,n){var i=-1,o=Gd,s=!0,a=e.length,c=[],f=t.length;if(!a)return c;r&&(t=Bd(t,rp(r))),n?(o=DO,s=!1):t.length>=LO&&(o=cp,s=!1,t=new up(t));e:for(;++i<a;){var l=e[i],g=r==null?l:r(l);if(l=n||l!==0?l:0,s&&g===g){for(var P=f;P--;)if(t[P]===g)continue e;c.push(l)}else o(t,g,n)||c.push(l)}return c}var FO=jO;function VO(e,t,r,n){if(!pr(e))return e;t=ls(t,e);for(var i=-1,o=t.length,s=o-1,a=e;a!=null&&++i<o;){var c=Pi(t[i]),f=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(i!=s){var l=a[c];f=n?n(l,c,a):void 0,f===void 0&&(f=pr(l)?l:ss(t[i+1])?[]:{})}bw(a,c,f),a=a[c]}return e}var KO=VO;function zO(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],a=au(e,s);r(a,s)&&KO(o,ls(s,e),a)}return o}var qO=zO,GO=32,uu=Qd(function(e,t){var r=Ii(t,tu(uu));return lw(e,GO,void 0,t,r)});uu.placeholder={};var WO=uu;function HO(e,t){return qO(e,t,function(r,n){return gp(e,n)})}var JO=HO,XO=qT(function(e,t){return e==null?{}:JO(e,t)}),od=XO,YO=4294967295,QO=YO-1,ZO=Math.floor,e1=Math.min;function t1(e,t,r,n){var i=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,a=t===null,c=Un(t),f=t===void 0;i<o;){var l=ZO((i+o)/2),g=r(e[l]),P=g!==void 0,E=g===null,M=g===g,z=Un(g);if(s)var Q=n||M;else f?Q=M&&(n||P):a?Q=M&&P&&(n||!E):c?Q=M&&P&&!E&&(n||!z):E||z?Q=!1:Q=n?g<=t:g<t;Q?i=l+1:o=l}return e1(o,QO)}var r1=t1;function n1(e,t,r){return r1(e,t,UO(r,2))}var i1=n1,o1=1/0,aP=$n&&1/lp(new $n([,-0]))[1]==o1?function(e){return new $n(e)}:Fd;var s1=Qd(function(e,t){return MO(e)?FO(e,t):[]}),sd=s1,mp=Ut(Xm(),1),uP=mp.default.configure,en=mp.default,Ca=100,{WARN:a1,LOG:cP,DEBUG:qe,VERBOSE:Te,ERROR:fP}=Ce.setup(Ce.INFO),Wo=$e.set();al({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var He=({caller:e,thread:t,pattern:r,args:n})=>Re(()=>(n=n||r,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${n?`{${typeof n=="string"?n:en(n)}}`:""}`));function bp(e,t){return Re(()=>Ve.structural(e.get(),t.get()))}function Fn(e,t){return Ve.shallow(e.applogs,t.applogs)}function ds(e,t){if(e.size!==t.size)return!1;for(let r=0;r<e.size;r++){let n=e.nodes[r],i=t.nodes[r];if(Te.isEnabled&&Te("queryNodesComparer",r,n,i),!Ve.structural(n.variables,i.variables))return Te.isEnabled&&Te("[queryNodesComparer] changed vars:",r,n,i),!1;if(!Fn(n.logsOfThisNode,i.logsOfThisNode))return Te.isEnabled&&Te("[queryNodesComparer] changed logsOfThisNode:",r,n,i),!1}return Te.isEnabled&&Te("[queryNodesComparer] equal:",{a:e,b:t}),!0}var u1=0;function nr(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++u1}{${t}}`;Te.isEnabled&&Te(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,o=_p(e,a=>{i?Re(()=>(r??Ve.structural)(i,a))?qe.isEnabled&&qe(`[${n}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),qe.isEnabled&&qe(`[${n}] updated`,{updatedItems:a,observableArr:i})):i=$e.array(a,{deep:!1,name:t,equals:r})},{name:n});if(n.includes("useRoots")){var s=Rt(i);qe(`[${n}] deps`,{disposeAutorun:o,rootsAtom:s,observableArr:i,observers:hi(i)}),xn(()=>Wo.add(s))}return Te.isEnabled&&Nn(i,()=>{Te(`[${n}] observed`,hi(i),{rootsAtom:s,observableArr:i})}),Hr(i,()=>{Te.isEnabled&&Te(`[${n}] dispose`),s&&xn(()=>Wo.delete(s)),o()}),i}var c1=0;function vp(e,{name:t}={}){let r=`observableSetMap@${++c1}{${t}}`;Te.isEnabled&&Te(`[${r}] create`,{fnname:e.name,fn:e,name:t});let n,i=_p(e,s=>{if(!n)n=$e.set(s,{deep:!1,name:t});else{let{deleted:a,added:c}=Re(()=>{let f=new Set(n.values()),l=new Set;for(let g of s)n.has(g)?(Te.isEnabled&&Te(`[${r}] unchanged`,g,{updatedItems:s,observableSet:n}),f.delete(g)):l.add(g);return qe.isEnabled&&qe(`[${r}] updated:`,{unseen:f,added:l,updatedItems:s,observableSet:n}),{added:l,deleted:f}});for(let f of a)n.delete(f);for(let f of c)n.add(f)}},{name:r});if(r.includes("useRoots")){var o=Rt(n);qe.isEnabled&&qe(`[${r}] deps`,{disposeAutorun:i,rootsAtom:o,observableSet:n,observers:hi(n)}),xn(()=>Wo.add(o))}return Te.isEnabled&&Nn(n,()=>{Te(`[${r}] observed`,hi(n),{rootsAtom:o,observableSet:n})}),Hr(n,()=>{Te.isEnabled&&Te(`[${r}] dispose`),o&&xn(()=>Wo.delete(o)),i()}),n}function _p(e,t=null,{name:r}={}){qe.isEnabled&&qe("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:r});let n=`${r}.autorunImm`,i,o=new qt(n,function(...f){qe.isEnabled&&qe(`[${n}] reaction.invalidate`,f),s()});function s(){o.track(function(){let f=Ca&&performance.now();qe.isEnabled&&qe(`[${n}] runAndTrack:`,{name:r??e.name,fn:e}),i=e(),qe.isEnabled&&qe(`[${n}] runAndTrack =>`,i),xn(()=>{t?.(i)}),Ca&&performance.now()-f>Ca&&a1(`[${n}] took ${performance.now()-f}ms`)})}return s(),qe.isEnabled&&qe(`[${n}] deps of reaction`,{reaction:o,result:i,deps:yi(o)}),()=>{Te.isEnabled&&Te(`[${n}] dispose`),setTimeout(()=>o.dispose())}}function Qe(e,t,r=!1){if(Ar(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let n=!1,i=0,o=typeof r=="boolean"?{keepAlive:r}:r,s=new Map;return function(...a){let c,f=Re(()=>{let E=a;for(let M=0;M<a.length;M++)a[M]instanceof tn&&a===E&&(E=a.slice());return E}),l=`computedFnDeepCompare(${e||t.name}#${++i})${o.argsDebugName?`{${o.argsDebugName(...a)}}`:""}`;for(let[E,M]of s.entries())if(l1(E,f)){c=M;break}else if(Te.isEnabled)for(let z=0;z<E.length;z++)E[z]instanceof tn&&E[z].name===a[z].name&&Ve.structural(sd(E,E[z]),sd(f,f[z]))&&Te.force(`[${l}] threadState mismatch => cachebust`,{diffFields:Object.keys(E[z]).filter(Q=>!Ve.structural(E[z][Q],a[z][Q])),cacheArg:E[z],freshArg:a[z]});if(c){let E=c.get();return Te.isEnabled&&Te(`[${l}] cache hit`,{untrackedArgs:f,cachedResult:E}),E}if(!o.keepAlive&&!Kf())return!n&&Wf().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),n=!0),t.apply(this,a);Te.isEnabled&&Te(`[${l}] new computation`,{untrackedArgs:f});let g,P=ke(()=>(Te.isEnabled&&Te(`[${l}] update->rerun`,Re(()=>({args:a})),t),Te.isEnabled&&ga(),g=t.apply(this,a)),{...o,name:l});if(Te.isEnabled&&Te(`[${l}] deps`,yi(P),{untrackedArgs:f}),s.set(f,P),!o.keepAlive){let E=Hr(P,()=>{Te.isEnabled&&Te(`[${l}] dispose`,P),E(),s.delete(f),o.onCleanup&&o.onCleanup(g,...a),g=void 0})}return P.get()}}function f1(e){let t=0,r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("?r+=o+`
57
57
  `+" ".repeat(++t):o===")"?r+=`
58
58
  `+" ".repeat(--t)+o:o===","&&n===0?r+=o+`
59
59
  `+" ".repeat(t):o==="{"&&n===0?(n++,r+=o+`
60
60
  `+" ".repeat(t+1)):o==="}"&&n===1?(n--,r+=`
61
- `+" ".repeat(t)+o):o==="{"&&n>0?(n++,r+=o):(o==="}"&&n>1&&n--,r+=o)}return r}function l1(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]instanceof tn){if(t[r]!==e[r])return!1}else if(!Ve.structural(e[r],t[r]))return!1;return!0}var{WARN:ad,LOG:lP,DEBUG:d1,VERBOSE:dP,ERROR:Xr}=Ce.setup(Ce.INFO,{prefix:"[thread]"});function rr(e){return e.init!==void 0}var tn=class{constructor(e,t,r,n=[],i={}){this.name=e,this._applogs=n,this.parents=t===null?null:vl(t),this.filters=r,Re(()=>this.parents?.length===0)&&ad("[Thread] empty parents array",e),i.skipObservable||Er(this,{applogsCids:ke,applogsByCid:ke,insert:ot,size:ke,isEmpty:ke,firstLog:ke,latestLog:ke},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw Xr("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Xr("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Xr("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw Xr("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Xr("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Xr("[Thread] insertRaw() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insertRaw(e)}subscribe(e){return this._subscribers.push(e),this.unsubscribe.bind(this,e)}unsubscribe(e){let t=this._subscribers.indexOf(e);t!==-1?this._subscribers.splice(t,1):ad("unsubscribe called for non-existent",e)}notifySubscribers(e){d1(`[thread: ${this.name}] notifying`,this._subscribers.length,"subscribers of",{...e,subs:this._subscribers});for(let t of this._subscribers)t(e)}get applogs(){return this._applogs}get applogsCids(){return this._applogs.map(e=>e.cid)}map(e){return this.applogs.map(e)}get findLast(){return this.applogs.findLast.bind(this.applogs)}get findFirst(){return this.applogs.find.bind(this.applogs)}get firstLog(){return this.applogs[0]}get latestLog(){return this.applogs[this.applogs.length-1]}hasApplog(e,t){if(t)return this.applogs.includes(e);if(!e.cid)throw Xr("[hasApplogs] applog without CID:",e);return this.hasApplogCid(e.cid)}hasApplogCid(e){return this.applogsCids.includes(e.toString())}get applogsByCid(){return new Map(this.applogs.map(e=>[e.cid,e]))}getApplog(e){return this.applogsByCid.get(e.toString())}hasApplogWithDiffTs(e){return this.applogs.find(t=>t.en===e.en&&t.at===e.at&&t.vl===e.vl&&t.ag===e.ag)}get isEmpty(){return this.size===0}get size(){return this.applogs.length}get length(){return this.applogs.length}get untrackedSize(){return Re(()=>this.size)}get nameAndSizeUntracked(){return Re(()=>`${this.name} (${this.size})`)}get prettyName(){return f1(this.name)}get hasParents(){return!!this.parents?.length}};var cu=class wp extends tn{static fromArray(t,r){return new wp(r||"static",null,[],t)}constructor(t,r,n,i){super(t,r,n,i,{skipObservable:!0})}get readOnly(){return!0}},Tp={};Aa(Tp,{code:()=>Vp,decode:()=>ms,encode:()=>Iu,format:()=>bd,name:()=>wE,parse:()=>AE,stringify:()=>bd});var p1=["string","number","bigint","symbol"],y1=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function h1(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(p1.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(g1(e))return"Buffer";let r=m1(e);return r||"Object"}function g1(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function m1(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(y1.includes(t))return t}var C=class{constructor(e,t,r){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};C.uint=new C(0,"uint",!0);C.negint=new C(1,"negint",!0);C.bytes=new C(2,"bytes",!0);C.string=new C(3,"string",!0);C.array=new C(4,"array",!1);C.map=new C(5,"map",!1);C.tag=new C(6,"tag",!1);C.float=new C(7,"float",!0);C.false=new C(7,"false",!0);C.true=new C(7,"true",!0);C.null=new C(7,"null",!0);C.undefined=new C(7,"undefined",!0);C.break=new C(7,"break",!0);var ee=class{constructor(e,t,r){this.type=e,this.value=t,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},Fn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",b1=new TextDecoder,v1=new TextEncoder;function Wo(e){return Fn&&globalThis.Buffer.isBuffer(e)}function fu(e){return e instanceof Uint8Array?Wo(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var _1=Fn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):cd(e,t,r):(e,t,r)=>r-t>64?b1.decode(e.subarray(t,r)):cd(e,t,r),Ap=Fn?e=>e.length>64?globalThis.Buffer.from(e):ud(e):e=>e.length>64?v1.encode(e):ud(e);var lu=Fn?(e,t,r)=>Wo(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),w1=Fn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),fu(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},T1=Fn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function A1(e,t){if(Wo(e)&&Wo(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function ud(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function cd(e,t,r){let n=[];for(;t<r;){let i=e[t],o=null,s=i>239?4:i>223?3:i>191?2:1;if(t+s<=r){let a,c,f,l;switch(s){case 1:i<128&&(o=i);break;case 2:a=e[t+1],(a&192)===128&&(l=(i&31)<<6|a&63,l>127&&(o=l));break;case 3:a=e[t+1],c=e[t+2],(a&192)===128&&(c&192)===128&&(l=(i&15)<<12|(a&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:a=e[t+1],c=e[t+2],f=e[t+3],(a&192)===128&&(c&192)===128&&(f&192)===128&&(l=(i&15)<<18|(a&63)<<12|(c&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),t+=s}return Op(n)}var fd=4096;function Op(e){let t=e.length;if(t<=fd)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=fd));return r}var O1=256,Ip=class{constructor(e=O1){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let n=t.length-(this.maxCursor-this.cursor)-1;t.set(e,n)}else{if(t){let n=t.length-(this.maxCursor-this.cursor)-1;n<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,n),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=T1(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let r=this.chunks[0];e&&this.cursor>r.length/2?(t=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=lu(r,0,this.cursor)}else t=w1(this.chunks,this.cursor);return e&&this.reset(),t}},he="CBOR decode error:",Zr="CBOR encode error:",Ri=[];Ri[23]=1;Ri[24]=2;Ri[25]=3;Ri[26]=5;Ri[27]=9;function Vn(e,t,r){if(e.length-t<r)throw new Error(`${he} not enough data for type`)}var Ye=[24,256,65536,4294967296,BigInt("18446744073709551616")];function on(e,t,r){Vn(e,t,1);let n=e[t];if(r.strict===!0&&n<Ye[0])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function sn(e,t,r){Vn(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Ye[1])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function an(e,t,r){Vn(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Ye[2])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function un(e,t,r){Vn(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&o<Ye[3])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(r.allowBigInt===!0)return o;throw new Error(`${he} integers outside of the safe integer range are not supported`)}function I1(e,t,r,n){return new ee(C.uint,on(e,t+1,n),2)}function E1(e,t,r,n){return new ee(C.uint,sn(e,t+1,n),3)}function S1(e,t,r,n){return new ee(C.uint,an(e,t+1,n),5)}function x1(e,t,r,n){return new ee(C.uint,un(e,t+1,n),9)}function cn(e,t){return Mt(e,0,t.value)}function Mt(e,t,r){if(r<Ye[0]){let n=Number(r);e.push([t|n])}else if(r<Ye[1]){let n=Number(r);e.push([t|24,n])}else if(r<Ye[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Ye[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Ye[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),s=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=o&255,o=o>>8,i[7]=o&255,o=o>>8,i[6]=o&255,o=o>>8,i[5]=o&255,i[4]=s&255,s=s>>8,i[3]=s&255,s=s>>8,i[2]=s&255,s=s>>8,i[1]=s&255,e.push(i)}else throw new Error(`${he} encountered BigInt larger than allowable range`)}}cn.encodedSize=function(t){return Mt.encodedSize(t.value)};Mt.encodedSize=function(t){return t<Ye[0]?1:t<Ye[1]?2:t<Ye[2]?3:t<Ye[3]?5:9};cn.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function N1(e,t,r,n){return new ee(C.negint,-1-on(e,t+1,n),2)}function P1(e,t,r,n){return new ee(C.negint,-1-sn(e,t+1,n),3)}function R1(e,t,r,n){return new ee(C.negint,-1-an(e,t+1,n),5)}var du=BigInt(-1),Ep=BigInt(1);function C1(e,t,r,n){let i=un(e,t+1,n);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new ee(C.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${he} integers outside of the safe integer range are not supported`);return new ee(C.negint,du-BigInt(i),9)}function pu(e,t){let r=t.value,n=typeof r=="bigint"?r*du-Ep:r*-1-1;Mt(e,t.type.majorEncoded,n)}pu.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*du-Ep:r*-1-1;return n<Ye[0]?1:n<Ye[1]?2:n<Ye[2]?3:n<Ye[3]?5:9};pu.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function Ci(e,t,r,n){Vn(e,t,r+n);let i=lu(e,t+r,t+r+n);return new ee(C.bytes,i,r+n)}function $1(e,t,r,n){return Ci(e,t,1,r)}function U1(e,t,r,n){return Ci(e,t,2,on(e,t+1,n))}function B1(e,t,r,n){return Ci(e,t,3,sn(e,t+1,n))}function M1(e,t,r,n){return Ci(e,t,5,an(e,t+1,n))}function k1(e,t,r,n){let i=un(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer bytes lengths not supported`);return Ci(e,t,9,i)}function Ho(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===C.string?Ap(e.value):e.value),e.encodedBytes}function ds(e,t){let r=Ho(t);Mt(e,t.type.majorEncoded,r.length),e.push(r)}ds.encodedSize=function(t){let r=Ho(t);return Mt.encodedSize(r.length)+r.length};ds.compareTokens=function(t,r){return D1(Ho(t),Ho(r))};function D1(e,t){return e.length<t.length?-1:e.length>t.length?1:A1(e,t)}function $i(e,t,r,n,i){let o=r+n;Vn(e,t,o);let s=new ee(C.string,_1(e,t+r,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=lu(e,t+r,t+o)),s}function L1(e,t,r,n){return $i(e,t,1,r,n)}function j1(e,t,r,n){return $i(e,t,2,on(e,t+1,n),n)}function F1(e,t,r,n){return $i(e,t,3,sn(e,t+1,n),n)}function V1(e,t,r,n){return $i(e,t,5,an(e,t+1,n),n)}function K1(e,t,r,n){let i=un(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer string lengths not supported`);return $i(e,t,9,i,n)}var z1=ds;function Kn(e,t,r,n){return new ee(C.array,n,r)}function q1(e,t,r,n){return Kn(e,t,1,r)}function G1(e,t,r,n){return Kn(e,t,2,on(e,t+1,n))}function W1(e,t,r,n){return Kn(e,t,3,sn(e,t+1,n))}function H1(e,t,r,n){return Kn(e,t,5,an(e,t+1,n))}function J1(e,t,r,n){let i=un(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer array lengths not supported`);return Kn(e,t,9,i)}function X1(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return Kn(e,t,1,1/0)}function yu(e,t){Mt(e,C.array.majorEncoded,t.value)}yu.compareTokens=cn.compareTokens;yu.encodedSize=function(t){return Mt.encodedSize(t.value)};function zn(e,t,r,n){return new ee(C.map,n,r)}function Y1(e,t,r,n){return zn(e,t,1,r)}function Q1(e,t,r,n){return zn(e,t,2,on(e,t+1,n))}function Z1(e,t,r,n){return zn(e,t,3,sn(e,t+1,n))}function eI(e,t,r,n){return zn(e,t,5,an(e,t+1,n))}function tI(e,t,r,n){let i=un(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer map lengths not supported`);return zn(e,t,9,i)}function rI(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return zn(e,t,1,1/0)}function hu(e,t){Mt(e,C.map.majorEncoded,t.value)}hu.compareTokens=cn.compareTokens;hu.encodedSize=function(t){return Mt.encodedSize(t.value)};function nI(e,t,r,n){return new ee(C.tag,r,1)}function iI(e,t,r,n){return new ee(C.tag,on(e,t+1,n),2)}function oI(e,t,r,n){return new ee(C.tag,sn(e,t+1,n),3)}function sI(e,t,r,n){return new ee(C.tag,an(e,t+1,n),5)}function aI(e,t,r,n){return new ee(C.tag,un(e,t+1,n),9)}function gu(e,t){Mt(e,C.tag.majorEncoded,t.value)}gu.compareTokens=cn.compareTokens;gu.encodedSize=function(t){return Mt.encodedSize(t.value)};var uI=20,cI=21,fI=22,lI=23;function dI(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${he} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new ee(C.null,null,1):new ee(C.undefined,void 0,1)}function pI(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return new ee(C.break,void 0,1)}function mu(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${he} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${he} Infinity values are not supported`)}return new ee(C.float,e,t)}function yI(e,t,r,n){return mu(vu(e,t+1),3,n)}function hI(e,t,r,n){return mu(_u(e,t+1),5,n)}function gI(e,t,r,n){return mu(Pp(e,t+1),9,n)}function bu(e,t,r){let n=t.value;if(n===!1)e.push([C.float.majorEncoded|uI]);else if(n===!0)e.push([C.float.majorEncoded|cI]);else if(n===null)e.push([C.float.majorEncoded|fI]);else if(n===void 0)e.push([C.float.majorEncoded|lI]);else{let i,o=!1;(!r||r.float64!==!0)&&(xp(n),i=vu(Ht,1),n===i||Number.isNaN(n)?(Ht[0]=249,e.push(Ht.slice(0,3)),o=!0):(Np(n),i=_u(Ht,1),n===i&&(Ht[0]=250,e.push(Ht.slice(0,5)),o=!0))),o||(mI(n),i=Pp(Ht,1),Ht[0]=251,e.push(Ht.slice(0,9)))}}bu.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){xp(n);let i=vu(Ht,1);if(n===i||Number.isNaN(n))return 3;if(Np(n),i=_u(Ht,1),n===i)return 5}return 9};var Sp=new ArrayBuffer(9),Bt=new DataView(Sp,1),Ht=new Uint8Array(Sp,0);function xp(e){if(e===1/0)Bt.setUint16(0,31744,!1);else if(e===-1/0)Bt.setUint16(0,64512,!1);else if(Number.isNaN(e))Bt.setUint16(0,32256,!1);else{Bt.setFloat32(0,e);let t=Bt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)Bt.setUint16(0,31744,!1);else if(r===0)Bt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?Bt.setUint16(0,0):i<-14?Bt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):Bt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function vu(e,t){if(e.length-t<2)throw new Error(`${he} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,o;return n===0?o=i*2**-24:n!==31?o=(i+1024)*2**(n-25):o=i===0?1/0:NaN,r&32768?-o:o}function Np(e){Bt.setFloat32(0,e,!1)}function _u(e,t){if(e.length-t<4)throw new Error(`${he} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function mI(e){Bt.setFloat64(0,e,!1)}function Pp(e,t){if(e.length-t<8)throw new Error(`${he} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}bu.compareTokens=cn.compareTokens;function Se(e,t,r){throw new Error(`${he} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function ps(e){return()=>{throw new Error(`${he} ${e}`)}}var ae=[];for(let e=0;e<=23;e++)ae[e]=Se;ae[24]=I1;ae[25]=E1;ae[26]=S1;ae[27]=x1;ae[28]=Se;ae[29]=Se;ae[30]=Se;ae[31]=Se;for(let e=32;e<=55;e++)ae[e]=Se;ae[56]=N1;ae[57]=P1;ae[58]=R1;ae[59]=C1;ae[60]=Se;ae[61]=Se;ae[62]=Se;ae[63]=Se;for(let e=64;e<=87;e++)ae[e]=$1;ae[88]=U1;ae[89]=B1;ae[90]=M1;ae[91]=k1;ae[92]=Se;ae[93]=Se;ae[94]=Se;ae[95]=ps("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ae[e]=L1;ae[120]=j1;ae[121]=F1;ae[122]=V1;ae[123]=K1;ae[124]=Se;ae[125]=Se;ae[126]=Se;ae[127]=ps("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ae[e]=q1;ae[152]=G1;ae[153]=W1;ae[154]=H1;ae[155]=J1;ae[156]=Se;ae[157]=Se;ae[158]=Se;ae[159]=X1;for(let e=160;e<=183;e++)ae[e]=Y1;ae[184]=Q1;ae[185]=Z1;ae[186]=eI;ae[187]=tI;ae[188]=Se;ae[189]=Se;ae[190]=Se;ae[191]=rI;for(let e=192;e<=215;e++)ae[e]=nI;ae[216]=iI;ae[217]=oI;ae[218]=sI;ae[219]=aI;ae[220]=Se;ae[221]=Se;ae[222]=Se;ae[223]=Se;for(let e=224;e<=243;e++)ae[e]=ps("simple values are not supported");ae[244]=Se;ae[245]=Se;ae[246]=Se;ae[247]=dI;ae[248]=ps("simple values are not supported");ae[249]=yI;ae[250]=hI;ae[251]=gI;ae[252]=Se;ae[253]=Se;ae[254]=Se;ae[255]=pI;var ir=[];for(let e=0;e<24;e++)ir[e]=new ee(C.uint,e,1);for(let e=-1;e>=-24;e--)ir[31-e]=new ee(C.negint,e,1);ir[64]=new ee(C.bytes,new Uint8Array(0),1);ir[96]=new ee(C.string,"",1);ir[128]=new ee(C.array,0,1);ir[160]=new ee(C.map,0,1);ir[244]=new ee(C.false,!1,1);ir[245]=new ee(C.true,!0,1);ir[246]=new ee(C.null,null,1);function wu(){let e=[];return e[C.uint.major]=cn,e[C.negint.major]=pu,e[C.bytes.major]=ds,e[C.string.major]=z1,e[C.array.major]=yu,e[C.map.major]=hu,e[C.tag.major]=gu,e[C.float.major]=bu,e}var pP=wu(),$a=new Ip,ld=class Rp{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${Zr} object contains circular references`);return new Rp(r,t)}},Sr={null:new ee(C.null,null),undefined:new ee(C.undefined,void 0),true:new ee(C.true,!0),false:new ee(C.false,!1),emptyArray:new ee(C.array,0),emptyMap:new ee(C.map,0)},Cr={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new ee(C.float,e):e>=0?new ee(C.uint,e):new ee(C.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new ee(C.uint,e):new ee(C.negint,e)},Uint8Array(e,t,r,n){return new ee(C.bytes,e)},string(e,t,r,n){return new ee(C.string,e)},boolean(e,t,r,n){return e?Sr.true:Sr.false},null(e,t,r,n){return Sr.null},undefined(e,t,r,n){return Sr.undefined},ArrayBuffer(e,t,r,n){return new ee(C.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new ee(C.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[Sr.emptyArray,new ee(C.break)]:Sr.emptyArray;n=ld.createCheck(n,e);let i=[],o=0;for(let s of e)i[o++]=Uo(s,r,n);return r.addBreakTokens?[new ee(C.array,e.length),i,new ee(C.break)]:[new ee(C.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",o=i?e.keys():Object.keys(e),s=i?e.size:o.length;if(!s)return r.addBreakTokens===!0?[Sr.emptyMap,new ee(C.break)]:Sr.emptyMap;n=ld.createCheck(n,e);let a=[],c=0;for(let f of o)a[c++]=[Uo(f,r,n),Uo(i?e.get(f):e[f],r,n)];return bI(a,r),r.addBreakTokens?[new ee(C.map,s),a,new ee(C.break)]:[new ee(C.map,s),a]}};Cr.Map=Cr.Object;Cr.Buffer=Cr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Cr[`${e}Array`]=Cr.DataView;function Uo(e,t={},r){let n=h1(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||Cr[n];if(typeof i=="function"){let s=i(e,n,t,r);if(s!=null)return s}let o=Cr[n];if(!o)throw new Error(`${Zr} unsupported type: ${n}`);return o(e,n,t,r)}function bI(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Cp(e,t,r,n){if(Array.isArray(t))for(let i of t)Cp(e,i,r,n);else r[t.type.major](e,t,n)}function vI(e,t,r){let n=Uo(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let i=r.quickEncodeToken(n);if(i)return i;let o=t[n.type.major];if(o.encodedSize){let s=o.encodedSize(n,r),a=new Ip(s);if(o(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return fu(a.chunks[0])}}return $a.reset(),Cp($a,n,t,r),$a.toBytes(!0)}var _I={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},wI=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=ir[e];if(t===void 0){let r=ae[e];if(!r)throw new Error(`${he} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let n=e&31;t=r(this.data,this._pos,n,this.options)}return this._pos+=t.encodedLength,t}},xi=Symbol.for("DONE"),ys=Symbol.for("BREAK");function TI(e,t,r){let n=[];for(let i=0;i<e.value;i++){let o=Ni(t,r);if(o===ys){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed array`)}if(o===xi)throw new Error(`${he} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=o}return n}function AI(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},o=n?new Map:void 0;for(let s=0;s<e.value;s++){let a=Ni(t,r);if(a===ys){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed map`)}if(a===xi)throw new Error(`${he} found map but not enough entries (got ${s} [no key], expected ${e.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${he} non-string keys not supported (got ${typeof a})`);if(r.rejectDuplicateMapKeys===!0&&(n&&o.has(a)||!n&&a in i))throw new Error(`${he} found repeat map key "${a}"`);let c=Ni(t,r);if(c===xi)throw new Error(`${he} found map but not enough entries (got ${s} [no value], expected ${e.value})`);n?o.set(a,c):i[a]=c}return n?o:i}function Ni(e,t){if(e.done())return xi;let r=e.next();if(r.type===C.break)return ys;if(r.type.terminal)return r.value;if(r.type===C.array)return TI(r,e,t);if(r.type===C.map)return AI(r,e,t);if(r.type===C.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Ni(e,t);return t.tags[r.value](n)}throw new Error(`${he} tag not supported (${r.value})`)}throw new Error("unsupported")}function OI(e,t){if(!(e instanceof Uint8Array))throw new Error(`${he} data to decode must be a Uint8Array`);t=Object.assign({},_I,t);let r=t.tokenizer||new wI(e,t),n=Ni(r,t);if(n===xi)throw new Error(`${he} did not find any content to decode`);if(n===ys)throw new Error(`${he} got unexpected break`);return[n,e.subarray(r.pos())]}function $p(e,t){let[r,n]=OI(e,t);if(n.length>0)throw new Error(`${he} too many terminals, data makes no sense`);return r}var II=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===C.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===C.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[C.uint.major](e,t){this.prefix(e);let r=String(t.value),n=[];for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);e.push(n)}[C.negint.major](e,t){this[C.uint.major](e,t)}[C.bytes.major](e,t){throw new Error(`${Zr} unsupported type: Uint8Array`)}[C.string.major](e,t){this.prefix(e);let r=Ap(JSON.stringify(t.value));e.push(r.length>32?fu(r):r)}[C.array.major](e,t){this.prefix(e),this.inRecursive.push({type:C.array,elements:0}),e.push([91])}[C.map.major](e,t){this.prefix(e),this.inRecursive.push({type:C.map,elements:0}),e.push([123])}[C.tag.major](e,t){}[C.float.major](e,t){if(t.type.name==="break"){let o=this.inRecursive.pop();if(o){if(o.type===C.array)e.push([93]);else if(o.type===C.map)e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${Zr} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let r=String(t.value),n=[],i=!1;for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o),!i&&(n[o]===46||n[o]===101||n[o]===69)&&(i=!0);i||(n.push(46),n.push(48)),e.push(n)}};function EI(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Zr} complex map keys are not supported`);let r=e[0],n=t[0];if(r.type!==C.string||n.type!==C.string)throw new Error(`${Zr} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${Zr} unexpected duplicate map keys, this is not supported`)}var SI={addBreakTokens:!0,mapSorter:EI};function xI(e,t){return t=Object.assign({},SI,t),vI(e,new II,t)}var Up=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${he} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${he} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,r=!1,n=s=>{for(;!this.done();){let a=this.ch();if(s.includes(a))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,r=!0;else return new ee(C.uint,0,this._pos-e);if(n([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${he} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(r)throw new Error(`${he} unexpected token at position ${this._pos}`);r=!0,this._pos++,n([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(r=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,n([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),o=parseFloat(i);return r?new ee(C.float,o,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(o)?new ee(o>=0?C.uint:C.negint,o,this._pos-e):new ee(o>=0?C.uint:C.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${he} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,o=0;i<this.data.length&&o<65536;i++,o++){let s=this.data[i];if(s===92||s<32||s>=128)break;if(s===34){let a=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new ee(C.string,a,o)}}let e=this._pos,t=[],r=()=>{if(this._pos+4>=this.data.length)throw new Error(`${he} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let o=0;o<4;o++){let s=this.ch();if(s>=48&&s<=57)s-=48;else if(s>=97&&s<=102)s=s-97+10;else if(s>=65&&s<=70)s=s-65+10;else throw new Error(`${he} unexpected unicode escape character at position ${this._pos}`);i=i*16+s,this._pos++}return i},n=()=>{let i=this.ch(),o=null,s=i>239?4:i>223?3:i>191?2:1;if(this._pos+s>this.data.length)throw new Error(`${he} unexpected unicode sequence at position ${this._pos}`);let a,c,f,l;switch(s){case 1:i<128&&(o=i);break;case 2:a=this.data[this._pos+1],(a&192)===128&&(l=(i&31)<<6|a&63,l>127&&(o=l));break;case 3:a=this.data[this._pos+1],c=this.data[this._pos+2],(a&192)===128&&(c&192)===128&&(l=(i&15)<<12|(a&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:a=this.data[this._pos+1],c=this.data[this._pos+2],f=this.data[this._pos+3],(a&192)===128&&(c&192)===128&&(f&192)===128&&(l=(i&15)<<18|(a&63)<<12|(c&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}o===null?(o=65533,s=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|o&1023),t.push(o),this._pos+=s};for(;!this.done();){let i=this.ch(),o;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${he} unexpected string termination at position ${this._pos}`);switch(o=this.ch(),this._pos++,o){case 34:case 39:case 92:case 47:t.push(o);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(r());break;default:throw new Error(`${he} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new ee(C.string,Op(t),this._pos-e);default:if(i<32)throw new Error(`${he} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):n()}}throw new Error(`${he} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new ee(C.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new ee(C.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new ee(C.null,null,4);case 102:return this.expect([102,97,108,115,101]),new ee(C.false,!1,5);case 116:return this.expect([116,114,117,101]),new ee(C.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${he} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new ee(C.break,void 0,1);if(this.ch()!==44)throw new Error(`${he} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new ee(C.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new ee(C.break,void 0,1);if(this.ch()!==44)throw new Error(`${he} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new ee(C.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${he} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${he} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function NI(e,t){return t=Object.assign({tokenizer:new Up(e,t)},t),$p(e,t)}var yP=new Uint8Array(0);function PI(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}function Tu(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function RI(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=e.length,c=e.charAt(0),f=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function g(M){if(M instanceof Uint8Array||(ArrayBuffer.isView(M)?M=new Uint8Array(M.buffer,M.byteOffset,M.byteLength):Array.isArray(M)&&(M=Uint8Array.from(M))),!(M instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(M.length===0)return"";for(var z=0,Q=0,F=0,L=M.length;F!==L&&M[F]===0;)F++,z++;for(var G=(L-F)*l+1>>>0,H=new Uint8Array(G);F!==L;){for(var j=M[F],re=0,W=G-1;(j!==0||re<Q)&&W!==-1;W--,re++)j+=256*H[W]>>>0,H[W]=j%a>>>0,j=j/a>>>0;if(j!==0)throw new Error("Non-zero carry");Q=re,F++}for(var pe=G-Q;pe!==G&&H[pe]===0;)pe++;for(var $=c.repeat(z);pe<G;++pe)$+=e.charAt(H[pe]);return $}function P(M){if(typeof M!="string")throw new TypeError("Expected String");if(M.length===0)return new Uint8Array;var z=0;if(M[z]!==" "){for(var Q=0,F=0;M[z]===c;)Q++,z++;for(var L=(M.length-z)*f+1>>>0,G=new Uint8Array(L);M[z];){var H=r[M.charCodeAt(z)];if(H===255)return;for(var j=0,re=L-1;(H!==0||j<F)&&re!==-1;re--,j++)H+=a*G[re]>>>0,G[re]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");F=j,z++}if(M[z]!==" "){for(var W=L-F;W!==L&&G[W]===0;)W++;for(var pe=new Uint8Array(Q+(L-W)),$=Q;W!==L;)pe[$++]=G[W++];return pe}}}function E(M){var z=P(M);if(z)return z;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:P,decode:E}}var CI=RI,$I=CI,UI=$I,BI=class{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},MI=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;let n=t.codePointAt(0);if(n===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n,this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Bp(this,e)}},kI=class{decoders;constructor(e){this.decoders=e}or(e){return Bp(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Bp(e,t){return new kI({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var DI=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new BI(e,t,r),this.decoder=new MI(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Mp({name:e,prefix:t,encode:r,decode:n}){return new DI(e,t,r,n)}function hs({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=UI(r,e);return Mp({prefix:t,name:e,encode:n,decode:o=>Tu(i(o))})}function LI(e,t,r,n){let i=e.length;for(;e[i-1]==="=";)--i;let o=new Uint8Array(i*r/8|0),s=0,a=0,c=0;for(let f=0;f<i;++f){let l=t[e[f]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|l,s+=r,s>=8&&(s-=8,o[c++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o}function jI(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,o="",s=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s!==0&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o}function FI(e){let t={};for(let r=0;r<e.length;++r)t[e[r]]=r;return t}function vt({name:e,prefix:t,bitsPerChar:r,alphabet:n}){let i=FI(n);return Mp({prefix:t,name:e,encode(o){return jI(o,n,r)},decode(o){return LI(o,i,r,e)}})}var Bo=vt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),hP=vt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),gP=vt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),mP=vt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),bP=vt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),vP=vt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),_P=vt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),wP=vt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),TP=vt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Mo=hs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),AP=hs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Pr=hs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),OP=hs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),kp={};Aa(kp,{Digest:()=>gs,create:()=>Au,decode:()=>Ou,equals:()=>Lp,hasCode:()=>sE});var VI=Dp,dd=128,KI=127,zI=~KI,qI=Math.pow(2,31);function Dp(e,t,r){t=t||[],r=r||0;for(var n=r;e>=qI;)t[r++]=e&255|dd,e/=128;for(;e&zI;)t[r++]=e&255|dd,e>>>=7;return t[r]=e|0,Dp.bytes=r-n+1,t}var GI=ja,WI=128,pd=127;function ja(e,n){var r=0,n=n||0,i=0,o=n,s,a=e.length;do{if(o>=a)throw ja.bytes=0,new RangeError("Could not decode varint");s=e[o++],r+=i<28?(s&pd)<<i:(s&pd)*Math.pow(2,i),i+=7}while(s>=WI);return ja.bytes=o-n,r}var HI=Math.pow(2,7),JI=Math.pow(2,14),XI=Math.pow(2,21),YI=Math.pow(2,28),QI=Math.pow(2,35),ZI=Math.pow(2,42),eE=Math.pow(2,49),tE=Math.pow(2,56),rE=Math.pow(2,63),nE=function(e){return e<HI?1:e<JI?2:e<XI?3:e<YI?4:e<QI?5:e<ZI?6:e<eE?7:e<tE?8:e<rE?9:10},iE={encode:VI,decode:GI,encodingLength:nE},oE=iE,Jo=oE;function Fa(e,t=0){return[Jo.decode(e,t),Jo.decode.bytes]}function Xo(e,t,r=0){return Jo.encode(e,t,r),t}function Yo(e){return Jo.encodingLength(e)}function Au(e,t){let r=t.byteLength,n=Yo(e),i=n+Yo(r),o=new Uint8Array(i+r);return Xo(e,o,0),Xo(r,o,n),o.set(t,i),new gs(e,r,t,o)}function Ou(e){let t=Tu(e),[r,n]=Fa(t),[i,o]=Fa(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new gs(r,i,s,t)}function Lp(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&PI(e.bytes,r.bytes)}}var gs=class{code;size;digest;bytes;constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}};function sE(e,t){return e.code===t}function yd(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return uE(r,Va(e),t??Pr.encoder);default:return cE(r,Va(e),t??Bo.encoder)}}var hd=new WeakMap;function Va(e){let t=hd.get(e);if(t==null){let r=new Map;return hd.set(e,r),r}return t}var at=class et{code;version;multihash;bytes;"/";constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==_i)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==fE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return et.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=Au(t,r);return et.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return et.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&Lp(t.multihash,n.multihash)}toString(t){return yd(this,t)}toJSON(){return{"/":yd(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof et)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:o,bytes:s}=r;return new et(n,i,o,s??gd(n,i,o.bytes))}else if(r[lE]===!0){let{version:n,multihash:i,code:o}=r,s=Ou(i);return et.create(n,o,s)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==_i)throw new Error(`Version 0 CID must use dag-pb (code: ${_i}) block encoding`);return new et(t,r,n,n.bytes)}case 1:{let i=gd(t,r,n.bytes);return new et(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return et.create(0,_i,t)}static createV1(t,r){return et.create(1,t,r)}static decode(t){let[r,n]=et.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=et.inspectBytes(t),n=r.size-r.multihashSize,i=Tu(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=i.subarray(r.multihashSize-r.digestSize),s=new gs(r.multihashCode,r.digestSize,o,i);return[r.version===0?et.createV0(s):et.createV1(r.codec,s),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[g,P]=Fa(t.subarray(r));return r+=P,g},i=n(),o=_i;if(i===18?(i=0,r=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=r,a=n(),c=n(),f=r+c,l=f-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:f}}static parse(t,r){let[n,i]=aE(t,r),o=et.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Va(o).set(n,t),o}};function aE(e,t){switch(e[0]){case"Q":{let r=t??Pr;return[Pr.prefix,r.decode(`${Pr.prefix}${e}`)]}case Pr.prefix:{let r=t??Pr;return[Pr.prefix,r.decode(e)]}case Bo.prefix:{let r=t??Bo;return[Bo.prefix,r.decode(e)]}case Mo.prefix:{let r=t??Mo;return[Mo.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function uE(e,t,r){let{prefix:n}=r;if(n!==Pr.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let o=r.encode(e).slice(1);return t.set(n,o),o}else return i}function cE(e,t,r){let{prefix:n}=r,i=t.get(n);if(i==null){let o=r.encode(e);return t.set(n,o),o}else return i}var _i=112,fE=18;function gd(e,t,r){let n=Yo(e),i=n+Yo(t),o=new Uint8Array(i+r.byteLength);return Xo(e,o,0),Xo(t,o,n),o.set(r,i),o}var lE=Symbol.for("@ipld/js-cid/CID"),dE=20;function jp({name:e,code:t,encode:r,minDigestLength:n,maxDigestLength:i}){return new pE(e,t,r,n,i)}var pE=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,r,n,i){this.name=e,this.code=t,this.encode=r,this.minDigestLength=n??dE,this.maxDigestLength=i}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?md(r,this.code,t?.truncate):r.then(n=>md(n,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function md(e,t,r){if(r!=null&&r!==e.byteLength){if(r>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,r)}return Au(t,e)}var Fp=vt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),IP=vt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),EP=vt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),SP=vt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function yE(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function hE(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=at.asCID(e);if(!t)return null;let r=t.toString();return[new ee(C.map,1/0,1),new ee(C.string,"/",1),new ee(C.string,r,r.length),new ee(C.break,void 0,1)]}function Qo(e){let t=Fp.encode(e).slice(1);return[new ee(C.map,1/0,1),new ee(C.string,"/",1),new ee(C.map,1/0,1),new ee(C.string,"bytes",5),new ee(C.string,t,t.length),new ee(C.break,void 0,1),new ee(C.break,void 0,1)]}function Wt(e){return Qo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function gE(e){return Qo(new Uint8Array(e))}function mE(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function bE(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var vE={typeEncoders:{Object:hE,Buffer:Qo,Uint8Array:Qo,Int8Array:Wt,Uint16Array:Wt,Int16Array:Wt,Uint32Array:Wt,Int32Array:Wt,Float32Array:Wt,Float64Array:Wt,Uint8ClampedArray:Wt,BigInt64Array:Wt,BigUint64Array:Wt,DataView:Wt,ArrayBuffer:gE,undefined:mE,number:bE}},_E=class extends Up{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===C.map){let t=this._next();if(t.type===C.string&&t.value==="/"){let r=this._next();if(r.type===C.string){if(this._next().type!==C.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(r),new ee(C.tag,42,0)}if(r.type===C.map){let n=this._next();if(n.type===C.string&&n.value==="bytes"){let i=this._next();if(i.type===C.string){for(let s=0;s<2;s++)if(this._next().type!==C.break)throw new Error("Invalid encoded Bytes form");let o=Fp.decode(`m${i.value}`);return new ee(C.bytes,o,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}},Ka={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Ka.tags[42]=at.parse;var wE="dag-json",Vp=297,Iu=e=>xI(e,vE),ms=e=>{let t=yE(e),r=Object.assign(Ka,{tokenizer:new _E(t,Ka)});return NI(t,r)},bd=e=>TE.decode(Iu(e)),TE=new TextDecoder,AE=e=>ms(OE.encode(e)),OE=new TextEncoder;function IE(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Kp(e,t,r=""){let n=IE(e),i=e?.length,o=t!==void 0;if(!n||o&&i!==t){let s=r&&`"${r}" `,a=o?` of length ${t}`:"",c=n?`length=${i}`:`type=${typeof e}`;throw new Error(s+"expected Uint8Array"+a+", got "+c)}return e}function vd(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function EE(e,t){Kp(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}function za(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ua(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function er(e,t){return e<<32-t|e>>>t}function SE(e,t={}){let r=(i,o)=>e(o).update(i).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.create=i=>e(i),Object.assign(r,t),Object.freeze(r)}var xE=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function NE(e,t,r){return e&t^~e&r}function PE(e,t,r){return e&t^e&r^t&r}var RE=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=Ua(this.buffer)}update(e){vd(this),Kp(e);let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let a=Ua(e);for(;n<=i-o;o+=n)this.process(a,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){vd(this),EE(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;t[o++]=128,za(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(r,0),o=0);for(let l=o;l<n;l++)t[l]=0;r.setBigUint64(n-8,BigInt(this.length*8),i),this.process(r,0);let s=Ua(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let c=a/4,f=this.get();if(c>f.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<c;l++)s.setUint32(4*l,f[l],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}},xr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),CE=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Nr=new Uint32Array(64),$E=class extends RE{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=i|0,this.F=o|0,this.G=s|0,this.H=a|0}process(e,t){for(let l=0;l<16;l++,t+=4)Nr[l]=e.getUint32(t,!1);for(let l=16;l<64;l++){let g=Nr[l-15],P=Nr[l-2],E=er(g,7)^er(g,18)^g>>>3,M=er(P,17)^er(P,19)^P>>>10;Nr[l]=M+Nr[l-7]+E+Nr[l-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:f}=this;for(let l=0;l<64;l++){let g=er(s,6)^er(s,11)^er(s,25),P=f+g+NE(s,a,c)+CE[l]+Nr[l]|0,M=(er(r,2)^er(r,13)^er(r,22))+PE(r,n,i)|0;f=c,c=a,a=s,s=o+P|0,o=i,i=n,n=r,r=P+M|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,f=f+this.H|0,this.set(r,n,i,o,s,a,c,f)}roundClean(){za(Nr)}destroy(){this.set(0,0,0,0,0,0,0,0),za(this.buffer)}},UE=class extends $E{A=xr[0]|0;B=xr[1]|0;C=xr[2]|0;D=xr[3]|0;E=xr[4]|0;F=xr[5]|0;G=xr[6]|0;H=xr[7]|0;constructor(){super(32)}},BE=SE(()=>new UE,xE(1));var We=Ut(dr(),1),zp=Ut(tb(),1),qa=e=>We.Type.Union([e,We.Type.Null()]);var qp=/^(k51qz|baguq)[0-9a-z]{56,57}$/,ME=/^[0-9A-Fa-f]{7,8}$/g;We.FormatRegistry.Set("EntityID",e=>!!e.match(ME)||!!e.match(qp));var Gp=We.Type.String(),bs=e=>e?.enc instanceof Uint8Array;We.FormatRegistry.Set("CID",e=>!!e.match(qp));var Eu=We.Type.String({format:"CID"}),kE=/^http([s]?):\/\/.*\..*/;We.FormatRegistry.Set("URL",e=>!!e.match(kE));var DE=We.Type.String({format:"URL"}),Su=We.Type.Object({en:Gp,at:We.Type.String(),vl:qa(We.Type.Union([We.Type.String(),We.Type.Boolean(),We.Type.Number()])),ts:We.Type.String(),ag:We.Type.String(),pv:qa(Eu)}),Ga=zp.TypeCompiler.Compile(Su);var LE=Ga.Check.bind(Ga),Wp=We.Type.Composite([We.Type.Object({cid:Eu}),Su]),Zo=zp.TypeCompiler.Compile(Wp),Hp=e=>Array.from(Zo.Errors(e)),xu=Zo.Check.bind(Zo);function Jp(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var jE=jp({name:"sha2-256",code:18,encode:Jp("SHA-256")}),xP=jp({name:"sha2-512",code:19,encode:Jp("SHA-512")}),{WARN:_d,LOG:NP,DEBUG:FE,VERBOSE:es,ERROR:VE}=Ce.setup(Ce.INFO),Xp=114;function Nu(e,t=["cid"]){if(!e)throw VE("falsy log",e);let r=e.cid;if(bs(e))return r||(r=vs(Pu(e).bytes).toString()),_d("preparing an encrypted applog - really?"),{log:e,cid:r};let n={};for(let[i,o]of Object.entries(e))o===void 0&&(_d(`log.${i} is undefined, which is not allowed - encoding as null`,e),o=null),t.includes(i)?es("excluding app log",{key:i,val:o}):n[i]=o;return{log:n,cid:r}}function Yp(e){return vs(Qp(e).bytes)}function Qp(e){return Pu(Nu(e)?.log)}function vs(e){let t=BE(e),r=kp.create(jE.code,t),n=at.create(1,Vp,r);return es("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function Pu(e){FE("[encodeBlock]",e);let t=Iu(e);return{bytes:t,cid:vs(t)}}function Ru(e){let t=null,r=[];try{t=at.parse(e)}catch(n){es("[retrieveThread] couldn't parse pubID with default base"),r.push(n)}if(!t)try{t=at.parse(e,Mo)}catch(n){es("[retrieveThread] couldn't parse pubID with base36"),r.push(n)}return{cid:t,errors:t?null:r,isIpns:t&&Zp(t)}}function Zp(e){return e.code===Xp}function Wa(e){return typeof e=="string"?at.parse(e):typeof e.toV1!="function"?at.decode(e.bytes):e}function _s(e,t){if(!e||!t)throw new Error(`[areCidsEqual] invalid params: ${e}, ${t}`);if(e===t)return!0;let r=Wa(e),n=Wa(t);return r.toV1().toString()===n.toV1().toString()}function Cu(e,t){return e instanceof Set?e.has(typeof t=="string"?t:t.toV1().toString()):e.some(r=>_s(r,t))}function wd(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function KE(e,t){let r=wd(e),n=wd(t);return+r<+n}var{WARN:PP,LOG:RP,DEBUG:CP,VERBOSE:zE,ERROR:Td}=Ce.setup(Ce.INFO),ey=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),$u=(e,t,r)=>Ve.structural(od(t,e),od(r,e)),ty=(e,t,r="asc")=>ey(e.ts,t.ts,r),qE=WO($u,["en","at"]);function $r(e,t="asc"){return e.sort((r,n)=>ty(r,n,t))}var ry=(e,t)=>KE(new Date(e.ts),new Date(t.ts));var Uu=e=>{let t=new Map;for(let r of e){if(!r)throw Td("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!r.cid)throw Td("applog with missing CID",r),new Error("applog with missing CID");let n=r.cid;t.has(n)?zE("Skipping duplicate applog:",[t.get(n),r]):t.set(n,r)}return Array.from(t.values())};function ny(e){return typeof e=="string"&&e.startsWith("?")}function iy(e){return e.slice(1)}function ws(e,t){let r={},n={};for(let[i,o]of Object.entries(e))if(ny(o)){let s=iy(o),a=t[s];a?n[i]=a:r[i]=s}else n[i]=o;return[n,r]}function oy(e,t,r){let n;if(t){let i=typeof t;i==="string"?n=t===r:i==="function"?n=t(r):typeof t.has=="function"?n=t.has(r):Array.isArray(t)&&!Array.isArray(r)?n=t.includes(r):n=t===r}else n=t===r;return e.charAt(0)==="!"?!n:n}var sy=function(t){for(var r=0,n=0,i=t.length;n<i;n++)r+=t[n];return r},Ad=function(t){return sy(t)/t.length},mt={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return mt.max(e)-mt.min(e)},midrange:function(e){return mt.range(e)/2},sum:sy,mean:Ad,average:Ad,median:function(e){e.sort(function(r,n){return r-n});var t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2},modes:function(e){if(!e.length)return[];var t={},r=0,n=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>r?(n=[i],r=t[i]):t[i]===r&&(n.push(i),r=t[i])}),n},variance:function(e){var t=mt.mean(e);return mt.mean(e.map(function(r){return Math.pow(r-t,2)}))},standardDeviation:function(e){return Math.sqrt(mt.variance(e))},meanAbsoluteDeviation:function(e){var t=mt.mean(e);return mt.mean(e.map(function(r){return Math.abs(r-t)}))},zScores:function(e){var t=mt.mean(e),r=mt.standardDeviation(e);return e.map(function(n){return(n-t)/r})}};mt.average=mt.mean;function Bu(){return new Date().toISOString()}var{WARN:GE,LOG:$P,DEBUG:WE,VERBOSE:UP,ERROR:ts}=Ce.setup(Ce.INFO);function ay(e,t){let r=Bu(),n=t;return e.map(o=>uy(o,{ts:r,threadForPv:n}))}function uy(e,{ts:t,threadForPv:r}={}){let n=ly(e,t??Bu()),i=dy(n,r),o=Yp(i).toString();e.cid&&e.cid!==o&&GE("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:o,logWithPv:i});let s={...i,cid:o};if(!xu(s))throw ts(`Bogus Applog ${JSON.stringify(s)}`,Hp(s));return Object.freeze(s)}function cy(e){return!!e.ts}function fy(e){return!!e.pv}function ly(e,t){return cy(e)?e:{...e,ts:t}}function dy(e,t){if(e.pv!==void 0)return e;if(t){let{en:r,at:n}=e,i=t.findLast(s=>s.en==r&&s.at==n);if($u(["en","at","vl","ts","ag"],e,i))throw ts("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let o=(e.pv!==void 0?e.pv:i?.cid)??null;return{...e,pv:o}}else{if(!fy(e))throw ts("[withPvFrom] no thread and no pv:",e);return e}}function Ui(e){let t=()=>(Re(()=>e.length<2&&WE(`joinThreads with count=${e.length}`)),$r(Uu(e.flatMap(i=>{let o=i.applogs;if(!o)throw ts("falsy applogs of thread",i),new Error("falsy applogs of thread");return o})))),r=Re(()=>t()),n=ot(function(i,o){return rr(i)?{init:Re(()=>t())}:{added:i.added.filter(s=>!this.hasApplog(s,!0)),removed:i.removed?.filter(s=>!!this.parents.some(c=>c===o?!1:c.hasApplog(s,!0)))}});return new Ts(Re(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var{WARN:Od,LOG:BP,DEBUG:Id,VERBOSE:Yr,ERROR:Ed}=Ce.setup(Ce.INFO),Ts=class py extends tn{constructor(t,r,n,i,o,s=null){super(t,r,n,o?$e.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=o,this._writeMapper=s,Er(this,{onParentUpdate:ot}),o&&this.subscribeToParents()}static mapWrites(t,r,n){return new py(`${r}<${t.nameAndSizeUntracked}>`,t,t.filters,t._applogs,null,n)}_parentSubscriptions=null;insert(t){let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insert(r))}insertRaw(t){let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insertRaw(r))}subscribeToParents(){this._parentSubscriptions=new Map;let t=$t(()=>{this.parents.length||Od("MappedThread has no parents",this),Yr(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(n=>n.name));let r=new Set([...this._parentSubscriptions.keys()]);for(let n of this.parents){r.delete(n)&&Yr(`[MappedThread: ${this.name}] Skipping re-sub to parent`,n.nameAndSizeUntracked),Yr(`[MappedThread: ${this.name}] sub to new parent`,n.nameAndSizeUntracked);let o=this.onParentUpdate.bind(this,n),s=n.subscribe(o);this._parentSubscriptions.set(n,s)}for(let n of r)Yr(`[MappedThread: ${this.name}] un-subscribing from old parent`,n.nameAndSizeUntracked),this._parentSubscriptions.get(n)(),this._parentSubscriptions.delete(n)})}subscribe(t){return this._parentSubscriptions||this.subscribeToParents(),super.subscribe(t)}triggerRemap(){if(!this._eventMapper)throw Ed("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);Id(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&Od(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Re(()=>lr(t.applogs))})})}onParentUpdate(t,r){Yr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,r);let n=this._eventMapper?this._eventMapper(r,t):r;if(this._eventMapper)if(Yr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,n),rr(n))this._applogs.replace([...n.init]);else{for(let i of n.added)this._applogs.splice(i1(this._applogs,i,"ts"),0,i);if(n.removed){for(let i of n.removed)if(!this._applogs.remove(i))if(!rr(r)&&r.removed?.includes(i))Id("Ignoring remove event for non-existent because it was part of parent event's removed",i,r);else throw Ed(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:r,mapResult:n})}}Yr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,yi(this._applogs)),this.notifySubscribers(n)}get readOnly(){return!1}},{WARN:MP,LOG:kP,DEBUG:DP,VERBOSE:Ba,ERROR:HE}=Ce.setup(Ce.INFO),yr=Qe("rollingFilter",function(t,r,n={}){let i=yy(r),o=Ha(i),s=$e.array(Re(function(){return o(t.applogs)}),{deep:!1,name:`${t.name} | ${n.name||`rollingFilter.array{${en(i)}}`}`}),a=g=>{let P;return rr(g)?P={init:o(g.init)}:P={added:o(g.added),removed:g.removed},Ba(`rollingFilter{${t.nameAndSizeUntracked} | ${n.name?` '${n.name}'}`:""} parentUpdate`,i,g,"=>",P),P},c=new Ts(`${t.name} | ${n.name||`rollingFilter{${en(i)}}`}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],s,a),f=ol(()=>lr(r),g=>{Ba(`rollingFilter<${t.nameAndSizeUntracked}>${n.name?` '${n.name}'`:""} patternUpdate`,i,"=>",g),i=g,o=Ha(i),c.triggerRemap()}),l=Hr(s,()=>{Ba(`rollingFilter<${Re(()=>t.name)}>${n.name?` '${n.name}'`:""} unobserve`,i),f(),l()});return c},{equals:jn,argsDebugName:(e,t,r)=>He({caller:"rollingFilter",thread:e,pattern:t,args:r})}),Mu=Qe("rollingMapper",function(t,r,n={}){let i=Re(()=>r.call(null,{init:t.applogs},t));if(!rr(i))throw HE("Initial run must return init event");let o=i.init;return new Ts(`${t.name} | ${n.name||"rollingMapper"}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],o,r)},{equals:jn,argsDebugName:(e,t,r)=>He({caller:"rollingMapper",thread:e,args:r})}),JE=Qe("rollingAcc",function(t,r,n,i={}){let o=ot(n);return o({init:t.applogs},r),t.subscribe(s=>{o(s,r)}),r},{argsDebugName:(e,t,r,n)=>`rollingAcc{${e.nameAndSizeUntracked}${n?.name?` | ${n?.name}`:""}}`}),yy=function(t){let r=Re(function(){return Object.fromEntries(Object.entries(lr(t)).map(([i,o])=>[lr(i),lr(o)]))});if(!Object.entries(r).length)throw new Error("Pattern is empty");return r};function Ha(e){return function(r){return r.filter(function(i){for(let o of Object.keys(e)){let s=e[o];if(s===void 0)continue;let a=i[o.startsWith("!")?o.slice(1):o];if(!oy(o,s,a))return!1}return!0})}}var{WARN:XE,LOG:YE,DEBUG:QE,VERBOSE:ZE,ERROR:ko}=Ce.setup(Ce.INFO),hy=class extends tn{constructor(e,t=[],r){super(e,null,r,t),Er(this,{})}purge(e){let t=this.applogs.length;return this._applogs=this.applogs.filter(r=>!e.includes(r.cid)),t-this.applogs.length}insert(e){let t=ay(e,this);return this.insertRaw(t)}insertRaw(e){let t=Uu(e);if(t.length!==e.length)throw ko(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});let r=e.filter(o=>!xu(o));if(r.length)throw ko(`[insertRaw] bogus applogs passed: ${r.length}`,{bogus:r});let n=e.filter(o=>this.hasApplog(o,!1));if(n.length)throw ko(`[insertRaw] already existing applogs passed: ${n.length}`,{existing:n});if(!e.length){XE("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof qn)?YE:QE)("Inserting:",e.length===1?e[0]:e,{ds:this}),$r(e);let i=this._applogs.length&&ry(e[0],this._applogs[this._applogs.length-1]);return this._applogs.push(...e),i&&$r(this._applogs),this.notifySubscribers({added:e,removed:null}),this.persist(e),e}get readOnly(){return!1}},qn=class Do extends hy{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,Er(this,{_applogs:$e.shallow})}static empty(t){return Do.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new Do(r??"in-memory",t,[],n)}static fromReadOnlyArray(t,r){return new Do(r??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if(ZE("[InMem.persist] no persist for",t),this.readOnly)throw ko("[persist] called for readOnly thread")}},{WARN:LP,LOG:jP,DEBUG:FP,VERBOSE:VP,ERROR:KP}=Ce.setup(Ce.INFO);var tS=class{constructor(e,t,r=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=r,Er(this,{threadOfTrail:ke})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?Ui([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},gy=class{constructor(e){this.nodes=e,Er(this,{threadOfAllTrails:ke,size:ke,isEmpty:ke})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Re(()=>this.records.length)}get records(){return nr(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return Ui(nr(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogSet(){return nr(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogSet"})}get leafNodeLogs(){return nr(()=>this.nodes.flatMap(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return Ui(nr(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:WR,LOG:As,DEBUG:hr,VERBOSE:Ae,ERROR:fn}=Ce.setup(Ce.INFO,{prefix:"[q]"}),ku=null,rS=Qe("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:r,tolerateAlreadyFiltered:n}={}){if(Ae(`lastWriteWins${r?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(n)return hr("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw fn("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,o=Mu(t,function(a,c){let f=rr(a),l,g=[],P=f?null:[];f?(i=new Map,l=a.init):l=a.added;let E;for(let M=r?0:l.length-1;r?M<l.length:M>=0;r?M++:M--){let z=l[M],Q=z.en+"|"+z.at;if(E&&(r?E>z.ts:E<z.ts))throw fn("lastWriteWins.mapper logs not sorted:",E,r?">":"<",z.ts,{log:z,i:M,newLogs:l,inverseToOnlyReturnFirstLogs:r});E=z.ts;let F=i.get(Q);(!F||(r?F.ts>z.ts:F.ts<z.ts))&&(F&&!f&&P.push(F),g.push(z),i.set(Q,z))}return $r(g),Ae.isDisabled||Ae(`lastWriteWins${r?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,f?{...Object.fromEntries(Object.entries(a).map(([M,z])=>[M,z?.length])),toAdd:g.length,toRemove:P}:{...a,toAdd:g,toRemove:P}),f?{init:g}:{added:g,removed:P}},{name:`lastWriteWins${r?".inversed":""}`,extraFilterName:"lastWriteWins"});return Ae.isDisabled||$t(()=>{Ae(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,o.applogs.length)}),o},{equals:jn,argsDebugName:e=>He({caller:"lastWriteWins",thread:e})}),HR=Qe("withoutDeleted",function(t){if(Ae.isEnabled&&Ae(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw fn("thread already filtered withoutDeleted:",t.filters,{name:t.name});let r=yr(t,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});Ae.isEnabled&&Ae(`withoutDeleted<${t.nameAndSizeUntracked}> deletionLogs:`,Re(function(){return[...r.applogs]}));let n=He({caller:"allDeletedEntities",thread:t}),i=vp(function(){return r.map(s=>s.en)},{name:n});return Ae.isEnabled&&$t(()=>{Ae(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),yr(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:jn}),my=Qe("query",function e(t,r,n={},i={}){fS();let o=by(t);hr(`query<${o.nameAndSizeUntracked}>:`,r);let s=Array.isArray(r)?r:[r],a;if(s.length===1)a=null;else{let l=s.slice(0,-1);a=e(o,l,n,i)}let c=s[s.length-1],f=nS(o,a,c,i);return Ae.isDisabled||$t(()=>Ae("query result:",lr(f))),f},{equals:ls,argsDebugName:(e,t,r)=>He({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),nS=Qe("queryStep",function(t,r,n,i={}){if(hr(`queryStep<${t.nameAndSizeUntracked}> with`,r?.untrackedSize??"all","nodes, pattern:",n),!Object.entries(n).length)throw new Error("Pattern is empty");function o(a){let[c,f]=ws(n,a?.variables??{});Ae("[queryStep.doQuery] patternWithoutVars: ",c);let l=yr(t,c),g=Os(f),P=nr(function(){let M=l.map(z=>({log:z,vars:g(z)}));return Ae.isEnabled&&Ae("[queryStep.doQuery] step node:",a?.variables," =>",M,"from:",Re(()=>l.applogs)),M.map(({log:z,vars:Q})=>{let F=Object.assign({},a?.variables,Q);return new tS(cu.fromArray([z],He({caller:"QueryNode",thread:l,pattern:`${en(F)}@${en(c)}`})),F,a)})},{name:He({caller:"doQuery.mapNodes",thread:l,pattern:n})});return Ae.isEnabled&&$t(()=>Ae("[queryStep.doQuery] resultNodes:",[...P])),i.debug&&As("[queryStep] step result:",Re(()=>P.map(({variables:E,logsOfThisNode:M})=>({variables:E,thread:M})))),P}let s=nr(function(){return hr(`[queryStep] Running with ${r?.nodes?.length} input nodes:`),r?[...r.nodes.flatMap(o)]:[...o(null)]},{name:He({caller:"queryStep",thread:t,pattern:n})});return Ae.isEnabled&&$t(()=>Ae("[queryStep] observableResultNodes:",[...s])),new gy(s)},{equals:ls,argsDebugName:(e,t,r)=>He({caller:"queryStep",thread:e,pattern:r})}),JR=Qe("queryNot",function(t,r,n,i={}){let o=r.nodes;hr(`queryNot<${t.nameAndSizeUntracked}> from: ${o.length} nodes`);let s=Array.isArray(n)?n:[n];for(let a of s){if(!Object.entries(n).length)throw new Error("Pattern is empty");o=o.filter(function({variables:f}){let[l,g]=ws(a,f??{});Ae("[queryNot] patternWithoutVars: ",l);let P=yr(t,l);return Ae("[queryNot] step node:",f," =>",P.size,"applogs"),Ae.isDisabled||Ae("[queryNot] step node:",f," => empty?",Re(()=>P.applogs)),i.debug&&As("[queryNot] node result:",f,"=>",P.applogs),P.isEmpty})}return new gy(o)},{equals:ls,argsDebugName:(e,t,r)=>He({caller:"queryNot",thread:e,pattern:r})}),XR=Qe("filterAndMap",function(t,r,n){hr(`filterAndMap<${t.nameAndSizeUntracked}>`,r);let i=yr(t,r);Ae.isEnabled&&(Ae("[filterAndMap] filtered:",i.untrackedSize),$t(()=>Ae("[filterAndMap] filtered:",i.applogs)));let o=He({thread:t,pattern:r,caller:"filterAndMap"}),s=nr(()=>sS(i,n),{name:o});return Ae.isDisabled||$t(()=>Ae("[filterAndMap] mapped:",s)),s},{equals:Ve.structural,argsDebugName:(e,t)=>He({caller:"filterAndMap",thread:e,pattern:t})}),YR=Qe("queryAndMap",function(t,r,n,i={}){let o=by(t);hr(`queryAndMap<${o.nameAndSizeUntracked}>`,{patternOrPatterns:r,variables:i,map:n});let s=He({thread:o,caller:"queryAndMap"}),a=my(o,r);Ae("[queryAndMap] filtered count:",a.untrackedSize);let c=nr(()=>aS(a,n),{name:s});return Ae.isDisabled||$t(()=>Ae("[queryAndMap] result:",lr(c))),c},{equals:Ve.structural,argsDebugName:(e,t)=>He({caller:"queryAndMap",thread:e,pattern:t})}),QR=Qe("queryEntity",function(t,r,n,i){hr(`queryEntity<${t.nameAndSizeUntracked}>`,n,r);let o=yr(t,{en:n,at:uS(r,i)});return Ae("queryEntity applogs:",o.applogs),ke(()=>o.isEmpty?null:Object.fromEntries(o.map(({at:s,vl:a})=>[s.slice(r.length+1),a])))},{equals:bp,argsDebugName:(e,t,r)=>He({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),ZR=Qe("agentsOfThread",function(t){hr(`agentsOfThread<${t.nameAndSizeUntracked}>`);let r=$e.map(),n=ot(o=>{for(let s of rr(o)?o.init:o.added){let a=r.get(s.ag)??0;r.set(s.ag,a+1)}for(let s of!rr(o)&&o.removed||[]){let a=r.get(s.ag);if(!a||a<1)throw fn("[agentsOfThread] number is now negative",{log:s,event:o,mapped:r,prev:a});r.set(s.ag,a-1)}As(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:o,mapped:r})});n({init:t.applogs});let i=t.subscribe(n);return xn(r,i),r}),iS=Qe("entityOverlap",function(t,r){return As(`entityOverlap<${t.nameAndSizeUntracked}, ${r.nameAndSizeUntracked}>`),ke(()=>{let n=new Set(t.map(o=>o.en)),i=new Set(r.map(o=>o.en));return[...n].filter(o=>i.has(o))})});var eC=Qe("entityOverlapCount",function(t,r){return ke(()=>iS(t,r).get().length)}),oS=Qe("querySingle",function(t,r,n={}){let i=my(t,r,n);return ke(()=>{if(i.isEmpty)return null;if(i.size>1)throw fn("[querySingle] got",i.size,"results:",i);let o=i.nodes[0].logsOfThisNode;if(o.size!=1)throw fn("[querySingle] single result, but got",o.size,"logs:",o.applogs);return o.applogs[0]})},{equals:Ve.structural,argsDebugName:(e,t)=>He({caller:"querySingle",thread:e,pattern:t})}),tC=Qe("querySingleAndMap",function(t,r,n,i={}){let o=oS(t,r,i);return ke(()=>{let s=o.get();if(s)return typeof n=="string"?s[n]:Os(n)(s)})},{equals:Ve.structural,argsDebugName:(e,t)=>He({caller:"querySingleAndMap",thread:e,pattern:t})}),sS=function(t,r){return typeof r=="function"?t.map(r):typeof r=="string"?t.map(n=>n[r]):t.map(Os(r))},aS=function(t,r){return typeof r=="function"?t.records.map(r):typeof r=="string"?t.nodes.map(n=>{if(!Object.hasOwn(n.record,r)){if(n.logsOfThisNode.size!==1)throw fn(`not sure what to map (it's not a var and a result node log count of ${n.logsOfThisNode.size})`);return n.logsOfThisNode.firstLog[r]}return n.record[r]}):t.nodes.map(n=>Os(r)(t))};function Os(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function uS(e,t){return t.map(r=>cS(e,r))}function cS(e,t){return`${e}/${t}`}function by(e,t){return Array.isArray(e)?qn.fromArray(e,t||`threadFromArray[${e.length}]`,!0):e}function fS(){if(ku!=null&&performance.now()>=ku)throw new lS(ku)}var lS=class extends Error{constructor(e){super(e)}};var yS=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=s;var r=128,n=127,i=~n,o=Math.pow(2,31);function s(a,c,f){if(Number.MAX_SAFE_INTEGER&&a>Number.MAX_SAFE_INTEGER)throw s.bytes=0,new RangeError("Could not encode varint");c=c||[],f=f||0;for(var l=f;a>=o;)c[f++]=a&255|r,a/=128;for(;a&i;)c[f++]=a&255|r,a>>>=7;return c[f]=a|0,s.bytes=f-l+1,c}}}),hS=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){"use strict";t.exports=i;var r=128,n=127;function i(o,c){var a=0,c=c||0,f=0,l=c,g,P=o.length;do{if(l>=P||f>49)throw i.bytes=0,new RangeError("Could not decode varint");g=o[l++],a+=f<28?(g&n)<<f:(g&n)*Math.pow(2,f),f+=7}while(g>=r);return i.bytes=l-c,a}}}),gS=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){"use strict";var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),s=Math.pow(2,35),a=Math.pow(2,42),c=Math.pow(2,49),f=Math.pow(2,56),l=Math.pow(2,63);t.exports=function(g){return g<r?1:g<n?2:g<i?3:g<o?4:g<s?5:g<a?6:g<c?7:g<f?8:g<l?9:10}}}),Lu=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:yS(),decode:hS(),encodingLength:gS()}}}),wy=42;function mS(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=at.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new ee(C.tag,wy),new ee(C.bytes,r)]}function bS(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function vS(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}function _S(e){for(let t of e.keys())if(typeof t!="string"||t.length===0)throw new Error("Non-string Map keys are not supported by the IPLD Data Model and cannot be encoded");return null}var vy={float64:!0,typeEncoders:{Map:_S,Object:mS,undefined:bS,number:vS}},dC={...vy,typeEncoders:{...vy.typeEncoders}};function wS(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return at.decode(e.subarray(1))}var Du={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Du.tags[wy]=wS;var pC={...Du,tags:Du.tags.slice()};var yC=Ut(Lu(),1);var Ur={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},Bi={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Ur.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Ur.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Bi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=Bi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:Ur.Int,CarV1HeaderOrV2Pragma:e=>{if(Ur.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=Bi["CarV1HeaderOrV2Pragma > roots (anon)"](e[o]);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.roots=a}}break;case"version":{n--;let a=Bi.Int(e[o]);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},Mi={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Ur.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Ur.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Mi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=Mi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:Ur.Int,CarV1HeaderOrV2Pragma:e=>{if(Ur.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=Mi["CarV1HeaderOrV2Pragma > roots (anon)"](s);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.roots=a}}break;case"version":{n--;let a=Mi.Int(s);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},hC={toTyped:Bi.CarV1HeaderOrV2Pragma,toRepresentation:Mi.CarV1HeaderOrV2Pragma},gC=wu(),mC=Ut(Lu(),1),bC=[new ee(C.map,2),new ee(C.string,"version"),new ee(C.uint,1),new ee(C.string,"roots")],vC=new ee(C.tag,42);var _C=Ut(Lu(),1);var{WARN:Ty,LOG:wC,DEBUG:_y,VERBOSE:ju,ERROR:Is}=Ce.setup(Ce.INFO);async function Fu(e){let t=await Ay(e);return await Vu(t)}async function Vu({rootCID:e,blockStore:t},r=[]){if(!e||!t)throw Is("Empty roots/blocks",{rootCID:e,blockStore:t});let n=await Gn(t,e),i,o=null,s=null;if(ju("[decodePubFromBlocks] root:",e.toString(),n,{blockStore:t}),!n)throw Is("root not found in blockStore",{blockStore:t,rootCID:e});if(n?.info){o=n.applogs;let l=await Gn(t,o);i=await AS(l,t),s=await Gn(t,n.info),_y("new format - infoLogs",s.logs.map(g=>({[g.toString()]:g})))}else i=n.applogs;let a=async l=>{let g=l,P=await Gn(t,g);if(!P)throw Is("Could not find applog CID in pub blocks:",g.toString(),{cid:g,root:n,blockStore:t}),new Error(`Could not find applog CID in pub blocks: ${g.toString()}`);return P.pv instanceof at&&(P.pv=P.pv.toV1().toString()),{...P,cid:g.toV1().toString()}},c;if(c=await Promise.all(i.map(a)),n.prev){if(_s(n.prev,e)||Cu(r,n.prev))throw Is("[pubFromBlocks] pub chain has a loop",{rootCID:e,prev:n.prev,recursionTrace:r});c=c.concat((await Vu({rootCID:n.prev,blockStore:t},[...r,e])).applogs)}let f={cid:e,info:{...s,logs:await Promise.all(s.logs.map(a))},applogsCID:o,applogs:c};return _y("[decodePubFromBlocks] result:",f,{rootCID:e.toString(),root:n,blockStore:t,applogs:c,info:s}),f}async function Ay(e){let r=(await e.getRoots()).map(i=>(typeof i.toV1=="function"?i:at.decode(i.bytes)).toV1().toString()),n=new Map;for await(let{cid:i,bytes:o}of e.blocks()){let s=typeof i.toV1=="function"?i:at.decode(i.bytes);ju({cidFromCarblocks:i,cid:s}),n.set(s.toV1().toString(),o)}return r.length!==1&&Ty("Unexpected roots count:",r),{rootCID:at.parse(r[0]),blockStore:{get:i=>n.get(i.toV1().toString())}}}async function Gn(e,t){try{var r=await e.get(t);if(!r)return Ty("returning null"),null}catch(n){if(n.message==="Not Found")return null;throw n}return ms(r)}function Ku(e){return async function*(){for(;;){let{done:t,value:r}=await e.read();if(ju("[car] chunk",{done:t,value:r}),t)break;yield r}}()}var{WARN:TC,LOG:AC,DEBUG:OC,VERBOSE:IC,ERROR:TS}=Ce.setup(Ce.INFO);async function AS(e,t){return OS(e)?(await Promise.all(e.chunks.map(async r=>{let n=await Gn(t,r);if(!n.logs)throw TS("Weird chunk",n);return n.logs}))).flat():e.logs}function OS(e){return e.chunks}var{WARN:Es,LOG:d$,DEBUG:ki,VERBOSE:p$,ERROR:Di}=$s.setup($s.INFO),Ss=class extends Error{constructor(t){super(`IPNS key has never been published: ${t}`),this.name="IPNSNeverPublishedError"}},Wn=class extends Error{constructor(t,r){super(`Failed to resolve IPNS ${t}: ${r}`),this.name="IPNSResolutionError",this.cause=r}};async function y$(e,t,{readOnly:r=!0,pinnedCID:n}={}){let{cid:i,errors:o,isIpns:s}=Ru(t);if(!i)throw Di("Failed to parse pubID",t,o);ki("[retrieveThread] parsedPubID",i);let a;if(n)ki("[retrieveThread] using pinnedCID"),s||Es("pubID isn't IPNS, but pinnedCID different:",{pubID:t,pinnedCID:n}),a=wt.parse(n);else if(!s)ki("[retrieveThread] pubID is not IPNS - using as CID"),a=i;else{if(!t)throw Di("[retrieveThread] neither pubID nor pinnedCID provided");if(!e.nameBaseUrl)throw Di("[retrieveThread] IPNS, but no nameBaseUrl");try{a=await IS(e,t),ki("Resolved pub to CID",a.toString())}catch(E){throw Di(`Failed to resolve IPNS ${t}:`,E)}}let c=await ES(e.gatewayBaseUrl,a),{applogs:f}=await Fu(c),l=f.filter(E=>bs(E));l.length&&Es(`Found ${l.length} encrypted logs - skipping`);let g=f.filter(E=>!(E instanceof Uint8Array));$r(g);let P=qn.fromArray(g,`preview${t&&t!==a.toString()?"-"+t:""}@${a.toString()}`,r);return{cid:a,thread:P,encryptedCount:l.length}}async function IS(e,t){let r=Us(e.nameBaseUrl),n;try{n=await fetch(`${r}/name/${t}`)}catch(o){throw new Wn(t,o)}if(!n.ok)throw n.status===404?new Ss(t):new Wn(t,`HTTP ${n.status}: ${n.statusText}`);let i;try{i=await n.json()}catch(o){throw new Wn(t,`Invalid JSON response: ${o}`)}if(!i.value)throw new Ss(t);i.value.startsWith("/ipfs/")||Es("IPNS value is not '/ipfs/..':",i);try{return wt.parse(i.value.replace("/ipfs/",""))}catch(o){throw new Wn(t,`Invalid CID in IPNS value: ${o}`)}}async function ES(e,t){e=Us(e),ki("Retrieving:",t.toString(),"from",e);let r=`${e}/ipfs/${t}?format=car&dag-scope=all`,n=await fetch(r),i;if((!n?.ok||!n?.body)&&(i=Di(`[retrieveCar] unexpected response ${n?.statusText}`,{url:r}),Es("Gateway failed:",r,i)),i=Ku(n.body.getReader()),i instanceof Error)throw i;return await jr.fromIterable(i)}export{Ss as a,Wn as b,y$ as c,IS as d,ES as e};
61
+ `+" ".repeat(t)+o):o==="{"&&n>0?(n++,r+=o):(o==="}"&&n>1&&n--,r+=o)}return r}function l1(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]instanceof tn){if(t[r]!==e[r])return!1}else if(!Ve.structural(e[r],t[r]))return!1;return!0}var{WARN:ad,LOG:lP,DEBUG:d1,VERBOSE:dP,ERROR:Xr}=Ce.setup(Ce.INFO,{prefix:"[thread]"});function rr(e){return e.init!==void 0}var tn=class{constructor(e,t,r,n=[],i={}){this.name=e,this._applogs=n,this.parents=t===null?null:vl(t),this.filters=r,Re(()=>this.parents?.length===0)&&ad("[Thread] empty parents array",e),i.skipObservable||Er(this,{applogsCids:ke,applogsByCid:ke,insert:ot,size:ke,isEmpty:ke,firstLog:ke,latestLog:ke},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw Xr("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Xr("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Xr("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw Xr("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Xr("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Xr("[Thread] insertRaw() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insertRaw(e)}subscribe(e){return this._subscribers.push(e),this.unsubscribe.bind(this,e)}unsubscribe(e){let t=this._subscribers.indexOf(e);t!==-1?this._subscribers.splice(t,1):ad("unsubscribe called for non-existent",e)}notifySubscribers(e){d1(`[thread: ${this.name}] notifying`,this._subscribers.length,"subscribers of",{...e,subs:this._subscribers});for(let t of this._subscribers)t(e)}get applogs(){return this._applogs}get applogsCids(){return this._applogs.map(e=>e.cid)}map(e){return this.applogs.map(e)}get findLast(){return this.applogs.findLast.bind(this.applogs)}get findFirst(){return this.applogs.find.bind(this.applogs)}get firstLog(){return this.applogs[0]}get latestLog(){return this.applogs[this.applogs.length-1]}hasApplog(e,t){if(t)return this.applogs.includes(e);if(!e.cid)throw Xr("[hasApplogs] applog without CID:",e);return this.hasApplogCid(e.cid)}hasApplogCid(e){return this.applogsCids.includes(e.toString())}get applogsByCid(){return new Map(this.applogs.map(e=>[e.cid,e]))}getApplog(e){return this.applogsByCid.get(e.toString())}hasApplogWithDiffTs(e){return this.applogs.find(t=>t.en===e.en&&t.at===e.at&&t.vl===e.vl&&t.ag===e.ag)}get isEmpty(){return this.size===0}get size(){return this.applogs.length}get length(){return this.applogs.length}get untrackedSize(){return Re(()=>this.size)}get nameAndSizeUntracked(){return Re(()=>`${this.name} (${this.size})`)}get prettyName(){return f1(this.name)}get hasParents(){return!!this.parents?.length}};var cu=class wp extends tn{static fromArray(t,r){return new wp(r||"static",null,[],t)}constructor(t,r,n,i){super(t,r,n,i,{skipObservable:!0})}get readOnly(){return!0}},Tp={};Aa(Tp,{code:()=>Vp,decode:()=>bs,encode:()=>Iu,format:()=>bd,name:()=>wE,parse:()=>AE,stringify:()=>bd});var p1=["string","number","bigint","symbol"],y1=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function h1(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(p1.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(g1(e))return"Buffer";let r=m1(e);return r||"Object"}function g1(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function m1(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(y1.includes(t))return t}var C=class{constructor(e,t,r){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};C.uint=new C(0,"uint",!0);C.negint=new C(1,"negint",!0);C.bytes=new C(2,"bytes",!0);C.string=new C(3,"string",!0);C.array=new C(4,"array",!1);C.map=new C(5,"map",!1);C.tag=new C(6,"tag",!1);C.float=new C(7,"float",!0);C.false=new C(7,"false",!0);C.true=new C(7,"true",!0);C.null=new C(7,"null",!0);C.undefined=new C(7,"undefined",!0);C.break=new C(7,"break",!0);var ee=class{constructor(e,t,r){this.type=e,this.value=t,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},Vn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",b1=new TextDecoder,v1=new TextEncoder;function Ho(e){return Vn&&globalThis.Buffer.isBuffer(e)}function fu(e){return e instanceof Uint8Array?Ho(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var _1=Vn?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):cd(e,t,r):(e,t,r)=>r-t>64?b1.decode(e.subarray(t,r)):cd(e,t,r),Ap=Vn?e=>e.length>64?globalThis.Buffer.from(e):ud(e):e=>e.length>64?v1.encode(e):ud(e);var lu=Vn?(e,t,r)=>Ho(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),w1=Vn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),fu(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},T1=Vn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function A1(e,t){if(Ho(e)&&Ho(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function ud(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}function cd(e,t,r){let n=[];for(;t<r;){let i=e[t],o=null,s=i>239?4:i>223?3:i>191?2:1;if(t+s<=r){let a,c,f,l;switch(s){case 1:i<128&&(o=i);break;case 2:a=e[t+1],(a&192)===128&&(l=(i&31)<<6|a&63,l>127&&(o=l));break;case 3:a=e[t+1],c=e[t+2],(a&192)===128&&(c&192)===128&&(l=(i&15)<<12|(a&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:a=e[t+1],c=e[t+2],f=e[t+3],(a&192)===128&&(c&192)===128&&(f&192)===128&&(l=(i&15)<<18|(a&63)<<12|(c&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),t+=s}return Op(n)}var fd=4096;function Op(e){let t=e.length;if(t<=fd)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=fd));return r}var O1=256,Ip=class{constructor(e=O1){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let n=t.length-(this.maxCursor-this.cursor)-1;t.set(e,n)}else{if(t){let n=t.length-(this.maxCursor-this.cursor)-1;n<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,n),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=T1(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let r=this.chunks[0];e&&this.cursor>r.length/2?(t=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=lu(r,0,this.cursor)}else t=w1(this.chunks,this.cursor);return e&&this.reset(),t}},he="CBOR decode error:",Zr="CBOR encode error:",Ri=[];Ri[23]=1;Ri[24]=2;Ri[25]=3;Ri[26]=5;Ri[27]=9;function Kn(e,t,r){if(e.length-t<r)throw new Error(`${he} not enough data for type`)}var Ye=[24,256,65536,4294967296,BigInt("18446744073709551616")];function on(e,t,r){Kn(e,t,1);let n=e[t];if(r.strict===!0&&n<Ye[0])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function sn(e,t,r){Kn(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Ye[1])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function an(e,t,r){Kn(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Ye[2])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);return n}function un(e,t,r){Kn(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&o<Ye[3])throw new Error(`${he} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(r.allowBigInt===!0)return o;throw new Error(`${he} integers outside of the safe integer range are not supported`)}function I1(e,t,r,n){return new ee(C.uint,on(e,t+1,n),2)}function E1(e,t,r,n){return new ee(C.uint,sn(e,t+1,n),3)}function S1(e,t,r,n){return new ee(C.uint,an(e,t+1,n),5)}function x1(e,t,r,n){return new ee(C.uint,un(e,t+1,n),9)}function cn(e,t){return Mt(e,0,t.value)}function Mt(e,t,r){if(r<Ye[0]){let n=Number(r);e.push([t|n])}else if(r<Ye[1]){let n=Number(r);e.push([t|24,n])}else if(r<Ye[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Ye[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Ye[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),s=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=o&255,o=o>>8,i[7]=o&255,o=o>>8,i[6]=o&255,o=o>>8,i[5]=o&255,i[4]=s&255,s=s>>8,i[3]=s&255,s=s>>8,i[2]=s&255,s=s>>8,i[1]=s&255,e.push(i)}else throw new Error(`${he} encountered BigInt larger than allowable range`)}}cn.encodedSize=function(t){return Mt.encodedSize(t.value)};Mt.encodedSize=function(t){return t<Ye[0]?1:t<Ye[1]?2:t<Ye[2]?3:t<Ye[3]?5:9};cn.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function N1(e,t,r,n){return new ee(C.negint,-1-on(e,t+1,n),2)}function P1(e,t,r,n){return new ee(C.negint,-1-sn(e,t+1,n),3)}function R1(e,t,r,n){return new ee(C.negint,-1-an(e,t+1,n),5)}var du=BigInt(-1),Ep=BigInt(1);function C1(e,t,r,n){let i=un(e,t+1,n);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new ee(C.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${he} integers outside of the safe integer range are not supported`);return new ee(C.negint,du-BigInt(i),9)}function pu(e,t){let r=t.value,n=typeof r=="bigint"?r*du-Ep:r*-1-1;Mt(e,t.type.majorEncoded,n)}pu.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*du-Ep:r*-1-1;return n<Ye[0]?1:n<Ye[1]?2:n<Ye[2]?3:n<Ye[3]?5:9};pu.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function Ci(e,t,r,n){Kn(e,t,r+n);let i=lu(e,t+r,t+r+n);return new ee(C.bytes,i,r+n)}function $1(e,t,r,n){return Ci(e,t,1,r)}function U1(e,t,r,n){return Ci(e,t,2,on(e,t+1,n))}function B1(e,t,r,n){return Ci(e,t,3,sn(e,t+1,n))}function M1(e,t,r,n){return Ci(e,t,5,an(e,t+1,n))}function k1(e,t,r,n){let i=un(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer bytes lengths not supported`);return Ci(e,t,9,i)}function Jo(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===C.string?Ap(e.value):e.value),e.encodedBytes}function ps(e,t){let r=Jo(t);Mt(e,t.type.majorEncoded,r.length),e.push(r)}ps.encodedSize=function(t){let r=Jo(t);return Mt.encodedSize(r.length)+r.length};ps.compareTokens=function(t,r){return D1(Jo(t),Jo(r))};function D1(e,t){return e.length<t.length?-1:e.length>t.length?1:A1(e,t)}function $i(e,t,r,n,i){let o=r+n;Kn(e,t,o);let s=new ee(C.string,_1(e,t+r,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=lu(e,t+r,t+o)),s}function L1(e,t,r,n){return $i(e,t,1,r,n)}function j1(e,t,r,n){return $i(e,t,2,on(e,t+1,n),n)}function F1(e,t,r,n){return $i(e,t,3,sn(e,t+1,n),n)}function V1(e,t,r,n){return $i(e,t,5,an(e,t+1,n),n)}function K1(e,t,r,n){let i=un(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer string lengths not supported`);return $i(e,t,9,i,n)}var z1=ps;function zn(e,t,r,n){return new ee(C.array,n,r)}function q1(e,t,r,n){return zn(e,t,1,r)}function G1(e,t,r,n){return zn(e,t,2,on(e,t+1,n))}function W1(e,t,r,n){return zn(e,t,3,sn(e,t+1,n))}function H1(e,t,r,n){return zn(e,t,5,an(e,t+1,n))}function J1(e,t,r,n){let i=un(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer array lengths not supported`);return zn(e,t,9,i)}function X1(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return zn(e,t,1,1/0)}function yu(e,t){Mt(e,C.array.majorEncoded,t.value)}yu.compareTokens=cn.compareTokens;yu.encodedSize=function(t){return Mt.encodedSize(t.value)};function qn(e,t,r,n){return new ee(C.map,n,r)}function Y1(e,t,r,n){return qn(e,t,1,r)}function Q1(e,t,r,n){return qn(e,t,2,on(e,t+1,n))}function Z1(e,t,r,n){return qn(e,t,3,sn(e,t+1,n))}function eI(e,t,r,n){return qn(e,t,5,an(e,t+1,n))}function tI(e,t,r,n){let i=un(e,t+1,n);if(typeof i=="bigint")throw new Error(`${he} 64-bit integer map lengths not supported`);return qn(e,t,9,i)}function rI(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return qn(e,t,1,1/0)}function hu(e,t){Mt(e,C.map.majorEncoded,t.value)}hu.compareTokens=cn.compareTokens;hu.encodedSize=function(t){return Mt.encodedSize(t.value)};function nI(e,t,r,n){return new ee(C.tag,r,1)}function iI(e,t,r,n){return new ee(C.tag,on(e,t+1,n),2)}function oI(e,t,r,n){return new ee(C.tag,sn(e,t+1,n),3)}function sI(e,t,r,n){return new ee(C.tag,an(e,t+1,n),5)}function aI(e,t,r,n){return new ee(C.tag,un(e,t+1,n),9)}function gu(e,t){Mt(e,C.tag.majorEncoded,t.value)}gu.compareTokens=cn.compareTokens;gu.encodedSize=function(t){return Mt.encodedSize(t.value)};var uI=20,cI=21,fI=22,lI=23;function dI(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${he} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new ee(C.null,null,1):new ee(C.undefined,void 0,1)}function pI(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${he} indefinite length items not allowed`);return new ee(C.break,void 0,1)}function mu(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${he} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${he} Infinity values are not supported`)}return new ee(C.float,e,t)}function yI(e,t,r,n){return mu(vu(e,t+1),3,n)}function hI(e,t,r,n){return mu(_u(e,t+1),5,n)}function gI(e,t,r,n){return mu(Pp(e,t+1),9,n)}function bu(e,t,r){let n=t.value;if(n===!1)e.push([C.float.majorEncoded|uI]);else if(n===!0)e.push([C.float.majorEncoded|cI]);else if(n===null)e.push([C.float.majorEncoded|fI]);else if(n===void 0)e.push([C.float.majorEncoded|lI]);else{let i,o=!1;(!r||r.float64!==!0)&&(xp(n),i=vu(Ht,1),n===i||Number.isNaN(n)?(Ht[0]=249,e.push(Ht.slice(0,3)),o=!0):(Np(n),i=_u(Ht,1),n===i&&(Ht[0]=250,e.push(Ht.slice(0,5)),o=!0))),o||(mI(n),i=Pp(Ht,1),Ht[0]=251,e.push(Ht.slice(0,9)))}}bu.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){xp(n);let i=vu(Ht,1);if(n===i||Number.isNaN(n))return 3;if(Np(n),i=_u(Ht,1),n===i)return 5}return 9};var Sp=new ArrayBuffer(9),Bt=new DataView(Sp,1),Ht=new Uint8Array(Sp,0);function xp(e){if(e===1/0)Bt.setUint16(0,31744,!1);else if(e===-1/0)Bt.setUint16(0,64512,!1);else if(Number.isNaN(e))Bt.setUint16(0,32256,!1);else{Bt.setFloat32(0,e);let t=Bt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)Bt.setUint16(0,31744,!1);else if(r===0)Bt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?Bt.setUint16(0,0):i<-14?Bt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):Bt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function vu(e,t){if(e.length-t<2)throw new Error(`${he} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,i=r&1023,o;return n===0?o=i*2**-24:n!==31?o=(i+1024)*2**(n-25):o=i===0?1/0:NaN,r&32768?-o:o}function Np(e){Bt.setFloat32(0,e,!1)}function _u(e,t){if(e.length-t<4)throw new Error(`${he} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function mI(e){Bt.setFloat64(0,e,!1)}function Pp(e,t){if(e.length-t<8)throw new Error(`${he} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}bu.compareTokens=cn.compareTokens;function Se(e,t,r){throw new Error(`${he} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function ys(e){return()=>{throw new Error(`${he} ${e}`)}}var ae=[];for(let e=0;e<=23;e++)ae[e]=Se;ae[24]=I1;ae[25]=E1;ae[26]=S1;ae[27]=x1;ae[28]=Se;ae[29]=Se;ae[30]=Se;ae[31]=Se;for(let e=32;e<=55;e++)ae[e]=Se;ae[56]=N1;ae[57]=P1;ae[58]=R1;ae[59]=C1;ae[60]=Se;ae[61]=Se;ae[62]=Se;ae[63]=Se;for(let e=64;e<=87;e++)ae[e]=$1;ae[88]=U1;ae[89]=B1;ae[90]=M1;ae[91]=k1;ae[92]=Se;ae[93]=Se;ae[94]=Se;ae[95]=ys("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ae[e]=L1;ae[120]=j1;ae[121]=F1;ae[122]=V1;ae[123]=K1;ae[124]=Se;ae[125]=Se;ae[126]=Se;ae[127]=ys("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ae[e]=q1;ae[152]=G1;ae[153]=W1;ae[154]=H1;ae[155]=J1;ae[156]=Se;ae[157]=Se;ae[158]=Se;ae[159]=X1;for(let e=160;e<=183;e++)ae[e]=Y1;ae[184]=Q1;ae[185]=Z1;ae[186]=eI;ae[187]=tI;ae[188]=Se;ae[189]=Se;ae[190]=Se;ae[191]=rI;for(let e=192;e<=215;e++)ae[e]=nI;ae[216]=iI;ae[217]=oI;ae[218]=sI;ae[219]=aI;ae[220]=Se;ae[221]=Se;ae[222]=Se;ae[223]=Se;for(let e=224;e<=243;e++)ae[e]=ys("simple values are not supported");ae[244]=Se;ae[245]=Se;ae[246]=Se;ae[247]=dI;ae[248]=ys("simple values are not supported");ae[249]=yI;ae[250]=hI;ae[251]=gI;ae[252]=Se;ae[253]=Se;ae[254]=Se;ae[255]=pI;var ir=[];for(let e=0;e<24;e++)ir[e]=new ee(C.uint,e,1);for(let e=-1;e>=-24;e--)ir[31-e]=new ee(C.negint,e,1);ir[64]=new ee(C.bytes,new Uint8Array(0),1);ir[96]=new ee(C.string,"",1);ir[128]=new ee(C.array,0,1);ir[160]=new ee(C.map,0,1);ir[244]=new ee(C.false,!1,1);ir[245]=new ee(C.true,!0,1);ir[246]=new ee(C.null,null,1);function wu(){let e=[];return e[C.uint.major]=cn,e[C.negint.major]=pu,e[C.bytes.major]=ps,e[C.string.major]=z1,e[C.array.major]=yu,e[C.map.major]=hu,e[C.tag.major]=gu,e[C.float.major]=bu,e}var pP=wu(),$a=new Ip,ld=class Rp{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${Zr} object contains circular references`);return new Rp(r,t)}},Sr={null:new ee(C.null,null),undefined:new ee(C.undefined,void 0),true:new ee(C.true,!0),false:new ee(C.false,!1),emptyArray:new ee(C.array,0),emptyMap:new ee(C.map,0)},Cr={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new ee(C.float,e):e>=0?new ee(C.uint,e):new ee(C.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new ee(C.uint,e):new ee(C.negint,e)},Uint8Array(e,t,r,n){return new ee(C.bytes,e)},string(e,t,r,n){return new ee(C.string,e)},boolean(e,t,r,n){return e?Sr.true:Sr.false},null(e,t,r,n){return Sr.null},undefined(e,t,r,n){return Sr.undefined},ArrayBuffer(e,t,r,n){return new ee(C.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new ee(C.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[Sr.emptyArray,new ee(C.break)]:Sr.emptyArray;n=ld.createCheck(n,e);let i=[],o=0;for(let s of e)i[o++]=Bo(s,r,n);return r.addBreakTokens?[new ee(C.array,e.length),i,new ee(C.break)]:[new ee(C.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",o=i?e.keys():Object.keys(e),s=i?e.size:o.length;if(!s)return r.addBreakTokens===!0?[Sr.emptyMap,new ee(C.break)]:Sr.emptyMap;n=ld.createCheck(n,e);let a=[],c=0;for(let f of o)a[c++]=[Bo(f,r,n),Bo(i?e.get(f):e[f],r,n)];return bI(a,r),r.addBreakTokens?[new ee(C.map,s),a,new ee(C.break)]:[new ee(C.map,s),a]}};Cr.Map=Cr.Object;Cr.Buffer=Cr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Cr[`${e}Array`]=Cr.DataView;function Bo(e,t={},r){let n=h1(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||Cr[n];if(typeof i=="function"){let s=i(e,n,t,r);if(s!=null)return s}let o=Cr[n];if(!o)throw new Error(`${Zr} unsupported type: ${n}`);return o(e,n,t,r)}function bI(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Cp(e,t,r,n){if(Array.isArray(t))for(let i of t)Cp(e,i,r,n);else r[t.type.major](e,t,n)}function vI(e,t,r){let n=Bo(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let i=r.quickEncodeToken(n);if(i)return i;let o=t[n.type.major];if(o.encodedSize){let s=o.encodedSize(n,r),a=new Ip(s);if(o(a,n,r),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return fu(a.chunks[0])}}return $a.reset(),Cp($a,n,t,r),$a.toBytes(!0)}var _I={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},wI=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=ir[e];if(t===void 0){let r=ae[e];if(!r)throw new Error(`${he} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let n=e&31;t=r(this.data,this._pos,n,this.options)}return this._pos+=t.encodedLength,t}},xi=Symbol.for("DONE"),hs=Symbol.for("BREAK");function TI(e,t,r){let n=[];for(let i=0;i<e.value;i++){let o=Ni(t,r);if(o===hs){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed array`)}if(o===xi)throw new Error(`${he} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=o}return n}function AI(e,t,r){let n=r.useMaps===!0,i=n?void 0:{},o=n?new Map:void 0;for(let s=0;s<e.value;s++){let a=Ni(t,r);if(a===hs){if(e.value===1/0)break;throw new Error(`${he} got unexpected break to lengthed map`)}if(a===xi)throw new Error(`${he} found map but not enough entries (got ${s} [no key], expected ${e.value})`);if(n!==!0&&typeof a!="string")throw new Error(`${he} non-string keys not supported (got ${typeof a})`);if(r.rejectDuplicateMapKeys===!0&&(n&&o.has(a)||!n&&a in i))throw new Error(`${he} found repeat map key "${a}"`);let c=Ni(t,r);if(c===xi)throw new Error(`${he} found map but not enough entries (got ${s} [no value], expected ${e.value})`);n?o.set(a,c):i[a]=c}return n?o:i}function Ni(e,t){if(e.done())return xi;let r=e.next();if(r.type===C.break)return hs;if(r.type.terminal)return r.value;if(r.type===C.array)return TI(r,e,t);if(r.type===C.map)return AI(r,e,t);if(r.type===C.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Ni(e,t);return t.tags[r.value](n)}throw new Error(`${he} tag not supported (${r.value})`)}throw new Error("unsupported")}function OI(e,t){if(!(e instanceof Uint8Array))throw new Error(`${he} data to decode must be a Uint8Array`);t=Object.assign({},_I,t);let r=t.tokenizer||new wI(e,t),n=Ni(r,t);if(n===xi)throw new Error(`${he} did not find any content to decode`);if(n===hs)throw new Error(`${he} got unexpected break`);return[n,e.subarray(r.pos())]}function $p(e,t){let[r,n]=OI(e,t);if(n.length>0)throw new Error(`${he} too many terminals, data makes no sense`);return r}var II=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===C.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===C.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[C.uint.major](e,t){this.prefix(e);let r=String(t.value),n=[];for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);e.push(n)}[C.negint.major](e,t){this[C.uint.major](e,t)}[C.bytes.major](e,t){throw new Error(`${Zr} unsupported type: Uint8Array`)}[C.string.major](e,t){this.prefix(e);let r=Ap(JSON.stringify(t.value));e.push(r.length>32?fu(r):r)}[C.array.major](e,t){this.prefix(e),this.inRecursive.push({type:C.array,elements:0}),e.push([91])}[C.map.major](e,t){this.prefix(e),this.inRecursive.push({type:C.map,elements:0}),e.push([123])}[C.tag.major](e,t){}[C.float.major](e,t){if(t.type.name==="break"){let o=this.inRecursive.pop();if(o){if(o.type===C.array)e.push([93]);else if(o.type===C.map)e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${Zr} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let r=String(t.value),n=[],i=!1;for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o),!i&&(n[o]===46||n[o]===101||n[o]===69)&&(i=!0);i||(n.push(46),n.push(48)),e.push(n)}};function EI(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Zr} complex map keys are not supported`);let r=e[0],n=t[0];if(r.type!==C.string||n.type!==C.string)throw new Error(`${Zr} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${Zr} unexpected duplicate map keys, this is not supported`)}var SI={addBreakTokens:!0,mapSorter:EI};function xI(e,t){return t=Object.assign({},SI,t),vI(e,new II,t)}var Up=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${he} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${he} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,r=!1,n=s=>{for(;!this.done();){let a=this.ch();if(s.includes(a))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,r=!0;else return new ee(C.uint,0,this._pos-e);if(n([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${he} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(r)throw new Error(`${he} unexpected token at position ${this._pos}`);r=!0,this._pos++,n([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(r=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,n([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),o=parseFloat(i);return r?new ee(C.float,o,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(o)?new ee(o>=0?C.uint:C.negint,o,this._pos-e):new ee(o>=0?C.uint:C.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${he} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,o=0;i<this.data.length&&o<65536;i++,o++){let s=this.data[i];if(s===92||s<32||s>=128)break;if(s===34){let a=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new ee(C.string,a,o)}}let e=this._pos,t=[],r=()=>{if(this._pos+4>=this.data.length)throw new Error(`${he} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let o=0;o<4;o++){let s=this.ch();if(s>=48&&s<=57)s-=48;else if(s>=97&&s<=102)s=s-97+10;else if(s>=65&&s<=70)s=s-65+10;else throw new Error(`${he} unexpected unicode escape character at position ${this._pos}`);i=i*16+s,this._pos++}return i},n=()=>{let i=this.ch(),o=null,s=i>239?4:i>223?3:i>191?2:1;if(this._pos+s>this.data.length)throw new Error(`${he} unexpected unicode sequence at position ${this._pos}`);let a,c,f,l;switch(s){case 1:i<128&&(o=i);break;case 2:a=this.data[this._pos+1],(a&192)===128&&(l=(i&31)<<6|a&63,l>127&&(o=l));break;case 3:a=this.data[this._pos+1],c=this.data[this._pos+2],(a&192)===128&&(c&192)===128&&(l=(i&15)<<12|(a&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:a=this.data[this._pos+1],c=this.data[this._pos+2],f=this.data[this._pos+3],(a&192)===128&&(c&192)===128&&(f&192)===128&&(l=(i&15)<<18|(a&63)<<12|(c&63)<<6|f&63,l>65535&&l<1114112&&(o=l))}o===null?(o=65533,s=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|o&1023),t.push(o),this._pos+=s};for(;!this.done();){let i=this.ch(),o;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${he} unexpected string termination at position ${this._pos}`);switch(o=this.ch(),this._pos++,o){case 34:case 39:case 92:case 47:t.push(o);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(r());break;default:throw new Error(`${he} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new ee(C.string,Op(t),this._pos-e);default:if(i<32)throw new Error(`${he} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):n()}}throw new Error(`${he} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new ee(C.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new ee(C.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new ee(C.null,null,4);case 102:return this.expect([102,97,108,115,101]),new ee(C.false,!1,5);case 116:return this.expect([116,114,117,101]),new ee(C.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${he} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new ee(C.break,void 0,1);if(this.ch()!==44)throw new Error(`${he} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new ee(C.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new ee(C.break,void 0,1);if(this.ch()!==44)throw new Error(`${he} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new ee(C.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${he} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${he} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function NI(e,t){return t=Object.assign({tokenizer:new Up(e,t)},t),$p(e,t)}var yP=new Uint8Array(0);function PI(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}function Tu(e){if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}function RI(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=e.length,c=e.charAt(0),f=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function g(M){if(M instanceof Uint8Array||(ArrayBuffer.isView(M)?M=new Uint8Array(M.buffer,M.byteOffset,M.byteLength):Array.isArray(M)&&(M=Uint8Array.from(M))),!(M instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(M.length===0)return"";for(var z=0,Q=0,F=0,L=M.length;F!==L&&M[F]===0;)F++,z++;for(var G=(L-F)*l+1>>>0,H=new Uint8Array(G);F!==L;){for(var j=M[F],re=0,W=G-1;(j!==0||re<Q)&&W!==-1;W--,re++)j+=256*H[W]>>>0,H[W]=j%a>>>0,j=j/a>>>0;if(j!==0)throw new Error("Non-zero carry");Q=re,F++}for(var pe=G-Q;pe!==G&&H[pe]===0;)pe++;for(var $=c.repeat(z);pe<G;++pe)$+=e.charAt(H[pe]);return $}function P(M){if(typeof M!="string")throw new TypeError("Expected String");if(M.length===0)return new Uint8Array;var z=0;if(M[z]!==" "){for(var Q=0,F=0;M[z]===c;)Q++,z++;for(var L=(M.length-z)*f+1>>>0,G=new Uint8Array(L);M[z];){var H=r[M.charCodeAt(z)];if(H===255)return;for(var j=0,re=L-1;(H!==0||j<F)&&re!==-1;re--,j++)H+=a*G[re]>>>0,G[re]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");F=j,z++}if(M[z]!==" "){for(var W=L-F;W!==L&&G[W]===0;)W++;for(var pe=new Uint8Array(Q+(L-W)),$=Q;W!==L;)pe[$++]=G[W++];return pe}}}function E(M){var z=P(M);if(z)return z;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:P,decode:E}}var CI=RI,$I=CI,UI=$I,BI=class{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},MI=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;let n=t.codePointAt(0);if(n===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n,this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Bp(this,e)}},kI=class{decoders;constructor(e){this.decoders=e}or(e){return Bp(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Bp(e,t){return new kI({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var DI=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new BI(e,t,r),this.decoder=new MI(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Mp({name:e,prefix:t,encode:r,decode:n}){return new DI(e,t,r,n)}function gs({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=UI(r,e);return Mp({prefix:t,name:e,encode:n,decode:o=>Tu(i(o))})}function LI(e,t,r,n){let i=e.length;for(;e[i-1]==="=";)--i;let o=new Uint8Array(i*r/8|0),s=0,a=0,c=0;for(let f=0;f<i;++f){let l=t[e[f]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|l,s+=r,s>=8&&(s-=8,o[c++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o}function jI(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,o="",s=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s!==0&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o}function FI(e){let t={};for(let r=0;r<e.length;++r)t[e[r]]=r;return t}function vt({name:e,prefix:t,bitsPerChar:r,alphabet:n}){let i=FI(n);return Mp({prefix:t,name:e,encode(o){return jI(o,n,r)},decode(o){return LI(o,i,r,e)}})}var Mo=vt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),hP=vt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),gP=vt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),mP=vt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),bP=vt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),vP=vt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),_P=vt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),wP=vt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),TP=vt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),ko=gs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),AP=gs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Pr=gs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),OP=gs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),kp={};Aa(kp,{Digest:()=>ms,create:()=>Au,decode:()=>Ou,equals:()=>Lp,hasCode:()=>sE});var VI=Dp,dd=128,KI=127,zI=~KI,qI=Math.pow(2,31);function Dp(e,t,r){t=t||[],r=r||0;for(var n=r;e>=qI;)t[r++]=e&255|dd,e/=128;for(;e&zI;)t[r++]=e&255|dd,e>>>=7;return t[r]=e|0,Dp.bytes=r-n+1,t}var GI=ja,WI=128,pd=127;function ja(e,n){var r=0,n=n||0,i=0,o=n,s,a=e.length;do{if(o>=a)throw ja.bytes=0,new RangeError("Could not decode varint");s=e[o++],r+=i<28?(s&pd)<<i:(s&pd)*Math.pow(2,i),i+=7}while(s>=WI);return ja.bytes=o-n,r}var HI=Math.pow(2,7),JI=Math.pow(2,14),XI=Math.pow(2,21),YI=Math.pow(2,28),QI=Math.pow(2,35),ZI=Math.pow(2,42),eE=Math.pow(2,49),tE=Math.pow(2,56),rE=Math.pow(2,63),nE=function(e){return e<HI?1:e<JI?2:e<XI?3:e<YI?4:e<QI?5:e<ZI?6:e<eE?7:e<tE?8:e<rE?9:10},iE={encode:VI,decode:GI,encodingLength:nE},oE=iE,Xo=oE;function Fa(e,t=0){return[Xo.decode(e,t),Xo.decode.bytes]}function Yo(e,t,r=0){return Xo.encode(e,t,r),t}function Qo(e){return Xo.encodingLength(e)}function Au(e,t){let r=t.byteLength,n=Qo(e),i=n+Qo(r),o=new Uint8Array(i+r);return Yo(e,o,0),Yo(r,o,n),o.set(t,i),new ms(e,r,t,o)}function Ou(e){let t=Tu(e),[r,n]=Fa(t),[i,o]=Fa(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new ms(r,i,s,t)}function Lp(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&PI(e.bytes,r.bytes)}}var ms=class{code;size;digest;bytes;constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}};function sE(e,t){return e.code===t}function yd(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return uE(r,Va(e),t??Pr.encoder);default:return cE(r,Va(e),t??Mo.encoder)}}var hd=new WeakMap;function Va(e){let t=hd.get(e);if(t==null){let r=new Map;return hd.set(e,r),r}return t}var at=class et{code;version;multihash;bytes;"/";constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==_i)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==fE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return et.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=Au(t,r);return et.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return et.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&Lp(t.multihash,n.multihash)}toString(t){return yd(this,t)}toJSON(){return{"/":yd(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof et)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:o,bytes:s}=r;return new et(n,i,o,s??gd(n,i,o.bytes))}else if(r[lE]===!0){let{version:n,multihash:i,code:o}=r,s=Ou(i);return et.create(n,o,s)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==_i)throw new Error(`Version 0 CID must use dag-pb (code: ${_i}) block encoding`);return new et(t,r,n,n.bytes)}case 1:{let i=gd(t,r,n.bytes);return new et(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return et.create(0,_i,t)}static createV1(t,r){return et.create(1,t,r)}static decode(t){let[r,n]=et.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=et.inspectBytes(t),n=r.size-r.multihashSize,i=Tu(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=i.subarray(r.multihashSize-r.digestSize),s=new ms(r.multihashCode,r.digestSize,o,i);return[r.version===0?et.createV0(s):et.createV1(r.codec,s),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[g,P]=Fa(t.subarray(r));return r+=P,g},i=n(),o=_i;if(i===18?(i=0,r=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=r,a=n(),c=n(),f=r+c,l=f-s;return{version:i,codec:o,multihashCode:a,digestSize:c,multihashSize:l,size:f}}static parse(t,r){let[n,i]=aE(t,r),o=et.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Va(o).set(n,t),o}};function aE(e,t){switch(e[0]){case"Q":{let r=t??Pr;return[Pr.prefix,r.decode(`${Pr.prefix}${e}`)]}case Pr.prefix:{let r=t??Pr;return[Pr.prefix,r.decode(e)]}case Mo.prefix:{let r=t??Mo;return[Mo.prefix,r.decode(e)]}case ko.prefix:{let r=t??ko;return[ko.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function uE(e,t,r){let{prefix:n}=r;if(n!==Pr.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let o=r.encode(e).slice(1);return t.set(n,o),o}else return i}function cE(e,t,r){let{prefix:n}=r,i=t.get(n);if(i==null){let o=r.encode(e);return t.set(n,o),o}else return i}var _i=112,fE=18;function gd(e,t,r){let n=Qo(e),i=n+Qo(t),o=new Uint8Array(i+r.byteLength);return Yo(e,o,0),Yo(t,o,n),o.set(r,i),o}var lE=Symbol.for("@ipld/js-cid/CID"),dE=20;function jp({name:e,code:t,encode:r,minDigestLength:n,maxDigestLength:i}){return new pE(e,t,r,n,i)}var pE=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,r,n,i){this.name=e,this.code=t,this.encode=r,this.minDigestLength=n??dE,this.maxDigestLength=i}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?md(r,this.code,t?.truncate):r.then(n=>md(n,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function md(e,t,r){if(r!=null&&r!==e.byteLength){if(r>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,r)}return Au(t,e)}var Fp=vt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),IP=vt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),EP=vt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),SP=vt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function yE(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function hE(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=at.asCID(e);if(!t)return null;let r=t.toString();return[new ee(C.map,1/0,1),new ee(C.string,"/",1),new ee(C.string,r,r.length),new ee(C.break,void 0,1)]}function Zo(e){let t=Fp.encode(e).slice(1);return[new ee(C.map,1/0,1),new ee(C.string,"/",1),new ee(C.map,1/0,1),new ee(C.string,"bytes",5),new ee(C.string,t,t.length),new ee(C.break,void 0,1),new ee(C.break,void 0,1)]}function Wt(e){return Zo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function gE(e){return Zo(new Uint8Array(e))}function mE(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function bE(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}var vE={typeEncoders:{Object:hE,Buffer:Zo,Uint8Array:Zo,Int8Array:Wt,Uint16Array:Wt,Int16Array:Wt,Uint32Array:Wt,Int32Array:Wt,Float32Array:Wt,Float64Array:Wt,Uint8ClampedArray:Wt,BigInt64Array:Wt,BigUint64Array:Wt,DataView:Wt,ArrayBuffer:gE,undefined:mE,number:bE}},_E=class extends Up{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===C.map){let t=this._next();if(t.type===C.string&&t.value==="/"){let r=this._next();if(r.type===C.string){if(this._next().type!==C.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(r),new ee(C.tag,42,0)}if(r.type===C.map){let n=this._next();if(n.type===C.string&&n.value==="bytes"){let i=this._next();if(i.type===C.string){for(let s=0;s<2;s++)if(this._next().type!==C.break)throw new Error("Invalid encoded Bytes form");let o=Fp.decode(`m${i.value}`);return new ee(C.bytes,o,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}},Ka={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Ka.tags[42]=at.parse;var wE="dag-json",Vp=297,Iu=e=>xI(e,vE),bs=e=>{let t=yE(e),r=Object.assign(Ka,{tokenizer:new _E(t,Ka)});return NI(t,r)},bd=e=>TE.decode(Iu(e)),TE=new TextDecoder,AE=e=>bs(OE.encode(e)),OE=new TextEncoder;function IE(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Kp(e,t,r=""){let n=IE(e),i=e?.length,o=t!==void 0;if(!n||o&&i!==t){let s=r&&`"${r}" `,a=o?` of length ${t}`:"",c=n?`length=${i}`:`type=${typeof e}`;throw new Error(s+"expected Uint8Array"+a+", got "+c)}return e}function vd(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function EE(e,t){Kp(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}function za(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ua(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function er(e,t){return e<<32-t|e>>>t}function SE(e,t={}){let r=(i,o)=>e(o).update(i).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.create=i=>e(i),Object.assign(r,t),Object.freeze(r)}var xE=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function NE(e,t,r){return e&t^~e&r}function PE(e,t,r){return e&t^e&r^t&r}var RE=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=Ua(this.buffer)}update(e){vd(this),Kp(e);let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let a=Ua(e);for(;n<=i-o;o+=n)this.process(a,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){vd(this),EE(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;t[o++]=128,za(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(r,0),o=0);for(let l=o;l<n;l++)t[l]=0;r.setBigUint64(n-8,BigInt(this.length*8),i),this.process(r,0);let s=Ua(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let c=a/4,f=this.get();if(c>f.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<c;l++)s.setUint32(4*l,f[l],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}},xr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),CE=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Nr=new Uint32Array(64),$E=class extends RE{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=i|0,this.F=o|0,this.G=s|0,this.H=a|0}process(e,t){for(let l=0;l<16;l++,t+=4)Nr[l]=e.getUint32(t,!1);for(let l=16;l<64;l++){let g=Nr[l-15],P=Nr[l-2],E=er(g,7)^er(g,18)^g>>>3,M=er(P,17)^er(P,19)^P>>>10;Nr[l]=M+Nr[l-7]+E+Nr[l-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:f}=this;for(let l=0;l<64;l++){let g=er(s,6)^er(s,11)^er(s,25),P=f+g+NE(s,a,c)+CE[l]+Nr[l]|0,M=(er(r,2)^er(r,13)^er(r,22))+PE(r,n,i)|0;f=c,c=a,a=s,s=o+P|0,o=i,i=n,n=r,r=P+M|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,f=f+this.H|0,this.set(r,n,i,o,s,a,c,f)}roundClean(){za(Nr)}destroy(){this.set(0,0,0,0,0,0,0,0),za(this.buffer)}},UE=class extends $E{A=xr[0]|0;B=xr[1]|0;C=xr[2]|0;D=xr[3]|0;E=xr[4]|0;F=xr[5]|0;G=xr[6]|0;H=xr[7]|0;constructor(){super(32)}},BE=SE(()=>new UE,xE(1));var We=Ut(dr(),1),zp=Ut(tb(),1),qa=e=>We.Type.Union([e,We.Type.Null()]);var qp=/^(k51qz|baguq)[0-9a-z]{56,57}$/,ME=/^[0-9A-Fa-f]{7,8}$/g;We.FormatRegistry.Set("EntityID",e=>!!e.match(ME)||!!e.match(qp));var Gp=We.Type.String(),vs=e=>e?.enc instanceof Uint8Array;We.FormatRegistry.Set("CID",e=>!!e.match(qp));var Eu=We.Type.String({format:"CID"}),kE=/^http([s]?):\/\/.*\..*/;We.FormatRegistry.Set("URL",e=>!!e.match(kE));var DE=We.Type.String({format:"URL"}),Su=We.Type.Object({en:Gp,at:We.Type.String(),vl:qa(We.Type.Union([We.Type.String(),We.Type.Boolean(),We.Type.Number()])),ts:We.Type.String(),ag:We.Type.String(),pv:qa(Eu)}),Ga=zp.TypeCompiler.Compile(Su);var LE=Ga.Check.bind(Ga),Wp=We.Type.Composite([We.Type.Object({cid:Eu}),Su]),es=zp.TypeCompiler.Compile(Wp),Hp=e=>Array.from(es.Errors(e)),xu=es.Check.bind(es);function Jp(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var jE=jp({name:"sha2-256",code:18,encode:Jp("SHA-256")}),xP=jp({name:"sha2-512",code:19,encode:Jp("SHA-512")}),{WARN:_d,LOG:NP,DEBUG:FE,VERBOSE:ts,ERROR:VE}=Ce.setup(Ce.INFO),Xp=114;function Nu(e,t=["cid"]){if(!e)throw VE("falsy log",e);let r=e.cid;if(vs(e))return r||(r=_s(Pu(e).bytes).toString()),_d("preparing an encrypted applog - really?"),{log:e,cid:r};let n={};for(let[i,o]of Object.entries(e))o===void 0&&(_d(`log.${i} is undefined, which is not allowed - encoding as null`,e),o=null),t.includes(i)?ts("excluding app log",{key:i,val:o}):n[i]=o;return{log:n,cid:r}}function Yp(e){return _s(Qp(e).bytes)}function Qp(e){return Pu(Nu(e)?.log)}function _s(e){let t=BE(e),r=kp.create(jE.code,t),n=at.create(1,Vp,r);return ts("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function Pu(e){FE("[encodeBlock]",e);let t=Iu(e);return{bytes:t,cid:_s(t)}}function Ru(e){let t=null,r=[];try{t=at.parse(e)}catch(n){ts("[retrieveThread] couldn't parse pubID with default base"),r.push(n)}if(!t)try{t=at.parse(e,ko)}catch(n){ts("[retrieveThread] couldn't parse pubID with base36"),r.push(n)}return{cid:t,errors:t?null:r,isIpns:t&&Zp(t)}}function Zp(e){return e.code===Xp}function Wa(e){return typeof e=="string"?at.parse(e):typeof e.toV1!="function"?at.decode(e.bytes):e}function ws(e,t){if(!e||!t)throw new Error(`[areCidsEqual] invalid params: ${e}, ${t}`);if(e===t)return!0;let r=Wa(e),n=Wa(t);return r.toV1().toString()===n.toV1().toString()}function Cu(e,t){return e instanceof Set?e.has(typeof t=="string"?t:t.toV1().toString()):e.some(r=>ws(r,t))}function wd(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function KE(e,t){let r=wd(e),n=wd(t);return+r<+n}var{WARN:PP,LOG:RP,DEBUG:CP,VERBOSE:zE,ERROR:Td}=Ce.setup(Ce.INFO),ey=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),$u=(e,t,r)=>Ve.structural(od(t,e),od(r,e)),ty=(e,t,r="asc")=>ey(e.ts,t.ts,r),qE=WO($u,["en","at"]);function $r(e,t="asc"){return e.sort((r,n)=>ty(r,n,t))}var ry=(e,t)=>KE(new Date(e.ts),new Date(t.ts));var Uu=e=>{let t=new Map;for(let r of e){if(!r)throw Td("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!r.cid)throw Td("applog with missing CID",r),new Error("applog with missing CID");let n=r.cid;t.has(n)?zE("Skipping duplicate applog:",[t.get(n),r]):t.set(n,r)}return Array.from(t.values())};function ny(e){return typeof e=="string"&&e.startsWith("?")}function iy(e){return e.slice(1)}function Ts(e,t){let r={},n={};for(let[i,o]of Object.entries(e))if(ny(o)){let s=iy(o),a=t[s];a?n[i]=a:r[i]=s}else n[i]=o;return[n,r]}function oy(e,t,r){let n;if(t){let i=typeof t;i==="string"?n=t===r:i==="function"?n=t(r):typeof t.has=="function"?n=t.has(r):Array.isArray(t)&&!Array.isArray(r)?n=t.includes(r):n=t===r}else n=t===r;return e.charAt(0)==="!"?!n:n}var sy=function(t){for(var r=0,n=0,i=t.length;n<i;n++)r+=t[n];return r},Ad=function(t){return sy(t)/t.length},mt={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return mt.max(e)-mt.min(e)},midrange:function(e){return mt.range(e)/2},sum:sy,mean:Ad,average:Ad,median:function(e){e.sort(function(r,n){return r-n});var t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2},modes:function(e){if(!e.length)return[];var t={},r=0,n=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>r?(n=[i],r=t[i]):t[i]===r&&(n.push(i),r=t[i])}),n},variance:function(e){var t=mt.mean(e);return mt.mean(e.map(function(r){return Math.pow(r-t,2)}))},standardDeviation:function(e){return Math.sqrt(mt.variance(e))},meanAbsoluteDeviation:function(e){var t=mt.mean(e);return mt.mean(e.map(function(r){return Math.abs(r-t)}))},zScores:function(e){var t=mt.mean(e),r=mt.standardDeviation(e);return e.map(function(n){return(n-t)/r})}};mt.average=mt.mean;function Bu(){return new Date().toISOString()}var{WARN:GE,LOG:$P,DEBUG:WE,VERBOSE:UP,ERROR:rs}=Ce.setup(Ce.INFO);function ay(e,t){let r=Bu(),n=t;return e.map(o=>uy(o,{ts:r,threadForPv:n}))}function uy(e,{ts:t,threadForPv:r}={}){let n=ly(e,t??Bu()),i=dy(n,r),o=Yp(i).toString();e.cid&&e.cid!==o&&GE("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:o,logWithPv:i});let s={...i,cid:o};if(!xu(s))throw rs(`Bogus Applog ${JSON.stringify(s)}`,Hp(s));return Object.freeze(s)}function cy(e){return!!e.ts}function fy(e){return!!e.pv}function ly(e,t){return cy(e)?e:{...e,ts:t}}function dy(e,t){if(e.pv!==void 0)return e;if(t){let{en:r,at:n}=e,i=t.findLast(s=>s.en==r&&s.at==n);if($u(["en","at","vl","ts","ag"],e,i))throw rs("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let o=(e.pv!==void 0?e.pv:i?.cid)??null;return{...e,pv:o}}else{if(!fy(e))throw rs("[withPvFrom] no thread and no pv:",e);return e}}function Ui(e){let t=()=>(Re(()=>e.length<2&&WE(`joinThreads with count=${e.length}`)),$r(Uu(e.flatMap(i=>{let o=i.applogs;if(!o)throw rs("falsy applogs of thread",i),new Error("falsy applogs of thread");return o})))),r=Re(()=>t()),n=ot(function(i,o){return rr(i)?{init:Re(()=>t())}:{added:i.added.filter(s=>!this.hasApplog(s,!0)),removed:i.removed?.filter(s=>!!this.parents.some(c=>c===o?!1:c.hasApplog(s,!0)))}});return new As(Re(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var{WARN:Od,LOG:BP,DEBUG:Id,VERBOSE:Yr,ERROR:Ed}=Ce.setup(Ce.INFO),As=class py extends tn{constructor(t,r,n,i,o,s=null){super(t,r,n,o?$e.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=o,this._writeMapper=s,Er(this,{onParentUpdate:ot}),o&&this.subscribeToParents()}static mapWrites(t,r,n){return new py(`${r}<${t.nameAndSizeUntracked}>`,t,t.filters,t._applogs,null,n)}_parentSubscriptions=null;insert(t){let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insert(r))}insertRaw(t){let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insertRaw(r))}subscribeToParents(){this._parentSubscriptions=new Map;let t=$t(()=>{this.parents.length||Od("MappedThread has no parents",this),Yr(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(n=>n.name));let r=new Set([...this._parentSubscriptions.keys()]);for(let n of this.parents){r.delete(n)&&Yr(`[MappedThread: ${this.name}] Skipping re-sub to parent`,n.nameAndSizeUntracked),Yr(`[MappedThread: ${this.name}] sub to new parent`,n.nameAndSizeUntracked);let o=this.onParentUpdate.bind(this,n),s=n.subscribe(o);this._parentSubscriptions.set(n,s)}for(let n of r)Yr(`[MappedThread: ${this.name}] un-subscribing from old parent`,n.nameAndSizeUntracked),this._parentSubscriptions.get(n)(),this._parentSubscriptions.delete(n)})}subscribe(t){return this._parentSubscriptions||this.subscribeToParents(),super.subscribe(t)}triggerRemap(){if(!this._eventMapper)throw Ed("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);Id(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&Od(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Re(()=>lr(t.applogs))})})}onParentUpdate(t,r){Yr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,r);let n=this._eventMapper?this._eventMapper(r,t):r;if(this._eventMapper)if(Yr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,n),rr(n))this._applogs.replace([...n.init]);else{for(let i of n.added)this._applogs.splice(i1(this._applogs,i,"ts"),0,i);if(n.removed){for(let i of n.removed)if(!this._applogs.remove(i))if(!rr(r)&&r.removed?.includes(i))Id("Ignoring remove event for non-existent because it was part of parent event's removed",i,r);else throw Ed(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:r,mapResult:n})}}Yr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,yi(this._applogs)),this.notifySubscribers(n)}get readOnly(){return!1}},{WARN:MP,LOG:kP,DEBUG:DP,VERBOSE:Ba,ERROR:HE}=Ce.setup(Ce.INFO),yr=Qe("rollingFilter",function(t,r,n={}){let i=yy(r),o=Ha(i),s=$e.array(Re(function(){return o(t.applogs)}),{deep:!1,name:`${t.name} | ${n.name||`rollingFilter.array{${en(i)}}`}`}),a=g=>{let P;return rr(g)?P={init:o(g.init)}:P={added:o(g.added),removed:g.removed},Ba(`rollingFilter{${t.nameAndSizeUntracked} | ${n.name?` '${n.name}'}`:""} parentUpdate`,i,g,"=>",P),P},c=new As(`${t.name} | ${n.name||`rollingFilter{${en(i)}}`}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],s,a),f=ol(()=>lr(r),g=>{Ba(`rollingFilter<${t.nameAndSizeUntracked}>${n.name?` '${n.name}'`:""} patternUpdate`,i,"=>",g),i=g,o=Ha(i),c.triggerRemap()}),l=Hr(s,()=>{Ba(`rollingFilter<${Re(()=>t.name)}>${n.name?` '${n.name}'`:""} unobserve`,i),f(),l()});return c},{equals:Fn,argsDebugName:(e,t,r)=>He({caller:"rollingFilter",thread:e,pattern:t,args:r})}),Mu=Qe("rollingMapper",function(t,r,n={}){let i=Re(()=>r.call(null,{init:t.applogs},t));if(!rr(i))throw HE("Initial run must return init event");let o=i.init;return new As(`${t.name} | ${n.name||"rollingMapper"}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],o,r)},{equals:Fn,argsDebugName:(e,t,r)=>He({caller:"rollingMapper",thread:e,args:r})}),JE=Qe("rollingAcc",function(t,r,n,i={}){let o=ot(n);return o({init:t.applogs},r),t.subscribe(s=>{o(s,r)}),r},{argsDebugName:(e,t,r,n)=>`rollingAcc{${e.nameAndSizeUntracked}${n?.name?` | ${n?.name}`:""}}`}),yy=function(t){let r=Re(function(){return Object.fromEntries(Object.entries(lr(t)).map(([i,o])=>[lr(i),lr(o)]))});if(!Object.entries(r).length)throw new Error("Pattern is empty");return r};function Ha(e){return function(r){return r.filter(function(i){for(let o of Object.keys(e)){let s=e[o];if(s===void 0)continue;let a=i[o.startsWith("!")?o.slice(1):o];if(!oy(o,s,a))return!1}return!0})}}var{WARN:XE,LOG:YE,DEBUG:QE,VERBOSE:ZE,ERROR:Do}=Ce.setup(Ce.INFO),hy=class extends tn{constructor(e,t=[],r){super(e,null,r,t),Er(this,{})}purge(e){let t=this.applogs.length;return this._applogs=this.applogs.filter(r=>!e.includes(r.cid)),t-this.applogs.length}insert(e){let t=ay(e,this);return this.insertRaw(t)}insertRaw(e){let t=Uu(e);if(t.length!==e.length)throw Do(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});let r=e.filter(o=>!xu(o));if(r.length)throw Do(`[insertRaw] bogus applogs passed: ${r.length}`,{bogus:r});let n=e.filter(o=>this.hasApplog(o,!1));if(n.length)throw Do(`[insertRaw] already existing applogs passed: ${n.length}`,{existing:n});if(!e.length){XE("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof Gn)?YE:QE)("Inserting:",e.length===1?e[0]:e,{ds:this}),$r(e);let i=this._applogs.length&&ry(e[0],this._applogs[this._applogs.length-1]);return this._applogs.push(...e),i&&$r(this._applogs),this.notifySubscribers({added:e,removed:null}),this.persist(e),e}get readOnly(){return!1}},Gn=class Lo extends hy{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,Er(this,{_applogs:$e.shallow})}static empty(t){return Lo.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new Lo(r??"in-memory",t,[],n)}static fromReadOnlyArray(t,r){return new Lo(r??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if(ZE("[InMem.persist] no persist for",t),this.readOnly)throw Do("[persist] called for readOnly thread")}},{WARN:LP,LOG:jP,DEBUG:FP,VERBOSE:VP,ERROR:KP}=Ce.setup(Ce.INFO);var tS=class{constructor(e,t,r=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=r,Er(this,{threadOfTrail:ke})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?Ui([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},gy=class{constructor(e){this.nodes=e,Er(this,{threadOfAllTrails:ke,size:ke,isEmpty:ke})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Re(()=>this.records.length)}get records(){return nr(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return Ui(nr(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogSet(){return nr(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogSet"})}get leafNodeLogs(){return nr(()=>this.nodes.flatMap(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return Ui(nr(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:WR,LOG:Os,DEBUG:hr,VERBOSE:Ae,ERROR:fn}=Ce.setup(Ce.INFO,{prefix:"[q]"}),ku=null,rS=Qe("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:r,tolerateAlreadyFiltered:n}={}){if(Ae(`lastWriteWins${r?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(n)return hr("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw fn("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,o=Mu(t,function(a,c){let f=rr(a),l,g=[],P=f?null:[];f?(i=new Map,l=a.init):l=a.added;let E;for(let M=r?0:l.length-1;r?M<l.length:M>=0;r?M++:M--){let z=l[M],Q=z.en+"|"+z.at;if(E&&(r?E>z.ts:E<z.ts))throw fn("lastWriteWins.mapper logs not sorted:",E,r?">":"<",z.ts,{log:z,i:M,newLogs:l,inverseToOnlyReturnFirstLogs:r});E=z.ts;let F=i.get(Q);(!F||(r?F.ts>z.ts:F.ts<z.ts))&&(F&&!f&&P.push(F),g.push(z),i.set(Q,z))}return $r(g),Ae.isDisabled||Ae(`lastWriteWins${r?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,f?{...Object.fromEntries(Object.entries(a).map(([M,z])=>[M,z?.length])),toAdd:g.length,toRemove:P}:{...a,toAdd:g,toRemove:P}),f?{init:g}:{added:g,removed:P}},{name:`lastWriteWins${r?".inversed":""}`,extraFilterName:"lastWriteWins"});return Ae.isDisabled||$t(()=>{Ae(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,o.applogs.length)}),o},{equals:Fn,argsDebugName:e=>He({caller:"lastWriteWins",thread:e})}),HR=Qe("withoutDeleted",function(t){if(Ae.isEnabled&&Ae(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw fn("thread already filtered withoutDeleted:",t.filters,{name:t.name});let r=yr(t,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});Ae.isEnabled&&Ae(`withoutDeleted<${t.nameAndSizeUntracked}> deletionLogs:`,Re(function(){return[...r.applogs]}));let n=He({caller:"allDeletedEntities",thread:t}),i=vp(function(){return r.map(s=>s.en)},{name:n});return Ae.isEnabled&&$t(()=>{Ae(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),yr(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:Fn}),my=Qe("query",function e(t,r,n={},i={}){fS();let o=by(t);hr(`query<${o.nameAndSizeUntracked}>:`,r);let s=Array.isArray(r)?r:[r],a;if(s.length===1)a=null;else{let l=s.slice(0,-1);a=e(o,l,n,i)}let c=s[s.length-1],f=nS(o,a,c,i);return Ae.isDisabled||$t(()=>Ae("query result:",lr(f))),f},{equals:ds,argsDebugName:(e,t,r)=>He({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),nS=Qe("queryStep",function(t,r,n,i={}){if(hr(`queryStep<${t.nameAndSizeUntracked}> with`,r?.untrackedSize??"all","nodes, pattern:",n),!Object.entries(n).length)throw new Error("Pattern is empty");function o(a){let[c,f]=Ts(n,a?.variables??{});Ae("[queryStep.doQuery] patternWithoutVars: ",c);let l=yr(t,c),g=Is(f),P=nr(function(){let M=l.map(z=>({log:z,vars:g(z)}));return Ae.isEnabled&&Ae("[queryStep.doQuery] step node:",a?.variables," =>",M,"from:",Re(()=>l.applogs)),M.map(({log:z,vars:Q})=>{let F=Object.assign({},a?.variables,Q);return new tS(cu.fromArray([z],He({caller:"QueryNode",thread:l,pattern:`${en(F)}@${en(c)}`})),F,a)})},{name:He({caller:"doQuery.mapNodes",thread:l,pattern:n})});return Ae.isEnabled&&$t(()=>Ae("[queryStep.doQuery] resultNodes:",[...P])),i.debug&&Os("[queryStep] step result:",Re(()=>P.map(({variables:E,logsOfThisNode:M})=>({variables:E,thread:M})))),P}let s=nr(function(){return hr(`[queryStep] Running with ${r?.nodes?.length} input nodes:`),r?[...r.nodes.flatMap(o)]:[...o(null)]},{name:He({caller:"queryStep",thread:t,pattern:n})});return Ae.isEnabled&&$t(()=>Ae("[queryStep] observableResultNodes:",[...s])),new gy(s)},{equals:ds,argsDebugName:(e,t,r)=>He({caller:"queryStep",thread:e,pattern:r})}),JR=Qe("queryNot",function(t,r,n,i={}){let o=r.nodes;hr(`queryNot<${t.nameAndSizeUntracked}> from: ${o.length} nodes`);let s=Array.isArray(n)?n:[n];for(let a of s){if(!Object.entries(n).length)throw new Error("Pattern is empty");o=o.filter(function({variables:f}){let[l,g]=Ts(a,f??{});Ae("[queryNot] patternWithoutVars: ",l);let P=yr(t,l);return Ae("[queryNot] step node:",f," =>",P.size,"applogs"),Ae.isDisabled||Ae("[queryNot] step node:",f," => empty?",Re(()=>P.applogs)),i.debug&&Os("[queryNot] node result:",f,"=>",P.applogs),P.isEmpty})}return new gy(o)},{equals:ds,argsDebugName:(e,t,r)=>He({caller:"queryNot",thread:e,pattern:r})}),XR=Qe("filterAndMap",function(t,r,n){hr(`filterAndMap<${t.nameAndSizeUntracked}>`,r);let i=yr(t,r);Ae.isEnabled&&(Ae("[filterAndMap] filtered:",i.untrackedSize),$t(()=>Ae("[filterAndMap] filtered:",i.applogs)));let o=He({thread:t,pattern:r,caller:"filterAndMap"}),s=nr(()=>sS(i,n),{name:o});return Ae.isDisabled||$t(()=>Ae("[filterAndMap] mapped:",s)),s},{equals:Ve.structural,argsDebugName:(e,t)=>He({caller:"filterAndMap",thread:e,pattern:t})}),YR=Qe("queryAndMap",function(t,r,n,i={}){let o=by(t);hr(`queryAndMap<${o.nameAndSizeUntracked}>`,{patternOrPatterns:r,variables:i,map:n});let s=He({thread:o,caller:"queryAndMap"}),a=my(o,r);Ae("[queryAndMap] filtered count:",a.untrackedSize);let c=nr(()=>aS(a,n),{name:s});return Ae.isDisabled||$t(()=>Ae("[queryAndMap] result:",lr(c))),c},{equals:Ve.structural,argsDebugName:(e,t)=>He({caller:"queryAndMap",thread:e,pattern:t})}),QR=Qe("queryEntity",function(t,r,n,i){hr(`queryEntity<${t.nameAndSizeUntracked}>`,n,r);let o=yr(t,{en:n,at:uS(r,i)});return Ae("queryEntity applogs:",o.applogs),ke(()=>o.isEmpty?null:Object.fromEntries(o.map(({at:s,vl:a})=>[s.slice(r.length+1),a])))},{equals:bp,argsDebugName:(e,t,r)=>He({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),ZR=Qe("agentsOfThread",function(t){hr(`agentsOfThread<${t.nameAndSizeUntracked}>`);let r=$e.map(),n=ot(o=>{for(let s of rr(o)?o.init:o.added){let a=r.get(s.ag)??0;r.set(s.ag,a+1)}for(let s of!rr(o)&&o.removed||[]){let a=r.get(s.ag);if(!a||a<1)throw fn("[agentsOfThread] number is now negative",{log:s,event:o,mapped:r,prev:a});r.set(s.ag,a-1)}Os(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:o,mapped:r})});n({init:t.applogs});let i=t.subscribe(n);return Nn(r,i),r}),iS=Qe("entityOverlap",function(t,r){return Os(`entityOverlap<${t.nameAndSizeUntracked}, ${r.nameAndSizeUntracked}>`),ke(()=>{let n=new Set(t.map(o=>o.en)),i=new Set(r.map(o=>o.en));return[...n].filter(o=>i.has(o))})});var eC=Qe("entityOverlapCount",function(t,r){return ke(()=>iS(t,r).get().length)}),oS=Qe("querySingle",function(t,r,n={}){let i=my(t,r,n);return ke(()=>{if(i.isEmpty)return null;if(i.size>1)throw fn("[querySingle] got",i.size,"results:",i);let o=i.nodes[0].logsOfThisNode;if(o.size!=1)throw fn("[querySingle] single result, but got",o.size,"logs:",o.applogs);return o.applogs[0]})},{equals:Ve.structural,argsDebugName:(e,t)=>He({caller:"querySingle",thread:e,pattern:t})}),tC=Qe("querySingleAndMap",function(t,r,n,i={}){let o=oS(t,r,i);return ke(()=>{let s=o.get();if(s)return typeof n=="string"?s[n]:Is(n)(s)})},{equals:Ve.structural,argsDebugName:(e,t)=>He({caller:"querySingleAndMap",thread:e,pattern:t})}),sS=function(t,r){return typeof r=="function"?t.map(r):typeof r=="string"?t.map(n=>n[r]):t.map(Is(r))},aS=function(t,r){return typeof r=="function"?t.records.map(r):typeof r=="string"?t.nodes.map(n=>{if(!Object.hasOwn(n.record,r)){if(n.logsOfThisNode.size!==1)throw fn(`not sure what to map (it's not a var and a result node log count of ${n.logsOfThisNode.size})`);return n.logsOfThisNode.firstLog[r]}return n.record[r]}):t.nodes.map(n=>Is(r)(t))};function Is(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function uS(e,t){return t.map(r=>cS(e,r))}function cS(e,t){return`${e}/${t}`}function by(e,t){return Array.isArray(e)?Gn.fromArray(e,t||`threadFromArray[${e.length}]`,!0):e}function fS(){if(ku!=null&&performance.now()>=ku)throw new lS(ku)}var lS=class extends Error{constructor(e){super(e)}};var yS=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=s;var r=128,n=127,i=~n,o=Math.pow(2,31);function s(a,c,f){if(Number.MAX_SAFE_INTEGER&&a>Number.MAX_SAFE_INTEGER)throw s.bytes=0,new RangeError("Could not encode varint");c=c||[],f=f||0;for(var l=f;a>=o;)c[f++]=a&255|r,a/=128;for(;a&i;)c[f++]=a&255|r,a>>>=7;return c[f]=a|0,s.bytes=f-l+1,c}}}),hS=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){"use strict";t.exports=i;var r=128,n=127;function i(o,c){var a=0,c=c||0,f=0,l=c,g,P=o.length;do{if(l>=P||f>49)throw i.bytes=0,new RangeError("Could not decode varint");g=o[l++],a+=f<28?(g&n)<<f:(g&n)*Math.pow(2,f),f+=7}while(g>=r);return i.bytes=l-c,a}}}),gS=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){"use strict";var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),s=Math.pow(2,35),a=Math.pow(2,42),c=Math.pow(2,49),f=Math.pow(2,56),l=Math.pow(2,63);t.exports=function(g){return g<r?1:g<n?2:g<i?3:g<o?4:g<s?5:g<a?6:g<c?7:g<f?8:g<l?9:10}}}),Lu=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:yS(),decode:hS(),encodingLength:gS()}}}),wy=42;function mS(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=at.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new ee(C.tag,wy),new ee(C.bytes,r)]}function bS(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function vS(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}function _S(e){for(let t of e.keys())if(typeof t!="string"||t.length===0)throw new Error("Non-string Map keys are not supported by the IPLD Data Model and cannot be encoded");return null}var vy={float64:!0,typeEncoders:{Map:_S,Object:mS,undefined:bS,number:vS}},dC={...vy,typeEncoders:{...vy.typeEncoders}};function wS(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return at.decode(e.subarray(1))}var Du={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Du.tags[wy]=wS;var pC={...Du,tags:Du.tags.slice()};var yC=Ut(Lu(),1);var Ur={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},Bi={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Ur.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Ur.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Bi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=Bi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:Ur.Int,CarV1HeaderOrV2Pragma:e=>{if(Ur.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=Bi["CarV1HeaderOrV2Pragma > roots (anon)"](e[o]);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.roots=a}}break;case"version":{n--;let a=Bi.Int(e[o]);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},Mi={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Ur.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Ur.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=Mi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=Mi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;n.push(o)}return n}}return e}},Int:Ur.Int,CarV1HeaderOrV2Pragma:e=>{if(Ur.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=Mi["CarV1HeaderOrV2Pragma > roots (anon)"](s);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.roots=a}}break;case"version":{n--;let a=Mi.Int(s);if(a===void 0)return;if(a!==s||r!==e){if(r===e){r={};for(let c=0;c<i;c++)r[t[c][0]]=t[c][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},hC={toTyped:Bi.CarV1HeaderOrV2Pragma,toRepresentation:Mi.CarV1HeaderOrV2Pragma},gC=wu(),mC=Ut(Lu(),1),bC=[new ee(C.map,2),new ee(C.string,"version"),new ee(C.uint,1),new ee(C.string,"roots")],vC=new ee(C.tag,42);var _C=Ut(Lu(),1);var{WARN:Ty,LOG:wC,DEBUG:_y,VERBOSE:ju,ERROR:Es}=Ce.setup(Ce.INFO);async function Fu(e){let t=await Ay(e);return await Vu(t)}async function Vu({rootCID:e,blockStore:t},r=[]){if(!e||!t)throw Es("Empty roots/blocks",{rootCID:e,blockStore:t});let n=await Wn(t,e),i,o=null,s=null;if(ju("[decodePubFromBlocks] root:",e.toString(),n,{blockStore:t}),!n)throw Es("root not found in blockStore",{blockStore:t,rootCID:e});if(n?.info){o=n.applogs;let l=await Wn(t,o);i=await AS(l,t),s=await Wn(t,n.info),_y("new format - infoLogs",s.logs.map(g=>({[g.toString()]:g})))}else i=n.applogs;let a=async l=>{let g=l,P=await Wn(t,g);if(!P)throw Es("Could not find applog CID in pub blocks:",g.toString(),{cid:g,root:n,blockStore:t}),new Error(`Could not find applog CID in pub blocks: ${g.toString()}`);return P.pv instanceof at&&(P.pv=P.pv.toV1().toString()),{...P,cid:g.toV1().toString()}},c;if(c=await Promise.all(i.map(a)),n.prev){if(ws(n.prev,e)||Cu(r,n.prev))throw Es("[pubFromBlocks] pub chain has a loop",{rootCID:e,prev:n.prev,recursionTrace:r});c=c.concat((await Vu({rootCID:n.prev,blockStore:t},[...r,e])).applogs)}let f={cid:e,info:{...s,logs:await Promise.all(s.logs.map(a))},applogsCID:o,applogs:c};return _y("[decodePubFromBlocks] result:",f,{rootCID:e.toString(),root:n,blockStore:t,applogs:c,info:s}),f}async function Ay(e){let r=(await e.getRoots()).map(i=>(typeof i.toV1=="function"?i:at.decode(i.bytes)).toV1().toString()),n=new Map;for await(let{cid:i,bytes:o}of e.blocks()){let s=typeof i.toV1=="function"?i:at.decode(i.bytes);ju({cidFromCarblocks:i,cid:s}),n.set(s.toV1().toString(),o)}return r.length!==1&&Ty("Unexpected roots count:",r),{rootCID:at.parse(r[0]),blockStore:{get:i=>n.get(i.toV1().toString())}}}async function Wn(e,t){try{var r=await e.get(t);if(!r)return Ty("returning null"),null}catch(n){if(n.message==="Not Found")return null;throw n}return bs(r)}function Ku(e){return async function*(){for(;;){let{done:t,value:r}=await e.read();if(ju("[car] chunk",{done:t,value:r}),t)break;yield r}}()}var{WARN:TC,LOG:AC,DEBUG:OC,VERBOSE:IC,ERROR:TS}=Ce.setup(Ce.INFO);async function AS(e,t){return OS(e)?(await Promise.all(e.chunks.map(async r=>{let n=await Wn(t,r);if(!n.logs)throw TS("Weird chunk",n);return n.logs}))).flat():e.logs}function OS(e){return e.chunks}var{WARN:Ss,LOG:d$,DEBUG:ki,VERBOSE:p$,ERROR:Di}=$s.setup($s.INFO),Li=class extends Error{constructor(t){super(`IPNS key has never been published: ${t}`),this.name="IPNSNeverPublishedError"}},ln=class extends Error{constructor(t,r){super(`Failed to resolve IPNS ${t}: ${r}`),this.name="IPNSResolutionError",this.cause=r}};async function y$(e,t,{readOnly:r=!0,pinnedCID:n}={}){let{cid:i,errors:o,isIpns:s}=Ru(t);if(!i)throw Di("Failed to parse pubID",t,o);ki("[retrieveThread] parsedPubID",i);let a;if(n)ki("[retrieveThread] using pinnedCID"),s||Ss("pubID isn't IPNS, but pinnedCID different:",{pubID:t,pinnedCID:n}),a=wt.parse(n);else if(!s)ki("[retrieveThread] pubID is not IPNS - using as CID"),a=i;else{if(!t)throw Di("[retrieveThread] neither pubID nor pinnedCID provided");if(!e.nameBaseUrl)throw Di("[retrieveThread] IPNS, but no nameBaseUrl");try{a=await IS(e,t),ki("Resolved pub to CID",a.toString())}catch(E){throw E instanceof Li||E instanceof ln?E:Di(`Failed to resolve IPNS ${t}:`,E)}}let c=await ES(e.gatewayBaseUrl,a),{applogs:f}=await Fu(c),l=f.filter(E=>vs(E));l.length&&Ss(`Found ${l.length} encrypted logs - skipping`);let g=f.filter(E=>!(E instanceof Uint8Array));$r(g);let P=Gn.fromArray(g,`preview${t&&t!==a.toString()?"-"+t:""}@${a.toString()}`,r);return{cid:a,thread:P,encryptedCount:l.length}}async function IS(e,t){let r=Us(e.nameBaseUrl),n;try{n=await fetch(`${r}/name/${t}`)}catch(o){throw new ln(t,o)}if(!n.ok)throw n.status===404?new Li(t):new ln(t,`HTTP ${n.status}: ${n.statusText}`);let i;try{i=await n.json()}catch(o){throw new ln(t,`Invalid JSON response: ${o}`)}if(!i.value)throw new Li(t);i.value.startsWith("/ipfs/")||Ss("IPNS value is not '/ipfs/..':",i);try{return wt.parse(i.value.replace("/ipfs/",""))}catch(o){throw new ln(t,`Invalid CID in IPNS value: ${o}`)}}async function ES(e,t){e=Us(e),ki("Retrieving:",t.toString(),"from",e);let r=`${e}/ipfs/${t}?format=car&dag-scope=all`,n=await fetch(r),i;if((!n?.ok||!n?.body)&&(i=Di(`[retrieveCar] unexpected response ${n?.statusText}`,{url:r}),Ss("Gateway failed:",r,i)),i=Ku(n.body.getReader()),i instanceof Error)throw i;return await jr.fromIterable(i)}export{Li as a,ln as b,y$ as c,IS as d,ES as e};
62
62
  /*! Bundled license information:
63
63
 
64
64
  lodash-es/lodash.js:
@@ -75,4 +75,4 @@ lodash-es/lodash.js:
75
75
  @noble/hashes/utils.js:
76
76
  (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
77
77
  */
78
- //# sourceMappingURL=chunk-QUUYIPF7.min.js.map
78
+ //# sourceMappingURL=chunk-V35AFUSX.min.js.map