@wovin/base-agent 0.1.15 → 0.1.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.
package/dist/index.min.js CHANGED
@@ -1,13 +1,13 @@
1
- var qd=Object.create,ns=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,Qa=Object.getOwnPropertyNames,Wd=Object.getPrototypeOf,Hd=Object.prototype.hasOwnProperty,De=(e,t)=>function(){return t||(0,e[Qa(e)[0]])((t={exports:{}}).exports,t),t.exports},rs=(e,t)=>{for(var n in t)ns(e,n,{get:t[n],enumerable:!0})},Jd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qa(t))!Hd.call(e,i)&&i!==n&&ns(e,i,{get:()=>t[i],enumerable:!(r=Gd(t,i))||r.enumerable});return e},mt=(e,t,n)=>(n=e!=null?qd(Wd(e)):{},Jd(t||!e||!e.__esModule?ns(n,"default",{value:e,enumerable:!0}):n,e));var en=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(f){let _=new Map;function E(){return new Map(_)}f.Entries=E;function U(){return _.clear()}f.Clear=U;function P(w){return _.delete(w)}f.Delete=P;function $(w){return _.has(w)}f.Has=$;function y(w,u){_.set(w,u)}f.Set=y;function T(w){return _.get(w)}f.Get=T})(t||(e.TypeRegistry=t={}));var n=class extends Error{constructor(f){super(f)}};e.TypeBoxError=n;var r;(function(f){let _=new Map;function E(){return new Map(_)}f.Entries=E;function U(){return _.clear()}f.Clear=U;function P(w){return _.delete(w)}f.Delete=P;function $(w){return _.has(w)}f.Has=$;function y(w,u){_.set(w,u)}f.Set=y;function T(w){return _.get(w)}f.Get=T})(r||(e.FormatRegistry=r={}));var i;(function(f){function _(b){return Array.isArray(b)}f.IsArray=_;function E(b){return typeof b=="bigint"}f.IsBigInt=E;function U(b){return typeof b=="boolean"}f.IsBoolean=U;function P(b){return b instanceof globalThis.Date}f.IsDate=P;function $(b){return b===null}f.IsNull=$;function y(b){return typeof b=="number"}f.IsNumber=y;function T(b){return typeof b=="object"&&b!==null}f.IsObject=T;function w(b){return typeof b=="string"}f.IsString=w;function u(b){return b instanceof globalThis.Uint8Array}f.IsUint8Array=u;function A(b){return b===void 0}f.IsUndefined=A})(i||(e.ValueGuard=i={}));var o=class extends n{};e.TypeGuardUnknownTypeError=o;var s;(function(f){function _(m){try{return new RegExp(m),!0}catch{return!1}}function E(m){if(!i.IsString(m))return!1;for(let Re=0;Re<m.length;Re++){let gt=m.charCodeAt(Re);if(gt>=7&&gt<=13||gt===27||gt===127)return!1}return!0}function U(m){return y(m)||Ge(m)}function P(m){return i.IsUndefined(m)||i.IsBigInt(m)}function $(m){return i.IsUndefined(m)||i.IsNumber(m)}function y(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)&&E(m)&&_(m)}function u(m){return i.IsUndefined(m)||i.IsString(m)&&E(m)}function A(m){return i.IsUndefined(m)||Ge(m)}function b(m){return _e(m,"Any")&&T(m.$id)}f.TAny=b;function v(m){return _e(m,"Array")&&m.type==="array"&&T(m.$id)&&Ge(m.items)&&$(m.minItems)&&$(m.maxItems)&&y(m.uniqueItems)&&A(m.contains)&&$(m.minContains)&&$(m.maxContains)}f.TArray=v;function N(m){return _e(m,"AsyncIterator")&&m.type==="AsyncIterator"&&T(m.$id)&&Ge(m.items)}f.TAsyncIterator=N;function q(m){return _e(m,"BigInt")&&m.type==="bigint"&&T(m.$id)&&P(m.exclusiveMaximum)&&P(m.exclusiveMinimum)&&P(m.maximum)&&P(m.minimum)&&P(m.multipleOf)}f.TBigInt=q;function te(m){return _e(m,"Boolean")&&m.type==="boolean"&&T(m.$id)}f.TBoolean=te;function ne(m){return _e(m,"Constructor")&&m.type==="Constructor"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Re=>Ge(Re))&&Ge(m.returns)}f.TConstructor=ne;function ge(m){return _e(m,"Date")&&m.type==="Date"&&T(m.$id)&&$(m.exclusiveMaximumTimestamp)&&$(m.exclusiveMinimumTimestamp)&&$(m.maximumTimestamp)&&$(m.minimumTimestamp)&&$(m.multipleOfTimestamp)}f.TDate=ge;function be(m){return _e(m,"Function")&&m.type==="Function"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Re=>Ge(Re))&&Ge(m.returns)}f.TFunction=be;function Ue(m){return _e(m,"Integer")&&m.type==="integer"&&T(m.$id)&&$(m.exclusiveMaximum)&&$(m.exclusiveMinimum)&&$(m.maximum)&&$(m.minimum)&&$(m.multipleOf)}f.TInteger=Ue;function Fe(m){return _e(m,"Intersect")&&!(i.IsString(m.type)&&m.type!=="object")&&i.IsArray(m.allOf)&&m.allOf.every(Re=>Ge(Re)&&!jr(Re))&&T(m.type)&&(y(m.unevaluatedProperties)||A(m.unevaluatedProperties))&&T(m.$id)}f.TIntersect=Fe;function Pn(m){return _e(m,"Iterator")&&m.type==="Iterator"&&T(m.$id)&&Ge(m.items)}f.TIterator=Pn;function _e(m,Re){return pn(m)&&m[e.Kind]===Re}f.TKindOf=_e;function pn(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}f.TKind=pn;function Cn(m){return R(m)&&i.IsString(m.const)}f.TLiteralString=Cn;function O(m){return R(m)&&i.IsNumber(m.const)}f.TLiteralNumber=O;function le(m){return R(m)&&i.IsBoolean(m.const)}f.TLiteralBoolean=le;function R(m){return _e(m,"Literal")&&T(m.$id)&&(i.IsBoolean(m.const)||i.IsNumber(m.const)||i.IsString(m.const))}f.TLiteral=R;function me(m){return _e(m,"Never")&&i.IsObject(m.not)&&Object.getOwnPropertyNames(m.not).length===0}f.TNever=me;function re(m){return _e(m,"Not")&&Ge(m.not)}f.TNot=re;function de(m){return _e(m,"Null")&&m.type==="null"&&T(m.$id)}f.TNull=de;function Se(m){return _e(m,"Number")&&m.type==="number"&&T(m.$id)&&$(m.exclusiveMaximum)&&$(m.exclusiveMinimum)&&$(m.maximum)&&$(m.minimum)&&$(m.multipleOf)}f.TNumber=Se;function ke(m){return _e(m,"Object")&&m.type==="object"&&T(m.$id)&&i.IsObject(m.properties)&&U(m.additionalProperties)&&$(m.minProperties)&&$(m.maxProperties)&&Object.entries(m.properties).every(([Re,gt])=>E(Re)&&Ge(gt))}f.TObject=ke;function rt(m){return _e(m,"Promise")&&m.type==="Promise"&&T(m.$id)&&Ge(m.item)}f.TPromise=rt;function et(m){return _e(m,"Record")&&m.type==="object"&&T(m.$id)&&U(m.additionalProperties)&&i.IsObject(m.patternProperties)&&(Re=>{let gt=Object.getOwnPropertyNames(Re.patternProperties);return gt.length===1&&_(gt[0])&&i.IsObject(Re.patternProperties)&&Ge(Re.patternProperties[gt[0]])})(m)}f.TRecord=et;function ot(m){return i.IsObject(m)&&e.Hint in m&&m[e.Hint]==="Recursive"}f.TRecursive=ot;function Zt(m){return _e(m,"Ref")&&T(m.$id)&&i.IsString(m.$ref)}f.TRef=Zt;function ur(m){return _e(m,"String")&&m.type==="string"&&T(m.$id)&&$(m.minLength)&&$(m.maxLength)&&w(m.pattern)&&u(m.format)}f.TString=ur;function cr(m){return _e(m,"Symbol")&&m.type==="symbol"&&T(m.$id)}f.TSymbol=cr;function xn(m){return _e(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}f.TTemplateLiteral=xn;function Ei(m){return _e(m,"This")&&T(m.$id)&&i.IsString(m.$ref)}f.TThis=Ei;function jr(m){return i.IsObject(m)&&e.Transform in m}f.TTransform=jr;function qe(m){return _e(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(Re=>Ge(Re)))}f.TTuple=qe;function Ii(m){return _e(m,"Undefined")&&m.type==="undefined"&&T(m.$id)}f.TUndefined=Ii;function Qo(m){return Un(m)&&m.anyOf.every(Re=>Cn(Re)||O(Re))}f.TUnionLiteral=Qo;function Un(m){return _e(m,"Union")&&T(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every(Re=>Ge(Re))}f.TUnion=Un;function lr(m){return _e(m,"Uint8Array")&&m.type==="Uint8Array"&&T(m.$id)&&$(m.minByteLength)&&$(m.maxByteLength)}f.TUint8Array=lr;function it(m){return _e(m,"Unknown")&&T(m.$id)}f.TUnknown=it;function Si(m){return _e(m,"Unsafe")}f.TUnsafe=Si;function Fr(m){return _e(m,"Void")&&m.type==="void"&&T(m.$id)}f.TVoid=Fr;function Zo(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}f.TReadonly=Zo;function es(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}f.TOptional=es;function Ge(m){return i.IsObject(m)&&(b(m)||v(m)||te(m)||q(m)||N(m)||ne(m)||ge(m)||be(m)||Ue(m)||Fe(m)||Pn(m)||R(m)||me(m)||re(m)||de(m)||Se(m)||ke(m)||rt(m)||et(m)||Zt(m)||ur(m)||cr(m)||xn(m)||Ei(m)||qe(m)||Ii(m)||Un(m)||lr(m)||it(m)||Si(m)||Fr(m)||pn(m)&&t.Has(m[e.Kind]))}f.TSchema=Ge})(s||(e.TypeGuard=s={}));var a;(function(f){function _(E){return E[e.Kind]==="Intersect"?E.allOf.every(U=>_(U)):E[e.Kind]==="Union"?E.anyOf.some(U=>_(U)):E[e.Kind]==="Undefined"?!0:E[e.Kind]==="Not"?!_(E.not):!1}f.Check=_})(a||(e.ExtendsUndefined=a={}));var l=class extends n{};e.TypeExtendsError=l;var c;(function(f){f[f.Union=0]="Union",f[f.True=1]="True",f[f.False=2]="False"})(c||(e.TypeExtendsResult=c={}));var d;(function(f){function _(p){return p===c.False?p:c.True}function E(p){throw new l(p)}function U(p){return s.TNever(p)||s.TIntersect(p)||s.TUnion(p)||s.TUnknown(p)||s.TAny(p)}function P(p,h){return s.TNever(h)?_e(p,h):s.TIntersect(h)?be(p,h):s.TUnion(h)?ts(p,h):s.TUnknown(h)?Ya(p,h):s.TAny(h)?$(p,h):E("StructuralRight")}function $(p,h){return c.True}function y(p,h){return s.TIntersect(h)?be(p,h):s.TUnion(h)&&h.anyOf.some(Ae=>s.TAny(Ae)||s.TUnknown(Ae))?c.True:s.TUnion(h)?c.Union:s.TUnknown(h)||s.TAny(h)?c.True:c.Union}function T(p,h){return s.TUnknown(p)?c.False:s.TAny(p)?c.Union:s.TNever(p)?c.True:c.False}function w(p,h){return s.TObject(h)&&xn(h)?c.True:U(h)?P(p,h):s.TArray(h)?_(Ne(p.items,h.items)):c.False}function u(p,h){return U(h)?P(p,h):s.TAsyncIterator(h)?_(Ne(p.items,h.items)):c.False}function A(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TBigInt(h)?c.True:c.False}function b(p,h){return s.TLiteral(p)&&i.IsBoolean(p.const)||s.TBoolean(p)?c.True:c.False}function v(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TBoolean(h)?c.True:c.False}function N(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TConstructor(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((Ae,xt)=>_(Ne(h.parameters[xt],Ae))===c.True)?_(Ne(p.returns,h.returns)):c.False:c.False}function q(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TDate(h)?c.True:c.False}function te(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TFunction(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((Ae,xt)=>_(Ne(h.parameters[xt],Ae))===c.True)?_(Ne(p.returns,h.returns)):c.False:c.False}function ne(p,h){return s.TLiteral(p)&&i.IsNumber(p.const)||s.TNumber(p)||s.TInteger(p)?c.True:c.False}function ge(p,h){return s.TInteger(h)||s.TNumber(h)?c.True:U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):c.False}function be(p,h){return h.allOf.every(Ae=>Ne(p,Ae)===c.True)?c.True:c.False}function Ue(p,h){return p.allOf.some(Ae=>Ne(Ae,h)===c.True)?c.True:c.False}function Fe(p,h){return U(h)?P(p,h):s.TIterator(h)?_(Ne(p.items,h.items)):c.False}function Pn(p,h){return s.TLiteral(h)&&h.const===p.const?c.True:U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TString(h)?Fr(p,h):s.TNumber(h)?R(p,h):s.TInteger(h)?ne(p,h):s.TBoolean(h)?b(p,h):c.False}function _e(p,h){return c.False}function pn(p,h){return c.True}function Cn(p){let[h,Ae]=[p,0];for(;s.TNot(h);)h=h.not,Ae+=1;return Ae%2===0?h:e.Type.Unknown()}function O(p,h){return s.TNot(p)?Ne(Cn(p),h):s.TNot(h)?Ne(p,Cn(h)):E("Invalid fallthrough for Not")}function le(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TNull(h)?c.True:c.False}function R(p,h){return s.TLiteralNumber(p)||s.TNumber(p)||s.TInteger(p)?c.True:c.False}function me(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TInteger(h)||s.TNumber(h)?c.True:c.False}function re(p,h){return Object.getOwnPropertyNames(p.properties).length===h}function de(p){return xn(p)}function Se(p){return re(p,0)||re(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 ke(p){return re(p,0)}function rt(p){return re(p,0)}function et(p){return re(p,0)}function ot(p){return re(p,0)}function Zt(p){return xn(p)}function ur(p){let h=e.Type.Number();return re(p,0)||re(p,1)&&"length"in p.properties&&_(Ne(p.properties.length,h))===c.True}function cr(p){return re(p,0)}function xn(p){let h=e.Type.Number();return re(p,0)||re(p,1)&&"length"in p.properties&&_(Ne(p.properties.length,h))===c.True}function Ei(p){let h=e.Type.Function([e.Type.Any()],e.Type.Any());return re(p,0)||re(p,1)&&"then"in p.properties&&_(Ne(p.properties.then,h))===c.True}function jr(p,h){return Ne(p,h)===c.False||s.TOptional(p)&&!s.TOptional(h)?c.False:c.True}function qe(p,h){return s.TUnknown(p)?c.False:s.TAny(p)?c.Union:s.TNever(p)||s.TLiteralString(p)&&de(h)||s.TLiteralNumber(p)&&ke(h)||s.TLiteralBoolean(p)&&rt(h)||s.TSymbol(p)&&Se(h)||s.TBigInt(p)&&et(h)||s.TString(p)&&de(h)||s.TSymbol(p)&&Se(h)||s.TNumber(p)&&ke(h)||s.TInteger(p)&&ke(h)||s.TBoolean(p)&&rt(h)||s.TUint8Array(p)&&Zt(h)||s.TDate(p)&&ot(h)||s.TConstructor(p)&&cr(h)||s.TFunction(p)&&ur(h)?c.True:s.TRecord(p)&&s.TString(Un(p))?h[e.Hint]==="Record"?c.True:c.False:s.TRecord(p)&&s.TNumber(Un(p))?re(h,0)?c.True:c.False:c.False}function Ii(p,h){return U(h)?P(p,h):s.TRecord(h)?it(p,h):s.TObject(h)?(()=>{for(let Ae of Object.getOwnPropertyNames(h.properties)){if(!(Ae in p.properties)&&!s.TOptional(h.properties[Ae]))return c.False;if(s.TOptional(h.properties[Ae]))return c.True;if(jr(p.properties[Ae],h.properties[Ae])===c.False)return c.False}return c.True})():c.False}function Qo(p,h){return U(h)?P(p,h):s.TObject(h)&&Ei(h)?c.True:s.TPromise(h)?_(Ne(p.item,h.item)):c.False}function Un(p){return e.PatternNumberExact in p.patternProperties?e.Type.Number():e.PatternStringExact in p.patternProperties?e.Type.String():E("Unknown record key pattern")}function lr(p){return e.PatternNumberExact in p.patternProperties?p.patternProperties[e.PatternNumberExact]:e.PatternStringExact in p.patternProperties?p.patternProperties[e.PatternStringExact]:E("Unable to get record value schema")}function it(p,h){let[Ae,xt]=[Un(h),lr(h)];return s.TLiteralString(p)&&s.TNumber(Ae)&&_(Ne(p,xt))===c.True?c.True:s.TUint8Array(p)&&s.TNumber(Ae)||s.TString(p)&&s.TNumber(Ae)||s.TArray(p)&&s.TNumber(Ae)?Ne(p,xt):s.TObject(p)?(()=>{for(let Kd of Object.getOwnPropertyNames(p.properties))if(jr(xt,p.properties[Kd])===c.False)return c.False;return c.True})():c.False}function Si(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?Ne(lr(p),lr(h)):c.False}function Fr(p,h){return s.TLiteral(p)&&i.IsString(p.const)||s.TString(p)?c.True:c.False}function Zo(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TString(h)?c.True:c.False}function es(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TSymbol(h)?c.True:c.False}function Ge(p,h){return s.TTemplateLiteral(p)?Ne(j.Resolve(p),h):s.TTemplateLiteral(h)?Ne(p,j.Resolve(h)):E("Invalid fallthrough for TemplateLiteral")}function m(p,h){return s.TArray(h)&&p.items!==void 0&&p.items.every(Ae=>Ne(Ae,h.items)===c.True)}function Re(p,h){return s.TNever(p)?c.True:s.TUnknown(p)?c.False:s.TAny(p)?c.Union:c.False}function gt(p,h){return U(h)?P(p,h):s.TObject(h)&&xn(h)||s.TArray(h)&&m(p,h)?c.True:s.TTuple(h)?i.IsUndefined(p.items)&&!i.IsUndefined(h.items)||!i.IsUndefined(p.items)&&i.IsUndefined(h.items)?c.False:i.IsUndefined(p.items)&&!i.IsUndefined(h.items)||p.items.every((Ae,xt)=>Ne(Ae,h.items[xt])===c.True)?c.True:c.False:c.False}function Dd(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TUint8Array(h)?c.True:c.False}function Ld(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TVoid(h)?Fd(p,h):s.TUndefined(h)?c.True:c.False}function ts(p,h){return h.anyOf.some(Ae=>Ne(p,Ae)===c.True)?c.True:c.False}function kd(p,h){return p.anyOf.every(Ae=>Ne(Ae,h)===c.True)?c.True:c.False}function Ya(p,h){return c.True}function jd(p,h){return s.TNever(h)?_e(p,h):s.TIntersect(h)?be(p,h):s.TUnion(h)?ts(p,h):s.TAny(h)?$(p,h):s.TString(h)?Fr(p,h):s.TNumber(h)?R(p,h):s.TInteger(h)?ne(p,h):s.TBoolean(h)?b(p,h):s.TArray(h)?T(p,h):s.TTuple(h)?Re(p,h):s.TObject(h)?qe(p,h):s.TUnknown(h)?c.True:c.False}function Fd(p,h){return s.TUndefined(p)||s.TUndefined(p)?c.True:c.False}function zd(p,h){return s.TIntersect(h)?be(p,h):s.TUnion(h)?ts(p,h):s.TUnknown(h)?Ya(p,h):s.TAny(h)?$(p,h):s.TObject(h)?qe(p,h):s.TVoid(h)?c.True:c.False}function Ne(p,h){return s.TTemplateLiteral(p)||s.TTemplateLiteral(h)?Ge(p,h):s.TNot(p)||s.TNot(h)?O(p,h):s.TAny(p)?y(p,h):s.TArray(p)?w(p,h):s.TBigInt(p)?A(p,h):s.TBoolean(p)?v(p,h):s.TAsyncIterator(p)?u(p,h):s.TConstructor(p)?N(p,h):s.TDate(p)?q(p,h):s.TFunction(p)?te(p,h):s.TInteger(p)?ge(p,h):s.TIntersect(p)?Ue(p,h):s.TIterator(p)?Fe(p,h):s.TLiteral(p)?Pn(p,h):s.TNever(p)?pn(p,h):s.TNull(p)?le(p,h):s.TNumber(p)?me(p,h):s.TObject(p)?Ii(p,h):s.TRecord(p)?Si(p,h):s.TString(p)?Zo(p,h):s.TSymbol(p)?es(p,h):s.TTuple(p)?gt(p,h):s.TPromise(p)?Qo(p,h):s.TUint8Array(p)?Dd(p,h):s.TUndefined(p)?Ld(p,h):s.TUnion(p)?kd(p,h):s.TUnknown(p)?jd(p,h):s.TVoid(p)?zd(p,h):E(`Unknown left type operand '${p[e.Kind]}'`)}function Vd(p,h){return Ne(p,h)}f.Extends=Vd})(d||(e.TypeExtends=d={}));var g;(function(f){function _(w){return w.map(u=>$(u))}function E(w){return new Date(w.getTime())}function U(w){return new Uint8Array(w)}function P(w){let u=Object.getOwnPropertyNames(w).reduce((b,v)=>({...b,[v]:$(w[v])}),{}),A=Object.getOwnPropertySymbols(w).reduce((b,v)=>({...b,[v]:$(w[v])}),{});return{...u,...A}}function $(w){return i.IsArray(w)?_(w):i.IsDate(w)?E(w):i.IsUint8Array(w)?U(w):i.IsObject(w)?P(w):w}function y(w){return w.map(u=>T(u))}f.Rest=y;function T(w,u={}){return{...$(w),...u}}f.Type=T})(g||(e.TypeClone=g={}));var C;(function(f){function _(N){return N.map(q=>{let{[e.Optional]:te,...ne}=g.Type(q);return ne})}function E(N){return N.every(q=>s.TOptional(q))}function U(N){return N.some(q=>s.TOptional(q))}function P(N){return E(N.allOf)?e.Type.Optional(e.Type.Intersect(_(N.allOf))):N}function $(N){return U(N.anyOf)?e.Type.Optional(e.Type.Union(_(N.anyOf))):N}function y(N){return N[e.Kind]==="Intersect"?P(N):N[e.Kind]==="Union"?$(N):N}function T(N,q){let te=N.allOf.reduce((ne,ge)=>{let be=b(ge,q);return be[e.Kind]==="Never"?ne:[...ne,be]},[]);return y(e.Type.Intersect(te))}function w(N,q){let te=N.anyOf.map(ne=>b(ne,q));return y(e.Type.Union(te))}function u(N,q){let te=N.properties[q];return i.IsUndefined(te)?e.Type.Never():e.Type.Union([te])}function A(N,q){let te=N.items;if(i.IsUndefined(te))return e.Type.Never();let ne=te[q];return i.IsUndefined(ne)?e.Type.Never():ne}function b(N,q){return N[e.Kind]==="Intersect"?T(N,q):N[e.Kind]==="Union"?w(N,q):N[e.Kind]==="Object"?u(N,q):N[e.Kind]==="Tuple"?A(N,q):e.Type.Never()}function v(N,q,te={}){let ne=q.map(ge=>b(N,ge.toString()));return y(e.Type.Union(ne,te))}f.Resolve=v})(C||(e.IndexedAccessor=C={}));var I;(function(f){function _(A){let[b,v]=[A.slice(0,1),A.slice(1)];return`${b.toLowerCase()}${v}`}function E(A){let[b,v]=[A.slice(0,1),A.slice(1)];return`${b.toUpperCase()}${v}`}function U(A){return A.toUpperCase()}function P(A){return A.toLowerCase()}function $(A,b){let v=G.ParseExact(A.pattern);if(!x.Check(v))return{...A,pattern:y(A.pattern,b)};let te=[...L.Generate(v)].map(be=>e.Type.Literal(be)),ne=T(te,b),ge=e.Type.Union(ne);return e.Type.TemplateLiteral([ge])}function y(A,b){return typeof A=="string"?b==="Uncapitalize"?_(A):b==="Capitalize"?E(A):b==="Uppercase"?U(A):b==="Lowercase"?P(A):A:A.toString()}function T(A,b){if(A.length===0)return[];let[v,...N]=A;return[u(v,b),...T(N,b)]}function w(A,b){return s.TTemplateLiteral(A)?$(A,b):s.TUnion(A)?e.Type.Union(T(A.anyOf,b)):s.TLiteral(A)?e.Type.Literal(y(A.const,b)):A}function u(A,b){return w(A,b)}f.Map=u})(I||(e.Intrinsic=I={}));var S;(function(f){function _(y,T){return e.Type.Intersect(y.allOf.map(w=>P(w,T)),{...y})}function E(y,T){return e.Type.Union(y.anyOf.map(w=>P(w,T)),{...y})}function U(y,T){return T(y)}function P(y,T){return y[e.Kind]==="Intersect"?_(y,T):y[e.Kind]==="Union"?E(y,T):y[e.Kind]==="Object"?U(y,T):y}function $(y,T,w){return{...P(g.Type(y),T),...w}}f.Map=$})(S||(e.ObjectMap=S={}));var z;(function(f){function _(u){return u[0]==="^"&&u[u.length-1]==="$"?u.slice(1,u.length-1):u}function E(u,A){return u.allOf.reduce((b,v)=>[...b,...y(v,A)],[])}function U(u,A){let b=u.anyOf.map(v=>y(v,A));return[...b.reduce((v,N)=>N.map(q=>b.every(te=>te.includes(q))?v.add(q):v)[0],new Set)]}function P(u,A){return Object.getOwnPropertyNames(u.properties)}function $(u,A){return A.includePatterns?Object.getOwnPropertyNames(u.patternProperties):[]}function y(u,A){return s.TIntersect(u)?E(u,A):s.TUnion(u)?U(u,A):s.TObject(u)?P(u,A):s.TRecord(u)?$(u,A):[]}function T(u,A){return[...new Set(y(u,A))]}f.ResolveKeys=T;function w(u){return`^(${T(u,{includePatterns:!0}).map(v=>`(${_(v)})`).join("|")})$`}f.ResolvePattern=w})(z||(e.KeyResolver=z={}));var J=class extends n{};e.KeyArrayResolverError=J;var F;(function(f){function _(E){return Array.isArray(E)?E:s.TUnionLiteral(E)?E.anyOf.map(U=>U.const.toString()):s.TLiteral(E)?[E.const]:s.TTemplateLiteral(E)?(()=>{let U=G.ParseExact(E.pattern);if(!x.Check(U))throw new J("Cannot resolve keys from infinite template expression");return[...L.Generate(U)]})():[]}f.Resolve=_})(F||(e.KeyArrayResolver=F={}));var k;(function(f){function*_(U){for(let P of U.anyOf)P[e.Kind]==="Union"?yield*_(P):yield P}function E(U){return e.Type.Union([..._(U)],{...U})}f.Resolve=E})(k||(e.UnionResolver=k={}));var K=class extends n{};e.TemplateLiteralPatternError=K;var W;(function(f){function _($){throw new K($)}function E($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U($,y){return s.TTemplateLiteral($)?$.pattern.slice(1,$.pattern.length-1):s.TUnion($)?`(${$.anyOf.map(T=>U(T,y)).join("|")})`:s.TNumber($)?`${y}${e.PatternNumber}`:s.TInteger($)?`${y}${e.PatternNumber}`:s.TBigInt($)?`${y}${e.PatternNumber}`:s.TString($)?`${y}${e.PatternString}`:s.TLiteral($)?`${y}${E($.const.toString())}`:s.TBoolean($)?`${y}${e.PatternBoolean}`:_(`Unexpected Kind '${$[e.Kind]}'`)}function P($){return`^${$.map(y=>U(y,"")).join("")}$`}f.Create=P})(W||(e.TemplateLiteralPattern=W={}));var j;(function(f){function _(E){let U=G.ParseExact(E.pattern);if(!x.Check(U))return e.Type.String();let P=[...L.Generate(U)].map($=>e.Type.Literal($));return e.Type.Union(P)}f.Resolve=_})(j||(e.TemplateLiteralResolver=j={}));var Z=class extends n{};e.TemplateLiteralParserError=Z;var G;(function(f){function _(N,q,te){return N[q]===te&&N.charCodeAt(q-1)!==92}function E(N,q){return _(N,q,"(")}function U(N,q){return _(N,q,")")}function P(N,q){return _(N,q,"|")}function $(N){if(!(E(N,0)&&U(N,N.length-1)))return!1;let q=0;for(let te=0;te<N.length;te++)if(E(N,te)&&(q+=1),U(N,te)&&(q-=1),q===0&&te!==N.length-1)return!1;return!0}function y(N){return N.slice(1,N.length-1)}function T(N){let q=0;for(let te=0;te<N.length;te++)if(E(N,te)&&(q+=1),U(N,te)&&(q-=1),P(N,te)&&q===0)return!0;return!1}function w(N){for(let q=0;q<N.length;q++)if(E(N,q))return!0;return!1}function u(N){let[q,te]=[0,0],ne=[];for(let be=0;be<N.length;be++)if(E(N,be)&&(q+=1),U(N,be)&&(q-=1),P(N,be)&&q===0){let Ue=N.slice(te,be);Ue.length>0&&ne.push(b(Ue)),te=be+1}let ge=N.slice(te);return ge.length>0&&ne.push(b(ge)),ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"or",expr:ne}}function A(N){function q(ge,be){if(!E(ge,be))throw new Z("TemplateLiteralParser: Index must point to open parens");let Ue=0;for(let Fe=be;Fe<ge.length;Fe++)if(E(ge,Fe)&&(Ue+=1),U(ge,Fe)&&(Ue-=1),Ue===0)return[be,Fe];throw new Z("TemplateLiteralParser: Unclosed group parens in expression")}function te(ge,be){for(let Ue=be;Ue<ge.length;Ue++)if(E(ge,Ue))return[be,Ue];return[be,ge.length]}let ne=[];for(let ge=0;ge<N.length;ge++)if(E(N,ge)){let[be,Ue]=q(N,ge),Fe=N.slice(be,Ue+1);ne.push(b(Fe)),ge=Ue}else{let[be,Ue]=te(N,ge),Fe=N.slice(be,Ue);Fe.length>0&&ne.push(b(Fe)),ge=Ue-1}return ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"and",expr:ne}}function b(N){return $(N)?b(y(N)):T(N)?u(N):w(N)?A(N):{type:"const",const:N}}f.Parse=b;function v(N){return b(N.slice(1,N.length-1))}f.ParseExact=v})(G||(e.TemplateLiteralParser=G={}));var fe=class extends n{};e.TemplateLiteralFiniteError=fe;var x;(function(f){function _(y){throw new fe(y)}function E(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="0"&&y.expr[1].type==="const"&&y.expr[1].const==="[1-9][0-9]*"}function U(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="true"&&y.expr[1].type==="const"&&y.expr[1].const==="false"}function P(y){return y.type==="const"&&y.const===".*"}function $(y){return U(y)?!0:E(y)||P(y)?!1:y.type==="and"?y.expr.every(T=>$(T)):y.type==="or"?y.expr.every(T=>$(T)):y.type==="const"?!0:_("Unknown expression type")}f.Check=$})(x||(e.TemplateLiteralFinite=x={}));var M=class extends n{};e.TemplateLiteralGeneratorError=M;var L;(function(f){function*_(y){if(y.length===1)return yield*y[0];for(let T of y[0])for(let w of _(y.slice(1)))yield`${T}${w}`}function*E(y){return yield*_(y.expr.map(T=>[...$(T)]))}function*U(y){for(let T of y.expr)yield*$(T)}function*P(y){return yield y.const}function*$(y){return y.type==="and"?yield*E(y):y.type==="or"?yield*U(y):y.type==="const"?yield*P(y):(()=>{throw new M("Unknown expression")})()}f.Generate=$})(L||(e.TemplateLiteralGenerator=L={}));var ee;(function(f){function*_($){let y=$.trim().replace(/"|'/g,"");return y==="boolean"?yield e.Type.Boolean():y==="number"?yield e.Type.Number():y==="bigint"?yield e.Type.BigInt():y==="string"?yield e.Type.String():yield(()=>{let T=y.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*E($){if($[1]!=="{"){let y=e.Type.Literal("$"),T=U($.slice(1));return yield*[y,...T]}for(let y=2;y<$.length;y++)if($[y]==="}"){let T=_($.slice(2,y)),w=U($.slice(y+1));return yield*[...T,...w]}yield e.Type.Literal($)}function*U($){for(let y=0;y<$.length;y++)if($[y]==="$"){let T=e.Type.Literal($.slice(0,y)),w=E($.slice(y));return yield*[T,...w]}yield e.Type.Literal($)}function P($){return[...U($)]}f.Parse=P})(ee||(e.TemplateLiteralDslParser=ee={}));var oe=class{constructor(f){this.schema=f}Decode(f){return new Q(this.schema,f)}};e.TransformDecodeBuilder=oe;var Q=class{constructor(f,_){this.schema=f,this.decode=_}Encode(f){let _=g.Type(this.schema);return s.TTransform(_)?(()=>{let P={Encode:$=>_[e.Transform].Encode(f($)),Decode:$=>this.decode(_[e.Transform].Decode($))};return{..._,[e.Transform]:P}})():(()=>{let E={Decode:this.decode,Encode:f};return{..._,[e.Transform]:E}})()}};e.TransformEncodeBuilder=Q;var ae=0,D=class extends n{};e.TypeBuilderError=D;var H=class{Create(f){return f}Throw(f){throw new D(f)}Discard(f,_){return _.reduce((E,U)=>{let{[U]:P,...$}=E;return $},f)}Strict(f){return JSON.parse(JSON.stringify(f))}};e.TypeBuilder=H;var Y=class extends H{ReadonlyOptional(f){return this.Readonly(this.Optional(f))}Readonly(f){return{...g.Type(f),[e.Readonly]:"Readonly"}}Optional(f){return{...g.Type(f),[e.Optional]:"Optional"}}Any(f={}){return this.Create({...f,[e.Kind]:"Any"})}Array(f,_={}){return this.Create({..._,[e.Kind]:"Array",type:"array",items:g.Type(f)})}Boolean(f={}){return this.Create({...f,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(f,_={}){return{...I.Map(g.Type(f),"Capitalize"),..._}}Composite(f,_){let E=e.Type.Intersect(f,{}),P=z.ResolveKeys(E,{includePatterns:!1}).reduce(($,y)=>({...$,[y]:e.Type.Index(E,[y])}),{});return e.Type.Object(P,_)}Enum(f,_={}){if(i.IsUndefined(f))return this.Throw("Enum undefined or empty");let E=Object.getOwnPropertyNames(f).filter($=>isNaN($)).map($=>f[$]),P=[...new Set(E)].map($=>e.Type.Literal($));return this.Union(P,{..._,[e.Hint]:"Enum"})}Extends(f,_,E,U,P={}){switch(d.Extends(f,_)){case c.Union:return this.Union([g.Type(E,P),g.Type(U,P)]);case c.True:return g.Type(E,P);case c.False:return g.Type(U,P)}}Exclude(f,_,E={}){return s.TTemplateLiteral(f)?this.Exclude(j.Resolve(f),_,E):s.TTemplateLiteral(_)?this.Exclude(f,j.Resolve(_),E):s.TUnion(f)?(()=>{let U=f.anyOf.filter(P=>d.Extends(P,_)===c.False);return U.length===1?g.Type(U[0],E):this.Union(U,E)})():d.Extends(f,_)!==c.False?this.Never(E):g.Type(f,E)}Extract(f,_,E={}){return s.TTemplateLiteral(f)?this.Extract(j.Resolve(f),_,E):s.TTemplateLiteral(_)?this.Extract(f,j.Resolve(_),E):s.TUnion(f)?(()=>{let U=f.anyOf.filter(P=>d.Extends(P,_)!==c.False);return U.length===1?g.Type(U[0],E):this.Union(U,E)})():d.Extends(f,_)!==c.False?g.Type(f,E):this.Never(E)}Index(f,_,E={}){return s.TArray(f)&&s.TNumber(_)?g.Type(f.items,E):s.TTuple(f)&&s.TNumber(_)?(()=>{let P=(i.IsUndefined(f.items)?[]:f.items).map($=>g.Type($));return this.Union(P,E)})():(()=>{let U=F.Resolve(_),P=g.Type(f);return C.Resolve(P,U,E)})()}Integer(f={}){return this.Create({...f,[e.Kind]:"Integer",type:"integer"})}Intersect(f,_={}){if(f.length===0)return e.Type.Never();if(f.length===1)return g.Type(f[0],_);f.some($=>s.TTransform($))&&this.Throw("Cannot intersect transform types");let E=f.every($=>s.TObject($)),U=g.Rest(f),P=s.TSchema(_.unevaluatedProperties)?{unevaluatedProperties:g.Type(_.unevaluatedProperties)}:{};return _.unevaluatedProperties===!1||s.TSchema(_.unevaluatedProperties)||E?this.Create({..._,...P,[e.Kind]:"Intersect",type:"object",allOf:U}):this.Create({..._,...P,[e.Kind]:"Intersect",allOf:U})}KeyOf(f,_={}){return s.TRecord(f)?(()=>{let E=Object.getOwnPropertyNames(f.patternProperties)[0];return E===e.PatternNumberExact?this.Number(_):E===e.PatternStringExact?this.String(_):this.Throw("Unable to resolve key type from Record key pattern")})():s.TTuple(f)?(()=>{let U=(i.IsUndefined(f.items)?[]:f.items).map((P,$)=>e.Type.Literal($.toString()));return this.Union(U,_)})():s.TArray(f)?this.Number(_):(()=>{let E=z.ResolveKeys(f,{includePatterns:!1});if(E.length===0)return this.Never(_);let U=E.map(P=>this.Literal(P));return this.Union(U,_)})()}Literal(f,_={}){return this.Create({..._,[e.Kind]:"Literal",const:f,type:typeof f})}Lowercase(f,_={}){return{...I.Map(g.Type(f),"Lowercase"),..._}}Never(f={}){return this.Create({...f,[e.Kind]:"Never",not:{}})}Not(f,_){return this.Create({..._,[e.Kind]:"Not",not:g.Type(f)})}Null(f={}){return this.Create({...f,[e.Kind]:"Null",type:"null"})}Number(f={}){return this.Create({...f,[e.Kind]:"Number",type:"number"})}Object(f,_={}){let E=Object.getOwnPropertyNames(f),U=E.filter(T=>s.TOptional(f[T])),P=E.filter(T=>!U.includes(T)),$=s.TSchema(_.additionalProperties)?{additionalProperties:g.Type(_.additionalProperties)}:{},y=E.reduce((T,w)=>({...T,[w]:g.Type(f[w])}),{});return P.length>0?this.Create({..._,...$,[e.Kind]:"Object",type:"object",properties:y,required:P}):this.Create({..._,...$,[e.Kind]:"Object",type:"object",properties:y})}Omit(f,_,E={}){let U=F.Resolve(_);return S.Map(this.Discard(g.Type(f),["$id",e.Transform]),P=>{i.IsArray(P.required)&&(P.required=P.required.filter($=>!U.includes($)),P.required.length===0&&delete P.required);for(let $ of Object.getOwnPropertyNames(P.properties))U.includes($)&&delete P.properties[$];return this.Create(P)},E)}Partial(f,_={}){return S.Map(this.Discard(g.Type(f),["$id",e.Transform]),E=>{let U=Object.getOwnPropertyNames(E.properties).reduce((P,$)=>({...P,[$]:this.Optional(E.properties[$])}),{});return this.Object(U,this.Discard(E,["required"]))},_)}Pick(f,_,E={}){let U=F.Resolve(_);return S.Map(this.Discard(g.Type(f),["$id",e.Transform]),P=>{i.IsArray(P.required)&&(P.required=P.required.filter($=>U.includes($)),P.required.length===0&&delete P.required);for(let $ of Object.getOwnPropertyNames(P.properties))U.includes($)||delete P.properties[$];return this.Create(P)},E)}Record(f,_,E={}){return s.TTemplateLiteral(f)?(()=>{let U=G.ParseExact(f.pattern);return x.Check(U)?this.Object([...L.Generate(U)].reduce((P,$)=>({...P,[$]:g.Type(_)}),{}),E):this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[f.pattern]:g.Type(_)}})})():s.TUnion(f)?(()=>{let U=k.Resolve(f);if(s.TUnionLiteral(U)){let P=U.anyOf.reduce(($,y)=>({...$,[y.const]:g.Type(_)}),{});return this.Object(P,{...E,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():s.TLiteral(f)?i.IsString(f.const)||i.IsNumber(f.const)?this.Object({[f.const]:g.Type(_)},E):this.Throw("Record key of type literal is not of type string or number"):s.TInteger(f)||s.TNumber(f)?this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:g.Type(_)}}):s.TString(f)?(()=>{let U=i.IsUndefined(f.pattern)?e.PatternStringExact:f.pattern;return this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[U]:g.Type(_)}})})():this.Never()}Recursive(f,_={}){i.IsUndefined(_.$id)&&(_.$id=`T${ae++}`);let E=f({[e.Kind]:"This",$ref:`${_.$id}`});return E.$id=_.$id,this.Create({..._,[e.Hint]:"Recursive",...E})}Ref(f,_={}){return i.IsString(f)?this.Create({..._,[e.Kind]:"Ref",$ref:f}):(i.IsUndefined(f.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({..._,[e.Kind]:"Ref",$ref:f.$id}))}Required(f,_={}){return S.Map(this.Discard(g.Type(f),["$id",e.Transform]),E=>{let U=Object.getOwnPropertyNames(E.properties).reduce((P,$)=>({...P,[$]:this.Discard(E.properties[$],[e.Optional])}),{});return this.Object(U,E)},_)}Rest(f){return s.TTuple(f)&&!i.IsUndefined(f.items)?g.Rest(f.items):s.TIntersect(f)?g.Rest(f.allOf):s.TUnion(f)?g.Rest(f.anyOf):[]}String(f={}){return this.Create({...f,[e.Kind]:"String",type:"string"})}TemplateLiteral(f,_={}){let E=i.IsString(f)?W.Create(ee.Parse(f)):W.Create(f);return this.Create({..._,[e.Kind]:"TemplateLiteral",type:"string",pattern:E})}Transform(f){return new oe(f)}Tuple(f,_={}){let[E,U,P]=[!1,f.length,f.length],$=g.Rest(f),y=f.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:$,additionalItems:E,minItems:U,maxItems:P}:{..._,[e.Kind]:"Tuple",type:"array",minItems:U,maxItems:P};return this.Create(y)}Uncapitalize(f,_={}){return{...I.Map(g.Type(f),"Uncapitalize"),..._}}Union(f,_={}){return s.TTemplateLiteral(f)?j.Resolve(f):(()=>{let E=f;if(E.length===0)return this.Never(_);if(E.length===1)return this.Create(g.Type(E[0],_));let U=g.Rest(E);return this.Create({..._,[e.Kind]:"Union",anyOf:U})})()}Unknown(f={}){return this.Create({...f,[e.Kind]:"Unknown"})}Unsafe(f={}){return this.Create({...f,[e.Kind]:f[e.Kind]||"Unsafe"})}Uppercase(f,_={}){return{...I.Map(g.Type(f),"Uppercase"),..._}}};e.JsonTypeBuilder=Y;var he=class extends Y{AsyncIterator(f,_={}){return this.Create({..._,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:g.Type(f)})}Awaited(f,_={}){let E=U=>U.length>0?(()=>{let[P,...$]=U;return[this.Awaited(P),...E($)]})():U;return s.TIntersect(f)?e.Type.Intersect(E(f.allOf)):s.TUnion(f)?e.Type.Union(E(f.anyOf)):s.TPromise(f)?this.Awaited(f.item):g.Type(f,_)}BigInt(f={}){return this.Create({...f,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(f,_={}){return this.Tuple([...f.parameters],{..._})}Constructor(f,_,E){let[U,P]=[g.Rest(f),g.Type(_)];return this.Create({...E,[e.Kind]:"Constructor",type:"Constructor",parameters:U,returns:P})}Date(f={}){return this.Create({...f,[e.Kind]:"Date",type:"Date"})}Function(f,_,E){let[U,P]=[g.Rest(f),g.Type(_)];return this.Create({...E,[e.Kind]:"Function",type:"Function",parameters:U,returns:P})}InstanceType(f,_={}){return g.Type(f.returns,_)}Iterator(f,_={}){return this.Create({..._,[e.Kind]:"Iterator",type:"Iterator",items:g.Type(f)})}Parameters(f,_={}){return this.Tuple(f.parameters,{..._})}Promise(f,_={}){return this.Create({..._,[e.Kind]:"Promise",type:"Promise",item:g.Type(f)})}RegExp(f,_={}){let E=i.IsString(f)?f:f.source;return this.Create({..._,[e.Kind]:"String",type:"string",pattern:E})}RegEx(f,_={}){return this.RegExp(f,_)}ReturnType(f,_={}){return g.Type(f.returns,_)}Symbol(f){return this.Create({...f,[e.Kind]:"Symbol",type:"symbol"})}Undefined(f={}){return this.Create({...f,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(f={}){return this.Create({...f,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(f={}){return this.Create({...f,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=he,e.JsonType=new Y,e.Type=new he}}),fr=mt(en(),1),{String:Xd,Optional:Yd,Boolean:Qd,Object:Zd,Number:ep}=fr.Type,tp=Xd.bind(fr.Type),np=ep.bind(fr.Type),zI=Zd.bind(fr.Type),VI=Yd.bind(fr.Type),rp=Qd.bind(fr.Type),KI=tp(),qI=np(),GI=rp();function Za(e){return Array.isArray(e)?e:[e]}var ip={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,n){return"Cannot apply '"+t+"' to '"+n.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,n){return"[mobx.array] Index out of bounds, "+t+" is larger than "+n},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,n){return"the entry '"+t+"' does not exist in the observable map '"+n+"'"},26:"please specify a property",27:function(t,n){return"no observable property '"+t.toString()+"' found on the observable object '"+n+"'"},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,n){return"Cycle detected in computation "+t+": "+n},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"},op=ip;function ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=typeof e=="string"?e:op[e];throw typeof i=="function"&&(i=i.apply(null,n)),new Error("[MobX] "+i)}var sp={};function Ki(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:sp}var vu=Object.assign,Mi=Object.getOwnPropertyDescriptor,Gt=Object.defineProperty,Gr=Object.prototype,Bi=[];Object.freeze(Bi);var ms={};Object.freeze(ms);var ap=typeof Proxy<"u",up=Object.toString();function bu(){ap||ce("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function zr(e){X.verifyProxies&&ce("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function It(){return++X.mobxGuid}function vs(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var pr=function(){};function je(e){return typeof e=="function"}function Bn(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function qi(e){return e!==null&&typeof e=="object"}function Lt(e){if(!qi(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===up}function _u(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Gi(e,t,n){Gt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function wu(e,t,n){Gt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function mn(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return qi(r)&&r[n]===!0}}function mr(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function cp(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function tn(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Tu=typeof Object.getOwnPropertySymbols<"u";function lp(e){var t=Object.keys(e);if(!Tu)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return Gr.propertyIsEnumerable.call(e,r)})):t}var Wi=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Tu?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function ss(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Au(e){return e===null?null:typeof e=="object"?""+e:e}function Tt(e,t){return Gr.hasOwnProperty.call(e,t)}var fp=Object.getOwnPropertyDescriptors||function(t){var n={};return Wi(t).forEach(function(r){n[r]=Mi(t,r)}),n};function ct(e,t){return!!(e&t)}function lt(e,t,n){return n?e|=t:e&=~t,e}function eu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pp(r.key),r)}}function vr(e,t,n){return t&&tu(e.prototype,t),n&&tu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=hp(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}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 on(){return on=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},on.apply(null,arguments)}function Ou(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,as(e,t)}function as(e,t){return as=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},as(e,t)}function dp(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pp(e){var t=dp(e,"string");return typeof t=="symbol"?t:t+""}function hp(e,t){if(e){if(typeof e=="string")return eu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eu(e,t):void 0}}var st=Symbol("mobx-stored-annotations");function Wt(e){function t(n,r){if(Hr(r))return e.decorate_20223_(n,r);Wr(n,r,e)}return Object.assign(t,e)}function Wr(e,t,n){if(Tt(e,st)||Gi(e,st,on({},e[st])),Di(n)&&!Tt(e[st],t)){var r=e.constructor.name+".prototype."+t.toString();ce("'"+r+"' is decorated with 'override', but no such decorated member was found on prototype.")}yp(e,n,t),Di(n)||(e[st][t]=n)}function yp(e,t,n){if(!Di(t)&&Tt(e[st],n)){var r=e.constructor.name+".prototype."+n.toString(),i=e[st][n].annotationType_,o=t.annotationType_;ce("Cannot apply '@"+o+"' to '"+r+"':"+(`
1
+ var qd=Object.create,is=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,eu=Object.getOwnPropertyNames,Wd=Object.getPrototypeOf,Hd=Object.prototype.hasOwnProperty,De=(e,t)=>function(){return t||(0,e[eu(e)[0]])((t={exports:{}}).exports,t),t.exports},os=(e,t)=>{for(var n in t)is(e,n,{get:t[n],enumerable:!0})},Jd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of eu(t))!Hd.call(e,i)&&i!==n&&is(e,i,{get:()=>t[i],enumerable:!(r=Gd(t,i))||r.enumerable});return e},mt=(e,t,n)=>(n=e!=null?qd(Wd(e)):{},Jd(t||!e||!e.__esModule?is(n,"default",{value:e,enumerable:!0}):n,e));var en=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(f){let _=new Map;function E(){return new Map(_)}f.Entries=E;function U(){return _.clear()}f.Clear=U;function P(w){return _.delete(w)}f.Delete=P;function $(w){return _.has(w)}f.Has=$;function y(w,u){_.set(w,u)}f.Set=y;function T(w){return _.get(w)}f.Get=T})(t||(e.TypeRegistry=t={}));var n=class extends Error{constructor(f){super(f)}};e.TypeBoxError=n;var r;(function(f){let _=new Map;function E(){return new Map(_)}f.Entries=E;function U(){return _.clear()}f.Clear=U;function P(w){return _.delete(w)}f.Delete=P;function $(w){return _.has(w)}f.Has=$;function y(w,u){_.set(w,u)}f.Set=y;function T(w){return _.get(w)}f.Get=T})(r||(e.FormatRegistry=r={}));var i;(function(f){function _(b){return Array.isArray(b)}f.IsArray=_;function E(b){return typeof b=="bigint"}f.IsBigInt=E;function U(b){return typeof b=="boolean"}f.IsBoolean=U;function P(b){return b instanceof globalThis.Date}f.IsDate=P;function $(b){return b===null}f.IsNull=$;function y(b){return typeof b=="number"}f.IsNumber=y;function T(b){return typeof b=="object"&&b!==null}f.IsObject=T;function w(b){return typeof b=="string"}f.IsString=w;function u(b){return b instanceof globalThis.Uint8Array}f.IsUint8Array=u;function A(b){return b===void 0}f.IsUndefined=A})(i||(e.ValueGuard=i={}));var o=class extends n{};e.TypeGuardUnknownTypeError=o;var s;(function(f){function _(m){try{return new RegExp(m),!0}catch{return!1}}function E(m){if(!i.IsString(m))return!1;for(let Re=0;Re<m.length;Re++){let gt=m.charCodeAt(Re);if(gt>=7&&gt<=13||gt===27||gt===127)return!1}return!0}function U(m){return y(m)||Ge(m)}function P(m){return i.IsUndefined(m)||i.IsBigInt(m)}function $(m){return i.IsUndefined(m)||i.IsNumber(m)}function y(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)&&E(m)&&_(m)}function u(m){return i.IsUndefined(m)||i.IsString(m)&&E(m)}function A(m){return i.IsUndefined(m)||Ge(m)}function b(m){return _e(m,"Any")&&T(m.$id)}f.TAny=b;function v(m){return _e(m,"Array")&&m.type==="array"&&T(m.$id)&&Ge(m.items)&&$(m.minItems)&&$(m.maxItems)&&y(m.uniqueItems)&&A(m.contains)&&$(m.minContains)&&$(m.maxContains)}f.TArray=v;function N(m){return _e(m,"AsyncIterator")&&m.type==="AsyncIterator"&&T(m.$id)&&Ge(m.items)}f.TAsyncIterator=N;function q(m){return _e(m,"BigInt")&&m.type==="bigint"&&T(m.$id)&&P(m.exclusiveMaximum)&&P(m.exclusiveMinimum)&&P(m.maximum)&&P(m.minimum)&&P(m.multipleOf)}f.TBigInt=q;function te(m){return _e(m,"Boolean")&&m.type==="boolean"&&T(m.$id)}f.TBoolean=te;function ne(m){return _e(m,"Constructor")&&m.type==="Constructor"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Re=>Ge(Re))&&Ge(m.returns)}f.TConstructor=ne;function ge(m){return _e(m,"Date")&&m.type==="Date"&&T(m.$id)&&$(m.exclusiveMaximumTimestamp)&&$(m.exclusiveMinimumTimestamp)&&$(m.maximumTimestamp)&&$(m.minimumTimestamp)&&$(m.multipleOfTimestamp)}f.TDate=ge;function be(m){return _e(m,"Function")&&m.type==="Function"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Re=>Ge(Re))&&Ge(m.returns)}f.TFunction=be;function Ue(m){return _e(m,"Integer")&&m.type==="integer"&&T(m.$id)&&$(m.exclusiveMaximum)&&$(m.exclusiveMinimum)&&$(m.maximum)&&$(m.minimum)&&$(m.multipleOf)}f.TInteger=Ue;function Fe(m){return _e(m,"Intersect")&&!(i.IsString(m.type)&&m.type!=="object")&&i.IsArray(m.allOf)&&m.allOf.every(Re=>Ge(Re)&&!jr(Re))&&T(m.type)&&(y(m.unevaluatedProperties)||A(m.unevaluatedProperties))&&T(m.$id)}f.TIntersect=Fe;function Pn(m){return _e(m,"Iterator")&&m.type==="Iterator"&&T(m.$id)&&Ge(m.items)}f.TIterator=Pn;function _e(m,Re){return pn(m)&&m[e.Kind]===Re}f.TKindOf=_e;function pn(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}f.TKind=pn;function Cn(m){return R(m)&&i.IsString(m.const)}f.TLiteralString=Cn;function O(m){return R(m)&&i.IsNumber(m.const)}f.TLiteralNumber=O;function le(m){return R(m)&&i.IsBoolean(m.const)}f.TLiteralBoolean=le;function R(m){return _e(m,"Literal")&&T(m.$id)&&(i.IsBoolean(m.const)||i.IsNumber(m.const)||i.IsString(m.const))}f.TLiteral=R;function me(m){return _e(m,"Never")&&i.IsObject(m.not)&&Object.getOwnPropertyNames(m.not).length===0}f.TNever=me;function re(m){return _e(m,"Not")&&Ge(m.not)}f.TNot=re;function de(m){return _e(m,"Null")&&m.type==="null"&&T(m.$id)}f.TNull=de;function Se(m){return _e(m,"Number")&&m.type==="number"&&T(m.$id)&&$(m.exclusiveMaximum)&&$(m.exclusiveMinimum)&&$(m.maximum)&&$(m.minimum)&&$(m.multipleOf)}f.TNumber=Se;function ke(m){return _e(m,"Object")&&m.type==="object"&&T(m.$id)&&i.IsObject(m.properties)&&U(m.additionalProperties)&&$(m.minProperties)&&$(m.maxProperties)&&Object.entries(m.properties).every(([Re,gt])=>E(Re)&&Ge(gt))}f.TObject=ke;function rt(m){return _e(m,"Promise")&&m.type==="Promise"&&T(m.$id)&&Ge(m.item)}f.TPromise=rt;function et(m){return _e(m,"Record")&&m.type==="object"&&T(m.$id)&&U(m.additionalProperties)&&i.IsObject(m.patternProperties)&&(Re=>{let gt=Object.getOwnPropertyNames(Re.patternProperties);return gt.length===1&&_(gt[0])&&i.IsObject(Re.patternProperties)&&Ge(Re.patternProperties[gt[0]])})(m)}f.TRecord=et;function ot(m){return i.IsObject(m)&&e.Hint in m&&m[e.Hint]==="Recursive"}f.TRecursive=ot;function Zt(m){return _e(m,"Ref")&&T(m.$id)&&i.IsString(m.$ref)}f.TRef=Zt;function ur(m){return _e(m,"String")&&m.type==="string"&&T(m.$id)&&$(m.minLength)&&$(m.maxLength)&&w(m.pattern)&&u(m.format)}f.TString=ur;function cr(m){return _e(m,"Symbol")&&m.type==="symbol"&&T(m.$id)}f.TSymbol=cr;function xn(m){return _e(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}f.TTemplateLiteral=xn;function Ei(m){return _e(m,"This")&&T(m.$id)&&i.IsString(m.$ref)}f.TThis=Ei;function jr(m){return i.IsObject(m)&&e.Transform in m}f.TTransform=jr;function qe(m){return _e(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(Re=>Ge(Re)))}f.TTuple=qe;function Ii(m){return _e(m,"Undefined")&&m.type==="undefined"&&T(m.$id)}f.TUndefined=Ii;function es(m){return Un(m)&&m.anyOf.every(Re=>Cn(Re)||O(Re))}f.TUnionLiteral=es;function Un(m){return _e(m,"Union")&&T(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every(Re=>Ge(Re))}f.TUnion=Un;function lr(m){return _e(m,"Uint8Array")&&m.type==="Uint8Array"&&T(m.$id)&&$(m.minByteLength)&&$(m.maxByteLength)}f.TUint8Array=lr;function it(m){return _e(m,"Unknown")&&T(m.$id)}f.TUnknown=it;function Si(m){return _e(m,"Unsafe")}f.TUnsafe=Si;function Fr(m){return _e(m,"Void")&&m.type==="void"&&T(m.$id)}f.TVoid=Fr;function ts(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}f.TReadonly=ts;function ns(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}f.TOptional=ns;function Ge(m){return i.IsObject(m)&&(b(m)||v(m)||te(m)||q(m)||N(m)||ne(m)||ge(m)||be(m)||Ue(m)||Fe(m)||Pn(m)||R(m)||me(m)||re(m)||de(m)||Se(m)||ke(m)||rt(m)||et(m)||Zt(m)||ur(m)||cr(m)||xn(m)||Ei(m)||qe(m)||Ii(m)||Un(m)||lr(m)||it(m)||Si(m)||Fr(m)||pn(m)&&t.Has(m[e.Kind]))}f.TSchema=Ge})(s||(e.TypeGuard=s={}));var a;(function(f){function _(E){return E[e.Kind]==="Intersect"?E.allOf.every(U=>_(U)):E[e.Kind]==="Union"?E.anyOf.some(U=>_(U)):E[e.Kind]==="Undefined"?!0:E[e.Kind]==="Not"?!_(E.not):!1}f.Check=_})(a||(e.ExtendsUndefined=a={}));var l=class extends n{};e.TypeExtendsError=l;var c;(function(f){f[f.Union=0]="Union",f[f.True=1]="True",f[f.False=2]="False"})(c||(e.TypeExtendsResult=c={}));var d;(function(f){function _(p){return p===c.False?p:c.True}function E(p){throw new l(p)}function U(p){return s.TNever(p)||s.TIntersect(p)||s.TUnion(p)||s.TUnknown(p)||s.TAny(p)}function P(p,h){return s.TNever(h)?_e(p,h):s.TIntersect(h)?be(p,h):s.TUnion(h)?rs(p,h):s.TUnknown(h)?Za(p,h):s.TAny(h)?$(p,h):E("StructuralRight")}function $(p,h){return c.True}function y(p,h){return s.TIntersect(h)?be(p,h):s.TUnion(h)&&h.anyOf.some(Ae=>s.TAny(Ae)||s.TUnknown(Ae))?c.True:s.TUnion(h)?c.Union:s.TUnknown(h)||s.TAny(h)?c.True:c.Union}function T(p,h){return s.TUnknown(p)?c.False:s.TAny(p)?c.Union:s.TNever(p)?c.True:c.False}function w(p,h){return s.TObject(h)&&xn(h)?c.True:U(h)?P(p,h):s.TArray(h)?_(Ne(p.items,h.items)):c.False}function u(p,h){return U(h)?P(p,h):s.TAsyncIterator(h)?_(Ne(p.items,h.items)):c.False}function A(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TBigInt(h)?c.True:c.False}function b(p,h){return s.TLiteral(p)&&i.IsBoolean(p.const)||s.TBoolean(p)?c.True:c.False}function v(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TBoolean(h)?c.True:c.False}function N(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TConstructor(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((Ae,xt)=>_(Ne(h.parameters[xt],Ae))===c.True)?_(Ne(p.returns,h.returns)):c.False:c.False}function q(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TDate(h)?c.True:c.False}function te(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TFunction(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((Ae,xt)=>_(Ne(h.parameters[xt],Ae))===c.True)?_(Ne(p.returns,h.returns)):c.False:c.False}function ne(p,h){return s.TLiteral(p)&&i.IsNumber(p.const)||s.TNumber(p)||s.TInteger(p)?c.True:c.False}function ge(p,h){return s.TInteger(h)||s.TNumber(h)?c.True:U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):c.False}function be(p,h){return h.allOf.every(Ae=>Ne(p,Ae)===c.True)?c.True:c.False}function Ue(p,h){return p.allOf.some(Ae=>Ne(Ae,h)===c.True)?c.True:c.False}function Fe(p,h){return U(h)?P(p,h):s.TIterator(h)?_(Ne(p.items,h.items)):c.False}function Pn(p,h){return s.TLiteral(h)&&h.const===p.const?c.True:U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TString(h)?Fr(p,h):s.TNumber(h)?R(p,h):s.TInteger(h)?ne(p,h):s.TBoolean(h)?b(p,h):c.False}function _e(p,h){return c.False}function pn(p,h){return c.True}function Cn(p){let[h,Ae]=[p,0];for(;s.TNot(h);)h=h.not,Ae+=1;return Ae%2===0?h:e.Type.Unknown()}function O(p,h){return s.TNot(p)?Ne(Cn(p),h):s.TNot(h)?Ne(p,Cn(h)):E("Invalid fallthrough for Not")}function le(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TNull(h)?c.True:c.False}function R(p,h){return s.TLiteralNumber(p)||s.TNumber(p)||s.TInteger(p)?c.True:c.False}function me(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TInteger(h)||s.TNumber(h)?c.True:c.False}function re(p,h){return Object.getOwnPropertyNames(p.properties).length===h}function de(p){return xn(p)}function Se(p){return re(p,0)||re(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 ke(p){return re(p,0)}function rt(p){return re(p,0)}function et(p){return re(p,0)}function ot(p){return re(p,0)}function Zt(p){return xn(p)}function ur(p){let h=e.Type.Number();return re(p,0)||re(p,1)&&"length"in p.properties&&_(Ne(p.properties.length,h))===c.True}function cr(p){return re(p,0)}function xn(p){let h=e.Type.Number();return re(p,0)||re(p,1)&&"length"in p.properties&&_(Ne(p.properties.length,h))===c.True}function Ei(p){let h=e.Type.Function([e.Type.Any()],e.Type.Any());return re(p,0)||re(p,1)&&"then"in p.properties&&_(Ne(p.properties.then,h))===c.True}function jr(p,h){return Ne(p,h)===c.False||s.TOptional(p)&&!s.TOptional(h)?c.False:c.True}function qe(p,h){return s.TUnknown(p)?c.False:s.TAny(p)?c.Union:s.TNever(p)||s.TLiteralString(p)&&de(h)||s.TLiteralNumber(p)&&ke(h)||s.TLiteralBoolean(p)&&rt(h)||s.TSymbol(p)&&Se(h)||s.TBigInt(p)&&et(h)||s.TString(p)&&de(h)||s.TSymbol(p)&&Se(h)||s.TNumber(p)&&ke(h)||s.TInteger(p)&&ke(h)||s.TBoolean(p)&&rt(h)||s.TUint8Array(p)&&Zt(h)||s.TDate(p)&&ot(h)||s.TConstructor(p)&&cr(h)||s.TFunction(p)&&ur(h)?c.True:s.TRecord(p)&&s.TString(Un(p))?h[e.Hint]==="Record"?c.True:c.False:s.TRecord(p)&&s.TNumber(Un(p))?re(h,0)?c.True:c.False:c.False}function Ii(p,h){return U(h)?P(p,h):s.TRecord(h)?it(p,h):s.TObject(h)?(()=>{for(let Ae of Object.getOwnPropertyNames(h.properties)){if(!(Ae in p.properties)&&!s.TOptional(h.properties[Ae]))return c.False;if(s.TOptional(h.properties[Ae]))return c.True;if(jr(p.properties[Ae],h.properties[Ae])===c.False)return c.False}return c.True})():c.False}function es(p,h){return U(h)?P(p,h):s.TObject(h)&&Ei(h)?c.True:s.TPromise(h)?_(Ne(p.item,h.item)):c.False}function Un(p){return e.PatternNumberExact in p.patternProperties?e.Type.Number():e.PatternStringExact in p.patternProperties?e.Type.String():E("Unknown record key pattern")}function lr(p){return e.PatternNumberExact in p.patternProperties?p.patternProperties[e.PatternNumberExact]:e.PatternStringExact in p.patternProperties?p.patternProperties[e.PatternStringExact]:E("Unable to get record value schema")}function it(p,h){let[Ae,xt]=[Un(h),lr(h)];return s.TLiteralString(p)&&s.TNumber(Ae)&&_(Ne(p,xt))===c.True?c.True:s.TUint8Array(p)&&s.TNumber(Ae)||s.TString(p)&&s.TNumber(Ae)||s.TArray(p)&&s.TNumber(Ae)?Ne(p,xt):s.TObject(p)?(()=>{for(let Kd of Object.getOwnPropertyNames(p.properties))if(jr(xt,p.properties[Kd])===c.False)return c.False;return c.True})():c.False}function Si(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?Ne(lr(p),lr(h)):c.False}function Fr(p,h){return s.TLiteral(p)&&i.IsString(p.const)||s.TString(p)?c.True:c.False}function ts(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TString(h)?c.True:c.False}function ns(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TSymbol(h)?c.True:c.False}function Ge(p,h){return s.TTemplateLiteral(p)?Ne(j.Resolve(p),h):s.TTemplateLiteral(h)?Ne(p,j.Resolve(h)):E("Invalid fallthrough for TemplateLiteral")}function m(p,h){return s.TArray(h)&&p.items!==void 0&&p.items.every(Ae=>Ne(Ae,h.items)===c.True)}function Re(p,h){return s.TNever(p)?c.True:s.TUnknown(p)?c.False:s.TAny(p)?c.Union:c.False}function gt(p,h){return U(h)?P(p,h):s.TObject(h)&&xn(h)||s.TArray(h)&&m(p,h)?c.True:s.TTuple(h)?i.IsUndefined(p.items)&&!i.IsUndefined(h.items)||!i.IsUndefined(p.items)&&i.IsUndefined(h.items)?c.False:i.IsUndefined(p.items)&&!i.IsUndefined(h.items)||p.items.every((Ae,xt)=>Ne(Ae,h.items[xt])===c.True)?c.True:c.False:c.False}function Dd(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TUint8Array(h)?c.True:c.False}function Ld(p,h){return U(h)?P(p,h):s.TObject(h)?qe(p,h):s.TRecord(h)?it(p,h):s.TVoid(h)?Fd(p,h):s.TUndefined(h)?c.True:c.False}function rs(p,h){return h.anyOf.some(Ae=>Ne(p,Ae)===c.True)?c.True:c.False}function kd(p,h){return p.anyOf.every(Ae=>Ne(Ae,h)===c.True)?c.True:c.False}function Za(p,h){return c.True}function jd(p,h){return s.TNever(h)?_e(p,h):s.TIntersect(h)?be(p,h):s.TUnion(h)?rs(p,h):s.TAny(h)?$(p,h):s.TString(h)?Fr(p,h):s.TNumber(h)?R(p,h):s.TInteger(h)?ne(p,h):s.TBoolean(h)?b(p,h):s.TArray(h)?T(p,h):s.TTuple(h)?Re(p,h):s.TObject(h)?qe(p,h):s.TUnknown(h)?c.True:c.False}function Fd(p,h){return s.TUndefined(p)||s.TUndefined(p)?c.True:c.False}function zd(p,h){return s.TIntersect(h)?be(p,h):s.TUnion(h)?rs(p,h):s.TUnknown(h)?Za(p,h):s.TAny(h)?$(p,h):s.TObject(h)?qe(p,h):s.TVoid(h)?c.True:c.False}function Ne(p,h){return s.TTemplateLiteral(p)||s.TTemplateLiteral(h)?Ge(p,h):s.TNot(p)||s.TNot(h)?O(p,h):s.TAny(p)?y(p,h):s.TArray(p)?w(p,h):s.TBigInt(p)?A(p,h):s.TBoolean(p)?v(p,h):s.TAsyncIterator(p)?u(p,h):s.TConstructor(p)?N(p,h):s.TDate(p)?q(p,h):s.TFunction(p)?te(p,h):s.TInteger(p)?ge(p,h):s.TIntersect(p)?Ue(p,h):s.TIterator(p)?Fe(p,h):s.TLiteral(p)?Pn(p,h):s.TNever(p)?pn(p,h):s.TNull(p)?le(p,h):s.TNumber(p)?me(p,h):s.TObject(p)?Ii(p,h):s.TRecord(p)?Si(p,h):s.TString(p)?ts(p,h):s.TSymbol(p)?ns(p,h):s.TTuple(p)?gt(p,h):s.TPromise(p)?es(p,h):s.TUint8Array(p)?Dd(p,h):s.TUndefined(p)?Ld(p,h):s.TUnion(p)?kd(p,h):s.TUnknown(p)?jd(p,h):s.TVoid(p)?zd(p,h):E(`Unknown left type operand '${p[e.Kind]}'`)}function Vd(p,h){return Ne(p,h)}f.Extends=Vd})(d||(e.TypeExtends=d={}));var g;(function(f){function _(w){return w.map(u=>$(u))}function E(w){return new Date(w.getTime())}function U(w){return new Uint8Array(w)}function P(w){let u=Object.getOwnPropertyNames(w).reduce((b,v)=>({...b,[v]:$(w[v])}),{}),A=Object.getOwnPropertySymbols(w).reduce((b,v)=>({...b,[v]:$(w[v])}),{});return{...u,...A}}function $(w){return i.IsArray(w)?_(w):i.IsDate(w)?E(w):i.IsUint8Array(w)?U(w):i.IsObject(w)?P(w):w}function y(w){return w.map(u=>T(u))}f.Rest=y;function T(w,u={}){return{...$(w),...u}}f.Type=T})(g||(e.TypeClone=g={}));var C;(function(f){function _(N){return N.map(q=>{let{[e.Optional]:te,...ne}=g.Type(q);return ne})}function E(N){return N.every(q=>s.TOptional(q))}function U(N){return N.some(q=>s.TOptional(q))}function P(N){return E(N.allOf)?e.Type.Optional(e.Type.Intersect(_(N.allOf))):N}function $(N){return U(N.anyOf)?e.Type.Optional(e.Type.Union(_(N.anyOf))):N}function y(N){return N[e.Kind]==="Intersect"?P(N):N[e.Kind]==="Union"?$(N):N}function T(N,q){let te=N.allOf.reduce((ne,ge)=>{let be=b(ge,q);return be[e.Kind]==="Never"?ne:[...ne,be]},[]);return y(e.Type.Intersect(te))}function w(N,q){let te=N.anyOf.map(ne=>b(ne,q));return y(e.Type.Union(te))}function u(N,q){let te=N.properties[q];return i.IsUndefined(te)?e.Type.Never():e.Type.Union([te])}function A(N,q){let te=N.items;if(i.IsUndefined(te))return e.Type.Never();let ne=te[q];return i.IsUndefined(ne)?e.Type.Never():ne}function b(N,q){return N[e.Kind]==="Intersect"?T(N,q):N[e.Kind]==="Union"?w(N,q):N[e.Kind]==="Object"?u(N,q):N[e.Kind]==="Tuple"?A(N,q):e.Type.Never()}function v(N,q,te={}){let ne=q.map(ge=>b(N,ge.toString()));return y(e.Type.Union(ne,te))}f.Resolve=v})(C||(e.IndexedAccessor=C={}));var I;(function(f){function _(A){let[b,v]=[A.slice(0,1),A.slice(1)];return`${b.toLowerCase()}${v}`}function E(A){let[b,v]=[A.slice(0,1),A.slice(1)];return`${b.toUpperCase()}${v}`}function U(A){return A.toUpperCase()}function P(A){return A.toLowerCase()}function $(A,b){let v=G.ParseExact(A.pattern);if(!x.Check(v))return{...A,pattern:y(A.pattern,b)};let te=[...L.Generate(v)].map(be=>e.Type.Literal(be)),ne=T(te,b),ge=e.Type.Union(ne);return e.Type.TemplateLiteral([ge])}function y(A,b){return typeof A=="string"?b==="Uncapitalize"?_(A):b==="Capitalize"?E(A):b==="Uppercase"?U(A):b==="Lowercase"?P(A):A:A.toString()}function T(A,b){if(A.length===0)return[];let[v,...N]=A;return[u(v,b),...T(N,b)]}function w(A,b){return s.TTemplateLiteral(A)?$(A,b):s.TUnion(A)?e.Type.Union(T(A.anyOf,b)):s.TLiteral(A)?e.Type.Literal(y(A.const,b)):A}function u(A,b){return w(A,b)}f.Map=u})(I||(e.Intrinsic=I={}));var S;(function(f){function _(y,T){return e.Type.Intersect(y.allOf.map(w=>P(w,T)),{...y})}function E(y,T){return e.Type.Union(y.anyOf.map(w=>P(w,T)),{...y})}function U(y,T){return T(y)}function P(y,T){return y[e.Kind]==="Intersect"?_(y,T):y[e.Kind]==="Union"?E(y,T):y[e.Kind]==="Object"?U(y,T):y}function $(y,T,w){return{...P(g.Type(y),T),...w}}f.Map=$})(S||(e.ObjectMap=S={}));var z;(function(f){function _(u){return u[0]==="^"&&u[u.length-1]==="$"?u.slice(1,u.length-1):u}function E(u,A){return u.allOf.reduce((b,v)=>[...b,...y(v,A)],[])}function U(u,A){let b=u.anyOf.map(v=>y(v,A));return[...b.reduce((v,N)=>N.map(q=>b.every(te=>te.includes(q))?v.add(q):v)[0],new Set)]}function P(u,A){return Object.getOwnPropertyNames(u.properties)}function $(u,A){return A.includePatterns?Object.getOwnPropertyNames(u.patternProperties):[]}function y(u,A){return s.TIntersect(u)?E(u,A):s.TUnion(u)?U(u,A):s.TObject(u)?P(u,A):s.TRecord(u)?$(u,A):[]}function T(u,A){return[...new Set(y(u,A))]}f.ResolveKeys=T;function w(u){return`^(${T(u,{includePatterns:!0}).map(v=>`(${_(v)})`).join("|")})$`}f.ResolvePattern=w})(z||(e.KeyResolver=z={}));var J=class extends n{};e.KeyArrayResolverError=J;var F;(function(f){function _(E){return Array.isArray(E)?E:s.TUnionLiteral(E)?E.anyOf.map(U=>U.const.toString()):s.TLiteral(E)?[E.const]:s.TTemplateLiteral(E)?(()=>{let U=G.ParseExact(E.pattern);if(!x.Check(U))throw new J("Cannot resolve keys from infinite template expression");return[...L.Generate(U)]})():[]}f.Resolve=_})(F||(e.KeyArrayResolver=F={}));var k;(function(f){function*_(U){for(let P of U.anyOf)P[e.Kind]==="Union"?yield*_(P):yield P}function E(U){return e.Type.Union([..._(U)],{...U})}f.Resolve=E})(k||(e.UnionResolver=k={}));var K=class extends n{};e.TemplateLiteralPatternError=K;var W;(function(f){function _($){throw new K($)}function E($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U($,y){return s.TTemplateLiteral($)?$.pattern.slice(1,$.pattern.length-1):s.TUnion($)?`(${$.anyOf.map(T=>U(T,y)).join("|")})`:s.TNumber($)?`${y}${e.PatternNumber}`:s.TInteger($)?`${y}${e.PatternNumber}`:s.TBigInt($)?`${y}${e.PatternNumber}`:s.TString($)?`${y}${e.PatternString}`:s.TLiteral($)?`${y}${E($.const.toString())}`:s.TBoolean($)?`${y}${e.PatternBoolean}`:_(`Unexpected Kind '${$[e.Kind]}'`)}function P($){return`^${$.map(y=>U(y,"")).join("")}$`}f.Create=P})(W||(e.TemplateLiteralPattern=W={}));var j;(function(f){function _(E){let U=G.ParseExact(E.pattern);if(!x.Check(U))return e.Type.String();let P=[...L.Generate(U)].map($=>e.Type.Literal($));return e.Type.Union(P)}f.Resolve=_})(j||(e.TemplateLiteralResolver=j={}));var Z=class extends n{};e.TemplateLiteralParserError=Z;var G;(function(f){function _(N,q,te){return N[q]===te&&N.charCodeAt(q-1)!==92}function E(N,q){return _(N,q,"(")}function U(N,q){return _(N,q,")")}function P(N,q){return _(N,q,"|")}function $(N){if(!(E(N,0)&&U(N,N.length-1)))return!1;let q=0;for(let te=0;te<N.length;te++)if(E(N,te)&&(q+=1),U(N,te)&&(q-=1),q===0&&te!==N.length-1)return!1;return!0}function y(N){return N.slice(1,N.length-1)}function T(N){let q=0;for(let te=0;te<N.length;te++)if(E(N,te)&&(q+=1),U(N,te)&&(q-=1),P(N,te)&&q===0)return!0;return!1}function w(N){for(let q=0;q<N.length;q++)if(E(N,q))return!0;return!1}function u(N){let[q,te]=[0,0],ne=[];for(let be=0;be<N.length;be++)if(E(N,be)&&(q+=1),U(N,be)&&(q-=1),P(N,be)&&q===0){let Ue=N.slice(te,be);Ue.length>0&&ne.push(b(Ue)),te=be+1}let ge=N.slice(te);return ge.length>0&&ne.push(b(ge)),ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"or",expr:ne}}function A(N){function q(ge,be){if(!E(ge,be))throw new Z("TemplateLiteralParser: Index must point to open parens");let Ue=0;for(let Fe=be;Fe<ge.length;Fe++)if(E(ge,Fe)&&(Ue+=1),U(ge,Fe)&&(Ue-=1),Ue===0)return[be,Fe];throw new Z("TemplateLiteralParser: Unclosed group parens in expression")}function te(ge,be){for(let Ue=be;Ue<ge.length;Ue++)if(E(ge,Ue))return[be,Ue];return[be,ge.length]}let ne=[];for(let ge=0;ge<N.length;ge++)if(E(N,ge)){let[be,Ue]=q(N,ge),Fe=N.slice(be,Ue+1);ne.push(b(Fe)),ge=Ue}else{let[be,Ue]=te(N,ge),Fe=N.slice(be,Ue);Fe.length>0&&ne.push(b(Fe)),ge=Ue-1}return ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"and",expr:ne}}function b(N){return $(N)?b(y(N)):T(N)?u(N):w(N)?A(N):{type:"const",const:N}}f.Parse=b;function v(N){return b(N.slice(1,N.length-1))}f.ParseExact=v})(G||(e.TemplateLiteralParser=G={}));var fe=class extends n{};e.TemplateLiteralFiniteError=fe;var x;(function(f){function _(y){throw new fe(y)}function E(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="0"&&y.expr[1].type==="const"&&y.expr[1].const==="[1-9][0-9]*"}function U(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="true"&&y.expr[1].type==="const"&&y.expr[1].const==="false"}function P(y){return y.type==="const"&&y.const===".*"}function $(y){return U(y)?!0:E(y)||P(y)?!1:y.type==="and"?y.expr.every(T=>$(T)):y.type==="or"?y.expr.every(T=>$(T)):y.type==="const"?!0:_("Unknown expression type")}f.Check=$})(x||(e.TemplateLiteralFinite=x={}));var M=class extends n{};e.TemplateLiteralGeneratorError=M;var L;(function(f){function*_(y){if(y.length===1)return yield*y[0];for(let T of y[0])for(let w of _(y.slice(1)))yield`${T}${w}`}function*E(y){return yield*_(y.expr.map(T=>[...$(T)]))}function*U(y){for(let T of y.expr)yield*$(T)}function*P(y){return yield y.const}function*$(y){return y.type==="and"?yield*E(y):y.type==="or"?yield*U(y):y.type==="const"?yield*P(y):(()=>{throw new M("Unknown expression")})()}f.Generate=$})(L||(e.TemplateLiteralGenerator=L={}));var ee;(function(f){function*_($){let y=$.trim().replace(/"|'/g,"");return y==="boolean"?yield e.Type.Boolean():y==="number"?yield e.Type.Number():y==="bigint"?yield e.Type.BigInt():y==="string"?yield e.Type.String():yield(()=>{let T=y.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*E($){if($[1]!=="{"){let y=e.Type.Literal("$"),T=U($.slice(1));return yield*[y,...T]}for(let y=2;y<$.length;y++)if($[y]==="}"){let T=_($.slice(2,y)),w=U($.slice(y+1));return yield*[...T,...w]}yield e.Type.Literal($)}function*U($){for(let y=0;y<$.length;y++)if($[y]==="$"){let T=e.Type.Literal($.slice(0,y)),w=E($.slice(y));return yield*[T,...w]}yield e.Type.Literal($)}function P($){return[...U($)]}f.Parse=P})(ee||(e.TemplateLiteralDslParser=ee={}));var oe=class{constructor(f){this.schema=f}Decode(f){return new Q(this.schema,f)}};e.TransformDecodeBuilder=oe;var Q=class{constructor(f,_){this.schema=f,this.decode=_}Encode(f){let _=g.Type(this.schema);return s.TTransform(_)?(()=>{let P={Encode:$=>_[e.Transform].Encode(f($)),Decode:$=>this.decode(_[e.Transform].Decode($))};return{..._,[e.Transform]:P}})():(()=>{let E={Decode:this.decode,Encode:f};return{..._,[e.Transform]:E}})()}};e.TransformEncodeBuilder=Q;var ae=0,D=class extends n{};e.TypeBuilderError=D;var H=class{Create(f){return f}Throw(f){throw new D(f)}Discard(f,_){return _.reduce((E,U)=>{let{[U]:P,...$}=E;return $},f)}Strict(f){return JSON.parse(JSON.stringify(f))}};e.TypeBuilder=H;var Y=class extends H{ReadonlyOptional(f){return this.Readonly(this.Optional(f))}Readonly(f){return{...g.Type(f),[e.Readonly]:"Readonly"}}Optional(f){return{...g.Type(f),[e.Optional]:"Optional"}}Any(f={}){return this.Create({...f,[e.Kind]:"Any"})}Array(f,_={}){return this.Create({..._,[e.Kind]:"Array",type:"array",items:g.Type(f)})}Boolean(f={}){return this.Create({...f,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(f,_={}){return{...I.Map(g.Type(f),"Capitalize"),..._}}Composite(f,_){let E=e.Type.Intersect(f,{}),P=z.ResolveKeys(E,{includePatterns:!1}).reduce(($,y)=>({...$,[y]:e.Type.Index(E,[y])}),{});return e.Type.Object(P,_)}Enum(f,_={}){if(i.IsUndefined(f))return this.Throw("Enum undefined or empty");let E=Object.getOwnPropertyNames(f).filter($=>isNaN($)).map($=>f[$]),P=[...new Set(E)].map($=>e.Type.Literal($));return this.Union(P,{..._,[e.Hint]:"Enum"})}Extends(f,_,E,U,P={}){switch(d.Extends(f,_)){case c.Union:return this.Union([g.Type(E,P),g.Type(U,P)]);case c.True:return g.Type(E,P);case c.False:return g.Type(U,P)}}Exclude(f,_,E={}){return s.TTemplateLiteral(f)?this.Exclude(j.Resolve(f),_,E):s.TTemplateLiteral(_)?this.Exclude(f,j.Resolve(_),E):s.TUnion(f)?(()=>{let U=f.anyOf.filter(P=>d.Extends(P,_)===c.False);return U.length===1?g.Type(U[0],E):this.Union(U,E)})():d.Extends(f,_)!==c.False?this.Never(E):g.Type(f,E)}Extract(f,_,E={}){return s.TTemplateLiteral(f)?this.Extract(j.Resolve(f),_,E):s.TTemplateLiteral(_)?this.Extract(f,j.Resolve(_),E):s.TUnion(f)?(()=>{let U=f.anyOf.filter(P=>d.Extends(P,_)!==c.False);return U.length===1?g.Type(U[0],E):this.Union(U,E)})():d.Extends(f,_)!==c.False?g.Type(f,E):this.Never(E)}Index(f,_,E={}){return s.TArray(f)&&s.TNumber(_)?g.Type(f.items,E):s.TTuple(f)&&s.TNumber(_)?(()=>{let P=(i.IsUndefined(f.items)?[]:f.items).map($=>g.Type($));return this.Union(P,E)})():(()=>{let U=F.Resolve(_),P=g.Type(f);return C.Resolve(P,U,E)})()}Integer(f={}){return this.Create({...f,[e.Kind]:"Integer",type:"integer"})}Intersect(f,_={}){if(f.length===0)return e.Type.Never();if(f.length===1)return g.Type(f[0],_);f.some($=>s.TTransform($))&&this.Throw("Cannot intersect transform types");let E=f.every($=>s.TObject($)),U=g.Rest(f),P=s.TSchema(_.unevaluatedProperties)?{unevaluatedProperties:g.Type(_.unevaluatedProperties)}:{};return _.unevaluatedProperties===!1||s.TSchema(_.unevaluatedProperties)||E?this.Create({..._,...P,[e.Kind]:"Intersect",type:"object",allOf:U}):this.Create({..._,...P,[e.Kind]:"Intersect",allOf:U})}KeyOf(f,_={}){return s.TRecord(f)?(()=>{let E=Object.getOwnPropertyNames(f.patternProperties)[0];return E===e.PatternNumberExact?this.Number(_):E===e.PatternStringExact?this.String(_):this.Throw("Unable to resolve key type from Record key pattern")})():s.TTuple(f)?(()=>{let U=(i.IsUndefined(f.items)?[]:f.items).map((P,$)=>e.Type.Literal($.toString()));return this.Union(U,_)})():s.TArray(f)?this.Number(_):(()=>{let E=z.ResolveKeys(f,{includePatterns:!1});if(E.length===0)return this.Never(_);let U=E.map(P=>this.Literal(P));return this.Union(U,_)})()}Literal(f,_={}){return this.Create({..._,[e.Kind]:"Literal",const:f,type:typeof f})}Lowercase(f,_={}){return{...I.Map(g.Type(f),"Lowercase"),..._}}Never(f={}){return this.Create({...f,[e.Kind]:"Never",not:{}})}Not(f,_){return this.Create({..._,[e.Kind]:"Not",not:g.Type(f)})}Null(f={}){return this.Create({...f,[e.Kind]:"Null",type:"null"})}Number(f={}){return this.Create({...f,[e.Kind]:"Number",type:"number"})}Object(f,_={}){let E=Object.getOwnPropertyNames(f),U=E.filter(T=>s.TOptional(f[T])),P=E.filter(T=>!U.includes(T)),$=s.TSchema(_.additionalProperties)?{additionalProperties:g.Type(_.additionalProperties)}:{},y=E.reduce((T,w)=>({...T,[w]:g.Type(f[w])}),{});return P.length>0?this.Create({..._,...$,[e.Kind]:"Object",type:"object",properties:y,required:P}):this.Create({..._,...$,[e.Kind]:"Object",type:"object",properties:y})}Omit(f,_,E={}){let U=F.Resolve(_);return S.Map(this.Discard(g.Type(f),["$id",e.Transform]),P=>{i.IsArray(P.required)&&(P.required=P.required.filter($=>!U.includes($)),P.required.length===0&&delete P.required);for(let $ of Object.getOwnPropertyNames(P.properties))U.includes($)&&delete P.properties[$];return this.Create(P)},E)}Partial(f,_={}){return S.Map(this.Discard(g.Type(f),["$id",e.Transform]),E=>{let U=Object.getOwnPropertyNames(E.properties).reduce((P,$)=>({...P,[$]:this.Optional(E.properties[$])}),{});return this.Object(U,this.Discard(E,["required"]))},_)}Pick(f,_,E={}){let U=F.Resolve(_);return S.Map(this.Discard(g.Type(f),["$id",e.Transform]),P=>{i.IsArray(P.required)&&(P.required=P.required.filter($=>U.includes($)),P.required.length===0&&delete P.required);for(let $ of Object.getOwnPropertyNames(P.properties))U.includes($)||delete P.properties[$];return this.Create(P)},E)}Record(f,_,E={}){return s.TTemplateLiteral(f)?(()=>{let U=G.ParseExact(f.pattern);return x.Check(U)?this.Object([...L.Generate(U)].reduce((P,$)=>({...P,[$]:g.Type(_)}),{}),E):this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[f.pattern]:g.Type(_)}})})():s.TUnion(f)?(()=>{let U=k.Resolve(f);if(s.TUnionLiteral(U)){let P=U.anyOf.reduce(($,y)=>({...$,[y.const]:g.Type(_)}),{});return this.Object(P,{...E,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():s.TLiteral(f)?i.IsString(f.const)||i.IsNumber(f.const)?this.Object({[f.const]:g.Type(_)},E):this.Throw("Record key of type literal is not of type string or number"):s.TInteger(f)||s.TNumber(f)?this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:g.Type(_)}}):s.TString(f)?(()=>{let U=i.IsUndefined(f.pattern)?e.PatternStringExact:f.pattern;return this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[U]:g.Type(_)}})})():this.Never()}Recursive(f,_={}){i.IsUndefined(_.$id)&&(_.$id=`T${ae++}`);let E=f({[e.Kind]:"This",$ref:`${_.$id}`});return E.$id=_.$id,this.Create({..._,[e.Hint]:"Recursive",...E})}Ref(f,_={}){return i.IsString(f)?this.Create({..._,[e.Kind]:"Ref",$ref:f}):(i.IsUndefined(f.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({..._,[e.Kind]:"Ref",$ref:f.$id}))}Required(f,_={}){return S.Map(this.Discard(g.Type(f),["$id",e.Transform]),E=>{let U=Object.getOwnPropertyNames(E.properties).reduce((P,$)=>({...P,[$]:this.Discard(E.properties[$],[e.Optional])}),{});return this.Object(U,E)},_)}Rest(f){return s.TTuple(f)&&!i.IsUndefined(f.items)?g.Rest(f.items):s.TIntersect(f)?g.Rest(f.allOf):s.TUnion(f)?g.Rest(f.anyOf):[]}String(f={}){return this.Create({...f,[e.Kind]:"String",type:"string"})}TemplateLiteral(f,_={}){let E=i.IsString(f)?W.Create(ee.Parse(f)):W.Create(f);return this.Create({..._,[e.Kind]:"TemplateLiteral",type:"string",pattern:E})}Transform(f){return new oe(f)}Tuple(f,_={}){let[E,U,P]=[!1,f.length,f.length],$=g.Rest(f),y=f.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:$,additionalItems:E,minItems:U,maxItems:P}:{..._,[e.Kind]:"Tuple",type:"array",minItems:U,maxItems:P};return this.Create(y)}Uncapitalize(f,_={}){return{...I.Map(g.Type(f),"Uncapitalize"),..._}}Union(f,_={}){return s.TTemplateLiteral(f)?j.Resolve(f):(()=>{let E=f;if(E.length===0)return this.Never(_);if(E.length===1)return this.Create(g.Type(E[0],_));let U=g.Rest(E);return this.Create({..._,[e.Kind]:"Union",anyOf:U})})()}Unknown(f={}){return this.Create({...f,[e.Kind]:"Unknown"})}Unsafe(f={}){return this.Create({...f,[e.Kind]:f[e.Kind]||"Unsafe"})}Uppercase(f,_={}){return{...I.Map(g.Type(f),"Uppercase"),..._}}};e.JsonTypeBuilder=Y;var he=class extends Y{AsyncIterator(f,_={}){return this.Create({..._,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:g.Type(f)})}Awaited(f,_={}){let E=U=>U.length>0?(()=>{let[P,...$]=U;return[this.Awaited(P),...E($)]})():U;return s.TIntersect(f)?e.Type.Intersect(E(f.allOf)):s.TUnion(f)?e.Type.Union(E(f.anyOf)):s.TPromise(f)?this.Awaited(f.item):g.Type(f,_)}BigInt(f={}){return this.Create({...f,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(f,_={}){return this.Tuple([...f.parameters],{..._})}Constructor(f,_,E){let[U,P]=[g.Rest(f),g.Type(_)];return this.Create({...E,[e.Kind]:"Constructor",type:"Constructor",parameters:U,returns:P})}Date(f={}){return this.Create({...f,[e.Kind]:"Date",type:"Date"})}Function(f,_,E){let[U,P]=[g.Rest(f),g.Type(_)];return this.Create({...E,[e.Kind]:"Function",type:"Function",parameters:U,returns:P})}InstanceType(f,_={}){return g.Type(f.returns,_)}Iterator(f,_={}){return this.Create({..._,[e.Kind]:"Iterator",type:"Iterator",items:g.Type(f)})}Parameters(f,_={}){return this.Tuple(f.parameters,{..._})}Promise(f,_={}){return this.Create({..._,[e.Kind]:"Promise",type:"Promise",item:g.Type(f)})}RegExp(f,_={}){let E=i.IsString(f)?f:f.source;return this.Create({..._,[e.Kind]:"String",type:"string",pattern:E})}RegEx(f,_={}){return this.RegExp(f,_)}ReturnType(f,_={}){return g.Type(f.returns,_)}Symbol(f){return this.Create({...f,[e.Kind]:"Symbol",type:"symbol"})}Undefined(f={}){return this.Create({...f,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(f={}){return this.Create({...f,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(f={}){return this.Create({...f,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=he,e.JsonType=new Y,e.Type=new he}}),fr=mt(en(),1),{String:Xd,Optional:Yd,Boolean:Qd,Object:Zd,Number:ep}=fr.Type,tp=Xd.bind(fr.Type),np=ep.bind(fr.Type),zI=Zd.bind(fr.Type),VI=Yd.bind(fr.Type),rp=Qd.bind(fr.Type),KI=tp(),qI=np(),GI=rp();function tu(e){return Array.isArray(e)?e:[e]}var ip={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,n){return"Cannot apply '"+t+"' to '"+n.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,n){return"[mobx.array] Index out of bounds, "+t+" is larger than "+n},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,n){return"the entry '"+t+"' does not exist in the observable map '"+n+"'"},26:"please specify a property",27:function(t,n){return"no observable property '"+t.toString()+"' found on the observable object '"+n+"'"},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,n){return"Cycle detected in computation "+t+": "+n},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"},op=ip;function ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=typeof e=="string"?e:op[e];throw typeof i=="function"&&(i=i.apply(null,n)),new Error("[MobX] "+i)}var sp={};function Ki(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:sp}var _u=Object.assign,Mi=Object.getOwnPropertyDescriptor,Gt=Object.defineProperty,Gr=Object.prototype,Bi=[];Object.freeze(Bi);var bs={};Object.freeze(bs);var ap=typeof Proxy<"u",up=Object.toString();function wu(){ap||ce("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function zr(e){X.verifyProxies&&ce("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function It(){return++X.mobxGuid}function _s(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var pr=function(){};function je(e){return typeof e=="function"}function Bn(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function qi(e){return e!==null&&typeof e=="object"}function Lt(e){if(!qi(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===up}function Tu(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Gi(e,t,n){Gt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Au(e,t,n){Gt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function mn(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return qi(r)&&r[n]===!0}}function mr(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function cp(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function tn(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Ou=typeof Object.getOwnPropertySymbols<"u";function lp(e){var t=Object.keys(e);if(!Ou)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return Gr.propertyIsEnumerable.call(e,r)})):t}var Wi=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Ou?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function us(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Eu(e){return e===null?null:typeof e=="object"?""+e:e}function Tt(e,t){return Gr.hasOwnProperty.call(e,t)}var fp=Object.getOwnPropertyDescriptors||function(t){var n={};return Wi(t).forEach(function(r){n[r]=Mi(t,r)}),n};function ct(e,t){return!!(e&t)}function lt(e,t,n){return n?e|=t:e&=~t,e}function nu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ru(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pp(r.key),r)}}function vr(e,t,n){return t&&ru(e.prototype,t),n&&ru(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=hp(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}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 on(){return on=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},on.apply(null,arguments)}function Iu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cs(e,t)}function cs(e,t){return cs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},cs(e,t)}function dp(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pp(e){var t=dp(e,"string");return typeof t=="symbol"?t:t+""}function hp(e,t){if(e){if(typeof e=="string")return nu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nu(e,t):void 0}}var st=Symbol("mobx-stored-annotations");function Wt(e){function t(n,r){if(Hr(r))return e.decorate_20223_(n,r);Wr(n,r,e)}return Object.assign(t,e)}function Wr(e,t,n){if(Tt(e,st)||Gi(e,st,on({},e[st])),Di(n)&&!Tt(e[st],t)){var r=e.constructor.name+".prototype."+t.toString();ce("'"+r+"' is decorated with 'override', but no such decorated member was found on prototype.")}yp(e,n,t),Di(n)||(e[st][t]=n)}function yp(e,t,n){if(!Di(t)&&Tt(e[st],n)){var r=e.constructor.name+".prototype."+n.toString(),i=e[st][n].annotationType_,o=t.annotationType_;ce("Cannot apply '@"+o+"' to '"+r+"':"+(`
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 gp(e){return Tt(e,st)||Gi(e,st,on({},e[st])),e[st]}function Hr(e){return typeof e=="object"&&typeof e.kind=="string"}function Hi(e,t){t.includes(e.kind)||ce("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var ve=Symbol("mobx administration"),vn=function(){function e(n){n===void 0&&(n="Atom@"+It()),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Oe.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.reportObserved=function(){return zu(this)},t.reportChanged=function(){_t(),Vu(this),wt()},t.toString=function(){return this.name_},vr(e,[{key:"isBeingObserved",get:function(){return ct(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=lt(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return ct(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=lt(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return ct(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=lt(this.flags_,e.diffValueMask_,r===1)}}])}();vn.isBeingObservedMask_=1;vn.isPendingUnobservationMask_=2;vn.diffValueMask_=4;var bs=mn("Atom",vn);function Eu(e,t,n){t===void 0&&(t=pr),n===void 0&&(n=pr);var r=new vn(e);return t!==pr&&_r(r,t),n!==pr&&zn(r,n),r}function mp(e,t){return e===t}function vp(e,t){return Ss(e,t)}function bp(e,t){return Ss(e,t,1)}function _p(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ze={identity:mp,structural:vp,default:_p,shallow:bp};function Dn(e,t,n){return gr(e)?e:Array.isArray(e)?Ce.array(e,{name:n}):Lt(e)?Ce.object(e,void 0,{name:n}):mr(e)?Ce.map(e,{name:n}):tn(e)?Ce.set(e,{name:n}):typeof e=="function"&&!gn(e)&&!qr(e)?_u(e)?yr(e):Kr(n,e):e}function wp(e,t,n){if(e==null||jn(e)||wr(e)||Ht(e)||Ut(e))return e;if(Array.isArray(e))return Ce.array(e,{name:n,deep:!1});if(Lt(e))return Ce.object(e,void 0,{name:n,deep:!1});if(mr(e))return Ce.map(e,{name:n,deep:!1});if(tn(e))return Ce.set(e,{name:n,deep:!1});ce("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function Ji(e){return e}function Tp(e,t){return gr(e)&&ce("observable.struct should not be used with observable values"),Ss(e,t)?t:e}var Ap="override";function Di(e){return e.annotationType_===Ap}function Jr(e,t){return{annotationType_:e,options_:t,make_:Op,extend_:Ep,decorate_20223_:Ip}}function Op(e,t,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,n,!1)===null?0:1;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if(gn(n.value))return 1;var o=Iu(e,this,t,n,!1);return Gt(r,t,o),2}function Ep(e,t,n,r){var i=Iu(e,this,t,n);return e.defineProperty_(t,i,r)}function Ip(e,t){Hi(t,["method","field"]);var n=t.kind,r=t.name,i=t.addInitializer,o=this,s=function(c){var d,g,C,I;return Ln((d=(g=o.options_)==null?void 0:g.name)!=null?d:r.toString(),c,(C=(I=o.options_)==null?void 0:I.autoAction)!=null?C:!1)};if(n=="field")return function(l){var c,d=l;return gn(d)||(d=s(d)),(c=o.options_)!=null&&c.bound&&(d=d.bind(this),d.isMobxAction=!0),d};if(n=="method"){var a;return gn(e)||(e=s(e)),(a=this.options_)!=null&&a.bound&&i(function(){var l=this,c=l[r].bind(l);c.isMobxAction=!0,l[r]=c}),e}ce("Cannot apply '"+o.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
5
+ Use '@override' decorator for methods overridden by subclass.`)}}function gp(e){return Tt(e,st)||Gi(e,st,on({},e[st])),e[st]}function Hr(e){return typeof e=="object"&&typeof e.kind=="string"}function Hi(e,t){t.includes(e.kind)||ce("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var ve=Symbol("mobx administration"),vn=function(){function e(n){n===void 0&&(n="Atom@"+It()),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Oe.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.reportObserved=function(){return Ku(this)},t.reportChanged=function(){_t(),qu(this),wt()},t.toString=function(){return this.name_},vr(e,[{key:"isBeingObserved",get:function(){return ct(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=lt(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return ct(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=lt(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return ct(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=lt(this.flags_,e.diffValueMask_,r===1)}}])}();vn.isBeingObservedMask_=1;vn.isPendingUnobservationMask_=2;vn.diffValueMask_=4;var ws=mn("Atom",vn);function Su(e,t,n){t===void 0&&(t=pr),n===void 0&&(n=pr);var r=new vn(e);return t!==pr&&_r(r,t),n!==pr&&zn(r,n),r}function mp(e,t){return e===t}function vp(e,t){return Ns(e,t)}function bp(e,t){return Ns(e,t,1)}function _p(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ze={identity:mp,structural:vp,default:_p,shallow:bp};function Dn(e,t,n){return gr(e)?e:Array.isArray(e)?Ce.array(e,{name:n}):Lt(e)?Ce.object(e,void 0,{name:n}):mr(e)?Ce.map(e,{name:n}):tn(e)?Ce.set(e,{name:n}):typeof e=="function"&&!gn(e)&&!qr(e)?Tu(e)?yr(e):Kr(n,e):e}function wp(e,t,n){if(e==null||jn(e)||wr(e)||Ht(e)||Ut(e))return e;if(Array.isArray(e))return Ce.array(e,{name:n,deep:!1});if(Lt(e))return Ce.object(e,void 0,{name:n,deep:!1});if(mr(e))return Ce.map(e,{name:n,deep:!1});if(tn(e))return Ce.set(e,{name:n,deep:!1});ce("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function Ji(e){return e}function Tp(e,t){return gr(e)&&ce("observable.struct should not be used with observable values"),Ns(e,t)?t:e}var Ap="override";function Di(e){return e.annotationType_===Ap}function Jr(e,t){return{annotationType_:e,options_:t,make_:Op,extend_:Ep,decorate_20223_:Ip}}function Op(e,t,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,n,!1)===null?0:1;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if(gn(n.value))return 1;var o=$u(e,this,t,n,!1);return Gt(r,t,o),2}function Ep(e,t,n,r){var i=$u(e,this,t,n);return e.defineProperty_(t,i,r)}function Ip(e,t){Hi(t,["method","field"]);var n=t.kind,r=t.name,i=t.addInitializer,o=this,s=function(c){var d,g,C,I;return Ln((d=(g=o.options_)==null?void 0:g.name)!=null?d:r.toString(),c,(C=(I=o.options_)==null?void 0:I.autoAction)!=null?C:!1)};if(n=="field")return function(l){var c,d=l;return gn(d)||(d=s(d)),(c=o.options_)!=null&&c.bound&&(d=d.bind(this),d.isMobxAction=!0),d};if(n=="method"){var a;return gn(e)||(e=s(e)),(a=this.options_)!=null&&a.bound&&i(function(){var l=this,c=l[r].bind(l);c.isMobxAction=!0,l[r]=c}),e}ce("Cannot apply '"+o.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
6
6
  '`+o.annotationType_+"' can only be used on properties with a function value."))}function Sp(e,t,n,r){var i=t.annotationType_,o=r.value;je(o)||ce("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
7
- '`+i+"' can only be used on properties with a function value."))}function Iu(e,t,n,r,i){var o,s,a,l,c,d,g;i===void 0&&(i=X.safeDescriptors),Sp(e,t,n,r);var C=r.value;if((o=t.options_)!=null&&o.bound){var I;C=C.bind((I=e.proxy_)!=null?I:e.target_)}return{value:Ln((s=(a=t.options_)==null?void 0:a.name)!=null?s:n.toString(),C,(l=(c=t.options_)==null?void 0:c.autoAction)!=null?l:!1,(d=t.options_)!=null&&d.bound?(g=e.proxy_)!=null?g:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Su(e,t){return{annotationType_:e,options_:t,make_:$p,extend_:Np,decorate_20223_:Rp}}function $p(e,t,n,r){var i;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!Tt(e.target_,t)||!qr(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(qr(n.value))return 1;var o=$u(e,this,t,n,!1,!1);return Gt(r,t,o),2}function Np(e,t,n,r){var i,o=$u(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,o,r)}function Rp(e,t){var n;Hi(t,["method"]);var r=t.name,i=t.addInitializer;return qr(e)||(e=yr(e)),(n=this.options_)!=null&&n.bound&&i(function(){var o=this,s=o[r].bind(o);s.isMobXFlow=!0,o[r]=s}),e}function Pp(e,t,n,r){var i=t.annotationType_,o=r.value;je(o)||ce("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
8
- '`+i+"' can only be used on properties with a generator function value."))}function $u(e,t,n,r,i,o){o===void 0&&(o=X.safeDescriptors),Pp(e,t,n,r);var s=r.value;if(qr(s)||(s=yr(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 _s(e,t){return{annotationType_:e,options_:t,make_:Cp,extend_:xp,decorate_20223_:Up}}function Cp(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function xp(e,t,n,r){return Mp(e,this,t,n),e.defineComputedProperty_(t,on({},this.options_,{get:n.get,set:n.set}),r)}function Up(e,t){Hi(t,["getter"]);var n=this,r=t.name,i=t.addInitializer;return i(function(){var o=Tr(this)[ve],s=on({},n.options_,{get:e,context:this});s.name||(s.name=o.name_+"."+r.toString()),o.values_.set(r,new Ot(s))}),function(){return this[ve].getObservablePropValue_(r)}}function Mp(e,t,n,r){var i=t.annotationType_,o=r.get;o||ce("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
7
+ '`+i+"' can only be used on properties with a function value."))}function $u(e,t,n,r,i){var o,s,a,l,c,d,g;i===void 0&&(i=X.safeDescriptors),Sp(e,t,n,r);var C=r.value;if((o=t.options_)!=null&&o.bound){var I;C=C.bind((I=e.proxy_)!=null?I:e.target_)}return{value:Ln((s=(a=t.options_)==null?void 0:a.name)!=null?s:n.toString(),C,(l=(c=t.options_)==null?void 0:c.autoAction)!=null?l:!1,(d=t.options_)!=null&&d.bound?(g=e.proxy_)!=null?g:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Nu(e,t){return{annotationType_:e,options_:t,make_:$p,extend_:Np,decorate_20223_:Rp}}function $p(e,t,n,r){var i;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!Tt(e.target_,t)||!qr(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(qr(n.value))return 1;var o=Ru(e,this,t,n,!1,!1);return Gt(r,t,o),2}function Np(e,t,n,r){var i,o=Ru(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,o,r)}function Rp(e,t){var n;Hi(t,["method"]);var r=t.name,i=t.addInitializer;return qr(e)||(e=yr(e)),(n=this.options_)!=null&&n.bound&&i(function(){var o=this,s=o[r].bind(o);s.isMobXFlow=!0,o[r]=s}),e}function Pp(e,t,n,r){var i=t.annotationType_,o=r.value;je(o)||ce("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
8
+ '`+i+"' can only be used on properties with a generator function value."))}function Ru(e,t,n,r,i,o){o===void 0&&(o=X.safeDescriptors),Pp(e,t,n,r);var s=r.value;if(qr(s)||(s=yr(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 Ts(e,t){return{annotationType_:e,options_:t,make_:Cp,extend_:xp,decorate_20223_:Up}}function Cp(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function xp(e,t,n,r){return Mp(e,this,t,n),e.defineComputedProperty_(t,on({},this.options_,{get:n.get,set:n.set}),r)}function Up(e,t){Hi(t,["getter"]);var n=this,r=t.name,i=t.addInitializer;return i(function(){var o=Tr(this)[ve],s=on({},n.options_,{get:e,context:this});s.name||(s.name=o.name_+"."+r.toString()),o.values_.set(r,new Ot(s))}),function(){return this[ve].getObservablePropValue_(r)}}function Mp(e,t,n,r){var i=t.annotationType_,o=r.get;o||ce("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
9
9
  '`+i+"' can only be used on getter(+setter) properties."))}function Xi(e,t){return{annotationType_:e,options_:t,make_:Bp,extend_:Dp,decorate_20223_:Lp}}function Bp(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Dp(e,t,n,r){var i,o;return kp(e,this,t,n),e.defineObservableProperty_(t,n.value,(i=(o=this.options_)==null?void 0:o.enhancer)!=null?i:Dn,r)}function Lp(e,t){if(t.kind==="field")throw ce("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");Hi(t,["accessor"]);var n=this,r=t.kind,i=t.name,o=new WeakSet;function s(a,l){var c,d,g=Tr(a)[ve],C=new yn(l,(c=(d=n.options_)==null?void 0:d.enhancer)!=null?c:Dn,g.name_+"."+i.toString(),!1);g.values_.set(i,C),o.add(a)}if(r=="accessor")return{get:function(){return o.has(this)||s(this,e.get.call(this)),this[ve].getObservablePropValue_(i)},set:function(l){return o.has(this)||s(this,l),this[ve].setObservablePropValue_(i,l)},init:function(l){return o.has(this)||s(this,l),l}}}function kp(e,t,n,r){var i=t.annotationType_;"value"in r||ce("Cannot apply '"+i+"' to '"+e.name_+"."+n.toString()+"':"+(`
10
- '`+i+"' cannot be used on getter/setter properties"))}var jp="true",Fp=Nu();function Nu(e){return{annotationType_:jp,options_:e,make_:zp,extend_:Vp,decorate_20223_:Kp}}function zp(e,t,n,r){var i,o;if(n.get)return Le.make_(e,t,n,r);if(n.set){var s=Ln(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:X.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(Gt(r,t,{configurable:!0,set:s}),2)}if(r!==e.target_&&typeof n.value=="function"){var a;if(_u(n.value)){var l,c=(l=this.options_)!=null&&l.autoBind?yr.bound:yr;return c.make_(e,t,n,r)}var d=(a=this.options_)!=null&&a.autoBind?Kr.bound:Kr;return d.make_(e,t,n,r)}var g=((i=this.options_)==null?void 0:i.deep)===!1?Ce.ref:Ce;if(typeof n.value=="function"&&(o=this.options_)!=null&&o.autoBind){var C;n.value=n.value.bind((C=e.proxy_)!=null?C:e.target_)}return g.make_(e,t,n,r)}function Vp(e,t,n,r){var i,o;if(n.get)return Le.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:X.safeDescriptors?e.isPlainObject_:!0,set:Ln(t.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var s;n.value=n.value.bind((s=e.proxy_)!=null?s:e.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?Ce.ref:Ce;return a.extend_(e,t,n,r)}function Kp(e,t){ce("'"+this.annotationType_+"' cannot be used as a decorator")}var qp="observable",Gp="observable.ref",Wp="observable.shallow",Hp="observable.struct",Ru={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Ru);function $i(e){return e||Ru}var us=Xi(qp),Jp=Xi(Gp,{enhancer:Ji}),Xp=Xi(Wp,{enhancer:wp}),Yp=Xi(Hp,{enhancer:Tp}),Pu=Wt(us);function Ni(e){return e.deep===!0?Dn:e.deep===!1?Ji:Zp(e.defaultDecorator)}function Qp(e){var t;return e?(t=e.defaultDecorator)!=null?t:Nu(e):void 0}function Zp(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:Dn}function Cu(e,t,n){if(Hr(t))return us.decorate_20223_(e,t);if(Bn(t)){Wr(e,t,us);return}return gr(e)?e:Lt(e)?Ce.object(e,t,n):Array.isArray(e)?Ce.array(e,t):mr(e)?Ce.map(e,t):tn(e)?Ce.set(e,t):typeof e=="object"&&e!==null?e:Ce.box(e,t)}vu(Cu,Pu);var eh={box:function(t,n){var r=$i(n);return new yn(t,Ni(r),r.name,!0,r.equals)},array:function(t,n){var r=$i(n);return(X.useProxies===!1||r.proxy===!1?ey:Kh)(t,Ni(r),r.name)},map:function(t,n){var r=$i(n);return new ic(t,Ni(r),r.name)},set:function(t,n){var r=$i(n);return new oc(t,Ni(r),r.name)},object:function(t,n,r){return Vn(function(){return xh(X.useProxies===!1||r?.proxy===!1?Tr({},r):Fh({},r),t,n)})},ref:Wt(Jp),shallow:Wt(Xp),deep:Pu,struct:Wt(Yp)},Ce=vu(Cu,eh),xu="computed",th="computed.struct",cs=_s(xu),nh=_s(th,{equals:ze.structural}),Le=function(t,n){if(Hr(n))return cs.decorate_20223_(t,n);if(Bn(n))return Wr(t,n,cs);if(Lt(t))return Wt(_s(xu,t));je(t)||ce("First argument to `computed` should be an expression."),je(n)&&ce("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var r=Lt(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new Ot(r)};Object.assign(Le,cs);Le.struct=Wt(nh);var nu,ru,Li=0,rh=1,ih=(nu=(ru=Mi(function(){},"name"))==null?void 0:ru.configurable)!=null?nu:!1,iu={value:"action",configurable:!0,writable:!1,enumerable:!1};function Ln(e,t,n,r){n===void 0&&(n=!1),je(t)||ce("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&ce("actions should have valid names, got: '"+e+"'");function i(){return Uu(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},ih&&(iu.value=e,Gt(i,"name",iu)),i}function Uu(e,t,n,r,i){var o=oh(e,t,r,i);try{return n.apply(r,i)}catch(s){throw o.error_=s,s}finally{sh(o)}}function oh(e,t,n,r){var i=Xe()&&!!e,o=0;if(i){o=Date.now();var s=r?Array.from(r):Bi;ft({type:Ts,name:e,object:n,arguments:s})}var a=X.trackingDerivation,l=!t||!a;_t();var c=X.allowStateChanges;l&&(Fn(),c=Yi(!0));var d=ws(!0),g={runAsAction_:l,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:d,notifySpy_:i,startTime_:o,actionId_:rh++,parentActionId_:Li};return Li=g.actionId_,g}function sh(e){Li!==e.actionId_&&ce(30),Li=e.parentActionId_,e.error_!==void 0&&(X.suppressReactionErrors=!0),Qi(e.prevAllowStateChanges_),Vr(e.prevAllowStateReads_),wt(),e.runAsAction_&&rn(e.prevDerivation_),e.notifySpy_&&dt({time:Date.now()-e.startTime_}),X.suppressReactionErrors=!1}function ah(e,t){var n=Yi(e);try{return t()}finally{Qi(n)}}function Yi(e){var t=X.allowStateChanges;return X.allowStateChanges=e,t}function Qi(e){X.allowStateChanges=e}var uh="create",yn=function(e){function t(r,i,o,s,a){var l;return o===void 0&&(o="ObservableValue@"+It()),s===void 0&&(s=!0),a===void 0&&(a=ze.default),l=e.call(this,o)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=i,l.name_=o,l.equals=a,l.value_=i(r,void 0,o),s&&Xe()&&kn({type:uh,object:l,observableKind:"value",debugObjectName:l.name_,newValue:""+l.value_}),l}Ou(t,e);var n=t.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){var o=this.value_;if(i=this.prepareNewValue_(i),i!==X.UNCHANGED){var s=Xe();s&&ft({type:Mt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:o}),this.setNewValue_(i),s&&dt()}},n.prepareNewValue_=function(i){if(qt(this),vt(this)){var o=bt(this,{object:this,type:Mt,newValue:i});if(!o)return X.UNCHANGED;i=o.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?X.UNCHANGED:i},n.setNewValue_=function(i){var o=this.value_;this.value_=i,this.reportChanged(),Bt(this)&&Dt(this,{type:Mt,object:this,newValue:i,oldValue:o})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return Zr(this,i)},n.observe_=function(i,o){return o&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Mt,newValue:this.value_,oldValue:void 0}),ei(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Au(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(vn),ch=mn("ObservableValue",yn),Ot=function(){function e(n){this.dependenciesState_=Oe.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Oe.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ki(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=At.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,n.get||ce(31),this.derivation=n.get,this.name_=n.name||"ComputedValue@"+It(),n.set&&(this.setter_=Ln(this.name_+"-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?ze.structural:ze.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){vh(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.get=function(){if(this.isComputing&&ce(32,this.name_,this.derivation),X.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)ls(this)&&(this.warnAboutUntrackedRead_(),_t(),this.value_=this.computeValue_(!1),wt());else if(zu(this),ls(this)){var r=X.trackingContext;this.keepAlive_&&!r&&(X.trackingContext=this),this.trackAndCompute()&&mh(this),X.trackingContext=r}var i=this.value_;if(Ci(i))throw i.cause;return i},t.set=function(r){if(this.setter_){this.isRunningSetter&&ce(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else ce(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===Oe.NOT_TRACKING_,o=this.computeValue_(!0),s=i||Ci(r)||Ci(o)||!this.equals_(r,o);return s&&(this.value_=o,Xe()&&kn({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:r,newValue:o})),s},t.computeValue_=function(r){this.isComputing=!0;var i=Yi(!1),o;if(r)o=Bu(this,this.derivation,this.scope_);else if(X.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(s){o=new ki(s)}return Qi(i),this.isComputing=!1,o},t.suspend_=function(){this.keepAlive_||(fs(this),this.value_=void 0,this.isTracing_!==At.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(r,i){var o=this,s=!0,a=void 0;return St(function(){var l=o.get();if(!s||i){var c=Fn();r({observableKind:"computed",debugObjectName:o.name_,type:Mt,object:o,newValue:l,oldValue:a}),rn(c)}s=!1,a=l})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==At.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_:X.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 Au(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},vr(e,[{key:"isComputing",get:function(){return ct(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=lt(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return ct(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=lt(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return ct(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=lt(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return ct(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=lt(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return ct(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=lt(this.flags_,e.diffValueMask_,r===1)}}])}();Ot.isComputingMask_=1;Ot.isRunningSetterMask_=2;Ot.isBeingObservedMask_=4;Ot.isPendingUnobservationMask_=8;Ot.diffValueMask_=16;var Xr=mn("ComputedValue",Ot),Oe;(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_"})(Oe||(Oe={}));var At;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(At||(At={}));var ki=function(t){this.cause=void 0,this.cause=t};function Ci(e){return e instanceof ki}function ls(e){switch(e.dependenciesState_){case Oe.UP_TO_DATE_:return!1;case Oe.NOT_TRACKING_:case Oe.STALE_:return!0;case Oe.POSSIBLY_STALE_:{for(var t=ws(!0),n=Fn(),r=e.observing_,i=r.length,o=0;o<i;o++){var s=r[o];if(Xr(s)){if(X.disableErrorBoundaries)s.get();else try{s.get()}catch{return rn(n),Vr(t),!0}if(e.dependenciesState_===Oe.STALE_)return rn(n),Vr(t),!0}}return Du(e),rn(n),Vr(t),!1}}}function Mu(){return X.trackingDerivation!==null}function qt(e){var t=e.observers_.size>0;!X.allowStateChanges&&(t||X.enforceActions==="always")&&console.warn("[MobX] "+(X.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 lh(e){!X.allowStateReads&&X.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Bu(e,t,n){var r=ws(!0);Du(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++X.runId;var i=X.trackingDerivation;X.trackingDerivation=e,X.inBatch++;var o;if(X.disableErrorBoundaries===!0)o=t.call(n);else try{o=t.call(n)}catch(s){o=new ki(s)}return X.inBatch--,X.trackingDerivation=i,dh(e),fh(e),Vr(r),o}function fh(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:X.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function dh(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=Oe.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,s=0;s<o;s++){var a=n[s];a.diffValue===0&&(a.diffValue=1,i!==s&&(n[i]=a),i++),a.dependenciesState_>r&&(r=a.dependenciesState_)}for(n.length=i,e.newObserving_=null,o=t.length;o--;){var l=t[o];l.diffValue===0&&ju(l,e),l.diffValue=0}for(;i--;){var c=n[i];c.diffValue===1&&(c.diffValue=0,gh(c,e))}r!==Oe.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function fs(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)ju(t[n],e);e.dependenciesState_=Oe.NOT_TRACKING_}function Pe(e){var t=Fn();try{return e()}finally{rn(t)}}function Fn(){var e=X.trackingDerivation;return X.trackingDerivation=null,e}function rn(e){X.trackingDerivation=e}function ws(e){var t=X.allowStateReads;return X.allowStateReads=e,t}function Vr(e){X.allowStateReads=e}function Du(e){if(e.dependenciesState_!==Oe.UP_TO_DATE_){e.dependenciesState_=Oe.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Oe.UP_TO_DATE_}}var xi=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},Ui=!0,Lu=!1,X=function(){var e=Ki();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ui=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new xi().version&&(Ui=!1),Ui?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new xi):(setTimeout(function(){Lu||ce(35)},1),new xi)}();function ph(){if((X.pendingReactions.length||X.inBatch||X.isRunningReactions)&&ce(36),Lu=!0,Ui){var e=Ki();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),X=new xi}}function ku(){return X}function hh(e){return e.observers_&&e.observers_.size>0}function yh(e){return e.observers_}function gh(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function ju(e,t){e.observers_.delete(t),e.observers_.size===0&&Fu(e)}function Fu(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,X.pendingUnobservations.push(e))}function _t(){X.inBatch++}function wt(){if(--X.inBatch===0){Gu();for(var e=X.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof Ot&&n.suspend_())}X.pendingUnobservations=[]}}function zu(e){lh(e);var t=X.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&X.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&X.inBatch>0&&Fu(e),!1)}function Vu(e){e.lowestObserverState_!==Oe.STALE_&&(e.lowestObserverState_=Oe.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Oe.UP_TO_DATE_&&(t.isTracing_!==At.NONE&&Ku(t,e),t.onBecomeStale_()),t.dependenciesState_=Oe.STALE_}))}function mh(e){e.lowestObserverState_!==Oe.STALE_&&(e.lowestObserverState_=Oe.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Oe.POSSIBLY_STALE_?(t.dependenciesState_=Oe.STALE_,t.isTracing_!==At.NONE&&Ku(t,e)):t.dependenciesState_===Oe.UP_TO_DATE_&&(e.lowestObserverState_=Oe.UP_TO_DATE_)}))}function vh(e){e.lowestObserverState_===Oe.UP_TO_DATE_&&(e.lowestObserverState_=Oe.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Oe.UP_TO_DATE_&&(t.dependenciesState_=Oe.POSSIBLY_STALE_,t.onBecomeStale_())}))}function Ku(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===At.BREAK){var n=[];qu(Yr(e),n,1),new Function(`debugger;
10
+ '`+i+"' cannot be used on getter/setter properties"))}var jp="true",Fp=Pu();function Pu(e){return{annotationType_:jp,options_:e,make_:zp,extend_:Vp,decorate_20223_:Kp}}function zp(e,t,n,r){var i,o;if(n.get)return Le.make_(e,t,n,r);if(n.set){var s=Ln(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:X.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(Gt(r,t,{configurable:!0,set:s}),2)}if(r!==e.target_&&typeof n.value=="function"){var a;if(Tu(n.value)){var l,c=(l=this.options_)!=null&&l.autoBind?yr.bound:yr;return c.make_(e,t,n,r)}var d=(a=this.options_)!=null&&a.autoBind?Kr.bound:Kr;return d.make_(e,t,n,r)}var g=((i=this.options_)==null?void 0:i.deep)===!1?Ce.ref:Ce;if(typeof n.value=="function"&&(o=this.options_)!=null&&o.autoBind){var C;n.value=n.value.bind((C=e.proxy_)!=null?C:e.target_)}return g.make_(e,t,n,r)}function Vp(e,t,n,r){var i,o;if(n.get)return Le.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:X.safeDescriptors?e.isPlainObject_:!0,set:Ln(t.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var s;n.value=n.value.bind((s=e.proxy_)!=null?s:e.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?Ce.ref:Ce;return a.extend_(e,t,n,r)}function Kp(e,t){ce("'"+this.annotationType_+"' cannot be used as a decorator")}var qp="observable",Gp="observable.ref",Wp="observable.shallow",Hp="observable.struct",Cu={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Cu);function $i(e){return e||Cu}var ls=Xi(qp),Jp=Xi(Gp,{enhancer:Ji}),Xp=Xi(Wp,{enhancer:wp}),Yp=Xi(Hp,{enhancer:Tp}),xu=Wt(ls);function Ni(e){return e.deep===!0?Dn:e.deep===!1?Ji:Zp(e.defaultDecorator)}function Qp(e){var t;return e?(t=e.defaultDecorator)!=null?t:Pu(e):void 0}function Zp(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:Dn}function Uu(e,t,n){if(Hr(t))return ls.decorate_20223_(e,t);if(Bn(t)){Wr(e,t,ls);return}return gr(e)?e:Lt(e)?Ce.object(e,t,n):Array.isArray(e)?Ce.array(e,t):mr(e)?Ce.map(e,t):tn(e)?Ce.set(e,t):typeof e=="object"&&e!==null?e:Ce.box(e,t)}_u(Uu,xu);var eh={box:function(t,n){var r=$i(n);return new yn(t,Ni(r),r.name,!0,r.equals)},array:function(t,n){var r=$i(n);return(X.useProxies===!1||r.proxy===!1?ey:Kh)(t,Ni(r),r.name)},map:function(t,n){var r=$i(n);return new sc(t,Ni(r),r.name)},set:function(t,n){var r=$i(n);return new ac(t,Ni(r),r.name)},object:function(t,n,r){return Vn(function(){return xh(X.useProxies===!1||r?.proxy===!1?Tr({},r):Fh({},r),t,n)})},ref:Wt(Jp),shallow:Wt(Xp),deep:xu,struct:Wt(Yp)},Ce=_u(Uu,eh),Mu="computed",th="computed.struct",fs=Ts(Mu),nh=Ts(th,{equals:ze.structural}),Le=function(t,n){if(Hr(n))return fs.decorate_20223_(t,n);if(Bn(n))return Wr(t,n,fs);if(Lt(t))return Wt(Ts(Mu,t));je(t)||ce("First argument to `computed` should be an expression."),je(n)&&ce("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var r=Lt(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new Ot(r)};Object.assign(Le,fs);Le.struct=Wt(nh);var iu,ou,Li=0,rh=1,ih=(iu=(ou=Mi(function(){},"name"))==null?void 0:ou.configurable)!=null?iu:!1,su={value:"action",configurable:!0,writable:!1,enumerable:!1};function Ln(e,t,n,r){n===void 0&&(n=!1),je(t)||ce("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&ce("actions should have valid names, got: '"+e+"'");function i(){return Bu(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},ih&&(su.value=e,Gt(i,"name",su)),i}function Bu(e,t,n,r,i){var o=oh(e,t,r,i);try{return n.apply(r,i)}catch(s){throw o.error_=s,s}finally{sh(o)}}function oh(e,t,n,r){var i=Xe()&&!!e,o=0;if(i){o=Date.now();var s=r?Array.from(r):Bi;ft({type:Os,name:e,object:n,arguments:s})}var a=X.trackingDerivation,l=!t||!a;_t();var c=X.allowStateChanges;l&&(Fn(),c=Yi(!0));var d=As(!0),g={runAsAction_:l,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:d,notifySpy_:i,startTime_:o,actionId_:rh++,parentActionId_:Li};return Li=g.actionId_,g}function sh(e){Li!==e.actionId_&&ce(30),Li=e.parentActionId_,e.error_!==void 0&&(X.suppressReactionErrors=!0),Qi(e.prevAllowStateChanges_),Vr(e.prevAllowStateReads_),wt(),e.runAsAction_&&rn(e.prevDerivation_),e.notifySpy_&&dt({time:Date.now()-e.startTime_}),X.suppressReactionErrors=!1}function ah(e,t){var n=Yi(e);try{return t()}finally{Qi(n)}}function Yi(e){var t=X.allowStateChanges;return X.allowStateChanges=e,t}function Qi(e){X.allowStateChanges=e}var uh="create",yn=function(e){function t(r,i,o,s,a){var l;return o===void 0&&(o="ObservableValue@"+It()),s===void 0&&(s=!0),a===void 0&&(a=ze.default),l=e.call(this,o)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=i,l.name_=o,l.equals=a,l.value_=i(r,void 0,o),s&&Xe()&&kn({type:uh,object:l,observableKind:"value",debugObjectName:l.name_,newValue:""+l.value_}),l}Iu(t,e);var n=t.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){var o=this.value_;if(i=this.prepareNewValue_(i),i!==X.UNCHANGED){var s=Xe();s&&ft({type:Mt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:o}),this.setNewValue_(i),s&&dt()}},n.prepareNewValue_=function(i){if(qt(this),vt(this)){var o=bt(this,{object:this,type:Mt,newValue:i});if(!o)return X.UNCHANGED;i=o.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?X.UNCHANGED:i},n.setNewValue_=function(i){var o=this.value_;this.value_=i,this.reportChanged(),Bt(this)&&Dt(this,{type:Mt,object:this,newValue:i,oldValue:o})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return Zr(this,i)},n.observe_=function(i,o){return o&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Mt,newValue:this.value_,oldValue:void 0}),ei(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Eu(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(vn),ch=mn("ObservableValue",yn),Ot=function(){function e(n){this.dependenciesState_=Oe.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Oe.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ki(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=At.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,n.get||ce(31),this.derivation=n.get,this.name_=n.name||"ComputedValue@"+It(),n.set&&(this.setter_=Ln(this.name_+"-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?ze.structural:ze.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){vh(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.get=function(){if(this.isComputing&&ce(32,this.name_,this.derivation),X.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)ds(this)&&(this.warnAboutUntrackedRead_(),_t(),this.value_=this.computeValue_(!1),wt());else if(Ku(this),ds(this)){var r=X.trackingContext;this.keepAlive_&&!r&&(X.trackingContext=this),this.trackAndCompute()&&mh(this),X.trackingContext=r}var i=this.value_;if(Ci(i))throw i.cause;return i},t.set=function(r){if(this.setter_){this.isRunningSetter&&ce(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else ce(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===Oe.NOT_TRACKING_,o=this.computeValue_(!0),s=i||Ci(r)||Ci(o)||!this.equals_(r,o);return s&&(this.value_=o,Xe()&&kn({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:r,newValue:o})),s},t.computeValue_=function(r){this.isComputing=!0;var i=Yi(!1),o;if(r)o=Lu(this,this.derivation,this.scope_);else if(X.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(s){o=new ki(s)}return Qi(i),this.isComputing=!1,o},t.suspend_=function(){this.keepAlive_||(ps(this),this.value_=void 0,this.isTracing_!==At.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(r,i){var o=this,s=!0,a=void 0;return St(function(){var l=o.get();if(!s||i){var c=Fn();r({observableKind:"computed",debugObjectName:o.name_,type:Mt,object:o,newValue:l,oldValue:a}),rn(c)}s=!1,a=l})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==At.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_:X.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 Eu(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},vr(e,[{key:"isComputing",get:function(){return ct(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=lt(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return ct(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=lt(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return ct(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=lt(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return ct(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=lt(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return ct(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=lt(this.flags_,e.diffValueMask_,r===1)}}])}();Ot.isComputingMask_=1;Ot.isRunningSetterMask_=2;Ot.isBeingObservedMask_=4;Ot.isPendingUnobservationMask_=8;Ot.diffValueMask_=16;var Xr=mn("ComputedValue",Ot),Oe;(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_"})(Oe||(Oe={}));var At;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(At||(At={}));var ki=function(t){this.cause=void 0,this.cause=t};function Ci(e){return e instanceof ki}function ds(e){switch(e.dependenciesState_){case Oe.UP_TO_DATE_:return!1;case Oe.NOT_TRACKING_:case Oe.STALE_:return!0;case Oe.POSSIBLY_STALE_:{for(var t=As(!0),n=Fn(),r=e.observing_,i=r.length,o=0;o<i;o++){var s=r[o];if(Xr(s)){if(X.disableErrorBoundaries)s.get();else try{s.get()}catch{return rn(n),Vr(t),!0}if(e.dependenciesState_===Oe.STALE_)return rn(n),Vr(t),!0}}return ku(e),rn(n),Vr(t),!1}}}function Du(){return X.trackingDerivation!==null}function qt(e){var t=e.observers_.size>0;!X.allowStateChanges&&(t||X.enforceActions==="always")&&console.warn("[MobX] "+(X.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 lh(e){!X.allowStateReads&&X.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Lu(e,t,n){var r=As(!0);ku(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++X.runId;var i=X.trackingDerivation;X.trackingDerivation=e,X.inBatch++;var o;if(X.disableErrorBoundaries===!0)o=t.call(n);else try{o=t.call(n)}catch(s){o=new ki(s)}return X.inBatch--,X.trackingDerivation=i,dh(e),fh(e),Vr(r),o}function fh(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:X.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function dh(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=Oe.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,s=0;s<o;s++){var a=n[s];a.diffValue===0&&(a.diffValue=1,i!==s&&(n[i]=a),i++),a.dependenciesState_>r&&(r=a.dependenciesState_)}for(n.length=i,e.newObserving_=null,o=t.length;o--;){var l=t[o];l.diffValue===0&&zu(l,e),l.diffValue=0}for(;i--;){var c=n[i];c.diffValue===1&&(c.diffValue=0,gh(c,e))}r!==Oe.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function ps(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)zu(t[n],e);e.dependenciesState_=Oe.NOT_TRACKING_}function Pe(e){var t=Fn();try{return e()}finally{rn(t)}}function Fn(){var e=X.trackingDerivation;return X.trackingDerivation=null,e}function rn(e){X.trackingDerivation=e}function As(e){var t=X.allowStateReads;return X.allowStateReads=e,t}function Vr(e){X.allowStateReads=e}function ku(e){if(e.dependenciesState_!==Oe.UP_TO_DATE_){e.dependenciesState_=Oe.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Oe.UP_TO_DATE_}}var xi=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},Ui=!0,ju=!1,X=function(){var e=Ki();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ui=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new xi().version&&(Ui=!1),Ui?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new xi):(setTimeout(function(){ju||ce(35)},1),new xi)}();function ph(){if((X.pendingReactions.length||X.inBatch||X.isRunningReactions)&&ce(36),ju=!0,Ui){var e=Ki();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),X=new xi}}function Fu(){return X}function hh(e){return e.observers_&&e.observers_.size>0}function yh(e){return e.observers_}function gh(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function zu(e,t){e.observers_.delete(t),e.observers_.size===0&&Vu(e)}function Vu(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,X.pendingUnobservations.push(e))}function _t(){X.inBatch++}function wt(){if(--X.inBatch===0){Hu();for(var e=X.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof Ot&&n.suspend_())}X.pendingUnobservations=[]}}function Ku(e){lh(e);var t=X.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&X.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&X.inBatch>0&&Vu(e),!1)}function qu(e){e.lowestObserverState_!==Oe.STALE_&&(e.lowestObserverState_=Oe.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Oe.UP_TO_DATE_&&(t.isTracing_!==At.NONE&&Gu(t,e),t.onBecomeStale_()),t.dependenciesState_=Oe.STALE_}))}function mh(e){e.lowestObserverState_!==Oe.STALE_&&(e.lowestObserverState_=Oe.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Oe.POSSIBLY_STALE_?(t.dependenciesState_=Oe.STALE_,t.isTracing_!==At.NONE&&Gu(t,e)):t.dependenciesState_===Oe.UP_TO_DATE_&&(e.lowestObserverState_=Oe.UP_TO_DATE_)}))}function vh(e){e.lowestObserverState_===Oe.UP_TO_DATE_&&(e.lowestObserverState_=Oe.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Oe.UP_TO_DATE_&&(t.dependenciesState_=Oe.POSSIBLY_STALE_,t.onBecomeStale_())}))}function Gu(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===At.BREAK){var n=[];Wu(Yr(e),n,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
  `+n.join(`
23
23
  `)+`
24
24
  */
25
- `)()}}function qu(e,t,n){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(n-1)+e.name),e.dependencies&&e.dependencies.forEach(function(r){return qu(r,t,n+1)})}var kt=function(){function e(n,r,i,o){n===void 0&&(n="Reaction@"+It()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Oe.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=At.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=o}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,X.pendingReactions.push(this),Gu())},t.runReaction_=function(){if(!this.isDisposed){_t(),this.isScheduled=!1;var r=X.trackingContext;if(X.trackingContext=this,ls(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&Xe()&&kn({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}X.trackingContext=r,wt()}},t.track=function(r){if(!this.isDisposed){_t();var i=Xe(),o;i&&(o=Date.now(),ft({name:this.name_,type:"reaction"})),this.isRunning=!0;var s=X.trackingContext;X.trackingContext=this;var a=Bu(this,r,void 0);X.trackingContext=s,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&fs(this),Ci(a)&&this.reportExceptionInDerivation_(a.cause),i&&dt({time:Date.now()-o}),wt()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(X.disableErrorBoundaries)throw r;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";X.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(o,r),Xe()&&kn({type:"error",name:this.name_,message:o,error:""+r}),X.globalReactionErrorHandlers.forEach(function(s){return s(r,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(_t(),fs(this),wt()))},t.getDisposer_=function(r){var i=this,o=function s(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",s)};return r==null||r.addEventListener==null||r.addEventListener("abort",o),o[ve]=this,o},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){r===void 0&&(r=!1),As(this,r)},vr(e,[{key:"isDisposed",get:function(){return ct(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=lt(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return ct(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=lt(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return ct(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=lt(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return ct(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=lt(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return ct(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=lt(this.flags_,e.diffValueMask_,r===1)}}])}();kt.isDisposedMask_=1;kt.isScheduledMask_=2;kt.isTrackPendingMask_=4;kt.isRunningMask_=8;kt.diffValueMask_=16;var ou=100,ds=function(t){return t()};function Gu(){X.inBatch>0||X.isRunningReactions||ds(bh)}function bh(){X.isRunningReactions=!0;for(var e=X.pendingReactions,t=0;e.length>0;){++t===ou&&(console.error("Reaction doesn't converge to a stable state after "+ou+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}X.isRunningReactions=!1}var ji=mn("Reaction",kt);function _h(e){var t=ds;ds=function(r){return e(function(){return t(r)})}}function Xe(){return!!X.spyListeners.length}function kn(e){if(X.spyListeners.length)for(var t=X.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function ft(e){var t=on({},e,{spyReportStart:!0});kn(t)}var wh={type:"report-end",spyReportEnd:!0};function dt(e){kn(e?on({},e,{type:"report-end",spyReportEnd:!0}):wh)}function Th(e){return X.spyListeners.push(e),vs(function(){X.spyListeners=X.spyListeners.filter(function(t){return t!==e})})}var Ts="action",Ah="action.bound",Wu="autoAction",Oh="autoAction.bound",Hu="<unnamed action>",ps=Jr(Ts),Eh=Jr(Ah,{bound:!0}),hs=Jr(Wu,{autoAction:!0}),Ih=Jr(Oh,{autoAction:!0,bound:!0});function Ju(e){var t=function(r,i){if(je(r))return Ln(r.name||Hu,r,e);if(je(i))return Ln(r,i,e);if(Hr(i))return(e?hs:ps).decorate_20223_(r,i);if(Bn(i))return Wr(r,i,e?hs:ps);if(Bn(r))return Wt(Jr(e?Wu:Ts,{name:r,autoAction:e}));ce("Invalid arguments for `action`")};return t}var at=Ju(!1);Object.assign(at,ps);var Kr=Ju(!0);Object.assign(Kr,hs);at.bound=Wt(Eh);Kr.bound=Wt(Ih);function br(e){return Uu(e.name||Hu,!1,e,this,void 0)}function gn(e){return je(e)&&e.isMobxAction===!0}function St(e,t){var n,r,i,o;t===void 0&&(t=ms),je(e)||ce("Autorun expects a function as first argument"),gn(e)&&ce("Autorun does not accept actions since actions are untrackable");var s=(n=(r=t)==null?void 0:r.name)!=null?n:e.name||"Autorun@"+It(),a=!t.scheduler&&!t.delay,l;if(a)l=new kt(s,function(){this.track(g)},t.onError,t.requiresObservable);else{var c=Xu(t),d=!1;l=new kt(s,function(){d||(d=!0,c(function(){d=!1,l.isDisposed||l.track(g)}))},t.onError,t.requiresObservable)}function g(){e(l)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||l.schedule_(),l.getDisposer_((o=t)==null?void 0:o.signal)}var Sh=function(t){return t()};function Xu(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Sh}function Yu(e,t,n){var r,i,o;n===void 0&&(n=ms),(!je(e)||!je(t))&&ce("First and second argument to reaction should be functions"),Lt(n)||ce("Third argument of reactions should be an object");var s=(r=n.name)!=null?r:"Reaction@"+It(),a=at(s,n.onError?$h(n.onError,t):t),l=!n.scheduler&&!n.delay,c=Xu(n),d=!0,g=!1,C,I=n.compareStructural?ze.structural:n.equals||ze.default,S=new kt(s,function(){d||l?z():g||(g=!0,c(z))},n.onError,n.requiresObservable);function z(){if(g=!1,!S.isDisposed){var J=!1,F=C;S.track(function(){var k=ah(!1,function(){return e(S)});J=d||!I(C,k),C=k}),(d&&n.fireImmediately||!d&&J)&&a(C,F,S),d=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||S.schedule_(),S.getDisposer_((o=n)==null?void 0:o.signal)}function $h(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var Nh="onBO",Rh="onBUO";function _r(e,t,n){return Qu(Nh,e,t,n)}function zn(e,t,n){return Qu(Rh,e,t,n)}function Qu(e,t,n,r){var i=typeof r=="function"?Et(t,n):Et(t),o=je(r)?r:n,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 Ph="never",Ri="always",Ch="observed";function Zu(e){e.isolateGlobalState===!0&&ph();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(X.useProxies=t===Ri?!0:t===Ph?!1:typeof Proxy<"u"),t==="ifavailable"&&(X.verifyProxies=!0),n!==void 0){var r=n===Ri?Ri:n===Ch;X.enforceActions=r,X.allowStateChanges=!(r===!0||r===Ri)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(X[i]=!!e[i])}),X.allowStateReads=!X.observableRequiresReaction,X.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&_h(e.reactionScheduler)}function xh(e,t,n,r){arguments.length>4&&ce("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&ce("'extendObservable' expects an object as first argument"),Ht(e)&&ce("'extendObservable' should not be used on maps, use map.merge instead"),Lt(t)||ce("'extendObservable' only accepts plain objects as second argument"),(gr(t)||gr(n))&&ce("Extending an object with another observable (object) is not supported");var i=fp(t);return Vn(function(){var o=Tr(e,r)[ve];Wi(i).forEach(function(s){o.extend_(s,i[s],n&&s in n?n[s]:!0)})}),e}function Yr(e,t){return ec(Et(e,t))}function ec(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Uh(e.observing_).map(ec)),t}function Qr(e,t){return tc(Et(e,t))}function tc(e){var t={name:e.name_};return hh(e)&&(t.observers=Array.from(yh(e)).map(tc)),t}function Uh(e){return Array.from(new Set(e))}var Mh=0;function nc(){this.message="FLOW_CANCELLED"}nc.prototype=Object.create(Error.prototype);var is=Su("flow"),Bh=Su("flow.bound",{bound:!0}),yr=Object.assign(function(t,n){if(Hr(n))return is.decorate_20223_(t,n);if(Bn(n))return Wr(t,n,is);arguments.length!==1&&ce("Flow expects single argument with generator function");var r=t,i=r.name||"<unnamed flow>",o=function(){var a=this,l=arguments,c=++Mh,d=at(i+" - runid: "+c+" - init",r).apply(a,l),g,C=void 0,I=new Promise(function(S,z){var J=0;g=z;function F(W){C=void 0;var j;try{j=at(i+" - runid: "+c+" - yield "+J++,d.next).call(d,W)}catch(Z){return z(Z)}K(j)}function k(W){C=void 0;var j;try{j=at(i+" - runid: "+c+" - yield "+J++,d.throw).call(d,W)}catch(Z){return z(Z)}K(j)}function K(W){if(je(W?.then)){W.then(K,z);return}return W.done?S(W.value):(C=Promise.resolve(W.value),C.then(F,k))}F(void 0)});return I.cancel=at(i+" - runid: "+c+" - cancel",function(){try{C&&su(C);var S=d.return(void 0),z=Promise.resolve(S.value);z.then(pr,pr),su(z),g(new nc)}catch(J){g(J)}}),I};return o.isMobXFlow=!0,o},is);yr.bound=Wt(Bh);function su(e){je(e.cancel)&&e.cancel()}function qr(e){return e?.isMobXFlow===!0}function Dh(e,t){return e?t!==void 0?Ht(e)||wr(e)?ce("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):jn(e)?e[ve].values_.has(t):!1:jn(e)||!!e[ve]||bs(e)||ji(e)||Xr(e):!1}function gr(e){return arguments.length!==1&&ce("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),Dh(e)}function Lh(e){if(jn(e))return e[ve].ownKeys_();ce(38)}function Pi(e,t,n){return e.set(t,n),n}function dr(e,t){if(e==null||typeof e!="object"||e instanceof Date||!gr(e))return e;if(ch(e)||Xr(e))return dr(e.get(),t);if(t.has(e))return t.get(e);if(wr(e)){var n=Pi(t,e,new Array(e.length));return e.forEach(function(s,a){n[a]=dr(s,t)}),n}if(Ut(e)){var r=Pi(t,e,new Set);return e.forEach(function(s){r.add(dr(s,t))}),r}if(Ht(e)){var i=Pi(t,e,new Map);return e.forEach(function(s,a){i.set(a,dr(s,t))}),i}else{var o=Pi(t,e,{});return Lh(e).forEach(function(s){Gr.propertyIsEnumerable.call(e,s)&&(o[s]=dr(e[s],t))}),o}}function sn(e,t){return t&&ce("toJS no longer supports options"),dr(e,new Map)}function As(){for(var e=!1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];typeof n[n.length-1]=="boolean"&&(e=n.pop());var i=kh(n);if(!i)return ce("'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_===At.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?At.BREAK:At.LOG}function kh(e){switch(e.length){case 0:return X.trackingDerivation;case 1:return Et(e[0]);case 2:return Et(e[0],e[1])}}function nn(e,t){t===void 0&&(t=void 0),_t();try{return e.apply(t)}finally{wt()}}function Mn(e){return e[ve]}var jh={has:function(t,n){return X.trackingDerivation&&zr("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Mn(t).has_(n)},get:function(t,n){return Mn(t).get_(n)},set:function(t,n,r){var i;return Bn(n)?(Mn(t).values_.has(n)||zr("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=Mn(t).set_(n,r,!0))!=null?i:!0):!1},deleteProperty:function(t,n){var r;return zr("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Bn(n)?(r=Mn(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return zr("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=Mn(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return X.trackingDerivation&&zr("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Mn(t).ownKeys_()},preventExtensions:function(t){ce(13)}};function Fh(e,t){var n,r;return bu(),e=Tr(e,t),(r=(n=e[ve]).proxy_)!=null?r:n.proxy_=new Proxy(e,jh)}function vt(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Zr(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),vs(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function bt(e,t){var n=Fn();try{for(var r=[].concat(e.interceptors_||[]),i=0,o=r.length;i<o&&(t=r[i](t),t&&!t.type&&ce(14),!!t);i++);return t}finally{rn(n)}}function Bt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function ei(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),vs(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function Dt(e,t){var n=Fn(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](t);rn(n)}}function bn(e,t,n){return Vn(function(){var r,i=Tr(e,n)[ve];t&&e[st]&&ce("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(r=t)!=null||(t=gp(e)),Wi(t).forEach(function(o){return i.make_(o,t[o])})}),e}var au="splice",Mt="update",zh=1e4,Vh={get:function(t,n){var r=t[ve];return n===ve?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):Tt(Fi,n)?Fi[n]:t[n]},set:function(t,n,r){var i=t[ve];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?t[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){ce(15)}},Os=function(){function e(n,r,i,o){n===void 0&&(n="ObservableArray@"+It()),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 vn(n),this.enhancer_=function(s,a){return r(s,a,n+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},t.intercept_=function(r){return Zr(this,r)},t.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),ei(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&ce("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var o=new Array(r-i),s=0;s<r-i;s++)o[s]=void 0;this.spliceWithArray_(i,0,o)}else this.spliceWithArray_(r,i-r)},t.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&ce(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&uc(r+i+1)},t.spliceWithArray_=function(r,i,o){var s=this;qt(this.atom_);var a=this.values_.length;if(r===void 0?r=0:r>a?r=a:r<0&&(r=Math.max(0,a+r)),arguments.length===1?i=a-r:i==null?i=0:i=Math.max(0,Math.min(i,a-r)),o===void 0&&(o=Bi),vt(this)){var l=bt(this,{object:this.proxy_,type:au,index:r,removedCount:i,added:o});if(!l)return Bi;i=l.removedCount,o=l.added}o=o.length===0?o:o.map(function(g){return s.enhancer_(g,void 0)}),this.legacyMode_;var c=o.length-i;this.updateArrayLength_(a,c);var d=this.spliceItemsIntoValues_(r,i,o);return(i!==0||o.length!==0)&&this.notifyArraySplice_(r,o,d),this.dehanceValues_(d)},t.spliceItemsIntoValues_=function(r,i,o){if(o.length<zh){var s;return(s=this.values_).splice.apply(s,[r,i].concat(o))}else{var a=this.values_.slice(r,r+i),l=this.values_.slice(r+i);this.values_.length+=o.length-i;for(var c=0;c<o.length;c++)this.values_[r+c]=o[c];for(var d=0;d<l.length;d++)this.values_[r+o.length+d]=l[d];return a}},t.notifyArrayChildUpdate_=function(r,i,o){var s=!this.owned_&&Xe(),a=Bt(this),l=a||s?{observableKind:"array",object:this.proxy_,type:Mt,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:o}:null;s&&ft(l),this.atom_.reportChanged(),a&&Dt(this,l),s&&dt()},t.notifyArraySplice_=function(r,i,o){var s=!this.owned_&&Xe(),a=Bt(this),l=a||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:au,index:r,removed:o,added:i,removedCount:o.length,addedCount:i.length}:null;s&&ft(l),this.atom_.reportChanged(),a&&Dt(this,l),s&&dt()},t.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+r+") 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_[r])},t.set_=function(r,i){var o=this.values_;if(this.legacyMode_&&r>o.length&&ce(17,r,o.length),r<o.length){qt(this.atom_);var s=o[r];if(vt(this)){var a=bt(this,{type:Mt,object:this.proxy_,index:r,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,s);var l=i!==s;l&&(o[r]=i,this.notifyArrayChildUpdate_(r,i,s))}else{for(var c=new Array(r+1-o.length),d=0;d<c.length-1;d++)c[d]=void 0;c[c.length-1]=i,this.spliceWithArray_(o.length,0,c)}},e}();function Kh(e,t,n,r){return n===void 0&&(n="ObservableArray@"+It()),r===void 0&&(r=!1),bu(),Vn(function(){var i=new Os(n,t,r,!1);wu(i.values_,ve,i);var o=new Proxy(i.values_,Vh);return i.proxy_=o,e&&e.length&&i.spliceWithArray_(0,0,e),o})}var Fi={clear:function(){return this.splice(0)},replace:function(t){var n=this[ve];return n.spliceWithArray_(0,n.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];var s=this[ve];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(t);case 2:return s.spliceWithArray_(t,n)}return s.spliceWithArray_(t,n,i)},spliceWithArray:function(t,n,r){return this[ve].spliceWithArray_(t,n,r)},push:function(){for(var t=this[ve],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,r),t.values_.length},pop:function(){return this.splice(Math.max(this[ve].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[ve],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(0,0,r),t.values_.length},reverse:function(){return X.trackingDerivation&&ce(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){X.trackingDerivation&&ce(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[ve],r=n.dehanceValues_(n.values_).indexOf(t);return r>-1?(this.splice(r,1),!0):!1}};xe("at",pt);xe("concat",pt);xe("flat",pt);xe("includes",pt);xe("indexOf",pt);xe("join",pt);xe("lastIndexOf",pt);xe("slice",pt);xe("toString",pt);xe("toLocaleString",pt);xe("toSorted",pt);xe("toSpliced",pt);xe("with",pt);xe("every",jt);xe("filter",jt);xe("find",jt);xe("findIndex",jt);xe("findLast",jt);xe("findLastIndex",jt);xe("flatMap",jt);xe("forEach",jt);xe("map",jt);xe("some",jt);xe("toReversed",jt);xe("reduce",rc);xe("reduceRight",rc);function xe(e,t){typeof Array.prototype[e]=="function"&&(Fi[e]=t(e))}function pt(e){return function(){var t=this[ve];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function jt(e){return function(t,n){var r=this,i=this[ve];i.atom_.reportObserved();var o=i.dehanceValues_(i.values_);return o[e](function(s,a){return t.call(n,s,a,r)})}}function rc(e){return function(){var t=this,n=this[ve];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(o,s,a){return i(o,s,a,t)},r[e].apply(r,arguments)}}var qh=mn("ObservableArrayAdministration",Os);function wr(e){return qi(e)&&qh(e[ve])}var Gh={},hn="add",zi="delete",ic=function(){function e(n,r,i){var o=this;r===void 0&&(r=Dn),i===void 0&&(i="ObservableMap@"+It()),this.enhancer_=void 0,this.name_=void 0,this[ve]=Gh,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_=r,this.name_=i,je(Map)||ce(18),Vn(function(){o.keysAtom_=Eu(o.name_+".keys()"),o.data_=new Map,o.hasMap_=new Map,n&&o.merge(n)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var i=this;if(!X.trackingDerivation)return this.has_(r);var o=this.hasMap_.get(r);if(!o){var s=o=new yn(this.has_(r),Ji,this.name_+"."+ss(r)+"?",!1);this.hasMap_.set(r,s),zn(s,function(){return i.hasMap_.delete(r)})}return o.get()},t.set=function(r,i){var o=this.has_(r);if(vt(this)){var s=bt(this,{type:o?Mt:hn,object:this,newValue:i,name:r});if(!s)return this;i=s.newValue}return o?this.updateValue_(r,i):this.addValue_(r,i),this},t.delete=function(r){var i=this;if(qt(this.keysAtom_),vt(this)){var o=bt(this,{type:zi,object:this,name:r});if(!o)return!1}if(this.has_(r)){var s=Xe(),a=Bt(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:zi,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return s&&ft(l),nn(function(){var c;i.keysAtom_.reportChanged(),(c=i.hasMap_.get(r))==null||c.setNewValue_(!1);var d=i.data_.get(r);d.setNewValue_(void 0),i.data_.delete(r)}),a&&Dt(this,l),s&&dt(),!0}return!1},t.updateValue_=function(r,i){var o=this.data_.get(r);if(i=o.prepareNewValue_(i),i!==X.UNCHANGED){var s=Xe(),a=Bt(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:Mt,object:this,oldValue:o.value_,name:r,newValue:i}:null;s&&ft(l),o.setNewValue_(i),a&&Dt(this,l),s&&dt()}},t.addValue_=function(r,i){var o=this;qt(this.keysAtom_),nn(function(){var c,d=new yn(i,o.enhancer_,o.name_+"."+ss(r),!1);o.data_.set(r,d),i=d.value_,(c=o.hasMap_.get(r))==null||c.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=Xe(),a=Bt(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:hn,object:this,name:r,newValue:i}:null;s&&ft(l),a&&Dt(this,l),s&&dt()},t.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var r=this,i=this.keys();return uu({next:function(){var s=i.next(),a=s.done,l=s.value;return{done:a,value:a?void 0:r.get(l)}}})},t.entries=function(){var r=this,i=this.keys();return uu({next:function(){var s=i.next(),a=s.done,l=s.value;return{done:a,value:a?void 0:[l,r.get(l)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(r,i){for(var o=hr(this),s;!(s=o()).done;){var a=s.value,l=a[0],c=a[1];r.call(i,c,l,this)}},t.merge=function(r){var i=this;return Ht(r)&&(r=new Map(r)),nn(function(){Lt(r)?lp(r).forEach(function(o){return i.set(o,r[o])}):Array.isArray(r)?r.forEach(function(o){var s=o[0],a=o[1];return i.set(s,a)}):mr(r)?(cp(r)||ce(19,r),r.forEach(function(o,s){return i.set(s,o)})):r!=null&&ce(20,r)}),this},t.clear=function(){var r=this;nn(function(){Pe(function(){for(var i=hr(r.keys()),o;!(o=i()).done;){var s=o.value;r.delete(s)}})})},t.replace=function(r){var i=this;return nn(function(){for(var o=Wh(r),s=new Map,a=!1,l=hr(i.data_.keys()),c;!(c=l()).done;){var d=c.value;if(!o.has(d)){var g=i.delete(d);if(g)a=!0;else{var C=i.data_.get(d);s.set(d,C)}}}for(var I=hr(o.entries()),S;!(S=I()).done;){var z=S.value,J=z[0],F=z[1],k=i.data_.has(J);if(i.set(J,F),i.data_.has(J)){var K=i.data_.get(J);s.set(J,K),k||(a=!0)}}if(!a)if(i.data_.size!==s.size)i.keysAtom_.reportChanged();else for(var W=i.data_.keys(),j=s.keys(),Z=W.next(),G=j.next();!Z.done;){if(Z.value!==G.value){i.keysAtom_.reportChanged();break}Z=W.next(),G=j.next()}i.data_=s}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,i){return i===!0&&ce("`observe` doesn't support fireImmediately=true in combination with maps."),ei(this,r)},t.intercept_=function(r){return Zr(this,r)},vr(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Ht=mn("ObservableMap",ic);function uu(e){return e[Symbol.toStringTag]="MapIterator",$s(e)}function Wh(e){if(mr(e)||Ht(e))return e;if(Array.isArray(e))return new Map(e);if(Lt(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return ce(21,e)}var Hh={},oc=function(){function e(n,r,i){var o=this;r===void 0&&(r=Dn),i===void 0&&(i="ObservableSet@"+It()),this.name_=void 0,this[ve]=Hh,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)||ce(22),this.enhancer_=function(s,a){return r(s,a,i)},Vn(function(){o.atom_=Eu(o.name_),n&&o.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.clear=function(){var r=this;nn(function(){Pe(function(){for(var i=hr(r.data_.values()),o;!(o=i()).done;){var s=o.value;r.delete(s)}})})},t.forEach=function(r,i){for(var o=hr(this),s;!(s=o()).done;){var a=s.value;r.call(i,a,a,this)}},t.add=function(r){var i=this;if(qt(this.atom_),vt(this)){var o=bt(this,{type:hn,object:this,newValue:r});if(!o)return this;r=o.newValue}if(!this.has(r)){nn(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var s=Xe(),a=Bt(this),l=a||s?{observableKind:"set",debugObjectName:this.name_,type:hn,object:this,newValue:r}:null;s&&ft(l),a&&Dt(this,l),s&&dt()}return this},t.delete=function(r){var i=this;if(vt(this)){var o=bt(this,{type:zi,object:this,oldValue:r});if(!o)return!1}if(this.has(r)){var s=Xe(),a=Bt(this),l=a||s?{observableKind:"set",debugObjectName:this.name_,type:zi,object:this,oldValue:r}:null;return s&&ft(l),nn(function(){i.atom_.reportChanged(),i.data_.delete(r)}),a&&Dt(this,l),s&&dt(),!0}return!1},t.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},t.entries=function(){var r=this.values();return cu({next:function(){var o=r.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 r=this,i=this.data_.values();return cu({next:function(){var s=i.next(),a=s.value,l=s.done;return l?{value:void 0,done:l}:{value:r.dehanceValue_(a),done:l}}})},t.intersection=function(r){if(tn(r)&&!Ut(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(tn(r)&&!Ut(r))return r.union(this);var i=new Set(this);return i.union(r)},t.difference=function(r){return new Set(this).difference(r)},t.symmetricDifference=function(r){if(tn(r)&&!Ut(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},t.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},t.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},t.isDisjointFrom=function(r){if(tn(r)&&!Ut(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},t.replace=function(r){var i=this;return Ut(r)&&(r=new Set(r)),nn(function(){Array.isArray(r)?(i.clear(),r.forEach(function(o){return i.add(o)})):tn(r)?(i.clear(),r.forEach(function(o){return i.add(o)})):r!=null&&ce("Cannot initialize set from "+r)}),this},t.observe_=function(r,i){return i===!0&&ce("`observe` doesn't support fireImmediately=true in combination with sets."),ei(this,r)},t.intercept_=function(r){return Zr(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},vr(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Ut=mn("ObservableSet",oc);function cu(e){return e[Symbol.toStringTag]="SetIterator",$s(e)}var lu=Object.create(null),fu="remove",ys=function(){function e(n,r,i,o){r===void 0&&(r=new Map),o===void 0&&(o=Fp),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_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=o,this.keysAtom_=new vn(this.name_+".keys"),this.isPlainObject_=Lt(this.target_),cc(this.defaultAnnotation_)||ce("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(r){return this.values_.get(r).get()},t.setObservablePropValue_=function(r,i){var o=this.values_.get(r);if(o instanceof Ot)return o.set(i),!0;if(vt(this)){var s=bt(this,{type:Mt,object:this.proxy_||this.target_,name:r,newValue:i});if(!s)return null;i=s.newValue}if(i=o.prepareNewValue_(i),i!==X.UNCHANGED){var a=Bt(this),l=Xe(),c=a||l?{type:Mt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:r,newValue:i}:null;l&&ft(c),o.setNewValue_(i),a&&Dt(this,c),l&&dt()}return!0},t.get_=function(r){return X.trackingDerivation&&!Tt(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,o){return o===void 0&&(o=!1),Tt(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):o?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},t.has_=function(r){if(!X.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new yn(r in this.target_,Ji,this.name_+"."+ss(r)+"?",!1),this.pendingKeys_.set(r,i)),i.get()},t.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(hu(this,i,r),!(r in this.target_)){var o;if((o=this.target_[st])!=null&&o[r])return;ce(1,i.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==Gr;){var a=Mi(s,r);if(a){var l=i.make_(this,r,a,s);if(l===0)return;if(l===1)break}s=Object.getPrototypeOf(s)}pu(this,i,r)}},t.extend_=function(r,i,o,s){if(s===void 0&&(s=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(r,i,s);hu(this,o,r);var a=o.extend_(this,r,i,s);return a&&pu(this,o,r),a},t.defineProperty_=function(r,i,o){o===void 0&&(o=!1),qt(this.keysAtom_);try{_t();var s=this.delete_(r);if(!s)return s;if(vt(this)){var a=bt(this,{object:this.proxy_||this.target_,name:r,type:hn,newValue:i.value});if(!a)return null;var l=a.newValue;i.value!==l&&(i=on({},i,{value:l}))}if(o){if(!Reflect.defineProperty(this.target_,r,i))return!1}else Gt(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{wt()}return!0},t.defineObservableProperty_=function(r,i,o,s){s===void 0&&(s=!1),qt(this.keysAtom_);try{_t();var a=this.delete_(r);if(!a)return a;if(vt(this)){var l=bt(this,{object:this.proxy_||this.target_,name:r,type:hn,newValue:i});if(!l)return null;i=l.newValue}var c=du(r),d={configurable:X.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(s){if(!Reflect.defineProperty(this.target_,r,d))return!1}else Gt(this.target_,r,d);var g=new yn(i,o,this.name_+"."+r.toString(),!1);this.values_.set(r,g),this.notifyPropertyAddition_(r,g.value_)}finally{wt()}return!0},t.defineComputedProperty_=function(r,i,o){o===void 0&&(o=!1),qt(this.keysAtom_);try{_t();var s=this.delete_(r);if(!s)return s;if(vt(this)){var a=bt(this,{object:this.proxy_||this.target_,name:r,type:hn,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+r.toString()),i.context=this.proxy_||this.target_;var l=du(r),c={configurable:X.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(o){if(!Reflect.defineProperty(this.target_,r,c))return!1}else Gt(this.target_,r,c);this.values_.set(r,new Ot(i)),this.notifyPropertyAddition_(r,void 0)}finally{wt()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),qt(this.keysAtom_),!Tt(this.target_,r))return!0;if(vt(this)){var o=bt(this,{object:this.proxy_||this.target_,name:r,type:fu});if(!o)return null}try{var s;_t();var a=Bt(this),l=Xe(),c=this.values_.get(r),d=void 0;if(!c&&(a||l)){var g;d=(g=Mi(this.target_,r))==null?void 0:g.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(delete this.appliedAnnotations_[r],c&&(this.values_.delete(r),c instanceof yn&&(d=c.value_),Vu(c)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),a||l){var C={type:fu,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:r};l&&ft(C),a&&Dt(this,C),l&&dt()}}finally{wt()}return!0},t.observe_=function(r,i){return i===!0&&ce("`observe` doesn't support the fire immediately property for observable objects."),ei(this,r)},t.intercept_=function(r){return Zr(this,r)},t.notifyPropertyAddition_=function(r,i){var o,s=Bt(this),a=Xe();if(s||a){var l=s||a?{type:hn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;a&&ft(l),s&&Dt(this,l),a&&dt()}(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Wi(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Tr(e,t){var n;if(t&&jn(e)&&ce("Options can't be provided for already observable objects."),Tt(e,ve))return Is(e)instanceof ys||ce("Cannot convert '"+Vi(e)+`' into observable object:
25
+ `)()}}function Wu(e,t,n){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(n-1)+e.name),e.dependencies&&e.dependencies.forEach(function(r){return Wu(r,t,n+1)})}var kt=function(){function e(n,r,i,o){n===void 0&&(n="Reaction@"+It()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Oe.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=At.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=o}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,X.pendingReactions.push(this),Hu())},t.runReaction_=function(){if(!this.isDisposed){_t(),this.isScheduled=!1;var r=X.trackingContext;if(X.trackingContext=this,ds(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&Xe()&&kn({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}X.trackingContext=r,wt()}},t.track=function(r){if(!this.isDisposed){_t();var i=Xe(),o;i&&(o=Date.now(),ft({name:this.name_,type:"reaction"})),this.isRunning=!0;var s=X.trackingContext;X.trackingContext=this;var a=Lu(this,r,void 0);X.trackingContext=s,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&ps(this),Ci(a)&&this.reportExceptionInDerivation_(a.cause),i&&dt({time:Date.now()-o}),wt()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(X.disableErrorBoundaries)throw r;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";X.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(o,r),Xe()&&kn({type:"error",name:this.name_,message:o,error:""+r}),X.globalReactionErrorHandlers.forEach(function(s){return s(r,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(_t(),ps(this),wt()))},t.getDisposer_=function(r){var i=this,o=function s(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",s)};return r==null||r.addEventListener==null||r.addEventListener("abort",o),o[ve]=this,o},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){r===void 0&&(r=!1),Es(this,r)},vr(e,[{key:"isDisposed",get:function(){return ct(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=lt(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return ct(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=lt(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return ct(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=lt(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return ct(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=lt(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return ct(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=lt(this.flags_,e.diffValueMask_,r===1)}}])}();kt.isDisposedMask_=1;kt.isScheduledMask_=2;kt.isTrackPendingMask_=4;kt.isRunningMask_=8;kt.diffValueMask_=16;var au=100,hs=function(t){return t()};function Hu(){X.inBatch>0||X.isRunningReactions||hs(bh)}function bh(){X.isRunningReactions=!0;for(var e=X.pendingReactions,t=0;e.length>0;){++t===au&&(console.error("Reaction doesn't converge to a stable state after "+au+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}X.isRunningReactions=!1}var ji=mn("Reaction",kt);function _h(e){var t=hs;hs=function(r){return e(function(){return t(r)})}}function Xe(){return!!X.spyListeners.length}function kn(e){if(X.spyListeners.length)for(var t=X.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function ft(e){var t=on({},e,{spyReportStart:!0});kn(t)}var wh={type:"report-end",spyReportEnd:!0};function dt(e){kn(e?on({},e,{type:"report-end",spyReportEnd:!0}):wh)}function Th(e){return X.spyListeners.push(e),_s(function(){X.spyListeners=X.spyListeners.filter(function(t){return t!==e})})}var Os="action",Ah="action.bound",Ju="autoAction",Oh="autoAction.bound",Xu="<unnamed action>",ys=Jr(Os),Eh=Jr(Ah,{bound:!0}),gs=Jr(Ju,{autoAction:!0}),Ih=Jr(Oh,{autoAction:!0,bound:!0});function Yu(e){var t=function(r,i){if(je(r))return Ln(r.name||Xu,r,e);if(je(i))return Ln(r,i,e);if(Hr(i))return(e?gs:ys).decorate_20223_(r,i);if(Bn(i))return Wr(r,i,e?gs:ys);if(Bn(r))return Wt(Jr(e?Ju:Os,{name:r,autoAction:e}));ce("Invalid arguments for `action`")};return t}var at=Yu(!1);Object.assign(at,ys);var Kr=Yu(!0);Object.assign(Kr,gs);at.bound=Wt(Eh);Kr.bound=Wt(Ih);function br(e){return Bu(e.name||Xu,!1,e,this,void 0)}function gn(e){return je(e)&&e.isMobxAction===!0}function St(e,t){var n,r,i,o;t===void 0&&(t=bs),je(e)||ce("Autorun expects a function as first argument"),gn(e)&&ce("Autorun does not accept actions since actions are untrackable");var s=(n=(r=t)==null?void 0:r.name)!=null?n:e.name||"Autorun@"+It(),a=!t.scheduler&&!t.delay,l;if(a)l=new kt(s,function(){this.track(g)},t.onError,t.requiresObservable);else{var c=Qu(t),d=!1;l=new kt(s,function(){d||(d=!0,c(function(){d=!1,l.isDisposed||l.track(g)}))},t.onError,t.requiresObservable)}function g(){e(l)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||l.schedule_(),l.getDisposer_((o=t)==null?void 0:o.signal)}var Sh=function(t){return t()};function Qu(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Sh}function Zu(e,t,n){var r,i,o;n===void 0&&(n=bs),(!je(e)||!je(t))&&ce("First and second argument to reaction should be functions"),Lt(n)||ce("Third argument of reactions should be an object");var s=(r=n.name)!=null?r:"Reaction@"+It(),a=at(s,n.onError?$h(n.onError,t):t),l=!n.scheduler&&!n.delay,c=Qu(n),d=!0,g=!1,C,I=n.compareStructural?ze.structural:n.equals||ze.default,S=new kt(s,function(){d||l?z():g||(g=!0,c(z))},n.onError,n.requiresObservable);function z(){if(g=!1,!S.isDisposed){var J=!1,F=C;S.track(function(){var k=ah(!1,function(){return e(S)});J=d||!I(C,k),C=k}),(d&&n.fireImmediately||!d&&J)&&a(C,F,S),d=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||S.schedule_(),S.getDisposer_((o=n)==null?void 0:o.signal)}function $h(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var Nh="onBO",Rh="onBUO";function _r(e,t,n){return ec(Nh,e,t,n)}function zn(e,t,n){return ec(Rh,e,t,n)}function ec(e,t,n,r){var i=typeof r=="function"?Et(t,n):Et(t),o=je(r)?r:n,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 Ph="never",Ri="always",Ch="observed";function tc(e){e.isolateGlobalState===!0&&ph();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(X.useProxies=t===Ri?!0:t===Ph?!1:typeof Proxy<"u"),t==="ifavailable"&&(X.verifyProxies=!0),n!==void 0){var r=n===Ri?Ri:n===Ch;X.enforceActions=r,X.allowStateChanges=!(r===!0||r===Ri)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(X[i]=!!e[i])}),X.allowStateReads=!X.observableRequiresReaction,X.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&_h(e.reactionScheduler)}function xh(e,t,n,r){arguments.length>4&&ce("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&ce("'extendObservable' expects an object as first argument"),Ht(e)&&ce("'extendObservable' should not be used on maps, use map.merge instead"),Lt(t)||ce("'extendObservable' only accepts plain objects as second argument"),(gr(t)||gr(n))&&ce("Extending an object with another observable (object) is not supported");var i=fp(t);return Vn(function(){var o=Tr(e,r)[ve];Wi(i).forEach(function(s){o.extend_(s,i[s],n&&s in n?n[s]:!0)})}),e}function Yr(e,t){return nc(Et(e,t))}function nc(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Uh(e.observing_).map(nc)),t}function Qr(e,t){return rc(Et(e,t))}function rc(e){var t={name:e.name_};return hh(e)&&(t.observers=Array.from(yh(e)).map(rc)),t}function Uh(e){return Array.from(new Set(e))}var Mh=0;function ic(){this.message="FLOW_CANCELLED"}ic.prototype=Object.create(Error.prototype);var ss=Nu("flow"),Bh=Nu("flow.bound",{bound:!0}),yr=Object.assign(function(t,n){if(Hr(n))return ss.decorate_20223_(t,n);if(Bn(n))return Wr(t,n,ss);arguments.length!==1&&ce("Flow expects single argument with generator function");var r=t,i=r.name||"<unnamed flow>",o=function(){var a=this,l=arguments,c=++Mh,d=at(i+" - runid: "+c+" - init",r).apply(a,l),g,C=void 0,I=new Promise(function(S,z){var J=0;g=z;function F(W){C=void 0;var j;try{j=at(i+" - runid: "+c+" - yield "+J++,d.next).call(d,W)}catch(Z){return z(Z)}K(j)}function k(W){C=void 0;var j;try{j=at(i+" - runid: "+c+" - yield "+J++,d.throw).call(d,W)}catch(Z){return z(Z)}K(j)}function K(W){if(je(W?.then)){W.then(K,z);return}return W.done?S(W.value):(C=Promise.resolve(W.value),C.then(F,k))}F(void 0)});return I.cancel=at(i+" - runid: "+c+" - cancel",function(){try{C&&uu(C);var S=d.return(void 0),z=Promise.resolve(S.value);z.then(pr,pr),uu(z),g(new ic)}catch(J){g(J)}}),I};return o.isMobXFlow=!0,o},ss);yr.bound=Wt(Bh);function uu(e){je(e.cancel)&&e.cancel()}function qr(e){return e?.isMobXFlow===!0}function Dh(e,t){return e?t!==void 0?Ht(e)||wr(e)?ce("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):jn(e)?e[ve].values_.has(t):!1:jn(e)||!!e[ve]||ws(e)||ji(e)||Xr(e):!1}function gr(e){return arguments.length!==1&&ce("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),Dh(e)}function Lh(e){if(jn(e))return e[ve].ownKeys_();ce(38)}function Pi(e,t,n){return e.set(t,n),n}function dr(e,t){if(e==null||typeof e!="object"||e instanceof Date||!gr(e))return e;if(ch(e)||Xr(e))return dr(e.get(),t);if(t.has(e))return t.get(e);if(wr(e)){var n=Pi(t,e,new Array(e.length));return e.forEach(function(s,a){n[a]=dr(s,t)}),n}if(Ut(e)){var r=Pi(t,e,new Set);return e.forEach(function(s){r.add(dr(s,t))}),r}if(Ht(e)){var i=Pi(t,e,new Map);return e.forEach(function(s,a){i.set(a,dr(s,t))}),i}else{var o=Pi(t,e,{});return Lh(e).forEach(function(s){Gr.propertyIsEnumerable.call(e,s)&&(o[s]=dr(e[s],t))}),o}}function sn(e,t){return t&&ce("toJS no longer supports options"),dr(e,new Map)}function Es(){for(var e=!1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];typeof n[n.length-1]=="boolean"&&(e=n.pop());var i=kh(n);if(!i)return ce("'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_===At.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?At.BREAK:At.LOG}function kh(e){switch(e.length){case 0:return X.trackingDerivation;case 1:return Et(e[0]);case 2:return Et(e[0],e[1])}}function nn(e,t){t===void 0&&(t=void 0),_t();try{return e.apply(t)}finally{wt()}}function Mn(e){return e[ve]}var jh={has:function(t,n){return X.trackingDerivation&&zr("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Mn(t).has_(n)},get:function(t,n){return Mn(t).get_(n)},set:function(t,n,r){var i;return Bn(n)?(Mn(t).values_.has(n)||zr("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=Mn(t).set_(n,r,!0))!=null?i:!0):!1},deleteProperty:function(t,n){var r;return zr("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Bn(n)?(r=Mn(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return zr("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=Mn(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return X.trackingDerivation&&zr("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Mn(t).ownKeys_()},preventExtensions:function(t){ce(13)}};function Fh(e,t){var n,r;return wu(),e=Tr(e,t),(r=(n=e[ve]).proxy_)!=null?r:n.proxy_=new Proxy(e,jh)}function vt(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Zr(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),_s(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function bt(e,t){var n=Fn();try{for(var r=[].concat(e.interceptors_||[]),i=0,o=r.length;i<o&&(t=r[i](t),t&&!t.type&&ce(14),!!t);i++);return t}finally{rn(n)}}function Bt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function ei(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),_s(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function Dt(e,t){var n=Fn(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](t);rn(n)}}function bn(e,t,n){return Vn(function(){var r,i=Tr(e,n)[ve];t&&e[st]&&ce("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(r=t)!=null||(t=gp(e)),Wi(t).forEach(function(o){return i.make_(o,t[o])})}),e}var cu="splice",Mt="update",zh=1e4,Vh={get:function(t,n){var r=t[ve];return n===ve?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):Tt(Fi,n)?Fi[n]:t[n]},set:function(t,n,r){var i=t[ve];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?t[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){ce(15)}},Is=function(){function e(n,r,i,o){n===void 0&&(n="ObservableArray@"+It()),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 vn(n),this.enhancer_=function(s,a){return r(s,a,n+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},t.intercept_=function(r){return Zr(this,r)},t.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),ei(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&ce("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var o=new Array(r-i),s=0;s<r-i;s++)o[s]=void 0;this.spliceWithArray_(i,0,o)}else this.spliceWithArray_(r,i-r)},t.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&ce(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&lc(r+i+1)},t.spliceWithArray_=function(r,i,o){var s=this;qt(this.atom_);var a=this.values_.length;if(r===void 0?r=0:r>a?r=a:r<0&&(r=Math.max(0,a+r)),arguments.length===1?i=a-r:i==null?i=0:i=Math.max(0,Math.min(i,a-r)),o===void 0&&(o=Bi),vt(this)){var l=bt(this,{object:this.proxy_,type:cu,index:r,removedCount:i,added:o});if(!l)return Bi;i=l.removedCount,o=l.added}o=o.length===0?o:o.map(function(g){return s.enhancer_(g,void 0)}),this.legacyMode_;var c=o.length-i;this.updateArrayLength_(a,c);var d=this.spliceItemsIntoValues_(r,i,o);return(i!==0||o.length!==0)&&this.notifyArraySplice_(r,o,d),this.dehanceValues_(d)},t.spliceItemsIntoValues_=function(r,i,o){if(o.length<zh){var s;return(s=this.values_).splice.apply(s,[r,i].concat(o))}else{var a=this.values_.slice(r,r+i),l=this.values_.slice(r+i);this.values_.length+=o.length-i;for(var c=0;c<o.length;c++)this.values_[r+c]=o[c];for(var d=0;d<l.length;d++)this.values_[r+o.length+d]=l[d];return a}},t.notifyArrayChildUpdate_=function(r,i,o){var s=!this.owned_&&Xe(),a=Bt(this),l=a||s?{observableKind:"array",object:this.proxy_,type:Mt,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:o}:null;s&&ft(l),this.atom_.reportChanged(),a&&Dt(this,l),s&&dt()},t.notifyArraySplice_=function(r,i,o){var s=!this.owned_&&Xe(),a=Bt(this),l=a||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:cu,index:r,removed:o,added:i,removedCount:o.length,addedCount:i.length}:null;s&&ft(l),this.atom_.reportChanged(),a&&Dt(this,l),s&&dt()},t.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+r+") 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_[r])},t.set_=function(r,i){var o=this.values_;if(this.legacyMode_&&r>o.length&&ce(17,r,o.length),r<o.length){qt(this.atom_);var s=o[r];if(vt(this)){var a=bt(this,{type:Mt,object:this.proxy_,index:r,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,s);var l=i!==s;l&&(o[r]=i,this.notifyArrayChildUpdate_(r,i,s))}else{for(var c=new Array(r+1-o.length),d=0;d<c.length-1;d++)c[d]=void 0;c[c.length-1]=i,this.spliceWithArray_(o.length,0,c)}},e}();function Kh(e,t,n,r){return n===void 0&&(n="ObservableArray@"+It()),r===void 0&&(r=!1),wu(),Vn(function(){var i=new Is(n,t,r,!1);Au(i.values_,ve,i);var o=new Proxy(i.values_,Vh);return i.proxy_=o,e&&e.length&&i.spliceWithArray_(0,0,e),o})}var Fi={clear:function(){return this.splice(0)},replace:function(t){var n=this[ve];return n.spliceWithArray_(0,n.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];var s=this[ve];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(t);case 2:return s.spliceWithArray_(t,n)}return s.spliceWithArray_(t,n,i)},spliceWithArray:function(t,n,r){return this[ve].spliceWithArray_(t,n,r)},push:function(){for(var t=this[ve],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,r),t.values_.length},pop:function(){return this.splice(Math.max(this[ve].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[ve],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(0,0,r),t.values_.length},reverse:function(){return X.trackingDerivation&&ce(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){X.trackingDerivation&&ce(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[ve],r=n.dehanceValues_(n.values_).indexOf(t);return r>-1?(this.splice(r,1),!0):!1}};xe("at",pt);xe("concat",pt);xe("flat",pt);xe("includes",pt);xe("indexOf",pt);xe("join",pt);xe("lastIndexOf",pt);xe("slice",pt);xe("toString",pt);xe("toLocaleString",pt);xe("toSorted",pt);xe("toSpliced",pt);xe("with",pt);xe("every",jt);xe("filter",jt);xe("find",jt);xe("findIndex",jt);xe("findLast",jt);xe("findLastIndex",jt);xe("flatMap",jt);xe("forEach",jt);xe("map",jt);xe("some",jt);xe("toReversed",jt);xe("reduce",oc);xe("reduceRight",oc);function xe(e,t){typeof Array.prototype[e]=="function"&&(Fi[e]=t(e))}function pt(e){return function(){var t=this[ve];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function jt(e){return function(t,n){var r=this,i=this[ve];i.atom_.reportObserved();var o=i.dehanceValues_(i.values_);return o[e](function(s,a){return t.call(n,s,a,r)})}}function oc(e){return function(){var t=this,n=this[ve];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(o,s,a){return i(o,s,a,t)},r[e].apply(r,arguments)}}var qh=mn("ObservableArrayAdministration",Is);function wr(e){return qi(e)&&qh(e[ve])}var Gh={},hn="add",zi="delete",sc=function(){function e(n,r,i){var o=this;r===void 0&&(r=Dn),i===void 0&&(i="ObservableMap@"+It()),this.enhancer_=void 0,this.name_=void 0,this[ve]=Gh,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_=r,this.name_=i,je(Map)||ce(18),Vn(function(){o.keysAtom_=Su(o.name_+".keys()"),o.data_=new Map,o.hasMap_=new Map,n&&o.merge(n)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var i=this;if(!X.trackingDerivation)return this.has_(r);var o=this.hasMap_.get(r);if(!o){var s=o=new yn(this.has_(r),Ji,this.name_+"."+us(r)+"?",!1);this.hasMap_.set(r,s),zn(s,function(){return i.hasMap_.delete(r)})}return o.get()},t.set=function(r,i){var o=this.has_(r);if(vt(this)){var s=bt(this,{type:o?Mt:hn,object:this,newValue:i,name:r});if(!s)return this;i=s.newValue}return o?this.updateValue_(r,i):this.addValue_(r,i),this},t.delete=function(r){var i=this;if(qt(this.keysAtom_),vt(this)){var o=bt(this,{type:zi,object:this,name:r});if(!o)return!1}if(this.has_(r)){var s=Xe(),a=Bt(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:zi,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return s&&ft(l),nn(function(){var c;i.keysAtom_.reportChanged(),(c=i.hasMap_.get(r))==null||c.setNewValue_(!1);var d=i.data_.get(r);d.setNewValue_(void 0),i.data_.delete(r)}),a&&Dt(this,l),s&&dt(),!0}return!1},t.updateValue_=function(r,i){var o=this.data_.get(r);if(i=o.prepareNewValue_(i),i!==X.UNCHANGED){var s=Xe(),a=Bt(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:Mt,object:this,oldValue:o.value_,name:r,newValue:i}:null;s&&ft(l),o.setNewValue_(i),a&&Dt(this,l),s&&dt()}},t.addValue_=function(r,i){var o=this;qt(this.keysAtom_),nn(function(){var c,d=new yn(i,o.enhancer_,o.name_+"."+us(r),!1);o.data_.set(r,d),i=d.value_,(c=o.hasMap_.get(r))==null||c.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=Xe(),a=Bt(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:hn,object:this,name:r,newValue:i}:null;s&&ft(l),a&&Dt(this,l),s&&dt()},t.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var r=this,i=this.keys();return lu({next:function(){var s=i.next(),a=s.done,l=s.value;return{done:a,value:a?void 0:r.get(l)}}})},t.entries=function(){var r=this,i=this.keys();return lu({next:function(){var s=i.next(),a=s.done,l=s.value;return{done:a,value:a?void 0:[l,r.get(l)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(r,i){for(var o=hr(this),s;!(s=o()).done;){var a=s.value,l=a[0],c=a[1];r.call(i,c,l,this)}},t.merge=function(r){var i=this;return Ht(r)&&(r=new Map(r)),nn(function(){Lt(r)?lp(r).forEach(function(o){return i.set(o,r[o])}):Array.isArray(r)?r.forEach(function(o){var s=o[0],a=o[1];return i.set(s,a)}):mr(r)?(cp(r)||ce(19,r),r.forEach(function(o,s){return i.set(s,o)})):r!=null&&ce(20,r)}),this},t.clear=function(){var r=this;nn(function(){Pe(function(){for(var i=hr(r.keys()),o;!(o=i()).done;){var s=o.value;r.delete(s)}})})},t.replace=function(r){var i=this;return nn(function(){for(var o=Wh(r),s=new Map,a=!1,l=hr(i.data_.keys()),c;!(c=l()).done;){var d=c.value;if(!o.has(d)){var g=i.delete(d);if(g)a=!0;else{var C=i.data_.get(d);s.set(d,C)}}}for(var I=hr(o.entries()),S;!(S=I()).done;){var z=S.value,J=z[0],F=z[1],k=i.data_.has(J);if(i.set(J,F),i.data_.has(J)){var K=i.data_.get(J);s.set(J,K),k||(a=!0)}}if(!a)if(i.data_.size!==s.size)i.keysAtom_.reportChanged();else for(var W=i.data_.keys(),j=s.keys(),Z=W.next(),G=j.next();!Z.done;){if(Z.value!==G.value){i.keysAtom_.reportChanged();break}Z=W.next(),G=j.next()}i.data_=s}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,i){return i===!0&&ce("`observe` doesn't support fireImmediately=true in combination with maps."),ei(this,r)},t.intercept_=function(r){return Zr(this,r)},vr(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Ht=mn("ObservableMap",sc);function lu(e){return e[Symbol.toStringTag]="MapIterator",Rs(e)}function Wh(e){if(mr(e)||Ht(e))return e;if(Array.isArray(e))return new Map(e);if(Lt(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return ce(21,e)}var Hh={},ac=function(){function e(n,r,i){var o=this;r===void 0&&(r=Dn),i===void 0&&(i="ObservableSet@"+It()),this.name_=void 0,this[ve]=Hh,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)||ce(22),this.enhancer_=function(s,a){return r(s,a,i)},Vn(function(){o.atom_=Su(o.name_),n&&o.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.clear=function(){var r=this;nn(function(){Pe(function(){for(var i=hr(r.data_.values()),o;!(o=i()).done;){var s=o.value;r.delete(s)}})})},t.forEach=function(r,i){for(var o=hr(this),s;!(s=o()).done;){var a=s.value;r.call(i,a,a,this)}},t.add=function(r){var i=this;if(qt(this.atom_),vt(this)){var o=bt(this,{type:hn,object:this,newValue:r});if(!o)return this;r=o.newValue}if(!this.has(r)){nn(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var s=Xe(),a=Bt(this),l=a||s?{observableKind:"set",debugObjectName:this.name_,type:hn,object:this,newValue:r}:null;s&&ft(l),a&&Dt(this,l),s&&dt()}return this},t.delete=function(r){var i=this;if(vt(this)){var o=bt(this,{type:zi,object:this,oldValue:r});if(!o)return!1}if(this.has(r)){var s=Xe(),a=Bt(this),l=a||s?{observableKind:"set",debugObjectName:this.name_,type:zi,object:this,oldValue:r}:null;return s&&ft(l),nn(function(){i.atom_.reportChanged(),i.data_.delete(r)}),a&&Dt(this,l),s&&dt(),!0}return!1},t.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},t.entries=function(){var r=this.values();return fu({next:function(){var o=r.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 r=this,i=this.data_.values();return fu({next:function(){var s=i.next(),a=s.value,l=s.done;return l?{value:void 0,done:l}:{value:r.dehanceValue_(a),done:l}}})},t.intersection=function(r){if(tn(r)&&!Ut(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(tn(r)&&!Ut(r))return r.union(this);var i=new Set(this);return i.union(r)},t.difference=function(r){return new Set(this).difference(r)},t.symmetricDifference=function(r){if(tn(r)&&!Ut(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},t.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},t.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},t.isDisjointFrom=function(r){if(tn(r)&&!Ut(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},t.replace=function(r){var i=this;return Ut(r)&&(r=new Set(r)),nn(function(){Array.isArray(r)?(i.clear(),r.forEach(function(o){return i.add(o)})):tn(r)?(i.clear(),r.forEach(function(o){return i.add(o)})):r!=null&&ce("Cannot initialize set from "+r)}),this},t.observe_=function(r,i){return i===!0&&ce("`observe` doesn't support fireImmediately=true in combination with sets."),ei(this,r)},t.intercept_=function(r){return Zr(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},vr(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Ut=mn("ObservableSet",ac);function fu(e){return e[Symbol.toStringTag]="SetIterator",Rs(e)}var du=Object.create(null),pu="remove",ms=function(){function e(n,r,i,o){r===void 0&&(r=new Map),o===void 0&&(o=Fp),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_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=o,this.keysAtom_=new vn(this.name_+".keys"),this.isPlainObject_=Lt(this.target_),fc(this.defaultAnnotation_)||ce("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(r){return this.values_.get(r).get()},t.setObservablePropValue_=function(r,i){var o=this.values_.get(r);if(o instanceof Ot)return o.set(i),!0;if(vt(this)){var s=bt(this,{type:Mt,object:this.proxy_||this.target_,name:r,newValue:i});if(!s)return null;i=s.newValue}if(i=o.prepareNewValue_(i),i!==X.UNCHANGED){var a=Bt(this),l=Xe(),c=a||l?{type:Mt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:r,newValue:i}:null;l&&ft(c),o.setNewValue_(i),a&&Dt(this,c),l&&dt()}return!0},t.get_=function(r){return X.trackingDerivation&&!Tt(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,o){return o===void 0&&(o=!1),Tt(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):o?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},t.has_=function(r){if(!X.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new yn(r in this.target_,Ji,this.name_+"."+us(r)+"?",!1),this.pendingKeys_.set(r,i)),i.get()},t.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(gu(this,i,r),!(r in this.target_)){var o;if((o=this.target_[st])!=null&&o[r])return;ce(1,i.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==Gr;){var a=Mi(s,r);if(a){var l=i.make_(this,r,a,s);if(l===0)return;if(l===1)break}s=Object.getPrototypeOf(s)}yu(this,i,r)}},t.extend_=function(r,i,o,s){if(s===void 0&&(s=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(r,i,s);gu(this,o,r);var a=o.extend_(this,r,i,s);return a&&yu(this,o,r),a},t.defineProperty_=function(r,i,o){o===void 0&&(o=!1),qt(this.keysAtom_);try{_t();var s=this.delete_(r);if(!s)return s;if(vt(this)){var a=bt(this,{object:this.proxy_||this.target_,name:r,type:hn,newValue:i.value});if(!a)return null;var l=a.newValue;i.value!==l&&(i=on({},i,{value:l}))}if(o){if(!Reflect.defineProperty(this.target_,r,i))return!1}else Gt(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{wt()}return!0},t.defineObservableProperty_=function(r,i,o,s){s===void 0&&(s=!1),qt(this.keysAtom_);try{_t();var a=this.delete_(r);if(!a)return a;if(vt(this)){var l=bt(this,{object:this.proxy_||this.target_,name:r,type:hn,newValue:i});if(!l)return null;i=l.newValue}var c=hu(r),d={configurable:X.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(s){if(!Reflect.defineProperty(this.target_,r,d))return!1}else Gt(this.target_,r,d);var g=new yn(i,o,this.name_+"."+r.toString(),!1);this.values_.set(r,g),this.notifyPropertyAddition_(r,g.value_)}finally{wt()}return!0},t.defineComputedProperty_=function(r,i,o){o===void 0&&(o=!1),qt(this.keysAtom_);try{_t();var s=this.delete_(r);if(!s)return s;if(vt(this)){var a=bt(this,{object:this.proxy_||this.target_,name:r,type:hn,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+r.toString()),i.context=this.proxy_||this.target_;var l=hu(r),c={configurable:X.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(o){if(!Reflect.defineProperty(this.target_,r,c))return!1}else Gt(this.target_,r,c);this.values_.set(r,new Ot(i)),this.notifyPropertyAddition_(r,void 0)}finally{wt()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),qt(this.keysAtom_),!Tt(this.target_,r))return!0;if(vt(this)){var o=bt(this,{object:this.proxy_||this.target_,name:r,type:pu});if(!o)return null}try{var s;_t();var a=Bt(this),l=Xe(),c=this.values_.get(r),d=void 0;if(!c&&(a||l)){var g;d=(g=Mi(this.target_,r))==null?void 0:g.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(delete this.appliedAnnotations_[r],c&&(this.values_.delete(r),c instanceof yn&&(d=c.value_),qu(c)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),a||l){var C={type:pu,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:r};l&&ft(C),a&&Dt(this,C),l&&dt()}}finally{wt()}return!0},t.observe_=function(r,i){return i===!0&&ce("`observe` doesn't support the fire immediately property for observable objects."),ei(this,r)},t.intercept_=function(r){return Zr(this,r)},t.notifyPropertyAddition_=function(r,i){var o,s=Bt(this),a=Xe();if(s||a){var l=s||a?{type:hn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;a&&ft(l),s&&Dt(this,l),a&&dt()}(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Wi(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Tr(e,t){var n;if(t&&jn(e)&&ce("Options can't be provided for already observable objects."),Tt(e,ve))return $s(e)instanceof ms||ce("Cannot convert '"+Vi(e)+`' into observable object:
26
26
  The target is already observable of different type.
27
- Extending builtins is not supported.`),e;Object.isExtensible(e)||ce("Cannot make the designated object observable; it is not extensible");var r=(n=t?.name)!=null?n:(Lt(e)?"ObservableObject":e.constructor.name)+"@"+It(),i=new ys(e,new Map,String(r),Qp(t));return Gi(e,ve,i),e}var Jh=mn("ObservableObjectAdministration",ys);function du(e){return lu[e]||(lu[e]={get:function(){return this[ve].getObservablePropValue_(e)},set:function(n){return this[ve].setObservablePropValue_(e,n)}})}function jn(e){return qi(e)?Jh(e[ve]):!1}function pu(e,t,n){var r;e.appliedAnnotations_[n]=t,(r=e.target_[st])==null||delete r[n]}function hu(e,t,n){if(cc(t)||ce("Cannot annotate '"+e.name_+"."+n.toString()+"': Invalid annotation."),!Di(t)&&Tt(e.appliedAnnotations_,n)){var r=e.name_+"."+n.toString(),i=e.appliedAnnotations_[n].annotationType_,o=t.annotationType_;ce("Cannot apply '"+o+"' to '"+r+"':"+(`
27
+ Extending builtins is not supported.`),e;Object.isExtensible(e)||ce("Cannot make the designated object observable; it is not extensible");var r=(n=t?.name)!=null?n:(Lt(e)?"ObservableObject":e.constructor.name)+"@"+It(),i=new ms(e,new Map,String(r),Qp(t));return Gi(e,ve,i),e}var Jh=mn("ObservableObjectAdministration",ms);function hu(e){return du[e]||(du[e]={get:function(){return this[ve].getObservablePropValue_(e)},set:function(n){return this[ve].setObservablePropValue_(e,n)}})}function jn(e){return qi(e)?Jh(e[ve]):!1}function yu(e,t,n){var r;e.appliedAnnotations_[n]=t,(r=e.target_[st])==null||delete r[n]}function gu(e,t,n){if(fc(t)||ce("Cannot annotate '"+e.name_+"."+n.toString()+"': Invalid annotation."),!Di(t)&&Tt(e.appliedAnnotations_,n)){var r=e.name_+"."+n.toString(),i=e.appliedAnnotations_[n].annotationType_,o=t.annotationType_;ce("Cannot apply '"+o+"' to '"+r+"':"+(`
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 Xh=ac(0),Yh=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),os=0,sc=function(){};function Qh(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Qh(sc,Array.prototype);var Es=function(e){function t(r,i,o,s){var a;return o===void 0&&(o="ObservableArray@"+It()),s===void 0&&(s=!1),a=e.call(this)||this,Vn(function(){var l=new Os(o,i,s,!0);l.proxy_=a,wu(a,ve,l),r&&r.length&&a.spliceWithArray(0,0,r),Yh&&Object.defineProperty(a,"0",Xh)}),a}Ou(t,e);var n=t.prototype;return n.concat=function(){this[ve].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 wr(a)?a.slice():a}))},n[Symbol.iterator]=function(){var r=this,i=0;return $s({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},vr(t,[{key:"length",get:function(){return this[ve].getArrayLength_()},set:function(i){this[ve].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(sc);Object.entries(Fi).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&Gi(Es.prototype,t,n)});function ac(e){return{enumerable:!1,configurable:!0,get:function(){return this[ve].get_(e)},set:function(n){this[ve].set_(e,n)}}}function Zh(e){Gt(Es.prototype,""+e,ac(e))}function uc(e){if(e>os){for(var t=os;t<e+100;t++)Zh(t);os=e}}uc(1e3);function ey(e,t,n){return new Es(e,t,n)}function Et(e,t){if(typeof e=="object"&&e!==null){if(wr(e))return t!==void 0&&ce(23),e[ve].atom_;if(Ut(e))return e.atom_;if(Ht(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||ce(25,t,Vi(e)),n}if(jn(e)){if(!t)return ce(26);var r=e[ve].values_.get(t);return r||ce(27,t,Vi(e)),r}if(bs(e)||Xr(e)||ji(e))return e}else if(je(e)&&ji(e[ve]))return e[ve];ce(28)}function Is(e,t){if(e||ce(29),t!==void 0)return Is(Et(e,t));if(bs(e)||Xr(e)||ji(e)||Ht(e)||Ut(e))return e;if(e[ve])return e[ve];ce(24,e)}function Vi(e,t){var n;if(t!==void 0)n=Et(e,t);else{if(gn(e))return e.name;jn(e)||Ht(e)||Ut(e)?n=Is(e):n=Et(e)}return n.name_}function Vn(e){var t=Fn(),n=Yi(!0);_t();try{return e()}finally{wt(),Qi(n),rn(t)}}var yu=Gr.toString;function Ss(e,t,n){return n===void 0&&(n=-1),gs(e,t,n)}function gs(e,t,n,r,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=yu.call(e);if(s!==yu.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]":n>=0&&n++;break}e=gu(e),t=gu(t);var a=s==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(je(l)&&l instanceof l&&je(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var d=r.length;d--;)if(r[d]===e)return i[d]===t;if(r.push(e),i.push(t),a){if(d=e.length,d!==t.length)return!1;for(;d--;)if(!gs(e[d],t[d],n-1,r,i))return!1}else{var g=Object.keys(e),C=g.length;if(Object.keys(t).length!==C)return!1;for(var I=0;I<C;I++){var S=g[I];if(!(Tt(t,S)&&gs(e[S],t[S],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function gu(e){return wr(e)?e.slice():mr(e)||Ht(e)||tn(e)||Ut(e)?Array.from(e.entries()):e}var mu,ty=((mu=Ki().Iterator)==null?void 0:mu.prototype)||{};function $s(e){return e[Symbol.iterator]=ny,Object.assign(Object.create(ty),e)}function ny(){return this}function cc(e){return e instanceof Object&&typeof e.annotationType_=="string"&&je(e.make_)&&je(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Ki();typeof t[e]>"u"&&ce("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Th,extras:{getDebugName:Vi},$mobx:ve});var ry=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},n=typeof window<"u"&&typeof window.document<"u",r=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=n,e.isWebWorker=i,e.isNode=r,e.isJsDom=o,e.isDeno=s}}),iy=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(n,r){r||(r={}),typeof r=="function"&&(r={cmp:r});var i=typeof r.cycles=="boolean"?r.cycles:!1,o=r.cmp&&function(a){return function(l){return function(c,d){var g={key:c,value:l[c]},C={key:d,value:l[d]};return a(g,C)}}}(r.cmp),s=[];return function a(l){if(l&&l.toJSON&&typeof l.toJSON=="function"&&(l=l.toJSON()),l!==void 0){if(typeof l=="number")return isFinite(l)?""+l:"null";if(typeof l!="object")return JSON.stringify(l);var c,d;if(Array.isArray(l)){for(d="[",c=0;c<l.length;c++)c&&(d+=","),d+=a(l[c])||"null";return d+"]"}if(l===null)return"null";if(s.indexOf(l)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=s.push(l)-1,C=Object.keys(l).sort(o&&o(l));for(d="",c=0;c<C.length;c++){var I=C[c],S=a(l[I]);S&&(d&&(d+=","),d+=JSON.stringify(I)+":"+S)}return s.splice(g,1),"{"+d+"}"}}(n)}}}),oy=De({"../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:n}=Object.prototype,r=F();r.configure=F,r.stringify=r,r.default=r,e.stringify=r,e.configure=F,t.exports=r;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function o(k){return k.length<5e3&&!i.test(k)?`"${k}"`:JSON.stringify(k)}function s(k,K){if(k.length>200||K)return k.sort(K);for(let W=1;W<k.length;W++){let j=k[W],Z=W;for(;Z!==0&&k[Z-1]>j;)k[Z]=k[Z-1],Z--;k[Z]=j}return k}var a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(k){return a.call(k)!==void 0&&k.length!==0}function c(k,K,W){k.length<W&&(W=k.length);let j=K===","?"":" ",Z=`"0":${j}${k[0]}`;for(let G=1;G<W;G++)Z+=`${K}"${G}":${j}${k[G]}`;return Z}function d(k){if(n.call(k,"circularValue")){let K=k.circularValue;if(typeof K=="string")return`"${K}"`;if(K==null)return K;if(K===Error||K===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(k){let K;if(n.call(k,"deterministic")&&(K=k.deterministic,typeof K!="boolean"&&typeof K!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return K===void 0?!0:K}function C(k,K){let W;if(n.call(k,K)&&(W=k[K],typeof W!="boolean"))throw new TypeError(`The "${K}" argument must be of type boolean`);return W===void 0?!0:W}function I(k,K){let W;if(n.call(k,K)){if(W=k[K],typeof W!="number")throw new TypeError(`The "${K}" argument must be of type number`);if(!Number.isInteger(W))throw new TypeError(`The "${K}" argument must be an integer`);if(W<1)throw new RangeError(`The "${K}" argument must be >= 1`)}return W===void 0?1/0:W}function S(k){return k===1?"1 item":`${k} items`}function z(k){let K=new Set;for(let W of k)(typeof W=="string"||typeof W=="number")&&K.add(String(W));return K}function J(k){if(n.call(k,"strict")){let K=k.strict;if(typeof K!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(K)return W=>{let j=`Object can not safely be stringified. Received type ${typeof W}`;throw typeof W!="function"&&(j+=` (${W.toString()})`),new Error(j)}}}function F(k){k={...k};let K=J(k);K&&(k.bigint===void 0&&(k.bigint=!1),"circularValue"in k||(k.circularValue=Error));let W=d(k),j=C(k,"bigint"),Z=g(k),G=typeof Z=="function"?Z:void 0,fe=I(k,"maximumDepth"),x=I(k,"maximumBreadth");function M(ae,D,H,Y,he,f){let _=D[ae];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(ae)),_=Y.call(D,ae,_),typeof _){case"string":return o(_);case"object":{if(_===null)return"null";if(H.indexOf(_)!==-1)return W;let E="",U=",",P=f;if(Array.isArray(_)){if(_.length===0)return"[]";if(fe<H.length+1)return'"[Array]"';H.push(_),he!==""&&(f+=he,E+=`
30
+ Use 'override' annotation for methods overridden by subclass.`)}}var Xh=cc(0),Yh=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),as=0,uc=function(){};function Qh(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Qh(uc,Array.prototype);var Ss=function(e){function t(r,i,o,s){var a;return o===void 0&&(o="ObservableArray@"+It()),s===void 0&&(s=!1),a=e.call(this)||this,Vn(function(){var l=new Is(o,i,s,!0);l.proxy_=a,Au(a,ve,l),r&&r.length&&a.spliceWithArray(0,0,r),Yh&&Object.defineProperty(a,"0",Xh)}),a}Iu(t,e);var n=t.prototype;return n.concat=function(){this[ve].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 wr(a)?a.slice():a}))},n[Symbol.iterator]=function(){var r=this,i=0;return Rs({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},vr(t,[{key:"length",get:function(){return this[ve].getArrayLength_()},set:function(i){this[ve].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(uc);Object.entries(Fi).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&Gi(Ss.prototype,t,n)});function cc(e){return{enumerable:!1,configurable:!0,get:function(){return this[ve].get_(e)},set:function(n){this[ve].set_(e,n)}}}function Zh(e){Gt(Ss.prototype,""+e,cc(e))}function lc(e){if(e>as){for(var t=as;t<e+100;t++)Zh(t);as=e}}lc(1e3);function ey(e,t,n){return new Ss(e,t,n)}function Et(e,t){if(typeof e=="object"&&e!==null){if(wr(e))return t!==void 0&&ce(23),e[ve].atom_;if(Ut(e))return e.atom_;if(Ht(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||ce(25,t,Vi(e)),n}if(jn(e)){if(!t)return ce(26);var r=e[ve].values_.get(t);return r||ce(27,t,Vi(e)),r}if(ws(e)||Xr(e)||ji(e))return e}else if(je(e)&&ji(e[ve]))return e[ve];ce(28)}function $s(e,t){if(e||ce(29),t!==void 0)return $s(Et(e,t));if(ws(e)||Xr(e)||ji(e)||Ht(e)||Ut(e))return e;if(e[ve])return e[ve];ce(24,e)}function Vi(e,t){var n;if(t!==void 0)n=Et(e,t);else{if(gn(e))return e.name;jn(e)||Ht(e)||Ut(e)?n=$s(e):n=Et(e)}return n.name_}function Vn(e){var t=Fn(),n=Yi(!0);_t();try{return e()}finally{wt(),Qi(n),rn(t)}}var mu=Gr.toString;function Ns(e,t,n){return n===void 0&&(n=-1),vs(e,t,n)}function vs(e,t,n,r,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=mu.call(e);if(s!==mu.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]":n>=0&&n++;break}e=vu(e),t=vu(t);var a=s==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(je(l)&&l instanceof l&&je(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var d=r.length;d--;)if(r[d]===e)return i[d]===t;if(r.push(e),i.push(t),a){if(d=e.length,d!==t.length)return!1;for(;d--;)if(!vs(e[d],t[d],n-1,r,i))return!1}else{var g=Object.keys(e),C=g.length;if(Object.keys(t).length!==C)return!1;for(var I=0;I<C;I++){var S=g[I];if(!(Tt(t,S)&&vs(e[S],t[S],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function vu(e){return wr(e)?e.slice():mr(e)||Ht(e)||tn(e)||Ut(e)?Array.from(e.entries()):e}var bu,ty=((bu=Ki().Iterator)==null?void 0:bu.prototype)||{};function Rs(e){return e[Symbol.iterator]=ny,Object.assign(Object.create(ty),e)}function ny(){return this}function fc(e){return e instanceof Object&&typeof e.annotationType_=="string"&&je(e.make_)&&je(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Ki();typeof t[e]>"u"&&ce("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Th,extras:{getDebugName:Vi},$mobx:ve});var ry=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},n=typeof window<"u"&&typeof window.document<"u",r=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=n,e.isWebWorker=i,e.isNode=r,e.isJsDom=o,e.isDeno=s}}),iy=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(n,r){r||(r={}),typeof r=="function"&&(r={cmp:r});var i=typeof r.cycles=="boolean"?r.cycles:!1,o=r.cmp&&function(a){return function(l){return function(c,d){var g={key:c,value:l[c]},C={key:d,value:l[d]};return a(g,C)}}}(r.cmp),s=[];return function a(l){if(l&&l.toJSON&&typeof l.toJSON=="function"&&(l=l.toJSON()),l!==void 0){if(typeof l=="number")return isFinite(l)?""+l:"null";if(typeof l!="object")return JSON.stringify(l);var c,d;if(Array.isArray(l)){for(d="[",c=0;c<l.length;c++)c&&(d+=","),d+=a(l[c])||"null";return d+"]"}if(l===null)return"null";if(s.indexOf(l)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=s.push(l)-1,C=Object.keys(l).sort(o&&o(l));for(d="",c=0;c<C.length;c++){var I=C[c],S=a(l[I]);S&&(d&&(d+=","),d+=JSON.stringify(I)+":"+S)}return s.splice(g,1),"{"+d+"}"}}(n)}}}),oy=De({"../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:n}=Object.prototype,r=F();r.configure=F,r.stringify=r,r.default=r,e.stringify=r,e.configure=F,t.exports=r;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function o(k){return k.length<5e3&&!i.test(k)?`"${k}"`:JSON.stringify(k)}function s(k,K){if(k.length>200||K)return k.sort(K);for(let W=1;W<k.length;W++){let j=k[W],Z=W;for(;Z!==0&&k[Z-1]>j;)k[Z]=k[Z-1],Z--;k[Z]=j}return k}var a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(k){return a.call(k)!==void 0&&k.length!==0}function c(k,K,W){k.length<W&&(W=k.length);let j=K===","?"":" ",Z=`"0":${j}${k[0]}`;for(let G=1;G<W;G++)Z+=`${K}"${G}":${j}${k[G]}`;return Z}function d(k){if(n.call(k,"circularValue")){let K=k.circularValue;if(typeof K=="string")return`"${K}"`;if(K==null)return K;if(K===Error||K===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(k){let K;if(n.call(k,"deterministic")&&(K=k.deterministic,typeof K!="boolean"&&typeof K!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return K===void 0?!0:K}function C(k,K){let W;if(n.call(k,K)&&(W=k[K],typeof W!="boolean"))throw new TypeError(`The "${K}" argument must be of type boolean`);return W===void 0?!0:W}function I(k,K){let W;if(n.call(k,K)){if(W=k[K],typeof W!="number")throw new TypeError(`The "${K}" argument must be of type number`);if(!Number.isInteger(W))throw new TypeError(`The "${K}" argument must be an integer`);if(W<1)throw new RangeError(`The "${K}" argument must be >= 1`)}return W===void 0?1/0:W}function S(k){return k===1?"1 item":`${k} items`}function z(k){let K=new Set;for(let W of k)(typeof W=="string"||typeof W=="number")&&K.add(String(W));return K}function J(k){if(n.call(k,"strict")){let K=k.strict;if(typeof K!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(K)return W=>{let j=`Object can not safely be stringified. Received type ${typeof W}`;throw typeof W!="function"&&(j+=` (${W.toString()})`),new Error(j)}}}function F(k){k={...k};let K=J(k);K&&(k.bigint===void 0&&(k.bigint=!1),"circularValue"in k||(k.circularValue=Error));let W=d(k),j=C(k,"bigint"),Z=g(k),G=typeof Z=="function"?Z:void 0,fe=I(k,"maximumDepth"),x=I(k,"maximumBreadth");function M(ae,D,H,Y,he,f){let _=D[ae];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(ae)),_=Y.call(D,ae,_),typeof _){case"string":return o(_);case"object":{if(_===null)return"null";if(H.indexOf(_)!==-1)return W;let E="",U=",",P=f;if(Array.isArray(_)){if(_.length===0)return"[]";if(fe<H.length+1)return'"[Array]"';H.push(_),he!==""&&(f+=he,E+=`
31
31
  ${f}`,U=`,
32
32
  ${f}`);let A=Math.min(_.length,x),b=0;for(;b<A-1;b++){let N=M(String(b),_,H,Y,he,f);E+=N!==void 0?N:"null",E+=U}let v=M(String(b),_,H,Y,he,f);if(E+=v!==void 0?v:"null",_.length-1>x){let N=_.length-x-1;E+=`${U}"... ${S(N)} not stringified"`}return he!==""&&(E+=`
33
33
  ${P}`),H.pop(),`[${E}]`}let $=Object.keys(_),y=$.length;if(y===0)return"{}";if(fe<H.length+1)return'"[Object]"';let T="",w="";he!==""&&(f+=he,U=`,
@@ -45,20 +45,20 @@ ${he}`,u=Math.min(D.length,x),A=0;for(;A<u-1;A++){let v=ee(String(A),D[A],H,Y,he
45
45
  ${f}`,H.pop(),`[${T}]`}let _=Object.keys(D),E=_.length;if(E===0)return"{}";if(fe<H.length+1)return'"[Object]"';he+=Y;let U=`,
46
46
  ${he}`,P="",$="",y=Math.min(E,x);l(D)&&(P+=c(D,U,x),_=_.slice(D.length),y-=D.length,$=U),Z&&(_=s(_,G)),H.push(D);for(let T=0;T<y;T++){let w=_[T],u=ee(w,D[w],H,Y,he);u!==void 0&&(P+=`${$}${o(w)}: ${u}`,$=U)}if(E>x){let T=E-x;P+=`${$}"...": "${S(T)} not stringified"`,$=U}return $!==""&&(P=`
47
47
  ${he}${P}
48
- ${f}`),H.pop(),`{${P}}`}case"number":return isFinite(D)?String(D):K?K(D):"null";case"boolean":return D===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(D);default:return K?K(D):void 0}}function oe(ae,D,H){switch(typeof D){case"string":return o(D);case"object":{if(D===null)return"null";if(typeof D.toJSON=="function"){if(D=D.toJSON(ae),typeof D!="object")return oe(ae,D,H);if(D===null)return"null"}if(H.indexOf(D)!==-1)return W;let Y="",he=D.length!==void 0;if(he&&Array.isArray(D)){if(D.length===0)return"[]";if(fe<H.length+1)return'"[Array]"';H.push(D);let P=Math.min(D.length,x),$=0;for(;$<P-1;$++){let T=oe(String($),D[$],H);Y+=T!==void 0?T:"null",Y+=","}let y=oe(String($),D[$],H);if(Y+=y!==void 0?y:"null",D.length-1>x){let T=D.length-x-1;Y+=`,"... ${S(T)} not stringified"`}return H.pop(),`[${Y}]`}let f=Object.keys(D),_=f.length;if(_===0)return"{}";if(fe<H.length+1)return'"[Object]"';let E="",U=Math.min(_,x);he&&l(D)&&(Y+=c(D,",",x),f=f.slice(D.length),U-=D.length,E=","),Z&&(f=s(f,G)),H.push(D);for(let P=0;P<U;P++){let $=f[P],y=oe($,D[$],H);y!==void 0&&(Y+=`${E}${o($)}:${y}`,E=",")}if(_>x){let P=_-x;Y+=`${E}"...":"${S(P)} not stringified"`}return H.pop(),`{${Y}}`}case"number":return isFinite(D)?String(D):K?K(D):"null";case"boolean":return D===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(D);default:return K?K(D):void 0}}function Q(ae,D,H){if(arguments.length>1){let Y="";if(typeof H=="number"?Y=" ".repeat(Math.min(H,10)):typeof H=="string"&&(Y=H.slice(0,10)),D!=null){if(typeof D=="function")return M("",{"":ae},[],D,Y,"");if(Array.isArray(D))return L("",ae,[],z(D),Y,"")}if(Y.length!==0)return ee("",ae,[],Y,"")}return oe("",ae,[])}return Q}}}),Ir=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 c(j)&&Symbol.asyncIterator in j}e.IsAsyncIterator=t;function n(j){return c(j)&&Symbol.iterator in j}e.IsIterator=n;function r(j){return ArrayBuffer.isView(j)}e.IsTypedArray=r;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,Z){return Z in j}e.HasPropertyKey=a;function l(j){return c(j)&&k(j.constructor)&&j.constructor.name==="Object"}e.IsPlainObject=l;function c(j){return j!==null&&typeof j=="object"}e.IsObject=c;function d(j){return Array.isArray(j)&&!ArrayBuffer.isView(j)}e.IsArray=d;function g(j){return j===void 0}e.IsUndefined=g;function C(j){return j===null}e.IsNull=C;function I(j){return typeof j=="boolean"}e.IsBoolean=I;function S(j){return typeof j=="number"}e.IsNumber=S;function z(j){return S(j)&&Number.isInteger(j)}e.IsInteger=z;function J(j){return typeof j=="bigint"}e.IsBigInt=J;function F(j){return typeof j=="string"}e.IsString=F;function k(j){return typeof j=="function"}e.IsFunction=k;function K(j){return typeof j=="symbol"}e.IsSymbol=K;function W(j){return J(j)||I(j)||C(j)||S(j)||F(j)||K(j)||g(j)}e.IsValueType=W}}),_l=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=Ir(),n=Oo(),r=en(),i=class extends r.TypeBoxError{constructor(d){super(`Duplicate type kind '${d}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var o=class extends r.TypeBoxError{constructor(d){super(`Duplicate string format '${d}' detected`)}};e.TypeSystemDuplicateFormat=o;var s;(function(d){function g(I,S){if(r.TypeRegistry.Has(I))throw new i(I);return r.TypeRegistry.Set(I,S),(z={})=>r.Type.Unsafe({...z,[r.Kind]:I})}d.Type=g;function C(I,S){if(r.FormatRegistry.Has(I))throw new o(I);return r.FormatRegistry.Set(I,S),I}d.Format=C})(s||(e.TypeSystem=s={}));var a;(function(d){let g=c;function C(){g=c}d.Reset=C;function I(z){g=z}d.Set=I;function S(){return g}d.Get=S})(a||(e.TypeSystemErrorFunction=a={}));var l;(function(d){d.ExactOptionalPropertyTypes=!1,d.AllowArrayObject=!1,d.AllowNaN=!1,d.AllowNullVoid=!1;function g(J,F){return d.ExactOptionalPropertyTypes?F in J:J[F]!==void 0}d.IsExactOptionalProperty=g;function C(J){let F=(0,t.IsObject)(J);return d.AllowArrayObject?F:F&&!(0,t.IsArray)(J)}d.IsObjectLike=C;function I(J){return C(J)&&!(J instanceof Date)&&!(J instanceof Uint8Array)}d.IsRecordLike=I;function S(J){let F=(0,t.IsNumber)(J);return d.AllowNaN?F:F&&Number.isFinite(J)}d.IsNumberLike=S;function z(J){let F=(0,t.IsUndefined)(J);return d.AllowNullVoid?F||J===null:F}d.IsVoidLike=z})(l||(e.TypeSystemPolicy=l={}));function c(d,g){switch(g){case n.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case n.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${d.maxContains} matching values`;case n.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${d.minContains} matching values`;case n.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${d.maxItems}`;case n.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${d.minItems}`;case n.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case n.ValueErrorType.Array:return"Expected array";case n.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case n.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${d.exclusiveMaximum}`;case n.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${d.exclusiveMinimum}`;case n.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${d.maximum}`;case n.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${d.minimum}`;case n.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${d.multipleOf}`;case n.ValueErrorType.BigInt:return"Expected bigint";case n.ValueErrorType.Boolean:return"Expected boolean";case n.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${d.exclusiveMinimumTimestamp}`;case n.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${d.exclusiveMaximumTimestamp}`;case n.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${d.minimumTimestamp}`;case n.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${d.maximumTimestamp}`;case n.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${d.multipleOfTimestamp}`;case n.ValueErrorType.Date:return"Expected Date";case n.ValueErrorType.Function:return"Expected function";case n.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${d.exclusiveMaximum}`;case n.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${d.exclusiveMinimum}`;case n.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${d.maximum}`;case n.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${d.minimum}`;case n.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${d.multipleOf}`;case n.ValueErrorType.Integer:return"Expected integer";case n.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case n.ValueErrorType.Intersect:return"Expected all values to match";case n.ValueErrorType.Iterator:return"Expected Iterator";case n.ValueErrorType.Literal:return`Expected ${typeof d.const=="string"?`'${d.const}'`:d.const}`;case n.ValueErrorType.Never:return"Never";case n.ValueErrorType.Not:return"Value should not match";case n.ValueErrorType.Null:return"Expected null";case n.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${d.exclusiveMaximum}`;case n.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${d.exclusiveMinimum}`;case n.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${d.maximum}`;case n.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${d.minimum}`;case n.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${d.multipleOf}`;case n.ValueErrorType.Number:return"Expected number";case n.ValueErrorType.Object:return"Expected object";case n.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case n.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${d.maxProperties} properties`;case n.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${d.minProperties} properties`;case n.ValueErrorType.ObjectRequiredProperty:return"Required property";case n.ValueErrorType.Promise:return"Expected Promise";case n.ValueErrorType.StringFormatUnknown:return`Unknown format '${d.format}'`;case n.ValueErrorType.StringFormat:return`Expected string to match '${d.format}' format`;case n.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${d.maxLength}`;case n.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${d.minLength}`;case n.ValueErrorType.StringPattern:return`Expected string to match '${d.pattern}'`;case n.ValueErrorType.String:return"Expected string";case n.ValueErrorType.Symbol:return"Expected symbol";case n.ValueErrorType.TupleLength:return`Expected tuple to have ${d.maxItems||0} elements`;case n.ValueErrorType.Tuple:return"Expected tuple";case n.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${d.maxByteLength}`;case n.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${d.minByteLength}`;case n.ValueErrorType.Uint8Array:return"Expected Uint8Array";case n.ValueErrorType.Undefined:return"Expected undefined";case n.ValueErrorType.Union:return"Expected union value";case n.ValueErrorType.Void:return"Expected void";case n.ValueErrorType.Kind:return`Expected kind '${d[r.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=c}}),Ao=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=en(),n=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=n;function r(i,o){let s=o.findIndex(a=>a.$id===i.$ref);if(s===-1)throw new n(i);return o[s]}e.Deref=r}}),Qs=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=Ir(),n=class extends Error{constructor(M){super("Unable to hash value"),this.value=M}};e.ValueHashError=n;var r;(function(M){M[M.Undefined=0]="Undefined",M[M.Null=1]="Null",M[M.Boolean=2]="Boolean",M[M.Number=3]="Number",M[M.String=4]="String",M[M.Object=5]="Object",M[M.Array=6]="Array",M[M.Date=7]="Date",M[M.Uint8Array=8]="Uint8Array",M[M.Symbol=9]="Symbol",M[M.BigInt=10]="BigInt"})(r||(e.ByteMarker=r={}));var i=BigInt("14695981039346656037"),[o,s]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],a=Array.from({length:256}).map((M,L)=>BigInt(L)),l=new Float64Array(1),c=new DataView(l.buffer),d=new Uint8Array(l.buffer);function*g(M){let L=M===0?1:Math.ceil(Math.floor(Math.log2(M)+1)/8);for(let ee=0;ee<L;ee++)yield M>>8*(L-1-ee)&255}function C(M){fe(r.Array);for(let L of M)G(L)}function I(M){fe(r.Boolean),fe(M?1:0)}function S(M){fe(r.BigInt),c.setBigInt64(0,M);for(let L of d)fe(L)}function z(M){fe(r.Date),G(M.getTime())}function J(M){fe(r.Null)}function F(M){fe(r.Number),c.setFloat64(0,M);for(let L of d)fe(L)}function k(M){fe(r.Object);for(let L of globalThis.Object.keys(M).sort())G(L),G(M[L])}function K(M){fe(r.String);for(let L=0;L<M.length;L++)for(let ee of g(M.charCodeAt(L)))fe(ee)}function W(M){fe(r.Symbol),G(M.description)}function j(M){fe(r.Uint8Array);for(let L=0;L<M.length;L++)fe(M[L])}function Z(M){return fe(r.Undefined)}function G(M){if((0,t.IsArray)(M))return C(M);if((0,t.IsBoolean)(M))return I(M);if((0,t.IsBigInt)(M))return S(M);if((0,t.IsDate)(M))return z(M);if((0,t.IsNull)(M))return J(M);if((0,t.IsNumber)(M))return F(M);if((0,t.IsPlainObject)(M))return k(M);if((0,t.IsString)(M))return K(M);if((0,t.IsSymbol)(M))return W(M);if((0,t.IsUint8Array)(M))return j(M);if((0,t.IsUndefined)(M))return Z(M);throw new n(M)}function fe(M){i=i^a[M],i=i*o%s}function x(M){return i=BigInt("14695981039346656037"),G(M),i}e.Hash=x}}),Oo=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=Ir(),n=_l(),r=Ao(),i=Qs(),o=en(),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 l(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=l;function c(u){return u!==void 0}var d=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=d;function g(u,A,b,v){return{type:u,schema:A,path:b,value:v,message:n.TypeSystemErrorFunction.Get()(A,u)}}function*C(u,A,b,v){}function*I(u,A,b,v){if(!(0,t.IsArray)(v))return yield g(s.Array,u,b,v);c(u.minItems)&&!(v.length>=u.minItems)&&(yield g(s.ArrayMinItems,u,b,v)),c(u.maxItems)&&!(v.length<=u.maxItems)&&(yield g(s.ArrayMaxItems,u,b,v));for(let te=0;te<v.length;te++)yield*T(u.items,A,`${b}/${te}`,v[te]);if(u.uniqueItems===!0&&!function(){let te=new Set;for(let ne of v){let ge=(0,i.Hash)(ne);if(te.has(ge))return!1;te.add(ge)}return!0}()&&(yield g(s.ArrayUniqueItems,u,b,v)),!(c(u.contains)||c(u.minContains)||c(u.maxContains)))return;let N=c(u.contains)?u.contains:o.Type.Never(),q=v.reduce((te,ne,ge)=>T(N,A,`${b}${ge}`,ne).next().done===!0?te+1:te,0);q===0&&(yield g(s.ArrayContains,u,b,v)),(0,t.IsNumber)(u.minContains)&&q<u.minContains&&(yield g(s.ArrayMinContains,u,b,v)),(0,t.IsNumber)(u.maxContains)&&q>u.maxContains&&(yield g(s.ArrayMaxContains,u,b,v))}function*S(u,A,b,v){(0,t.IsAsyncIterator)(v)||(yield g(s.AsyncIterator,u,b,v))}function*z(u,A,b,v){if(!(0,t.IsBigInt)(v))return yield g(s.BigInt,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(s.BigIntExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(s.BigIntExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(s.BigIntMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(s.BigIntMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==BigInt(0)&&(yield g(s.BigIntMultipleOf,u,b,v))}function*J(u,A,b,v){(0,t.IsBoolean)(v)||(yield g(s.Boolean,u,b,v))}function*F(u,A,b,v){yield*T(u.returns,A,b,v.prototype)}function*k(u,A,b,v){if(!(0,t.IsDate)(v))return yield g(s.Date,u,b,v);c(u.exclusiveMaximumTimestamp)&&!(v.getTime()<u.exclusiveMaximumTimestamp)&&(yield g(s.DateExclusiveMaximumTimestamp,u,b,v)),c(u.exclusiveMinimumTimestamp)&&!(v.getTime()>u.exclusiveMinimumTimestamp)&&(yield g(s.DateExclusiveMinimumTimestamp,u,b,v)),c(u.maximumTimestamp)&&!(v.getTime()<=u.maximumTimestamp)&&(yield g(s.DateMaximumTimestamp,u,b,v)),c(u.minimumTimestamp)&&!(v.getTime()>=u.minimumTimestamp)&&(yield g(s.DateMinimumTimestamp,u,b,v)),c(u.multipleOfTimestamp)&&v.getTime()%u.multipleOfTimestamp!==0&&(yield g(s.DateMultipleOfTimestamp,u,b,v))}function*K(u,A,b,v){(0,t.IsFunction)(v)||(yield g(s.Function,u,b,v))}function*W(u,A,b,v){if(!(0,t.IsInteger)(v))return yield g(s.Integer,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(s.IntegerExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(s.IntegerExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(s.IntegerMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(s.IntegerMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==0&&(yield g(s.IntegerMultipleOf,u,b,v))}function*j(u,A,b,v){for(let N of u.allOf){let q=T(N,A,b,v).next();q.done||(yield g(s.Intersect,u,b,v),yield q.value)}if(u.unevaluatedProperties===!1){let N=new RegExp(o.KeyResolver.ResolvePattern(u));for(let q of Object.getOwnPropertyNames(v))N.test(q)||(yield g(s.IntersectUnevaluatedProperties,u,`${b}/${q}`,v))}if(typeof u.unevaluatedProperties=="object"){let N=new RegExp(o.KeyResolver.ResolvePattern(u));for(let q of Object.getOwnPropertyNames(v))if(!N.test(q)){let te=T(u.unevaluatedProperties,A,`${b}/${q}`,v[q]).next();te.done||(yield te.value)}}}function*Z(u,A,b,v){(0,t.IsIterator)(v)||(yield g(s.Iterator,u,b,v))}function*G(u,A,b,v){v!==u.const&&(yield g(s.Literal,u,b,v))}function*fe(u,A,b,v){yield g(s.Never,u,b,v)}function*x(u,A,b,v){T(u.not,A,b,v).next().done===!0&&(yield g(s.Not,u,b,v))}function*M(u,A,b,v){(0,t.IsNull)(v)||(yield g(s.Null,u,b,v))}function*L(u,A,b,v){if(!n.TypeSystemPolicy.IsNumberLike(v))return yield g(s.Number,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(s.NumberExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(s.NumberExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(s.NumberMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(s.NumberMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==0&&(yield g(s.NumberMultipleOf,u,b,v))}function*ee(u,A,b,v){if(!n.TypeSystemPolicy.IsObjectLike(v))return yield g(s.Object,u,b,v);c(u.minProperties)&&!(Object.getOwnPropertyNames(v).length>=u.minProperties)&&(yield g(s.ObjectMinProperties,u,b,v)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=u.maxProperties)&&(yield g(s.ObjectMaxProperties,u,b,v));let N=Array.isArray(u.required)?u.required:[],q=Object.getOwnPropertyNames(u.properties),te=Object.getOwnPropertyNames(v);for(let ne of N)te.includes(ne)||(yield g(s.ObjectRequiredProperty,u.properties[ne],`${b}/${l(ne)}`,void 0));if(u.additionalProperties===!1)for(let ne of te)q.includes(ne)||(yield g(s.ObjectAdditionalProperties,u,`${b}/${l(ne)}`,v[ne]));if(typeof u.additionalProperties=="object")for(let ne of te)q.includes(ne)||(yield*T(u.additionalProperties,A,`${b}/${l(ne)}`,v[ne]));for(let ne of q){let ge=u.properties[ne];u.required&&u.required.includes(ne)?(yield*T(ge,A,`${b}/${l(ne)}`,v[ne]),o.ExtendsUndefined.Check(u)&&!(ne in v)&&(yield g(s.ObjectRequiredProperty,ge,`${b}/${l(ne)}`,void 0))):n.TypeSystemPolicy.IsExactOptionalProperty(v,ne)&&(yield*T(ge,A,`${b}/${l(ne)}`,v[ne]))}}function*oe(u,A,b,v){(0,t.IsPromise)(v)||(yield g(s.Promise,u,b,v))}function*Q(u,A,b,v){if(!n.TypeSystemPolicy.IsRecordLike(v))return yield g(s.Object,u,b,v);c(u.minProperties)&&!(Object.getOwnPropertyNames(v).length>=u.minProperties)&&(yield g(s.ObjectMinProperties,u,b,v)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=u.maxProperties)&&(yield g(s.ObjectMaxProperties,u,b,v));let[N,q]=Object.entries(u.patternProperties)[0],te=new RegExp(N);for(let[ne,ge]of Object.entries(v))te.test(ne)&&(yield*T(q,A,`${b}/${l(ne)}`,ge));if(typeof u.additionalProperties=="object")for(let[ne,ge]of Object.entries(v))te.test(ne)||(yield*T(u.additionalProperties,A,`${b}/${l(ne)}`,ge));if(u.additionalProperties===!1){for(let[ne,ge]of Object.entries(v))if(!te.test(ne))return yield g(s.ObjectAdditionalProperties,u,`${b}/${l(ne)}`,ge)}}function*ae(u,A,b,v){yield*T((0,r.Deref)(u,A),A,b,v)}function*D(u,A,b,v){if(!(0,t.IsString)(v))return yield g(s.String,u,b,v);c(u.minLength)&&!(v.length>=u.minLength)&&(yield g(s.StringMinLength,u,b,v)),c(u.maxLength)&&!(v.length<=u.maxLength)&&(yield g(s.StringMaxLength,u,b,v)),(0,t.IsString)(u.pattern)&&(new RegExp(u.pattern).test(v)||(yield g(s.StringPattern,u,b,v))),(0,t.IsString)(u.format)&&(o.FormatRegistry.Has(u.format)?o.FormatRegistry.Get(u.format)(v)||(yield g(s.StringFormat,u,b,v)):yield g(s.StringFormatUnknown,u,b,v))}function*H(u,A,b,v){(0,t.IsSymbol)(v)||(yield g(s.Symbol,u,b,v))}function*Y(u,A,b,v){if(!(0,t.IsString)(v))return yield g(s.String,u,b,v);new RegExp(u.pattern).test(v)||(yield g(s.StringPattern,u,b,v))}function*he(u,A,b,v){yield*T((0,r.Deref)(u,A),A,b,v)}function*f(u,A,b,v){if(!(0,t.IsArray)(v))return yield g(s.Tuple,u,b,v);if(u.items===void 0&&v.length!==0)return yield g(s.TupleLength,u,b,v);if(v.length!==u.maxItems)return yield g(s.TupleLength,u,b,v);if(u.items)for(let N=0;N<u.items.length;N++)yield*T(u.items[N],A,`${b}/${N}`,v[N])}function*_(u,A,b,v){(0,t.IsUndefined)(v)||(yield g(s.Undefined,u,b,v))}function*E(u,A,b,v){let N=0;for(let q of u.anyOf){let te=[...T(q,A,b,v)];if(te.length===0)return;N+=te.length}N>0&&(yield g(s.Union,u,b,v))}function*U(u,A,b,v){if(!(0,t.IsUint8Array)(v))return yield g(s.Uint8Array,u,b,v);c(u.maxByteLength)&&!(v.length<=u.maxByteLength)&&(yield g(s.Uint8ArrayMaxByteLength,u,b,v)),c(u.minByteLength)&&!(v.length>=u.minByteLength)&&(yield g(s.Uint8ArrayMinByteLength,u,b,v))}function*P(u,A,b,v){}function*$(u,A,b,v){n.TypeSystemPolicy.IsVoidLike(v)||(yield g(s.Void,u,b,v))}function*y(u,A,b,v){o.TypeRegistry.Get(u[o.Kind])(u,v)||(yield g(s.Kind,u,b,v))}function*T(u,A,b,v){let N=c(u.$id)?[...A,u]:A,q=u;switch(q[o.Kind]){case"Any":return yield*C(q,N,b,v);case"Array":return yield*I(q,N,b,v);case"AsyncIterator":return yield*S(q,N,b,v);case"BigInt":return yield*z(q,N,b,v);case"Boolean":return yield*J(q,N,b,v);case"Constructor":return yield*F(q,N,b,v);case"Date":return yield*k(q,N,b,v);case"Function":return yield*K(q,N,b,v);case"Integer":return yield*W(q,N,b,v);case"Intersect":return yield*j(q,N,b,v);case"Iterator":return yield*Z(q,N,b,v);case"Literal":return yield*G(q,N,b,v);case"Never":return yield*fe(q,N,b,v);case"Not":return yield*x(q,N,b,v);case"Null":return yield*M(q,N,b,v);case"Number":return yield*L(q,N,b,v);case"Object":return yield*ee(q,N,b,v);case"Promise":return yield*oe(q,N,b,v);case"Record":return yield*Q(q,N,b,v);case"Ref":return yield*ae(q,N,b,v);case"String":return yield*D(q,N,b,v);case"Symbol":return yield*H(q,N,b,v);case"TemplateLiteral":return yield*Y(q,N,b,v);case"This":return yield*he(q,N,b,v);case"Tuple":return yield*f(q,N,b,v);case"Undefined":return yield*_(q,N,b,v);case"Union":return yield*E(q,N,b,v);case"Uint8Array":return yield*U(q,N,b,v);case"Unknown":return yield*P(q,N,b,v);case"Void":return yield*$(q,N,b,v);default:if(!o.TypeRegistry.Has(q[o.Kind]))throw new a(u);return yield*y(q,N,b,v)}}function w(...u){let A=u.length===3?T(u[0],u[1],"",u[2]):T(u[0],[],"",u[1]);return new d(A)}e.Errors=w}}),sy=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(r,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(r,s,a)}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),n=e&&e.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Oo(),e)}}),wl=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 l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,a,l)}:function(i,o,s,a){a===void 0&&(a=s),i[a]=o[s]}),n=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 r=Oo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),n(_l(),e)}}),ay=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=Ir(),n=wl(),r=Ao(),i=Qs(),o=en(),s=class extends o.TypeBoxError{constructor(y){super("Unknown type"),this.schema=y}};e.ValueCheckUnknownTypeError=s;function a(y){return y[o.Kind]==="Any"||y[o.Kind]==="Unknown"}function l(y){return y!==void 0}function c(y,T,w){return!0}function d(y,T,w){if(!(0,t.IsArray)(w)||l(y.minItems)&&!(w.length>=y.minItems)||l(y.maxItems)&&!(w.length<=y.maxItems)||!w.every(b=>P(y.items,T,b))||y.uniqueItems===!0&&!function(){let b=new Set;for(let v of w){let N=(0,i.Hash)(v);if(b.has(N))return!1;b.add(N)}return!0}())return!1;if(!(l(y.contains)||(0,t.IsNumber)(y.minContains)||(0,t.IsNumber)(y.maxContains)))return!0;let u=l(y.contains)?y.contains:o.Type.Never(),A=w.reduce((b,v)=>P(u,T,v)?b+1:b,0);return!(A===0||(0,t.IsNumber)(y.minContains)&&A<y.minContains||(0,t.IsNumber)(y.maxContains)&&A>y.maxContains)}function g(y,T,w){return(0,t.IsAsyncIterator)(w)}function C(y,T,w){return!(!(0,t.IsBigInt)(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.minimum)&&!(w>=y.minimum)||l(y.multipleOf)&&w%y.multipleOf!==BigInt(0))}function I(y,T,w){return(0,t.IsBoolean)(w)}function S(y,T,w){return P(y.returns,T,w.prototype)}function z(y,T,w){return!(!(0,t.IsDate)(w)||l(y.exclusiveMaximumTimestamp)&&!(w.getTime()<y.exclusiveMaximumTimestamp)||l(y.exclusiveMinimumTimestamp)&&!(w.getTime()>y.exclusiveMinimumTimestamp)||l(y.maximumTimestamp)&&!(w.getTime()<=y.maximumTimestamp)||l(y.minimumTimestamp)&&!(w.getTime()>=y.minimumTimestamp)||l(y.multipleOfTimestamp)&&w.getTime()%y.multipleOfTimestamp!==0)}function J(y,T,w){return(0,t.IsFunction)(w)}function F(y,T,w){return!(!(0,t.IsInteger)(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.minimum)&&!(w>=y.minimum)||l(y.multipleOf)&&w%y.multipleOf!==0)}function k(y,T,w){let u=y.allOf.every(A=>P(A,T,w));if(y.unevaluatedProperties===!1){let A=new RegExp(o.KeyResolver.ResolvePattern(y)),b=Object.getOwnPropertyNames(w).every(v=>A.test(v));return u&&b}else if(o.TypeGuard.TSchema(y.unevaluatedProperties)){let A=new RegExp(o.KeyResolver.ResolvePattern(y)),b=Object.getOwnPropertyNames(w).every(v=>A.test(v)||P(y.unevaluatedProperties,T,w[v]));return u&&b}else return u}function K(y,T,w){return(0,t.IsIterator)(w)}function W(y,T,w){return w===y.const}function j(y,T,w){return!1}function Z(y,T,w){return!P(y.not,T,w)}function G(y,T,w){return(0,t.IsNull)(w)}function fe(y,T,w){return!(!n.TypeSystemPolicy.IsNumberLike(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.minimum)&&!(w>=y.minimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.multipleOf)&&w%y.multipleOf!==0)}function x(y,T,w){if(!n.TypeSystemPolicy.IsObjectLike(w)||l(y.minProperties)&&!(Object.getOwnPropertyNames(w).length>=y.minProperties)||l(y.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=y.maxProperties))return!1;let u=Object.getOwnPropertyNames(y.properties);for(let A of u){let b=y.properties[A];if(y.required&&y.required.includes(A)){if(!P(b,T,w[A])||(o.ExtendsUndefined.Check(b)||a(b))&&!(A in w))return!1}else if(n.TypeSystemPolicy.IsExactOptionalProperty(w,A)&&!P(b,T,w[A]))return!1}if(y.additionalProperties===!1){let A=Object.getOwnPropertyNames(w);return y.required&&y.required.length===u.length&&A.length===u.length?!0:A.every(b=>u.includes(b))}else return typeof y.additionalProperties=="object"?Object.getOwnPropertyNames(w).every(b=>u.includes(b)||P(y.additionalProperties,T,w[b])):!0}function M(y,T,w){return(0,t.IsPromise)(w)}function L(y,T,w){if(!n.TypeSystemPolicy.IsRecordLike(w)||l(y.minProperties)&&!(Object.getOwnPropertyNames(w).length>=y.minProperties)||l(y.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=y.maxProperties))return!1;let[u,A]=Object.entries(y.patternProperties)[0],b=new RegExp(u),v=Object.entries(w).every(([te,ne])=>b.test(te)?P(A,T,ne):!0),N=typeof y.additionalProperties=="object"?Object.entries(w).every(([te,ne])=>b.test(te)?!0:P(y.additionalProperties,T,ne)):!0,q=y.additionalProperties===!1?Object.getOwnPropertyNames(w).every(te=>b.test(te)):!0;return v&&N&&q}function ee(y,T,w){return P((0,r.Deref)(y,T),T,w)}function oe(y,T,w){return!(0,t.IsString)(w)||l(y.minLength)&&!(w.length>=y.minLength)||l(y.maxLength)&&!(w.length<=y.maxLength)||l(y.pattern)&&!new RegExp(y.pattern).test(w)?!1:l(y.format)?o.FormatRegistry.Has(y.format)?o.FormatRegistry.Get(y.format)(w):!1:!0}function Q(y,T,w){return(0,t.IsSymbol)(w)}function ae(y,T,w){return(0,t.IsString)(w)&&new RegExp(y.pattern).test(w)}function D(y,T,w){return P((0,r.Deref)(y,T),T,w)}function H(y,T,w){if(!(0,t.IsArray)(w)||y.items===void 0&&w.length!==0||w.length!==y.maxItems)return!1;if(!y.items)return!0;for(let u=0;u<y.items.length;u++)if(!P(y.items[u],T,w[u]))return!1;return!0}function Y(y,T,w){return(0,t.IsUndefined)(w)}function he(y,T,w){return y.anyOf.some(u=>P(u,T,w))}function f(y,T,w){return!(!(0,t.IsUint8Array)(w)||l(y.maxByteLength)&&!(w.length<=y.maxByteLength)||l(y.minByteLength)&&!(w.length>=y.minByteLength))}function _(y,T,w){return!0}function E(y,T,w){return n.TypeSystemPolicy.IsVoidLike(w)}function U(y,T,w){return o.TypeRegistry.Has(y[o.Kind])?o.TypeRegistry.Get(y[o.Kind])(y,w):!1}function P(y,T,w){let u=l(y.$id)?[...T,y]:T,A=y;switch(A[o.Kind]){case"Any":return c(A,u,w);case"Array":return d(A,u,w);case"AsyncIterator":return g(A,u,w);case"BigInt":return C(A,u,w);case"Boolean":return I(A,u,w);case"Constructor":return S(A,u,w);case"Date":return z(A,u,w);case"Function":return J(A,u,w);case"Integer":return F(A,u,w);case"Intersect":return k(A,u,w);case"Iterator":return K(A,u,w);case"Literal":return W(A,u,w);case"Never":return j(A,u,w);case"Not":return Z(A,u,w);case"Null":return G(A,u,w);case"Number":return fe(A,u,w);case"Object":return x(A,u,w);case"Promise":return M(A,u,w);case"Record":return L(A,u,w);case"Ref":return ee(A,u,w);case"String":return oe(A,u,w);case"Symbol":return Q(A,u,w);case"TemplateLiteral":return ae(A,u,w);case"This":return D(A,u,w);case"Tuple":return H(A,u,w);case"Undefined":return Y(A,u,w);case"Union":return he(A,u,w);case"Uint8Array":return f(A,u,w);case"Unknown":return _(A,u,w);case"Void":return E(A,u,w);default:if(!o.TypeRegistry.Has(A[o.Kind]))throw new s(A);return U(A,u,w)}}function $(...y){return y.length===3?P(y[0],y[1],y[2]):P(y[0],[],y[1])}e.Check=$}}),uy=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=Ir(),n=Ao(),r=ay(),i=en(),o=class extends i.TypeBoxError{constructor(C,I,S){super("Unable to decode due to invalid value"),this.schema=C,this.value=I,this.error=S}};e.TransformDecodeCheckError=o;var s=class extends i.TypeBoxError{constructor(C,I,S){super("Unable to encode due to invalid value"),this.schema=C,this.value=I,this.error=S}};e.TransformEncodeCheckError=s;var a=class extends i.TypeBoxError{constructor(C,I,S){super(`${S instanceof Error?S.message:"Unknown error"}`),this.schema=C,this.value=I}};e.TransformDecodeError=a;var l=class extends i.TypeBoxError{constructor(C,I,S){super(`${S instanceof Error?S.message:"Unknown error"}`),this.schema=C,this.value=I}};e.TransformEncodeError=l;var c;(function(C){function I(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.items,ae)}function S(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.items,ae)}function z(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.returns,ae)||Q.parameters.some(D=>L(D,ae))}function J(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.returns,ae)||Q.parameters.some(D=>L(D,ae))}function F(Q,ae){return i.TypeGuard.TTransform(Q)||i.TypeGuard.TTransform(Q.unevaluatedProperties)||Q.allOf.some(D=>L(D,ae))}function k(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.items,ae)}function K(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.not,ae)}function W(Q,ae){return i.TypeGuard.TTransform(Q)||Object.values(Q.properties).some(D=>L(D,ae))||i.TypeGuard.TSchema(Q.additionalProperties)&&L(Q.additionalProperties,ae)}function j(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.item,ae)}function Z(Q,ae){let D=Object.getOwnPropertyNames(Q.patternProperties)[0],H=Q.patternProperties[D];return i.TypeGuard.TTransform(Q)||L(H,ae)||i.TypeGuard.TSchema(Q.additionalProperties)&&i.TypeGuard.TTransform(Q.additionalProperties)}function G(Q,ae){return i.TypeGuard.TTransform(Q)?!0:L((0,n.Deref)(Q,ae),ae)}function fe(Q,ae){return i.TypeGuard.TTransform(Q)?!0:L((0,n.Deref)(Q,ae),ae)}function x(Q,ae){return i.TypeGuard.TTransform(Q)||!(0,t.IsUndefined)(Q.items)&&Q.items.some(D=>L(D,ae))}function M(Q,ae){return i.TypeGuard.TTransform(Q)||Q.anyOf.some(D=>L(D,ae))}function L(Q,ae){let D=(0,t.IsString)(Q.$id)?[...ae,Q]:ae,H=Q;if(Q.$id&&ee.has(Q.$id))return!1;switch(Q.$id&&ee.add(Q.$id),Q[i.Kind]){case"Array":return I(H,D);case"AsyncIterator":return S(H,D);case"Constructor":return z(H,D);case"Function":return J(H,D);case"Intersect":return F(H,D);case"Iterator":return k(H,D);case"Not":return K(H,D);case"Object":return W(H,D);case"Promise":return j(H,D);case"Record":return Z(H,D);case"Ref":return G(H,D);case"This":return fe(H,D);case"Tuple":return x(H,D);case"Union":return M(H,D);default:return i.TypeGuard.TTransform(Q)}}let ee=new Set;function oe(Q,ae){return ee.clear(),L(Q,ae)}C.Has=oe})(c||(e.HasTransform=c={}));var d;(function(C){function I(x,M){try{return i.TypeGuard.TTransform(x)?x[i.Transform].Decode(M):M}catch(L){throw new a(x,M,L)}}function S(x,M,L){return(0,t.IsArray)(L)?I(x,L.map(ee=>G(x.items,M,ee))):I(x,L)}function z(x,M,L){if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return I(x,L);let ee=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),oe=ee.reduce((H,Y)=>Y in H?{...H,[Y]:G(i.IndexedAccessor.Resolve(x,[Y]),M,H[Y])}:H,L);if(!i.TypeGuard.TTransform(x.unevaluatedProperties))return I(x,oe);let Q=Object.getOwnPropertyNames(oe),ae=x.unevaluatedProperties,D=Q.reduce((H,Y)=>ee.includes(Y)?H:{...H,[Y]:I(ae,H[Y])},oe);return I(x,D)}function J(x,M,L){return I(x,G(x.not,M,L))}function F(x,M,L){if(!(0,t.IsPlainObject)(L))return I(x,L);let ee=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),oe=ee.reduce((H,Y)=>Y in H?{...H,[Y]:G(x.properties[Y],M,H[Y])}:H,L);if(!i.TypeGuard.TSchema(x.additionalProperties))return I(x,oe);let Q=Object.getOwnPropertyNames(oe),ae=x.additionalProperties,D=Q.reduce((H,Y)=>ee.includes(Y)?H:{...H,[Y]:I(ae,H[Y])},oe);return I(x,D)}function k(x,M,L){if(!(0,t.IsPlainObject)(L))return I(x,L);let ee=Object.getOwnPropertyNames(x.patternProperties)[0],oe=new RegExp(ee),Q=Object.getOwnPropertyNames(L).reduce((Y,he)=>oe.test(he)?{...Y,[he]:G(x.patternProperties[ee],M,Y[he])}:Y,L);if(!i.TypeGuard.TSchema(x.additionalProperties))return I(x,Q);let ae=Object.getOwnPropertyNames(Q),D=x.additionalProperties,H=ae.reduce((Y,he)=>oe.test(he)?Y:{...Y,[he]:I(D,Y[he])},Q);return I(x,H)}function K(x,M,L){let ee=(0,n.Deref)(x,M);return I(x,G(ee,M,L))}function W(x,M,L){let ee=(0,n.Deref)(x,M);return I(x,G(ee,M,L))}function j(x,M,L){return(0,t.IsArray)(L)&&(0,t.IsArray)(x.items)?I(x,x.items.map((ee,oe)=>G(ee,M,L[oe]))):I(x,L)}function Z(x,M,L){let ee=I(x,L);for(let oe of x.anyOf)if((0,r.Check)(oe,M,ee))return G(oe,M,ee);return ee}function G(x,M,L){let ee=typeof x.$id=="string"?[...M,x]:M,oe=x;switch(x[i.Kind]){case"Array":return S(oe,ee,L);case"Intersect":return z(oe,ee,L);case"Not":return J(oe,ee,L);case"Object":return F(oe,ee,L);case"Record":return k(oe,ee,L);case"Ref":return K(oe,ee,L);case"Symbol":return I(oe,L);case"This":return W(oe,ee,L);case"Tuple":return j(oe,ee,L);case"Union":return Z(oe,ee,L);default:return I(oe,L)}}function fe(x,M,L){return G(x,M,L)}C.Decode=fe})(d||(e.DecodeTransform=d={}));var g;(function(C){function I(x,M){try{return i.TypeGuard.TTransform(x)?x[i.Transform].Encode(M):M}catch(L){throw new l(x,M,L)}}function S(x,M,L){let ee=I(x,L);return(0,t.IsArray)(ee)?ee.map(oe=>G(x.items,M,oe)):ee}function z(x,M,L){let ee=I(x,L);if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return ee;let oe=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),Q=oe.reduce((H,Y)=>Y in ee?{...H,[Y]:G(i.IndexedAccessor.Resolve(x,[Y]),M,H[Y])}:H,ee);if(!i.TypeGuard.TTransform(x.unevaluatedProperties))return I(x,Q);let ae=Object.getOwnPropertyNames(Q),D=x.unevaluatedProperties;return ae.reduce((H,Y)=>oe.includes(Y)?H:{...H,[Y]:I(D,H[Y])},Q)}function J(x,M,L){return I(x.not,I(x,L))}function F(x,M,L){let ee=I(x,L);if(!(0,t.IsPlainObject)(L))return ee;let oe=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),Q=oe.reduce((H,Y)=>Y in H?{...H,[Y]:G(x.properties[Y],M,H[Y])}:H,ee);if(!i.TypeGuard.TSchema(x.additionalProperties))return Q;let ae=Object.getOwnPropertyNames(Q),D=x.additionalProperties;return ae.reduce((H,Y)=>oe.includes(Y)?H:{...H,[Y]:I(D,H[Y])},Q)}function k(x,M,L){let ee=I(x,L);if(!(0,t.IsPlainObject)(L))return ee;let oe=Object.getOwnPropertyNames(x.patternProperties)[0],Q=new RegExp(oe),ae=Object.getOwnPropertyNames(L).reduce((Y,he)=>Q.test(he)?{...Y,[he]:G(x.patternProperties[oe],M,Y[he])}:Y,ee);if(!i.TypeGuard.TSchema(x.additionalProperties))return I(x,ae);let D=Object.getOwnPropertyNames(ae),H=x.additionalProperties;return D.reduce((Y,he)=>Q.test(he)?Y:{...Y,[he]:I(H,Y[he])},ae)}function K(x,M,L){let ee=(0,n.Deref)(x,M),oe=G(ee,M,L);return I(x,oe)}function W(x,M,L){let ee=(0,n.Deref)(x,M),oe=G(ee,M,L);return I(x,oe)}function j(x,M,L){let ee=I(x,L);return(0,t.IsArray)(x.items)?x.items.map((oe,Q)=>G(oe,M,ee[Q])):[]}function Z(x,M,L){for(let ee of x.anyOf){if(!(0,r.Check)(ee,M,L))continue;let oe=G(ee,M,L);return I(x,oe)}for(let ee of x.anyOf){let oe=G(ee,M,L);if((0,r.Check)(x,M,oe))return I(x,oe)}return I(x,L)}function G(x,M,L){let ee=typeof x.$id=="string"?[...M,x]:M,oe=x;switch(x[i.Kind]){case"Array":return S(oe,ee,L);case"Intersect":return z(oe,ee,L);case"Not":return J(oe,ee,L);case"Object":return F(oe,ee,L);case"Record":return k(oe,ee,L);case"Ref":return K(oe,ee,L);case"This":return W(oe,ee,L);case"Tuple":return j(oe,ee,L);case"Union":return Z(oe,ee,L);default:return I(oe,L)}}function fe(x,M,L){return G(x,M,L)}C.Encode=fe})(g||(e.EncodeTransform=g={}))}}),cy=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=uy(),n=Ir(),r=Oo(),i=wl(),o=Ao(),s=Qs(),a=en(),l=class{constructor(F,k,K,W){this.schema=F,this.references=k,this.checkFunc=K,this.code=W,this.hasTransform=t.HasTransform.Has(F,k)}Code(){return this.code}Errors(F){return(0,r.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 k=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,F):F;if(!this.checkFunc(k))throw new t.TransformEncodeCheckError(this.schema,F,this.Errors(F).First());return k}};e.TypeCheck=l;var c;(function(F){function k(Z){return Z===36}F.DollarSign=k;function K(Z){return Z===95}F.IsUnderscore=K;function W(Z){return Z>=65&&Z<=90||Z>=97&&Z<=122}F.IsAlpha=W;function j(Z){return Z>=48&&Z<=57}F.IsNumeric=j})(c||(c={}));var d;(function(F){function k(Z){return Z.length===0?!1:c.IsNumeric(Z.charCodeAt(0))}function K(Z){if(k(Z))return!1;for(let G=0;G<Z.length;G++){let fe=Z.charCodeAt(G);if(!(c.IsAlpha(fe)||c.IsNumeric(fe)||c.DollarSign(fe)||c.IsUnderscore(fe)))return!1}return!0}function W(Z){return Z.replace(/'/g,"\\'")}function j(Z,G){return K(G)?`${Z}.${G}`:`${Z}['${W(G)}']`}F.Encode=j})(d||(d={}));var g;(function(F){function k(K){let W=[];for(let j=0;j<K.length;j++){let Z=K.charCodeAt(j);c.IsNumeric(Z)||c.IsAlpha(Z)?W.push(K.charAt(j)):W.push(`_${Z}_`)}return W.join("").replace(/__/g,"_")}F.Encode=k})(g||(g={}));var C;(function(F){function k(K){return K.replace(/'/g,"\\'")}F.Escape=k})(C||(C={}));var I=class extends a.TypeBoxError{constructor(F){super("Unknown type"),this.schema=F}};e.TypeCompilerUnknownTypeError=I;var S=class extends a.TypeBoxError{constructor(F){super("Preflight validation check failed to guard for the given schema"),this.schema=F}};e.TypeCompilerTypeGuardError=S;var z;(function(F){function k(G,fe,x){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${fe}' in ${G} ? ${x} : true)`:`(${d.Encode(G,fe)} !== undefined ? ${x} : true)`}F.IsExactOptionalProperty=k;function K(G){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${G} === 'object' && ${G} !== null)`:`(typeof ${G} === 'object' && ${G} !== null && !Array.isArray(${G}))`}F.IsObjectLike=K;function W(G){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${G} === 'object' && ${G} !== null && !(${G} instanceof Date) && !(${G} instanceof Uint8Array))`:`(typeof ${G} === 'object' && ${G} !== null && !Array.isArray(${G}) && !(${G} instanceof Date) && !(${G} instanceof Uint8Array))`}F.IsRecordLike=W;function j(G){return i.TypeSystemPolicy.AllowNaN?`typeof ${G} === 'number'`:`(typeof ${G} === 'number' && Number.isFinite(${G}))`}F.IsNumberLike=j;function Z(G){return i.TypeSystemPolicy.AllowNullVoid?`(${G} === undefined || ${G} === null)`:`${G} === undefined`}F.IsVoidLike=Z})(z||(e.Policy=z={}));var J;(function(F){function k(O){return O[a.Kind]==="Any"||O[a.Kind]==="Unknown"}function*K(O,le,R){yield"true"}function*W(O,le,R){yield`Array.isArray(${R})`;let[me,re]=[Fe("value","any"),Fe("acc","number")];(0,n.IsNumber)(O.maxItems)&&(yield`${R}.length <= ${O.maxItems}`),(0,n.IsNumber)(O.minItems)&&(yield`${R}.length >= ${O.minItems}`);let de=ne(O.items,le,"value");if(yield`${R}.every((${me}) => ${de})`,a.TypeGuard.TSchema(O.contains)||(0,n.IsNumber)(O.minContains)||(0,n.IsNumber)(O.maxContains)){let Se=a.TypeGuard.TSchema(O.contains)?O.contains:a.Type.Never(),ke=ne(Se,le,"value"),rt=(0,n.IsNumber)(O.minContains)?[`(count >= ${O.minContains})`]:[],et=(0,n.IsNumber)(O.maxContains)?[`(count <= ${O.maxContains})`]:[],ot=`const count = value.reduce((${re}, ${me}) => ${ke} ? acc + 1 : acc, 0)`,Zt=["(count > 0)",...rt,...et].join(" && ");yield`((${me}) => { ${ot}; return ${Zt}})(${R})`}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 } )(${R})`)}function*j(O,le,R){yield`(typeof value === 'object' && Symbol.asyncIterator in ${R})`}function*Z(O,le,R){yield`(typeof ${R} === 'bigint')`,(0,n.IsBigInt)(O.exclusiveMaximum)&&(yield`${R} < BigInt(${O.exclusiveMaximum})`),(0,n.IsBigInt)(O.exclusiveMinimum)&&(yield`${R} > BigInt(${O.exclusiveMinimum})`),(0,n.IsBigInt)(O.maximum)&&(yield`${R} <= BigInt(${O.maximum})`),(0,n.IsBigInt)(O.minimum)&&(yield`${R} >= BigInt(${O.minimum})`),(0,n.IsBigInt)(O.multipleOf)&&(yield`(${R} % BigInt(${O.multipleOf})) === 0`)}function*G(O,le,R){yield`(typeof ${R} === 'boolean')`}function*fe(O,le,R){yield*q(O.returns,le,`${R}.prototype`)}function*x(O,le,R){yield`(${R} instanceof Date) && Number.isFinite(${R}.getTime())`,(0,n.IsNumber)(O.exclusiveMaximumTimestamp)&&(yield`${R}.getTime() < ${O.exclusiveMaximumTimestamp}`),(0,n.IsNumber)(O.exclusiveMinimumTimestamp)&&(yield`${R}.getTime() > ${O.exclusiveMinimumTimestamp}`),(0,n.IsNumber)(O.maximumTimestamp)&&(yield`${R}.getTime() <= ${O.maximumTimestamp}`),(0,n.IsNumber)(O.minimumTimestamp)&&(yield`${R}.getTime() >= ${O.minimumTimestamp}`),(0,n.IsNumber)(O.multipleOfTimestamp)&&(yield`(${R}.getTime() % ${O.multipleOfTimestamp}) === 0`)}function*M(O,le,R){yield`(typeof ${R} === 'function')`}function*L(O,le,R){yield`(typeof ${R} === 'number' && Number.isInteger(${R}))`,(0,n.IsNumber)(O.exclusiveMaximum)&&(yield`${R} < ${O.exclusiveMaximum}`),(0,n.IsNumber)(O.exclusiveMinimum)&&(yield`${R} > ${O.exclusiveMinimum}`),(0,n.IsNumber)(O.maximum)&&(yield`${R} <= ${O.maximum}`),(0,n.IsNumber)(O.minimum)&&(yield`${R} >= ${O.minimum}`),(0,n.IsNumber)(O.multipleOf)&&(yield`(${R} % ${O.multipleOf}) === 0`)}function*ee(O,le,R){let me=O.allOf.map(re=>ne(re,le,R)).join(" && ");if(O.unevaluatedProperties===!1){let re=be(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),de=`Object.getOwnPropertyNames(${R}).every(key => ${re}.test(key))`;yield`(${me} && ${de})`}else if(a.TypeGuard.TSchema(O.unevaluatedProperties)){let re=be(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),de=`Object.getOwnPropertyNames(${R}).every(key => ${re}.test(key) || ${ne(O.unevaluatedProperties,le,`${R}[key]`)})`;yield`(${me} && ${de})`}else yield`(${me})`}function*oe(O,le,R){yield`(typeof value === 'object' && Symbol.iterator in ${R})`}function*Q(O,le,R){typeof O.const=="number"||typeof O.const=="boolean"?yield`(${R} === ${O.const})`:yield`(${R} === '${C.Escape(O.const)}')`}function*ae(O,le,R){yield"false"}function*D(O,le,R){yield`(!${ne(O.not,le,R)})`}function*H(O,le,R){yield`(${R} === null)`}function*Y(O,le,R){yield z.IsNumberLike(R),(0,n.IsNumber)(O.exclusiveMaximum)&&(yield`${R} < ${O.exclusiveMaximum}`),(0,n.IsNumber)(O.exclusiveMinimum)&&(yield`${R} > ${O.exclusiveMinimum}`),(0,n.IsNumber)(O.maximum)&&(yield`${R} <= ${O.maximum}`),(0,n.IsNumber)(O.minimum)&&(yield`${R} >= ${O.minimum}`),(0,n.IsNumber)(O.multipleOf)&&(yield`(${R} % ${O.multipleOf}) === 0`)}function*he(O,le,R){yield z.IsObjectLike(R),(0,n.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${R}).length >= ${O.minProperties}`),(0,n.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${R}).length <= ${O.maxProperties}`);let me=Object.getOwnPropertyNames(O.properties);for(let re of me){let de=d.Encode(R,re),Se=O.properties[re];if(O.required&&O.required.includes(re))yield*q(Se,le,de),(a.ExtendsUndefined.Check(Se)||k(Se))&&(yield`('${re}' in ${R})`);else{let ke=ne(Se,le,de);yield z.IsExactOptionalProperty(R,re,ke)}}if(O.additionalProperties===!1)if(O.required&&O.required.length===me.length)yield`Object.getOwnPropertyNames(${R}).length === ${me.length}`;else{let re=`[${me.map(de=>`'${de}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${R}).every(key => ${re}.includes(key))`}if(typeof O.additionalProperties=="object"){let re=ne(O.additionalProperties,le,`${R}[key]`),de=`[${me.map(Se=>`'${Se}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${R}).every(key => ${de}.includes(key) || ${re}))`}}function*f(O,le,R){yield`(typeof value === 'object' && typeof ${R}.then === 'function')`}function*_(O,le,R){yield z.IsRecordLike(R),(0,n.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${R}).length >= ${O.minProperties}`),(0,n.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${R}).length <= ${O.maxProperties}`);let[me,re]=Object.entries(O.patternProperties)[0],de=be(`${new RegExp(me)}`),Se=ne(re,le,"value"),ke=a.TypeGuard.TSchema(O.additionalProperties)?ne(O.additionalProperties,le,R):O.additionalProperties===!1?"false":"true",rt=`(${de}.test(key) ? ${Se} : ${ke})`;yield`(Object.entries(${R}).every(([key, value]) => ${rt}))`}function*E(O,le,R){let me=(0,o.Deref)(O,le);if(te.functions.has(O.$ref))return yield`${ge(O.$ref)}(${R})`;yield*q(me,le,R)}function*U(O,le,R){yield`(typeof ${R} === 'string')`,(0,n.IsNumber)(O.maxLength)&&(yield`${R}.length <= ${O.maxLength}`),(0,n.IsNumber)(O.minLength)&&(yield`${R}.length >= ${O.minLength}`),O.pattern!==void 0&&(yield`${be(`${new RegExp(O.pattern)};`)}.test(${R})`),O.format!==void 0&&(yield`format('${O.format}', ${R})`)}function*P(O,le,R){yield`(typeof ${R} === 'symbol')`}function*$(O,le,R){yield`(typeof ${R} === 'string')`,yield`${be(`${new RegExp(O.pattern)};`)}.test(${R})`}function*y(O,le,R){yield`${ge(O.$ref)}(${R})`}function*T(O,le,R){if(yield`Array.isArray(${R})`,O.items===void 0)return yield`${R}.length === 0`;yield`(${R}.length === ${O.maxItems})`;for(let me=0;me<O.items.length;me++)yield`${ne(O.items[me],le,`${R}[${me}]`)}`}function*w(O,le,R){yield`${R} === undefined`}function*u(O,le,R){yield`(${O.anyOf.map(re=>ne(re,le,R)).join(" || ")})`}function*A(O,le,R){yield`${R} instanceof Uint8Array`,(0,n.IsNumber)(O.maxByteLength)&&(yield`(${R}.length <= ${O.maxByteLength})`),(0,n.IsNumber)(O.minByteLength)&&(yield`(${R}.length >= ${O.minByteLength})`)}function*b(O,le,R){yield"true"}function*v(O,le,R){yield z.IsVoidLike(R)}function*N(O,le,R){let me=te.instances.size;te.instances.set(me,O),yield`kind('${O[a.Kind]}', ${me}, ${R})`}function*q(O,le,R,me=!0){let re=(0,n.IsString)(O.$id)?[...le,O]:le,de=O;if(me&&(0,n.IsString)(O.$id)){let Se=ge(O.$id);if(te.functions.has(Se))return yield`${Se}(${R})`;{let ke=Ue(Se,O,le,"value",!1);return te.functions.set(Se,ke),yield`${Se}(${R})`}}switch(de[a.Kind]){case"Any":return yield*K(de,re,R);case"Array":return yield*W(de,re,R);case"AsyncIterator":return yield*j(de,re,R);case"BigInt":return yield*Z(de,re,R);case"Boolean":return yield*G(de,re,R);case"Constructor":return yield*fe(de,re,R);case"Date":return yield*x(de,re,R);case"Function":return yield*M(de,re,R);case"Integer":return yield*L(de,re,R);case"Intersect":return yield*ee(de,re,R);case"Iterator":return yield*oe(de,re,R);case"Literal":return yield*Q(de,re,R);case"Never":return yield*ae(de,re,R);case"Not":return yield*D(de,re,R);case"Null":return yield*H(de,re,R);case"Number":return yield*Y(de,re,R);case"Object":return yield*he(de,re,R);case"Promise":return yield*f(de,re,R);case"Record":return yield*_(de,re,R);case"Ref":return yield*E(de,re,R);case"String":return yield*U(de,re,R);case"Symbol":return yield*P(de,re,R);case"TemplateLiteral":return yield*$(de,re,R);case"This":return yield*y(de,re,R);case"Tuple":return yield*T(de,re,R);case"Undefined":return yield*w(de,re,R);case"Union":return yield*u(de,re,R);case"Uint8Array":return yield*A(de,re,R);case"Unknown":return yield*b(de,re,R);case"Void":return yield*v(de,re,R);default:if(!a.TypeRegistry.Has(de[a.Kind]))throw new I(O);return yield*N(de,re,R)}}let te={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function ne(O,le,R,me=!0){return`(${[...q(O,le,R,me)].join(" && ")})`}function ge(O){return`check_${g.Encode(O)}`}function be(O){let le=`local_${te.variables.size}`;return te.variables.set(le,`const ${le} = ${O}`),le}function Ue(O,le,R,me,re=!0){let[de,Se]=[`
48
+ ${f}`),H.pop(),`{${P}}`}case"number":return isFinite(D)?String(D):K?K(D):"null";case"boolean":return D===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(D);default:return K?K(D):void 0}}function oe(ae,D,H){switch(typeof D){case"string":return o(D);case"object":{if(D===null)return"null";if(typeof D.toJSON=="function"){if(D=D.toJSON(ae),typeof D!="object")return oe(ae,D,H);if(D===null)return"null"}if(H.indexOf(D)!==-1)return W;let Y="",he=D.length!==void 0;if(he&&Array.isArray(D)){if(D.length===0)return"[]";if(fe<H.length+1)return'"[Array]"';H.push(D);let P=Math.min(D.length,x),$=0;for(;$<P-1;$++){let T=oe(String($),D[$],H);Y+=T!==void 0?T:"null",Y+=","}let y=oe(String($),D[$],H);if(Y+=y!==void 0?y:"null",D.length-1>x){let T=D.length-x-1;Y+=`,"... ${S(T)} not stringified"`}return H.pop(),`[${Y}]`}let f=Object.keys(D),_=f.length;if(_===0)return"{}";if(fe<H.length+1)return'"[Object]"';let E="",U=Math.min(_,x);he&&l(D)&&(Y+=c(D,",",x),f=f.slice(D.length),U-=D.length,E=","),Z&&(f=s(f,G)),H.push(D);for(let P=0;P<U;P++){let $=f[P],y=oe($,D[$],H);y!==void 0&&(Y+=`${E}${o($)}:${y}`,E=",")}if(_>x){let P=_-x;Y+=`${E}"...":"${S(P)} not stringified"`}return H.pop(),`{${Y}}`}case"number":return isFinite(D)?String(D):K?K(D):"null";case"boolean":return D===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(D);default:return K?K(D):void 0}}function Q(ae,D,H){if(arguments.length>1){let Y="";if(typeof H=="number"?Y=" ".repeat(Math.min(H,10)):typeof H=="string"&&(Y=H.slice(0,10)),D!=null){if(typeof D=="function")return M("",{"":ae},[],D,Y,"");if(Array.isArray(D))return L("",ae,[],z(D),Y,"")}if(Y.length!==0)return ee("",ae,[],Y,"")}return oe("",ae,[])}return Q}}}),Ir=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 c(j)&&Symbol.asyncIterator in j}e.IsAsyncIterator=t;function n(j){return c(j)&&Symbol.iterator in j}e.IsIterator=n;function r(j){return ArrayBuffer.isView(j)}e.IsTypedArray=r;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,Z){return Z in j}e.HasPropertyKey=a;function l(j){return c(j)&&k(j.constructor)&&j.constructor.name==="Object"}e.IsPlainObject=l;function c(j){return j!==null&&typeof j=="object"}e.IsObject=c;function d(j){return Array.isArray(j)&&!ArrayBuffer.isView(j)}e.IsArray=d;function g(j){return j===void 0}e.IsUndefined=g;function C(j){return j===null}e.IsNull=C;function I(j){return typeof j=="boolean"}e.IsBoolean=I;function S(j){return typeof j=="number"}e.IsNumber=S;function z(j){return S(j)&&Number.isInteger(j)}e.IsInteger=z;function J(j){return typeof j=="bigint"}e.IsBigInt=J;function F(j){return typeof j=="string"}e.IsString=F;function k(j){return typeof j=="function"}e.IsFunction=k;function K(j){return typeof j=="symbol"}e.IsSymbol=K;function W(j){return J(j)||I(j)||C(j)||S(j)||F(j)||K(j)||g(j)}e.IsValueType=W}}),wl=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=Ir(),n=Eo(),r=en(),i=class extends r.TypeBoxError{constructor(d){super(`Duplicate type kind '${d}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var o=class extends r.TypeBoxError{constructor(d){super(`Duplicate string format '${d}' detected`)}};e.TypeSystemDuplicateFormat=o;var s;(function(d){function g(I,S){if(r.TypeRegistry.Has(I))throw new i(I);return r.TypeRegistry.Set(I,S),(z={})=>r.Type.Unsafe({...z,[r.Kind]:I})}d.Type=g;function C(I,S){if(r.FormatRegistry.Has(I))throw new o(I);return r.FormatRegistry.Set(I,S),I}d.Format=C})(s||(e.TypeSystem=s={}));var a;(function(d){let g=c;function C(){g=c}d.Reset=C;function I(z){g=z}d.Set=I;function S(){return g}d.Get=S})(a||(e.TypeSystemErrorFunction=a={}));var l;(function(d){d.ExactOptionalPropertyTypes=!1,d.AllowArrayObject=!1,d.AllowNaN=!1,d.AllowNullVoid=!1;function g(J,F){return d.ExactOptionalPropertyTypes?F in J:J[F]!==void 0}d.IsExactOptionalProperty=g;function C(J){let F=(0,t.IsObject)(J);return d.AllowArrayObject?F:F&&!(0,t.IsArray)(J)}d.IsObjectLike=C;function I(J){return C(J)&&!(J instanceof Date)&&!(J instanceof Uint8Array)}d.IsRecordLike=I;function S(J){let F=(0,t.IsNumber)(J);return d.AllowNaN?F:F&&Number.isFinite(J)}d.IsNumberLike=S;function z(J){let F=(0,t.IsUndefined)(J);return d.AllowNullVoid?F||J===null:F}d.IsVoidLike=z})(l||(e.TypeSystemPolicy=l={}));function c(d,g){switch(g){case n.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case n.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${d.maxContains} matching values`;case n.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${d.minContains} matching values`;case n.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${d.maxItems}`;case n.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${d.minItems}`;case n.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case n.ValueErrorType.Array:return"Expected array";case n.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case n.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${d.exclusiveMaximum}`;case n.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${d.exclusiveMinimum}`;case n.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${d.maximum}`;case n.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${d.minimum}`;case n.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${d.multipleOf}`;case n.ValueErrorType.BigInt:return"Expected bigint";case n.ValueErrorType.Boolean:return"Expected boolean";case n.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${d.exclusiveMinimumTimestamp}`;case n.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${d.exclusiveMaximumTimestamp}`;case n.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${d.minimumTimestamp}`;case n.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${d.maximumTimestamp}`;case n.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${d.multipleOfTimestamp}`;case n.ValueErrorType.Date:return"Expected Date";case n.ValueErrorType.Function:return"Expected function";case n.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${d.exclusiveMaximum}`;case n.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${d.exclusiveMinimum}`;case n.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${d.maximum}`;case n.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${d.minimum}`;case n.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${d.multipleOf}`;case n.ValueErrorType.Integer:return"Expected integer";case n.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case n.ValueErrorType.Intersect:return"Expected all values to match";case n.ValueErrorType.Iterator:return"Expected Iterator";case n.ValueErrorType.Literal:return`Expected ${typeof d.const=="string"?`'${d.const}'`:d.const}`;case n.ValueErrorType.Never:return"Never";case n.ValueErrorType.Not:return"Value should not match";case n.ValueErrorType.Null:return"Expected null";case n.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${d.exclusiveMaximum}`;case n.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${d.exclusiveMinimum}`;case n.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${d.maximum}`;case n.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${d.minimum}`;case n.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${d.multipleOf}`;case n.ValueErrorType.Number:return"Expected number";case n.ValueErrorType.Object:return"Expected object";case n.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case n.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${d.maxProperties} properties`;case n.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${d.minProperties} properties`;case n.ValueErrorType.ObjectRequiredProperty:return"Required property";case n.ValueErrorType.Promise:return"Expected Promise";case n.ValueErrorType.StringFormatUnknown:return`Unknown format '${d.format}'`;case n.ValueErrorType.StringFormat:return`Expected string to match '${d.format}' format`;case n.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${d.maxLength}`;case n.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${d.minLength}`;case n.ValueErrorType.StringPattern:return`Expected string to match '${d.pattern}'`;case n.ValueErrorType.String:return"Expected string";case n.ValueErrorType.Symbol:return"Expected symbol";case n.ValueErrorType.TupleLength:return`Expected tuple to have ${d.maxItems||0} elements`;case n.ValueErrorType.Tuple:return"Expected tuple";case n.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${d.maxByteLength}`;case n.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${d.minByteLength}`;case n.ValueErrorType.Uint8Array:return"Expected Uint8Array";case n.ValueErrorType.Undefined:return"Expected undefined";case n.ValueErrorType.Union:return"Expected union value";case n.ValueErrorType.Void:return"Expected void";case n.ValueErrorType.Kind:return`Expected kind '${d[r.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=c}}),Oo=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=en(),n=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=n;function r(i,o){let s=o.findIndex(a=>a.$id===i.$ref);if(s===-1)throw new n(i);return o[s]}e.Deref=r}}),ta=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=Ir(),n=class extends Error{constructor(M){super("Unable to hash value"),this.value=M}};e.ValueHashError=n;var r;(function(M){M[M.Undefined=0]="Undefined",M[M.Null=1]="Null",M[M.Boolean=2]="Boolean",M[M.Number=3]="Number",M[M.String=4]="String",M[M.Object=5]="Object",M[M.Array=6]="Array",M[M.Date=7]="Date",M[M.Uint8Array=8]="Uint8Array",M[M.Symbol=9]="Symbol",M[M.BigInt=10]="BigInt"})(r||(e.ByteMarker=r={}));var i=BigInt("14695981039346656037"),[o,s]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],a=Array.from({length:256}).map((M,L)=>BigInt(L)),l=new Float64Array(1),c=new DataView(l.buffer),d=new Uint8Array(l.buffer);function*g(M){let L=M===0?1:Math.ceil(Math.floor(Math.log2(M)+1)/8);for(let ee=0;ee<L;ee++)yield M>>8*(L-1-ee)&255}function C(M){fe(r.Array);for(let L of M)G(L)}function I(M){fe(r.Boolean),fe(M?1:0)}function S(M){fe(r.BigInt),c.setBigInt64(0,M);for(let L of d)fe(L)}function z(M){fe(r.Date),G(M.getTime())}function J(M){fe(r.Null)}function F(M){fe(r.Number),c.setFloat64(0,M);for(let L of d)fe(L)}function k(M){fe(r.Object);for(let L of globalThis.Object.keys(M).sort())G(L),G(M[L])}function K(M){fe(r.String);for(let L=0;L<M.length;L++)for(let ee of g(M.charCodeAt(L)))fe(ee)}function W(M){fe(r.Symbol),G(M.description)}function j(M){fe(r.Uint8Array);for(let L=0;L<M.length;L++)fe(M[L])}function Z(M){return fe(r.Undefined)}function G(M){if((0,t.IsArray)(M))return C(M);if((0,t.IsBoolean)(M))return I(M);if((0,t.IsBigInt)(M))return S(M);if((0,t.IsDate)(M))return z(M);if((0,t.IsNull)(M))return J(M);if((0,t.IsNumber)(M))return F(M);if((0,t.IsPlainObject)(M))return k(M);if((0,t.IsString)(M))return K(M);if((0,t.IsSymbol)(M))return W(M);if((0,t.IsUint8Array)(M))return j(M);if((0,t.IsUndefined)(M))return Z(M);throw new n(M)}function fe(M){i=i^a[M],i=i*o%s}function x(M){return i=BigInt("14695981039346656037"),G(M),i}e.Hash=x}}),Eo=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=Ir(),n=wl(),r=Oo(),i=ta(),o=en(),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 l(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=l;function c(u){return u!==void 0}var d=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=d;function g(u,A,b,v){return{type:u,schema:A,path:b,value:v,message:n.TypeSystemErrorFunction.Get()(A,u)}}function*C(u,A,b,v){}function*I(u,A,b,v){if(!(0,t.IsArray)(v))return yield g(s.Array,u,b,v);c(u.minItems)&&!(v.length>=u.minItems)&&(yield g(s.ArrayMinItems,u,b,v)),c(u.maxItems)&&!(v.length<=u.maxItems)&&(yield g(s.ArrayMaxItems,u,b,v));for(let te=0;te<v.length;te++)yield*T(u.items,A,`${b}/${te}`,v[te]);if(u.uniqueItems===!0&&!function(){let te=new Set;for(let ne of v){let ge=(0,i.Hash)(ne);if(te.has(ge))return!1;te.add(ge)}return!0}()&&(yield g(s.ArrayUniqueItems,u,b,v)),!(c(u.contains)||c(u.minContains)||c(u.maxContains)))return;let N=c(u.contains)?u.contains:o.Type.Never(),q=v.reduce((te,ne,ge)=>T(N,A,`${b}${ge}`,ne).next().done===!0?te+1:te,0);q===0&&(yield g(s.ArrayContains,u,b,v)),(0,t.IsNumber)(u.minContains)&&q<u.minContains&&(yield g(s.ArrayMinContains,u,b,v)),(0,t.IsNumber)(u.maxContains)&&q>u.maxContains&&(yield g(s.ArrayMaxContains,u,b,v))}function*S(u,A,b,v){(0,t.IsAsyncIterator)(v)||(yield g(s.AsyncIterator,u,b,v))}function*z(u,A,b,v){if(!(0,t.IsBigInt)(v))return yield g(s.BigInt,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(s.BigIntExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(s.BigIntExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(s.BigIntMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(s.BigIntMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==BigInt(0)&&(yield g(s.BigIntMultipleOf,u,b,v))}function*J(u,A,b,v){(0,t.IsBoolean)(v)||(yield g(s.Boolean,u,b,v))}function*F(u,A,b,v){yield*T(u.returns,A,b,v.prototype)}function*k(u,A,b,v){if(!(0,t.IsDate)(v))return yield g(s.Date,u,b,v);c(u.exclusiveMaximumTimestamp)&&!(v.getTime()<u.exclusiveMaximumTimestamp)&&(yield g(s.DateExclusiveMaximumTimestamp,u,b,v)),c(u.exclusiveMinimumTimestamp)&&!(v.getTime()>u.exclusiveMinimumTimestamp)&&(yield g(s.DateExclusiveMinimumTimestamp,u,b,v)),c(u.maximumTimestamp)&&!(v.getTime()<=u.maximumTimestamp)&&(yield g(s.DateMaximumTimestamp,u,b,v)),c(u.minimumTimestamp)&&!(v.getTime()>=u.minimumTimestamp)&&(yield g(s.DateMinimumTimestamp,u,b,v)),c(u.multipleOfTimestamp)&&v.getTime()%u.multipleOfTimestamp!==0&&(yield g(s.DateMultipleOfTimestamp,u,b,v))}function*K(u,A,b,v){(0,t.IsFunction)(v)||(yield g(s.Function,u,b,v))}function*W(u,A,b,v){if(!(0,t.IsInteger)(v))return yield g(s.Integer,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(s.IntegerExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(s.IntegerExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(s.IntegerMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(s.IntegerMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==0&&(yield g(s.IntegerMultipleOf,u,b,v))}function*j(u,A,b,v){for(let N of u.allOf){let q=T(N,A,b,v).next();q.done||(yield g(s.Intersect,u,b,v),yield q.value)}if(u.unevaluatedProperties===!1){let N=new RegExp(o.KeyResolver.ResolvePattern(u));for(let q of Object.getOwnPropertyNames(v))N.test(q)||(yield g(s.IntersectUnevaluatedProperties,u,`${b}/${q}`,v))}if(typeof u.unevaluatedProperties=="object"){let N=new RegExp(o.KeyResolver.ResolvePattern(u));for(let q of Object.getOwnPropertyNames(v))if(!N.test(q)){let te=T(u.unevaluatedProperties,A,`${b}/${q}`,v[q]).next();te.done||(yield te.value)}}}function*Z(u,A,b,v){(0,t.IsIterator)(v)||(yield g(s.Iterator,u,b,v))}function*G(u,A,b,v){v!==u.const&&(yield g(s.Literal,u,b,v))}function*fe(u,A,b,v){yield g(s.Never,u,b,v)}function*x(u,A,b,v){T(u.not,A,b,v).next().done===!0&&(yield g(s.Not,u,b,v))}function*M(u,A,b,v){(0,t.IsNull)(v)||(yield g(s.Null,u,b,v))}function*L(u,A,b,v){if(!n.TypeSystemPolicy.IsNumberLike(v))return yield g(s.Number,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(s.NumberExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(s.NumberExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(s.NumberMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(s.NumberMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==0&&(yield g(s.NumberMultipleOf,u,b,v))}function*ee(u,A,b,v){if(!n.TypeSystemPolicy.IsObjectLike(v))return yield g(s.Object,u,b,v);c(u.minProperties)&&!(Object.getOwnPropertyNames(v).length>=u.minProperties)&&(yield g(s.ObjectMinProperties,u,b,v)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=u.maxProperties)&&(yield g(s.ObjectMaxProperties,u,b,v));let N=Array.isArray(u.required)?u.required:[],q=Object.getOwnPropertyNames(u.properties),te=Object.getOwnPropertyNames(v);for(let ne of N)te.includes(ne)||(yield g(s.ObjectRequiredProperty,u.properties[ne],`${b}/${l(ne)}`,void 0));if(u.additionalProperties===!1)for(let ne of te)q.includes(ne)||(yield g(s.ObjectAdditionalProperties,u,`${b}/${l(ne)}`,v[ne]));if(typeof u.additionalProperties=="object")for(let ne of te)q.includes(ne)||(yield*T(u.additionalProperties,A,`${b}/${l(ne)}`,v[ne]));for(let ne of q){let ge=u.properties[ne];u.required&&u.required.includes(ne)?(yield*T(ge,A,`${b}/${l(ne)}`,v[ne]),o.ExtendsUndefined.Check(u)&&!(ne in v)&&(yield g(s.ObjectRequiredProperty,ge,`${b}/${l(ne)}`,void 0))):n.TypeSystemPolicy.IsExactOptionalProperty(v,ne)&&(yield*T(ge,A,`${b}/${l(ne)}`,v[ne]))}}function*oe(u,A,b,v){(0,t.IsPromise)(v)||(yield g(s.Promise,u,b,v))}function*Q(u,A,b,v){if(!n.TypeSystemPolicy.IsRecordLike(v))return yield g(s.Object,u,b,v);c(u.minProperties)&&!(Object.getOwnPropertyNames(v).length>=u.minProperties)&&(yield g(s.ObjectMinProperties,u,b,v)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=u.maxProperties)&&(yield g(s.ObjectMaxProperties,u,b,v));let[N,q]=Object.entries(u.patternProperties)[0],te=new RegExp(N);for(let[ne,ge]of Object.entries(v))te.test(ne)&&(yield*T(q,A,`${b}/${l(ne)}`,ge));if(typeof u.additionalProperties=="object")for(let[ne,ge]of Object.entries(v))te.test(ne)||(yield*T(u.additionalProperties,A,`${b}/${l(ne)}`,ge));if(u.additionalProperties===!1){for(let[ne,ge]of Object.entries(v))if(!te.test(ne))return yield g(s.ObjectAdditionalProperties,u,`${b}/${l(ne)}`,ge)}}function*ae(u,A,b,v){yield*T((0,r.Deref)(u,A),A,b,v)}function*D(u,A,b,v){if(!(0,t.IsString)(v))return yield g(s.String,u,b,v);c(u.minLength)&&!(v.length>=u.minLength)&&(yield g(s.StringMinLength,u,b,v)),c(u.maxLength)&&!(v.length<=u.maxLength)&&(yield g(s.StringMaxLength,u,b,v)),(0,t.IsString)(u.pattern)&&(new RegExp(u.pattern).test(v)||(yield g(s.StringPattern,u,b,v))),(0,t.IsString)(u.format)&&(o.FormatRegistry.Has(u.format)?o.FormatRegistry.Get(u.format)(v)||(yield g(s.StringFormat,u,b,v)):yield g(s.StringFormatUnknown,u,b,v))}function*H(u,A,b,v){(0,t.IsSymbol)(v)||(yield g(s.Symbol,u,b,v))}function*Y(u,A,b,v){if(!(0,t.IsString)(v))return yield g(s.String,u,b,v);new RegExp(u.pattern).test(v)||(yield g(s.StringPattern,u,b,v))}function*he(u,A,b,v){yield*T((0,r.Deref)(u,A),A,b,v)}function*f(u,A,b,v){if(!(0,t.IsArray)(v))return yield g(s.Tuple,u,b,v);if(u.items===void 0&&v.length!==0)return yield g(s.TupleLength,u,b,v);if(v.length!==u.maxItems)return yield g(s.TupleLength,u,b,v);if(u.items)for(let N=0;N<u.items.length;N++)yield*T(u.items[N],A,`${b}/${N}`,v[N])}function*_(u,A,b,v){(0,t.IsUndefined)(v)||(yield g(s.Undefined,u,b,v))}function*E(u,A,b,v){let N=0;for(let q of u.anyOf){let te=[...T(q,A,b,v)];if(te.length===0)return;N+=te.length}N>0&&(yield g(s.Union,u,b,v))}function*U(u,A,b,v){if(!(0,t.IsUint8Array)(v))return yield g(s.Uint8Array,u,b,v);c(u.maxByteLength)&&!(v.length<=u.maxByteLength)&&(yield g(s.Uint8ArrayMaxByteLength,u,b,v)),c(u.minByteLength)&&!(v.length>=u.minByteLength)&&(yield g(s.Uint8ArrayMinByteLength,u,b,v))}function*P(u,A,b,v){}function*$(u,A,b,v){n.TypeSystemPolicy.IsVoidLike(v)||(yield g(s.Void,u,b,v))}function*y(u,A,b,v){o.TypeRegistry.Get(u[o.Kind])(u,v)||(yield g(s.Kind,u,b,v))}function*T(u,A,b,v){let N=c(u.$id)?[...A,u]:A,q=u;switch(q[o.Kind]){case"Any":return yield*C(q,N,b,v);case"Array":return yield*I(q,N,b,v);case"AsyncIterator":return yield*S(q,N,b,v);case"BigInt":return yield*z(q,N,b,v);case"Boolean":return yield*J(q,N,b,v);case"Constructor":return yield*F(q,N,b,v);case"Date":return yield*k(q,N,b,v);case"Function":return yield*K(q,N,b,v);case"Integer":return yield*W(q,N,b,v);case"Intersect":return yield*j(q,N,b,v);case"Iterator":return yield*Z(q,N,b,v);case"Literal":return yield*G(q,N,b,v);case"Never":return yield*fe(q,N,b,v);case"Not":return yield*x(q,N,b,v);case"Null":return yield*M(q,N,b,v);case"Number":return yield*L(q,N,b,v);case"Object":return yield*ee(q,N,b,v);case"Promise":return yield*oe(q,N,b,v);case"Record":return yield*Q(q,N,b,v);case"Ref":return yield*ae(q,N,b,v);case"String":return yield*D(q,N,b,v);case"Symbol":return yield*H(q,N,b,v);case"TemplateLiteral":return yield*Y(q,N,b,v);case"This":return yield*he(q,N,b,v);case"Tuple":return yield*f(q,N,b,v);case"Undefined":return yield*_(q,N,b,v);case"Union":return yield*E(q,N,b,v);case"Uint8Array":return yield*U(q,N,b,v);case"Unknown":return yield*P(q,N,b,v);case"Void":return yield*$(q,N,b,v);default:if(!o.TypeRegistry.Has(q[o.Kind]))throw new a(u);return yield*y(q,N,b,v)}}function w(...u){let A=u.length===3?T(u[0],u[1],"",u[2]):T(u[0],[],"",u[1]);return new d(A)}e.Errors=w}}),sy=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(r,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(r,s,a)}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),n=e&&e.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Eo(),e)}}),Tl=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 l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,a,l)}:function(i,o,s,a){a===void 0&&(a=s),i[a]=o[s]}),n=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 r=Eo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),n(wl(),e)}}),ay=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=Ir(),n=Tl(),r=Oo(),i=ta(),o=en(),s=class extends o.TypeBoxError{constructor(y){super("Unknown type"),this.schema=y}};e.ValueCheckUnknownTypeError=s;function a(y){return y[o.Kind]==="Any"||y[o.Kind]==="Unknown"}function l(y){return y!==void 0}function c(y,T,w){return!0}function d(y,T,w){if(!(0,t.IsArray)(w)||l(y.minItems)&&!(w.length>=y.minItems)||l(y.maxItems)&&!(w.length<=y.maxItems)||!w.every(b=>P(y.items,T,b))||y.uniqueItems===!0&&!function(){let b=new Set;for(let v of w){let N=(0,i.Hash)(v);if(b.has(N))return!1;b.add(N)}return!0}())return!1;if(!(l(y.contains)||(0,t.IsNumber)(y.minContains)||(0,t.IsNumber)(y.maxContains)))return!0;let u=l(y.contains)?y.contains:o.Type.Never(),A=w.reduce((b,v)=>P(u,T,v)?b+1:b,0);return!(A===0||(0,t.IsNumber)(y.minContains)&&A<y.minContains||(0,t.IsNumber)(y.maxContains)&&A>y.maxContains)}function g(y,T,w){return(0,t.IsAsyncIterator)(w)}function C(y,T,w){return!(!(0,t.IsBigInt)(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.minimum)&&!(w>=y.minimum)||l(y.multipleOf)&&w%y.multipleOf!==BigInt(0))}function I(y,T,w){return(0,t.IsBoolean)(w)}function S(y,T,w){return P(y.returns,T,w.prototype)}function z(y,T,w){return!(!(0,t.IsDate)(w)||l(y.exclusiveMaximumTimestamp)&&!(w.getTime()<y.exclusiveMaximumTimestamp)||l(y.exclusiveMinimumTimestamp)&&!(w.getTime()>y.exclusiveMinimumTimestamp)||l(y.maximumTimestamp)&&!(w.getTime()<=y.maximumTimestamp)||l(y.minimumTimestamp)&&!(w.getTime()>=y.minimumTimestamp)||l(y.multipleOfTimestamp)&&w.getTime()%y.multipleOfTimestamp!==0)}function J(y,T,w){return(0,t.IsFunction)(w)}function F(y,T,w){return!(!(0,t.IsInteger)(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.minimum)&&!(w>=y.minimum)||l(y.multipleOf)&&w%y.multipleOf!==0)}function k(y,T,w){let u=y.allOf.every(A=>P(A,T,w));if(y.unevaluatedProperties===!1){let A=new RegExp(o.KeyResolver.ResolvePattern(y)),b=Object.getOwnPropertyNames(w).every(v=>A.test(v));return u&&b}else if(o.TypeGuard.TSchema(y.unevaluatedProperties)){let A=new RegExp(o.KeyResolver.ResolvePattern(y)),b=Object.getOwnPropertyNames(w).every(v=>A.test(v)||P(y.unevaluatedProperties,T,w[v]));return u&&b}else return u}function K(y,T,w){return(0,t.IsIterator)(w)}function W(y,T,w){return w===y.const}function j(y,T,w){return!1}function Z(y,T,w){return!P(y.not,T,w)}function G(y,T,w){return(0,t.IsNull)(w)}function fe(y,T,w){return!(!n.TypeSystemPolicy.IsNumberLike(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.minimum)&&!(w>=y.minimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.multipleOf)&&w%y.multipleOf!==0)}function x(y,T,w){if(!n.TypeSystemPolicy.IsObjectLike(w)||l(y.minProperties)&&!(Object.getOwnPropertyNames(w).length>=y.minProperties)||l(y.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=y.maxProperties))return!1;let u=Object.getOwnPropertyNames(y.properties);for(let A of u){let b=y.properties[A];if(y.required&&y.required.includes(A)){if(!P(b,T,w[A])||(o.ExtendsUndefined.Check(b)||a(b))&&!(A in w))return!1}else if(n.TypeSystemPolicy.IsExactOptionalProperty(w,A)&&!P(b,T,w[A]))return!1}if(y.additionalProperties===!1){let A=Object.getOwnPropertyNames(w);return y.required&&y.required.length===u.length&&A.length===u.length?!0:A.every(b=>u.includes(b))}else return typeof y.additionalProperties=="object"?Object.getOwnPropertyNames(w).every(b=>u.includes(b)||P(y.additionalProperties,T,w[b])):!0}function M(y,T,w){return(0,t.IsPromise)(w)}function L(y,T,w){if(!n.TypeSystemPolicy.IsRecordLike(w)||l(y.minProperties)&&!(Object.getOwnPropertyNames(w).length>=y.minProperties)||l(y.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=y.maxProperties))return!1;let[u,A]=Object.entries(y.patternProperties)[0],b=new RegExp(u),v=Object.entries(w).every(([te,ne])=>b.test(te)?P(A,T,ne):!0),N=typeof y.additionalProperties=="object"?Object.entries(w).every(([te,ne])=>b.test(te)?!0:P(y.additionalProperties,T,ne)):!0,q=y.additionalProperties===!1?Object.getOwnPropertyNames(w).every(te=>b.test(te)):!0;return v&&N&&q}function ee(y,T,w){return P((0,r.Deref)(y,T),T,w)}function oe(y,T,w){return!(0,t.IsString)(w)||l(y.minLength)&&!(w.length>=y.minLength)||l(y.maxLength)&&!(w.length<=y.maxLength)||l(y.pattern)&&!new RegExp(y.pattern).test(w)?!1:l(y.format)?o.FormatRegistry.Has(y.format)?o.FormatRegistry.Get(y.format)(w):!1:!0}function Q(y,T,w){return(0,t.IsSymbol)(w)}function ae(y,T,w){return(0,t.IsString)(w)&&new RegExp(y.pattern).test(w)}function D(y,T,w){return P((0,r.Deref)(y,T),T,w)}function H(y,T,w){if(!(0,t.IsArray)(w)||y.items===void 0&&w.length!==0||w.length!==y.maxItems)return!1;if(!y.items)return!0;for(let u=0;u<y.items.length;u++)if(!P(y.items[u],T,w[u]))return!1;return!0}function Y(y,T,w){return(0,t.IsUndefined)(w)}function he(y,T,w){return y.anyOf.some(u=>P(u,T,w))}function f(y,T,w){return!(!(0,t.IsUint8Array)(w)||l(y.maxByteLength)&&!(w.length<=y.maxByteLength)||l(y.minByteLength)&&!(w.length>=y.minByteLength))}function _(y,T,w){return!0}function E(y,T,w){return n.TypeSystemPolicy.IsVoidLike(w)}function U(y,T,w){return o.TypeRegistry.Has(y[o.Kind])?o.TypeRegistry.Get(y[o.Kind])(y,w):!1}function P(y,T,w){let u=l(y.$id)?[...T,y]:T,A=y;switch(A[o.Kind]){case"Any":return c(A,u,w);case"Array":return d(A,u,w);case"AsyncIterator":return g(A,u,w);case"BigInt":return C(A,u,w);case"Boolean":return I(A,u,w);case"Constructor":return S(A,u,w);case"Date":return z(A,u,w);case"Function":return J(A,u,w);case"Integer":return F(A,u,w);case"Intersect":return k(A,u,w);case"Iterator":return K(A,u,w);case"Literal":return W(A,u,w);case"Never":return j(A,u,w);case"Not":return Z(A,u,w);case"Null":return G(A,u,w);case"Number":return fe(A,u,w);case"Object":return x(A,u,w);case"Promise":return M(A,u,w);case"Record":return L(A,u,w);case"Ref":return ee(A,u,w);case"String":return oe(A,u,w);case"Symbol":return Q(A,u,w);case"TemplateLiteral":return ae(A,u,w);case"This":return D(A,u,w);case"Tuple":return H(A,u,w);case"Undefined":return Y(A,u,w);case"Union":return he(A,u,w);case"Uint8Array":return f(A,u,w);case"Unknown":return _(A,u,w);case"Void":return E(A,u,w);default:if(!o.TypeRegistry.Has(A[o.Kind]))throw new s(A);return U(A,u,w)}}function $(...y){return y.length===3?P(y[0],y[1],y[2]):P(y[0],[],y[1])}e.Check=$}}),uy=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=Ir(),n=Oo(),r=ay(),i=en(),o=class extends i.TypeBoxError{constructor(C,I,S){super("Unable to decode due to invalid value"),this.schema=C,this.value=I,this.error=S}};e.TransformDecodeCheckError=o;var s=class extends i.TypeBoxError{constructor(C,I,S){super("Unable to encode due to invalid value"),this.schema=C,this.value=I,this.error=S}};e.TransformEncodeCheckError=s;var a=class extends i.TypeBoxError{constructor(C,I,S){super(`${S instanceof Error?S.message:"Unknown error"}`),this.schema=C,this.value=I}};e.TransformDecodeError=a;var l=class extends i.TypeBoxError{constructor(C,I,S){super(`${S instanceof Error?S.message:"Unknown error"}`),this.schema=C,this.value=I}};e.TransformEncodeError=l;var c;(function(C){function I(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.items,ae)}function S(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.items,ae)}function z(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.returns,ae)||Q.parameters.some(D=>L(D,ae))}function J(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.returns,ae)||Q.parameters.some(D=>L(D,ae))}function F(Q,ae){return i.TypeGuard.TTransform(Q)||i.TypeGuard.TTransform(Q.unevaluatedProperties)||Q.allOf.some(D=>L(D,ae))}function k(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.items,ae)}function K(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.not,ae)}function W(Q,ae){return i.TypeGuard.TTransform(Q)||Object.values(Q.properties).some(D=>L(D,ae))||i.TypeGuard.TSchema(Q.additionalProperties)&&L(Q.additionalProperties,ae)}function j(Q,ae){return i.TypeGuard.TTransform(Q)||L(Q.item,ae)}function Z(Q,ae){let D=Object.getOwnPropertyNames(Q.patternProperties)[0],H=Q.patternProperties[D];return i.TypeGuard.TTransform(Q)||L(H,ae)||i.TypeGuard.TSchema(Q.additionalProperties)&&i.TypeGuard.TTransform(Q.additionalProperties)}function G(Q,ae){return i.TypeGuard.TTransform(Q)?!0:L((0,n.Deref)(Q,ae),ae)}function fe(Q,ae){return i.TypeGuard.TTransform(Q)?!0:L((0,n.Deref)(Q,ae),ae)}function x(Q,ae){return i.TypeGuard.TTransform(Q)||!(0,t.IsUndefined)(Q.items)&&Q.items.some(D=>L(D,ae))}function M(Q,ae){return i.TypeGuard.TTransform(Q)||Q.anyOf.some(D=>L(D,ae))}function L(Q,ae){let D=(0,t.IsString)(Q.$id)?[...ae,Q]:ae,H=Q;if(Q.$id&&ee.has(Q.$id))return!1;switch(Q.$id&&ee.add(Q.$id),Q[i.Kind]){case"Array":return I(H,D);case"AsyncIterator":return S(H,D);case"Constructor":return z(H,D);case"Function":return J(H,D);case"Intersect":return F(H,D);case"Iterator":return k(H,D);case"Not":return K(H,D);case"Object":return W(H,D);case"Promise":return j(H,D);case"Record":return Z(H,D);case"Ref":return G(H,D);case"This":return fe(H,D);case"Tuple":return x(H,D);case"Union":return M(H,D);default:return i.TypeGuard.TTransform(Q)}}let ee=new Set;function oe(Q,ae){return ee.clear(),L(Q,ae)}C.Has=oe})(c||(e.HasTransform=c={}));var d;(function(C){function I(x,M){try{return i.TypeGuard.TTransform(x)?x[i.Transform].Decode(M):M}catch(L){throw new a(x,M,L)}}function S(x,M,L){return(0,t.IsArray)(L)?I(x,L.map(ee=>G(x.items,M,ee))):I(x,L)}function z(x,M,L){if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return I(x,L);let ee=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),oe=ee.reduce((H,Y)=>Y in H?{...H,[Y]:G(i.IndexedAccessor.Resolve(x,[Y]),M,H[Y])}:H,L);if(!i.TypeGuard.TTransform(x.unevaluatedProperties))return I(x,oe);let Q=Object.getOwnPropertyNames(oe),ae=x.unevaluatedProperties,D=Q.reduce((H,Y)=>ee.includes(Y)?H:{...H,[Y]:I(ae,H[Y])},oe);return I(x,D)}function J(x,M,L){return I(x,G(x.not,M,L))}function F(x,M,L){if(!(0,t.IsPlainObject)(L))return I(x,L);let ee=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),oe=ee.reduce((H,Y)=>Y in H?{...H,[Y]:G(x.properties[Y],M,H[Y])}:H,L);if(!i.TypeGuard.TSchema(x.additionalProperties))return I(x,oe);let Q=Object.getOwnPropertyNames(oe),ae=x.additionalProperties,D=Q.reduce((H,Y)=>ee.includes(Y)?H:{...H,[Y]:I(ae,H[Y])},oe);return I(x,D)}function k(x,M,L){if(!(0,t.IsPlainObject)(L))return I(x,L);let ee=Object.getOwnPropertyNames(x.patternProperties)[0],oe=new RegExp(ee),Q=Object.getOwnPropertyNames(L).reduce((Y,he)=>oe.test(he)?{...Y,[he]:G(x.patternProperties[ee],M,Y[he])}:Y,L);if(!i.TypeGuard.TSchema(x.additionalProperties))return I(x,Q);let ae=Object.getOwnPropertyNames(Q),D=x.additionalProperties,H=ae.reduce((Y,he)=>oe.test(he)?Y:{...Y,[he]:I(D,Y[he])},Q);return I(x,H)}function K(x,M,L){let ee=(0,n.Deref)(x,M);return I(x,G(ee,M,L))}function W(x,M,L){let ee=(0,n.Deref)(x,M);return I(x,G(ee,M,L))}function j(x,M,L){return(0,t.IsArray)(L)&&(0,t.IsArray)(x.items)?I(x,x.items.map((ee,oe)=>G(ee,M,L[oe]))):I(x,L)}function Z(x,M,L){let ee=I(x,L);for(let oe of x.anyOf)if((0,r.Check)(oe,M,ee))return G(oe,M,ee);return ee}function G(x,M,L){let ee=typeof x.$id=="string"?[...M,x]:M,oe=x;switch(x[i.Kind]){case"Array":return S(oe,ee,L);case"Intersect":return z(oe,ee,L);case"Not":return J(oe,ee,L);case"Object":return F(oe,ee,L);case"Record":return k(oe,ee,L);case"Ref":return K(oe,ee,L);case"Symbol":return I(oe,L);case"This":return W(oe,ee,L);case"Tuple":return j(oe,ee,L);case"Union":return Z(oe,ee,L);default:return I(oe,L)}}function fe(x,M,L){return G(x,M,L)}C.Decode=fe})(d||(e.DecodeTransform=d={}));var g;(function(C){function I(x,M){try{return i.TypeGuard.TTransform(x)?x[i.Transform].Encode(M):M}catch(L){throw new l(x,M,L)}}function S(x,M,L){let ee=I(x,L);return(0,t.IsArray)(ee)?ee.map(oe=>G(x.items,M,oe)):ee}function z(x,M,L){let ee=I(x,L);if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return ee;let oe=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),Q=oe.reduce((H,Y)=>Y in ee?{...H,[Y]:G(i.IndexedAccessor.Resolve(x,[Y]),M,H[Y])}:H,ee);if(!i.TypeGuard.TTransform(x.unevaluatedProperties))return I(x,Q);let ae=Object.getOwnPropertyNames(Q),D=x.unevaluatedProperties;return ae.reduce((H,Y)=>oe.includes(Y)?H:{...H,[Y]:I(D,H[Y])},Q)}function J(x,M,L){return I(x.not,I(x,L))}function F(x,M,L){let ee=I(x,L);if(!(0,t.IsPlainObject)(L))return ee;let oe=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),Q=oe.reduce((H,Y)=>Y in H?{...H,[Y]:G(x.properties[Y],M,H[Y])}:H,ee);if(!i.TypeGuard.TSchema(x.additionalProperties))return Q;let ae=Object.getOwnPropertyNames(Q),D=x.additionalProperties;return ae.reduce((H,Y)=>oe.includes(Y)?H:{...H,[Y]:I(D,H[Y])},Q)}function k(x,M,L){let ee=I(x,L);if(!(0,t.IsPlainObject)(L))return ee;let oe=Object.getOwnPropertyNames(x.patternProperties)[0],Q=new RegExp(oe),ae=Object.getOwnPropertyNames(L).reduce((Y,he)=>Q.test(he)?{...Y,[he]:G(x.patternProperties[oe],M,Y[he])}:Y,ee);if(!i.TypeGuard.TSchema(x.additionalProperties))return I(x,ae);let D=Object.getOwnPropertyNames(ae),H=x.additionalProperties;return D.reduce((Y,he)=>Q.test(he)?Y:{...Y,[he]:I(H,Y[he])},ae)}function K(x,M,L){let ee=(0,n.Deref)(x,M),oe=G(ee,M,L);return I(x,oe)}function W(x,M,L){let ee=(0,n.Deref)(x,M),oe=G(ee,M,L);return I(x,oe)}function j(x,M,L){let ee=I(x,L);return(0,t.IsArray)(x.items)?x.items.map((oe,Q)=>G(oe,M,ee[Q])):[]}function Z(x,M,L){for(let ee of x.anyOf){if(!(0,r.Check)(ee,M,L))continue;let oe=G(ee,M,L);return I(x,oe)}for(let ee of x.anyOf){let oe=G(ee,M,L);if((0,r.Check)(x,M,oe))return I(x,oe)}return I(x,L)}function G(x,M,L){let ee=typeof x.$id=="string"?[...M,x]:M,oe=x;switch(x[i.Kind]){case"Array":return S(oe,ee,L);case"Intersect":return z(oe,ee,L);case"Not":return J(oe,ee,L);case"Object":return F(oe,ee,L);case"Record":return k(oe,ee,L);case"Ref":return K(oe,ee,L);case"This":return W(oe,ee,L);case"Tuple":return j(oe,ee,L);case"Union":return Z(oe,ee,L);default:return I(oe,L)}}function fe(x,M,L){return G(x,M,L)}C.Encode=fe})(g||(e.EncodeTransform=g={}))}}),cy=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=uy(),n=Ir(),r=Eo(),i=Tl(),o=Oo(),s=ta(),a=en(),l=class{constructor(F,k,K,W){this.schema=F,this.references=k,this.checkFunc=K,this.code=W,this.hasTransform=t.HasTransform.Has(F,k)}Code(){return this.code}Errors(F){return(0,r.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 k=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,F):F;if(!this.checkFunc(k))throw new t.TransformEncodeCheckError(this.schema,F,this.Errors(F).First());return k}};e.TypeCheck=l;var c;(function(F){function k(Z){return Z===36}F.DollarSign=k;function K(Z){return Z===95}F.IsUnderscore=K;function W(Z){return Z>=65&&Z<=90||Z>=97&&Z<=122}F.IsAlpha=W;function j(Z){return Z>=48&&Z<=57}F.IsNumeric=j})(c||(c={}));var d;(function(F){function k(Z){return Z.length===0?!1:c.IsNumeric(Z.charCodeAt(0))}function K(Z){if(k(Z))return!1;for(let G=0;G<Z.length;G++){let fe=Z.charCodeAt(G);if(!(c.IsAlpha(fe)||c.IsNumeric(fe)||c.DollarSign(fe)||c.IsUnderscore(fe)))return!1}return!0}function W(Z){return Z.replace(/'/g,"\\'")}function j(Z,G){return K(G)?`${Z}.${G}`:`${Z}['${W(G)}']`}F.Encode=j})(d||(d={}));var g;(function(F){function k(K){let W=[];for(let j=0;j<K.length;j++){let Z=K.charCodeAt(j);c.IsNumeric(Z)||c.IsAlpha(Z)?W.push(K.charAt(j)):W.push(`_${Z}_`)}return W.join("").replace(/__/g,"_")}F.Encode=k})(g||(g={}));var C;(function(F){function k(K){return K.replace(/'/g,"\\'")}F.Escape=k})(C||(C={}));var I=class extends a.TypeBoxError{constructor(F){super("Unknown type"),this.schema=F}};e.TypeCompilerUnknownTypeError=I;var S=class extends a.TypeBoxError{constructor(F){super("Preflight validation check failed to guard for the given schema"),this.schema=F}};e.TypeCompilerTypeGuardError=S;var z;(function(F){function k(G,fe,x){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${fe}' in ${G} ? ${x} : true)`:`(${d.Encode(G,fe)} !== undefined ? ${x} : true)`}F.IsExactOptionalProperty=k;function K(G){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${G} === 'object' && ${G} !== null)`:`(typeof ${G} === 'object' && ${G} !== null && !Array.isArray(${G}))`}F.IsObjectLike=K;function W(G){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${G} === 'object' && ${G} !== null && !(${G} instanceof Date) && !(${G} instanceof Uint8Array))`:`(typeof ${G} === 'object' && ${G} !== null && !Array.isArray(${G}) && !(${G} instanceof Date) && !(${G} instanceof Uint8Array))`}F.IsRecordLike=W;function j(G){return i.TypeSystemPolicy.AllowNaN?`typeof ${G} === 'number'`:`(typeof ${G} === 'number' && Number.isFinite(${G}))`}F.IsNumberLike=j;function Z(G){return i.TypeSystemPolicy.AllowNullVoid?`(${G} === undefined || ${G} === null)`:`${G} === undefined`}F.IsVoidLike=Z})(z||(e.Policy=z={}));var J;(function(F){function k(O){return O[a.Kind]==="Any"||O[a.Kind]==="Unknown"}function*K(O,le,R){yield"true"}function*W(O,le,R){yield`Array.isArray(${R})`;let[me,re]=[Fe("value","any"),Fe("acc","number")];(0,n.IsNumber)(O.maxItems)&&(yield`${R}.length <= ${O.maxItems}`),(0,n.IsNumber)(O.minItems)&&(yield`${R}.length >= ${O.minItems}`);let de=ne(O.items,le,"value");if(yield`${R}.every((${me}) => ${de})`,a.TypeGuard.TSchema(O.contains)||(0,n.IsNumber)(O.minContains)||(0,n.IsNumber)(O.maxContains)){let Se=a.TypeGuard.TSchema(O.contains)?O.contains:a.Type.Never(),ke=ne(Se,le,"value"),rt=(0,n.IsNumber)(O.minContains)?[`(count >= ${O.minContains})`]:[],et=(0,n.IsNumber)(O.maxContains)?[`(count <= ${O.maxContains})`]:[],ot=`const count = value.reduce((${re}, ${me}) => ${ke} ? acc + 1 : acc, 0)`,Zt=["(count > 0)",...rt,...et].join(" && ");yield`((${me}) => { ${ot}; return ${Zt}})(${R})`}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 } )(${R})`)}function*j(O,le,R){yield`(typeof value === 'object' && Symbol.asyncIterator in ${R})`}function*Z(O,le,R){yield`(typeof ${R} === 'bigint')`,(0,n.IsBigInt)(O.exclusiveMaximum)&&(yield`${R} < BigInt(${O.exclusiveMaximum})`),(0,n.IsBigInt)(O.exclusiveMinimum)&&(yield`${R} > BigInt(${O.exclusiveMinimum})`),(0,n.IsBigInt)(O.maximum)&&(yield`${R} <= BigInt(${O.maximum})`),(0,n.IsBigInt)(O.minimum)&&(yield`${R} >= BigInt(${O.minimum})`),(0,n.IsBigInt)(O.multipleOf)&&(yield`(${R} % BigInt(${O.multipleOf})) === 0`)}function*G(O,le,R){yield`(typeof ${R} === 'boolean')`}function*fe(O,le,R){yield*q(O.returns,le,`${R}.prototype`)}function*x(O,le,R){yield`(${R} instanceof Date) && Number.isFinite(${R}.getTime())`,(0,n.IsNumber)(O.exclusiveMaximumTimestamp)&&(yield`${R}.getTime() < ${O.exclusiveMaximumTimestamp}`),(0,n.IsNumber)(O.exclusiveMinimumTimestamp)&&(yield`${R}.getTime() > ${O.exclusiveMinimumTimestamp}`),(0,n.IsNumber)(O.maximumTimestamp)&&(yield`${R}.getTime() <= ${O.maximumTimestamp}`),(0,n.IsNumber)(O.minimumTimestamp)&&(yield`${R}.getTime() >= ${O.minimumTimestamp}`),(0,n.IsNumber)(O.multipleOfTimestamp)&&(yield`(${R}.getTime() % ${O.multipleOfTimestamp}) === 0`)}function*M(O,le,R){yield`(typeof ${R} === 'function')`}function*L(O,le,R){yield`(typeof ${R} === 'number' && Number.isInteger(${R}))`,(0,n.IsNumber)(O.exclusiveMaximum)&&(yield`${R} < ${O.exclusiveMaximum}`),(0,n.IsNumber)(O.exclusiveMinimum)&&(yield`${R} > ${O.exclusiveMinimum}`),(0,n.IsNumber)(O.maximum)&&(yield`${R} <= ${O.maximum}`),(0,n.IsNumber)(O.minimum)&&(yield`${R} >= ${O.minimum}`),(0,n.IsNumber)(O.multipleOf)&&(yield`(${R} % ${O.multipleOf}) === 0`)}function*ee(O,le,R){let me=O.allOf.map(re=>ne(re,le,R)).join(" && ");if(O.unevaluatedProperties===!1){let re=be(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),de=`Object.getOwnPropertyNames(${R}).every(key => ${re}.test(key))`;yield`(${me} && ${de})`}else if(a.TypeGuard.TSchema(O.unevaluatedProperties)){let re=be(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),de=`Object.getOwnPropertyNames(${R}).every(key => ${re}.test(key) || ${ne(O.unevaluatedProperties,le,`${R}[key]`)})`;yield`(${me} && ${de})`}else yield`(${me})`}function*oe(O,le,R){yield`(typeof value === 'object' && Symbol.iterator in ${R})`}function*Q(O,le,R){typeof O.const=="number"||typeof O.const=="boolean"?yield`(${R} === ${O.const})`:yield`(${R} === '${C.Escape(O.const)}')`}function*ae(O,le,R){yield"false"}function*D(O,le,R){yield`(!${ne(O.not,le,R)})`}function*H(O,le,R){yield`(${R} === null)`}function*Y(O,le,R){yield z.IsNumberLike(R),(0,n.IsNumber)(O.exclusiveMaximum)&&(yield`${R} < ${O.exclusiveMaximum}`),(0,n.IsNumber)(O.exclusiveMinimum)&&(yield`${R} > ${O.exclusiveMinimum}`),(0,n.IsNumber)(O.maximum)&&(yield`${R} <= ${O.maximum}`),(0,n.IsNumber)(O.minimum)&&(yield`${R} >= ${O.minimum}`),(0,n.IsNumber)(O.multipleOf)&&(yield`(${R} % ${O.multipleOf}) === 0`)}function*he(O,le,R){yield z.IsObjectLike(R),(0,n.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${R}).length >= ${O.minProperties}`),(0,n.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${R}).length <= ${O.maxProperties}`);let me=Object.getOwnPropertyNames(O.properties);for(let re of me){let de=d.Encode(R,re),Se=O.properties[re];if(O.required&&O.required.includes(re))yield*q(Se,le,de),(a.ExtendsUndefined.Check(Se)||k(Se))&&(yield`('${re}' in ${R})`);else{let ke=ne(Se,le,de);yield z.IsExactOptionalProperty(R,re,ke)}}if(O.additionalProperties===!1)if(O.required&&O.required.length===me.length)yield`Object.getOwnPropertyNames(${R}).length === ${me.length}`;else{let re=`[${me.map(de=>`'${de}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${R}).every(key => ${re}.includes(key))`}if(typeof O.additionalProperties=="object"){let re=ne(O.additionalProperties,le,`${R}[key]`),de=`[${me.map(Se=>`'${Se}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${R}).every(key => ${de}.includes(key) || ${re}))`}}function*f(O,le,R){yield`(typeof value === 'object' && typeof ${R}.then === 'function')`}function*_(O,le,R){yield z.IsRecordLike(R),(0,n.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${R}).length >= ${O.minProperties}`),(0,n.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${R}).length <= ${O.maxProperties}`);let[me,re]=Object.entries(O.patternProperties)[0],de=be(`${new RegExp(me)}`),Se=ne(re,le,"value"),ke=a.TypeGuard.TSchema(O.additionalProperties)?ne(O.additionalProperties,le,R):O.additionalProperties===!1?"false":"true",rt=`(${de}.test(key) ? ${Se} : ${ke})`;yield`(Object.entries(${R}).every(([key, value]) => ${rt}))`}function*E(O,le,R){let me=(0,o.Deref)(O,le);if(te.functions.has(O.$ref))return yield`${ge(O.$ref)}(${R})`;yield*q(me,le,R)}function*U(O,le,R){yield`(typeof ${R} === 'string')`,(0,n.IsNumber)(O.maxLength)&&(yield`${R}.length <= ${O.maxLength}`),(0,n.IsNumber)(O.minLength)&&(yield`${R}.length >= ${O.minLength}`),O.pattern!==void 0&&(yield`${be(`${new RegExp(O.pattern)};`)}.test(${R})`),O.format!==void 0&&(yield`format('${O.format}', ${R})`)}function*P(O,le,R){yield`(typeof ${R} === 'symbol')`}function*$(O,le,R){yield`(typeof ${R} === 'string')`,yield`${be(`${new RegExp(O.pattern)};`)}.test(${R})`}function*y(O,le,R){yield`${ge(O.$ref)}(${R})`}function*T(O,le,R){if(yield`Array.isArray(${R})`,O.items===void 0)return yield`${R}.length === 0`;yield`(${R}.length === ${O.maxItems})`;for(let me=0;me<O.items.length;me++)yield`${ne(O.items[me],le,`${R}[${me}]`)}`}function*w(O,le,R){yield`${R} === undefined`}function*u(O,le,R){yield`(${O.anyOf.map(re=>ne(re,le,R)).join(" || ")})`}function*A(O,le,R){yield`${R} instanceof Uint8Array`,(0,n.IsNumber)(O.maxByteLength)&&(yield`(${R}.length <= ${O.maxByteLength})`),(0,n.IsNumber)(O.minByteLength)&&(yield`(${R}.length >= ${O.minByteLength})`)}function*b(O,le,R){yield"true"}function*v(O,le,R){yield z.IsVoidLike(R)}function*N(O,le,R){let me=te.instances.size;te.instances.set(me,O),yield`kind('${O[a.Kind]}', ${me}, ${R})`}function*q(O,le,R,me=!0){let re=(0,n.IsString)(O.$id)?[...le,O]:le,de=O;if(me&&(0,n.IsString)(O.$id)){let Se=ge(O.$id);if(te.functions.has(Se))return yield`${Se}(${R})`;{let ke=Ue(Se,O,le,"value",!1);return te.functions.set(Se,ke),yield`${Se}(${R})`}}switch(de[a.Kind]){case"Any":return yield*K(de,re,R);case"Array":return yield*W(de,re,R);case"AsyncIterator":return yield*j(de,re,R);case"BigInt":return yield*Z(de,re,R);case"Boolean":return yield*G(de,re,R);case"Constructor":return yield*fe(de,re,R);case"Date":return yield*x(de,re,R);case"Function":return yield*M(de,re,R);case"Integer":return yield*L(de,re,R);case"Intersect":return yield*ee(de,re,R);case"Iterator":return yield*oe(de,re,R);case"Literal":return yield*Q(de,re,R);case"Never":return yield*ae(de,re,R);case"Not":return yield*D(de,re,R);case"Null":return yield*H(de,re,R);case"Number":return yield*Y(de,re,R);case"Object":return yield*he(de,re,R);case"Promise":return yield*f(de,re,R);case"Record":return yield*_(de,re,R);case"Ref":return yield*E(de,re,R);case"String":return yield*U(de,re,R);case"Symbol":return yield*P(de,re,R);case"TemplateLiteral":return yield*$(de,re,R);case"This":return yield*y(de,re,R);case"Tuple":return yield*T(de,re,R);case"Undefined":return yield*w(de,re,R);case"Union":return yield*u(de,re,R);case"Uint8Array":return yield*A(de,re,R);case"Unknown":return yield*b(de,re,R);case"Void":return yield*v(de,re,R);default:if(!a.TypeRegistry.Has(de[a.Kind]))throw new I(O);return yield*N(de,re,R)}}let te={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function ne(O,le,R,me=!0){return`(${[...q(O,le,R,me)].join(" && ")})`}function ge(O){return`check_${g.Encode(O)}`}function be(O){let le=`local_${te.variables.size}`;return te.variables.set(le,`const ${le} = ${O}`),le}function Ue(O,le,R,me,re=!0){let[de,Se]=[`
49
49
  `,ot=>"".padStart(ot," ")],ke=Fe("value","any"),rt=Pn("boolean"),et=[...q(le,R,me,re)].map(ot=>`${Se(4)}${ot}`).join(` &&${de}`);return`function ${O}(${ke})${rt} {${de}${Se(2)}return (${de}${et}${de}${Se(2)})
50
50
  }`}function Fe(O,le){let R=te.language==="typescript"?`: ${le}`:"";return`${O}${R}`}function Pn(O){return te.language==="typescript"?`: ${O}`:""}function _e(O,le,R){let me=Ue("check",O,le,"value"),re=Fe("value","any"),de=Pn("boolean"),Se=[...te.functions.values()],ke=[...te.variables.values()],rt=(0,n.IsString)(O.$id)?`return function check(${re})${de} {
51
51
  return ${ge(O.$id)}(value)
52
52
  }`:`return ${me}`;return[...ke,...Se,rt].join(`
53
- `)}function pn(...O){let le={language:"javascript"},[R,me,re]=O.length===2&&(0,n.IsArray)(O[1])?[O[0],O[1],le]:O.length===2&&!(0,n.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=re.language,te.variables.clear(),te.functions.clear(),te.instances.clear(),!a.TypeGuard.TSchema(R))throw new S(R);for(let de of me)if(!a.TypeGuard.TSchema(de))throw new S(de);return _e(R,me,re)}F.Code=pn;function Cn(O,le=[]){let R=pn(O,le,{language:"javascript"}),me=globalThis.Function("kind","format","hash",R),re=new Map(te.instances);function de(et,ot,Zt){if(!a.TypeRegistry.Has(et)||!re.has(ot))return!1;let ur=a.TypeRegistry.Get(et),cr=re.get(ot);return ur(cr,Zt)}function Se(et,ot){return a.FormatRegistry.Has(et)?a.FormatRegistry.Get(et)(ot):!1}function ke(et){return(0,s.Hash)(et)}let rt=me(de,Se,ke);return new l(O,le,rt,R)}F.Compile=Cn})(J||(e.TypeCompiler=J={}))}}),ly=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 l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,a,l)}:function(i,o,s,a){a===void 0&&(a=s),i[a]=o[s]}),n=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 r=sy();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return r.ValueErrorIterator}}),n(cy(),e)}}),oo=mt(ry(),1),fy=mt(iy(),1),Tl=!1,Al=!1;oo.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(Tl=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(Al=process?.env?.LOGGER_PERF_PREFIX==="true"));var dy={prefix:void 0,time:Tl,delta:Al,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},Ns=[],Ol=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,n,r){Object.assign(this,{sinceFirst:e,sinceLast:t,time:n,delta:r})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),n=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?n:null].filter(r=>r!=null).join(",")}]`}},El=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},ii=!1,$e=class ut{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=ut.INFO,n={}){n=Object.assign({},dy,n),t>10&&console.debug("setup logger",{config:n});let r=this.wrapLog(console.debug,{...n,dim:n.dimDebugOnServer}),i=(...l)=>{typeof window<"u"&&window?.FORCE_DISABLE_LOGLEVEL&&r(...l)};i.isDisabled=!0,i.isEnabled=!1;let o=this.wrapLog(console.groupCollapsed,n),s=(l,c)=>{function d(...C){let I=C[C.length-1];return I===i?I():(o(...C.slice(0,-1)),(async()=>{try{let S=I();return S instanceof Promise?await S:S}finally{console.groupEnd()}})())}let g=Object.assign(c.bind({}),{isEnabled:l,isDisabled:!l,group:d,force:c});return l?g:Object.assign(i.bind({}),{isEnabled:l,isDisabled:!l,group:d,force:g})},a=s(t>=ut.ERROR,this.wrapLog(console.error,n));return{ERROR:(...l)=>(a(...l),new Error(l.map(c=>typeof c=="string"?c:(0,fy.default)(c)).join(" "))),WARN:s(t>=ut.WARN,this.wrapLog(console.warn,n)),LOG:s(t>=ut.INFO,this.wrapLog(console.log,n)),DEBUG:s(t>=ut.DEBUG,this.wrapLog(console.log,{...n,dim:n.dimDebugOnServer})),VERBOSE:s(t>=ut.VERBOSE,this.wrapLog(console.debug,{...n,dim:n.dimDebugOnServer}))}}static wrapLog(t,n){if(oo.isNode)return t.bind(console);{let r=[];if(n.time||n.delta){let i=oo.isBrowser&&navigator.userAgent.includes("Chrome")?["",ut.timeStr(!!n.time,!!n.delta)]:[];r.push(...i)}return n.prefix&&(ii?r.push(new El("dim",n.prefix)):r.push(n.prefix)),t.bind(console,...r)}}static timeStr(t,n,r=0){if(!performance.now)return;let i=performance.now();ut.firstLog||(ut.firstLog=i,ut.lastLog=i);let o=new Ol(i-ut.firstLog,i-ut.lastLog,t,n);return ut.lastLog=i,r?o.toString():o}static getOriginFromStack(t){let n=!1;for(let r of t.split(`
54
- `)){let i=r.match(/^\s+at\s+(.*)/);if(i){if(n)return i[1].trim().replace(__dirname,"");n=!0}}}};oo.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Ns&&Ns.length){for(let t of Ns)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof Ol))return null;ii||(ii=!0);let t=$e.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof El?(ii||(ii=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var py=typeof global=="object"&&global&&global.Object===Object&&global,Il=py,hy=typeof self=="object"&&self&&self.Object===Object&&self,yy=Il||hy||Function("return this")(),ht=yy,gy=ht.Symbol,Xt=gy,Sl=Object.prototype,my=Sl.hasOwnProperty,vy=Sl.toString,ti=Xt?Xt.toStringTag:void 0;function by(e){var t=my.call(e,ti),n=e[ti];try{e[ti]=void 0;var r=!0}catch{}var i=vy.call(e);return r&&(t?e[ti]=n:delete e[ti]),i}var _y=by,wy=Object.prototype,Ty=wy.toString;function Ay(e){return Ty.call(e)}var Oy=Ay,Ey="[object Null]",Iy="[object Undefined]",lc=Xt?Xt.toStringTag:void 0;function Sy(e){return e==null?e===void 0?Iy:Ey:lc&&lc in Object(e)?_y(e):Oy(e)}var Sr=Sy;function $y(e){return e!=null&&typeof e=="object"}var On=$y,Ny="[object Symbol]";function Ry(e){return typeof e=="symbol"||On(e)&&Sr(e)==Ny}var Or=Ry;function Py(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var $l=Py,Cy=Array.isArray,Vt=Cy,xy=1/0,fc=Xt?Xt.prototype:void 0,dc=fc?fc.toString:void 0;function Nl(e){if(typeof e=="string")return e;if(Vt(e))return $l(e,Nl)+"";if(Or(e))return dc?dc.call(e):"";var t=e+"";return t=="0"&&1/e==-xy?"-0":t}var Uy=Nl,My=/\s/;function By(e){for(var t=e.length;t--&&My.test(e.charAt(t)););return t}var Dy=By,Ly=/^\s+/;function ky(e){return e&&e.slice(0,Dy(e)+1).replace(Ly,"")}var jy=ky;function Fy(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var an=Fy,pc=NaN,zy=/^[-+]0x[0-9a-f]+$/i,Vy=/^0b[01]+$/i,Ky=/^0o[0-7]+$/i,qy=parseInt;function Gy(e){if(typeof e=="number")return e;if(Or(e))return pc;if(an(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=an(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=jy(e);var n=Vy.test(e);return n||Ky.test(e)?qy(e.slice(2),n?2:8):zy.test(e)?pc:+e}var Wy=Gy,hc=1/0,Hy=17976931348623157e292;function Jy(e){if(!e)return e===0?e:0;if(e=Wy(e),e===hc||e===-hc){var t=e<0?-1:1;return t*Hy}return e===e?e:0}var Xy=Jy;function Yy(e){var t=Xy(e),n=t%1;return t===t?n?t-n:t:0}var yc=Yy;function Qy(e){return e}var Eo=Qy,Zy="[object AsyncFunction]",eg="[object Function]",tg="[object GeneratorFunction]",ng="[object Proxy]";function rg(e){if(!an(e))return!1;var t=Sr(e);return t==eg||t==tg||t==Zy||t==ng}var Rl=rg,ig=ht["__core-js_shared__"],Rs=ig,gc=function(){var e=/[^.]+$/.exec(Rs&&Rs.keys&&Rs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function og(e){return!!gc&&gc in e}var sg=og,ag=Function.prototype,ug=ag.toString;function cg(e){if(e!=null){try{return ug.call(e)}catch{}try{return e+""}catch{}}return""}var Jn=cg,lg=/[\\^$.*+?()[\]{}|]/g,fg=/^\[object .+?Constructor\]$/,dg=Function.prototype,pg=Object.prototype,hg=dg.toString,yg=pg.hasOwnProperty,gg=RegExp("^"+hg.call(yg).replace(lg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mg(e){if(!an(e)||sg(e))return!1;var t=Rl(e)?gg:fg;return t.test(Jn(e))}var vg=mg;function bg(e,t){return e?.[t]}var _g=bg;function wg(e,t){var n=_g(e,t);return vg(n)?n:void 0}var Xn=wg,Tg=Xn(ht,"WeakMap"),si=Tg,Ag=si&&new si,so=Ag,Og=so?function(e,t){return so.set(e,t),e}:Eo,Pl=Og,mc=Object.create,Eg=function(){function e(){}return function(t){if(!an(t))return{};if(mc)return mc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Zs=Eg;function Ig(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 n=Zs(e.prototype),r=e.apply(n,t);return an(r)?r:n}}var ai=Ig,Sg=1;function $g(e,t,n){var r=t&Sg,i=ai(e);function o(){var s=this&&this!==ht&&this instanceof o?i:e;return s.apply(r?n:this,arguments)}return o}var Ng=$g;function Rg(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var ea=Rg,Pg=Math.max;function Cg(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,l=t.length,c=Pg(o-s,0),d=Array(l+c),g=!r;++a<l;)d[a]=t[a];for(;++i<s;)(g||i<o)&&(d[n[i]]=e[i]);for(;c--;)d[a++]=e[i++];return d}var Cl=Cg,xg=Math.max;function Ug(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,l=-1,c=t.length,d=xg(o-a,0),g=Array(d+c),C=!r;++i<d;)g[i]=e[i];for(var I=i;++l<c;)g[I+l]=t[l];for(;++s<a;)(C||i<o)&&(g[I+n[s]]=e[i++]);return g}var xl=Ug;function Mg(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Bg=Mg;function Dg(){}var ta=Dg,Lg=4294967295;function ao(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Lg,this.__views__=[]}ao.prototype=Zs(ta.prototype);ao.prototype.constructor=ao;var na=ao;function kg(){}var Ul=kg,jg=so?function(e){return so.get(e)}:Ul,Ml=jg,Fg={},vc=Fg,zg=Object.prototype,Vg=zg.hasOwnProperty;function Kg(e){for(var t=e.name+"",n=vc[t],r=Vg.call(vc,t)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==e)return i.name}return t}var qg=Kg;function uo(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}uo.prototype=Zs(ta.prototype);uo.prototype.constructor=uo;var zs=uo;function Gg(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Bl=Gg;function Wg(e){if(e instanceof na)return e.clone();var t=new zs(e.__wrapped__,e.__chain__);return t.__actions__=Bl(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Hg=Wg,Jg=Object.prototype,Xg=Jg.hasOwnProperty;function co(e){if(On(e)&&!Vt(e)&&!(e instanceof na)){if(e instanceof zs)return e;if(Xg.call(e,"__wrapped__"))return Hg(e)}return new zs(e)}co.prototype=ta.prototype;co.prototype.constructor=co;var Yg=co;function Qg(e){var t=qg(e),n=Yg[t];if(typeof n!="function"||!(t in na.prototype))return!1;if(e===n)return!0;var r=Ml(n);return!!r&&e===r[0]}var Zg=Qg,em=800,tm=16,nm=Date.now;function rm(e){var t=0,n=0;return function(){var r=nm(),i=tm-(r-n);if(n=r,i>0){if(++t>=em)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Dl=rm,im=Dl(Pl),Ll=im,om=/\{\n\/\* \[wrapped with (.+)\] \*/,sm=/,? & /;function am(e){var t=e.match(om);return t?t[1].split(sm):[]}var um=am,cm=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function lm(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(cm,`{
53
+ `)}function pn(...O){let le={language:"javascript"},[R,me,re]=O.length===2&&(0,n.IsArray)(O[1])?[O[0],O[1],le]:O.length===2&&!(0,n.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=re.language,te.variables.clear(),te.functions.clear(),te.instances.clear(),!a.TypeGuard.TSchema(R))throw new S(R);for(let de of me)if(!a.TypeGuard.TSchema(de))throw new S(de);return _e(R,me,re)}F.Code=pn;function Cn(O,le=[]){let R=pn(O,le,{language:"javascript"}),me=globalThis.Function("kind","format","hash",R),re=new Map(te.instances);function de(et,ot,Zt){if(!a.TypeRegistry.Has(et)||!re.has(ot))return!1;let ur=a.TypeRegistry.Get(et),cr=re.get(ot);return ur(cr,Zt)}function Se(et,ot){return a.FormatRegistry.Has(et)?a.FormatRegistry.Get(et)(ot):!1}function ke(et){return(0,s.Hash)(et)}let rt=me(de,Se,ke);return new l(O,le,rt,R)}F.Compile=Cn})(J||(e.TypeCompiler=J={}))}}),ly=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 l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,a,l)}:function(i,o,s,a){a===void 0&&(a=s),i[a]=o[s]}),n=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 r=sy();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return r.ValueErrorIterator}}),n(cy(),e)}}),so=mt(ry(),1),fy=mt(iy(),1),Al=!1,Ol=!1;so.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(Al=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(Ol=process?.env?.LOGGER_PERF_PREFIX==="true"));var dy={prefix:void 0,time:Al,delta:Ol,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},Ps=[],El=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,n,r){Object.assign(this,{sinceFirst:e,sinceLast:t,time:n,delta:r})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),n=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?n:null].filter(r=>r!=null).join(",")}]`}},Il=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},ii=!1,$e=class ut{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=ut.INFO,n={}){n=Object.assign({},dy,n),t>10&&console.debug("setup logger",{config:n});let r=this.wrapLog(console.debug,{...n,dim:n.dimDebugOnServer}),i=(...l)=>{typeof window<"u"&&window?.FORCE_DISABLE_LOGLEVEL&&r(...l)};i.isDisabled=!0,i.isEnabled=!1;let o=this.wrapLog(console.groupCollapsed,n),s=(l,c)=>{function d(...C){let I=C[C.length-1];return I===i?I():(o(...C.slice(0,-1)),(async()=>{try{let S=I();return S instanceof Promise?await S:S}finally{console.groupEnd()}})())}let g=Object.assign(c.bind({}),{isEnabled:l,isDisabled:!l,group:d,force:c});return l?g:Object.assign(i.bind({}),{isEnabled:l,isDisabled:!l,group:d,force:g})},a=s(t>=ut.ERROR,this.wrapLog(console.error,n));return{ERROR:(...l)=>(a(...l),new Error(l.map(c=>typeof c=="string"?c:(0,fy.default)(c)).join(" "))),WARN:s(t>=ut.WARN,this.wrapLog(console.warn,n)),LOG:s(t>=ut.INFO,this.wrapLog(console.log,n)),DEBUG:s(t>=ut.DEBUG,this.wrapLog(console.log,{...n,dim:n.dimDebugOnServer})),VERBOSE:s(t>=ut.VERBOSE,this.wrapLog(console.debug,{...n,dim:n.dimDebugOnServer}))}}static wrapLog(t,n){if(so.isNode)return t.bind(console);{let r=[];if(n.time||n.delta){let i=so.isBrowser&&navigator.userAgent.includes("Chrome")?["",ut.timeStr(!!n.time,!!n.delta)]:[];r.push(...i)}return n.prefix&&(ii?r.push(new Il("dim",n.prefix)):r.push(n.prefix)),t.bind(console,...r)}}static timeStr(t,n,r=0){if(!performance.now)return;let i=performance.now();ut.firstLog||(ut.firstLog=i,ut.lastLog=i);let o=new El(i-ut.firstLog,i-ut.lastLog,t,n);return ut.lastLog=i,r?o.toString():o}static getOriginFromStack(t){let n=!1;for(let r of t.split(`
54
+ `)){let i=r.match(/^\s+at\s+(.*)/);if(i){if(n)return i[1].trim().replace(__dirname,"");n=!0}}}};so.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Ps&&Ps.length){for(let t of Ps)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof El))return null;ii||(ii=!0);let t=$e.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof Il?(ii||(ii=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var py=typeof global=="object"&&global&&global.Object===Object&&global,Sl=py,hy=typeof self=="object"&&self&&self.Object===Object&&self,yy=Sl||hy||Function("return this")(),ht=yy,gy=ht.Symbol,Xt=gy,$l=Object.prototype,my=$l.hasOwnProperty,vy=$l.toString,ti=Xt?Xt.toStringTag:void 0;function by(e){var t=my.call(e,ti),n=e[ti];try{e[ti]=void 0;var r=!0}catch{}var i=vy.call(e);return r&&(t?e[ti]=n:delete e[ti]),i}var _y=by,wy=Object.prototype,Ty=wy.toString;function Ay(e){return Ty.call(e)}var Oy=Ay,Ey="[object Null]",Iy="[object Undefined]",dc=Xt?Xt.toStringTag:void 0;function Sy(e){return e==null?e===void 0?Iy:Ey:dc&&dc in Object(e)?_y(e):Oy(e)}var Sr=Sy;function $y(e){return e!=null&&typeof e=="object"}var On=$y,Ny="[object Symbol]";function Ry(e){return typeof e=="symbol"||On(e)&&Sr(e)==Ny}var Or=Ry;function Py(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Nl=Py,Cy=Array.isArray,Vt=Cy,xy=1/0,pc=Xt?Xt.prototype:void 0,hc=pc?pc.toString:void 0;function Rl(e){if(typeof e=="string")return e;if(Vt(e))return Nl(e,Rl)+"";if(Or(e))return hc?hc.call(e):"";var t=e+"";return t=="0"&&1/e==-xy?"-0":t}var Uy=Rl,My=/\s/;function By(e){for(var t=e.length;t--&&My.test(e.charAt(t)););return t}var Dy=By,Ly=/^\s+/;function ky(e){return e&&e.slice(0,Dy(e)+1).replace(Ly,"")}var jy=ky;function Fy(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var an=Fy,yc=NaN,zy=/^[-+]0x[0-9a-f]+$/i,Vy=/^0b[01]+$/i,Ky=/^0o[0-7]+$/i,qy=parseInt;function Gy(e){if(typeof e=="number")return e;if(Or(e))return yc;if(an(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=an(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=jy(e);var n=Vy.test(e);return n||Ky.test(e)?qy(e.slice(2),n?2:8):zy.test(e)?yc:+e}var Wy=Gy,gc=1/0,Hy=17976931348623157e292;function Jy(e){if(!e)return e===0?e:0;if(e=Wy(e),e===gc||e===-gc){var t=e<0?-1:1;return t*Hy}return e===e?e:0}var Xy=Jy;function Yy(e){var t=Xy(e),n=t%1;return t===t?n?t-n:t:0}var mc=Yy;function Qy(e){return e}var Io=Qy,Zy="[object AsyncFunction]",eg="[object Function]",tg="[object GeneratorFunction]",ng="[object Proxy]";function rg(e){if(!an(e))return!1;var t=Sr(e);return t==eg||t==tg||t==Zy||t==ng}var Pl=rg,ig=ht["__core-js_shared__"],Cs=ig,vc=function(){var e=/[^.]+$/.exec(Cs&&Cs.keys&&Cs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function og(e){return!!vc&&vc in e}var sg=og,ag=Function.prototype,ug=ag.toString;function cg(e){if(e!=null){try{return ug.call(e)}catch{}try{return e+""}catch{}}return""}var Jn=cg,lg=/[\\^$.*+?()[\]{}|]/g,fg=/^\[object .+?Constructor\]$/,dg=Function.prototype,pg=Object.prototype,hg=dg.toString,yg=pg.hasOwnProperty,gg=RegExp("^"+hg.call(yg).replace(lg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mg(e){if(!an(e)||sg(e))return!1;var t=Pl(e)?gg:fg;return t.test(Jn(e))}var vg=mg;function bg(e,t){return e?.[t]}var _g=bg;function wg(e,t){var n=_g(e,t);return vg(n)?n:void 0}var Xn=wg,Tg=Xn(ht,"WeakMap"),si=Tg,Ag=si&&new si,ao=Ag,Og=ao?function(e,t){return ao.set(e,t),e}:Io,Cl=Og,bc=Object.create,Eg=function(){function e(){}return function(t){if(!an(t))return{};if(bc)return bc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),na=Eg;function Ig(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 n=na(e.prototype),r=e.apply(n,t);return an(r)?r:n}}var ai=Ig,Sg=1;function $g(e,t,n){var r=t&Sg,i=ai(e);function o(){var s=this&&this!==ht&&this instanceof o?i:e;return s.apply(r?n:this,arguments)}return o}var Ng=$g;function Rg(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var ra=Rg,Pg=Math.max;function Cg(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,l=t.length,c=Pg(o-s,0),d=Array(l+c),g=!r;++a<l;)d[a]=t[a];for(;++i<s;)(g||i<o)&&(d[n[i]]=e[i]);for(;c--;)d[a++]=e[i++];return d}var xl=Cg,xg=Math.max;function Ug(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,l=-1,c=t.length,d=xg(o-a,0),g=Array(d+c),C=!r;++i<d;)g[i]=e[i];for(var I=i;++l<c;)g[I+l]=t[l];for(;++s<a;)(C||i<o)&&(g[I+n[s]]=e[i++]);return g}var Ul=Ug;function Mg(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Bg=Mg;function Dg(){}var ia=Dg,Lg=4294967295;function uo(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Lg,this.__views__=[]}uo.prototype=na(ia.prototype);uo.prototype.constructor=uo;var oa=uo;function kg(){}var Ml=kg,jg=ao?function(e){return ao.get(e)}:Ml,Bl=jg,Fg={},_c=Fg,zg=Object.prototype,Vg=zg.hasOwnProperty;function Kg(e){for(var t=e.name+"",n=_c[t],r=Vg.call(_c,t)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==e)return i.name}return t}var qg=Kg;function co(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}co.prototype=na(ia.prototype);co.prototype.constructor=co;var Ks=co;function Gg(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Dl=Gg;function Wg(e){if(e instanceof oa)return e.clone();var t=new Ks(e.__wrapped__,e.__chain__);return t.__actions__=Dl(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Hg=Wg,Jg=Object.prototype,Xg=Jg.hasOwnProperty;function lo(e){if(On(e)&&!Vt(e)&&!(e instanceof oa)){if(e instanceof Ks)return e;if(Xg.call(e,"__wrapped__"))return Hg(e)}return new Ks(e)}lo.prototype=ia.prototype;lo.prototype.constructor=lo;var Yg=lo;function Qg(e){var t=qg(e),n=Yg[t];if(typeof n!="function"||!(t in oa.prototype))return!1;if(e===n)return!0;var r=Bl(n);return!!r&&e===r[0]}var Zg=Qg,em=800,tm=16,nm=Date.now;function rm(e){var t=0,n=0;return function(){var r=nm(),i=tm-(r-n);if(n=r,i>0){if(++t>=em)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ll=rm,im=Ll(Cl),kl=im,om=/\{\n\/\* \[wrapped with (.+)\] \*/,sm=/,? & /;function am(e){var t=e.match(om);return t?t[1].split(sm):[]}var um=am,cm=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function lm(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(cm,`{
55
55
  /* [wrapped with `+t+`] */
56
- `)}var fm=lm;function dm(e){return function(){return e}}var pm=dm,hm=function(){try{var e=Xn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),lo=hm,ym=lo?function(e,t){return lo(e,"toString",{configurable:!0,enumerable:!1,value:pm(t),writable:!0})}:Eo,gm=ym,mm=Dl(gm),ra=mm;function vm(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var bm=vm;function _m(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var wm=_m;function Tm(e){return e!==e}var Am=Tm;function Om(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Em=Om;function Im(e,t,n){return t===t?Em(e,t,n):wm(e,Am,n)}var Sm=Im;function $m(e,t){var n=e==null?0:e.length;return!!n&&Sm(e,t,0)>-1}var kl=$m,Nm=1,Rm=2,Pm=8,Cm=16,xm=32,Um=64,Mm=128,Bm=256,Dm=512,Lm=[["ary",Mm],["bind",Nm],["bindKey",Rm],["curry",Pm],["curryRight",Cm],["flip",Dm],["partial",xm],["partialRight",Um],["rearg",Bm]];function km(e,t){return bm(Lm,function(n){var r="_."+n[0];t&n[1]&&!kl(e,r)&&e.push(r)}),e.sort()}var jm=km;function Fm(e,t,n){var r=t+"";return ra(e,fm(r,jm(um(r),n)))}var jl=Fm,zm=1,Vm=2,Km=4,qm=8,bc=32,_c=64;function Gm(e,t,n,r,i,o,s,a,l,c){var d=t&qm,g=d?s:void 0,C=d?void 0:s,I=d?o:void 0,S=d?void 0:o;t|=d?bc:_c,t&=~(d?_c:bc),t&Km||(t&=~(zm|Vm));var z=[e,t,i,I,g,S,C,a,l,c],J=n.apply(void 0,z);return Zg(e)&&Ll(J,z),J.placeholder=r,jl(J,e,t)}var Fl=Gm;function Wm(e){var t=e;return t.placeholder}var ia=Wm,Hm=9007199254740991,Jm=/^(?:0|[1-9]\d*)$/;function Xm(e,t){var n=typeof e;return t=t??Hm,!!t&&(n=="number"||n!="symbol"&&Jm.test(e))&&e>-1&&e%1==0&&e<t}var Io=Xm,Ym=Math.min;function Qm(e,t){for(var n=e.length,r=Ym(t.length,n),i=Bl(e);r--;){var o=t[r];e[r]=Io(o,n)?i[o]:void 0}return e}var Zm=Qm,wc="__lodash_placeholder__";function ev(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===wc)&&(e[n]=wc,o[i++]=n)}return o}var ui=ev,tv=1,nv=2,rv=8,iv=16,ov=128,sv=512;function zl(e,t,n,r,i,o,s,a,l,c){var d=t&ov,g=t&tv,C=t&nv,I=t&(rv|iv),S=t&sv,z=C?void 0:ai(e);function J(){for(var F=arguments.length,k=Array(F),K=F;K--;)k[K]=arguments[K];if(I)var W=ia(J),j=Bg(k,W);if(r&&(k=Cl(k,r,i,I)),o&&(k=xl(k,o,s,I)),F-=j,I&&F<c){var Z=ui(k,W);return Fl(e,t,zl,J.placeholder,n,k,Z,a,l,c-F)}var G=g?n:this,fe=C?G[e]:e;return F=k.length,a?k=Zm(k,a):S&&F>1&&k.reverse(),d&&l<F&&(k.length=l),this&&this!==ht&&this instanceof J&&(fe=z||ai(fe)),fe.apply(G,k)}return J}var Vl=zl;function av(e,t,n){var r=ai(e);function i(){for(var o=arguments.length,s=Array(o),a=o,l=ia(i);a--;)s[a]=arguments[a];var c=o<3&&s[0]!==l&&s[o-1]!==l?[]:ui(s,l);if(o-=c.length,o<n)return Fl(e,t,Vl,i.placeholder,void 0,s,c,void 0,void 0,n-o);var d=this&&this!==ht&&this instanceof i?r:e;return ea(d,this,s)}return i}var uv=av,cv=1;function lv(e,t,n,r){var i=t&cv,o=ai(e);function s(){for(var a=-1,l=arguments.length,c=-1,d=r.length,g=Array(d+l),C=this&&this!==ht&&this instanceof s?o:e;++c<d;)g[c]=r[c];for(;l--;)g[c++]=arguments[++a];return ea(C,i?n:this,g)}return s}var fv=lv,Tc="__lodash_placeholder__",Ps=1,dv=2,pv=4,Ac=8,ni=128,Oc=256,hv=Math.min;function yv(e,t){var n=e[1],r=t[1],i=n|r,o=i<(Ps|dv|ni),s=r==ni&&n==Ac||r==ni&&n==Oc&&e[7].length<=t[8]||r==(ni|Oc)&&t[7].length<=t[8]&&n==Ac;if(!(o||s))return e;r&Ps&&(e[2]=t[2],i|=n&Ps?0:pv);var a=t[3];if(a){var l=e[3];e[3]=l?Cl(l,a,t[4]):a,e[4]=l?ui(e[3],Tc):t[4]}return a=t[5],a&&(l=e[5],e[5]=l?xl(l,a,t[6]):a,e[6]=l?ui(e[5],Tc):t[6]),a=t[7],a&&(e[7]=a),r&ni&&(e[8]=e[8]==null?t[8]:hv(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var gv=yv,mv="Expected a function",Ec=1,vv=2,Cs=8,xs=16,Us=32,Ic=64,Sc=Math.max;function bv(e,t,n,r,i,o,s,a){var l=t&vv;if(!l&&typeof e!="function")throw new TypeError(mv);var c=r?r.length:0;if(c||(t&=~(Us|Ic),r=i=void 0),s=s===void 0?s:Sc(yc(s),0),a=a===void 0?a:yc(a),c-=i?i.length:0,t&Ic){var d=r,g=i;r=i=void 0}var C=l?void 0:Ml(e),I=[e,t,n,r,i,d,g,o,s,a];if(C&&gv(I,C),e=I[0],t=I[1],n=I[2],r=I[3],i=I[4],a=I[9]=I[9]===void 0?l?0:e.length:Sc(I[9]-c,0),!a&&t&(Cs|xs)&&(t&=~(Cs|xs)),!t||t==Ec)var S=Ng(e,t,n);else t==Cs||t==xs?S=uv(e,t,a):(t==Us||t==(Ec|Us))&&!i.length?S=fv(e,t,n,r):S=Vl.apply(void 0,I);var z=C?Pl:Ll;return jl(z(S,I),e,t)}var _v=bv;function wv(e,t,n){t=="__proto__"&&lo?lo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Tv=wv;function Av(e,t){return e===t||e!==e&&t!==t}var oa=Av,Ov=Object.prototype,Ev=Ov.hasOwnProperty;function Iv(e,t,n){var r=e[t];(!(Ev.call(e,t)&&oa(r,n))||n===void 0&&!(t in e))&&Tv(e,t,n)}var Sv=Iv,$c=Math.max;function $v(e,t,n){return t=$c(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=$c(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),ea(e,this,a)}}var Kl=$v;function Nv(e,t){return ra(Kl(e,t,Eo),e+"")}var ql=Nv,Rv=9007199254740991;function Pv(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Rv}var sa=Pv;function Cv(e){return e!=null&&sa(e.length)&&!Rl(e)}var Gl=Cv,xv=Object.prototype;function Uv(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||xv;return e===n}var Mv=Uv;function Bv(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Dv=Bv,Lv="[object Arguments]";function kv(e){return On(e)&&Sr(e)==Lv}var Nc=kv,Wl=Object.prototype,jv=Wl.hasOwnProperty,Fv=Wl.propertyIsEnumerable,zv=Nc(function(){return arguments}())?Nc:function(e){return On(e)&&jv.call(e,"callee")&&!Fv.call(e,"callee")},aa=zv;function Vv(){return!1}var Kv=Vv,Hl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rc=Hl&&typeof module=="object"&&module&&!module.nodeType&&module,qv=Rc&&Rc.exports===Hl,Pc=qv?ht.Buffer:void 0,Gv=Pc?Pc.isBuffer:void 0,Wv=Gv||Kv,Vs=Wv,Hv="[object Arguments]",Jv="[object Array]",Xv="[object Boolean]",Yv="[object Date]",Qv="[object Error]",Zv="[object Function]",eb="[object Map]",tb="[object Number]",nb="[object Object]",rb="[object RegExp]",ib="[object Set]",ob="[object String]",sb="[object WeakMap]",ab="[object ArrayBuffer]",ub="[object DataView]",cb="[object Float32Array]",lb="[object Float64Array]",fb="[object Int8Array]",db="[object Int16Array]",pb="[object Int32Array]",hb="[object Uint8Array]",yb="[object Uint8ClampedArray]",gb="[object Uint16Array]",mb="[object Uint32Array]",Me={};Me[cb]=Me[lb]=Me[fb]=Me[db]=Me[pb]=Me[hb]=Me[yb]=Me[gb]=Me[mb]=!0;Me[Hv]=Me[Jv]=Me[ab]=Me[Xv]=Me[ub]=Me[Yv]=Me[Qv]=Me[Zv]=Me[eb]=Me[tb]=Me[nb]=Me[rb]=Me[ib]=Me[ob]=Me[sb]=!1;function vb(e){return On(e)&&sa(e.length)&&!!Me[Sr(e)]}var bb=vb;function _b(e){return function(t){return e(t)}}var Jl=_b,Xl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oi=Xl&&typeof module=="object"&&module&&!module.nodeType&&module,wb=oi&&oi.exports===Xl,Ms=wb&&Il.process,Tb=function(){try{var e=oi&&oi.require&&oi.require("util").types;return e||Ms&&Ms.binding&&Ms.binding("util")}catch{}}(),Cc=Tb,xc=Cc&&Cc.isTypedArray,Ab=xc?Jl(xc):bb,Yl=Ab,Ob=Object.prototype,Eb=Ob.hasOwnProperty;function Ib(e,t){var n=Vt(e),r=!n&&aa(e),i=!n&&!r&&Vs(e),o=!n&&!r&&!i&&Yl(e),s=n||r||i||o,a=s?Dv(e.length,String):[],l=a.length;for(var c in e)(t||Eb.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Io(c,l)))&&a.push(c);return a}var Sb=Ib;function $b(e,t){return function(n){return e(t(n))}}var Nb=$b,Rb=Nb(Object.keys,Object),Pb=Rb,Cb=Object.prototype,xb=Cb.hasOwnProperty;function Ub(e){if(!Mv(e))return Pb(e);var t=[];for(var n in Object(e))xb.call(e,n)&&n!="constructor"&&t.push(n);return t}var Mb=Ub;function Bb(e){return Gl(e)?Sb(e):Mb(e)}var Ql=Bb,Db=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lb=/^\w*$/;function kb(e,t){if(Vt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Or(e)?!0:Lb.test(e)||!Db.test(e)||t!=null&&e in Object(t)}var ua=kb,jb=Xn(Object,"create"),ci=jb;function Fb(){this.__data__=ci?ci(null):{},this.size=0}var zb=Fb;function Vb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Kb=Vb,qb="__lodash_hash_undefined__",Gb=Object.prototype,Wb=Gb.hasOwnProperty;function Hb(e){var t=this.__data__;if(ci){var n=t[e];return n===qb?void 0:n}return Wb.call(t,e)?t[e]:void 0}var Jb=Hb,Xb=Object.prototype,Yb=Xb.hasOwnProperty;function Qb(e){var t=this.__data__;return ci?t[e]!==void 0:Yb.call(t,e)}var Zb=Qb,e_="__lodash_hash_undefined__";function t_(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ci&&t===void 0?e_:t,this}var n_=t_;function $r(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}$r.prototype.clear=zb;$r.prototype.delete=Kb;$r.prototype.get=Jb;$r.prototype.has=Zb;$r.prototype.set=n_;var Uc=$r;function r_(){this.__data__=[],this.size=0}var i_=r_;function o_(e,t){for(var n=e.length;n--;)if(oa(e[n][0],t))return n;return-1}var So=o_,s_=Array.prototype,a_=s_.splice;function u_(e){var t=this.__data__,n=So(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():a_.call(t,n,1),--this.size,!0}var c_=u_;function l_(e){var t=this.__data__,n=So(t,e);return n<0?void 0:t[n][1]}var f_=l_;function d_(e){return So(this.__data__,e)>-1}var p_=d_;function h_(e,t){var n=this.__data__,r=So(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var y_=h_;function Nr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nr.prototype.clear=i_;Nr.prototype.delete=c_;Nr.prototype.get=f_;Nr.prototype.has=p_;Nr.prototype.set=y_;var $o=Nr,g_=Xn(ht,"Map"),li=g_;function m_(){this.size=0,this.__data__={hash:new Uc,map:new(li||$o),string:new Uc}}var v_=m_;function b_(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var __=b_;function w_(e,t){var n=e.__data__;return __(t)?n[typeof t=="string"?"string":"hash"]:n.map}var No=w_;function T_(e){var t=No(this,e).delete(e);return this.size-=t?1:0,t}var A_=T_;function O_(e){return No(this,e).get(e)}var E_=O_;function I_(e){return No(this,e).has(e)}var S_=I_;function $_(e,t){var n=No(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var N_=$_;function Rr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Rr.prototype.clear=v_;Rr.prototype.delete=A_;Rr.prototype.get=E_;Rr.prototype.has=S_;Rr.prototype.set=N_;var Ro=Rr,R_="Expected a function";function ca(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(R_);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(ca.Cache||Ro),n}ca.Cache=Ro;var P_=ca,C_=500;function x_(e){var t=P_(e,function(r){return n.size===C_&&n.clear(),r}),n=t.cache;return t}var U_=x_,M_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B_=/\\(\\)?/g,D_=U_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(M_,function(n,r,i,o){t.push(i?o.replace(B_,"$1"):r||n)}),t}),L_=D_;function k_(e){return e==null?"":Uy(e)}var j_=k_;function F_(e,t){return Vt(e)?e:ua(e,t)?[e]:L_(j_(e))}var Po=F_,z_=1/0;function V_(e){if(typeof e=="string"||Or(e))return e;var t=e+"";return t=="0"&&1/e==-z_?"-0":t}var hi=V_;function K_(e,t){t=Po(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[hi(t[n++])];return n&&n==r?e:void 0}var la=K_;function q_(e,t,n){var r=e==null?void 0:la(e,t);return r===void 0?n:r}var G_=q_;function W_(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Zl=W_,Mc=Xt?Xt.isConcatSpreadable:void 0;function H_(e){return Vt(e)||aa(e)||!!(Mc&&e&&e[Mc])}var J_=H_;function ef(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=J_),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?ef(a,t-1,n,r,i):Zl(i,a):r||(i[i.length]=a)}return i}var X_=ef;function Y_(e){var t=e==null?0:e.length;return t?X_(e,1):[]}var Q_=Y_;function Z_(e){return ra(Kl(e,void 0,Q_),e+"")}var ew=Z_;function tw(){this.__data__=new $o,this.size=0}var nw=tw;function rw(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var iw=rw;function ow(e){return this.__data__.get(e)}var sw=ow;function aw(e){return this.__data__.has(e)}var uw=aw,cw=200;function lw(e,t){var n=this.__data__;if(n instanceof $o){var r=n.__data__;if(!li||r.length<cw-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ro(r)}return n.set(e,t),this.size=n.size,this}var fw=lw;function Pr(e){var t=this.__data__=new $o(e);this.size=t.size}Pr.prototype.clear=nw;Pr.prototype.delete=iw;Pr.prototype.get=sw;Pr.prototype.has=uw;Pr.prototype.set=fw;var eo=Pr;function dw(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}var pw=dw;function hw(){return[]}var yw=hw,gw=Object.prototype,mw=gw.propertyIsEnumerable,Bc=Object.getOwnPropertySymbols,vw=Bc?function(e){return e==null?[]:(e=Object(e),pw(Bc(e),function(t){return mw.call(e,t)}))}:yw,bw=vw;function _w(e,t,n){var r=t(e);return Vt(e)?r:Zl(r,n(e))}var ww=_w;function Tw(e){return ww(e,Ql,bw)}var Dc=Tw,Aw=Xn(ht,"DataView"),Ks=Aw,Ow=Xn(ht,"Promise"),qs=Ow,Ew=Xn(ht,"Set"),Ar=Ew,Lc="[object Map]",Iw="[object Object]",kc="[object Promise]",jc="[object Set]",Fc="[object WeakMap]",zc="[object DataView]",Sw=Jn(Ks),$w=Jn(li),Nw=Jn(qs),Rw=Jn(Ar),Pw=Jn(si),Gn=Sr;(Ks&&Gn(new Ks(new ArrayBuffer(1)))!=zc||li&&Gn(new li)!=Lc||qs&&Gn(qs.resolve())!=kc||Ar&&Gn(new Ar)!=jc||si&&Gn(new si)!=Fc)&&(Gn=function(e){var t=Sr(e),n=t==Iw?e.constructor:void 0,r=n?Jn(n):"";if(r)switch(r){case Sw:return zc;case $w:return Lc;case Nw:return kc;case Rw:return jc;case Pw:return Fc}return t});var Vc=Gn,Cw=ht.Uint8Array,Kc=Cw,xw="__lodash_hash_undefined__";function Uw(e){return this.__data__.set(e,xw),this}var Mw=Uw;function Bw(e){return this.__data__.has(e)}var Dw=Bw;function fo(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Ro;++t<n;)this.add(e[t])}fo.prototype.add=fo.prototype.push=Mw;fo.prototype.has=Dw;var tf=fo;function Lw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var kw=Lw;function jw(e,t){return e.has(t)}var nf=jw,Fw=1,zw=2;function Vw(e,t,n,r,i,o){var s=n&Fw,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var g=-1,C=!0,I=n&zw?new tf:void 0;for(o.set(e,t),o.set(t,e);++g<a;){var S=e[g],z=t[g];if(r)var J=s?r(z,S,g,t,e,o):r(S,z,g,e,t,o);if(J!==void 0){if(J)continue;C=!1;break}if(I){if(!kw(t,function(F,k){if(!nf(I,k)&&(S===F||i(S,F,n,r,o)))return I.push(k)})){C=!1;break}}else if(!(S===z||i(S,z,n,r,o))){C=!1;break}}return o.delete(e),o.delete(t),C}var rf=Vw;function Kw(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var qw=Kw;function Gw(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var of=Gw,Ww=1,Hw=2,Jw="[object Boolean]",Xw="[object Date]",Yw="[object Error]",Qw="[object Map]",Zw="[object Number]",eT="[object RegExp]",tT="[object Set]",nT="[object String]",rT="[object Symbol]",iT="[object ArrayBuffer]",oT="[object DataView]",qc=Xt?Xt.prototype:void 0,Bs=qc?qc.valueOf:void 0;function sT(e,t,n,r,i,o,s){switch(n){case oT:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case iT:return!(e.byteLength!=t.byteLength||!o(new Kc(e),new Kc(t)));case Jw:case Xw:case Zw:return oa(+e,+t);case Yw:return e.name==t.name&&e.message==t.message;case eT:case nT:return e==t+"";case Qw:var a=qw;case tT:var l=r&Ww;if(a||(a=of),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=Hw,s.set(e,t);var d=rf(a(e),a(t),r,i,o,s);return s.delete(e),d;case rT:if(Bs)return Bs.call(e)==Bs.call(t)}return!1}var aT=sT,uT=1,cT=Object.prototype,lT=cT.hasOwnProperty;function fT(e,t,n,r,i,o){var s=n&uT,a=Dc(e),l=a.length,c=Dc(t),d=c.length;if(l!=d&&!s)return!1;for(var g=l;g--;){var C=a[g];if(!(s?C in t:lT.call(t,C)))return!1}var I=o.get(e),S=o.get(t);if(I&&S)return I==t&&S==e;var z=!0;o.set(e,t),o.set(t,e);for(var J=s;++g<l;){C=a[g];var F=e[C],k=t[C];if(r)var K=s?r(k,F,C,t,e,o):r(F,k,C,e,t,o);if(!(K===void 0?F===k||i(F,k,n,r,o):K)){z=!1;break}J||(J=C=="constructor")}if(z&&!J){var W=e.constructor,j=t.constructor;W!=j&&"constructor"in e&&"constructor"in t&&!(typeof W=="function"&&W instanceof W&&typeof j=="function"&&j instanceof j)&&(z=!1)}return o.delete(e),o.delete(t),z}var dT=fT,pT=1,Gc="[object Arguments]",Wc="[object Array]",Zi="[object Object]",hT=Object.prototype,Hc=hT.hasOwnProperty;function yT(e,t,n,r,i,o){var s=Vt(e),a=Vt(t),l=s?Wc:Vc(e),c=a?Wc:Vc(t);l=l==Gc?Zi:l,c=c==Gc?Zi:c;var d=l==Zi,g=c==Zi,C=l==c;if(C&&Vs(e)){if(!Vs(t))return!1;s=!0,d=!1}if(C&&!d)return o||(o=new eo),s||Yl(e)?rf(e,t,n,r,i,o):aT(e,t,l,n,r,i,o);if(!(n&pT)){var I=d&&Hc.call(e,"__wrapped__"),S=g&&Hc.call(t,"__wrapped__");if(I||S){var z=I?e.value():e,J=S?t.value():t;return o||(o=new eo),i(z,J,n,r,o)}}return C?(o||(o=new eo),dT(e,t,n,r,i,o)):!1}var gT=yT;function sf(e,t,n,r,i){return e===t?!0:e==null||t==null||!On(e)&&!On(t)?e!==e&&t!==t:gT(e,t,n,r,sf,i)}var af=sf,mT=1,vT=2;function bT(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],c=e[l],d=a[1];if(s&&a[2]){if(c===void 0&&!(l in e))return!1}else{var g=new eo;if(r)var C=r(c,d,l,e,t,g);if(!(C===void 0?af(d,c,mT|vT,r,g):C))return!1}}return!0}var _T=bT;function wT(e){return e===e&&!an(e)}var uf=wT;function TT(e){for(var t=Ql(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,uf(i)]}return t}var AT=TT;function OT(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var cf=OT;function ET(e){var t=AT(e);return t.length==1&&t[0][2]?cf(t[0][0],t[0][1]):function(n){return n===e||_T(n,e,t)}}var IT=ET;function ST(e,t){return e!=null&&t in Object(e)}var $T=ST;function NT(e,t,n){t=Po(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=hi(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&sa(i)&&Io(s,i)&&(Vt(e)||aa(e)))}var RT=NT;function PT(e,t){return e!=null&&RT(e,t,$T)}var lf=PT,CT=1,xT=2;function UT(e,t){return ua(e)&&uf(t)?cf(hi(e),t):function(n){var r=G_(n,e);return r===void 0&&r===t?lf(n,e):af(t,r,CT|xT)}}var MT=UT;function BT(e){return function(t){return t?.[e]}}var DT=BT;function LT(e){return function(t){return la(t,e)}}var kT=LT;function jT(e){return ua(e)?DT(hi(e)):kT(e)}var FT=jT;function zT(e){return typeof e=="function"?e:e==null?Eo:typeof e=="object"?Vt(e)?MT(e[0],e[1]):IT(e):FT(e)}var VT=zT;function KT(e){return On(e)&&Gl(e)}var qT=KT;function GT(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var WT=GT,HT=200;function JT(e,t,n,r){var i=-1,o=kl,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=$l(t,Jl(n))),r?(o=WT,s=!1):t.length>=HT&&(o=nf,s=!1,t=new tf(t));e:for(;++i<a;){var d=e[i],g=n==null?d:n(d);if(d=r||d!==0?d:0,s&&g===g){for(var C=c;C--;)if(t[C]===g)continue e;l.push(d)}else o(t,g,r)||l.push(d)}return l}var XT=JT;function YT(e,t,n,r){if(!an(e))return e;t=Po(t,e);for(var i=-1,o=t.length,s=o-1,a=e;a!=null&&++i<o;){var l=hi(t[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=s){var d=a[l];c=r?r(d,l,a):void 0,c===void 0&&(c=an(d)?d:Io(t[i+1])?[]:{})}Sv(a,l,c),a=a[l]}return e}var QT=YT;function ZT(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=la(e,s);n(a,s)&&QT(o,Po(s,e),a)}return o}var e0=ZT,t0=32,fa=ql(function(e,t){var n=ui(t,ia(fa));return _v(e,t0,void 0,t,n)});fa.placeholder={};var n0=fa;function r0(e,t){return e0(e,t,function(n,r){return lf(e,r)})}var i0=r0,o0=ew(function(e,t){return e==null?{}:i0(e,t)}),Jc=o0,s0=4294967295,a0=s0-1,u0=Math.floor,c0=Math.min;function l0(e,t,n,r){var i=0,o=e==null?0:e.length;if(o===0)return 0;t=n(t);for(var s=t!==t,a=t===null,l=Or(t),c=t===void 0;i<o;){var d=u0((i+o)/2),g=n(e[d]),C=g!==void 0,I=g===null,S=g===g,z=Or(g);if(s)var J=r||S;else c?J=S&&(r||C):a?J=S&&C&&(r||!I):l?J=S&&C&&!I&&(r||!z):I||z?J=!1:J=r?g<=t:g<t;J?i=d+1:o=d}return c0(o,a0)}var f0=l0;function d0(e,t,n){return f0(e,t,VT(n,2))}var p0=d0,h0=1/0,dS=Ar&&1/of(new Ar([,-0]))[1]==h0?function(e){return new Ar(e)}:Ul;var y0=ql(function(e,t){return qT(e)?XT(e,t):[]}),Xc=y0,ff=mt(oy(),1),pS=ff.default.configure,Hn=ff.default,Ds=100,{WARN:g0,LOG:hS,DEBUG:We,VERBOSE:we,ERROR:yS}=$e.setup($e.INFO),po=Ce.set();Zu({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var Je=({caller:e,thread:t,pattern:n,args:r})=>Pe(()=>(r=r||n,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${r?`{${typeof r=="string"?r:Hn(r)}}`:""}`));function df(e,t){return Pe(()=>ze.structural(e.get(),t.get()))}function Cr(e,t){return ze.shallow(e.applogs,t.applogs)}function Co(e,t){if(e.size!==t.size)return!1;for(let n=0;n<e.size;n++){let r=e.nodes[n],i=t.nodes[n];if(we.isEnabled&&we("queryNodesComparer",n,r,i),!ze.structural(r.variables,i.variables))return we.isEnabled&&we("[queryNodesComparer] changed vars:",n,r,i),!1;if(!Cr(r.logsOfThisNode,i.logsOfThisNode))return we.isEnabled&&we("[queryNodesComparer] changed logsOfThisNode:",n,r,i),!1}return we.isEnabled&&we("[queryNodesComparer] equal:",{a:e,b:t}),!0}var m0=0;function Yt(e,{name:t,equals:n}={}){let r=`observableArrayMap@${++m0}{${t}}`;we.isEnabled&&we(`[${r}] create`,{fnname:e.name,fn:e,name:t,equals:n});let i,o=hf(e,a=>{i?Pe(()=>(n??ze.structural)(i,a))?We.isEnabled&&We(`[${r}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),We.isEnabled&&We(`[${r}] updated`,{updatedItems:a,observableArr:i})):i=Ce.array(a,{deep:!1,name:t,equals:n})},{name:r});if(r.includes("useRoots")){var s=Et(i);We(`[${r}] deps`,{disposeAutorun:o,rootsAtom:s,observableArr:i,observers:Qr(i)}),br(()=>po.add(s))}return we.isEnabled&&_r(i,()=>{we(`[${r}] observed`,Qr(i),{rootsAtom:s,observableArr:i})}),zn(i,()=>{we.isEnabled&&we(`[${r}] dispose`),s&&br(()=>po.delete(s)),o()}),i}var v0=0;function pf(e,{name:t}={}){let n=`observableSetMap@${++v0}{${t}}`;we.isEnabled&&we(`[${n}] create`,{fnname:e.name,fn:e,name:t});let r,i=hf(e,s=>{if(!r)r=Ce.set(s,{deep:!1,name:t});else{let{deleted:a,added:l}=Pe(()=>{let c=new Set(r.values()),d=new Set;for(let g of s)r.has(g)?(we.isEnabled&&we(`[${n}] unchanged`,g,{updatedItems:s,observableSet:r}),c.delete(g)):d.add(g);return We.isEnabled&&We(`[${n}] updated:`,{unseen:c,added:d,updatedItems:s,observableSet:r}),{added:d,deleted:c}});for(let c of a)r.delete(c);for(let c of l)r.add(c)}},{name:n});if(n.includes("useRoots")){var o=Et(r);We.isEnabled&&We(`[${n}] deps`,{disposeAutorun:i,rootsAtom:o,observableSet:r,observers:Qr(r)}),br(()=>po.add(o))}return we.isEnabled&&_r(r,()=>{we(`[${n}] observed`,Qr(r),{rootsAtom:o,observableSet:r})}),zn(r,()=>{we.isEnabled&&we(`[${n}] dispose`),o&&br(()=>po.delete(o)),i()}),r}function hf(e,t=null,{name:n}={}){We.isEnabled&&We("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:n});let r=`${n}.autorunImm`,i,o=new kt(r,function(...c){We.isEnabled&&We(`[${r}] reaction.invalidate`,c),s()});function s(){o.track(function(){let c=Ds&&performance.now();We.isEnabled&&We(`[${r}] runAndTrack:`,{name:n??e.name,fn:e}),i=e(),We.isEnabled&&We(`[${r}] runAndTrack =>`,i),br(()=>{t?.(i)}),Ds&&performance.now()-c>Ds&&g0(`[${r}] took ${performance.now()-c}ms`)})}return s(),We.isEnabled&&We(`[${r}] deps of reaction`,{reaction:o,result:i,deps:Yr(o)}),()=>{we.isEnabled&&we(`[${r}] dispose`),setTimeout(()=>o.dispose())}}function Qe(e,t,n=!1){if(gn(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let r=!1,i=0,o=typeof n=="boolean"?{keepAlive:n}:n,s=new Map;return function(...a){let l,c=Pe(()=>{let I=a;for(let S=0;S<a.length;S++)a[S]instanceof Er&&a===I&&(I=a.slice());return I}),d=`computedFnDeepCompare(${e||t.name}#${++i})${o.argsDebugName?`{${o.argsDebugName(...a)}}`:""}`;for(let[I,S]of s.entries())if(_0(I,c)){l=S;break}else if(we.isEnabled)for(let z=0;z<I.length;z++)I[z]instanceof Er&&I[z].name===a[z].name&&ze.structural(Xc(I,I[z]),Xc(c,c[z]))&&we.force(`[${d}] threadState mismatch => cachebust`,{diffFields:Object.keys(I[z]).filter(J=>!ze.structural(I[z][J],a[z][J])),cacheArg:I[z],freshArg:a[z]});if(l){let I=l.get();return we.isEnabled&&we(`[${d}] cache hit`,{untrackedArgs:c,cachedResult:I}),I}if(!o.keepAlive&&!Mu())return!r&&ku().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),r=!0),t.apply(this,a);we.isEnabled&&we(`[${d}] new computation`,{untrackedArgs:c});let g,C=Le(()=>(we.isEnabled&&we(`[${d}] update->rerun`,Pe(()=>({args:a})),t),we.isEnabled&&As(),g=t.apply(this,a)),{...o,name:d});if(we.isEnabled&&we(`[${d}] deps`,Yr(C),{untrackedArgs:c}),s.set(c,C),!o.keepAlive){let I=zn(C,()=>{we.isEnabled&&we(`[${d}] dispose`,C),I(),s.delete(c),o.onCleanup&&o.onCleanup(g,...a),g=void 0})}return C.get()}}function b0(e){let t=0,n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("?n+=o+`
56
+ `)}var fm=lm;function dm(e){return function(){return e}}var pm=dm,hm=function(){try{var e=Xn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),fo=hm,ym=fo?function(e,t){return fo(e,"toString",{configurable:!0,enumerable:!1,value:pm(t),writable:!0})}:Io,gm=ym,mm=Ll(gm),sa=mm;function vm(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var bm=vm;function _m(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var wm=_m;function Tm(e){return e!==e}var Am=Tm;function Om(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Em=Om;function Im(e,t,n){return t===t?Em(e,t,n):wm(e,Am,n)}var Sm=Im;function $m(e,t){var n=e==null?0:e.length;return!!n&&Sm(e,t,0)>-1}var jl=$m,Nm=1,Rm=2,Pm=8,Cm=16,xm=32,Um=64,Mm=128,Bm=256,Dm=512,Lm=[["ary",Mm],["bind",Nm],["bindKey",Rm],["curry",Pm],["curryRight",Cm],["flip",Dm],["partial",xm],["partialRight",Um],["rearg",Bm]];function km(e,t){return bm(Lm,function(n){var r="_."+n[0];t&n[1]&&!jl(e,r)&&e.push(r)}),e.sort()}var jm=km;function Fm(e,t,n){var r=t+"";return sa(e,fm(r,jm(um(r),n)))}var Fl=Fm,zm=1,Vm=2,Km=4,qm=8,wc=32,Tc=64;function Gm(e,t,n,r,i,o,s,a,l,c){var d=t&qm,g=d?s:void 0,C=d?void 0:s,I=d?o:void 0,S=d?void 0:o;t|=d?wc:Tc,t&=~(d?Tc:wc),t&Km||(t&=~(zm|Vm));var z=[e,t,i,I,g,S,C,a,l,c],J=n.apply(void 0,z);return Zg(e)&&kl(J,z),J.placeholder=r,Fl(J,e,t)}var zl=Gm;function Wm(e){var t=e;return t.placeholder}var aa=Wm,Hm=9007199254740991,Jm=/^(?:0|[1-9]\d*)$/;function Xm(e,t){var n=typeof e;return t=t??Hm,!!t&&(n=="number"||n!="symbol"&&Jm.test(e))&&e>-1&&e%1==0&&e<t}var So=Xm,Ym=Math.min;function Qm(e,t){for(var n=e.length,r=Ym(t.length,n),i=Dl(e);r--;){var o=t[r];e[r]=So(o,n)?i[o]:void 0}return e}var Zm=Qm,Ac="__lodash_placeholder__";function ev(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===Ac)&&(e[n]=Ac,o[i++]=n)}return o}var ui=ev,tv=1,nv=2,rv=8,iv=16,ov=128,sv=512;function Vl(e,t,n,r,i,o,s,a,l,c){var d=t&ov,g=t&tv,C=t&nv,I=t&(rv|iv),S=t&sv,z=C?void 0:ai(e);function J(){for(var F=arguments.length,k=Array(F),K=F;K--;)k[K]=arguments[K];if(I)var W=aa(J),j=Bg(k,W);if(r&&(k=xl(k,r,i,I)),o&&(k=Ul(k,o,s,I)),F-=j,I&&F<c){var Z=ui(k,W);return zl(e,t,Vl,J.placeholder,n,k,Z,a,l,c-F)}var G=g?n:this,fe=C?G[e]:e;return F=k.length,a?k=Zm(k,a):S&&F>1&&k.reverse(),d&&l<F&&(k.length=l),this&&this!==ht&&this instanceof J&&(fe=z||ai(fe)),fe.apply(G,k)}return J}var Kl=Vl;function av(e,t,n){var r=ai(e);function i(){for(var o=arguments.length,s=Array(o),a=o,l=aa(i);a--;)s[a]=arguments[a];var c=o<3&&s[0]!==l&&s[o-1]!==l?[]:ui(s,l);if(o-=c.length,o<n)return zl(e,t,Kl,i.placeholder,void 0,s,c,void 0,void 0,n-o);var d=this&&this!==ht&&this instanceof i?r:e;return ra(d,this,s)}return i}var uv=av,cv=1;function lv(e,t,n,r){var i=t&cv,o=ai(e);function s(){for(var a=-1,l=arguments.length,c=-1,d=r.length,g=Array(d+l),C=this&&this!==ht&&this instanceof s?o:e;++c<d;)g[c]=r[c];for(;l--;)g[c++]=arguments[++a];return ra(C,i?n:this,g)}return s}var fv=lv,Oc="__lodash_placeholder__",xs=1,dv=2,pv=4,Ec=8,ni=128,Ic=256,hv=Math.min;function yv(e,t){var n=e[1],r=t[1],i=n|r,o=i<(xs|dv|ni),s=r==ni&&n==Ec||r==ni&&n==Ic&&e[7].length<=t[8]||r==(ni|Ic)&&t[7].length<=t[8]&&n==Ec;if(!(o||s))return e;r&xs&&(e[2]=t[2],i|=n&xs?0:pv);var a=t[3];if(a){var l=e[3];e[3]=l?xl(l,a,t[4]):a,e[4]=l?ui(e[3],Oc):t[4]}return a=t[5],a&&(l=e[5],e[5]=l?Ul(l,a,t[6]):a,e[6]=l?ui(e[5],Oc):t[6]),a=t[7],a&&(e[7]=a),r&ni&&(e[8]=e[8]==null?t[8]:hv(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var gv=yv,mv="Expected a function",Sc=1,vv=2,Us=8,Ms=16,Bs=32,$c=64,Nc=Math.max;function bv(e,t,n,r,i,o,s,a){var l=t&vv;if(!l&&typeof e!="function")throw new TypeError(mv);var c=r?r.length:0;if(c||(t&=~(Bs|$c),r=i=void 0),s=s===void 0?s:Nc(mc(s),0),a=a===void 0?a:mc(a),c-=i?i.length:0,t&$c){var d=r,g=i;r=i=void 0}var C=l?void 0:Bl(e),I=[e,t,n,r,i,d,g,o,s,a];if(C&&gv(I,C),e=I[0],t=I[1],n=I[2],r=I[3],i=I[4],a=I[9]=I[9]===void 0?l?0:e.length:Nc(I[9]-c,0),!a&&t&(Us|Ms)&&(t&=~(Us|Ms)),!t||t==Sc)var S=Ng(e,t,n);else t==Us||t==Ms?S=uv(e,t,a):(t==Bs||t==(Sc|Bs))&&!i.length?S=fv(e,t,n,r):S=Kl.apply(void 0,I);var z=C?Cl:kl;return Fl(z(S,I),e,t)}var _v=bv;function wv(e,t,n){t=="__proto__"&&fo?fo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Tv=wv;function Av(e,t){return e===t||e!==e&&t!==t}var ua=Av,Ov=Object.prototype,Ev=Ov.hasOwnProperty;function Iv(e,t,n){var r=e[t];(!(Ev.call(e,t)&&ua(r,n))||n===void 0&&!(t in e))&&Tv(e,t,n)}var Sv=Iv,Rc=Math.max;function $v(e,t,n){return t=Rc(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Rc(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),ra(e,this,a)}}var ql=$v;function Nv(e,t){return sa(ql(e,t,Io),e+"")}var Gl=Nv,Rv=9007199254740991;function Pv(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Rv}var ca=Pv;function Cv(e){return e!=null&&ca(e.length)&&!Pl(e)}var Wl=Cv,xv=Object.prototype;function Uv(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||xv;return e===n}var Mv=Uv;function Bv(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Dv=Bv,Lv="[object Arguments]";function kv(e){return On(e)&&Sr(e)==Lv}var Pc=kv,Hl=Object.prototype,jv=Hl.hasOwnProperty,Fv=Hl.propertyIsEnumerable,zv=Pc(function(){return arguments}())?Pc:function(e){return On(e)&&jv.call(e,"callee")&&!Fv.call(e,"callee")},la=zv;function Vv(){return!1}var Kv=Vv,Jl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cc=Jl&&typeof module=="object"&&module&&!module.nodeType&&module,qv=Cc&&Cc.exports===Jl,xc=qv?ht.Buffer:void 0,Gv=xc?xc.isBuffer:void 0,Wv=Gv||Kv,qs=Wv,Hv="[object Arguments]",Jv="[object Array]",Xv="[object Boolean]",Yv="[object Date]",Qv="[object Error]",Zv="[object Function]",eb="[object Map]",tb="[object Number]",nb="[object Object]",rb="[object RegExp]",ib="[object Set]",ob="[object String]",sb="[object WeakMap]",ab="[object ArrayBuffer]",ub="[object DataView]",cb="[object Float32Array]",lb="[object Float64Array]",fb="[object Int8Array]",db="[object Int16Array]",pb="[object Int32Array]",hb="[object Uint8Array]",yb="[object Uint8ClampedArray]",gb="[object Uint16Array]",mb="[object Uint32Array]",Me={};Me[cb]=Me[lb]=Me[fb]=Me[db]=Me[pb]=Me[hb]=Me[yb]=Me[gb]=Me[mb]=!0;Me[Hv]=Me[Jv]=Me[ab]=Me[Xv]=Me[ub]=Me[Yv]=Me[Qv]=Me[Zv]=Me[eb]=Me[tb]=Me[nb]=Me[rb]=Me[ib]=Me[ob]=Me[sb]=!1;function vb(e){return On(e)&&ca(e.length)&&!!Me[Sr(e)]}var bb=vb;function _b(e){return function(t){return e(t)}}var Xl=_b,Yl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oi=Yl&&typeof module=="object"&&module&&!module.nodeType&&module,wb=oi&&oi.exports===Yl,Ds=wb&&Sl.process,Tb=function(){try{var e=oi&&oi.require&&oi.require("util").types;return e||Ds&&Ds.binding&&Ds.binding("util")}catch{}}(),Uc=Tb,Mc=Uc&&Uc.isTypedArray,Ab=Mc?Xl(Mc):bb,Ql=Ab,Ob=Object.prototype,Eb=Ob.hasOwnProperty;function Ib(e,t){var n=Vt(e),r=!n&&la(e),i=!n&&!r&&qs(e),o=!n&&!r&&!i&&Ql(e),s=n||r||i||o,a=s?Dv(e.length,String):[],l=a.length;for(var c in e)(t||Eb.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||So(c,l)))&&a.push(c);return a}var Sb=Ib;function $b(e,t){return function(n){return e(t(n))}}var Nb=$b,Rb=Nb(Object.keys,Object),Pb=Rb,Cb=Object.prototype,xb=Cb.hasOwnProperty;function Ub(e){if(!Mv(e))return Pb(e);var t=[];for(var n in Object(e))xb.call(e,n)&&n!="constructor"&&t.push(n);return t}var Mb=Ub;function Bb(e){return Wl(e)?Sb(e):Mb(e)}var Zl=Bb,Db=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lb=/^\w*$/;function kb(e,t){if(Vt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Or(e)?!0:Lb.test(e)||!Db.test(e)||t!=null&&e in Object(t)}var fa=kb,jb=Xn(Object,"create"),ci=jb;function Fb(){this.__data__=ci?ci(null):{},this.size=0}var zb=Fb;function Vb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Kb=Vb,qb="__lodash_hash_undefined__",Gb=Object.prototype,Wb=Gb.hasOwnProperty;function Hb(e){var t=this.__data__;if(ci){var n=t[e];return n===qb?void 0:n}return Wb.call(t,e)?t[e]:void 0}var Jb=Hb,Xb=Object.prototype,Yb=Xb.hasOwnProperty;function Qb(e){var t=this.__data__;return ci?t[e]!==void 0:Yb.call(t,e)}var Zb=Qb,e_="__lodash_hash_undefined__";function t_(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ci&&t===void 0?e_:t,this}var n_=t_;function $r(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}$r.prototype.clear=zb;$r.prototype.delete=Kb;$r.prototype.get=Jb;$r.prototype.has=Zb;$r.prototype.set=n_;var Bc=$r;function r_(){this.__data__=[],this.size=0}var i_=r_;function o_(e,t){for(var n=e.length;n--;)if(ua(e[n][0],t))return n;return-1}var $o=o_,s_=Array.prototype,a_=s_.splice;function u_(e){var t=this.__data__,n=$o(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():a_.call(t,n,1),--this.size,!0}var c_=u_;function l_(e){var t=this.__data__,n=$o(t,e);return n<0?void 0:t[n][1]}var f_=l_;function d_(e){return $o(this.__data__,e)>-1}var p_=d_;function h_(e,t){var n=this.__data__,r=$o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var y_=h_;function Nr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nr.prototype.clear=i_;Nr.prototype.delete=c_;Nr.prototype.get=f_;Nr.prototype.has=p_;Nr.prototype.set=y_;var No=Nr,g_=Xn(ht,"Map"),li=g_;function m_(){this.size=0,this.__data__={hash:new Bc,map:new(li||No),string:new Bc}}var v_=m_;function b_(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var __=b_;function w_(e,t){var n=e.__data__;return __(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Ro=w_;function T_(e){var t=Ro(this,e).delete(e);return this.size-=t?1:0,t}var A_=T_;function O_(e){return Ro(this,e).get(e)}var E_=O_;function I_(e){return Ro(this,e).has(e)}var S_=I_;function $_(e,t){var n=Ro(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var N_=$_;function Rr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Rr.prototype.clear=v_;Rr.prototype.delete=A_;Rr.prototype.get=E_;Rr.prototype.has=S_;Rr.prototype.set=N_;var Po=Rr,R_="Expected a function";function da(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(R_);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(da.Cache||Po),n}da.Cache=Po;var P_=da,C_=500;function x_(e){var t=P_(e,function(r){return n.size===C_&&n.clear(),r}),n=t.cache;return t}var U_=x_,M_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B_=/\\(\\)?/g,D_=U_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(M_,function(n,r,i,o){t.push(i?o.replace(B_,"$1"):r||n)}),t}),L_=D_;function k_(e){return e==null?"":Uy(e)}var j_=k_;function F_(e,t){return Vt(e)?e:fa(e,t)?[e]:L_(j_(e))}var Co=F_,z_=1/0;function V_(e){if(typeof e=="string"||Or(e))return e;var t=e+"";return t=="0"&&1/e==-z_?"-0":t}var hi=V_;function K_(e,t){t=Co(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[hi(t[n++])];return n&&n==r?e:void 0}var pa=K_;function q_(e,t,n){var r=e==null?void 0:pa(e,t);return r===void 0?n:r}var G_=q_;function W_(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var ef=W_,Dc=Xt?Xt.isConcatSpreadable:void 0;function H_(e){return Vt(e)||la(e)||!!(Dc&&e&&e[Dc])}var J_=H_;function tf(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=J_),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?tf(a,t-1,n,r,i):ef(i,a):r||(i[i.length]=a)}return i}var X_=tf;function Y_(e){var t=e==null?0:e.length;return t?X_(e,1):[]}var Q_=Y_;function Z_(e){return sa(ql(e,void 0,Q_),e+"")}var ew=Z_;function tw(){this.__data__=new No,this.size=0}var nw=tw;function rw(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var iw=rw;function ow(e){return this.__data__.get(e)}var sw=ow;function aw(e){return this.__data__.has(e)}var uw=aw,cw=200;function lw(e,t){var n=this.__data__;if(n instanceof No){var r=n.__data__;if(!li||r.length<cw-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Po(r)}return n.set(e,t),this.size=n.size,this}var fw=lw;function Pr(e){var t=this.__data__=new No(e);this.size=t.size}Pr.prototype.clear=nw;Pr.prototype.delete=iw;Pr.prototype.get=sw;Pr.prototype.has=uw;Pr.prototype.set=fw;var to=Pr;function dw(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}var pw=dw;function hw(){return[]}var yw=hw,gw=Object.prototype,mw=gw.propertyIsEnumerable,Lc=Object.getOwnPropertySymbols,vw=Lc?function(e){return e==null?[]:(e=Object(e),pw(Lc(e),function(t){return mw.call(e,t)}))}:yw,bw=vw;function _w(e,t,n){var r=t(e);return Vt(e)?r:ef(r,n(e))}var ww=_w;function Tw(e){return ww(e,Zl,bw)}var kc=Tw,Aw=Xn(ht,"DataView"),Gs=Aw,Ow=Xn(ht,"Promise"),Ws=Ow,Ew=Xn(ht,"Set"),Ar=Ew,jc="[object Map]",Iw="[object Object]",Fc="[object Promise]",zc="[object Set]",Vc="[object WeakMap]",Kc="[object DataView]",Sw=Jn(Gs),$w=Jn(li),Nw=Jn(Ws),Rw=Jn(Ar),Pw=Jn(si),Gn=Sr;(Gs&&Gn(new Gs(new ArrayBuffer(1)))!=Kc||li&&Gn(new li)!=jc||Ws&&Gn(Ws.resolve())!=Fc||Ar&&Gn(new Ar)!=zc||si&&Gn(new si)!=Vc)&&(Gn=function(e){var t=Sr(e),n=t==Iw?e.constructor:void 0,r=n?Jn(n):"";if(r)switch(r){case Sw:return Kc;case $w:return jc;case Nw:return Fc;case Rw:return zc;case Pw:return Vc}return t});var qc=Gn,Cw=ht.Uint8Array,Gc=Cw,xw="__lodash_hash_undefined__";function Uw(e){return this.__data__.set(e,xw),this}var Mw=Uw;function Bw(e){return this.__data__.has(e)}var Dw=Bw;function po(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Po;++t<n;)this.add(e[t])}po.prototype.add=po.prototype.push=Mw;po.prototype.has=Dw;var nf=po;function Lw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var kw=Lw;function jw(e,t){return e.has(t)}var rf=jw,Fw=1,zw=2;function Vw(e,t,n,r,i,o){var s=n&Fw,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var g=-1,C=!0,I=n&zw?new nf:void 0;for(o.set(e,t),o.set(t,e);++g<a;){var S=e[g],z=t[g];if(r)var J=s?r(z,S,g,t,e,o):r(S,z,g,e,t,o);if(J!==void 0){if(J)continue;C=!1;break}if(I){if(!kw(t,function(F,k){if(!rf(I,k)&&(S===F||i(S,F,n,r,o)))return I.push(k)})){C=!1;break}}else if(!(S===z||i(S,z,n,r,o))){C=!1;break}}return o.delete(e),o.delete(t),C}var of=Vw;function Kw(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var qw=Kw;function Gw(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var sf=Gw,Ww=1,Hw=2,Jw="[object Boolean]",Xw="[object Date]",Yw="[object Error]",Qw="[object Map]",Zw="[object Number]",eT="[object RegExp]",tT="[object Set]",nT="[object String]",rT="[object Symbol]",iT="[object ArrayBuffer]",oT="[object DataView]",Wc=Xt?Xt.prototype:void 0,Ls=Wc?Wc.valueOf:void 0;function sT(e,t,n,r,i,o,s){switch(n){case oT:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case iT:return!(e.byteLength!=t.byteLength||!o(new Gc(e),new Gc(t)));case Jw:case Xw:case Zw:return ua(+e,+t);case Yw:return e.name==t.name&&e.message==t.message;case eT:case nT:return e==t+"";case Qw:var a=qw;case tT:var l=r&Ww;if(a||(a=sf),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=Hw,s.set(e,t);var d=of(a(e),a(t),r,i,o,s);return s.delete(e),d;case rT:if(Ls)return Ls.call(e)==Ls.call(t)}return!1}var aT=sT,uT=1,cT=Object.prototype,lT=cT.hasOwnProperty;function fT(e,t,n,r,i,o){var s=n&uT,a=kc(e),l=a.length,c=kc(t),d=c.length;if(l!=d&&!s)return!1;for(var g=l;g--;){var C=a[g];if(!(s?C in t:lT.call(t,C)))return!1}var I=o.get(e),S=o.get(t);if(I&&S)return I==t&&S==e;var z=!0;o.set(e,t),o.set(t,e);for(var J=s;++g<l;){C=a[g];var F=e[C],k=t[C];if(r)var K=s?r(k,F,C,t,e,o):r(F,k,C,e,t,o);if(!(K===void 0?F===k||i(F,k,n,r,o):K)){z=!1;break}J||(J=C=="constructor")}if(z&&!J){var W=e.constructor,j=t.constructor;W!=j&&"constructor"in e&&"constructor"in t&&!(typeof W=="function"&&W instanceof W&&typeof j=="function"&&j instanceof j)&&(z=!1)}return o.delete(e),o.delete(t),z}var dT=fT,pT=1,Hc="[object Arguments]",Jc="[object Array]",Zi="[object Object]",hT=Object.prototype,Xc=hT.hasOwnProperty;function yT(e,t,n,r,i,o){var s=Vt(e),a=Vt(t),l=s?Jc:qc(e),c=a?Jc:qc(t);l=l==Hc?Zi:l,c=c==Hc?Zi:c;var d=l==Zi,g=c==Zi,C=l==c;if(C&&qs(e)){if(!qs(t))return!1;s=!0,d=!1}if(C&&!d)return o||(o=new to),s||Ql(e)?of(e,t,n,r,i,o):aT(e,t,l,n,r,i,o);if(!(n&pT)){var I=d&&Xc.call(e,"__wrapped__"),S=g&&Xc.call(t,"__wrapped__");if(I||S){var z=I?e.value():e,J=S?t.value():t;return o||(o=new to),i(z,J,n,r,o)}}return C?(o||(o=new to),dT(e,t,n,r,i,o)):!1}var gT=yT;function af(e,t,n,r,i){return e===t?!0:e==null||t==null||!On(e)&&!On(t)?e!==e&&t!==t:gT(e,t,n,r,af,i)}var uf=af,mT=1,vT=2;function bT(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],c=e[l],d=a[1];if(s&&a[2]){if(c===void 0&&!(l in e))return!1}else{var g=new to;if(r)var C=r(c,d,l,e,t,g);if(!(C===void 0?uf(d,c,mT|vT,r,g):C))return!1}}return!0}var _T=bT;function wT(e){return e===e&&!an(e)}var cf=wT;function TT(e){for(var t=Zl(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,cf(i)]}return t}var AT=TT;function OT(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var lf=OT;function ET(e){var t=AT(e);return t.length==1&&t[0][2]?lf(t[0][0],t[0][1]):function(n){return n===e||_T(n,e,t)}}var IT=ET;function ST(e,t){return e!=null&&t in Object(e)}var $T=ST;function NT(e,t,n){t=Co(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=hi(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&ca(i)&&So(s,i)&&(Vt(e)||la(e)))}var RT=NT;function PT(e,t){return e!=null&&RT(e,t,$T)}var ff=PT,CT=1,xT=2;function UT(e,t){return fa(e)&&cf(t)?lf(hi(e),t):function(n){var r=G_(n,e);return r===void 0&&r===t?ff(n,e):uf(t,r,CT|xT)}}var MT=UT;function BT(e){return function(t){return t?.[e]}}var DT=BT;function LT(e){return function(t){return pa(t,e)}}var kT=LT;function jT(e){return fa(e)?DT(hi(e)):kT(e)}var FT=jT;function zT(e){return typeof e=="function"?e:e==null?Io:typeof e=="object"?Vt(e)?MT(e[0],e[1]):IT(e):FT(e)}var VT=zT;function KT(e){return On(e)&&Wl(e)}var qT=KT;function GT(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var WT=GT,HT=200;function JT(e,t,n,r){var i=-1,o=jl,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Nl(t,Xl(n))),r?(o=WT,s=!1):t.length>=HT&&(o=rf,s=!1,t=new nf(t));e:for(;++i<a;){var d=e[i],g=n==null?d:n(d);if(d=r||d!==0?d:0,s&&g===g){for(var C=c;C--;)if(t[C]===g)continue e;l.push(d)}else o(t,g,r)||l.push(d)}return l}var XT=JT;function YT(e,t,n,r){if(!an(e))return e;t=Co(t,e);for(var i=-1,o=t.length,s=o-1,a=e;a!=null&&++i<o;){var l=hi(t[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=s){var d=a[l];c=r?r(d,l,a):void 0,c===void 0&&(c=an(d)?d:So(t[i+1])?[]:{})}Sv(a,l,c),a=a[l]}return e}var QT=YT;function ZT(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=pa(e,s);n(a,s)&&QT(o,Co(s,e),a)}return o}var e0=ZT,t0=32,ha=Gl(function(e,t){var n=ui(t,aa(ha));return _v(e,t0,void 0,t,n)});ha.placeholder={};var n0=ha;function r0(e,t){return e0(e,t,function(n,r){return ff(e,r)})}var i0=r0,o0=ew(function(e,t){return e==null?{}:i0(e,t)}),Yc=o0,s0=4294967295,a0=s0-1,u0=Math.floor,c0=Math.min;function l0(e,t,n,r){var i=0,o=e==null?0:e.length;if(o===0)return 0;t=n(t);for(var s=t!==t,a=t===null,l=Or(t),c=t===void 0;i<o;){var d=u0((i+o)/2),g=n(e[d]),C=g!==void 0,I=g===null,S=g===g,z=Or(g);if(s)var J=r||S;else c?J=S&&(r||C):a?J=S&&C&&(r||!I):l?J=S&&C&&!I&&(r||!z):I||z?J=!1:J=r?g<=t:g<t;J?i=d+1:o=d}return c0(o,a0)}var f0=l0;function d0(e,t,n){return f0(e,t,VT(n,2))}var p0=d0,h0=1/0,dS=Ar&&1/sf(new Ar([,-0]))[1]==h0?function(e){return new Ar(e)}:Ml;var y0=Gl(function(e,t){return qT(e)?XT(e,t):[]}),Qc=y0,df=mt(oy(),1),pS=df.default.configure,Hn=df.default,ks=100,{WARN:g0,LOG:hS,DEBUG:We,VERBOSE:we,ERROR:yS}=$e.setup($e.INFO),ho=Ce.set();tc({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var Je=({caller:e,thread:t,pattern:n,args:r})=>Pe(()=>(r=r||n,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${r?`{${typeof r=="string"?r:Hn(r)}}`:""}`));function pf(e,t){return Pe(()=>ze.structural(e.get(),t.get()))}function Cr(e,t){return ze.shallow(e.applogs,t.applogs)}function xo(e,t){if(e.size!==t.size)return!1;for(let n=0;n<e.size;n++){let r=e.nodes[n],i=t.nodes[n];if(we.isEnabled&&we("queryNodesComparer",n,r,i),!ze.structural(r.variables,i.variables))return we.isEnabled&&we("[queryNodesComparer] changed vars:",n,r,i),!1;if(!Cr(r.logsOfThisNode,i.logsOfThisNode))return we.isEnabled&&we("[queryNodesComparer] changed logsOfThisNode:",n,r,i),!1}return we.isEnabled&&we("[queryNodesComparer] equal:",{a:e,b:t}),!0}var m0=0;function Yt(e,{name:t,equals:n}={}){let r=`observableArrayMap@${++m0}{${t}}`;we.isEnabled&&we(`[${r}] create`,{fnname:e.name,fn:e,name:t,equals:n});let i,o=yf(e,a=>{i?Pe(()=>(n??ze.structural)(i,a))?We.isEnabled&&We(`[${r}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),We.isEnabled&&We(`[${r}] updated`,{updatedItems:a,observableArr:i})):i=Ce.array(a,{deep:!1,name:t,equals:n})},{name:r});if(r.includes("useRoots")){var s=Et(i);We(`[${r}] deps`,{disposeAutorun:o,rootsAtom:s,observableArr:i,observers:Qr(i)}),br(()=>ho.add(s))}return we.isEnabled&&_r(i,()=>{we(`[${r}] observed`,Qr(i),{rootsAtom:s,observableArr:i})}),zn(i,()=>{we.isEnabled&&we(`[${r}] dispose`),s&&br(()=>ho.delete(s)),o()}),i}var v0=0;function hf(e,{name:t}={}){let n=`observableSetMap@${++v0}{${t}}`;we.isEnabled&&we(`[${n}] create`,{fnname:e.name,fn:e,name:t});let r,i=yf(e,s=>{if(!r)r=Ce.set(s,{deep:!1,name:t});else{let{deleted:a,added:l}=Pe(()=>{let c=new Set(r.values()),d=new Set;for(let g of s)r.has(g)?(we.isEnabled&&we(`[${n}] unchanged`,g,{updatedItems:s,observableSet:r}),c.delete(g)):d.add(g);return We.isEnabled&&We(`[${n}] updated:`,{unseen:c,added:d,updatedItems:s,observableSet:r}),{added:d,deleted:c}});for(let c of a)r.delete(c);for(let c of l)r.add(c)}},{name:n});if(n.includes("useRoots")){var o=Et(r);We.isEnabled&&We(`[${n}] deps`,{disposeAutorun:i,rootsAtom:o,observableSet:r,observers:Qr(r)}),br(()=>ho.add(o))}return we.isEnabled&&_r(r,()=>{we(`[${n}] observed`,Qr(r),{rootsAtom:o,observableSet:r})}),zn(r,()=>{we.isEnabled&&we(`[${n}] dispose`),o&&br(()=>ho.delete(o)),i()}),r}function yf(e,t=null,{name:n}={}){We.isEnabled&&We("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:n});let r=`${n}.autorunImm`,i,o=new kt(r,function(...c){We.isEnabled&&We(`[${r}] reaction.invalidate`,c),s()});function s(){o.track(function(){let c=ks&&performance.now();We.isEnabled&&We(`[${r}] runAndTrack:`,{name:n??e.name,fn:e}),i=e(),We.isEnabled&&We(`[${r}] runAndTrack =>`,i),br(()=>{t?.(i)}),ks&&performance.now()-c>ks&&g0(`[${r}] took ${performance.now()-c}ms`)})}return s(),We.isEnabled&&We(`[${r}] deps of reaction`,{reaction:o,result:i,deps:Yr(o)}),()=>{we.isEnabled&&we(`[${r}] dispose`),setTimeout(()=>o.dispose())}}function Qe(e,t,n=!1){if(gn(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let r=!1,i=0,o=typeof n=="boolean"?{keepAlive:n}:n,s=new Map;return function(...a){let l,c=Pe(()=>{let I=a;for(let S=0;S<a.length;S++)a[S]instanceof Er&&a===I&&(I=a.slice());return I}),d=`computedFnDeepCompare(${e||t.name}#${++i})${o.argsDebugName?`{${o.argsDebugName(...a)}}`:""}`;for(let[I,S]of s.entries())if(_0(I,c)){l=S;break}else if(we.isEnabled)for(let z=0;z<I.length;z++)I[z]instanceof Er&&I[z].name===a[z].name&&ze.structural(Qc(I,I[z]),Qc(c,c[z]))&&we.force(`[${d}] threadState mismatch => cachebust`,{diffFields:Object.keys(I[z]).filter(J=>!ze.structural(I[z][J],a[z][J])),cacheArg:I[z],freshArg:a[z]});if(l){let I=l.get();return we.isEnabled&&we(`[${d}] cache hit`,{untrackedArgs:c,cachedResult:I}),I}if(!o.keepAlive&&!Du())return!r&&Fu().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),r=!0),t.apply(this,a);we.isEnabled&&we(`[${d}] new computation`,{untrackedArgs:c});let g,C=Le(()=>(we.isEnabled&&we(`[${d}] update->rerun`,Pe(()=>({args:a})),t),we.isEnabled&&Es(),g=t.apply(this,a)),{...o,name:d});if(we.isEnabled&&we(`[${d}] deps`,Yr(C),{untrackedArgs:c}),s.set(c,C),!o.keepAlive){let I=zn(C,()=>{we.isEnabled&&we(`[${d}] dispose`,C),I(),s.delete(c),o.onCleanup&&o.onCleanup(g,...a),g=void 0})}return C.get()}}function b0(e){let t=0,n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("?n+=o+`
57
57
  `+" ".repeat(++t):o===")"?n+=`
58
58
  `+" ".repeat(--t)+o:o===","&&r===0?n+=o+`
59
59
  `+" ".repeat(t):o==="{"&&r===0?(r++,n+=o+`
60
60
  `+" ".repeat(t+1)):o==="}"&&r===1?(r--,n+=`
61
- `+" ".repeat(t)+o):o==="{"&&r>0?(r++,n+=o):(o==="}"&&r>1&&r--,n+=o)}return n}function _0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]instanceof Er){if(t[n]!==e[n])return!1}else if(!ze.structural(e[n],t[n]))return!1;return!0}var{WARN:Yc,LOG:gS,DEBUG:w0,VERBOSE:mS,ERROR:Kn}=$e.setup($e.INFO,{prefix:"[thread]"});function un(e){return e.init!==void 0}var Er=class{constructor(e,t,n,r=[],i={}){this.name=e,this._applogs=r,this.parents=t===null?null:Za(t),this.filters=n,Pe(()=>this.parents?.length===0)&&Yc("[Thread] empty parents array",e),i.skipObservable||bn(this,{applogsCids:Le,applogsByCid:Le,insert:at,size:Le,isEmpty:Le,firstLog:Le,latestLog:Le},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw Kn("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Kn("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Kn("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw Kn("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Kn("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Kn("[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):Yc("unsubscribe called for non-existent",e)}notifySubscribers(e){w0(`[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 Kn("[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 Pe(()=>this.size)}get nameAndSizeUntracked(){return Pe(()=>`${this.name} (${this.size})`)}get prettyName(){return b0(this.name)}get hasParents(){return!!this.parents?.length}};var yf=class gf extends Er{static fromArray(t,n){return new gf(n||"static",null,[],t)}constructor(t,n,r,i){super(t,n,r,i,{skipObservable:!0})}get readOnly(){return!0}},mf={};rs(mf,{code:()=>Df,decode:()=>Ia,encode:()=>Ea,format:()=>ul,name:()=>C1,parse:()=>U1,stringify:()=>ul});var T0=["string","number","bigint","symbol"],A0=["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 O0(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(T0.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(E0(e))return"Buffer";let n=I0(e);return n||"Object"}function E0(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function I0(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(A0.includes(t))return t}var B=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};B.uint=new B(0,"uint",!0);B.negint=new B(1,"negint",!0);B.bytes=new B(2,"bytes",!0);B.string=new B(3,"string",!0);B.array=new B(4,"array",!1);B.map=new B(5,"map",!1);B.tag=new B(6,"tag",!1);B.float=new B(7,"float",!0);B.false=new B(7,"false",!0);B.true=new B(7,"true",!0);B.null=new B(7,"null",!0);B.undefined=new B(7,"undefined",!0);B.break=new B(7,"break",!0);var ie=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},xr=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",S0=new TextDecoder,$0=new TextEncoder;function ho(e){return xr&&globalThis.Buffer.isBuffer(e)}function da(e){return e instanceof Uint8Array?ho(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var N0=xr?(e,t,n)=>n-t>64?globalThis.Buffer.from(e.subarray(t,n)).toString("utf8"):Zc(e,t,n):(e,t,n)=>n-t>64?S0.decode(e.subarray(t,n)):Zc(e,t,n),vf=xr?e=>e.length>64?globalThis.Buffer.from(e):Qc(e):e=>e.length>64?$0.encode(e):Qc(e),pa=xr?(e,t,n)=>ho(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n):(e,t,n)=>e.slice(t,n),R0=xr?(e,t)=>(e=e.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),da(globalThis.Buffer.concat(e,t))):(e,t)=>{let n=new Uint8Array(t),r=0;for(let i of e)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n},P0=xr?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function C0(e,t){if(ho(e)&&ho(t))return e.compare(t);for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return 0}function Qc(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}function Zc(e,t,n){let r=[];for(;t<n;){let i=e[t],o=null,s=i>239?4:i>223?3:i>191?2:1;if(t+s<=n){let a,l,c,d;switch(s){case 1:i<128&&(o=i);break;case 2:a=e[t+1],(a&192)===128&&(d=(i&31)<<6|a&63,d>127&&(o=d));break;case 3:a=e[t+1],l=e[t+2],(a&192)===128&&(l&192)===128&&(d=(i&15)<<12|(a&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:a=e[t+1],l=e[t+2],c=e[t+3],(a&192)===128&&(l&192)===128&&(c&192)===128&&(d=(i&15)<<18|(a&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),t+=s}return bf(r)}var el=4096;function bf(e){let t=e.length;if(t<=el)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=el));return n}var x0=256,_f=class{constructor(e=x0){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 r=t.length-(this.maxCursor-this.cursor)-1;t.set(e,r)}else{if(t){let r=t.length-(this.maxCursor-this.cursor)-1;r<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,r),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=P0(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 n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=pa(n,0,this.cursor)}else t=R0(this.chunks,this.cursor);return e&&this.reset(),t}},ye="CBOR decode error:",Wn="CBOR encode error:",yi=[];yi[23]=1;yi[24]=2;yi[25]=3;yi[26]=5;yi[27]=9;function Ur(e,t,n){if(e.length-t<n)throw new Error(`${ye} not enough data for type`)}var Ye=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Yn(e,t,n){Ur(e,t,1);let r=e[t];if(n.strict===!0&&r<Ye[0])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return r}function Qn(e,t,n){Ur(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<Ye[1])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return r}function Zn(e,t,n){Ur(e,t,4);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(n.strict===!0&&r<Ye[2])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return r}function er(e,t,n){Ur(e,t,8);let r=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(r)<<BigInt(32))+BigInt(i);if(n.strict===!0&&o<Ye[3])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(n.allowBigInt===!0)return o;throw new Error(`${ye} integers outside of the safe integer range are not supported`)}function U0(e,t,n,r){return new ie(B.uint,Yn(e,t+1,r),2)}function M0(e,t,n,r){return new ie(B.uint,Qn(e,t+1,r),3)}function B0(e,t,n,r){return new ie(B.uint,Zn(e,t+1,r),5)}function D0(e,t,n,r){return new ie(B.uint,er(e,t+1,r),9)}function tr(e,t){return Rt(e,0,t.value)}function Rt(e,t,n){if(n<Ye[0]){let r=Number(n);e.push([t|r])}else if(n<Ye[1]){let r=Number(n);e.push([t|24,r])}else if(n<Ye[2]){let r=Number(n);e.push([t|25,r>>>8,r&255])}else if(n<Ye[3]){let r=Number(n);e.push([t|26,r>>>24&255,r>>>16&255,r>>>8&255,r&255])}else{let r=BigInt(n);if(r<Ye[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(r&BigInt(4294967295)),s=Number(r>>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(`${ye} encountered BigInt larger than allowable range`)}}tr.encodedSize=function(t){return Rt.encodedSize(t.value)};Rt.encodedSize=function(t){return t<Ye[0]?1:t<Ye[1]?2:t<Ye[2]?3:t<Ye[3]?5:9};tr.compareTokens=function(t,n){return t.value<n.value?-1:t.value>n.value?1:0};function L0(e,t,n,r){return new ie(B.negint,-1-Yn(e,t+1,r),2)}function k0(e,t,n,r){return new ie(B.negint,-1-Qn(e,t+1,r),3)}function j0(e,t,n,r){return new ie(B.negint,-1-Zn(e,t+1,r),5)}var ha=BigInt(-1),wf=BigInt(1);function F0(e,t,n,r){let i=er(e,t+1,r);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new ie(B.negint,o,9)}if(r.allowBigInt!==!0)throw new Error(`${ye} integers outside of the safe integer range are not supported`);return new ie(B.negint,ha-BigInt(i),9)}function ya(e,t){let n=t.value,r=typeof n=="bigint"?n*ha-wf:n*-1-1;Rt(e,t.type.majorEncoded,r)}ya.encodedSize=function(t){let n=t.value,r=typeof n=="bigint"?n*ha-wf:n*-1-1;return r<Ye[0]?1:r<Ye[1]?2:r<Ye[2]?3:r<Ye[3]?5:9};ya.compareTokens=function(t,n){return t.value<n.value?1:t.value>n.value?-1:0};function gi(e,t,n,r){Ur(e,t,n+r);let i=pa(e,t+n,t+n+r);return new ie(B.bytes,i,n+r)}function z0(e,t,n,r){return gi(e,t,1,n)}function V0(e,t,n,r){return gi(e,t,2,Yn(e,t+1,r))}function K0(e,t,n,r){return gi(e,t,3,Qn(e,t+1,r))}function q0(e,t,n,r){return gi(e,t,5,Zn(e,t+1,r))}function G0(e,t,n,r){let i=er(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer bytes lengths not supported`);return gi(e,t,9,i)}function yo(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===B.string?vf(e.value):e.value),e.encodedBytes}function xo(e,t){let n=yo(t);Rt(e,t.type.majorEncoded,n.length),e.push(n)}xo.encodedSize=function(t){let n=yo(t);return Rt.encodedSize(n.length)+n.length};xo.compareTokens=function(t,n){return W0(yo(t),yo(n))};function W0(e,t){return e.length<t.length?-1:e.length>t.length?1:C0(e,t)}function mi(e,t,n,r,i){let o=n+r;Ur(e,t,o);let s=new ie(B.string,N0(e,t+n,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=pa(e,t+n,t+o)),s}function H0(e,t,n,r){return mi(e,t,1,n,r)}function J0(e,t,n,r){return mi(e,t,2,Yn(e,t+1,r),r)}function X0(e,t,n,r){return mi(e,t,3,Qn(e,t+1,r),r)}function Y0(e,t,n,r){return mi(e,t,5,Zn(e,t+1,r),r)}function Q0(e,t,n,r){let i=er(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer string lengths not supported`);return mi(e,t,9,i,r)}var Z0=xo;function Mr(e,t,n,r){return new ie(B.array,r,n)}function eA(e,t,n,r){return Mr(e,t,1,n)}function tA(e,t,n,r){return Mr(e,t,2,Yn(e,t+1,r))}function nA(e,t,n,r){return Mr(e,t,3,Qn(e,t+1,r))}function rA(e,t,n,r){return Mr(e,t,5,Zn(e,t+1,r))}function iA(e,t,n,r){let i=er(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer array lengths not supported`);return Mr(e,t,9,i)}function oA(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return Mr(e,t,1,1/0)}function ga(e,t){Rt(e,B.array.majorEncoded,t.value)}ga.compareTokens=tr.compareTokens;ga.encodedSize=function(t){return Rt.encodedSize(t.value)};function Br(e,t,n,r){return new ie(B.map,r,n)}function sA(e,t,n,r){return Br(e,t,1,n)}function aA(e,t,n,r){return Br(e,t,2,Yn(e,t+1,r))}function uA(e,t,n,r){return Br(e,t,3,Qn(e,t+1,r))}function cA(e,t,n,r){return Br(e,t,5,Zn(e,t+1,r))}function lA(e,t,n,r){let i=er(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer map lengths not supported`);return Br(e,t,9,i)}function fA(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return Br(e,t,1,1/0)}function ma(e,t){Rt(e,B.map.majorEncoded,t.value)}ma.compareTokens=tr.compareTokens;ma.encodedSize=function(t){return Rt.encodedSize(t.value)};function dA(e,t,n,r){return new ie(B.tag,n,1)}function pA(e,t,n,r){return new ie(B.tag,Yn(e,t+1,r),2)}function hA(e,t,n,r){return new ie(B.tag,Qn(e,t+1,r),3)}function yA(e,t,n,r){return new ie(B.tag,Zn(e,t+1,r),5)}function gA(e,t,n,r){return new ie(B.tag,er(e,t+1,r),9)}function va(e,t){Rt(e,B.tag.majorEncoded,t.value)}va.compareTokens=tr.compareTokens;va.encodedSize=function(t){return Rt.encodedSize(t.value)};var mA=20,vA=21,bA=22,_A=23;function wA(e,t,n,r){if(r.allowUndefined===!1)throw new Error(`${ye} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new ie(B.null,null,1):new ie(B.undefined,void 0,1)}function TA(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return new ie(B.break,void 0,1)}function ba(e,t,n){if(n){if(n.allowNaN===!1&&Number.isNaN(e))throw new Error(`${ye} NaN values are not supported`);if(n.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${ye} Infinity values are not supported`)}return new ie(B.float,e,t)}function AA(e,t,n,r){return ba(wa(e,t+1),3,r)}function OA(e,t,n,r){return ba(Ta(e,t+1),5,r)}function EA(e,t,n,r){return ba(Ef(e,t+1),9,r)}function _a(e,t,n){let r=t.value;if(r===!1)e.push([B.float.majorEncoded|mA]);else if(r===!0)e.push([B.float.majorEncoded|vA]);else if(r===null)e.push([B.float.majorEncoded|bA]);else if(r===void 0)e.push([B.float.majorEncoded|_A]);else{let i,o=!1;(!n||n.float64!==!0)&&(Af(r),i=wa(zt,1),r===i||Number.isNaN(r)?(zt[0]=249,e.push(zt.slice(0,3)),o=!0):(Of(r),i=Ta(zt,1),r===i&&(zt[0]=250,e.push(zt.slice(0,5)),o=!0))),o||(IA(r),i=Ef(zt,1),zt[0]=251,e.push(zt.slice(0,9)))}}_a.encodedSize=function(t,n){let r=t.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){Af(r);let i=wa(zt,1);if(r===i||Number.isNaN(r))return 3;if(Of(r),i=Ta(zt,1),r===i)return 5}return 9};var Tf=new ArrayBuffer(9),$t=new DataView(Tf,1),zt=new Uint8Array(Tf,0);function Af(e){if(e===1/0)$t.setUint16(0,31744,!1);else if(e===-1/0)$t.setUint16(0,64512,!1);else if(Number.isNaN(e))$t.setUint16(0,32256,!1);else{$t.setFloat32(0,e);let t=$t.getUint32(0),n=(t&2139095040)>>23,r=t&8388607;if(n===255)$t.setUint16(0,31744,!1);else if(n===0)$t.setUint16(0,(e&2147483648)>>16|r>>13,!1);else{let i=n-127;i<-24?$t.setUint16(0,0):i<-14?$t.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):$t.setUint16(0,(t&2147483648)>>16|i+15<<10|r>>13,!1)}}}function wa(e,t){if(e.length-t<2)throw new Error(`${ye} not enough data for float16`);let n=(e[t]<<8)+e[t+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;let r=n>>10&31,i=n&1023,o;return r===0?o=i*2**-24:r!==31?o=(i+1024)*2**(r-25):o=i===0?1/0:NaN,n&32768?-o:o}function Of(e){$t.setFloat32(0,e,!1)}function Ta(e,t){if(e.length-t<4)throw new Error(`${ye} not enough data for float32`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,4).getFloat32(0,!1)}function IA(e){$t.setFloat64(0,e,!1)}function Ef(e,t){if(e.length-t<8)throw new Error(`${ye} not enough data for float64`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,8).getFloat64(0,!1)}_a.compareTokens=tr.compareTokens;function Ee(e,t,n){throw new Error(`${ye} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function Uo(e){return()=>{throw new Error(`${ye} ${e}`)}}var se=[];for(let e=0;e<=23;e++)se[e]=Ee;se[24]=U0;se[25]=M0;se[26]=B0;se[27]=D0;se[28]=Ee;se[29]=Ee;se[30]=Ee;se[31]=Ee;for(let e=32;e<=55;e++)se[e]=Ee;se[56]=L0;se[57]=k0;se[58]=j0;se[59]=F0;se[60]=Ee;se[61]=Ee;se[62]=Ee;se[63]=Ee;for(let e=64;e<=87;e++)se[e]=z0;se[88]=V0;se[89]=K0;se[90]=q0;se[91]=G0;se[92]=Ee;se[93]=Ee;se[94]=Ee;se[95]=Uo("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)se[e]=H0;se[120]=J0;se[121]=X0;se[122]=Y0;se[123]=Q0;se[124]=Ee;se[125]=Ee;se[126]=Ee;se[127]=Uo("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)se[e]=eA;se[152]=tA;se[153]=nA;se[154]=rA;se[155]=iA;se[156]=Ee;se[157]=Ee;se[158]=Ee;se[159]=oA;for(let e=160;e<=183;e++)se[e]=sA;se[184]=aA;se[185]=uA;se[186]=cA;se[187]=lA;se[188]=Ee;se[189]=Ee;se[190]=Ee;se[191]=fA;for(let e=192;e<=215;e++)se[e]=dA;se[216]=pA;se[217]=hA;se[218]=yA;se[219]=gA;se[220]=Ee;se[221]=Ee;se[222]=Ee;se[223]=Ee;for(let e=224;e<=243;e++)se[e]=Uo("simple values are not supported");se[244]=Ee;se[245]=Ee;se[246]=Ee;se[247]=wA;se[248]=Uo("simple values are not supported");se[249]=AA;se[250]=OA;se[251]=EA;se[252]=Ee;se[253]=Ee;se[254]=Ee;se[255]=TA;var Qt=[];for(let e=0;e<24;e++)Qt[e]=new ie(B.uint,e,1);for(let e=-1;e>=-24;e--)Qt[31-e]=new ie(B.negint,e,1);Qt[64]=new ie(B.bytes,new Uint8Array(0),1);Qt[96]=new ie(B.string,"",1);Qt[128]=new ie(B.array,0,1);Qt[160]=new ie(B.map,0,1);Qt[244]=new ie(B.false,!1,1);Qt[245]=new ie(B.true,!0,1);Qt[246]=new ie(B.null,null,1);function SA(){let e=[];return e[B.uint.major]=tr,e[B.negint.major]=ya,e[B.bytes.major]=xo,e[B.string.major]=Z0,e[B.array.major]=ga,e[B.map.major]=ma,e[B.tag.major]=va,e[B.float.major]=_a,e}var vS=SA(),Ls=new _f,tl=class If{constructor(t,n){this.obj=t,this.parent=n}includes(t){let n=this;do if(n.obj===t)return!0;while(n=n.parent);return!1}static createCheck(t,n){if(t&&t.includes(n))throw new Error(`${Wn} object contains circular references`);return new If(n,t)}},_n={null:new ie(B.null,null),undefined:new ie(B.undefined,void 0),true:new ie(B.true,!0),false:new ie(B.false,!1),emptyArray:new ie(B.array,0),emptyMap:new ie(B.map,0)},En={number(e,t,n,r){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new ie(B.float,e):e>=0?new ie(B.uint,e):new ie(B.negint,e)},bigint(e,t,n,r){return e>=BigInt(0)?new ie(B.uint,e):new ie(B.negint,e)},Uint8Array(e,t,n,r){return new ie(B.bytes,e)},string(e,t,n,r){return new ie(B.string,e)},boolean(e,t,n,r){return e?_n.true:_n.false},null(e,t,n,r){return _n.null},undefined(e,t,n,r){return _n.undefined},ArrayBuffer(e,t,n,r){return new ie(B.bytes,new Uint8Array(e))},DataView(e,t,n,r){return new ie(B.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,n,r){if(!e.length)return n.addBreakTokens===!0?[_n.emptyArray,new ie(B.break)]:_n.emptyArray;r=tl.createCheck(r,e);let i=[],o=0;for(let s of e)i[o++]=to(s,n,r);return n.addBreakTokens?[new ie(B.array,e.length),i,new ie(B.break)]:[new ie(B.array,e.length),i]},Object(e,t,n,r){let i=t!=="Object",o=i?e.keys():Object.keys(e),s=i?e.size:o.length;if(!s)return n.addBreakTokens===!0?[_n.emptyMap,new ie(B.break)]:_n.emptyMap;r=tl.createCheck(r,e);let a=[],l=0;for(let c of o)a[l++]=[to(c,n,r),to(i?e.get(c):e[c],n,r)];return $A(a,n),n.addBreakTokens?[new ie(B.map,s),a,new ie(B.break)]:[new ie(B.map,s),a]}};En.Map=En.Object;En.Buffer=En.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))En[`${e}Array`]=En.DataView;function to(e,t={},n){let r=O0(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||En[r];if(typeof i=="function"){let s=i(e,r,t,n);if(s!=null)return s}let o=En[r];if(!o)throw new Error(`${Wn} unsupported type: ${r}`);return o(e,r,t,n)}function $A(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Sf(e,t,n,r){if(Array.isArray(t))for(let i of t)Sf(e,i,n,r);else n[t.type.major](e,t,r)}function NA(e,t,n){let r=to(e,n);if(!Array.isArray(r)&&n.quickEncodeToken){let i=n.quickEncodeToken(r);if(i)return i;let o=t[r.type.major];if(o.encodedSize){let s=o.encodedSize(r,n),a=new _f(s);if(o(a,r,n),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return da(a.chunks[0])}}return Ls.reset(),Sf(Ls,r,t,n),Ls.toBytes(!0)}var RA={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},PA=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=Qt[e];if(t===void 0){let n=se[e];if(!n)throw new Error(`${ye} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let r=e&31;t=n(this.data,this._pos,r,this.options)}return this._pos+=t.encodedLength,t}},fi=Symbol.for("DONE"),Mo=Symbol.for("BREAK");function CA(e,t,n){let r=[];for(let i=0;i<e.value;i++){let o=di(t,n);if(o===Mo){if(e.value===1/0)break;throw new Error(`${ye} got unexpected break to lengthed array`)}if(o===fi)throw new Error(`${ye} found array but not enough entries (got ${i}, expected ${e.value})`);r[i]=o}return r}function xA(e,t,n){let r=n.useMaps===!0,i=r?void 0:{},o=r?new Map:void 0;for(let s=0;s<e.value;s++){let a=di(t,n);if(a===Mo){if(e.value===1/0)break;throw new Error(`${ye} got unexpected break to lengthed map`)}if(a===fi)throw new Error(`${ye} found map but not enough entries (got ${s} [no key], expected ${e.value})`);if(r!==!0&&typeof a!="string")throw new Error(`${ye} non-string keys not supported (got ${typeof a})`);if(n.rejectDuplicateMapKeys===!0&&(r&&o.has(a)||!r&&a in i))throw new Error(`${ye} found repeat map key "${a}"`);let l=di(t,n);if(l===fi)throw new Error(`${ye} found map but not enough entries (got ${s} [no value], expected ${e.value})`);r?o.set(a,l):i[a]=l}return r?o:i}function di(e,t){if(e.done())return fi;let n=e.next();if(n.type===B.break)return Mo;if(n.type.terminal)return n.value;if(n.type===B.array)return CA(n,e,t);if(n.type===B.map)return xA(n,e,t);if(n.type===B.tag){if(t.tags&&typeof t.tags[n.value]=="function"){let r=di(e,t);return t.tags[n.value](r)}throw new Error(`${ye} tag not supported (${n.value})`)}throw new Error("unsupported")}function UA(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ye} data to decode must be a Uint8Array`);t=Object.assign({},RA,t);let n=t.tokenizer||new PA(e,t),r=di(n,t);if(r===fi)throw new Error(`${ye} did not find any content to decode`);if(r===Mo)throw new Error(`${ye} got unexpected break`);return[r,e.subarray(n.pos())]}function MA(e,t){let[n,r]=UA(e,t);if(r.length>0)throw new Error(`${ye} too many terminals, data makes no sense`);return n}var BA=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===B.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===B.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[B.uint.major](e,t){this.prefix(e);let n=String(t.value),r=[];for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);e.push(r)}[B.negint.major](e,t){this[B.uint.major](e,t)}[B.bytes.major](e,t){throw new Error(`${Wn} unsupported type: Uint8Array`)}[B.string.major](e,t){this.prefix(e);let n=vf(JSON.stringify(t.value));e.push(n.length>32?da(n):n)}[B.array.major](e,t){this.prefix(e),this.inRecursive.push({type:B.array,elements:0}),e.push([91])}[B.map.major](e,t){this.prefix(e),this.inRecursive.push({type:B.map,elements:0}),e.push([123])}[B.tag.major](e,t){}[B.float.major](e,t){if(t.type.name==="break"){let o=this.inRecursive.pop();if(o){if(o.type===B.array)e.push([93]);else if(o.type===B.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(`${Wn} 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 n=String(t.value),r=[],i=!1;for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o),!i&&(r[o]===46||r[o]===101||r[o]===69)&&(i=!0);i||(r.push(46),r.push(48)),e.push(r)}};function DA(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Wn} complex map keys are not supported`);let n=e[0],r=t[0];if(n.type!==B.string||r.type!==B.string)throw new Error(`${Wn} non-string map keys are not supported`);if(n<r)return-1;if(n>r)return 1;throw new Error(`${Wn} unexpected duplicate map keys, this is not supported`)}var LA={addBreakTokens:!0,mapSorter:DA};function kA(e,t){return t=Object.assign({},LA,t),NA(e,new BA,t)}var $f=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(`${ye} 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(`${ye} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,n=!1,r=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++,n=!0;else return new ie(B.uint,0,this._pos-e);if(r([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${ye} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(n)throw new Error(`${ye} unexpected token at position ${this._pos}`);n=!0,this._pos++,r([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(n=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,r([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 n?new ie(B.float,o,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(o)?new ie(o>=0?B.uint:B.negint,o,this._pos-e):new ie(o>=0?B.uint:B.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${ye} 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 ie(B.string,a,o)}}let e=this._pos,t=[],n=()=>{if(this._pos+4>=this.data.length)throw new Error(`${ye} 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(`${ye} unexpected unicode escape character at position ${this._pos}`);i=i*16+s,this._pos++}return i},r=()=>{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(`${ye} unexpected unicode sequence at position ${this._pos}`);let a,l,c,d;switch(s){case 1:i<128&&(o=i);break;case 2:a=this.data[this._pos+1],(a&192)===128&&(d=(i&31)<<6|a&63,d>127&&(o=d));break;case 3:a=this.data[this._pos+1],l=this.data[this._pos+2],(a&192)===128&&(l&192)===128&&(d=(i&15)<<12|(a&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:a=this.data[this._pos+1],l=this.data[this._pos+2],c=this.data[this._pos+3],(a&192)===128&&(l&192)===128&&(c&192)===128&&(d=(i&15)<<18|(a&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(o=d))}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(`${ye} 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(n());break;default:throw new Error(`${ye} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new ie(B.string,bf(t),this._pos-e);default:if(i<32)throw new Error(`${ye} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):r()}}throw new Error(`${ye} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new ie(B.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new ie(B.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new ie(B.null,null,4);case 102:return this.expect([102,97,108,115,101]),new ie(B.false,!1,5);case 116:return this.expect([116,114,117,101]),new ie(B.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(`${ye} 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 ie(B.break,void 0,1);if(this.ch()!==44)throw new Error(`${ye} 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 ie(B.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 ie(B.break,void 0,1);if(this.ch()!==44)throw new Error(`${ye} 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 ie(B.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${ye} 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(`${ye} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function jA(e,t){return t=Object.assign({tokenizer:new $f(e,t)},t),MA(e,t)}var bS=new Uint8Array(0);function FA(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function Aa(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 zA(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(n[s]!==255)throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function g(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var z=0,J=0,F=0,k=S.length;F!==k&&S[F]===0;)F++,z++;for(var K=(k-F)*d+1>>>0,W=new Uint8Array(K);F!==k;){for(var j=S[F],Z=0,G=K-1;(j!==0||Z<J)&&G!==-1;G--,Z++)j+=256*W[G]>>>0,W[G]=j%a>>>0,j=j/a>>>0;if(j!==0)throw new Error("Non-zero carry");J=Z,F++}for(var fe=K-J;fe!==K&&W[fe]===0;)fe++;for(var x=l.repeat(z);fe<K;++fe)x+=e.charAt(W[fe]);return x}function C(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var z=0;if(S[z]!==" "){for(var J=0,F=0;S[z]===l;)J++,z++;for(var k=(S.length-z)*c+1>>>0,K=new Uint8Array(k);S[z];){var W=n[S.charCodeAt(z)];if(W===255)return;for(var j=0,Z=k-1;(W!==0||j<F)&&Z!==-1;Z--,j++)W+=a*K[Z]>>>0,K[Z]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");F=j,z++}if(S[z]!==" "){for(var G=k-F;G!==k&&K[G]===0;)G++;for(var fe=new Uint8Array(J+(k-G)),x=J;G!==k;)fe[x++]=K[G++];return fe}}}function I(S){var z=C(S);if(z)return z;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:C,decode:I}}var VA=zA,KA=VA,qA=KA,GA=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},WA=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let r=t.codePointAt(0);if(r===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r,this.baseDecode=n}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 Nf(this,e)}},HA=class{decoders;constructor(e){this.decoders=e}or(e){return Nf(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Nf(e,t){return new HA({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var JA=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new GA(e,t,n),this.decoder=new WA(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Rf({name:e,prefix:t,encode:n,decode:r}){return new JA(e,t,n,r)}function Bo({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=qA(n,e);return Rf({prefix:t,name:e,encode:r,decode:o=>Aa(i(o))})}function XA(e,t,n,r){let i=e.length;for(;e[i-1]==="=";)--i;let o=new Uint8Array(i*n/8|0),s=0,a=0,l=0;for(let c=0;c<i;++c){let d=t[e[c]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);a=a<<n|d,s+=n,s>=8&&(s-=8,o[l++]=255&a>>s)}if(s>=n||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o}function YA(e,t,n){let r=t[t.length-1]==="=",i=(1<<n)-1,o="",s=0,a=0;for(let l=0;l<e.length;++l)for(a=a<<8|e[l],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s!==0&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o}function QA(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function yt({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=QA(r);return Rf({prefix:t,name:e,encode(o){return YA(o,r,n)},decode(o){return XA(o,i,n,e)}})}var no=yt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),_S=yt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),wS=yt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),TS=yt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),AS=yt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),OS=yt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ES=yt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),IS=yt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),SS=yt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),ks=Bo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$S=Bo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),An=Bo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),NS=Bo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Pf={};rs(Pf,{Digest:()=>Do,create:()=>Oa,decode:()=>xf,equals:()=>Uf,hasCode:()=>m1});var ZA=Cf,nl=128,e1=127,t1=~e1,n1=Math.pow(2,31);function Cf(e,t,n){t=t||[],n=n||0;for(var r=n;e>=n1;)t[n++]=e&255|nl,e/=128;for(;e&t1;)t[n++]=e&255|nl,e>>>=7;return t[n]=e|0,Cf.bytes=n-r+1,t}var r1=Gs,i1=128,rl=127;function Gs(e,r){var n=0,r=r||0,i=0,o=r,s,a=e.length;do{if(o>=a)throw Gs.bytes=0,new RangeError("Could not decode varint");s=e[o++],n+=i<28?(s&rl)<<i:(s&rl)*Math.pow(2,i),i+=7}while(s>=i1);return Gs.bytes=o-r,n}var o1=Math.pow(2,7),s1=Math.pow(2,14),a1=Math.pow(2,21),u1=Math.pow(2,28),c1=Math.pow(2,35),l1=Math.pow(2,42),f1=Math.pow(2,49),d1=Math.pow(2,56),p1=Math.pow(2,63),h1=function(e){return e<o1?1:e<s1?2:e<a1?3:e<u1?4:e<c1?5:e<l1?6:e<f1?7:e<d1?8:e<p1?9:10},y1={encode:ZA,decode:r1,encodingLength:h1},g1=y1,go=g1;function Ws(e,t=0){return[go.decode(e,t),go.decode.bytes]}function mo(e,t,n=0){return go.encode(e,t,n),t}function vo(e){return go.encodingLength(e)}function Oa(e,t){let n=t.byteLength,r=vo(e),i=r+vo(n),o=new Uint8Array(i+n);return mo(e,o,0),mo(n,o,r),o.set(t,i),new Do(e,n,t,o)}function xf(e){let t=Aa(e),[n,r]=Ws(t),[i,o]=Ws(t.subarray(r)),s=t.subarray(r+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Do(n,i,s,t)}function Uf(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&FA(e.bytes,n.bytes)}}var Do=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};function m1(e,t){return e.code===t}function il(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return b1(n,Hs(e),t??An.encoder);default:return _1(n,Hs(e),t??no.encoder)}}var ol=new WeakMap;function Hs(e){let t=ol.get(e);if(t==null){let n=new Map;return ol.set(e,n),n}return t}var Lo=class tt{code;version;multihash;bytes;"/";constructor(t,n,r,i){this.code=n,this.version=t,this.multihash=r,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:n}=this;if(t!==ri)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==w1)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return tt.createV0(n)}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:n}=this.multihash,r=Oa(t,n);return tt.createV1(this.code,r)}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 tt.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&Uf(t.multihash,r.multihash)}toString(t){return il(this,t)}toJSON(){return{"/":il(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 n=t;if(n instanceof tt)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:o,bytes:s}=n;return new tt(r,i,o,s??sl(r,i,o.bytes))}else if(n[T1]===!0){let{version:r,multihash:i,code:o}=n,s=xf(i);return tt.create(r,o,s)}else return null}static create(t,n,r){if(typeof n!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(n!==ri)throw new Error(`Version 0 CID must use dag-pb (code: ${ri}) block encoding`);return new tt(t,n,r,r.bytes)}case 1:{let i=sl(t,n,r.bytes);return new tt(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return tt.create(0,ri,t)}static createV1(t,n){return tt.create(1,t,n)}static decode(t){let[n,r]=tt.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=tt.inspectBytes(t),r=n.size-n.multihashSize,i=Aa(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw new Error("Incorrect length");let o=i.subarray(n.multihashSize-n.digestSize),s=new Do(n.multihashCode,n.digestSize,o,i);return[n.version===0?tt.createV0(s):tt.createV1(n.codec,s),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[g,C]=Ws(t.subarray(n));return n+=C,g},i=r(),o=ri;if(i===18?(i=0,n=0):o=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=n,a=r(),l=r(),c=n+l,d=c-s;return{version:i,codec:o,multihashCode:a,digestSize:l,multihashSize:d,size:c}}static parse(t,n){let[r,i]=v1(t,n),o=tt.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Hs(o).set(r,t),o}};function v1(e,t){switch(e[0]){case"Q":{let n=t??An;return[An.prefix,n.decode(`${An.prefix}${e}`)]}case An.prefix:{let n=t??An;return[An.prefix,n.decode(e)]}case no.prefix:{let n=t??no;return[no.prefix,n.decode(e)]}case ks.prefix:{let n=t??ks;return[ks.prefix,n.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 b1(e,t,n){let{prefix:r}=n;if(r!==An.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let o=n.encode(e).slice(1);return t.set(r,o),o}else return i}function _1(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let o=n.encode(e);return t.set(r,o),o}else return i}var ri=112,w1=18;function sl(e,t,n){let r=vo(e),i=r+vo(t),o=new Uint8Array(i+n.byteLength);return mo(e,o,0),mo(t,o,r),o.set(n,i),o}var T1=Symbol.for("@ipld/js-cid/CID"),A1=20;function Mf({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new O1(e,t,n,r,i)}var O1=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,r,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=r??A1,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 n=this.encode(e);return n instanceof Uint8Array?al(n,this.code,t?.truncate):n.then(r=>al(r,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function al(e,t,n){if(n!=null&&n!==e.byteLength){if(n>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,n)}return Oa(t,e)}var Bf=yt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),RS=yt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),PS=yt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),CS=yt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function E1(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function I1(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Lo.asCID(e);if(!t)return null;let n=t.toString();return[new ie(B.map,1/0,1),new ie(B.string,"/",1),new ie(B.string,n,n.length),new ie(B.break,void 0,1)]}function bo(e){let t=Bf.encode(e).slice(1);return[new ie(B.map,1/0,1),new ie(B.string,"/",1),new ie(B.map,1/0,1),new ie(B.string,"bytes",5),new ie(B.string,t,t.length),new ie(B.break,void 0,1),new ie(B.break,void 0,1)]}function Ft(e){return bo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function S1(e){return bo(new Uint8Array(e))}function $1(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function N1(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 R1={typeEncoders:{Object:I1,Buffer:bo,Uint8Array:bo,Int8Array:Ft,Uint16Array:Ft,Int16Array:Ft,Uint32Array:Ft,Int32Array:Ft,Float32Array:Ft,Float64Array:Ft,Uint8ClampedArray:Ft,BigInt64Array:Ft,BigUint64Array:Ft,DataView:Ft,ArrayBuffer:S1,undefined:$1,number:N1}},P1=class extends $f{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===B.map){let t=this._next();if(t.type===B.string&&t.value==="/"){let n=this._next();if(n.type===B.string){if(this._next().type!==B.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new ie(B.tag,42,0)}if(n.type===B.map){let r=this._next();if(r.type===B.string&&r.value==="bytes"){let i=this._next();if(i.type===B.string){for(let s=0;s<2;s++)if(this._next().type!==B.break)throw new Error("Invalid encoded Bytes form");let o=Bf.decode(`m${i.value}`);return new ie(B.bytes,o,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(r)}this.tokenBuffer.push(n)}this.tokenBuffer.push(t)}return e}},Js={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Js.tags[42]=Lo.parse;var C1="dag-json",Df=297,Ea=e=>kA(e,R1),Ia=e=>{let t=E1(e),n=Object.assign(Js,{tokenizer:new P1(t,Js)});return jA(t,n)},ul=e=>x1.decode(Ea(e)),x1=new TextDecoder,U1=e=>Ia(M1.encode(e)),M1=new TextEncoder;function B1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Lf(e,t,n=""){let r=B1(e),i=e?.length,o=t!==void 0;if(!r||o&&i!==t){let s=n&&`"${n}" `,a=o?` of length ${t}`:"",l=r?`length=${i}`:`type=${typeof e}`;throw new Error(s+"expected Uint8Array"+a+", got "+l)}return e}function cl(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 D1(e,t){Lf(e,void 0,"digestInto() output");let n=t.outputLen;if(e.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function Xs(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function js(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Jt(e,t){return e<<32-t|e>>>t}function L1(e,t={}){let n=(i,o)=>e(o).update(i).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}var k1=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function j1(e,t,n){return e&t^~e&n}function F1(e,t,n){return e&t^e&n^t&n}var z1=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=js(this.buffer)}update(e){cl(this),Lf(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let a=js(e);for(;r<=i-o;o+=r)this.process(a,o);continue}n.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){cl(this),D1(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:o}=this;t[o++]=128,Xs(this.buffer.subarray(o)),this.padOffset>r-o&&(this.process(n,0),o=0);for(let d=o;d<r;d++)t[d]=0;n.setBigUint64(r-8,BigInt(this.length*8),i),this.process(n,0);let s=js(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let l=a/4,c=this.get();if(l>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)s.setUint32(4*d,c[d],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=r,e.pos=s,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},wn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),V1=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]),Tn=new Uint32Array(64),K1=class extends z1{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:o,G:s,H:a}=this;return[e,t,n,r,i,o,s,a]}set(e,t,n,r,i,o,s,a){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=o|0,this.G=s|0,this.H=a|0}process(e,t){for(let d=0;d<16;d++,t+=4)Tn[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let g=Tn[d-15],C=Tn[d-2],I=Jt(g,7)^Jt(g,18)^g>>>3,S=Jt(C,17)^Jt(C,19)^C>>>10;Tn[d]=S+Tn[d-7]+I+Tn[d-16]|0}let{A:n,B:r,C:i,D:o,E:s,F:a,G:l,H:c}=this;for(let d=0;d<64;d++){let g=Jt(s,6)^Jt(s,11)^Jt(s,25),C=c+g+j1(s,a,l)+V1[d]+Tn[d]|0,S=(Jt(n,2)^Jt(n,13)^Jt(n,22))+F1(n,r,i)|0;c=l,l=a,a=s,s=o+C|0,o=i,i=r,r=n,n=C+S|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(n,r,i,o,s,a,l,c)}roundClean(){Xs(Tn)}destroy(){this.set(0,0,0,0,0,0,0,0),Xs(this.buffer)}},q1=class extends K1{A=wn[0]|0;B=wn[1]|0;C=wn[2]|0;D=wn[3]|0;E=wn[4]|0;F=wn[5]|0;G=wn[6]|0;H=wn[7]|0;constructor(){super(32)}},G1=L1(()=>new q1,k1(1));var He=mt(en(),1),kf=mt(ly(),1),ll=e=>He.Type.Union([e,He.Type.Null()]);var jf=/^(k51qz|baguq)[0-9a-z]{56,57}$/,W1=/^[0-9A-Fa-f]{7,8}$/g;He.FormatRegistry.Set("EntityID",e=>!!e.match(W1)||!!e.match(jf));var H1=He.Type.String(),J1=e=>e?.enc instanceof Uint8Array;He.FormatRegistry.Set("CID",e=>!!e.match(jf));var Ff=He.Type.String({format:"CID"}),X1=/^http([s]?):\/\/.*\..*/;He.FormatRegistry.Set("URL",e=>!!e.match(X1));var xS=He.Type.String({format:"URL"}),zf=He.Type.Object({en:H1,at:He.Type.String(),vl:ll(He.Type.Union([He.Type.String(),He.Type.Boolean(),He.Type.Number()])),ts:He.Type.String(),ag:He.Type.String(),pv:ll(Ff)}),fl=kf.TypeCompiler.Compile(zf);var US=fl.Check.bind(fl),Y1=He.Type.Composite([He.Type.Object({cid:Ff}),zf]),Ys=kf.TypeCompiler.Compile(Y1),Q1=e=>Array.from(Ys.Errors(e)),Vf=Ys.Check.bind(Ys);function Kf(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var Z1=Mf({name:"sha2-256",code:18,encode:Kf("SHA-256")}),MS=Mf({name:"sha2-512",code:19,encode:Kf("SHA-512")}),{WARN:dl,LOG:BS,DEBUG:eO,VERBOSE:qf,ERROR:tO}=$e.setup($e.INFO);function Gf(e,t=["cid"]){if(!e)throw tO("falsy log",e);let n=e.cid;if(J1(e))return n||(n=Sa(Wf(e).bytes).toString()),dl("preparing an encrypted applog - really?"),{log:e,cid:n};let r={};for(let[i,o]of Object.entries(e))o===void 0&&(dl(`log.${i} is undefined, which is not allowed - encoding as null`,e),o=null),t.includes(i)?qf("excluding app log",{key:i,val:o}):r[i]=o;return{log:r,cid:n}}function nO(e){return Sa(rO(e).bytes)}function rO(e){return Wf(Gf(e)?.log)}function Sa(e){let t=G1(e),n=Pf.create(Z1.code,t),r=Lo.create(1,Df,n);return qf("[getCidSync]",{bytes:e,hash:t,digest:n,cid:r}),r}function Wf(e){eO("[encodeBlock]",e);let t=Ea(e);return{bytes:t,cid:Sa(t)}}function pl(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 iO(e,t){let n=pl(e),r=pl(t);return+n<+r}var{WARN:oO,LOG:DS,DEBUG:LS,VERBOSE:_o,ERROR:wo}=$e.setup($e.INFO),sO=(e,t,n="asc")=>n==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),Hf=(e,t,n)=>ze.structural(Jc(t,e),Jc(n,e)),aO=(e,t,n="asc")=>sO(e.ts,t.ts,n),kS=n0(Hf,["en","at"]);function pi(e,t="asc"){return e.sort((n,r)=>aO(n,r,t))}var uO=(e,t)=>iO(new Date(e.ts),new Date(t.ts));var cO=()=>{oO("[removeDuplicateAppLogs] mode not set; pass 'safety' or 'cleanup' for optimal behavior")},hl=e=>{let t=new Map,n=_o.isEnabled;for(let r of e){if(!r)throw wo("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!r.cid)throw wo("applog with missing CID",r),new Error("applog with missing CID");let i=r.cid,o=t.get(i);o?n&&_o("Skipping duplicate applog:",[o,r]):t.set(i,r)}return Array.from(t.values())},lO=e=>{let t=new Set,n=_o.isEnabled,r=n?new Map:null,i=null,o=0;for(let s of e){if(!s)throw wo("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!s.cid)throw wo("applog with missing CID",s),new Error("applog with missing CID");let a=s.cid;t.has(a)?(i||(i=e.slice(0,o)),n&&_o("Skipping duplicate applog:",[r?.get(a),s])):(t.add(a),r&&r.set(a,s),i&&i.push(s)),o++}return i??e},Jf=(e,t)=>t?t==="safety"?lO(e):hl(e):(cO(),hl(e));function fO(e){return typeof e=="string"&&e.startsWith("?")}function dO(e){return e.slice(1)}function $a(e,t){let n={},r={};for(let[i,o]of Object.entries(e))if(fO(o)){let s=dO(o),a=t[s];a?r[i]=a:n[i]=s}else r[i]=o;return[r,n]}function pO(e,t,n){let r;if(t){let i=typeof t;i==="string"?r=t===n:i==="function"?r=t(n):typeof t.has=="function"?r=t.has(n):Array.isArray(t)&&!Array.isArray(n)?r=t.includes(n):r=t===n}else r=t===n;return e.charAt(0)==="!"?!r:r}var Xf=function(t){for(var n=0,r=0,i=t.length;r<i;r++)n+=t[r];return n},yl=function(t){return Xf(t)/t.length},Nt={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return Nt.max(e)-Nt.min(e)},midrange:function(e){return Nt.range(e)/2},sum:Xf,mean:yl,average:yl,median:function(e){e.sort(function(n,r){return n-r});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={},n=0,r=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>n?(r=[i],n=t[i]):t[i]===n&&(r.push(i),n=t[i])}),r},variance:function(e){var t=Nt.mean(e);return Nt.mean(e.map(function(n){return Math.pow(n-t,2)}))},standardDeviation:function(e){return Math.sqrt(Nt.variance(e))},meanAbsoluteDeviation:function(e){var t=Nt.mean(e);return Nt.mean(e.map(function(n){return Math.abs(n-t)}))},zScores:function(e){var t=Nt.mean(e),n=Nt.standardDeviation(e);return e.map(function(r){return(r-t)/n})}};Nt.average=Nt.mean;var Yf=function(e,t=13,n){if(!e?.length)throw new Error(`Empty string: ${e}`);let r=3735928559^t,i=1103547991^t;for(let s=0,a;s<e.length;s++)a=e.charCodeAt(s),r=Math.imul(r^a,2654435761),i=Math.imul(i^a,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),(4294967296*(2097151&i)+(r>>>0)).toString(16).slice(-n).padStart(n,"0")};function Qf(){return new Date().toISOString()}var{WARN:hO,LOG:jS,DEBUG:Ke,VERBOSE:FS,ERROR:To}=$e.setup($e.INFO);function yO(e,t){Ke(`[ensureTsPvAndFinalizeApplogs] ENTER - ${e.length} applogs, thread size=${t.size}`);let n=Qf(),r=t;Ke("[ensureTsPvAndFinalizeApplogs] About to map over applogs");let i=e.map((o,s)=>{Ke(`[ensureTsPvAndFinalizeApplogs] Processing applog ${s+1}/${e.length}`);let a=gO(o,{ts:n,threadForPv:r});return Ke(`[ensureTsPvAndFinalizeApplogs] Finalized applog ${s+1}/${e.length}`),a});return Ke(`[ensureTsPvAndFinalizeApplogs] EXIT - mapped ${i.length} applogs`),i}function gO(e,{ts:t,threadForPv:n}={}){Ke(`[finalizeApplogForInsert] ENTER - en=${e.en}, at=${e.at}`),Ke("[finalizeApplogForInsert] About to call withTs");let r=bO(e,t??Qf());Ke(`[finalizeApplogForInsert] About to call withPvFrom (thread size=${n?.size??"null"})`);let i=_O(r,n);Ke("[finalizeApplogForInsert] About to call encodeApplogAndGetCid");let o=nO(i).toString();Ke(`[finalizeApplogForInsert] CID created: ${o}`),e.cid&&e.cid!==o&&hO("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:o,logWithPv:i});let s={...i,cid:o};if(Ke("[finalizeApplogForInsert] About to validate applog"),!Vf(s))throw To(`Bogus Applog ${JSON.stringify(s)}`,Q1(s));return Ke(`[finalizeApplogForInsert] EXIT - CID=${o}`),Object.freeze(s)}function mO(e){return!!e.ts}function vO(e){return!!e.pv}function bO(e,t){return mO(e)?e:{...e,ts:t}}function _O(e,t){if(Ke(`[withPvFrom] ENTER - en=${e.en}, at=${e.at}, hasPv=${e.pv!==void 0}`),e.pv!==void 0)return Ke("[withPvFrom] EXIT early - pv already set"),e;if(t){let{en:n,at:r}=e;Ke(`[withPvFrom] About to call thread.findLast for en=${n}, at=${r}, thread.size=${t.size}`);let i=t.findLast(s=>s.en==n&&s.at==r);if(Ke(`[withPvFrom] findLast completed, found=${!!i}`),Ke("[withPvFrom] About to check equality"),Hf(["en","at","vl","ts","ag"],e,i))throw To("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let o=(e.pv!==void 0?e.pv:i?.cid)??null;return Ke(`[withPvFrom] EXIT - prevLogCid=${o}`),{...e,pv:o}}else{if(!vO(e))throw To("[withPvFrom] no thread and no pv:",e);return Ke("[withPvFrom] EXIT - no thread, returning log with existing pv"),e}}function ko(e){let t=()=>(Pe(()=>e.length<2&&Ke(`joinThreads with count=${e.length}`)),pi(Jf(e.flatMap(i=>{let o=i.applogs;if(!o)throw To("falsy applogs of thread",i),new Error("falsy applogs of thread");return o}),"cleanup"))),n=Pe(()=>t()),r=at(function(i,o){return un(i)?{init:Pe(()=>t())}:{added:i.added.filter(s=>!this.hasApplog(s,!0)),removed:i.removed?.filter(s=>!!this.parents.some(l=>l===o?!1:l.hasApplog(s,!0)))}});return new Na(Pe(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],n,r)}var{WARN:gl,LOG:zS,DEBUG:ml,VERBOSE:qn,ERROR:vl}=$e.setup($e.INFO),Na=class Zf extends Er{constructor(t,n,r,i,o,s=null){super(t,n,r,o?Ce.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=o,this._writeMapper=s,bn(this,{onParentUpdate:at}),o&&this.subscribeToParents()}static mapWrites(t,n,r){return new Zf(`${n}<${t.nameAndSizeUntracked}>`,t,t.filters,t._applogs,null,r)}_parentSubscriptions=null;insert(t){let n=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!n))return this.parents.forEach(r=>r.insert(n))}insertRaw(t){let n=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!n))return this.parents.forEach(r=>r.insertRaw(n))}subscribeToParents(){this._parentSubscriptions=new Map;let t=St(()=>{this.parents.length||gl("MappedThread has no parents",this),qn(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(r=>r.name));let n=new Set([...this._parentSubscriptions.keys()]);for(let r of this.parents){n.delete(r)&&qn(`[MappedThread: ${this.name}] Skipping re-sub to parent`,r.nameAndSizeUntracked),qn(`[MappedThread: ${this.name}] sub to new parent`,r.nameAndSizeUntracked);let o=this.onParentUpdate.bind(this,r),s=r.subscribe(o);this._parentSubscriptions.set(r,s)}for(let r of n)qn(`[MappedThread: ${this.name}] un-subscribing from old parent`,r.nameAndSizeUntracked),this._parentSubscriptions.get(r)(),this._parentSubscriptions.delete(r)})}subscribe(t){return this._parentSubscriptions||this.subscribeToParents(),super.subscribe(t)}triggerRemap(){if(!this._eventMapper)throw vl("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);ml(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&gl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Pe(()=>sn(t.applogs))})})}onParentUpdate(t,n){qn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,n);let r=this._eventMapper?this._eventMapper(n,t):n;if(this._eventMapper)if(qn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,r),un(r))this._applogs.replace([...r.init]);else{for(let i of r.added)this._applogs.splice(p0(this._applogs,i,"ts"),0,i);if(r.removed){for(let i of r.removed)if(!this._applogs.remove(i))if(!un(n)&&n.removed?.includes(i))ml("Ignoring remove event for non-existent because it was part of parent event's removed",i,n);else throw vl(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:n,mapResult:r})}}qn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Yr(this._applogs)),this.notifySubscribers(r)}get readOnly(){return!1}},{WARN:VS,LOG:KS,DEBUG:qS,VERBOSE:Fs,ERROR:wO}=$e.setup($e.INFO),In=Qe("rollingFilter",function(t,n,r={}){let i=TO(n),o=bl(i),s=Ce.array(Pe(function(){return o(t.applogs)}),{deep:!1,name:`${t.name} | ${r.name||`rollingFilter.array{${Hn(i)}}`}`}),a=g=>{let C;return un(g)?C={init:o(g.init)}:C={added:o(g.added),removed:g.removed},Fs(`rollingFilter{${t.nameAndSizeUntracked} | ${r.name?` '${r.name}'}`:""} parentUpdate`,i,g,"=>",C),C},l=new Na(`${t.name} | ${r.name||`rollingFilter{${Hn(i)}}`}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],s,a),c=Yu(()=>sn(n),g=>{Fs(`rollingFilter<${t.nameAndSizeUntracked}>${r.name?` '${r.name}'`:""} patternUpdate`,i,"=>",g),i=g,o=bl(i),l.triggerRemap()}),d=zn(s,()=>{Fs(`rollingFilter<${Pe(()=>t.name)}>${r.name?` '${r.name}'`:""} unobserve`,i),c(),d()});return l},{equals:Cr,argsDebugName:(e,t,n)=>Je({caller:"rollingFilter",thread:e,pattern:t,args:n})}),ed=Qe("rollingMapper",function(t,n,r={}){let i=Pe(()=>n.call(null,{init:t.applogs},t));if(!un(i))throw wO("Initial run must return init event");let o=i.init;return new Na(`${t.name} | ${r.name||"rollingMapper"}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],o,n)},{equals:Cr,argsDebugName:(e,t,n)=>Je({caller:"rollingMapper",thread:e,args:n})}),GS=Qe("rollingAcc",function(t,n,r,i={}){let o=at(r);return o({init:t.applogs},n),t.subscribe(s=>{o(s,n)}),n},{argsDebugName:(e,t,n,r)=>`rollingAcc{${e.nameAndSizeUntracked}${r?.name?` | ${r?.name}`:""}}`}),TO=function(t){let n=Pe(function(){return Object.fromEntries(Object.entries(sn(t)).map(([i,o])=>[sn(i),sn(o)]))});if(!Object.entries(n).length)throw new Error("Pattern is empty");return n};function bl(e){return function(n){return n.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(!pO(o,s,a))return!1}return!0})}}var{WARN:AO,LOG:OO,DEBUG:Ve,VERBOSE:td,ERROR:ro}=$e.setup($e.INFO),EO=class extends Er{constructor(e,t=[],n){super(e,null,n,t),bn(this,{})}purge(e){let t=this.applogs.length;return this._applogs=this.applogs.filter(n=>!e.includes(n.cid)),t-this.applogs.length}insert(e){Ve(`[WriteableThread.insert] ENTER - ${e.length} applogs for thread "${this.name}"`),Ve("[WriteableThread.insert] About to call ensureTsPvAndFinalizeApplogs");let t=yO(e,this);Ve(`[WriteableThread.insert] ensureTsPvAndFinalizeApplogs completed, mapped=${t.length} applogs`),Ve("[WriteableThread.insert] About to call insertRaw");let n=this.insertRaw(t);return Ve("[WriteableThread.insert] insertRaw completed"),n}insertMissing(e,t=!1){let n=e.filter(r=>!this.hasApplog(r,t));return n.length===0?(td("[insertMissing] no missing applogs"),[]):this.insertRaw(n)??[]}insertRaw(e){Ve(`[WriteableThread.insertRaw] ENTER - ${e.length} applogs for thread "${this.name}"`),Ve("[WriteableThread.insertRaw] About to deduplicate");let t=Jf(e,"safety");if(t.length!==e.length)throw ro(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});Ve("[WriteableThread.insertRaw] Deduplication done"),Ve("[WriteableThread.insertRaw] About to validate");let n=e.filter(o=>!Vf(o));if(n.length)throw ro(`[insertRaw] bogus applogs passed: ${n.length}`,{bogus:n});Ve("[WriteableThread.insertRaw] Validation done"),Ve("[WriteableThread.insertRaw] About to check for existing");let r=e.filter(o=>this.hasApplog(o,!1));if(r.length)throw ro(`[insertRaw] already existing applogs passed: ${r.length}`,{existing:r});if(Ve("[WriteableThread.insertRaw] Existing check done"),!e.length){AO("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof Ra)?OO:Ve)("Inserting:",e.length===1?e[0]:e,{ds:this}),Ve("[WriteableThread.insertRaw] About to sort applogs"),pi(e);let i=this._applogs.length&&uO(e[0],this._applogs[this._applogs.length-1]);return Ve("[WriteableThread.insertRaw] About to push to _applogs array"),this._applogs.push(...e),i&&(Ve("[WriteableThread.insertRaw] About to sort _applogs (sortNeeded=true)"),pi(this._applogs)),Ve("[WriteableThread.insertRaw] About to notify subscribers"),this.notifySubscribers({added:e,removed:null}),Ve("[WriteableThread.insertRaw] Subscribers notified"),Ve("[WriteableThread.insertRaw] About to call persist (void - not awaited)"),this.persist(e),Ve(`[WriteableThread.insertRaw] EXIT - returning ${e.length} applogs`),e}get readOnly(){return!1}},Ra=class io extends EO{constructor(t,n,r,i){super(t,n,r),this._readOnly=i,bn(this,{_applogs:Ce.shallow})}static empty(t){return io.fromArray([],t??"empty in-memory",!1)}static fromArray(t,n,r=!1){return new io(n??"in-memory",t,[],r)}static fromReadOnlyArray(t,n){return new io(n??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if(td("[InMem.persist] no persist for",t),this.readOnly)throw ro("[persist] called for readOnly thread")}},{WARN:WS,LOG:HS,DEBUG:JS,VERBOSE:XS,ERROR:YS}=$e.setup($e.INFO);var{WARN:M$,LOG:B$,DEBUG:D$,VERBOSE:L$,ERROR:k$}=$e.setup($e.INFO);function Pa(e){return Yf(e,31,7)}var SO=class{constructor(e,t,n=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=n,bn(this,{threadOfTrail:Le})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?ko([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},nd=class{constructor(e){this.nodes=e,bn(this,{threadOfAllTrails:Le,size:Le,isEmpty:Le})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Pe(()=>this.records.length)}get records(){return Yt(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return ko(Yt(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogSet(){return Yt(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogSet"})}get leafNodeLogs(){return Yt(()=>this.nodes.flatMap(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return ko(Yt(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:K$,LOG:jo,DEBUG:cn,VERBOSE:Te,ERROR:nr}=$e.setup($e.INFO,{prefix:"[q]"}),Ca=null,$O=Qe("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:n,tolerateAlreadyFiltered:r}={}){if(Te(`lastWriteWins${n?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(r)return cn("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw nr("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,o=ed(t,function(a,l){let c=un(a),d,g=[],C=c?null:[];c?(i=new Map,d=a.init):d=a.added;let I;for(let S=n?0:d.length-1;n?S<d.length:S>=0;n?S++:S--){let z=d[S],J=z.en+"|"+z.at;if(I&&(n?I>z.ts:I<z.ts))throw nr("lastWriteWins.mapper logs not sorted:",I,n?">":"<",z.ts,{log:z,i:S,newLogs:d,inverseToOnlyReturnFirstLogs:n});I=z.ts;let F=i.get(J);(!F||(n?F.ts>z.ts:F.ts<z.ts))&&(F&&!c&&C.push(F),g.push(z),i.set(J,z))}return pi(g),Te.isDisabled||Te(`lastWriteWins${n?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,c?{...Object.fromEntries(Object.entries(a).map(([S,z])=>[S,z?.length])),toAdd:g.length,toRemove:C}:{...a,toAdd:g,toRemove:C}),c?{init:g}:{added:g,removed:C}},{name:`lastWriteWins${n?".inversed":""}`,extraFilterName:"lastWriteWins"});return Te.isDisabled||St(()=>{Te(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,o.applogs.length)}),o},{equals:Cr,argsDebugName:e=>Je({caller:"lastWriteWins",thread:e})}),q$=Qe("withoutDeleted",function(t){if(Te.isEnabled&&Te(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw nr("thread already filtered withoutDeleted:",t.filters,{name:t.name});let n=In(t,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});Te.isEnabled&&Te(`withoutDeleted<${t.nameAndSizeUntracked}> deletionLogs:`,Pe(function(){return[...n.applogs]}));let r=Je({caller:"allDeletedEntities",thread:t}),i=pf(function(){return n.map(s=>s.en)},{name:r});return Te.isEnabled&&St(()=>{Te(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),In(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:Cr}),rd=Qe("query",function e(t,n,r={},i={}){BO();let o=id(t);cn(`query<${o.nameAndSizeUntracked}>:`,n);let s=Array.isArray(n)?n:[n],a;if(s.length===1)a=null;else{let d=s.slice(0,-1);a=e(o,d,r,i)}let l=s[s.length-1],c=NO(o,a,l,i);return Te.isDisabled||St(()=>Te("query result:",sn(c))),c},{equals:Co,argsDebugName:(e,t,n)=>Je({caller:"query",thread:e,args:n?{pattern:t,startVars:n}:t})}),NO=Qe("queryStep",function(t,n,r,i={}){if(cn(`queryStep<${t.nameAndSizeUntracked}> with`,n?.untrackedSize??"all","nodes, pattern:",r),!Object.entries(r).length)throw new Error("Pattern is empty");function o(a){let[l,c]=$a(r,a?.variables??{});Te("[queryStep.doQuery] patternWithoutVars: ",l);let d=In(t,l),g=Fo(c),C=Yt(function(){let S=d.map(z=>({log:z,vars:g(z)}));return Te.isEnabled&&Te("[queryStep.doQuery] step node:",a?.variables," =>",S,"from:",Pe(()=>d.applogs)),S.map(({log:z,vars:J})=>{let F=Object.assign({},a?.variables,J);return new SO(yf.fromArray([z],Je({caller:"QueryNode",thread:d,pattern:`${Hn(F)}@${Hn(l)}`})),F,a)})},{name:Je({caller:"doQuery.mapNodes",thread:d,pattern:r})});return Te.isEnabled&&St(()=>Te("[queryStep.doQuery] resultNodes:",[...C])),i.debug&&jo("[queryStep] step result:",Pe(()=>C.map(({variables:I,logsOfThisNode:S})=>({variables:I,thread:S})))),C}let s=Yt(function(){return cn(`[queryStep] Running with ${n?.nodes?.length} input nodes:`),n?[...n.nodes.flatMap(o)]:[...o(null)]},{name:Je({caller:"queryStep",thread:t,pattern:r})});return Te.isEnabled&&St(()=>Te("[queryStep] observableResultNodes:",[...s])),new nd(s)},{equals:Co,argsDebugName:(e,t,n)=>Je({caller:"queryStep",thread:e,pattern:n})}),G$=Qe("queryNot",function(t,n,r,i={}){let o=n.nodes;cn(`queryNot<${t.nameAndSizeUntracked}> from: ${o.length} nodes`);let s=Array.isArray(r)?r:[r];for(let a of s){if(!Object.entries(r).length)throw new Error("Pattern is empty");o=o.filter(function({variables:c}){let[d,g]=$a(a,c??{});Te("[queryNot] patternWithoutVars: ",d);let C=In(t,d);return Te("[queryNot] step node:",c," =>",C.size,"applogs"),Te.isDisabled||Te("[queryNot] step node:",c," => empty?",Pe(()=>C.applogs)),i.debug&&jo("[queryNot] node result:",c,"=>",C.applogs),C.isEmpty})}return new nd(o)},{equals:Co,argsDebugName:(e,t,n)=>Je({caller:"queryNot",thread:e,pattern:n})}),W$=Qe("filterAndMap",function(t,n,r){cn(`filterAndMap<${t.nameAndSizeUntracked}>`,n);let i=In(t,n);Te.isEnabled&&(Te("[filterAndMap] filtered:",i.untrackedSize),St(()=>Te("[filterAndMap] filtered:",i.applogs)));let o=Je({thread:t,pattern:n,caller:"filterAndMap"}),s=Yt(()=>CO(i,r),{name:o});return Te.isDisabled||St(()=>Te("[filterAndMap] mapped:",s)),s},{equals:ze.structural,argsDebugName:(e,t)=>Je({caller:"filterAndMap",thread:e,pattern:t})}),H$=Qe("queryAndMap",function(t,n,r,i={}){let o=id(t);cn(`queryAndMap<${o.nameAndSizeUntracked}>`,{patternOrPatterns:n,variables:i,map:r});let s=Je({thread:o,caller:"queryAndMap"}),a=rd(o,n);Te("[queryAndMap] filtered count:",a.untrackedSize);let l=Yt(()=>xO(a,r),{name:s});return Te.isDisabled||St(()=>Te("[queryAndMap] result:",sn(l))),l},{equals:ze.structural,argsDebugName:(e,t)=>Je({caller:"queryAndMap",thread:e,pattern:t})}),J$=Qe("queryEntity",function(t,n,r,i){cn(`queryEntity<${t.nameAndSizeUntracked}>`,r,n);let o=In(t,{en:r,at:UO(n,i)});return Te("queryEntity applogs:",o.applogs),Le(()=>o.isEmpty?null:Object.fromEntries(o.map(({at:s,vl:a})=>[s.slice(n.length+1),a])))},{equals:df,argsDebugName:(e,t,n)=>Je({caller:"queryEntity",thread:e,args:{name:t,entityID:n}})}),X$=Qe("agentsOfThread",function(t){cn(`agentsOfThread<${t.nameAndSizeUntracked}>`);let n=Ce.map(),r=at(o=>{for(let s of un(o)?o.init:o.added){let a=n.get(s.ag)??0;n.set(s.ag,a+1)}for(let s of!un(o)&&o.removed||[]){let a=n.get(s.ag);if(!a||a<1)throw nr("[agentsOfThread] number is now negative",{log:s,event:o,mapped:n,prev:a});n.set(s.ag,a-1)}jo(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:o,mapped:n})});r({init:t.applogs});let i=t.subscribe(r);return _r(n,i),n}),RO=Qe("entityOverlap",function(t,n){return jo(`entityOverlap<${t.nameAndSizeUntracked}, ${n.nameAndSizeUntracked}>`),Le(()=>{let r=new Set(t.map(o=>o.en)),i=new Set(n.map(o=>o.en));return[...r].filter(o=>i.has(o))})});var Y$=Qe("entityOverlapCount",function(t,n){return Le(()=>RO(t,n).get().length)}),PO=Qe("querySingle",function(t,n,r={}){let i=rd(t,n,r);return Le(()=>{if(i.isEmpty)return null;if(i.size>1)throw nr("[querySingle] got",i.size,"results:",i);let o=i.nodes[0].logsOfThisNode;if(o.size!=1)throw nr("[querySingle] single result, but got",o.size,"logs:",o.applogs);return o.applogs[0]})},{equals:ze.structural,argsDebugName:(e,t)=>Je({caller:"querySingle",thread:e,pattern:t})}),Q$=Qe("querySingleAndMap",function(t,n,r,i={}){let o=PO(t,n,i);return Le(()=>{let s=o.get();if(s)return typeof r=="string"?s[r]:Fo(r)(s)})},{equals:ze.structural,argsDebugName:(e,t)=>Je({caller:"querySingleAndMap",thread:e,pattern:t})}),CO=function(t,n){return typeof n=="function"?t.map(n):typeof n=="string"?t.map(r=>r[n]):t.map(Fo(n))},xO=function(t,n){return typeof n=="function"?t.records.map(n):typeof n=="string"?t.nodes.map(r=>{if(!Object.hasOwn(r.record,n)){if(r.logsOfThisNode.size!==1)throw nr(`not sure what to map (it's not a var and a result node log count of ${r.logsOfThisNode.size})`);return r.logsOfThisNode.firstLog[n]}return r.record[n]}):t.nodes.map(r=>Fo(n)(t))};function Fo(e){return t=>Object.entries(e).reduce((n,[r,i])=>(n[i]=t[r],n),{})}function UO(e,t){return t.map(n=>MO(e,n))}function MO(e,t){return`${e}/${t}`}function id(e,t){return Array.isArray(e)?Ra.fromArray(e,t||`threadFromArray[${e.length}]`,!0):e}function BO(){if(Ca!=null&&performance.now()>=Ca)throw new DO(Ca)}var DO=class extends Error{constructor(e){super(e)}};var LO=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=s;var n=128,r=127,i=~r,o=Math.pow(2,31);function s(a,l,c){if(Number.MAX_SAFE_INTEGER&&a>Number.MAX_SAFE_INTEGER)throw s.bytes=0,new RangeError("Could not encode varint");l=l||[],c=c||0;for(var d=c;a>=o;)l[c++]=a&255|n,a/=128;for(;a&i;)l[c++]=a&255|n,a>>>=7;return l[c]=a|0,s.bytes=c-d+1,l}}}),kO=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){"use strict";t.exports=i;var n=128,r=127;function i(o,l){var a=0,l=l||0,c=0,d=l,g,C=o.length;do{if(d>=C||c>49)throw i.bytes=0,new RangeError("Could not decode varint");g=o[d++],a+=c<28?(g&r)<<c:(g&r)*Math.pow(2,c),c+=7}while(g>=n);return i.bytes=d-l,a}}}),jO=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){"use strict";var n=Math.pow(2,7),r=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),s=Math.pow(2,35),a=Math.pow(2,42),l=Math.pow(2,49),c=Math.pow(2,56),d=Math.pow(2,63);t.exports=function(g){return g<n?1:g<r?2:g<i?3:g<o?4:g<s?5:g<a?6:g<l?7:g<c?8:g<d?9:10}}}),La=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:LO(),decode:kO(),encodingLength:jO()}}}),FO=["Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function zO(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(t==="string"||t==="number"||t==="bigint"||t==="symbol")return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(e instanceof Uint8Array)return"Uint8Array";if(e.constructor===Object)return"Object";let n=VO(e);return n||"Object"}function VO(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(FO.includes(t))return t}var V=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}static equals(e,t){return e===t||e.major===t.major&&e.name===t.name}};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 pe=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},wi=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",KO=new TextEncoder;function Ko(e){return wi&&globalThis.Buffer.isBuffer(e)}function yd(e){return e instanceof Uint8Array?Ko(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var qO=24,GO=200,WO=wi?e=>e.length>=qO?globalThis.Buffer.from(e):od(e):e=>e.length>=GO?KO.encode(e):od(e),ln=e=>Uint8Array.from(e),HO=wi?(e,t,n)=>Ko(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n):(e,t,n)=>e.slice(t,n),JO=wi?(e,t)=>(e=e.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),yd(globalThis.Buffer.concat(e,t))):(e,t)=>{let n=new Uint8Array(t),r=0;for(let i of e)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n},XO=wi?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function gd(e,t){if(Ko(e)&&Ko(t))return e.compare(t);for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return 0}function od(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(i>=55296&&i<=57343&&(i=65533),t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}var YO=256,md=class{constructor(e=YO){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 r=t.length-(this.maxCursor-this.cursor)-1;t.set(e,r)}else{if(t){let r=t.length-(this.maxCursor-this.cursor)-1;r<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,r),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=XO(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 n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=HO(n,0,this.cursor)}else t=JO(this.chunks,this.cursor);return e&&this.reset(),t}},QO=class{constructor(e){this.dest=e,this.cursor=0,this.chunks=[e]}reset(){this.cursor=0}push(e){if(this.cursor+e.length>this.dest.length)throw new Error("write out of bounds, destination buffer is too small");this.dest.set(e,this.cursor),this.cursor+=e.length}toBytes(e=!1){let t=this.dest.subarray(0,this.cursor);return e&&this.reset(),t}},Be="CBOR decode error:",vd="CBOR encode error:",Ti=[];Ti[23]=1;Ti[24]=2;Ti[25]=3;Ti[26]=5;Ti[27]=9;function Dr(e,t,n){if(e.length-t<n)throw new Error(`${Be} not enough data for type`)}var Ze=[24,256,65536,4294967296,BigInt("18446744073709551616")];function rr(e,t,n){Dr(e,t,1);let r=e[t];if(n.strict===!0&&r<Ze[0])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);return r}function ir(e,t,n){Dr(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<Ze[1])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);return r}function or(e,t,n){Dr(e,t,4);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(n.strict===!0&&r<Ze[2])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);return r}function sr(e,t,n){Dr(e,t,8);let r=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(r)<<BigInt(32))+BigInt(i);if(n.strict===!0&&o<Ze[3])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(n.allowBigInt===!0)return o;throw new Error(`${Be} integers outside of the safe integer range are not supported`)}function ZO(e,t,n,r){return new pe(V.uint,rr(e,t+1,r),2)}function eE(e,t,n,r){return new pe(V.uint,ir(e,t+1,r),3)}function tE(e,t,n,r){return new pe(V.uint,or(e,t+1,r),5)}function nE(e,t,n,r){return new pe(V.uint,sr(e,t+1,r),9)}function ar(e,t){return Ct(e,0,t.value)}function Ct(e,t,n){if(n<Ze[0]){let r=Number(n);e.push([t|r])}else if(n<Ze[1]){let r=Number(n);e.push([t|24,r])}else if(n<Ze[2]){let r=Number(n);e.push([t|25,r>>>8,r&255])}else if(n<Ze[3]){let r=Number(n);e.push([t|26,r>>>24&255,r>>>16&255,r>>>8&255,r&255])}else{let r=BigInt(n);if(r<Ze[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(r&BigInt(4294967295)),s=Number(r>>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(`${Be} encountered BigInt larger than allowable range`)}}ar.encodedSize=function(t){return Ct.encodedSize(t.value)};Ct.encodedSize=function(t){return t<Ze[0]?1:t<Ze[1]?2:t<Ze[2]?3:t<Ze[3]?5:9};ar.compareTokens=function(t,n){return t.value<n.value?-1:t.value>n.value?1:0};function rE(e,t,n,r){return new pe(V.negint,-1-rr(e,t+1,r),2)}function iE(e,t,n,r){return new pe(V.negint,-1-ir(e,t+1,r),3)}function oE(e,t,n,r){return new pe(V.negint,-1-or(e,t+1,r),5)}var ka=BigInt(-1),bd=BigInt(1);function sE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new pe(V.negint,o,9)}if(r.allowBigInt!==!0)throw new Error(`${Be} integers outside of the safe integer range are not supported`);return new pe(V.negint,ka-BigInt(i),9)}function ja(e,t){let n=t.value,r=typeof n=="bigint"?n*ka-bd:n*-1-1;Ct(e,t.type.majorEncoded,r)}ja.encodedSize=function(t){let n=t.value,r=typeof n=="bigint"?n*ka-bd:n*-1-1;return r<Ze[0]?1:r<Ze[1]?2:r<Ze[2]?3:r<Ze[3]?5:9};ja.compareTokens=function(t,n){return t.value<n.value?1:t.value>n.value?-1:0};function Ai(e,t,n,r){Dr(e,t,n+r);let i=e.slice(t+n,t+n+r);return new pe(V.bytes,i,n+r)}function aE(e,t,n,r){return Ai(e,t,1,n)}function uE(e,t,n,r){return Ai(e,t,2,rr(e,t+1,r))}function cE(e,t,n,r){return Ai(e,t,3,ir(e,t+1,r))}function lE(e,t,n,r){return Ai(e,t,5,or(e,t+1,r))}function fE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer bytes lengths not supported`);return Ai(e,t,9,i)}function qo(e){return e.encodedBytes===void 0&&(e.encodedBytes=V.equals(e.type,V.string)?WO(e.value):e.value),e.encodedBytes}function Jo(e,t){let n=qo(t);Ct(e,t.type.majorEncoded,n.length),e.push(n)}Jo.encodedSize=function(t){let n=qo(t);return Ct.encodedSize(n.length)+n.length};Jo.compareTokens=function(t,n){return dE(qo(t),qo(n))};function dE(e,t){return e.length<t.length?-1:e.length>t.length?1:gd(e,t)}var sd=new TextDecoder,pE=32;function hE(e,t,n){if(n-t<pE){let i="";for(let o=t;o<n;o++){let s=e[o];if(s&128)return sd.decode(e.subarray(t,n));i+=String.fromCharCode(s)}return i}return sd.decode(e.subarray(t,n))}function Oi(e,t,n,r,i){let o=n+r;Dr(e,t,o);let s=new pe(V.string,hE(e,t+n,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=e.slice(t+n,t+o)),s}function yE(e,t,n,r){return Oi(e,t,1,n,r)}function gE(e,t,n,r){return Oi(e,t,2,rr(e,t+1,r),r)}function mE(e,t,n,r){return Oi(e,t,3,ir(e,t+1,r),r)}function vE(e,t,n,r){return Oi(e,t,5,or(e,t+1,r),r)}function bE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer string lengths not supported`);return Oi(e,t,9,i,r)}var _E=Jo;function Lr(e,t,n,r){return new pe(V.array,r,n)}function wE(e,t,n,r){return Lr(e,t,1,n)}function TE(e,t,n,r){return Lr(e,t,2,rr(e,t+1,r))}function AE(e,t,n,r){return Lr(e,t,3,ir(e,t+1,r))}function OE(e,t,n,r){return Lr(e,t,5,or(e,t+1,r))}function EE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer array lengths not supported`);return Lr(e,t,9,i)}function IE(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${Be} indefinite length items not allowed`);return Lr(e,t,1,1/0)}function Fa(e,t){Ct(e,V.array.majorEncoded,t.value)}Fa.compareTokens=ar.compareTokens;Fa.encodedSize=function(t){return Ct.encodedSize(t.value)};function kr(e,t,n,r){return new pe(V.map,r,n)}function SE(e,t,n,r){return kr(e,t,1,n)}function $E(e,t,n,r){return kr(e,t,2,rr(e,t+1,r))}function NE(e,t,n,r){return kr(e,t,3,ir(e,t+1,r))}function RE(e,t,n,r){return kr(e,t,5,or(e,t+1,r))}function PE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer map lengths not supported`);return kr(e,t,9,i)}function CE(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${Be} indefinite length items not allowed`);return kr(e,t,1,1/0)}function za(e,t){Ct(e,V.map.majorEncoded,t.value)}za.compareTokens=ar.compareTokens;za.encodedSize=function(t){return Ct.encodedSize(t.value)};function xE(e,t,n,r){return new pe(V.tag,n,1)}function UE(e,t,n,r){return new pe(V.tag,rr(e,t+1,r),2)}function ME(e,t,n,r){return new pe(V.tag,ir(e,t+1,r),3)}function BE(e,t,n,r){return new pe(V.tag,or(e,t+1,r),5)}function DE(e,t,n,r){return new pe(V.tag,sr(e,t+1,r),9)}function Va(e,t){Ct(e,V.tag.majorEncoded,t.value)}Va.compareTokens=ar.compareTokens;Va.encodedSize=function(t){return Ct.encodedSize(t.value)};var _d=20,wd=21,Td=22,Ad=23;function LE(e,t,n,r){if(r.allowUndefined===!1)throw new Error(`${Be} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new pe(V.null,null,1):new pe(V.undefined,void 0,1)}function kE(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${Be} indefinite length items not allowed`);return new pe(V.break,void 0,1)}function Ka(e,t,n){if(n){if(n.allowNaN===!1&&Number.isNaN(e))throw new Error(`${Be} NaN values are not supported`);if(n.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${Be} Infinity values are not supported`)}return new pe(V.float,e,t)}function jE(e,t,n,r){return Ka(Ga(e,t+1),3,r)}function FE(e,t,n,r){return Ka(Wa(e,t+1),5,r)}function zE(e,t,n,r){return Ka(Sd(e,t+1),9,r)}function qa(e,t,n){let r=t.value;if(r===!1)e.push([V.float.majorEncoded|_d]);else if(r===!0)e.push([V.float.majorEncoded|wd]);else if(r===null)e.push([V.float.majorEncoded|Td]);else if(r===void 0)e.push([V.float.majorEncoded|Ad]);else{let i,o=!1;(!n||n.float64!==!0)&&(Ed(r),i=Ga(Kt,1),r===i||Number.isNaN(r)?(Kt[0]=249,e.push(Kt.slice(0,3)),o=!0):(Id(r),i=Wa(Kt,1),r===i&&(Kt[0]=250,e.push(Kt.slice(0,5)),o=!0))),o||(VE(r),i=Sd(Kt,1),Kt[0]=251,e.push(Kt.slice(0,9)))}}qa.encodedSize=function(t,n){let r=t.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){Ed(r);let i=Ga(Kt,1);if(r===i||Number.isNaN(r))return 3;if(Id(r),i=Wa(Kt,1),r===i)return 5}return 9};var Od=new ArrayBuffer(9),Pt=new DataView(Od,1),Kt=new Uint8Array(Od,0);function Ed(e){if(e===1/0)Pt.setUint16(0,31744,!1);else if(e===-1/0)Pt.setUint16(0,64512,!1);else if(Number.isNaN(e))Pt.setUint16(0,32256,!1);else{Pt.setFloat32(0,e);let t=Pt.getUint32(0),n=(t&2139095040)>>23,r=t&8388607;if(n===255)Pt.setUint16(0,31744,!1);else if(n===0)Pt.setUint16(0,(e&2147483648)>>16|r>>13,!1);else{let i=n-127;i<-24?Pt.setUint16(0,0):i<-14?Pt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):Pt.setUint16(0,(t&2147483648)>>16|i+15<<10|r>>13,!1)}}}function Ga(e,t){if(e.length-t<2)throw new Error(`${Be} not enough data for float16`);let n=(e[t]<<8)+e[t+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;let r=n>>10&31,i=n&1023,o;return r===0?o=i*2**-24:r!==31?o=(i+1024)*2**(r-25):o=i===0?1/0:NaN,n&32768?-o:o}function Id(e){Pt.setFloat32(0,e,!1)}function Wa(e,t){if(e.length-t<4)throw new Error(`${Be} not enough data for float32`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,4).getFloat32(0,!1)}function VE(e){Pt.setFloat64(0,e,!1)}function Sd(e,t){if(e.length-t<8)throw new Error(`${Be} not enough data for float64`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,8).getFloat64(0,!1)}qa.compareTokens=ar.compareTokens;function Ie(e,t,n){throw new Error(`${Be} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function Xo(e){return()=>{throw new Error(`${Be} ${e}`)}}var ue=[];for(let e=0;e<=23;e++)ue[e]=Ie;ue[24]=ZO;ue[25]=eE;ue[26]=tE;ue[27]=nE;ue[28]=Ie;ue[29]=Ie;ue[30]=Ie;ue[31]=Ie;for(let e=32;e<=55;e++)ue[e]=Ie;ue[56]=rE;ue[57]=iE;ue[58]=oE;ue[59]=sE;ue[60]=Ie;ue[61]=Ie;ue[62]=Ie;ue[63]=Ie;for(let e=64;e<=87;e++)ue[e]=aE;ue[88]=uE;ue[89]=cE;ue[90]=lE;ue[91]=fE;ue[92]=Ie;ue[93]=Ie;ue[94]=Ie;ue[95]=Xo("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ue[e]=yE;ue[120]=gE;ue[121]=mE;ue[122]=vE;ue[123]=bE;ue[124]=Ie;ue[125]=Ie;ue[126]=Ie;ue[127]=Xo("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ue[e]=wE;ue[152]=TE;ue[153]=AE;ue[154]=OE;ue[155]=EE;ue[156]=Ie;ue[157]=Ie;ue[158]=Ie;ue[159]=IE;for(let e=160;e<=183;e++)ue[e]=SE;ue[184]=$E;ue[185]=NE;ue[186]=RE;ue[187]=PE;ue[188]=Ie;ue[189]=Ie;ue[190]=Ie;ue[191]=CE;for(let e=192;e<=215;e++)ue[e]=xE;ue[216]=UE;ue[217]=ME;ue[218]=BE;ue[219]=DE;ue[220]=Ie;ue[221]=Ie;ue[222]=Ie;ue[223]=Ie;for(let e=224;e<=243;e++)ue[e]=Xo("simple values are not supported");ue[244]=Ie;ue[245]=Ie;ue[246]=Ie;ue[247]=LE;ue[248]=Xo("simple values are not supported");ue[249]=jE;ue[250]=FE;ue[251]=zE;ue[252]=Ie;ue[253]=Ie;ue[254]=Ie;ue[255]=kE;var fn=[];for(let e=0;e<24;e++)fn[e]=new pe(V.uint,e,1);for(let e=-1;e>=-24;e--)fn[31-e]=new pe(V.negint,e,1);fn[64]=new pe(V.bytes,new Uint8Array(0),1);fn[96]=new pe(V.string,"",1);fn[128]=new pe(V.array,0,1);fn[160]=new pe(V.map,0,1);fn[244]=new pe(V.false,!1,1);fn[245]=new pe(V.true,!0,1);fn[246]=new pe(V.null,null,1);function KE(e){switch(e.type){case V.false:return ln([244]);case V.true:return ln([245]);case V.null:return ln([246]);case V.bytes:return e.value.length?void 0:ln([64]);case V.string:return e.value===""?ln([96]):void 0;case V.array:return e.value===0?ln([128]):void 0;case V.map:return e.value===0?ln([160]):void 0;case V.uint:return e.value<24?ln([Number(e.value)]):void 0;case V.negint:if(e.value>=-24)return ln([31-Number(e.value)])}}var qE=Object.freeze({float64:!0,mapSorter:JE,quickEncodeToken:KE});function $d(){let e=[];return e[V.uint.major]=ar,e[V.negint.major]=ja,e[V.bytes.major]=Jo,e[V.string.major]=_E,e[V.array.major]=Fa,e[V.map.major]=za,e[V.tag.major]=Va,e[V.float.major]=qa,e}var GE=$d(),WE=new md,ad=class Nd{constructor(t,n){this.obj=t,this.parent=n}includes(t){let n=this;do if(n.obj===t)return!0;while(n=n.parent);return!1}static createCheck(t,n){if(t&&t.includes(n))throw new Error(`${vd} object contains circular references`);return new Nd(n,t)}},Sn={null:new pe(V.null,null),undefined:new pe(V.undefined,void 0),true:new pe(V.true,!0),false:new pe(V.false,!1),emptyArray:new pe(V.array,0),emptyMap:new pe(V.map,0)},Rn={number(e,t,n,r){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new pe(V.float,e):e>=0?new pe(V.uint,e):new pe(V.negint,e)},bigint(e,t,n,r){return e>=BigInt(0)?new pe(V.uint,e):new pe(V.negint,e)},Uint8Array(e,t,n,r){return new pe(V.bytes,e)},string(e,t,n,r){return new pe(V.string,e)},boolean(e,t,n,r){return e?Sn.true:Sn.false},null(e,t,n,r){return Sn.null},undefined(e,t,n,r){return Sn.undefined},ArrayBuffer(e,t,n,r){return new pe(V.bytes,new Uint8Array(e))},DataView(e,t,n,r){return new pe(V.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,n,r){if(!e.length)return n.addBreakTokens===!0?[Sn.emptyArray,new pe(V.break)]:Sn.emptyArray;r=ad.createCheck(r,e);let i=[],o=0;for(let s of e)i[o++]=zo(s,n,r);return n.addBreakTokens?[new pe(V.array,e.length),i,new pe(V.break)]:[new pe(V.array,e.length),i]},Object(e,t,n,r){let i=t!=="Object",o=i?e.keys():Object.keys(e),s=i?e.size:o.length,a;if(s){a=new Array(s),r=ad.createCheck(r,e);let l=!i&&n.ignoreUndefinedProperties,c=0;for(let d of o){let g=i?e.get(d):e[d];l&&g===void 0||(a[c++]=[zo(d,n,r),zo(g,n,r)])}c<s&&(a.length=c)}return a?.length?(HE(a,n),n.addBreakTokens?[new pe(V.map,a.length),a,new pe(V.break)]:[new pe(V.map,a.length),a]):n.addBreakTokens===!0?[Sn.emptyMap,new pe(V.break)]:Sn.emptyMap}};Rn.Map=Rn.Object;Rn.Buffer=Rn.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Rn[`${e}Array`]=Rn.DataView;function zo(e,t={},n){let r=zO(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||Rn[r];if(typeof i=="function"){let s=i(e,r,t,n);if(s!=null)return s}let o=Rn[r];if(!o)throw new Error(`${vd} unsupported type: ${r}`);return o(e,r,t,n)}function HE(e,t){t.mapSorter&&e.sort(t.mapSorter)}function JE(e,t){if(e[0]instanceof pe&&t[0]instanceof pe){let n=e[0],r=t[0];return n._keyBytes||(n._keyBytes=ud(n.value)),r._keyBytes||(r._keyBytes=ud(r.value)),gd(n._keyBytes,r._keyBytes)}throw new Error("rfc8949MapSorter: complex key types are not supported yet")}function ud(e){return XE(e,GE,qE)}function Rd(e,t,n,r){if(Array.isArray(t))for(let i of t)Rd(e,i,n,r);else n[t.type.major](e,t,r)}var fN=V.uint.majorEncoded,dN=V.negint.majorEncoded,pN=V.bytes.majorEncoded,hN=V.string.majorEncoded,yN=V.array.majorEncoded,gN=V.float.majorEncoded|_d,mN=V.float.majorEncoded|wd,vN=V.float.majorEncoded|Td,bN=V.float.majorEncoded|Ad,_N=BigInt(-1),wN=BigInt(1);function XE(e,t,n,r){let i=r instanceof Uint8Array,o=i?new QO(r):WE,s=zo(e,n);if(!Array.isArray(s)&&n.quickEncodeToken){let a=n.quickEncodeToken(s);if(a)return i?(o.push(a),o.toBytes()):a;let l=t[s.type.major];if(l.encodedSize){let c=l.encodedSize(s,n);if(i||(o=new md(c)),l(o,s,n),o.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${s} was wrong`);return i?o.toBytes():yd(o.chunks[0])}}return o.reset(),Rd(o,s,t,n),o.toBytes(!0)}var TN=Symbol.for("DONE"),AN=Symbol.for("BREAK");var ON=new Uint8Array(0);function YE(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function Ha(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 QE(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(n[s]!==255)throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function g(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var z=0,J=0,F=0,k=S.length;F!==k&&S[F]===0;)F++,z++;for(var K=(k-F)*d+1>>>0,W=new Uint8Array(K);F!==k;){for(var j=S[F],Z=0,G=K-1;(j!==0||Z<J)&&G!==-1;G--,Z++)j+=256*W[G]>>>0,W[G]=j%a>>>0,j=j/a>>>0;if(j!==0)throw new Error("Non-zero carry");J=Z,F++}for(var fe=K-J;fe!==K&&W[fe]===0;)fe++;for(var x=l.repeat(z);fe<K;++fe)x+=e.charAt(W[fe]);return x}function C(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var z=0;if(S[z]!==" "){for(var J=0,F=0;S[z]===l;)J++,z++;for(var k=(S.length-z)*c+1>>>0,K=new Uint8Array(k);S[z];){var W=n[S.charCodeAt(z)];if(W===255)return;for(var j=0,Z=k-1;(W!==0||j<F)&&Z!==-1;Z--,j++)W+=a*K[Z]>>>0,K[Z]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");F=j,z++}if(S[z]!==" "){for(var G=k-F;G!==k&&K[G]===0;)G++;for(var fe=new Uint8Array(J+(k-G)),x=J;G!==k;)fe[x++]=K[G++];return fe}}}function I(S){var z=C(S);if(z)return z;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:C,decode:I}}var ZE=QE,eI=ZE,tI=eI,nI=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},rI=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let r=t.codePointAt(0);if(r===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r,this.baseDecode=n}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 Pd(this,e)}},iI=class{decoders;constructor(e){this.decoders=e}or(e){return Pd(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Pd(e,t){return new iI({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var oI=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new nI(e,t,n),this.decoder=new rI(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Cd({name:e,prefix:t,encode:n,decode:r}){return new oI(e,t,n,r)}function Yo({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=tI(n,e);return Cd({prefix:t,name:e,encode:r,decode:o=>Ha(i(o))})}function sI(e,t,n,r){let i=e.length;for(;e[i-1]==="=";)--i;let o=new Uint8Array(i*n/8|0),s=0,a=0,l=0;for(let c=0;c<i;++c){let d=t[e[c]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);a=a<<n|d,s+=n,s>=8&&(s-=8,o[l++]=255&a>>s)}if(s>=n||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o}function aI(e,t,n){let r=t[t.length-1]==="=",i=(1<<n)-1,o="",s=0,a=0;for(let l=0;l<e.length;++l)for(a=a<<8|e[l],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s!==0&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o}function uI(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function dn({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=uI(r);return Cd({prefix:t,name:e,encode(o){return aI(o,r,n)},decode(o){return sI(o,i,n,e)}})}var Vo=dn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),EN=dn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),IN=dn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),SN=dn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),$N=dn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),NN=dn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),RN=dn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),PN=dn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),CN=dn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),xa=Yo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),xN=Yo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),$n=Yo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),UN=Yo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),cI=xd,cd=128,lI=127,fI=~lI,dI=Math.pow(2,31);function xd(e,t,n){t=t||[],n=n||0;for(var r=n;e>=dI;)t[n++]=e&255|cd,e/=128;for(;e&fI;)t[n++]=e&255|cd,e>>>=7;return t[n]=e|0,xd.bytes=n-r+1,t}var pI=Ua,hI=128,ld=127;function Ua(e,r){var n=0,r=r||0,i=0,o=r,s,a=e.length;do{if(o>=a)throw Ua.bytes=0,new RangeError("Could not decode varint");s=e[o++],n+=i<28?(s&ld)<<i:(s&ld)*Math.pow(2,i),i+=7}while(s>=hI);return Ua.bytes=o-r,n}var yI=Math.pow(2,7),gI=Math.pow(2,14),mI=Math.pow(2,21),vI=Math.pow(2,28),bI=Math.pow(2,35),_I=Math.pow(2,42),wI=Math.pow(2,49),TI=Math.pow(2,56),AI=Math.pow(2,63),OI=function(e){return e<yI?1:e<gI?2:e<mI?3:e<vI?4:e<bI?5:e<_I?6:e<wI?7:e<TI?8:e<AI?9:10},EI={encode:cI,decode:pI,encodingLength:OI},II=EI,Go=II;function Ma(e,t=0){return[Go.decode(e,t),Go.decode.bytes]}function Wo(e,t,n=0){return Go.encode(e,t,n),t}function Ho(e){return Go.encodingLength(e)}function SI(e,t){let n=t.byteLength,r=Ho(e),i=r+Ho(n),o=new Uint8Array(i+n);return Wo(e,o,0),Wo(n,o,r),o.set(t,i),new Ja(e,n,t,o)}function $I(e){let t=Ha(e),[n,r]=Ma(t),[i,o]=Ma(t.subarray(r)),s=t.subarray(r+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Ja(n,i,s,t)}function NI(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&YE(e.bytes,n.bytes)}}var Ja=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};function fd(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return PI(n,Ba(e),t??$n.encoder);default:return CI(n,Ba(e),t??Vo.encoder)}}var dd=new WeakMap;function Ba(e){let t=dd.get(e);if(t==null){let n=new Map;return dd.set(e,n),n}return t}var Ud=class nt{code;version;multihash;bytes;"/";constructor(t,n,r,i){this.code=n,this.version=t,this.multihash=r,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:n}=this;if(t!==vi)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==xI)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return nt.createV0(n)}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:n}=this.multihash,r=SI(t,n);return nt.createV1(this.code,r)}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 nt.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&NI(t.multihash,r.multihash)}toString(t){return fd(this,t)}toJSON(){return{"/":fd(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 n=t;if(n instanceof nt)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:o,bytes:s}=n;return new nt(r,i,o,s??pd(r,i,o.bytes))}else if(n[UI]===!0){let{version:r,multihash:i,code:o}=n,s=$I(i);return nt.create(r,o,s)}else return null}static create(t,n,r){if(typeof n!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(n!==vi)throw new Error(`Version 0 CID must use dag-pb (code: ${vi}) block encoding`);return new nt(t,n,r,r.bytes)}case 1:{let i=pd(t,n,r.bytes);return new nt(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return nt.create(0,vi,t)}static createV1(t,n){return nt.create(1,t,n)}static decode(t){let[n,r]=nt.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=nt.inspectBytes(t),r=n.size-n.multihashSize,i=Ha(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw new Error("Incorrect length");let o=i.subarray(n.multihashSize-n.digestSize),s=new Ja(n.multihashCode,n.digestSize,o,i);return[n.version===0?nt.createV0(s):nt.createV1(n.codec,s),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[g,C]=Ma(t.subarray(n));return n+=C,g},i=r(),o=vi;if(i===18?(i=0,n=0):o=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=n,a=r(),l=r(),c=n+l,d=c-s;return{version:i,codec:o,multihashCode:a,digestSize:l,multihashSize:d,size:c}}static parse(t,n){let[r,i]=RI(t,n),o=nt.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ba(o).set(r,t),o}};function RI(e,t){switch(e[0]){case"Q":{let n=t??$n;return[$n.prefix,n.decode(`${$n.prefix}${e}`)]}case $n.prefix:{let n=t??$n;return[$n.prefix,n.decode(e)]}case Vo.prefix:{let n=t??Vo;return[Vo.prefix,n.decode(e)]}case xa.prefix:{let n=t??xa;return[xa.prefix,n.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 PI(e,t,n){let{prefix:r}=n;if(r!==$n.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let o=n.encode(e).slice(1);return t.set(r,o),o}else return i}function CI(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let o=n.encode(e);return t.set(r,o),o}else return i}var vi=112,xI=18;function pd(e,t,n){let r=Ho(e),i=r+Ho(t),o=new Uint8Array(i+n.byteLength);return Wo(e,o,0),Wo(t,o,r),o.set(n,i),o}var UI=Symbol.for("@ipld/js-cid/CID"),Md=42;function MI(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Ud.asCID(e);if(!t)return null;let n=new Uint8Array(t.bytes.byteLength+1);return n.set(t.bytes,1),[new pe(V.tag,Md),new pe(V.bytes,n)]}function BI(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function DI(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 LI(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 hd={float64:!0,typeEncoders:{Map:LI,Object:MI,undefined:BI,number:DI}},MN={...hd,typeEncoders:{...hd.typeEncoders}};function kI(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ud.decode(e.subarray(1))}var Da={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Da.tags[Md]=kI;var BN={...Da,tags:Da.tags.slice()};var DN=mt(La(),1);var Nn={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)":Nn.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Nn.List(e)!==void 0){for(let t=0;t<e.length;t++){let n=e[t];if(n=bi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](n),n===void 0)return;if(n!==e[t]){let r=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;r.push(o)}return r}}return e}},Int:Nn.Int,CarV1HeaderOrV2Pragma:e=>{if(Nn.Map(e)===void 0)return;let t=Object.entries(e),n=e,r=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||n!==e){if(n===e){n={};for(let l=0;l<i;l++)n[t[l][0]]=t[l][1]}n.roots=a}}break;case"version":{r--;let a=bi.Int(e[o]);if(a===void 0)return;if(a!==s||n!==e){if(n===e){n={};for(let l=0;l<i;l++)n[t[l][0]]=t[l][1]}n.version=a}}break;default:return}}if(!(r>0))return n}},_i={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Nn.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Nn.List(e)!==void 0){for(let t=0;t<e.length;t++){let n=e[t];if(n=_i["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](n),n===void 0)return;if(n!==e[t]){let r=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=_i["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;r.push(o)}return r}}return e}},Int:Nn.Int,CarV1HeaderOrV2Pragma:e=>{if(Nn.Map(e)===void 0)return;let t=Object.entries(e),n=e,r=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=_i["CarV1HeaderOrV2Pragma > roots (anon)"](s);if(a===void 0)return;if(a!==s||n!==e){if(n===e){n={};for(let l=0;l<i;l++)n[t[l][0]]=t[l][1]}n.roots=a}}break;case"version":{r--;let a=_i.Int(s);if(a===void 0)return;if(a!==s||n!==e){if(n===e){n={};for(let l=0;l<i;l++)n[t[l][0]]=t[l][1]}n.version=a}}break;default:return}}if(!(r>0))return n}},LN={toTyped:bi.CarV1HeaderOrV2Pragma,toRepresentation:_i.CarV1HeaderOrV2Pragma},kN=$d(),jN=mt(La(),1),FN=[new pe(V.map,2),new pe(V.string,"version"),new pe(V.uint,1),new pe(V.string,"roots")],zN=new pe(V.tag,42);var VN=mt(La(),1);var{WARN:KN,LOG:qN,DEBUG:GN,VERBOSE:WN,ERROR:HN}=$e.setup($e.INFO);var{WARN:JN,LOG:XN,DEBUG:YN,VERBOSE:QN,ERROR:ZN}=$e.setup($e.INFO);var Xa=class{app;username;devicename;signer},Bd=class extends Xa{constructor(t){super(),Object.assign(this,t)}get did(){return this.signer.did}async sign(t){return await this.signer.sign(t)}get ag(){return Pa(this.agentString)}get shortDID(){return this.did?.slice(-8)}get agentString(){return`${this.username}.${this.shortDID}@${this.app}.${this.devicename}`}};export{Bd as BaseAgent};
61
+ `+" ".repeat(t)+o):o==="{"&&r>0?(r++,n+=o):(o==="}"&&r>1&&r--,n+=o)}return n}function _0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]instanceof Er){if(t[n]!==e[n])return!1}else if(!ze.structural(e[n],t[n]))return!1;return!0}var{WARN:Zc,LOG:gS,DEBUG:w0,VERBOSE:mS,ERROR:Kn}=$e.setup($e.INFO,{prefix:"[thread]"});function un(e){return e.init!==void 0}var Er=class{constructor(e,t,n,r=[],i={}){this.name=e,this._applogs=r,this.parents=t===null?null:tu(t),this.filters=n,Pe(()=>this.parents?.length===0)&&Zc("[Thread] empty parents array",e),i.skipObservable||bn(this,{applogsCids:Le,applogsByCid:Le,insert:at,size:Le,isEmpty:Le,firstLog:Le,latestLog:Le},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw Kn("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Kn("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Kn("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw Kn("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Kn("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Kn("[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):Zc("unsubscribe called for non-existent",e)}notifySubscribers(e){w0(`[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 Kn("[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 Pe(()=>this.size)}get nameAndSizeUntracked(){return Pe(()=>`${this.name} (${this.size})`)}get prettyName(){return b0(this.name)}get hasParents(){return!!this.parents?.length}};var gf=class mf extends Er{static fromArray(t,n){return new mf(n||"static",null,[],t)}constructor(t,n,r,i){super(t,n,r,i,{skipObservable:!0})}get readOnly(){return!0}},vf={};os(vf,{code:()=>Lf,decode:()=>Na,encode:()=>$a,format:()=>ll,name:()=>C1,parse:()=>U1,stringify:()=>ll});var T0=["string","number","bigint","symbol"],A0=["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 O0(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(T0.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(E0(e))return"Buffer";let n=I0(e);return n||"Object"}function E0(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function I0(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(A0.includes(t))return t}var B=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};B.uint=new B(0,"uint",!0);B.negint=new B(1,"negint",!0);B.bytes=new B(2,"bytes",!0);B.string=new B(3,"string",!0);B.array=new B(4,"array",!1);B.map=new B(5,"map",!1);B.tag=new B(6,"tag",!1);B.float=new B(7,"float",!0);B.false=new B(7,"false",!0);B.true=new B(7,"true",!0);B.null=new B(7,"null",!0);B.undefined=new B(7,"undefined",!0);B.break=new B(7,"break",!0);var ie=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},xr=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",S0=new TextDecoder,$0=new TextEncoder;function yo(e){return xr&&globalThis.Buffer.isBuffer(e)}function ya(e){return e instanceof Uint8Array?yo(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var N0=xr?(e,t,n)=>n-t>64?globalThis.Buffer.from(e.subarray(t,n)).toString("utf8"):tl(e,t,n):(e,t,n)=>n-t>64?S0.decode(e.subarray(t,n)):tl(e,t,n),bf=xr?e=>e.length>64?globalThis.Buffer.from(e):el(e):e=>e.length>64?$0.encode(e):el(e),ga=xr?(e,t,n)=>yo(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n):(e,t,n)=>e.slice(t,n),R0=xr?(e,t)=>(e=e.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),ya(globalThis.Buffer.concat(e,t))):(e,t)=>{let n=new Uint8Array(t),r=0;for(let i of e)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n},P0=xr?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function C0(e,t){if(yo(e)&&yo(t))return e.compare(t);for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return 0}function el(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}function tl(e,t,n){let r=[];for(;t<n;){let i=e[t],o=null,s=i>239?4:i>223?3:i>191?2:1;if(t+s<=n){let a,l,c,d;switch(s){case 1:i<128&&(o=i);break;case 2:a=e[t+1],(a&192)===128&&(d=(i&31)<<6|a&63,d>127&&(o=d));break;case 3:a=e[t+1],l=e[t+2],(a&192)===128&&(l&192)===128&&(d=(i&15)<<12|(a&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:a=e[t+1],l=e[t+2],c=e[t+3],(a&192)===128&&(l&192)===128&&(c&192)===128&&(d=(i&15)<<18|(a&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),t+=s}return _f(r)}var nl=4096;function _f(e){let t=e.length;if(t<=nl)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=nl));return n}var x0=256,wf=class{constructor(e=x0){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 r=t.length-(this.maxCursor-this.cursor)-1;t.set(e,r)}else{if(t){let r=t.length-(this.maxCursor-this.cursor)-1;r<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,r),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=P0(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 n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=ga(n,0,this.cursor)}else t=R0(this.chunks,this.cursor);return e&&this.reset(),t}},ye="CBOR decode error:",Wn="CBOR encode error:",yi=[];yi[23]=1;yi[24]=2;yi[25]=3;yi[26]=5;yi[27]=9;function Ur(e,t,n){if(e.length-t<n)throw new Error(`${ye} not enough data for type`)}var Ye=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Yn(e,t,n){Ur(e,t,1);let r=e[t];if(n.strict===!0&&r<Ye[0])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return r}function Qn(e,t,n){Ur(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<Ye[1])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return r}function Zn(e,t,n){Ur(e,t,4);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(n.strict===!0&&r<Ye[2])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return r}function er(e,t,n){Ur(e,t,8);let r=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(r)<<BigInt(32))+BigInt(i);if(n.strict===!0&&o<Ye[3])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(n.allowBigInt===!0)return o;throw new Error(`${ye} integers outside of the safe integer range are not supported`)}function U0(e,t,n,r){return new ie(B.uint,Yn(e,t+1,r),2)}function M0(e,t,n,r){return new ie(B.uint,Qn(e,t+1,r),3)}function B0(e,t,n,r){return new ie(B.uint,Zn(e,t+1,r),5)}function D0(e,t,n,r){return new ie(B.uint,er(e,t+1,r),9)}function tr(e,t){return Rt(e,0,t.value)}function Rt(e,t,n){if(n<Ye[0]){let r=Number(n);e.push([t|r])}else if(n<Ye[1]){let r=Number(n);e.push([t|24,r])}else if(n<Ye[2]){let r=Number(n);e.push([t|25,r>>>8,r&255])}else if(n<Ye[3]){let r=Number(n);e.push([t|26,r>>>24&255,r>>>16&255,r>>>8&255,r&255])}else{let r=BigInt(n);if(r<Ye[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(r&BigInt(4294967295)),s=Number(r>>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(`${ye} encountered BigInt larger than allowable range`)}}tr.encodedSize=function(t){return Rt.encodedSize(t.value)};Rt.encodedSize=function(t){return t<Ye[0]?1:t<Ye[1]?2:t<Ye[2]?3:t<Ye[3]?5:9};tr.compareTokens=function(t,n){return t.value<n.value?-1:t.value>n.value?1:0};function L0(e,t,n,r){return new ie(B.negint,-1-Yn(e,t+1,r),2)}function k0(e,t,n,r){return new ie(B.negint,-1-Qn(e,t+1,r),3)}function j0(e,t,n,r){return new ie(B.negint,-1-Zn(e,t+1,r),5)}var ma=BigInt(-1),Tf=BigInt(1);function F0(e,t,n,r){let i=er(e,t+1,r);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new ie(B.negint,o,9)}if(r.allowBigInt!==!0)throw new Error(`${ye} integers outside of the safe integer range are not supported`);return new ie(B.negint,ma-BigInt(i),9)}function va(e,t){let n=t.value,r=typeof n=="bigint"?n*ma-Tf:n*-1-1;Rt(e,t.type.majorEncoded,r)}va.encodedSize=function(t){let n=t.value,r=typeof n=="bigint"?n*ma-Tf:n*-1-1;return r<Ye[0]?1:r<Ye[1]?2:r<Ye[2]?3:r<Ye[3]?5:9};va.compareTokens=function(t,n){return t.value<n.value?1:t.value>n.value?-1:0};function gi(e,t,n,r){Ur(e,t,n+r);let i=ga(e,t+n,t+n+r);return new ie(B.bytes,i,n+r)}function z0(e,t,n,r){return gi(e,t,1,n)}function V0(e,t,n,r){return gi(e,t,2,Yn(e,t+1,r))}function K0(e,t,n,r){return gi(e,t,3,Qn(e,t+1,r))}function q0(e,t,n,r){return gi(e,t,5,Zn(e,t+1,r))}function G0(e,t,n,r){let i=er(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer bytes lengths not supported`);return gi(e,t,9,i)}function go(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===B.string?bf(e.value):e.value),e.encodedBytes}function Uo(e,t){let n=go(t);Rt(e,t.type.majorEncoded,n.length),e.push(n)}Uo.encodedSize=function(t){let n=go(t);return Rt.encodedSize(n.length)+n.length};Uo.compareTokens=function(t,n){return W0(go(t),go(n))};function W0(e,t){return e.length<t.length?-1:e.length>t.length?1:C0(e,t)}function mi(e,t,n,r,i){let o=n+r;Ur(e,t,o);let s=new ie(B.string,N0(e,t+n,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=ga(e,t+n,t+o)),s}function H0(e,t,n,r){return mi(e,t,1,n,r)}function J0(e,t,n,r){return mi(e,t,2,Yn(e,t+1,r),r)}function X0(e,t,n,r){return mi(e,t,3,Qn(e,t+1,r),r)}function Y0(e,t,n,r){return mi(e,t,5,Zn(e,t+1,r),r)}function Q0(e,t,n,r){let i=er(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer string lengths not supported`);return mi(e,t,9,i,r)}var Z0=Uo;function Mr(e,t,n,r){return new ie(B.array,r,n)}function eA(e,t,n,r){return Mr(e,t,1,n)}function tA(e,t,n,r){return Mr(e,t,2,Yn(e,t+1,r))}function nA(e,t,n,r){return Mr(e,t,3,Qn(e,t+1,r))}function rA(e,t,n,r){return Mr(e,t,5,Zn(e,t+1,r))}function iA(e,t,n,r){let i=er(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer array lengths not supported`);return Mr(e,t,9,i)}function oA(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return Mr(e,t,1,1/0)}function ba(e,t){Rt(e,B.array.majorEncoded,t.value)}ba.compareTokens=tr.compareTokens;ba.encodedSize=function(t){return Rt.encodedSize(t.value)};function Br(e,t,n,r){return new ie(B.map,r,n)}function sA(e,t,n,r){return Br(e,t,1,n)}function aA(e,t,n,r){return Br(e,t,2,Yn(e,t+1,r))}function uA(e,t,n,r){return Br(e,t,3,Qn(e,t+1,r))}function cA(e,t,n,r){return Br(e,t,5,Zn(e,t+1,r))}function lA(e,t,n,r){let i=er(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer map lengths not supported`);return Br(e,t,9,i)}function fA(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return Br(e,t,1,1/0)}function _a(e,t){Rt(e,B.map.majorEncoded,t.value)}_a.compareTokens=tr.compareTokens;_a.encodedSize=function(t){return Rt.encodedSize(t.value)};function dA(e,t,n,r){return new ie(B.tag,n,1)}function pA(e,t,n,r){return new ie(B.tag,Yn(e,t+1,r),2)}function hA(e,t,n,r){return new ie(B.tag,Qn(e,t+1,r),3)}function yA(e,t,n,r){return new ie(B.tag,Zn(e,t+1,r),5)}function gA(e,t,n,r){return new ie(B.tag,er(e,t+1,r),9)}function wa(e,t){Rt(e,B.tag.majorEncoded,t.value)}wa.compareTokens=tr.compareTokens;wa.encodedSize=function(t){return Rt.encodedSize(t.value)};var mA=20,vA=21,bA=22,_A=23;function wA(e,t,n,r){if(r.allowUndefined===!1)throw new Error(`${ye} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new ie(B.null,null,1):new ie(B.undefined,void 0,1)}function TA(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return new ie(B.break,void 0,1)}function Ta(e,t,n){if(n){if(n.allowNaN===!1&&Number.isNaN(e))throw new Error(`${ye} NaN values are not supported`);if(n.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${ye} Infinity values are not supported`)}return new ie(B.float,e,t)}function AA(e,t,n,r){return Ta(Oa(e,t+1),3,r)}function OA(e,t,n,r){return Ta(Ea(e,t+1),5,r)}function EA(e,t,n,r){return Ta(If(e,t+1),9,r)}function Aa(e,t,n){let r=t.value;if(r===!1)e.push([B.float.majorEncoded|mA]);else if(r===!0)e.push([B.float.majorEncoded|vA]);else if(r===null)e.push([B.float.majorEncoded|bA]);else if(r===void 0)e.push([B.float.majorEncoded|_A]);else{let i,o=!1;(!n||n.float64!==!0)&&(Of(r),i=Oa(zt,1),r===i||Number.isNaN(r)?(zt[0]=249,e.push(zt.slice(0,3)),o=!0):(Ef(r),i=Ea(zt,1),r===i&&(zt[0]=250,e.push(zt.slice(0,5)),o=!0))),o||(IA(r),i=If(zt,1),zt[0]=251,e.push(zt.slice(0,9)))}}Aa.encodedSize=function(t,n){let r=t.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){Of(r);let i=Oa(zt,1);if(r===i||Number.isNaN(r))return 3;if(Ef(r),i=Ea(zt,1),r===i)return 5}return 9};var Af=new ArrayBuffer(9),$t=new DataView(Af,1),zt=new Uint8Array(Af,0);function Of(e){if(e===1/0)$t.setUint16(0,31744,!1);else if(e===-1/0)$t.setUint16(0,64512,!1);else if(Number.isNaN(e))$t.setUint16(0,32256,!1);else{$t.setFloat32(0,e);let t=$t.getUint32(0),n=(t&2139095040)>>23,r=t&8388607;if(n===255)$t.setUint16(0,31744,!1);else if(n===0)$t.setUint16(0,(e&2147483648)>>16|r>>13,!1);else{let i=n-127;i<-24?$t.setUint16(0,0):i<-14?$t.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):$t.setUint16(0,(t&2147483648)>>16|i+15<<10|r>>13,!1)}}}function Oa(e,t){if(e.length-t<2)throw new Error(`${ye} not enough data for float16`);let n=(e[t]<<8)+e[t+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;let r=n>>10&31,i=n&1023,o;return r===0?o=i*2**-24:r!==31?o=(i+1024)*2**(r-25):o=i===0?1/0:NaN,n&32768?-o:o}function Ef(e){$t.setFloat32(0,e,!1)}function Ea(e,t){if(e.length-t<4)throw new Error(`${ye} not enough data for float32`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,4).getFloat32(0,!1)}function IA(e){$t.setFloat64(0,e,!1)}function If(e,t){if(e.length-t<8)throw new Error(`${ye} not enough data for float64`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,8).getFloat64(0,!1)}Aa.compareTokens=tr.compareTokens;function Ee(e,t,n){throw new Error(`${ye} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function Mo(e){return()=>{throw new Error(`${ye} ${e}`)}}var se=[];for(let e=0;e<=23;e++)se[e]=Ee;se[24]=U0;se[25]=M0;se[26]=B0;se[27]=D0;se[28]=Ee;se[29]=Ee;se[30]=Ee;se[31]=Ee;for(let e=32;e<=55;e++)se[e]=Ee;se[56]=L0;se[57]=k0;se[58]=j0;se[59]=F0;se[60]=Ee;se[61]=Ee;se[62]=Ee;se[63]=Ee;for(let e=64;e<=87;e++)se[e]=z0;se[88]=V0;se[89]=K0;se[90]=q0;se[91]=G0;se[92]=Ee;se[93]=Ee;se[94]=Ee;se[95]=Mo("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)se[e]=H0;se[120]=J0;se[121]=X0;se[122]=Y0;se[123]=Q0;se[124]=Ee;se[125]=Ee;se[126]=Ee;se[127]=Mo("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)se[e]=eA;se[152]=tA;se[153]=nA;se[154]=rA;se[155]=iA;se[156]=Ee;se[157]=Ee;se[158]=Ee;se[159]=oA;for(let e=160;e<=183;e++)se[e]=sA;se[184]=aA;se[185]=uA;se[186]=cA;se[187]=lA;se[188]=Ee;se[189]=Ee;se[190]=Ee;se[191]=fA;for(let e=192;e<=215;e++)se[e]=dA;se[216]=pA;se[217]=hA;se[218]=yA;se[219]=gA;se[220]=Ee;se[221]=Ee;se[222]=Ee;se[223]=Ee;for(let e=224;e<=243;e++)se[e]=Mo("simple values are not supported");se[244]=Ee;se[245]=Ee;se[246]=Ee;se[247]=wA;se[248]=Mo("simple values are not supported");se[249]=AA;se[250]=OA;se[251]=EA;se[252]=Ee;se[253]=Ee;se[254]=Ee;se[255]=TA;var Qt=[];for(let e=0;e<24;e++)Qt[e]=new ie(B.uint,e,1);for(let e=-1;e>=-24;e--)Qt[31-e]=new ie(B.negint,e,1);Qt[64]=new ie(B.bytes,new Uint8Array(0),1);Qt[96]=new ie(B.string,"",1);Qt[128]=new ie(B.array,0,1);Qt[160]=new ie(B.map,0,1);Qt[244]=new ie(B.false,!1,1);Qt[245]=new ie(B.true,!0,1);Qt[246]=new ie(B.null,null,1);function SA(){let e=[];return e[B.uint.major]=tr,e[B.negint.major]=va,e[B.bytes.major]=Uo,e[B.string.major]=Z0,e[B.array.major]=ba,e[B.map.major]=_a,e[B.tag.major]=wa,e[B.float.major]=Aa,e}var vS=SA(),js=new wf,rl=class Sf{constructor(t,n){this.obj=t,this.parent=n}includes(t){let n=this;do if(n.obj===t)return!0;while(n=n.parent);return!1}static createCheck(t,n){if(t&&t.includes(n))throw new Error(`${Wn} object contains circular references`);return new Sf(n,t)}},_n={null:new ie(B.null,null),undefined:new ie(B.undefined,void 0),true:new ie(B.true,!0),false:new ie(B.false,!1),emptyArray:new ie(B.array,0),emptyMap:new ie(B.map,0)},En={number(e,t,n,r){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new ie(B.float,e):e>=0?new ie(B.uint,e):new ie(B.negint,e)},bigint(e,t,n,r){return e>=BigInt(0)?new ie(B.uint,e):new ie(B.negint,e)},Uint8Array(e,t,n,r){return new ie(B.bytes,e)},string(e,t,n,r){return new ie(B.string,e)},boolean(e,t,n,r){return e?_n.true:_n.false},null(e,t,n,r){return _n.null},undefined(e,t,n,r){return _n.undefined},ArrayBuffer(e,t,n,r){return new ie(B.bytes,new Uint8Array(e))},DataView(e,t,n,r){return new ie(B.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,n,r){if(!e.length)return n.addBreakTokens===!0?[_n.emptyArray,new ie(B.break)]:_n.emptyArray;r=rl.createCheck(r,e);let i=[],o=0;for(let s of e)i[o++]=no(s,n,r);return n.addBreakTokens?[new ie(B.array,e.length),i,new ie(B.break)]:[new ie(B.array,e.length),i]},Object(e,t,n,r){let i=t!=="Object",o=i?e.keys():Object.keys(e),s=i?e.size:o.length;if(!s)return n.addBreakTokens===!0?[_n.emptyMap,new ie(B.break)]:_n.emptyMap;r=rl.createCheck(r,e);let a=[],l=0;for(let c of o)a[l++]=[no(c,n,r),no(i?e.get(c):e[c],n,r)];return $A(a,n),n.addBreakTokens?[new ie(B.map,s),a,new ie(B.break)]:[new ie(B.map,s),a]}};En.Map=En.Object;En.Buffer=En.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))En[`${e}Array`]=En.DataView;function no(e,t={},n){let r=O0(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||En[r];if(typeof i=="function"){let s=i(e,r,t,n);if(s!=null)return s}let o=En[r];if(!o)throw new Error(`${Wn} unsupported type: ${r}`);return o(e,r,t,n)}function $A(e,t){t.mapSorter&&e.sort(t.mapSorter)}function $f(e,t,n,r){if(Array.isArray(t))for(let i of t)$f(e,i,n,r);else n[t.type.major](e,t,r)}function NA(e,t,n){let r=no(e,n);if(!Array.isArray(r)&&n.quickEncodeToken){let i=n.quickEncodeToken(r);if(i)return i;let o=t[r.type.major];if(o.encodedSize){let s=o.encodedSize(r,n),a=new wf(s);if(o(a,r,n),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return ya(a.chunks[0])}}return js.reset(),$f(js,r,t,n),js.toBytes(!0)}var RA={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},PA=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=Qt[e];if(t===void 0){let n=se[e];if(!n)throw new Error(`${ye} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let r=e&31;t=n(this.data,this._pos,r,this.options)}return this._pos+=t.encodedLength,t}},fi=Symbol.for("DONE"),Bo=Symbol.for("BREAK");function CA(e,t,n){let r=[];for(let i=0;i<e.value;i++){let o=di(t,n);if(o===Bo){if(e.value===1/0)break;throw new Error(`${ye} got unexpected break to lengthed array`)}if(o===fi)throw new Error(`${ye} found array but not enough entries (got ${i}, expected ${e.value})`);r[i]=o}return r}function xA(e,t,n){let r=n.useMaps===!0,i=r?void 0:{},o=r?new Map:void 0;for(let s=0;s<e.value;s++){let a=di(t,n);if(a===Bo){if(e.value===1/0)break;throw new Error(`${ye} got unexpected break to lengthed map`)}if(a===fi)throw new Error(`${ye} found map but not enough entries (got ${s} [no key], expected ${e.value})`);if(r!==!0&&typeof a!="string")throw new Error(`${ye} non-string keys not supported (got ${typeof a})`);if(n.rejectDuplicateMapKeys===!0&&(r&&o.has(a)||!r&&a in i))throw new Error(`${ye} found repeat map key "${a}"`);let l=di(t,n);if(l===fi)throw new Error(`${ye} found map but not enough entries (got ${s} [no value], expected ${e.value})`);r?o.set(a,l):i[a]=l}return r?o:i}function di(e,t){if(e.done())return fi;let n=e.next();if(n.type===B.break)return Bo;if(n.type.terminal)return n.value;if(n.type===B.array)return CA(n,e,t);if(n.type===B.map)return xA(n,e,t);if(n.type===B.tag){if(t.tags&&typeof t.tags[n.value]=="function"){let r=di(e,t);return t.tags[n.value](r)}throw new Error(`${ye} tag not supported (${n.value})`)}throw new Error("unsupported")}function UA(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ye} data to decode must be a Uint8Array`);t=Object.assign({},RA,t);let n=t.tokenizer||new PA(e,t),r=di(n,t);if(r===fi)throw new Error(`${ye} did not find any content to decode`);if(r===Bo)throw new Error(`${ye} got unexpected break`);return[r,e.subarray(n.pos())]}function MA(e,t){let[n,r]=UA(e,t);if(r.length>0)throw new Error(`${ye} too many terminals, data makes no sense`);return n}var BA=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===B.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===B.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[B.uint.major](e,t){this.prefix(e);let n=String(t.value),r=[];for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);e.push(r)}[B.negint.major](e,t){this[B.uint.major](e,t)}[B.bytes.major](e,t){throw new Error(`${Wn} unsupported type: Uint8Array`)}[B.string.major](e,t){this.prefix(e);let n=bf(JSON.stringify(t.value));e.push(n.length>32?ya(n):n)}[B.array.major](e,t){this.prefix(e),this.inRecursive.push({type:B.array,elements:0}),e.push([91])}[B.map.major](e,t){this.prefix(e),this.inRecursive.push({type:B.map,elements:0}),e.push([123])}[B.tag.major](e,t){}[B.float.major](e,t){if(t.type.name==="break"){let o=this.inRecursive.pop();if(o){if(o.type===B.array)e.push([93]);else if(o.type===B.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(`${Wn} 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 n=String(t.value),r=[],i=!1;for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o),!i&&(r[o]===46||r[o]===101||r[o]===69)&&(i=!0);i||(r.push(46),r.push(48)),e.push(r)}};function DA(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Wn} complex map keys are not supported`);let n=e[0],r=t[0];if(n.type!==B.string||r.type!==B.string)throw new Error(`${Wn} non-string map keys are not supported`);if(n<r)return-1;if(n>r)return 1;throw new Error(`${Wn} unexpected duplicate map keys, this is not supported`)}var LA={addBreakTokens:!0,mapSorter:DA};function kA(e,t){return t=Object.assign({},LA,t),NA(e,new BA,t)}var Nf=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(`${ye} 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(`${ye} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,n=!1,r=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++,n=!0;else return new ie(B.uint,0,this._pos-e);if(r([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${ye} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(n)throw new Error(`${ye} unexpected token at position ${this._pos}`);n=!0,this._pos++,r([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(n=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,r([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 n?new ie(B.float,o,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(o)?new ie(o>=0?B.uint:B.negint,o,this._pos-e):new ie(o>=0?B.uint:B.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${ye} 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 ie(B.string,a,o)}}let e=this._pos,t=[],n=()=>{if(this._pos+4>=this.data.length)throw new Error(`${ye} 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(`${ye} unexpected unicode escape character at position ${this._pos}`);i=i*16+s,this._pos++}return i},r=()=>{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(`${ye} unexpected unicode sequence at position ${this._pos}`);let a,l,c,d;switch(s){case 1:i<128&&(o=i);break;case 2:a=this.data[this._pos+1],(a&192)===128&&(d=(i&31)<<6|a&63,d>127&&(o=d));break;case 3:a=this.data[this._pos+1],l=this.data[this._pos+2],(a&192)===128&&(l&192)===128&&(d=(i&15)<<12|(a&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:a=this.data[this._pos+1],l=this.data[this._pos+2],c=this.data[this._pos+3],(a&192)===128&&(l&192)===128&&(c&192)===128&&(d=(i&15)<<18|(a&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(o=d))}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(`${ye} 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(n());break;default:throw new Error(`${ye} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new ie(B.string,_f(t),this._pos-e);default:if(i<32)throw new Error(`${ye} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):r()}}throw new Error(`${ye} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new ie(B.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new ie(B.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new ie(B.null,null,4);case 102:return this.expect([102,97,108,115,101]),new ie(B.false,!1,5);case 116:return this.expect([116,114,117,101]),new ie(B.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(`${ye} 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 ie(B.break,void 0,1);if(this.ch()!==44)throw new Error(`${ye} 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 ie(B.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 ie(B.break,void 0,1);if(this.ch()!==44)throw new Error(`${ye} 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 ie(B.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${ye} 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(`${ye} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function jA(e,t){return t=Object.assign({tokenizer:new Nf(e,t)},t),MA(e,t)}var bS=new Uint8Array(0);function FA(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function Ia(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 zA(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(n[s]!==255)throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function g(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var z=0,J=0,F=0,k=S.length;F!==k&&S[F]===0;)F++,z++;for(var K=(k-F)*d+1>>>0,W=new Uint8Array(K);F!==k;){for(var j=S[F],Z=0,G=K-1;(j!==0||Z<J)&&G!==-1;G--,Z++)j+=256*W[G]>>>0,W[G]=j%a>>>0,j=j/a>>>0;if(j!==0)throw new Error("Non-zero carry");J=Z,F++}for(var fe=K-J;fe!==K&&W[fe]===0;)fe++;for(var x=l.repeat(z);fe<K;++fe)x+=e.charAt(W[fe]);return x}function C(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var z=0;if(S[z]!==" "){for(var J=0,F=0;S[z]===l;)J++,z++;for(var k=(S.length-z)*c+1>>>0,K=new Uint8Array(k);S[z];){var W=n[S.charCodeAt(z)];if(W===255)return;for(var j=0,Z=k-1;(W!==0||j<F)&&Z!==-1;Z--,j++)W+=a*K[Z]>>>0,K[Z]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");F=j,z++}if(S[z]!==" "){for(var G=k-F;G!==k&&K[G]===0;)G++;for(var fe=new Uint8Array(J+(k-G)),x=J;G!==k;)fe[x++]=K[G++];return fe}}}function I(S){var z=C(S);if(z)return z;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:C,decode:I}}var VA=zA,KA=VA,qA=KA,GA=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},WA=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let r=t.codePointAt(0);if(r===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r,this.baseDecode=n}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 Rf(this,e)}},HA=class{decoders;constructor(e){this.decoders=e}or(e){return Rf(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Rf(e,t){return new HA({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var JA=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new GA(e,t,n),this.decoder=new WA(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Pf({name:e,prefix:t,encode:n,decode:r}){return new JA(e,t,n,r)}function Do({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=qA(n,e);return Pf({prefix:t,name:e,encode:r,decode:o=>Ia(i(o))})}function XA(e,t,n,r){let i=e.length;for(;e[i-1]==="=";)--i;let o=new Uint8Array(i*n/8|0),s=0,a=0,l=0;for(let c=0;c<i;++c){let d=t[e[c]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);a=a<<n|d,s+=n,s>=8&&(s-=8,o[l++]=255&a>>s)}if(s>=n||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o}function YA(e,t,n){let r=t[t.length-1]==="=",i=(1<<n)-1,o="",s=0,a=0;for(let l=0;l<e.length;++l)for(a=a<<8|e[l],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s!==0&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o}function QA(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function yt({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=QA(r);return Pf({prefix:t,name:e,encode(o){return YA(o,r,n)},decode(o){return XA(o,i,n,e)}})}var ro=yt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),_S=yt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),wS=yt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),TS=yt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),AS=yt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),OS=yt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ES=yt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),IS=yt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),SS=yt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Fs=Do({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$S=Do({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),An=Do({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),NS=Do({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Cf={};os(Cf,{Digest:()=>Lo,create:()=>Sa,decode:()=>Uf,equals:()=>Mf,hasCode:()=>m1});var ZA=xf,il=128,e1=127,t1=~e1,n1=Math.pow(2,31);function xf(e,t,n){t=t||[],n=n||0;for(var r=n;e>=n1;)t[n++]=e&255|il,e/=128;for(;e&t1;)t[n++]=e&255|il,e>>>=7;return t[n]=e|0,xf.bytes=n-r+1,t}var r1=Hs,i1=128,ol=127;function Hs(e,r){var n=0,r=r||0,i=0,o=r,s,a=e.length;do{if(o>=a)throw Hs.bytes=0,new RangeError("Could not decode varint");s=e[o++],n+=i<28?(s&ol)<<i:(s&ol)*Math.pow(2,i),i+=7}while(s>=i1);return Hs.bytes=o-r,n}var o1=Math.pow(2,7),s1=Math.pow(2,14),a1=Math.pow(2,21),u1=Math.pow(2,28),c1=Math.pow(2,35),l1=Math.pow(2,42),f1=Math.pow(2,49),d1=Math.pow(2,56),p1=Math.pow(2,63),h1=function(e){return e<o1?1:e<s1?2:e<a1?3:e<u1?4:e<c1?5:e<l1?6:e<f1?7:e<d1?8:e<p1?9:10},y1={encode:ZA,decode:r1,encodingLength:h1},g1=y1,mo=g1;function Js(e,t=0){return[mo.decode(e,t),mo.decode.bytes]}function vo(e,t,n=0){return mo.encode(e,t,n),t}function bo(e){return mo.encodingLength(e)}function Sa(e,t){let n=t.byteLength,r=bo(e),i=r+bo(n),o=new Uint8Array(i+n);return vo(e,o,0),vo(n,o,r),o.set(t,i),new Lo(e,n,t,o)}function Uf(e){let t=Ia(e),[n,r]=Js(t),[i,o]=Js(t.subarray(r)),s=t.subarray(r+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Lo(n,i,s,t)}function Mf(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&FA(e.bytes,n.bytes)}}var Lo=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};function m1(e,t){return e.code===t}function sl(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return b1(n,Xs(e),t??An.encoder);default:return _1(n,Xs(e),t??ro.encoder)}}var al=new WeakMap;function Xs(e){let t=al.get(e);if(t==null){let n=new Map;return al.set(e,n),n}return t}var ko=class tt{code;version;multihash;bytes;"/";constructor(t,n,r,i){this.code=n,this.version=t,this.multihash=r,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:n}=this;if(t!==ri)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==w1)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return tt.createV0(n)}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:n}=this.multihash,r=Sa(t,n);return tt.createV1(this.code,r)}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 tt.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&Mf(t.multihash,r.multihash)}toString(t){return sl(this,t)}toJSON(){return{"/":sl(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 n=t;if(n instanceof tt)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:o,bytes:s}=n;return new tt(r,i,o,s??ul(r,i,o.bytes))}else if(n[T1]===!0){let{version:r,multihash:i,code:o}=n,s=Uf(i);return tt.create(r,o,s)}else return null}static create(t,n,r){if(typeof n!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(n!==ri)throw new Error(`Version 0 CID must use dag-pb (code: ${ri}) block encoding`);return new tt(t,n,r,r.bytes)}case 1:{let i=ul(t,n,r.bytes);return new tt(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return tt.create(0,ri,t)}static createV1(t,n){return tt.create(1,t,n)}static decode(t){let[n,r]=tt.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=tt.inspectBytes(t),r=n.size-n.multihashSize,i=Ia(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw new Error("Incorrect length");let o=i.subarray(n.multihashSize-n.digestSize),s=new Lo(n.multihashCode,n.digestSize,o,i);return[n.version===0?tt.createV0(s):tt.createV1(n.codec,s),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[g,C]=Js(t.subarray(n));return n+=C,g},i=r(),o=ri;if(i===18?(i=0,n=0):o=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=n,a=r(),l=r(),c=n+l,d=c-s;return{version:i,codec:o,multihashCode:a,digestSize:l,multihashSize:d,size:c}}static parse(t,n){let[r,i]=v1(t,n),o=tt.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Xs(o).set(r,t),o}};function v1(e,t){switch(e[0]){case"Q":{let n=t??An;return[An.prefix,n.decode(`${An.prefix}${e}`)]}case An.prefix:{let n=t??An;return[An.prefix,n.decode(e)]}case ro.prefix:{let n=t??ro;return[ro.prefix,n.decode(e)]}case Fs.prefix:{let n=t??Fs;return[Fs.prefix,n.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 b1(e,t,n){let{prefix:r}=n;if(r!==An.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let o=n.encode(e).slice(1);return t.set(r,o),o}else return i}function _1(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let o=n.encode(e);return t.set(r,o),o}else return i}var ri=112,w1=18;function ul(e,t,n){let r=bo(e),i=r+bo(t),o=new Uint8Array(i+n.byteLength);return vo(e,o,0),vo(t,o,r),o.set(n,i),o}var T1=Symbol.for("@ipld/js-cid/CID"),A1=20;function Bf({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new O1(e,t,n,r,i)}var O1=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,r,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=r??A1,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 n=this.encode(e);return n instanceof Uint8Array?cl(n,this.code,t?.truncate):n.then(r=>cl(r,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function cl(e,t,n){if(n!=null&&n!==e.byteLength){if(n>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,n)}return Sa(t,e)}var Df=yt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),RS=yt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),PS=yt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),CS=yt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function E1(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function I1(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=ko.asCID(e);if(!t)return null;let n=t.toString();return[new ie(B.map,1/0,1),new ie(B.string,"/",1),new ie(B.string,n,n.length),new ie(B.break,void 0,1)]}function _o(e){let t=Df.encode(e).slice(1);return[new ie(B.map,1/0,1),new ie(B.string,"/",1),new ie(B.map,1/0,1),new ie(B.string,"bytes",5),new ie(B.string,t,t.length),new ie(B.break,void 0,1),new ie(B.break,void 0,1)]}function Ft(e){return _o(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function S1(e){return _o(new Uint8Array(e))}function $1(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function N1(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 R1={typeEncoders:{Object:I1,Buffer:_o,Uint8Array:_o,Int8Array:Ft,Uint16Array:Ft,Int16Array:Ft,Uint32Array:Ft,Int32Array:Ft,Float32Array:Ft,Float64Array:Ft,Uint8ClampedArray:Ft,BigInt64Array:Ft,BigUint64Array:Ft,DataView:Ft,ArrayBuffer:S1,undefined:$1,number:N1}},P1=class extends Nf{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===B.map){let t=this._next();if(t.type===B.string&&t.value==="/"){let n=this._next();if(n.type===B.string){if(this._next().type!==B.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new ie(B.tag,42,0)}if(n.type===B.map){let r=this._next();if(r.type===B.string&&r.value==="bytes"){let i=this._next();if(i.type===B.string){for(let s=0;s<2;s++)if(this._next().type!==B.break)throw new Error("Invalid encoded Bytes form");let o=Df.decode(`m${i.value}`);return new ie(B.bytes,o,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(r)}this.tokenBuffer.push(n)}this.tokenBuffer.push(t)}return e}},Ys={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Ys.tags[42]=ko.parse;var C1="dag-json",Lf=297,$a=e=>kA(e,R1),Na=e=>{let t=E1(e),n=Object.assign(Ys,{tokenizer:new P1(t,Ys)});return jA(t,n)},ll=e=>x1.decode($a(e)),x1=new TextDecoder,U1=e=>Na(M1.encode(e)),M1=new TextEncoder;function B1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function kf(e,t,n=""){let r=B1(e),i=e?.length,o=t!==void 0;if(!r||o&&i!==t){let s=n&&`"${n}" `,a=o?` of length ${t}`:"",l=r?`length=${i}`:`type=${typeof e}`;throw new Error(s+"expected Uint8Array"+a+", got "+l)}return e}function fl(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 D1(e,t){kf(e,void 0,"digestInto() output");let n=t.outputLen;if(e.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function Qs(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function zs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Jt(e,t){return e<<32-t|e>>>t}function L1(e,t={}){let n=(i,o)=>e(o).update(i).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}var k1=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function j1(e,t,n){return e&t^~e&n}function F1(e,t,n){return e&t^e&n^t&n}var z1=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=zs(this.buffer)}update(e){fl(this),kf(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let a=zs(e);for(;r<=i-o;o+=r)this.process(a,o);continue}n.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){fl(this),D1(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:o}=this;t[o++]=128,Qs(this.buffer.subarray(o)),this.padOffset>r-o&&(this.process(n,0),o=0);for(let d=o;d<r;d++)t[d]=0;n.setBigUint64(r-8,BigInt(this.length*8),i),this.process(n,0);let s=zs(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let l=a/4,c=this.get();if(l>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)s.setUint32(4*d,c[d],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=r,e.pos=s,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},wn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),V1=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]),Tn=new Uint32Array(64),K1=class extends z1{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:o,G:s,H:a}=this;return[e,t,n,r,i,o,s,a]}set(e,t,n,r,i,o,s,a){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=o|0,this.G=s|0,this.H=a|0}process(e,t){for(let d=0;d<16;d++,t+=4)Tn[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let g=Tn[d-15],C=Tn[d-2],I=Jt(g,7)^Jt(g,18)^g>>>3,S=Jt(C,17)^Jt(C,19)^C>>>10;Tn[d]=S+Tn[d-7]+I+Tn[d-16]|0}let{A:n,B:r,C:i,D:o,E:s,F:a,G:l,H:c}=this;for(let d=0;d<64;d++){let g=Jt(s,6)^Jt(s,11)^Jt(s,25),C=c+g+j1(s,a,l)+V1[d]+Tn[d]|0,S=(Jt(n,2)^Jt(n,13)^Jt(n,22))+F1(n,r,i)|0;c=l,l=a,a=s,s=o+C|0,o=i,i=r,r=n,n=C+S|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(n,r,i,o,s,a,l,c)}roundClean(){Qs(Tn)}destroy(){this.set(0,0,0,0,0,0,0,0),Qs(this.buffer)}},q1=class extends K1{A=wn[0]|0;B=wn[1]|0;C=wn[2]|0;D=wn[3]|0;E=wn[4]|0;F=wn[5]|0;G=wn[6]|0;H=wn[7]|0;constructor(){super(32)}},G1=L1(()=>new q1,k1(1));var He=mt(en(),1),jf=mt(ly(),1),dl=e=>He.Type.Union([e,He.Type.Null()]);var Ff=/^(k51qz|baguq)[0-9a-z]{56,57}$/,W1=/^[0-9A-Fa-f]{7,8}$/g;He.FormatRegistry.Set("EntityID",e=>!!e.match(W1)||!!e.match(Ff));var H1=He.Type.String(),J1=e=>e?.enc instanceof Uint8Array;He.FormatRegistry.Set("CID",e=>!!e.match(Ff));var zf=He.Type.String({format:"CID"}),X1=/^http([s]?):\/\/.*\..*/;He.FormatRegistry.Set("URL",e=>!!e.match(X1));var xS=He.Type.String({format:"URL"}),Vf=He.Type.Object({en:H1,at:He.Type.String(),vl:dl(He.Type.Union([He.Type.String(),He.Type.Boolean(),He.Type.Number()])),ts:He.Type.String(),ag:He.Type.String(),pv:dl(zf)}),pl=jf.TypeCompiler.Compile(Vf);var US=pl.Check.bind(pl),Y1=He.Type.Composite([He.Type.Object({cid:zf}),Vf]),Zs=jf.TypeCompiler.Compile(Y1),Q1=e=>Array.from(Zs.Errors(e)),Kf=Zs.Check.bind(Zs);function qf(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var Z1=Bf({name:"sha2-256",code:18,encode:qf("SHA-256")}),MS=Bf({name:"sha2-512",code:19,encode:qf("SHA-512")}),{WARN:hl,LOG:BS,DEBUG:eO,VERBOSE:Gf,ERROR:tO}=$e.setup($e.INFO);function Wf(e,t=["cid"]){if(!e)throw tO("falsy log",e);let n=e.cid;if(J1(e))return n||(n=Ra(Hf(e).bytes).toString()),hl("preparing an encrypted applog - really?"),{log:e,cid:n};let r={};for(let[i,o]of Object.entries(e))o===void 0&&(hl(`log.${i} is undefined, which is not allowed - encoding as null`,e),o=null),t.includes(i)?Gf("excluding app log",{key:i,val:o}):r[i]=o;return{log:r,cid:n}}function nO(e){return Ra(rO(e).bytes)}function rO(e){return Hf(Wf(e)?.log)}function Ra(e){let t=G1(e),n=Cf.create(Z1.code,t),r=ko.create(1,Lf,n);return Gf("[getCidSync]",{bytes:e,hash:t,digest:n,cid:r}),r}function Hf(e){eO("[encodeBlock]",e);let t=$a(e);return{bytes:t,cid:Ra(t)}}function yl(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 iO(e,t){let n=yl(e),r=yl(t);return+n<+r}var{WARN:oO,LOG:DS,DEBUG:LS,VERBOSE:wo,ERROR:To}=$e.setup($e.INFO),sO=(e,t,n="asc")=>n==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),Jf=(e,t,n)=>ze.structural(Yc(t,e),Yc(n,e)),aO=(e,t,n="asc")=>sO(e.ts,t.ts,n),kS=n0(Jf,["en","at"]);function pi(e,t="asc"){return e.sort((n,r)=>aO(n,r,t))}var uO=(e,t)=>iO(new Date(e.ts),new Date(t.ts));var cO=()=>{oO("[removeDuplicateAppLogs] mode not set; pass 'safety' or 'cleanup' for optimal behavior")},gl=e=>{let t=new Map,n=wo.isEnabled;for(let r of e){if(!r)throw To("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!r.cid)throw To("applog with missing CID",r),new Error("applog with missing CID");let i=r.cid,o=t.get(i);o?n&&wo("Skipping duplicate applog:",[o,r]):t.set(i,r)}return Array.from(t.values())},lO=e=>{let t=new Set,n=wo.isEnabled,r=n?new Map:null,i=null,o=0;for(let s of e){if(!s)throw To("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!s.cid)throw To("applog with missing CID",s),new Error("applog with missing CID");let a=s.cid;t.has(a)?(i||(i=e.slice(0,o)),n&&wo("Skipping duplicate applog:",[r?.get(a),s])):(t.add(a),r&&r.set(a,s),i&&i.push(s)),o++}return i??e},Xf=(e,t)=>t?t==="safety"?lO(e):gl(e):(cO(),gl(e));function fO(e){return typeof e=="string"&&e.startsWith("?")}function dO(e){return e.slice(1)}function Pa(e,t){let n={},r={};for(let[i,o]of Object.entries(e))if(fO(o)){let s=dO(o),a=t[s];a?r[i]=a:n[i]=s}else r[i]=o;return[r,n]}function pO(e,t,n){let r;if(t){let i=typeof t;i==="string"?r=t===n:i==="function"?r=t(n):typeof t.has=="function"?r=t.has(n):Array.isArray(t)&&!Array.isArray(n)?r=t.includes(n):r=t===n}else r=t===n;return e.charAt(0)==="!"?!r:r}var Yf=function(t){for(var n=0,r=0,i=t.length;r<i;r++)n+=t[r];return n},ml=function(t){return Yf(t)/t.length},Nt={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return Nt.max(e)-Nt.min(e)},midrange:function(e){return Nt.range(e)/2},sum:Yf,mean:ml,average:ml,median:function(e){e.sort(function(n,r){return n-r});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={},n=0,r=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>n?(r=[i],n=t[i]):t[i]===n&&(r.push(i),n=t[i])}),r},variance:function(e){var t=Nt.mean(e);return Nt.mean(e.map(function(n){return Math.pow(n-t,2)}))},standardDeviation:function(e){return Math.sqrt(Nt.variance(e))},meanAbsoluteDeviation:function(e){var t=Nt.mean(e);return Nt.mean(e.map(function(n){return Math.abs(n-t)}))},zScores:function(e){var t=Nt.mean(e),n=Nt.standardDeviation(e);return e.map(function(r){return(r-t)/n})}};Nt.average=Nt.mean;var Qf=function(e,t=13,n){if(!e?.length)throw new Error(`Empty string: ${e}`);let r=3735928559^t,i=1103547991^t;for(let s=0,a;s<e.length;s++)a=e.charCodeAt(s),r=Math.imul(r^a,2654435761),i=Math.imul(i^a,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),(4294967296*(2097151&i)+(r>>>0)).toString(16).slice(-n).padStart(n,"0")};function Zf(){return new Date().toISOString()}var{WARN:hO,LOG:jS,DEBUG:Ke,VERBOSE:FS,ERROR:Ao}=$e.setup($e.INFO);function yO(e,t){Ke(`[ensureTsPvAndFinalizeApplogs] ENTER - ${e.length} applogs, thread size=${t.size}`);let n=Zf(),r=t;Ke("[ensureTsPvAndFinalizeApplogs] About to map over applogs");let i=e.map((o,s)=>{Ke(`[ensureTsPvAndFinalizeApplogs] Processing applog ${s+1}/${e.length}`);let a=gO(o,{ts:n,threadForPv:r});return Ke(`[ensureTsPvAndFinalizeApplogs] Finalized applog ${s+1}/${e.length}`),a});return Ke(`[ensureTsPvAndFinalizeApplogs] EXIT - mapped ${i.length} applogs`),i}function gO(e,{ts:t,threadForPv:n}={}){Ke(`[finalizeApplogForInsert] ENTER - en=${e.en}, at=${e.at}`),Ke("[finalizeApplogForInsert] About to call withTs");let r=bO(e,t??Zf());Ke(`[finalizeApplogForInsert] About to call withPvFrom (thread size=${n?.size??"null"})`);let i=_O(r,n);Ke("[finalizeApplogForInsert] About to call encodeApplogAndGetCid");let o=nO(i).toString();Ke(`[finalizeApplogForInsert] CID created: ${o}`),e.cid&&e.cid!==o&&hO("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:o,logWithPv:i});let s={...i,cid:o};if(Ke("[finalizeApplogForInsert] About to validate applog"),!Kf(s))throw Ao(`Bogus Applog ${JSON.stringify(s)}`,Q1(s));return Ke(`[finalizeApplogForInsert] EXIT - CID=${o}`),Object.freeze(s)}function mO(e){return!!e.ts}function vO(e){return!!e.pv}function bO(e,t){return mO(e)?e:{...e,ts:t}}function _O(e,t){if(Ke(`[withPvFrom] ENTER - en=${e.en}, at=${e.at}, hasPv=${e.pv!==void 0}`),e.pv!==void 0)return Ke("[withPvFrom] EXIT early - pv already set"),e;if(t){let{en:n,at:r}=e;Ke(`[withPvFrom] About to call thread.findLast for en=${n}, at=${r}, thread.size=${t.size}`);let i=t.findLast(s=>s.en==n&&s.at==r);if(Ke(`[withPvFrom] findLast completed, found=${!!i}`),Ke("[withPvFrom] About to check equality"),Jf(["en","at","vl","ts","ag"],e,i))throw Ao("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let o=(e.pv!==void 0?e.pv:i?.cid)??null;return Ke(`[withPvFrom] EXIT - prevLogCid=${o}`),{...e,pv:o}}else{if(!vO(e))throw Ao("[withPvFrom] no thread and no pv:",e);return Ke("[withPvFrom] EXIT - no thread, returning log with existing pv"),e}}function jo(e){let t=()=>(Pe(()=>e.length<2&&Ke(`joinThreads with count=${e.length}`)),pi(Xf(e.flatMap(i=>{let o=i.applogs;if(!o)throw Ao("falsy applogs of thread",i),new Error("falsy applogs of thread");return o}),"cleanup"))),n=Pe(()=>t()),r=at(function(i,o){return un(i)?{init:Pe(()=>t())}:{added:i.added.filter(s=>!this.hasApplog(s,!0)),removed:i.removed?.filter(s=>!!this.parents.some(l=>l===o?!1:l.hasApplog(s,!0)))}});return new Fo(Pe(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],n,r)}var{WARN:vl,LOG:zS,DEBUG:bl,VERBOSE:qn,ERROR:eo}=$e.setup($e.INFO),Fo=class ea extends Er{constructor(t,n,r,i,o,s=null,a){super(t,n,r,o?Ce.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=o,this._writeMapper=s,this._readOnly=a,bn(this,{onParentUpdate:at}),o&&this.subscribeToParents()}static mapWrites(t,n,r){return new ea(`${n}<${t.nameAndSizeUntracked}>`,t,t.filters,t._applogs,null,r)}static asReadOnly(t){return t.readOnly?t:new ea(`readOnly(${t.name})`,t,t.filters,t._applogs,null,null,!0)}_parentSubscriptions=null;insert(t){if(this.readOnly)throw eo("[MappedThread] insert() called on read-only thread:",this.nameAndSizeUntracked);let n=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!n))return this.parents.forEach(r=>r.insert(n))}insertRaw(t){if(this.readOnly)throw eo("[MappedThread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);let n=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!n))return this.parents.forEach(r=>r.insertRaw(n))}subscribeToParents(){this._parentSubscriptions=new Map;let t=St(()=>{this.parents.length||vl("MappedThread has no parents",this),qn(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(r=>r.name));let n=new Set([...this._parentSubscriptions.keys()]);for(let r of this.parents){n.delete(r)&&qn(`[MappedThread: ${this.name}] Skipping re-sub to parent`,r.nameAndSizeUntracked),qn(`[MappedThread: ${this.name}] sub to new parent`,r.nameAndSizeUntracked);let o=this.onParentUpdate.bind(this,r),s=r.subscribe(o);this._parentSubscriptions.set(r,s)}for(let r of n)qn(`[MappedThread: ${this.name}] un-subscribing from old parent`,r.nameAndSizeUntracked),this._parentSubscriptions.get(r)(),this._parentSubscriptions.delete(r)})}subscribe(t){return this._parentSubscriptions||this.subscribeToParents(),super.subscribe(t)}triggerRemap(){if(!this._eventMapper)throw eo("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);bl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&vl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Pe(()=>sn(t.applogs))})})}onParentUpdate(t,n){qn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,n);let r=this._eventMapper?this._eventMapper(n,t):n;if(this._eventMapper)if(qn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,r),un(r))this._applogs.replace([...r.init]);else{for(let i of r.added)this._applogs.splice(p0(this._applogs,i,"ts"),0,i);if(r.removed){for(let i of r.removed)if(!this._applogs.remove(i))if(!un(n)&&n.removed?.includes(i))bl("Ignoring remove event for non-existent because it was part of parent event's removed",i,n);else throw eo(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:n,mapResult:r})}}qn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Yr(this._applogs)),this.notifySubscribers(r)}get readOnly(){return this._readOnly??!1}},{WARN:VS,LOG:KS,DEBUG:qS,VERBOSE:Vs,ERROR:wO}=$e.setup($e.INFO),In=Qe("rollingFilter",function(t,n,r={}){let i=TO(n),o=_l(i),s=Ce.array(Pe(function(){return o(t.applogs)}),{deep:!1,name:`${t.name} | ${r.name||`rollingFilter.array{${Hn(i)}}`}`}),a=g=>{let C;return un(g)?C={init:o(g.init)}:C={added:o(g.added),removed:g.removed},Vs(`rollingFilter{${t.nameAndSizeUntracked} | ${r.name?` '${r.name}'}`:""} parentUpdate`,i,g,"=>",C),C},l=new Fo(`${t.name} | ${r.name||`rollingFilter{${Hn(i)}}`}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],s,a),c=Zu(()=>sn(n),g=>{Vs(`rollingFilter<${t.nameAndSizeUntracked}>${r.name?` '${r.name}'`:""} patternUpdate`,i,"=>",g),i=g,o=_l(i),l.triggerRemap()}),d=zn(s,()=>{Vs(`rollingFilter<${Pe(()=>t.name)}>${r.name?` '${r.name}'`:""} unobserve`,i),c(),d()});return l},{equals:Cr,argsDebugName:(e,t,n)=>Je({caller:"rollingFilter",thread:e,pattern:t,args:n})}),ed=Qe("rollingMapper",function(t,n,r={}){let i=Pe(()=>n.call(null,{init:t.applogs},t));if(!un(i))throw wO("Initial run must return init event");let o=i.init;return new Fo(`${t.name} | ${r.name||"rollingMapper"}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],o,n)},{equals:Cr,argsDebugName:(e,t,n)=>Je({caller:"rollingMapper",thread:e,args:n})}),GS=Qe("rollingAcc",function(t,n,r,i={}){let o=at(r);return o({init:t.applogs},n),t.subscribe(s=>{o(s,n)}),n},{argsDebugName:(e,t,n,r)=>`rollingAcc{${e.nameAndSizeUntracked}${r?.name?` | ${r?.name}`:""}}`}),TO=function(t){let n=Pe(function(){return Object.fromEntries(Object.entries(sn(t)).map(([i,o])=>[sn(i),sn(o)]))});if(!Object.entries(n).length)throw new Error("Pattern is empty");return n};function _l(e){return function(n){return n.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(!pO(o,s,a))return!1}return!0})}}var WS=Fo.asReadOnly;var{WARN:AO,LOG:OO,DEBUG:Ve,VERBOSE:td,ERROR:io}=$e.setup($e.INFO),EO=class extends Er{constructor(e,t=[],n){super(e,null,n,t),bn(this,{})}purge(e){let t=this.applogs.length;return this._applogs=this.applogs.filter(n=>!e.includes(n.cid)),t-this.applogs.length}insert(e){Ve(`[WriteableThread.insert] ENTER - ${e.length} applogs for thread "${this.name}"`),Ve("[WriteableThread.insert] About to call ensureTsPvAndFinalizeApplogs");let t=yO(e,this);Ve(`[WriteableThread.insert] ensureTsPvAndFinalizeApplogs completed, mapped=${t.length} applogs`),Ve("[WriteableThread.insert] About to call insertRaw");let n=this.insertRaw(t);return Ve("[WriteableThread.insert] insertRaw completed"),n}insertMissing(e,t=!1){let n=e.filter(r=>!this.hasApplog(r,t));return n.length===0?(td("[insertMissing] no missing applogs"),[]):this.insertRaw(n)??[]}insertRaw(e){Ve(`[WriteableThread.insertRaw] ENTER - ${e.length} applogs for thread "${this.name}"`),Ve("[WriteableThread.insertRaw] About to deduplicate");let t=Xf(e,"safety");if(t.length!==e.length)throw io(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});Ve("[WriteableThread.insertRaw] Deduplication done"),Ve("[WriteableThread.insertRaw] About to validate");let n=e.filter(o=>!Kf(o));if(n.length)throw io(`[insertRaw] bogus applogs passed: ${n.length}`,{bogus:n});Ve("[WriteableThread.insertRaw] Validation done"),Ve("[WriteableThread.insertRaw] About to check for existing");let r=e.filter(o=>this.hasApplog(o,!1));if(r.length)throw io(`[insertRaw] already existing applogs passed: ${r.length}`,{existing:r});if(Ve("[WriteableThread.insertRaw] Existing check done"),!e.length){AO("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof Ca)?OO:Ve)("Inserting:",e.length===1?e[0]:e,{ds:this}),Ve("[WriteableThread.insertRaw] About to sort applogs"),pi(e);let i=this._applogs.length&&uO(e[0],this._applogs[this._applogs.length-1]);return Ve("[WriteableThread.insertRaw] About to push to _applogs array"),this._applogs.push(...e),i&&(Ve("[WriteableThread.insertRaw] About to sort _applogs (sortNeeded=true)"),pi(this._applogs)),Ve("[WriteableThread.insertRaw] About to notify subscribers"),this.notifySubscribers({added:e,removed:null}),Ve("[WriteableThread.insertRaw] Subscribers notified"),Ve("[WriteableThread.insertRaw] About to call persist (void - not awaited)"),this.persist(e),Ve(`[WriteableThread.insertRaw] EXIT - returning ${e.length} applogs`),e}get readOnly(){return!1}},Ca=class oo extends EO{constructor(t,n,r,i){super(t,n,r),this._readOnly=i,bn(this,{_applogs:Ce.shallow})}static empty(t){return oo.fromArray([],t??"empty in-memory",!1)}static fromArray(t,n,r=!1){return new oo(n??"in-memory",t,[],r)}static fromReadOnlyArray(t,n){return new oo(n??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if(td("[InMem.persist] no persist for",t),this.readOnly)throw io("[persist] called for readOnly thread")}},{WARN:HS,LOG:JS,DEBUG:XS,VERBOSE:YS,ERROR:QS}=$e.setup($e.INFO);var{WARN:B$,LOG:D$,DEBUG:L$,VERBOSE:k$,ERROR:j$}=$e.setup($e.INFO);function xa(e){return Qf(e,31,7)}var SO=class{constructor(e,t,n=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=n,bn(this,{threadOfTrail:Le})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?jo([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},nd=class{constructor(e){this.nodes=e,bn(this,{threadOfAllTrails:Le,size:Le,isEmpty:Le})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Pe(()=>this.records.length)}get records(){return Yt(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return jo(Yt(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogSet(){return Yt(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogSet"})}get leafNodeLogs(){return Yt(()=>this.nodes.flatMap(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return jo(Yt(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:q$,LOG:zo,DEBUG:cn,VERBOSE:Te,ERROR:nr}=$e.setup($e.INFO,{prefix:"[q]"}),Ua=null,$O=Qe("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:n,tolerateAlreadyFiltered:r}={}){if(Te(`lastWriteWins${n?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(r)return cn("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw nr("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,o=ed(t,function(a,l){let c=un(a),d,g=[],C=c?null:[];c?(i=new Map,d=a.init):d=a.added;let I;for(let S=n?0:d.length-1;n?S<d.length:S>=0;n?S++:S--){let z=d[S],J=z.en+"|"+z.at;if(I&&(n?I>z.ts:I<z.ts))throw nr("lastWriteWins.mapper logs not sorted:",I,n?">":"<",z.ts,{log:z,i:S,newLogs:d,inverseToOnlyReturnFirstLogs:n});I=z.ts;let F=i.get(J);(!F||(n?F.ts>z.ts:F.ts<z.ts))&&(F&&!c&&C.push(F),g.push(z),i.set(J,z))}return pi(g),Te.isDisabled||Te(`lastWriteWins${n?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,c?{...Object.fromEntries(Object.entries(a).map(([S,z])=>[S,z?.length])),toAdd:g.length,toRemove:C}:{...a,toAdd:g,toRemove:C}),c?{init:g}:{added:g,removed:C}},{name:`lastWriteWins${n?".inversed":""}`,extraFilterName:"lastWriteWins"});return Te.isDisabled||St(()=>{Te(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,o.applogs.length)}),o},{equals:Cr,argsDebugName:e=>Je({caller:"lastWriteWins",thread:e})}),G$=Qe("withoutDeleted",function(t){if(Te.isEnabled&&Te(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw nr("thread already filtered withoutDeleted:",t.filters,{name:t.name});let n=In(t,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});Te.isEnabled&&Te(`withoutDeleted<${t.nameAndSizeUntracked}> deletionLogs:`,Pe(function(){return[...n.applogs]}));let r=Je({caller:"allDeletedEntities",thread:t}),i=hf(function(){return n.map(s=>s.en)},{name:r});return Te.isEnabled&&St(()=>{Te(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),In(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:Cr}),rd=Qe("query",function e(t,n,r={},i={}){BO();let o=id(t);cn(`query<${o.nameAndSizeUntracked}>:`,n);let s=Array.isArray(n)?n:[n],a;if(s.length===1)a=null;else{let d=s.slice(0,-1);a=e(o,d,r,i)}let l=s[s.length-1],c=NO(o,a,l,i);return Te.isDisabled||St(()=>Te("query result:",sn(c))),c},{equals:xo,argsDebugName:(e,t,n)=>Je({caller:"query",thread:e,args:n?{pattern:t,startVars:n}:t})}),NO=Qe("queryStep",function(t,n,r,i={}){if(cn(`queryStep<${t.nameAndSizeUntracked}> with`,n?.untrackedSize??"all","nodes, pattern:",r),!Object.entries(r).length)throw new Error("Pattern is empty");function o(a){let[l,c]=Pa(r,a?.variables??{});Te("[queryStep.doQuery] patternWithoutVars: ",l);let d=In(t,l),g=Vo(c),C=Yt(function(){let S=d.map(z=>({log:z,vars:g(z)}));return Te.isEnabled&&Te("[queryStep.doQuery] step node:",a?.variables," =>",S,"from:",Pe(()=>d.applogs)),S.map(({log:z,vars:J})=>{let F=Object.assign({},a?.variables,J);return new SO(gf.fromArray([z],Je({caller:"QueryNode",thread:d,pattern:`${Hn(F)}@${Hn(l)}`})),F,a)})},{name:Je({caller:"doQuery.mapNodes",thread:d,pattern:r})});return Te.isEnabled&&St(()=>Te("[queryStep.doQuery] resultNodes:",[...C])),i.debug&&zo("[queryStep] step result:",Pe(()=>C.map(({variables:I,logsOfThisNode:S})=>({variables:I,thread:S})))),C}let s=Yt(function(){return cn(`[queryStep] Running with ${n?.nodes?.length} input nodes:`),n?[...n.nodes.flatMap(o)]:[...o(null)]},{name:Je({caller:"queryStep",thread:t,pattern:r})});return Te.isEnabled&&St(()=>Te("[queryStep] observableResultNodes:",[...s])),new nd(s)},{equals:xo,argsDebugName:(e,t,n)=>Je({caller:"queryStep",thread:e,pattern:n})}),W$=Qe("queryNot",function(t,n,r,i={}){let o=n.nodes;cn(`queryNot<${t.nameAndSizeUntracked}> from: ${o.length} nodes`);let s=Array.isArray(r)?r:[r];for(let a of s){if(!Object.entries(r).length)throw new Error("Pattern is empty");o=o.filter(function({variables:c}){let[d,g]=Pa(a,c??{});Te("[queryNot] patternWithoutVars: ",d);let C=In(t,d);return Te("[queryNot] step node:",c," =>",C.size,"applogs"),Te.isDisabled||Te("[queryNot] step node:",c," => empty?",Pe(()=>C.applogs)),i.debug&&zo("[queryNot] node result:",c,"=>",C.applogs),C.isEmpty})}return new nd(o)},{equals:xo,argsDebugName:(e,t,n)=>Je({caller:"queryNot",thread:e,pattern:n})}),H$=Qe("filterAndMap",function(t,n,r){cn(`filterAndMap<${t.nameAndSizeUntracked}>`,n);let i=In(t,n);Te.isEnabled&&(Te("[filterAndMap] filtered:",i.untrackedSize),St(()=>Te("[filterAndMap] filtered:",i.applogs)));let o=Je({thread:t,pattern:n,caller:"filterAndMap"}),s=Yt(()=>CO(i,r),{name:o});return Te.isDisabled||St(()=>Te("[filterAndMap] mapped:",s)),s},{equals:ze.structural,argsDebugName:(e,t)=>Je({caller:"filterAndMap",thread:e,pattern:t})}),J$=Qe("queryAndMap",function(t,n,r,i={}){let o=id(t);cn(`queryAndMap<${o.nameAndSizeUntracked}>`,{patternOrPatterns:n,variables:i,map:r});let s=Je({thread:o,caller:"queryAndMap"}),a=rd(o,n);Te("[queryAndMap] filtered count:",a.untrackedSize);let l=Yt(()=>xO(a,r),{name:s});return Te.isDisabled||St(()=>Te("[queryAndMap] result:",sn(l))),l},{equals:ze.structural,argsDebugName:(e,t)=>Je({caller:"queryAndMap",thread:e,pattern:t})}),X$=Qe("queryEntity",function(t,n,r,i){cn(`queryEntity<${t.nameAndSizeUntracked}>`,r,n);let o=In(t,{en:r,at:UO(n,i)});return Te("queryEntity applogs:",o.applogs),Le(()=>o.isEmpty?null:Object.fromEntries(o.map(({at:s,vl:a})=>[s.slice(n.length+1),a])))},{equals:pf,argsDebugName:(e,t,n)=>Je({caller:"queryEntity",thread:e,args:{name:t,entityID:n}})}),Y$=Qe("agentsOfThread",function(t){cn(`agentsOfThread<${t.nameAndSizeUntracked}>`);let n=Ce.map(),r=at(o=>{for(let s of un(o)?o.init:o.added){let a=n.get(s.ag)??0;n.set(s.ag,a+1)}for(let s of!un(o)&&o.removed||[]){let a=n.get(s.ag);if(!a||a<1)throw nr("[agentsOfThread] number is now negative",{log:s,event:o,mapped:n,prev:a});n.set(s.ag,a-1)}zo(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:o,mapped:n})});r({init:t.applogs});let i=t.subscribe(r);return _r(n,i),n}),RO=Qe("entityOverlap",function(t,n){return zo(`entityOverlap<${t.nameAndSizeUntracked}, ${n.nameAndSizeUntracked}>`),Le(()=>{let r=new Set(t.map(o=>o.en)),i=new Set(n.map(o=>o.en));return[...r].filter(o=>i.has(o))})});var Q$=Qe("entityOverlapCount",function(t,n){return Le(()=>RO(t,n).get().length)}),PO=Qe("querySingle",function(t,n,r={}){let i=rd(t,n,r);return Le(()=>{if(i.isEmpty)return null;if(i.size>1)throw nr("[querySingle] got",i.size,"results:",i);let o=i.nodes[0].logsOfThisNode;if(o.size!=1)throw nr("[querySingle] single result, but got",o.size,"logs:",o.applogs);return o.applogs[0]})},{equals:ze.structural,argsDebugName:(e,t)=>Je({caller:"querySingle",thread:e,pattern:t})}),Z$=Qe("querySingleAndMap",function(t,n,r,i={}){let o=PO(t,n,i);return Le(()=>{let s=o.get();if(s)return typeof r=="string"?s[r]:Vo(r)(s)})},{equals:ze.structural,argsDebugName:(e,t)=>Je({caller:"querySingleAndMap",thread:e,pattern:t})}),CO=function(t,n){return typeof n=="function"?t.map(n):typeof n=="string"?t.map(r=>r[n]):t.map(Vo(n))},xO=function(t,n){return typeof n=="function"?t.records.map(n):typeof n=="string"?t.nodes.map(r=>{if(!Object.hasOwn(r.record,n)){if(r.logsOfThisNode.size!==1)throw nr(`not sure what to map (it's not a var and a result node log count of ${r.logsOfThisNode.size})`);return r.logsOfThisNode.firstLog[n]}return r.record[n]}):t.nodes.map(r=>Vo(n)(t))};function Vo(e){return t=>Object.entries(e).reduce((n,[r,i])=>(n[i]=t[r],n),{})}function UO(e,t){return t.map(n=>MO(e,n))}function MO(e,t){return`${e}/${t}`}function id(e,t){return Array.isArray(e)?Ca.fromArray(e,t||`threadFromArray[${e.length}]`,!0):e}function BO(){if(Ua!=null&&performance.now()>=Ua)throw new DO(Ua)}var DO=class extends Error{constructor(e){super(e)}};var LO=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=s;var n=128,r=127,i=~r,o=Math.pow(2,31);function s(a,l,c){if(Number.MAX_SAFE_INTEGER&&a>Number.MAX_SAFE_INTEGER)throw s.bytes=0,new RangeError("Could not encode varint");l=l||[],c=c||0;for(var d=c;a>=o;)l[c++]=a&255|n,a/=128;for(;a&i;)l[c++]=a&255|n,a>>>=7;return l[c]=a|0,s.bytes=c-d+1,l}}}),kO=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){"use strict";t.exports=i;var n=128,r=127;function i(o,l){var a=0,l=l||0,c=0,d=l,g,C=o.length;do{if(d>=C||c>49)throw i.bytes=0,new RangeError("Could not decode varint");g=o[d++],a+=c<28?(g&r)<<c:(g&r)*Math.pow(2,c),c+=7}while(g>=n);return i.bytes=d-l,a}}}),jO=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){"use strict";var n=Math.pow(2,7),r=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),s=Math.pow(2,35),a=Math.pow(2,42),l=Math.pow(2,49),c=Math.pow(2,56),d=Math.pow(2,63);t.exports=function(g){return g<n?1:g<r?2:g<i?3:g<o?4:g<s?5:g<a?6:g<l?7:g<c?8:g<d?9:10}}}),ja=De({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:LO(),decode:kO(),encodingLength:jO()}}}),FO=["Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function zO(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(t==="string"||t==="number"||t==="bigint"||t==="symbol")return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(e instanceof Uint8Array)return"Uint8Array";if(e.constructor===Object)return"Object";let n=VO(e);return n||"Object"}function VO(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(FO.includes(t))return t}var V=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}static equals(e,t){return e===t||e.major===t.major&&e.name===t.name}};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 pe=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},wi=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",KO=new TextEncoder;function Go(e){return wi&&globalThis.Buffer.isBuffer(e)}function yd(e){return e instanceof Uint8Array?Go(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var qO=24,GO=200,WO=wi?e=>e.length>=qO?globalThis.Buffer.from(e):od(e):e=>e.length>=GO?KO.encode(e):od(e),ln=e=>Uint8Array.from(e),HO=wi?(e,t,n)=>Go(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n):(e,t,n)=>e.slice(t,n),JO=wi?(e,t)=>(e=e.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),yd(globalThis.Buffer.concat(e,t))):(e,t)=>{let n=new Uint8Array(t),r=0;for(let i of e)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n},XO=wi?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function gd(e,t){if(Go(e)&&Go(t))return e.compare(t);for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return 0}function od(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(i>=55296&&i<=57343&&(i=65533),t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}var YO=256,md=class{constructor(e=YO){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 r=t.length-(this.maxCursor-this.cursor)-1;t.set(e,r)}else{if(t){let r=t.length-(this.maxCursor-this.cursor)-1;r<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,r),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=XO(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 n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=HO(n,0,this.cursor)}else t=JO(this.chunks,this.cursor);return e&&this.reset(),t}},QO=class{constructor(e){this.dest=e,this.cursor=0,this.chunks=[e]}reset(){this.cursor=0}push(e){if(this.cursor+e.length>this.dest.length)throw new Error("write out of bounds, destination buffer is too small");this.dest.set(e,this.cursor),this.cursor+=e.length}toBytes(e=!1){let t=this.dest.subarray(0,this.cursor);return e&&this.reset(),t}},Be="CBOR decode error:",vd="CBOR encode error:",Ti=[];Ti[23]=1;Ti[24]=2;Ti[25]=3;Ti[26]=5;Ti[27]=9;function Dr(e,t,n){if(e.length-t<n)throw new Error(`${Be} not enough data for type`)}var Ze=[24,256,65536,4294967296,BigInt("18446744073709551616")];function rr(e,t,n){Dr(e,t,1);let r=e[t];if(n.strict===!0&&r<Ze[0])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);return r}function ir(e,t,n){Dr(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<Ze[1])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);return r}function or(e,t,n){Dr(e,t,4);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(n.strict===!0&&r<Ze[2])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);return r}function sr(e,t,n){Dr(e,t,8);let r=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(r)<<BigInt(32))+BigInt(i);if(n.strict===!0&&o<Ze[3])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(n.allowBigInt===!0)return o;throw new Error(`${Be} integers outside of the safe integer range are not supported`)}function ZO(e,t,n,r){return new pe(V.uint,rr(e,t+1,r),2)}function eE(e,t,n,r){return new pe(V.uint,ir(e,t+1,r),3)}function tE(e,t,n,r){return new pe(V.uint,or(e,t+1,r),5)}function nE(e,t,n,r){return new pe(V.uint,sr(e,t+1,r),9)}function ar(e,t){return Ct(e,0,t.value)}function Ct(e,t,n){if(n<Ze[0]){let r=Number(n);e.push([t|r])}else if(n<Ze[1]){let r=Number(n);e.push([t|24,r])}else if(n<Ze[2]){let r=Number(n);e.push([t|25,r>>>8,r&255])}else if(n<Ze[3]){let r=Number(n);e.push([t|26,r>>>24&255,r>>>16&255,r>>>8&255,r&255])}else{let r=BigInt(n);if(r<Ze[4]){let i=[t|27,0,0,0,0,0,0,0],o=Number(r&BigInt(4294967295)),s=Number(r>>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(`${Be} encountered BigInt larger than allowable range`)}}ar.encodedSize=function(t){return Ct.encodedSize(t.value)};Ct.encodedSize=function(t){return t<Ze[0]?1:t<Ze[1]?2:t<Ze[2]?3:t<Ze[3]?5:9};ar.compareTokens=function(t,n){return t.value<n.value?-1:t.value>n.value?1:0};function rE(e,t,n,r){return new pe(V.negint,-1-rr(e,t+1,r),2)}function iE(e,t,n,r){return new pe(V.negint,-1-ir(e,t+1,r),3)}function oE(e,t,n,r){return new pe(V.negint,-1-or(e,t+1,r),5)}var Fa=BigInt(-1),bd=BigInt(1);function sE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new pe(V.negint,o,9)}if(r.allowBigInt!==!0)throw new Error(`${Be} integers outside of the safe integer range are not supported`);return new pe(V.negint,Fa-BigInt(i),9)}function za(e,t){let n=t.value,r=typeof n=="bigint"?n*Fa-bd:n*-1-1;Ct(e,t.type.majorEncoded,r)}za.encodedSize=function(t){let n=t.value,r=typeof n=="bigint"?n*Fa-bd:n*-1-1;return r<Ze[0]?1:r<Ze[1]?2:r<Ze[2]?3:r<Ze[3]?5:9};za.compareTokens=function(t,n){return t.value<n.value?1:t.value>n.value?-1:0};function Ai(e,t,n,r){Dr(e,t,n+r);let i=e.slice(t+n,t+n+r);return new pe(V.bytes,i,n+r)}function aE(e,t,n,r){return Ai(e,t,1,n)}function uE(e,t,n,r){return Ai(e,t,2,rr(e,t+1,r))}function cE(e,t,n,r){return Ai(e,t,3,ir(e,t+1,r))}function lE(e,t,n,r){return Ai(e,t,5,or(e,t+1,r))}function fE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer bytes lengths not supported`);return Ai(e,t,9,i)}function Wo(e){return e.encodedBytes===void 0&&(e.encodedBytes=V.equals(e.type,V.string)?WO(e.value):e.value),e.encodedBytes}function Yo(e,t){let n=Wo(t);Ct(e,t.type.majorEncoded,n.length),e.push(n)}Yo.encodedSize=function(t){let n=Wo(t);return Ct.encodedSize(n.length)+n.length};Yo.compareTokens=function(t,n){return dE(Wo(t),Wo(n))};function dE(e,t){return e.length<t.length?-1:e.length>t.length?1:gd(e,t)}var sd=new TextDecoder,pE=32;function hE(e,t,n){if(n-t<pE){let i="";for(let o=t;o<n;o++){let s=e[o];if(s&128)return sd.decode(e.subarray(t,n));i+=String.fromCharCode(s)}return i}return sd.decode(e.subarray(t,n))}function Oi(e,t,n,r,i){let o=n+r;Dr(e,t,o);let s=new pe(V.string,hE(e,t+n,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=e.slice(t+n,t+o)),s}function yE(e,t,n,r){return Oi(e,t,1,n,r)}function gE(e,t,n,r){return Oi(e,t,2,rr(e,t+1,r),r)}function mE(e,t,n,r){return Oi(e,t,3,ir(e,t+1,r),r)}function vE(e,t,n,r){return Oi(e,t,5,or(e,t+1,r),r)}function bE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer string lengths not supported`);return Oi(e,t,9,i,r)}var _E=Yo;function Lr(e,t,n,r){return new pe(V.array,r,n)}function wE(e,t,n,r){return Lr(e,t,1,n)}function TE(e,t,n,r){return Lr(e,t,2,rr(e,t+1,r))}function AE(e,t,n,r){return Lr(e,t,3,ir(e,t+1,r))}function OE(e,t,n,r){return Lr(e,t,5,or(e,t+1,r))}function EE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer array lengths not supported`);return Lr(e,t,9,i)}function IE(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${Be} indefinite length items not allowed`);return Lr(e,t,1,1/0)}function Va(e,t){Ct(e,V.array.majorEncoded,t.value)}Va.compareTokens=ar.compareTokens;Va.encodedSize=function(t){return Ct.encodedSize(t.value)};function kr(e,t,n,r){return new pe(V.map,r,n)}function SE(e,t,n,r){return kr(e,t,1,n)}function $E(e,t,n,r){return kr(e,t,2,rr(e,t+1,r))}function NE(e,t,n,r){return kr(e,t,3,ir(e,t+1,r))}function RE(e,t,n,r){return kr(e,t,5,or(e,t+1,r))}function PE(e,t,n,r){let i=sr(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer map lengths not supported`);return kr(e,t,9,i)}function CE(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${Be} indefinite length items not allowed`);return kr(e,t,1,1/0)}function Ka(e,t){Ct(e,V.map.majorEncoded,t.value)}Ka.compareTokens=ar.compareTokens;Ka.encodedSize=function(t){return Ct.encodedSize(t.value)};function xE(e,t,n,r){return new pe(V.tag,n,1)}function UE(e,t,n,r){return new pe(V.tag,rr(e,t+1,r),2)}function ME(e,t,n,r){return new pe(V.tag,ir(e,t+1,r),3)}function BE(e,t,n,r){return new pe(V.tag,or(e,t+1,r),5)}function DE(e,t,n,r){return new pe(V.tag,sr(e,t+1,r),9)}function qa(e,t){Ct(e,V.tag.majorEncoded,t.value)}qa.compareTokens=ar.compareTokens;qa.encodedSize=function(t){return Ct.encodedSize(t.value)};var _d=20,wd=21,Td=22,Ad=23;function LE(e,t,n,r){if(r.allowUndefined===!1)throw new Error(`${Be} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new pe(V.null,null,1):new pe(V.undefined,void 0,1)}function kE(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${Be} indefinite length items not allowed`);return new pe(V.break,void 0,1)}function Ga(e,t,n){if(n){if(n.allowNaN===!1&&Number.isNaN(e))throw new Error(`${Be} NaN values are not supported`);if(n.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${Be} Infinity values are not supported`)}return new pe(V.float,e,t)}function jE(e,t,n,r){return Ga(Ha(e,t+1),3,r)}function FE(e,t,n,r){return Ga(Ja(e,t+1),5,r)}function zE(e,t,n,r){return Ga(Sd(e,t+1),9,r)}function Wa(e,t,n){let r=t.value;if(r===!1)e.push([V.float.majorEncoded|_d]);else if(r===!0)e.push([V.float.majorEncoded|wd]);else if(r===null)e.push([V.float.majorEncoded|Td]);else if(r===void 0)e.push([V.float.majorEncoded|Ad]);else{let i,o=!1;(!n||n.float64!==!0)&&(Ed(r),i=Ha(Kt,1),r===i||Number.isNaN(r)?(Kt[0]=249,e.push(Kt.slice(0,3)),o=!0):(Id(r),i=Ja(Kt,1),r===i&&(Kt[0]=250,e.push(Kt.slice(0,5)),o=!0))),o||(VE(r),i=Sd(Kt,1),Kt[0]=251,e.push(Kt.slice(0,9)))}}Wa.encodedSize=function(t,n){let r=t.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){Ed(r);let i=Ha(Kt,1);if(r===i||Number.isNaN(r))return 3;if(Id(r),i=Ja(Kt,1),r===i)return 5}return 9};var Od=new ArrayBuffer(9),Pt=new DataView(Od,1),Kt=new Uint8Array(Od,0);function Ed(e){if(e===1/0)Pt.setUint16(0,31744,!1);else if(e===-1/0)Pt.setUint16(0,64512,!1);else if(Number.isNaN(e))Pt.setUint16(0,32256,!1);else{Pt.setFloat32(0,e);let t=Pt.getUint32(0),n=(t&2139095040)>>23,r=t&8388607;if(n===255)Pt.setUint16(0,31744,!1);else if(n===0)Pt.setUint16(0,(e&2147483648)>>16|r>>13,!1);else{let i=n-127;i<-24?Pt.setUint16(0,0):i<-14?Pt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):Pt.setUint16(0,(t&2147483648)>>16|i+15<<10|r>>13,!1)}}}function Ha(e,t){if(e.length-t<2)throw new Error(`${Be} not enough data for float16`);let n=(e[t]<<8)+e[t+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;let r=n>>10&31,i=n&1023,o;return r===0?o=i*2**-24:r!==31?o=(i+1024)*2**(r-25):o=i===0?1/0:NaN,n&32768?-o:o}function Id(e){Pt.setFloat32(0,e,!1)}function Ja(e,t){if(e.length-t<4)throw new Error(`${Be} not enough data for float32`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,4).getFloat32(0,!1)}function VE(e){Pt.setFloat64(0,e,!1)}function Sd(e,t){if(e.length-t<8)throw new Error(`${Be} not enough data for float64`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,8).getFloat64(0,!1)}Wa.compareTokens=ar.compareTokens;function Ie(e,t,n){throw new Error(`${Be} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function Qo(e){return()=>{throw new Error(`${Be} ${e}`)}}var ue=[];for(let e=0;e<=23;e++)ue[e]=Ie;ue[24]=ZO;ue[25]=eE;ue[26]=tE;ue[27]=nE;ue[28]=Ie;ue[29]=Ie;ue[30]=Ie;ue[31]=Ie;for(let e=32;e<=55;e++)ue[e]=Ie;ue[56]=rE;ue[57]=iE;ue[58]=oE;ue[59]=sE;ue[60]=Ie;ue[61]=Ie;ue[62]=Ie;ue[63]=Ie;for(let e=64;e<=87;e++)ue[e]=aE;ue[88]=uE;ue[89]=cE;ue[90]=lE;ue[91]=fE;ue[92]=Ie;ue[93]=Ie;ue[94]=Ie;ue[95]=Qo("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ue[e]=yE;ue[120]=gE;ue[121]=mE;ue[122]=vE;ue[123]=bE;ue[124]=Ie;ue[125]=Ie;ue[126]=Ie;ue[127]=Qo("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ue[e]=wE;ue[152]=TE;ue[153]=AE;ue[154]=OE;ue[155]=EE;ue[156]=Ie;ue[157]=Ie;ue[158]=Ie;ue[159]=IE;for(let e=160;e<=183;e++)ue[e]=SE;ue[184]=$E;ue[185]=NE;ue[186]=RE;ue[187]=PE;ue[188]=Ie;ue[189]=Ie;ue[190]=Ie;ue[191]=CE;for(let e=192;e<=215;e++)ue[e]=xE;ue[216]=UE;ue[217]=ME;ue[218]=BE;ue[219]=DE;ue[220]=Ie;ue[221]=Ie;ue[222]=Ie;ue[223]=Ie;for(let e=224;e<=243;e++)ue[e]=Qo("simple values are not supported");ue[244]=Ie;ue[245]=Ie;ue[246]=Ie;ue[247]=LE;ue[248]=Qo("simple values are not supported");ue[249]=jE;ue[250]=FE;ue[251]=zE;ue[252]=Ie;ue[253]=Ie;ue[254]=Ie;ue[255]=kE;var fn=[];for(let e=0;e<24;e++)fn[e]=new pe(V.uint,e,1);for(let e=-1;e>=-24;e--)fn[31-e]=new pe(V.negint,e,1);fn[64]=new pe(V.bytes,new Uint8Array(0),1);fn[96]=new pe(V.string,"",1);fn[128]=new pe(V.array,0,1);fn[160]=new pe(V.map,0,1);fn[244]=new pe(V.false,!1,1);fn[245]=new pe(V.true,!0,1);fn[246]=new pe(V.null,null,1);function KE(e){switch(e.type){case V.false:return ln([244]);case V.true:return ln([245]);case V.null:return ln([246]);case V.bytes:return e.value.length?void 0:ln([64]);case V.string:return e.value===""?ln([96]):void 0;case V.array:return e.value===0?ln([128]):void 0;case V.map:return e.value===0?ln([160]):void 0;case V.uint:return e.value<24?ln([Number(e.value)]):void 0;case V.negint:if(e.value>=-24)return ln([31-Number(e.value)])}}var qE=Object.freeze({float64:!0,mapSorter:JE,quickEncodeToken:KE});function $d(){let e=[];return e[V.uint.major]=ar,e[V.negint.major]=za,e[V.bytes.major]=Yo,e[V.string.major]=_E,e[V.array.major]=Va,e[V.map.major]=Ka,e[V.tag.major]=qa,e[V.float.major]=Wa,e}var GE=$d(),WE=new md,ad=class Nd{constructor(t,n){this.obj=t,this.parent=n}includes(t){let n=this;do if(n.obj===t)return!0;while(n=n.parent);return!1}static createCheck(t,n){if(t&&t.includes(n))throw new Error(`${vd} object contains circular references`);return new Nd(n,t)}},Sn={null:new pe(V.null,null),undefined:new pe(V.undefined,void 0),true:new pe(V.true,!0),false:new pe(V.false,!1),emptyArray:new pe(V.array,0),emptyMap:new pe(V.map,0)},Rn={number(e,t,n,r){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new pe(V.float,e):e>=0?new pe(V.uint,e):new pe(V.negint,e)},bigint(e,t,n,r){return e>=BigInt(0)?new pe(V.uint,e):new pe(V.negint,e)},Uint8Array(e,t,n,r){return new pe(V.bytes,e)},string(e,t,n,r){return new pe(V.string,e)},boolean(e,t,n,r){return e?Sn.true:Sn.false},null(e,t,n,r){return Sn.null},undefined(e,t,n,r){return Sn.undefined},ArrayBuffer(e,t,n,r){return new pe(V.bytes,new Uint8Array(e))},DataView(e,t,n,r){return new pe(V.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,n,r){if(!e.length)return n.addBreakTokens===!0?[Sn.emptyArray,new pe(V.break)]:Sn.emptyArray;r=ad.createCheck(r,e);let i=[],o=0;for(let s of e)i[o++]=Ko(s,n,r);return n.addBreakTokens?[new pe(V.array,e.length),i,new pe(V.break)]:[new pe(V.array,e.length),i]},Object(e,t,n,r){let i=t!=="Object",o=i?e.keys():Object.keys(e),s=i?e.size:o.length,a;if(s){a=new Array(s),r=ad.createCheck(r,e);let l=!i&&n.ignoreUndefinedProperties,c=0;for(let d of o){let g=i?e.get(d):e[d];l&&g===void 0||(a[c++]=[Ko(d,n,r),Ko(g,n,r)])}c<s&&(a.length=c)}return a?.length?(HE(a,n),n.addBreakTokens?[new pe(V.map,a.length),a,new pe(V.break)]:[new pe(V.map,a.length),a]):n.addBreakTokens===!0?[Sn.emptyMap,new pe(V.break)]:Sn.emptyMap}};Rn.Map=Rn.Object;Rn.Buffer=Rn.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Rn[`${e}Array`]=Rn.DataView;function Ko(e,t={},n){let r=zO(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||Rn[r];if(typeof i=="function"){let s=i(e,r,t,n);if(s!=null)return s}let o=Rn[r];if(!o)throw new Error(`${vd} unsupported type: ${r}`);return o(e,r,t,n)}function HE(e,t){t.mapSorter&&e.sort(t.mapSorter)}function JE(e,t){if(e[0]instanceof pe&&t[0]instanceof pe){let n=e[0],r=t[0];return n._keyBytes||(n._keyBytes=ud(n.value)),r._keyBytes||(r._keyBytes=ud(r.value)),gd(n._keyBytes,r._keyBytes)}throw new Error("rfc8949MapSorter: complex key types are not supported yet")}function ud(e){return XE(e,GE,qE)}function Rd(e,t,n,r){if(Array.isArray(t))for(let i of t)Rd(e,i,n,r);else n[t.type.major](e,t,r)}var dN=V.uint.majorEncoded,pN=V.negint.majorEncoded,hN=V.bytes.majorEncoded,yN=V.string.majorEncoded,gN=V.array.majorEncoded,mN=V.float.majorEncoded|_d,vN=V.float.majorEncoded|wd,bN=V.float.majorEncoded|Td,_N=V.float.majorEncoded|Ad,wN=BigInt(-1),TN=BigInt(1);function XE(e,t,n,r){let i=r instanceof Uint8Array,o=i?new QO(r):WE,s=Ko(e,n);if(!Array.isArray(s)&&n.quickEncodeToken){let a=n.quickEncodeToken(s);if(a)return i?(o.push(a),o.toBytes()):a;let l=t[s.type.major];if(l.encodedSize){let c=l.encodedSize(s,n);if(i||(o=new md(c)),l(o,s,n),o.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${s} was wrong`);return i?o.toBytes():yd(o.chunks[0])}}return o.reset(),Rd(o,s,t,n),o.toBytes(!0)}var AN=Symbol.for("DONE"),ON=Symbol.for("BREAK");var EN=new Uint8Array(0);function YE(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function Xa(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 QE(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(n[s]!==255)throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function g(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var z=0,J=0,F=0,k=S.length;F!==k&&S[F]===0;)F++,z++;for(var K=(k-F)*d+1>>>0,W=new Uint8Array(K);F!==k;){for(var j=S[F],Z=0,G=K-1;(j!==0||Z<J)&&G!==-1;G--,Z++)j+=256*W[G]>>>0,W[G]=j%a>>>0,j=j/a>>>0;if(j!==0)throw new Error("Non-zero carry");J=Z,F++}for(var fe=K-J;fe!==K&&W[fe]===0;)fe++;for(var x=l.repeat(z);fe<K;++fe)x+=e.charAt(W[fe]);return x}function C(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var z=0;if(S[z]!==" "){for(var J=0,F=0;S[z]===l;)J++,z++;for(var k=(S.length-z)*c+1>>>0,K=new Uint8Array(k);S[z];){var W=n[S.charCodeAt(z)];if(W===255)return;for(var j=0,Z=k-1;(W!==0||j<F)&&Z!==-1;Z--,j++)W+=a*K[Z]>>>0,K[Z]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");F=j,z++}if(S[z]!==" "){for(var G=k-F;G!==k&&K[G]===0;)G++;for(var fe=new Uint8Array(J+(k-G)),x=J;G!==k;)fe[x++]=K[G++];return fe}}}function I(S){var z=C(S);if(z)return z;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:C,decode:I}}var ZE=QE,eI=ZE,tI=eI,nI=class{name;prefix;baseEncode;constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},rI=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,n){this.name=e,this.prefix=t;let r=t.codePointAt(0);if(r===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r,this.baseDecode=n}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 Pd(this,e)}},iI=class{decoders;constructor(e){this.decoders=e}or(e){return Pd(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Pd(e,t){return new iI({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var oI=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new nI(e,t,n),this.decoder=new rI(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Cd({name:e,prefix:t,encode:n,decode:r}){return new oI(e,t,n,r)}function Zo({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=tI(n,e);return Cd({prefix:t,name:e,encode:r,decode:o=>Xa(i(o))})}function sI(e,t,n,r){let i=e.length;for(;e[i-1]==="=";)--i;let o=new Uint8Array(i*n/8|0),s=0,a=0,l=0;for(let c=0;c<i;++c){let d=t[e[c]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);a=a<<n|d,s+=n,s>=8&&(s-=8,o[l++]=255&a>>s)}if(s>=n||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o}function aI(e,t,n){let r=t[t.length-1]==="=",i=(1<<n)-1,o="",s=0,a=0;for(let l=0;l<e.length;++l)for(a=a<<8|e[l],s+=8;s>n;)s-=n,o+=t[i&a>>s];if(s!==0&&(o+=t[i&a<<n-s]),r)for(;o.length*n&7;)o+="=";return o}function uI(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function dn({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=uI(r);return Cd({prefix:t,name:e,encode(o){return aI(o,r,n)},decode(o){return sI(o,i,n,e)}})}var qo=dn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),IN=dn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),SN=dn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$N=dn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),NN=dn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),RN=dn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),PN=dn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),CN=dn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),xN=dn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Ma=Zo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),UN=Zo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),$n=Zo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),MN=Zo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),cI=xd,cd=128,lI=127,fI=~lI,dI=Math.pow(2,31);function xd(e,t,n){t=t||[],n=n||0;for(var r=n;e>=dI;)t[n++]=e&255|cd,e/=128;for(;e&fI;)t[n++]=e&255|cd,e>>>=7;return t[n]=e|0,xd.bytes=n-r+1,t}var pI=Ba,hI=128,ld=127;function Ba(e,r){var n=0,r=r||0,i=0,o=r,s,a=e.length;do{if(o>=a)throw Ba.bytes=0,new RangeError("Could not decode varint");s=e[o++],n+=i<28?(s&ld)<<i:(s&ld)*Math.pow(2,i),i+=7}while(s>=hI);return Ba.bytes=o-r,n}var yI=Math.pow(2,7),gI=Math.pow(2,14),mI=Math.pow(2,21),vI=Math.pow(2,28),bI=Math.pow(2,35),_I=Math.pow(2,42),wI=Math.pow(2,49),TI=Math.pow(2,56),AI=Math.pow(2,63),OI=function(e){return e<yI?1:e<gI?2:e<mI?3:e<vI?4:e<bI?5:e<_I?6:e<wI?7:e<TI?8:e<AI?9:10},EI={encode:cI,decode:pI,encodingLength:OI},II=EI,Ho=II;function Da(e,t=0){return[Ho.decode(e,t),Ho.decode.bytes]}function Jo(e,t,n=0){return Ho.encode(e,t,n),t}function Xo(e){return Ho.encodingLength(e)}function SI(e,t){let n=t.byteLength,r=Xo(e),i=r+Xo(n),o=new Uint8Array(i+n);return Jo(e,o,0),Jo(n,o,r),o.set(t,i),new Ya(e,n,t,o)}function $I(e){let t=Xa(e),[n,r]=Da(t),[i,o]=Da(t.subarray(r)),s=t.subarray(r+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Ya(n,i,s,t)}function NI(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&YE(e.bytes,n.bytes)}}var Ya=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};function fd(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return PI(n,La(e),t??$n.encoder);default:return CI(n,La(e),t??qo.encoder)}}var dd=new WeakMap;function La(e){let t=dd.get(e);if(t==null){let n=new Map;return dd.set(e,n),n}return t}var Ud=class nt{code;version;multihash;bytes;"/";constructor(t,n,r,i){this.code=n,this.version=t,this.multihash=r,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:n}=this;if(t!==vi)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==xI)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return nt.createV0(n)}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:n}=this.multihash,r=SI(t,n);return nt.createV1(this.code,r)}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 nt.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&NI(t.multihash,r.multihash)}toString(t){return fd(this,t)}toJSON(){return{"/":fd(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 n=t;if(n instanceof nt)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:o,bytes:s}=n;return new nt(r,i,o,s??pd(r,i,o.bytes))}else if(n[UI]===!0){let{version:r,multihash:i,code:o}=n,s=$I(i);return nt.create(r,o,s)}else return null}static create(t,n,r){if(typeof n!="number")throw new Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(n!==vi)throw new Error(`Version 0 CID must use dag-pb (code: ${vi}) block encoding`);return new nt(t,n,r,r.bytes)}case 1:{let i=pd(t,n,r.bytes);return new nt(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return nt.create(0,vi,t)}static createV1(t,n){return nt.create(1,t,n)}static decode(t){let[n,r]=nt.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=nt.inspectBytes(t),r=n.size-n.multihashSize,i=Xa(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw new Error("Incorrect length");let o=i.subarray(n.multihashSize-n.digestSize),s=new Ya(n.multihashCode,n.digestSize,o,i);return[n.version===0?nt.createV0(s):nt.createV1(n.codec,s),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[g,C]=Da(t.subarray(n));return n+=C,g},i=r(),o=vi;if(i===18?(i=0,n=0):o=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=n,a=r(),l=r(),c=n+l,d=c-s;return{version:i,codec:o,multihashCode:a,digestSize:l,multihashSize:d,size:c}}static parse(t,n){let[r,i]=RI(t,n),o=nt.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return La(o).set(r,t),o}};function RI(e,t){switch(e[0]){case"Q":{let n=t??$n;return[$n.prefix,n.decode(`${$n.prefix}${e}`)]}case $n.prefix:{let n=t??$n;return[$n.prefix,n.decode(e)]}case qo.prefix:{let n=t??qo;return[qo.prefix,n.decode(e)]}case Ma.prefix:{let n=t??Ma;return[Ma.prefix,n.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 PI(e,t,n){let{prefix:r}=n;if(r!==$n.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let o=n.encode(e).slice(1);return t.set(r,o),o}else return i}function CI(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let o=n.encode(e);return t.set(r,o),o}else return i}var vi=112,xI=18;function pd(e,t,n){let r=Xo(e),i=r+Xo(t),o=new Uint8Array(i+n.byteLength);return Jo(e,o,0),Jo(t,o,r),o.set(n,i),o}var UI=Symbol.for("@ipld/js-cid/CID"),Md=42;function MI(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Ud.asCID(e);if(!t)return null;let n=new Uint8Array(t.bytes.byteLength+1);return n.set(t.bytes,1),[new pe(V.tag,Md),new pe(V.bytes,n)]}function BI(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function DI(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 LI(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 hd={float64:!0,typeEncoders:{Map:LI,Object:MI,undefined:BI,number:DI}},BN={...hd,typeEncoders:{...hd.typeEncoders}};function kI(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ud.decode(e.subarray(1))}var ka={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};ka.tags[Md]=kI;var DN={...ka,tags:ka.tags.slice()};var LN=mt(ja(),1);var Nn={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)":Nn.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Nn.List(e)!==void 0){for(let t=0;t<e.length;t++){let n=e[t];if(n=bi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](n),n===void 0)return;if(n!==e[t]){let r=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;r.push(o)}return r}}return e}},Int:Nn.Int,CarV1HeaderOrV2Pragma:e=>{if(Nn.Map(e)===void 0)return;let t=Object.entries(e),n=e,r=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||n!==e){if(n===e){n={};for(let l=0;l<i;l++)n[t[l][0]]=t[l][1]}n.roots=a}}break;case"version":{r--;let a=bi.Int(e[o]);if(a===void 0)return;if(a!==s||n!==e){if(n===e){n={};for(let l=0;l<i;l++)n[t[l][0]]=t[l][1]}n.version=a}}break;default:return}}if(!(r>0))return n}},_i={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Nn.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Nn.List(e)!==void 0){for(let t=0;t<e.length;t++){let n=e[t];if(n=_i["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](n),n===void 0)return;if(n!==e[t]){let r=e.slice(0,t);for(let i=t;i<e.length;i++){let o=e[i];if(o=_i["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;r.push(o)}return r}}return e}},Int:Nn.Int,CarV1HeaderOrV2Pragma:e=>{if(Nn.Map(e)===void 0)return;let t=Object.entries(e),n=e,r=1;for(let i=0;i<t.length;i++){let[o,s]=t[i];switch(o){case"roots":{let a=_i["CarV1HeaderOrV2Pragma > roots (anon)"](s);if(a===void 0)return;if(a!==s||n!==e){if(n===e){n={};for(let l=0;l<i;l++)n[t[l][0]]=t[l][1]}n.roots=a}}break;case"version":{r--;let a=_i.Int(s);if(a===void 0)return;if(a!==s||n!==e){if(n===e){n={};for(let l=0;l<i;l++)n[t[l][0]]=t[l][1]}n.version=a}}break;default:return}}if(!(r>0))return n}},kN={toTyped:bi.CarV1HeaderOrV2Pragma,toRepresentation:_i.CarV1HeaderOrV2Pragma},jN=$d(),FN=mt(ja(),1),zN=[new pe(V.map,2),new pe(V.string,"version"),new pe(V.uint,1),new pe(V.string,"roots")],VN=new pe(V.tag,42);var KN=mt(ja(),1);var{WARN:qN,LOG:GN,DEBUG:WN,VERBOSE:HN,ERROR:JN}=$e.setup($e.INFO);var{WARN:XN,LOG:YN,DEBUG:QN,VERBOSE:ZN,ERROR:eR}=$e.setup($e.INFO);var Qa=class{app;username;devicename;signer},Bd=class extends Qa{constructor(t){super(),Object.assign(this,t)}get did(){return this.signer.did}async sign(t){return await this.signer.sign(t)}get ag(){return xa(this.agentString)}get shortDID(){return this.did?.slice(-8)}get agentString(){return`${this.username}.${this.shortDID}@${this.app}.${this.devicename}`}};export{Bd as BaseAgent};
62
62
  /*! Bundled license information:
63
63
 
64
64
  lodash-es/lodash.js: