@wovin/base-agent 0.0.17 → 0.0.19
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 +40 -40
- package/dist/index.min.js.map +1 -1
- package/package.json +3 -3
package/dist/index.min.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
1
|
+
var jd={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"},Fd=jd;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:Fd[e];throw typeof i=="function"&&(i=i.apply(null,n)),new Error("[MobX] "+i)}var Vd={};function Vi(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Vd}var du=Object.assign,xi=Object.getOwnPropertyDescriptor,zt=Object.defineProperty,zr=Object.prototype,Ui=[];Object.freeze(Ui);var fs={};Object.freeze(fs);var Kd=typeof Proxy<"u",zd=Object.toString();function pu(){Kd||ce("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function jr(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 At(){return++X.mobxGuid}function ds(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var lr=function(){};function je(e){return typeof e=="function"}function Un(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Ki(e){return e!==null&&typeof e=="object"}function Bt(e){if(!Ki(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()===zd}function hu(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function zi(e,t,n){zt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function yu(e,t,n){zt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function yn(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return Ki(r)&&r[n]===!0}}function hr(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function qd(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function Qt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var gu=typeof Object.getOwnPropertySymbols<"u";function Gd(e){var t=Object.keys(e);if(!gu)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return zr.propertyIsEnumerable.call(e,r)})):t}var qi=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:gu?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function es(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function mu(e){return e===null?null:typeof e=="object"?""+e:e}function bt(e,t){return zr.hasOwnProperty.call(e,t)}var Wd=Object.getOwnPropertyDescriptors||function(t){var n={};return qi(t).forEach(function(r){n[r]=xi(t,r)}),n};function at(e,t){return!!(e&t)}function ut(e,t,n){return n?e|=t:e&=~t,e}function Ha(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 Ja(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,Jd(r.key),r)}}function yr(e,t,n){return t&&Ja(e.prototype,t),n&&Ja(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fr(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=Xd(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 tn(){return tn=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},tn.apply(null,arguments)}function vu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ts(e,t)}function ts(e,t){return ts=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ts(e,t)}function Hd(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 Jd(e){var t=Hd(e,"string");return typeof t=="symbol"?t:t+""}function Xd(e,t){if(e){if(typeof e=="string")return Ha(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)?Ha(e,t):void 0}}var it=Symbol("mobx-stored-annotations");function qt(e){function t(n,r){if(Gr(r))return e.decorate_20223_(n,r);qr(n,r,e)}return Object.assign(t,e)}function qr(e,t,n){if(bt(e,it)||zi(e,it,tn({},e[it])),Mi(n)&&!bt(e[it],t)){var r=e.constructor.name+".prototype."+t.toString();ce("'"+r+"' is decorated with 'override', but no such decorated member was found on prototype.")}Yd(e,n,t),Mi(n)||(e[it][t]=n)}function Yd(e,t,n){if(!Mi(t)&&bt(e[it],n)){var r=e.constructor.name+".prototype."+n.toString(),i=e[it][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
|
|
6
|
-
'`+
|
|
7
|
-
'`+i+"' can only be used on properties with a function value."))}function
|
|
8
|
-
'`+i+"' can only be used on properties with a generator function value."))}function
|
|
9
|
-
'`+i+"' can only be used on getter(+setter) properties."))}function
|
|
10
|
-
'`+i+"' cannot be used on getter/setter properties"))}var Jf="true",Xf=Ia();function Ia(e){return{annotationType_:Jf,options_:e,make_:Yf,extend_:Qf,decorate_20223_:Zf}}function Yf(e,t,n,r){var i,s;if(n.get)return Ce.make_(e,t,n,r);if(n.set){var o=_n(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:H.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Ut(r,t,{configurable:!0,set:o}),2)}if(r!==e.target_&&typeof n.value=="function"){var a;if(ga(n.value)){var l,c=(l=this.options_)!=null&&l.autoBind?qn.bound:qn;return c.make_(e,t,n,r)}var d=(a=this.options_)!=null&&a.autoBind?br.bound:br;return d.make_(e,t,n,r)}var g=((i=this.options_)==null?void 0:i.deep)===!1?Pe.ref:Pe;if(typeof n.value=="function"&&(s=this.options_)!=null&&s.autoBind){var C;n.value=n.value.bind((C=e.proxy_)!=null?C:e.target_)}return g.make_(e,t,n,r)}function Qf(e,t,n,r){var i,s;if(n.get)return Ce.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:H.safeDescriptors?e.isPlainObject_:!0,set:_n(t.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;n.value=n.value.bind((o=e.proxy_)!=null?o:e.target_)}var a=((s=this.options_)==null?void 0:s.deep)===!1?Pe.ref:Pe;return a.extend_(e,t,n,r)}function Zf(e,t){ae("'"+this.annotationType_+"' cannot be used as a decorator")}var ed="observable",td="observable.ref",nd="observable.shallow",rd="observable.struct",Ea={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Ea);function Qr(e){return e||Ea}var mo=_i(ed),id=_i(td,{enhancer:bi}),od=_i(nd,{enhancer:Nf}),sd=_i(rd,{enhancer:$f}),Sa=Mt(mo);function Zr(e){return e.deep===!0?bn:e.deep===!1?bi:ud(e.defaultDecorator)}function ad(e){var t;return e?(t=e.defaultDecorator)!=null?t:Ia(e):void 0}function ud(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:bn}function Pa(e,t,n){if(Or(t))return mo.decorate_20223_(e,t);if(vn(t)){wr(e,t,mo);return}return Wn(e)?e:St(e)?Pe.object(e,t,n):Array.isArray(e)?Pe.array(e,t):zn(e)?Pe.map(e,t):Kt(e)?Pe.set(e,t):typeof e=="object"&&e!==null?e:Pe.box(e,t)}ya(Pa,Sa);var cd={box:function(t,n){var r=Qr(n);return new Zt(t,Zr(r),r.name,!0,r.equals)},array:function(t,n){var r=Qr(n);return(H.useProxies===!1||r.proxy===!1?cp:Zd)(t,Zr(r),r.name)},map:function(t,n){var r=Qr(n);return new eu(t,Zr(r),r.name)},set:function(t,n){var r=Qr(n);return new tu(t,Zr(r),r.name)},object:function(t,n,r){return In(function(){return Kd(H.useProxies===!1||r?.proxy===!1?Qn({},r):Xd({},r),t,n)})},ref:Mt(id),shallow:Mt(od),deep:Sa,struct:Mt(sd)},Pe=ya(Pa,cd),Ra="computed",ld="computed.struct",vo=Ro(Ra),fd=Ro(ld,{equals:Le.structural}),Ce=function(t,n){if(Or(n))return vo.decorate_20223_(t,n);if(vn(n))return wr(t,n,vo);if(St(t))return Mt(Ro(Ra,t));Me(t)||ae("First argument to `computed` should be an expression."),Me(n)&&ae("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var r=St(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new yt(r)};Object.assign(Ce,vo);Ce.struct=Mt(fd);var Qs,Zs,ui=0,dd=1,pd=(Qs=(Zs=oi(function(){},"name"))==null?void 0:Zs.configurable)!=null?Qs:!1,ea={value:"action",configurable:!0,writable:!1,enumerable:!1};function _n(e,t,n,r){n===void 0&&(n=!1),Me(t)||ae("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&ae("actions should have valid names, got: '"+e+"'");function i(){return Na(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},pd&&(ea.value=e,Ut(i,"name",ea)),i}function Na(e,t,n,r,i){var s=yd(e,t,r,i);try{return n.apply(r,i)}catch(o){throw s.error_=o,o}finally{hd(s)}}function yd(e,t,n,r){var i=Ve()&&!!e,s=0;if(i){s=Date.now();var o=r?Array.from(r):si;nt({type:$o,name:e,object:n,arguments:o})}var a=H.trackingDerivation,l=!t||!a;lt();var c=H.allowStateChanges;l&&(On(),c=Ti(!0));var d=No(!0),g={runAsAction_:l,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:d,notifySpy_:i,startTime_:s,actionId_:dd++,parentActionId_:ui};return ui=g.actionId_,g}function hd(e){ui!==e.actionId_&&ae(30),ui=e.parentActionId_,e.error_!==void 0&&(H.suppressReactionErrors=!0),wi(e.prevAllowStateChanges_),vr(e.prevAllowStateReads_),ft(),e.runAsAction_&&Gt(e.prevDerivation_),e.notifySpy_&&rt({time:Date.now()-e.startTime_}),H.suppressReactionErrors=!1}function gd(e,t){var n=Ti(e);try{return t()}finally{wi(n)}}function Ti(e){var t=H.allowStateChanges;return H.allowStateChanges=e,t}function wi(e){H.allowStateChanges=e}var md="create",Zt=function(e){function t(r,i,s,o,a){var l;return s===void 0&&(s="ObservableValue@"+gt()),o===void 0&&(o=!0),a===void 0&&(a=Le.default),l=e.call(this,s)||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_=s,l.equals=a,l.value_=i(r,void 0,s),o&&Ve()&&Tn({type:md,object:l,observableKind:"value",debugObjectName:l.name_,newValue:""+l.value_}),l}_a(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 s=this.value_;if(i=this.prepareNewValue_(i),i!==H.UNCHANGED){var o=Ve();o&&nt({type:At,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:s}),this.setNewValue_(i),o&&rt()}},n.prepareNewValue_=function(i){if(xt(this),ut(this)){var s=ct(this,{object:this,type:At,newValue:i});if(!s)return H.UNCHANGED;i=s.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?H.UNCHANGED:i},n.setNewValue_=function(i){var s=this.value_;this.value_=i,this.reportChanged(),It(this)&&Et(this,{type:At,object:this,newValue:i,oldValue:s})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return Pr(this,i)},n.observe_=function(i,s){return s&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:At,newValue:this.value_,oldValue:void 0}),Rr(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 ba(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(nn),vd=tn("ObservableValue",Zt),yt=function(){function e(n){this.dependenciesState_=Te.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Te.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ci(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=pt.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||ae(31),this.derivation=n.get,this.name_=n.name||"ComputedValue@"+gt(),n.set&&(this.setter_=_n(this.name_+"-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?Le.structural:Le.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){Sd(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&&ae(32,this.name_,this.derivation),H.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)bo(this)&&(this.warnAboutUntrackedRead_(),lt(),this.value_=this.computeValue_(!1),ft());else if(Ba(this),bo(this)){var r=H.trackingContext;this.keepAlive_&&!r&&(H.trackingContext=this),this.trackAndCompute()&&Ed(this),H.trackingContext=r}var i=this.value_;if(ni(i))throw i.cause;return i},t.set=function(r){if(this.setter_){this.isRunningSetter&&ae(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else ae(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===Te.NOT_TRACKING_,s=this.computeValue_(!0),o=i||ni(r)||ni(s)||!this.equals_(r,s);return o&&(this.value_=s,Ve()&&Tn({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:r,newValue:s})),o},t.computeValue_=function(r){this.isComputing=!0;var i=Ti(!1),s;if(r)s=Ca(this,this.derivation,this.scope_);else if(H.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(o){s=new ci(o)}return wi(i),this.isComputing=!1,s},t.suspend_=function(){this.keepAlive_||(_o(this),this.value_=void 0,this.isTracing_!==pt.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 s=this,o=!0,a=void 0;return mt(function(){var l=s.get();if(!o||i){var c=On();r({observableKind:"computed",debugObjectName:s.name_,type:At,object:s,newValue:l,oldValue:a}),Gt(c)}o=!1,a=l})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==pt.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_:H.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 ba(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Hn(e,[{key:"isComputing",get:function(){return et(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=tt(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return et(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=tt(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return et(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=tt(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return et(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=tt(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return et(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=tt(this.flags_,e.diffValueMask_,r===1)}}])}();yt.isComputingMask_=1;yt.isRunningSetterMask_=2;yt.isBeingObservedMask_=4;yt.isPendingUnobservationMask_=8;yt.diffValueMask_=16;var Ir=tn("ComputedValue",yt),Te;(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_"})(Te||(Te={}));var pt;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(pt||(pt={}));var ci=function(t){this.cause=void 0,this.cause=t};function ni(e){return e instanceof ci}function bo(e){switch(e.dependenciesState_){case Te.UP_TO_DATE_:return!1;case Te.NOT_TRACKING_:case Te.STALE_:return!0;case Te.POSSIBLY_STALE_:{for(var t=No(!0),n=On(),r=e.observing_,i=r.length,s=0;s<i;s++){var o=r[s];if(Ir(o)){if(H.disableErrorBoundaries)o.get();else try{o.get()}catch{return Gt(n),vr(t),!0}if(e.dependenciesState_===Te.STALE_)return Gt(n),vr(t),!0}}return xa(e),Gt(n),vr(t),!1}}}function $a(){return H.trackingDerivation!==null}function xt(e){var t=e.observers_.size>0;!H.allowStateChanges&&(t||H.enforceActions==="always")&&console.warn("[MobX] "+(H.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 bd(e){!H.allowStateReads&&H.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Ca(e,t,n){var r=No(!0);xa(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++H.runId;var i=H.trackingDerivation;H.trackingDerivation=e,H.inBatch++;var s;if(H.disableErrorBoundaries===!0)s=t.call(n);else try{s=t.call(n)}catch(o){s=new ci(o)}return H.inBatch--,H.trackingDerivation=i,Td(e),_d(e),vr(r),s}function _d(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:H.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function Td(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=Te.UP_TO_DATE_,i=0,s=e.unboundDepsCount_,o=0;o<s;o++){var a=n[o];a.diffValue===0&&(a.diffValue=1,i!==o&&(n[i]=a),i++),a.dependenciesState_>r&&(r=a.dependenciesState_)}for(n.length=i,e.newObserving_=null,s=t.length;s--;){var l=t[s];l.diffValue===0&&Da(l,e),l.diffValue=0}for(;i--;){var c=n[i];c.diffValue===1&&(c.diffValue=0,Id(c,e))}r!==Te.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function _o(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Da(t[n],e);e.dependenciesState_=Te.NOT_TRACKING_}function Se(e){var t=On();try{return e()}finally{Gt(t)}}function On(){var e=H.trackingDerivation;return H.trackingDerivation=null,e}function Gt(e){H.trackingDerivation=e}function No(e){var t=H.allowStateReads;return H.allowStateReads=e,t}function vr(e){H.allowStateReads=e}function xa(e){if(e.dependenciesState_!==Te.UP_TO_DATE_){e.dependenciesState_=Te.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Te.UP_TO_DATE_}}var ri=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},ii=!0,Ua=!1,H=function(){var e=yi();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(ii=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new ri().version&&(ii=!1),ii?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new ri):(setTimeout(function(){Ua||ae(35)},1),new ri)}();function wd(){if((H.pendingReactions.length||H.inBatch||H.isRunningReactions)&&ae(36),Ua=!0,ii){var e=yi();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),H=new ri}}function Ma(){return H}function Od(e){return e.observers_&&e.observers_.size>0}function Ad(e){return e.observers_}function Id(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Da(e,t){e.observers_.delete(t),e.observers_.size===0&&La(e)}function La(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,H.pendingUnobservations.push(e))}function lt(){H.inBatch++}function ft(){if(--H.inBatch===0){Ka();for(var e=H.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 yt&&n.suspend_())}H.pendingUnobservations=[]}}function Ba(e){bd(e);var t=H.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&H.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&H.inBatch>0&&La(e),!1)}function ja(e){e.lowestObserverState_!==Te.STALE_&&(e.lowestObserverState_=Te.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Te.UP_TO_DATE_&&(t.isTracing_!==pt.NONE&&ka(t,e),t.onBecomeStale_()),t.dependenciesState_=Te.STALE_}))}function Ed(e){e.lowestObserverState_!==Te.STALE_&&(e.lowestObserverState_=Te.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Te.POSSIBLY_STALE_?(t.dependenciesState_=Te.STALE_,t.isTracing_!==pt.NONE&&ka(t,e)):t.dependenciesState_===Te.UP_TO_DATE_&&(e.lowestObserverState_=Te.UP_TO_DATE_)}))}function Sd(e){e.lowestObserverState_===Te.UP_TO_DATE_&&(e.lowestObserverState_=Te.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Te.UP_TO_DATE_&&(t.dependenciesState_=Te.POSSIBLY_STALE_,t.onBecomeStale_())}))}function ka(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===pt.BREAK){var n=[];Fa(Er(e),n,1),new Function(`debugger;
|
|
5
|
+
Use '@override' decorator for methods overridden by subclass.`)}}function Qd(e){return bt(e,it)||zi(e,it,tn({},e[it])),e[it]}function Gr(e){return typeof e=="object"&&typeof e.kind=="string"}function Gi(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"),gn=function(){function e(n){n===void 0&&(n="Atom@"+At()),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 Bu(this)},t.reportChanged=function(){mt(),Du(this),vt()},t.toString=function(){return this.name_},yr(e,[{key:"isBeingObserved",get:function(){return at(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ut(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return at(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ut(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return at(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ut(this.flags_,e.diffValueMask_,r===1)}}])}();gn.isBeingObservedMask_=1;gn.isPendingUnobservationMask_=2;gn.diffValueMask_=4;var ps=yn("Atom",gn);function bu(e,t,n){t===void 0&&(t=lr),n===void 0&&(n=lr);var r=new gn(e);return t!==lr&&mr(r,t),n!==lr&&jn(r,n),r}function Zd(e,t){return e===t}function ep(e,t){return ws(e,t)}function tp(e,t){return ws(e,t,1)}function np(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ve={identity:Zd,structural:ep,default:np,shallow:tp};function Mn(e,t,n){return pr(e)?e:Array.isArray(e)?Ce.array(e,{name:n}):Bt(e)?Ce.object(e,void 0,{name:n}):hr(e)?Ce.map(e,{name:n}):Qt(e)?Ce.set(e,{name:n}):typeof e=="function"&&!hn(e)&&!Kr(e)?hu(e)?dr(e):Vr(n,e):e}function rp(e,t,n){if(e==null||Ln(e)||vr(e)||Gt(e)||Ct(e))return e;if(Array.isArray(e))return Ce.array(e,{name:n,deep:!1});if(Bt(e))return Ce.object(e,void 0,{name:n,deep:!1});if(hr(e))return Ce.map(e,{name:n,deep:!1});if(Qt(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 Wi(e){return e}function ip(e,t){return pr(e)&&ce("observable.struct should not be used with observable values"),ws(e,t)?t:e}var op="override";function Mi(e){return e.annotationType_===op}function Wr(e,t){return{annotationType_:e,options_:t,make_:sp,extend_:ap,decorate_20223_:up}}function sp(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(hn(n.value))return 1;var o=_u(e,this,t,n,!1);return zt(r,t,o),2}function ap(e,t,n,r){var i=_u(e,this,t,n);return e.defineProperty_(t,i,r)}function up(e,t){Gi(t,["method","field"]);var n=t.kind,r=t.name,i=t.addInitializer,o=this,s=function(c){var d,g,C,I;return Bn((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 hn(d)||(d=s(d)),(c=o.options_)!=null&&c.bound&&(d=d.bind(this),d.isMobxAction=!0),d};if(n=="method"){var a;return hn(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
|
+
'`+o.annotationType_+"' can only be used on properties with a function value."))}function cp(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 _u(e,t,n,r,i){var o,s,a,l,c,d,g;i===void 0&&(i=X.safeDescriptors),cp(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:Bn((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 wu(e,t){return{annotationType_:e,options_:t,make_:lp,extend_:fp,decorate_20223_:dp}}function lp(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&&(!bt(e.target_,t)||!Kr(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(Kr(n.value))return 1;var o=Tu(e,this,t,n,!1,!1);return zt(r,t,o),2}function fp(e,t,n,r){var i,o=Tu(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,o,r)}function dp(e,t){var n;Gi(t,["method"]);var r=t.name,i=t.addInitializer;return Kr(e)||(e=dr(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 Tu(e,t,n,r,i,o){o===void 0&&(o=X.safeDescriptors),pp(e,t,n,r);var s=r.value;if(Kr(s)||(s=dr(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 hs(e,t){return{annotationType_:e,options_:t,make_:hp,extend_:yp,decorate_20223_:gp}}function hp(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function yp(e,t,n,r){return mp(e,this,t,n),e.defineComputedProperty_(t,tn({},this.options_,{get:n.get,set:n.set}),r)}function gp(e,t){Gi(t,["getter"]);var n=this,r=t.name,i=t.addInitializer;return i(function(){var o=br(this)[ve],s=tn({},n.options_,{get:e,context:this});s.name||(s.name=o.name_+"."+r.toString()),o.values_.set(r,new wt(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
|
+
'`+i+"' can only be used on getter(+setter) properties."))}function Hi(e,t){return{annotationType_:e,options_:t,make_:vp,extend_:bp,decorate_20223_:_p}}function vp(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function bp(e,t,n,r){var i,o;return wp(e,this,t,n),e.defineObservableProperty_(t,n.value,(i=(o=this.options_)==null?void 0:o.enhancer)!=null?i:Mn,r)}function _p(e,t){if(t.kind==="field")throw ce("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");Gi(t,["accessor"]);var n=this,r=t.kind,i=t.name,o=new WeakSet;function s(a,l){var c,d,g=br(a)[ve],C=new pn(l,(c=(d=n.options_)==null?void 0:d.enhancer)!=null?c:Mn,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 wp(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 Tp="true",Ap=Au();function Au(e){return{annotationType_:Tp,options_:e,make_:Op,extend_:Ep,decorate_20223_:Ip}}function Op(e,t,n,r){var i,o;if(n.get)return De.make_(e,t,n,r);if(n.set){var s=Bn(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:X.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(zt(r,t,{configurable:!0,set:s}),2)}if(r!==e.target_&&typeof n.value=="function"){var a;if(hu(n.value)){var l,c=(l=this.options_)!=null&&l.autoBind?dr.bound:dr;return c.make_(e,t,n,r)}var d=(a=this.options_)!=null&&a.autoBind?Vr.bound:Vr;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 Ep(e,t,n,r){var i,o;if(n.get)return De.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:X.safeDescriptors?e.isPlainObject_:!0,set:Bn(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 Ip(e,t){ce("'"+this.annotationType_+"' cannot be used as a decorator")}var Sp="observable",Np="observable.ref",$p="observable.shallow",Rp="observable.struct",Ou={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Ou);function Ii(e){return e||Ou}var ns=Hi(Sp),Pp=Hi(Np,{enhancer:Wi}),Cp=Hi($p,{enhancer:rp}),xp=Hi(Rp,{enhancer:ip}),Eu=qt(ns);function Si(e){return e.deep===!0?Mn:e.deep===!1?Wi:Mp(e.defaultDecorator)}function Up(e){var t;return e?(t=e.defaultDecorator)!=null?t:Au(e):void 0}function Mp(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:Mn}function Iu(e,t,n){if(Gr(t))return ns.decorate_20223_(e,t);if(Un(t)){qr(e,t,ns);return}return pr(e)?e:Bt(e)?Ce.object(e,t,n):Array.isArray(e)?Ce.array(e,t):hr(e)?Ce.map(e,t):Qt(e)?Ce.set(e,t):typeof e=="object"&&e!==null?e:Ce.box(e,t)}du(Iu,Eu);var Bp={box:function(t,n){var r=Ii(n);return new pn(t,Si(r),r.name,!0,r.equals)},array:function(t,n){var r=Ii(n);return(X.useProxies===!1||r.proxy===!1?Bh:Ih)(t,Si(r),r.name)},map:function(t,n){var r=Ii(n);return new Qu(t,Si(r),r.name)},set:function(t,n){var r=Ii(n);return new Zu(t,Si(r),r.name)},object:function(t,n,r){return Fn(function(){return yh(X.useProxies===!1||r?.proxy===!1?br({},r):Ah({},r),t,n)})},ref:qt(Pp),shallow:qt(Cp),deep:Eu,struct:qt(xp)},Ce=du(Iu,Bp),Su="computed",Dp="computed.struct",rs=hs(Su),Lp=hs(Dp,{equals:Ve.structural}),De=function(t,n){if(Gr(n))return rs.decorate_20223_(t,n);if(Un(n))return qr(t,n,rs);if(Bt(t))return qt(hs(Su,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=Bt(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new wt(r)};Object.assign(De,rs);De.struct=qt(Lp);var Xa,Ya,Bi=0,kp=1,jp=(Xa=(Ya=xi(function(){},"name"))==null?void 0:Ya.configurable)!=null?Xa:!1,Qa={value:"action",configurable:!0,writable:!1,enumerable:!1};function Bn(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 Nu(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},jp&&(Qa.value=e,zt(i,"name",Qa)),i}function Nu(e,t,n,r,i){var o=Fp(e,t,r,i);try{return n.apply(r,i)}catch(s){throw o.error_=s,s}finally{Vp(o)}}function Fp(e,t,n,r){var i=He()&&!!e,o=0;if(i){o=Date.now();var s=r?Array.from(r):Ui;ct({type:gs,name:e,object:n,arguments:s})}var a=X.trackingDerivation,l=!t||!a;mt();var c=X.allowStateChanges;l&&(kn(),c=Ji(!0));var d=ys(!0),g={runAsAction_:l,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:d,notifySpy_:i,startTime_:o,actionId_:kp++,parentActionId_:Bi};return Bi=g.actionId_,g}function Vp(e){Bi!==e.actionId_&&ce(30),Bi=e.parentActionId_,e.error_!==void 0&&(X.suppressReactionErrors=!0),Xi(e.prevAllowStateChanges_),Fr(e.prevAllowStateReads_),vt(),e.runAsAction_&&en(e.prevDerivation_),e.notifySpy_&<({time:Date.now()-e.startTime_}),X.suppressReactionErrors=!1}function Kp(e,t){var n=Ji(e);try{return t()}finally{Xi(n)}}function Ji(e){var t=X.allowStateChanges;return X.allowStateChanges=e,t}function Xi(e){X.allowStateChanges=e}var zp="create",pn=function(e){function t(r,i,o,s,a){var l;return o===void 0&&(o="ObservableValue@"+At()),s===void 0&&(s=!0),a===void 0&&(a=Ve.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&&He()&&Dn({type:zp,object:l,observableKind:"value",debugObjectName:l.name_,newValue:""+l.value_}),l}vu(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=He();s&&ct({type:xt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:o}),this.setNewValue_(i),s&<()}},n.prepareNewValue_=function(i){if(Kt(this),yt(this)){var o=gt(this,{object:this,type:xt,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(),Ut(this)&&Mt(this,{type:xt,object:this,newValue:i,oldValue:o})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return Yr(this,i)},n.observe_=function(i,o){return o&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:xt,newValue:this.value_,oldValue:void 0}),Qr(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 mu(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(gn),qp=yn("ObservableValue",pn),wt=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 Di(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=_t.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@"+At(),n.set&&(this.setter_=Bn(this.name_+"-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?Ve.structural:Ve.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){eh(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_)is(this)&&(this.warnAboutUntrackedRead_(),mt(),this.value_=this.computeValue_(!1),vt());else if(Bu(this),is(this)){var r=X.trackingContext;this.keepAlive_&&!r&&(X.trackingContext=this),this.trackAndCompute()&&Zp(this),X.trackingContext=r}var i=this.value_;if(Ri(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||Ri(r)||Ri(o)||!this.equals_(r,o);return s&&(this.value_=o,He()&&Dn({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:r,newValue:o})),s},t.computeValue_=function(r){this.isComputing=!0;var i=Ji(!1),o;if(r)o=Ru(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 Di(s)}return Xi(i),this.isComputing=!1,o},t.suspend_=function(){this.keepAlive_||(os(this),this.value_=void 0,this.isTracing_!==_t.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 Ot(function(){var l=o.get();if(!s||i){var c=kn();r({observableKind:"computed",debugObjectName:o.name_,type:xt,object:o,newValue:l,oldValue:a}),en(c)}s=!1,a=l})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==_t.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 mu(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},yr(e,[{key:"isComputing",get:function(){return at(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=ut(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return at(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=ut(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return at(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ut(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return at(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ut(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return at(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ut(this.flags_,e.diffValueMask_,r===1)}}])}();wt.isComputingMask_=1;wt.isRunningSetterMask_=2;wt.isBeingObservedMask_=4;wt.isPendingUnobservationMask_=8;wt.diffValueMask_=16;var Hr=yn("ComputedValue",wt),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 _t;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(_t||(_t={}));var Di=function(t){this.cause=void 0,this.cause=t};function Ri(e){return e instanceof Di}function is(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=ys(!0),n=kn(),r=e.observing_,i=r.length,o=0;o<i;o++){var s=r[o];if(Hr(s)){if(X.disableErrorBoundaries)s.get();else try{s.get()}catch{return en(n),Fr(t),!0}if(e.dependenciesState_===Oe.STALE_)return en(n),Fr(t),!0}}return Pu(e),en(n),Fr(t),!1}}}function $u(){return X.trackingDerivation!==null}function Kt(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 Gp(e){!X.allowStateReads&&X.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Ru(e,t,n){var r=ys(!0);Pu(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 Di(s)}return X.inBatch--,X.trackingDerivation=i,Hp(e),Wp(e),Fr(r),o}function Wp(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 Hp(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&&Uu(l,e),l.diffValue=0}for(;i--;){var c=n[i];c.diffValue===1&&(c.diffValue=0,Qp(c,e))}r!==Oe.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function os(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Uu(t[n],e);e.dependenciesState_=Oe.NOT_TRACKING_}function Pe(e){var t=kn();try{return e()}finally{en(t)}}function kn(){var e=X.trackingDerivation;return X.trackingDerivation=null,e}function en(e){X.trackingDerivation=e}function ys(e){var t=X.allowStateReads;return X.allowStateReads=e,t}function Fr(e){X.allowStateReads=e}function Pu(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 Pi=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},Ci=!0,Cu=!1,X=function(){var e=Vi();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ci=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Pi().version&&(Ci=!1),Ci?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Pi):(setTimeout(function(){Cu||ce(35)},1),new Pi)}();function Jp(){if((X.pendingReactions.length||X.inBatch||X.isRunningReactions)&&ce(36),Cu=!0,Ci){var e=Vi();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),X=new Pi}}function xu(){return X}function Xp(e){return e.observers_&&e.observers_.size>0}function Yp(e){return e.observers_}function Qp(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Uu(e,t){e.observers_.delete(t),e.observers_.size===0&&Mu(e)}function Mu(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,X.pendingUnobservations.push(e))}function mt(){X.inBatch++}function vt(){if(--X.inBatch===0){ju();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 wt&&n.suspend_())}X.pendingUnobservations=[]}}function Bu(e){Gp(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&&Mu(e),!1)}function Du(e){e.lowestObserverState_!==Oe.STALE_&&(e.lowestObserverState_=Oe.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Oe.UP_TO_DATE_&&(t.isTracing_!==_t.NONE&&Lu(t,e),t.onBecomeStale_()),t.dependenciesState_=Oe.STALE_}))}function Zp(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_!==_t.NONE&&Lu(t,e)):t.dependenciesState_===Oe.UP_TO_DATE_&&(e.lowestObserverState_=Oe.UP_TO_DATE_)}))}function eh(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 Lu(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===_t.BREAK){var n=[];ku(Jr(e),n,1),new Function(`debugger;
|
|
11
11
|
/*
|
|
12
12
|
Tracing '`+e.name_+`'
|
|
13
13
|
|
|
@@ -15,50 +15,50 @@ You are entering this break point because derivation '`+e.name_+"' is being trac
|
|
|
15
15
|
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
|
16
16
|
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
|
17
17
|
|
|
18
|
-
`+(e instanceof
|
|
18
|
+
`+(e instanceof wt?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
|
19
19
|
|
|
20
20
|
The dependencies for this derivation are:
|
|
21
21
|
|
|
22
22
|
`+n.join(`
|
|
23
23
|
`)+`
|
|
24
24
|
*/
|
|
25
|
-
`)()}}function Fa(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 Fa(r,t,n+1)})}var Pt=function(){function e(n,r,i,s){n===void 0&&(n="Reaction@"+gt()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Te.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=pt.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=s}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,H.pendingReactions.push(this),Ka())},t.runReaction_=function(){if(!this.isDisposed){lt(),this.isScheduled=!1;var r=H.trackingContext;if(H.trackingContext=this,bo(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&Ve()&&Tn({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}H.trackingContext=r,ft()}},t.track=function(r){if(!this.isDisposed){lt();var i=Ve(),s;i&&(s=Date.now(),nt({name:this.name_,type:"reaction"})),this.isRunning=!0;var o=H.trackingContext;H.trackingContext=this;var a=Ca(this,r,void 0);H.trackingContext=o,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&_o(this),ni(a)&&this.reportExceptionInDerivation_(a.cause),i&&rt({time:Date.now()-s}),ft()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(H.disableErrorBoundaries)throw r;var s="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";H.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(s,r),Ve()&&Tn({type:"error",name:this.name_,message:s,error:""+r}),H.globalReactionErrorHandlers.forEach(function(o){return o(r,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(lt(),_o(this),ft()))},t.getDisposer_=function(r){var i=this,s=function o(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",o)};return r==null||r.addEventListener==null||r.addEventListener("abort",s),s[he]=this,s},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){r===void 0&&(r=!1),Co(this,r)},Hn(e,[{key:"isDisposed",get:function(){return et(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=tt(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return et(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=tt(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return et(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=tt(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return et(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=tt(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return et(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=tt(this.flags_,e.diffValueMask_,r===1)}}])}();Pt.isDisposedMask_=1;Pt.isScheduledMask_=2;Pt.isTrackPendingMask_=4;Pt.isRunningMask_=8;Pt.diffValueMask_=16;var ta=100,To=function(t){return t()};function Ka(){H.inBatch>0||H.isRunningReactions||To(Pd)}function Pd(){H.isRunningReactions=!0;for(var e=H.pendingReactions,t=0;e.length>0;){++t===ta&&(console.error("Reaction doesn't converge to a stable state after "+ta+" 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_()}H.isRunningReactions=!1}var li=tn("Reaction",Pt);function Rd(e){var t=To;To=function(r){return e(function(){return t(r)})}}function Ve(){return!!H.spyListeners.length}function Tn(e){if(H.spyListeners.length)for(var t=H.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function nt(e){var t=qt({},e,{spyReportStart:!0});Tn(t)}var Nd={type:"report-end",spyReportEnd:!0};function rt(e){Tn(e?qt({},e,{type:"report-end",spyReportEnd:!0}):Nd)}function $d(e){return H.spyListeners.push(e),So(function(){H.spyListeners=H.spyListeners.filter(function(t){return t!==e})})}var $o="action",Cd="action.bound",Va="autoAction",xd="autoAction.bound",Ga="<unnamed action>",wo=Ar($o),Ud=Ar(Cd,{bound:!0}),Oo=Ar(Va,{autoAction:!0}),Md=Ar(xd,{autoAction:!0,bound:!0});function qa(e){var t=function(r,i){if(Me(r))return _n(r.name||Ga,r,e);if(Me(i))return _n(r,i,e);if(Or(i))return(e?Oo:wo).decorate_20223_(r,i);if(vn(i))return wr(r,i,e?Oo:wo);if(vn(r))return Mt(Ar(e?Va:$o,{name:r,autoAction:e}));ae("Invalid arguments for `action`")};return t}var Qe=qa(!1);Object.assign(Qe,wo);var br=qa(!0);Object.assign(br,Oo);Qe.bound=Mt(Ud);br.bound=Mt(Md);function Jn(e){return Na(e.name||Ga,!1,e,this,void 0)}function en(e){return Me(e)&&e.isMobxAction===!0}function mt(e,t){var n,r,i,s;t===void 0&&(t=Eo),Me(e)||ae("Autorun expects a function as first argument"),en(e)&&ae("Autorun does not accept actions since actions are untrackable");var o=(n=(r=t)==null?void 0:r.name)!=null?n:e.name||"Autorun@"+gt(),a=!t.scheduler&&!t.delay,l;if(a)l=new Pt(o,function(){this.track(g)},t.onError,t.requiresObservable);else{var c=Wa(t),d=!1;l=new Pt(o,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_((s=t)==null?void 0:s.signal)}var Dd=function(t){return t()};function Wa(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Dd}function za(e,t,n){var r,i,s;n===void 0&&(n=Eo),(!Me(e)||!Me(t))&&ae("First and second argument to reaction should be functions"),St(n)||ae("Third argument of reactions should be an object");var o=(r=n.name)!=null?r:"Reaction@"+gt(),a=Qe(o,n.onError?Ld(n.onError,t):t),l=!n.scheduler&&!n.delay,c=Wa(n),d=!0,g=!1,C,E=n.compareStructural?Le.structural:n.equals||Le.default,D=new Pt(o,function(){d||l?V():g||(g=!0,c(V))},n.onError,n.requiresObservable);function V(){if(g=!1,!D.isDisposed){var Y=!1,F=C;D.track(function(){var j=gd(!1,function(){return e(D)});Y=d||!E(C,j),C=j}),(d&&n.fireImmediately||!d&&Y)&&a(C,F,D),d=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||D.schedule_(),D.getDisposer_((s=n)==null?void 0:s.signal)}function Ld(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var Bd="onBO",jd="onBUO";function Xn(e,t,n){return Ha(Bd,e,t,n)}function An(e,t,n){return Ha(jd,e,t,n)}function Ha(e,t,n,r){var i=typeof r=="function"?ht(t,n):ht(t),s=Me(r)?r:n,o=e+"L";return i[o]?i[o].add(s):i[o]=new Set([s]),function(){var a=i[o];a&&(a.delete(s),a.size===0&&delete i[o])}}var kd="never",ei="always",Fd="observed";function Ja(e){e.isolateGlobalState===!0&&wd();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(H.useProxies=t===ei?!0:t===kd?!1:typeof Proxy<"u"),t==="ifavailable"&&(H.verifyProxies=!0),n!==void 0){var r=n===ei?ei:n===Fd;H.enforceActions=r,H.allowStateChanges=!(r===!0||r===ei)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(H[i]=!!e[i])}),H.allowStateReads=!H.observableRequiresReaction,H.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&Rd(e.reactionScheduler)}function Kd(e,t,n,r){arguments.length>4&&ae("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&ae("'extendObservable' expects an object as first argument"),Dt(e)&&ae("'extendObservable' should not be used on maps, use map.merge instead"),St(t)||ae("'extendObservable' only accepts plain objects as second argument"),(Wn(t)||Wn(n))&&ae("Extending an object with another observable (object) is not supported");var i=_f(t);return In(function(){var s=Qn(e,r)[he];mi(i).forEach(function(o){s.extend_(o,i[o],n&&o in n?n[o]:!0)})}),e}function Er(e,t){return Xa(ht(e,t))}function Xa(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Vd(e.observing_).map(Xa)),t}function Sr(e,t){return Ya(ht(e,t))}function Ya(e){var t={name:e.name_};return Od(e)&&(t.observers=Array.from(Ad(e)).map(Ya)),t}function Vd(e){return Array.from(new Set(e))}var Gd=0;function Qa(){this.message="FLOW_CANCELLED"}Qa.prototype=Object.create(Error.prototype);var po=Oa("flow"),qd=Oa("flow.bound",{bound:!0}),qn=Object.assign(function(t,n){if(Or(n))return po.decorate_20223_(t,n);if(vn(n))return wr(t,n,po);arguments.length!==1&&ae("Flow expects single argument with generator function");var r=t,i=r.name||"<unnamed flow>",s=function(){var a=this,l=arguments,c=++Gd,d=Qe(i+" - runid: "+c+" - init",r).apply(a,l),g,C=void 0,E=new Promise(function(D,V){var Y=0;g=V;function F(z){C=void 0;var k;try{k=Qe(i+" - runid: "+c+" - yield "+Y++,d.next).call(d,z)}catch(te){return V(te)}q(k)}function j(z){C=void 0;var k;try{k=Qe(i+" - runid: "+c+" - yield "+Y++,d.throw).call(d,z)}catch(te){return V(te)}q(k)}function q(z){if(Me(z?.then)){z.then(q,V);return}return z.done?D(z.value):(C=Promise.resolve(z.value),C.then(F,j))}F(void 0)});return E.cancel=Qe(i+" - runid: "+c+" - cancel",function(){try{C&&na(C);var D=d.return(void 0),V=Promise.resolve(D.value);V.then(Vn,Vn),na(V),g(new Qa)}catch(Y){g(Y)}}),E};return s.isMobXFlow=!0,s},po);qn.bound=Mt(qd);function na(e){Me(e.cancel)&&e.cancel()}function _r(e){return e?.isMobXFlow===!0}function Wd(e,t){return e?t!==void 0?Dt(e)||Yn(e)?ae("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):wn(e)?e[he].values_.has(t):!1:wn(e)||!!e[he]||Po(e)||li(e)||Ir(e):!1}function Wn(e){return arguments.length!==1&&ae("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),Wd(e)}function zd(e){if(wn(e))return e[he].ownKeys_();ae(38)}function ti(e,t,n){return e.set(t,n),n}function Kn(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Wn(e))return e;if(vd(e)||Ir(e))return Kn(e.get(),t);if(t.has(e))return t.get(e);if(Yn(e)){var n=ti(t,e,new Array(e.length));return e.forEach(function(o,a){n[a]=Kn(o,t)}),n}if(Ot(e)){var r=ti(t,e,new Set);return e.forEach(function(o){r.add(Kn(o,t))}),r}if(Dt(e)){var i=ti(t,e,new Map);return e.forEach(function(o,a){i.set(a,Kn(o,t))}),i}else{var s=ti(t,e,{});return zd(e).forEach(function(o){Tr.propertyIsEnumerable.call(e,o)&&(s[o]=Kn(e[o],t))}),s}}function Wt(e,t){return t&&ae("toJS no longer supports options"),Kn(e,new Map)}function Co(){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=Hd(n);if(!i)return ae("'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_===pt.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?pt.BREAK:pt.LOG}function Hd(e){switch(e.length){case 0:return H.trackingDerivation;case 1:return ht(e[0]);case 2:return ht(e[0],e[1])}}function Vt(e,t){t===void 0&&(t=void 0),lt();try{return e.apply(t)}finally{ft()}}function mn(e){return e[he]}var Jd={has:function(t,n){return H.trackingDerivation&&mr("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 vn(n)?(mn(t).values_.has(n)||mr("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 mr("delete properties from an observable object. Use 'remove' from 'mobx' instead."),vn(n)?(r=mn(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return mr("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=mn(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return H.trackingDerivation&&mr("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),mn(t).ownKeys_()},preventExtensions:function(t){ae(13)}};function Xd(e,t){var n,r;return ha(),e=Qn(e,t),(r=(n=e[he]).proxy_)!=null?r:n.proxy_=new Proxy(e,Jd)}function ut(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Pr(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),So(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function ct(e,t){var n=On();try{for(var r=[].concat(e.interceptors_||[]),i=0,s=r.length;i<s&&(t=r[i](t),t&&!t.type&&ae(14),!!t);i++);return t}finally{Gt(n)}}function It(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Rr(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),So(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function Et(e,t){var n=On(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,s=r.length;i<s;i++)r[i](t);Gt(n)}}function rn(e,t,n){return In(function(){var r,i=Qn(e,n)[he];t&&e[Ye]&&ae("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(r=t)!=null||(t=If(e)),mi(t).forEach(function(s){return i.make_(s,t[s])})}),e}var ra="splice",At="update",Yd=1e4,Qd={get:function(t,n){var r=t[he];return n===he?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):dt(fi,n)?fi[n]:t[n]},set:function(t,n,r){var i=t[he];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?t[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){ae(15)}},xo=function(){function e(n,r,i,s){n===void 0&&(n="ObservableArray@"+gt()),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_=s,this.atom_=new nn(n),this.enhancer_=function(o,a){return r(o,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 Pr(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}),Rr(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&ae("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var s=new Array(r-i),o=0;o<r-i;o++)s[o]=void 0;this.spliceWithArray_(i,0,s)}else this.spliceWithArray_(r,i-r)},t.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&ae(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&iu(r+i+1)},t.spliceWithArray_=function(r,i,s){var o=this;xt(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)),s===void 0&&(s=si),ut(this)){var l=ct(this,{object:this.proxy_,type:ra,index:r,removedCount:i,added:s});if(!l)return si;i=l.removedCount,s=l.added}s=s.length===0?s:s.map(function(g){return o.enhancer_(g,void 0)}),this.legacyMode_;var c=s.length-i;this.updateArrayLength_(a,c);var d=this.spliceItemsIntoValues_(r,i,s);return(i!==0||s.length!==0)&&this.notifyArraySplice_(r,s,d),this.dehanceValues_(d)},t.spliceItemsIntoValues_=function(r,i,s){if(s.length<Yd){var o;return(o=this.values_).splice.apply(o,[r,i].concat(s))}else{var a=this.values_.slice(r,r+i),l=this.values_.slice(r+i);this.values_.length+=s.length-i;for(var c=0;c<s.length;c++)this.values_[r+c]=s[c];for(var d=0;d<l.length;d++)this.values_[r+s.length+d]=l[d];return a}},t.notifyArrayChildUpdate_=function(r,i,s){var o=!this.owned_&&Ve(),a=It(this),l=a||o?{observableKind:"array",object:this.proxy_,type:At,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:s}:null;o&&nt(l),this.atom_.reportChanged(),a&&Et(this,l),o&&rt()},t.notifyArraySplice_=function(r,i,s){var o=!this.owned_&&Ve(),a=It(this),l=a||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:ra,index:r,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;o&&nt(l),this.atom_.reportChanged(),a&&Et(this,l),o&&rt()},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 s=this.values_;if(this.legacyMode_&&r>s.length&&ae(17,r,s.length),r<s.length){xt(this.atom_);var o=s[r];if(ut(this)){var a=ct(this,{type:At,object:this.proxy_,index:r,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,o);var l=i!==o;l&&(s[r]=i,this.notifyArrayChildUpdate_(r,i,o))}else{for(var c=new Array(r+1-s.length),d=0;d<c.length-1;d++)c[d]=void 0;c[c.length-1]=i,this.spliceWithArray_(s.length,0,c)}},e}();function Zd(e,t,n,r){return n===void 0&&(n="ObservableArray@"+gt()),r===void 0&&(r=!1),ha(),In(function(){var i=new xo(n,t,r,!1);ma(i.values_,he,i);var s=new Proxy(i.values_,Qd);return i.proxy_=s,e&&e.length&&i.spliceWithArray_(0,0,e),s})}var fi={clear:function(){return this.splice(0)},replace:function(t){var n=this[he];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),s=2;s<r;s++)i[s-2]=arguments[s];var o=this[he];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,n)}return o.spliceWithArray_(t,n,i)},spliceWithArray:function(t,n,r){return this[he].spliceWithArray_(t,n,r)},push:function(){for(var t=this[he],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[he].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[he],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 H.trackingDerivation&&ae(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){H.trackingDerivation&&ae(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[he],r=n.dehanceValues_(n.values_).indexOf(t);return r>-1?(this.splice(r,1),!0):!1}};Re("at",it);Re("concat",it);Re("flat",it);Re("includes",it);Re("indexOf",it);Re("join",it);Re("lastIndexOf",it);Re("slice",it);Re("toString",it);Re("toLocaleString",it);Re("toSorted",it);Re("toSpliced",it);Re("with",it);Re("every",Rt);Re("filter",Rt);Re("find",Rt);Re("findIndex",Rt);Re("findLast",Rt);Re("findLastIndex",Rt);Re("flatMap",Rt);Re("forEach",Rt);Re("map",Rt);Re("some",Rt);Re("toReversed",Rt);Re("reduce",Za);Re("reduceRight",Za);function Re(e,t){typeof Array.prototype[e]=="function"&&(fi[e]=t(e))}function it(e){return function(){var t=this[he];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function Rt(e){return function(t,n){var r=this,i=this[he];i.atom_.reportObserved();var s=i.dehanceValues_(i.values_);return s[e](function(o,a){return t.call(n,o,a,r)})}}function Za(e){return function(){var t=this,n=this[he];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(s,o,a){return i(s,o,a,t)},r[e].apply(r,arguments)}}var ep=tn("ObservableArrayAdministration",xo);function Yn(e){return hi(e)&&ep(e[he])}var tp={},Qt="add",di="delete",eu=function(){function e(n,r,i){var s=this;r===void 0&&(r=bn),i===void 0&&(i="ObservableMap@"+gt()),this.enhancer_=void 0,this.name_=void 0,this[he]=tp,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,Me(Map)||ae(18),In(function(){s.keysAtom_=Ta(s.name_+".keys()"),s.data_=new Map,s.hasMap_=new Map,n&&s.merge(n)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var i=this;if(!H.trackingDerivation)return this.has_(r);var s=this.hasMap_.get(r);if(!s){var o=s=new Zt(this.has_(r),bi,this.name_+"."+ho(r)+"?",!1);this.hasMap_.set(r,o),An(o,function(){return i.hasMap_.delete(r)})}return s.get()},t.set=function(r,i){var s=this.has_(r);if(ut(this)){var o=ct(this,{type:s?At:Qt,object:this,newValue:i,name:r});if(!o)return this;i=o.newValue}return s?this.updateValue_(r,i):this.addValue_(r,i),this},t.delete=function(r){var i=this;if(xt(this.keysAtom_),ut(this)){var s=ct(this,{type:di,object:this,name:r});if(!s)return!1}if(this.has_(r)){var o=Ve(),a=It(this),l=a||o?{observableKind:"map",debugObjectName:this.name_,type:di,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return o&&nt(l),Vt(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&&Et(this,l),o&&rt(),!0}return!1},t.updateValue_=function(r,i){var s=this.data_.get(r);if(i=s.prepareNewValue_(i),i!==H.UNCHANGED){var o=Ve(),a=It(this),l=a||o?{observableKind:"map",debugObjectName:this.name_,type:At,object:this,oldValue:s.value_,name:r,newValue:i}:null;o&&nt(l),s.setNewValue_(i),a&&Et(this,l),o&&rt()}},t.addValue_=function(r,i){var s=this;xt(this.keysAtom_),Vt(function(){var c,d=new Zt(i,s.enhancer_,s.name_+"."+ho(r),!1);s.data_.set(r,d),i=d.value_,(c=s.hasMap_.get(r))==null||c.setNewValue_(!0),s.keysAtom_.reportChanged()});var o=Ve(),a=It(this),l=a||o?{observableKind:"map",debugObjectName:this.name_,type:Qt,object:this,name:r,newValue:i}:null;o&&nt(l),a&&Et(this,l),o&&rt()},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 ia({next:function(){var o=i.next(),a=o.done,l=o.value;return{done:a,value:a?void 0:r.get(l)}}})},t.entries=function(){var r=this,i=this.keys();return ia({next:function(){var o=i.next(),a=o.done,l=o.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 s=Gn(this),o;!(o=s()).done;){var a=o.value,l=a[0],c=a[1];r.call(i,c,l,this)}},t.merge=function(r){var i=this;return Dt(r)&&(r=new Map(r)),Vt(function(){St(r)?bf(r).forEach(function(s){return i.set(s,r[s])}):Array.isArray(r)?r.forEach(function(s){var o=s[0],a=s[1];return i.set(o,a)}):zn(r)?(vf(r)||ae(19,r),r.forEach(function(s,o){return i.set(o,s)})):r!=null&&ae(20,r)}),this},t.clear=function(){var r=this;Vt(function(){Se(function(){for(var i=Gn(r.keys()),s;!(s=i()).done;){var o=s.value;r.delete(o)}})})},t.replace=function(r){var i=this;return Vt(function(){for(var s=np(r),o=new Map,a=!1,l=Gn(i.data_.keys()),c;!(c=l()).done;){var d=c.value;if(!s.has(d)){var g=i.delete(d);if(g)a=!0;else{var C=i.data_.get(d);o.set(d,C)}}}for(var E=Gn(s.entries()),D;!(D=E()).done;){var V=D.value,Y=V[0],F=V[1],j=i.data_.has(Y);if(i.set(Y,F),i.data_.has(Y)){var q=i.data_.get(Y);o.set(Y,q),j||(a=!0)}}if(!a)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var z=i.data_.keys(),k=o.keys(),te=z.next(),W=k.next();!te.done;){if(te.value!==W.value){i.keysAtom_.reportChanged();break}te=z.next(),W=k.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with maps."),Rr(this,r)},t.intercept_=function(r){return Pr(this,r)},Hn(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Dt=tn("ObservableMap",eu);function ia(e){return e[Symbol.toStringTag]="MapIterator",Lo(e)}function np(e){if(zn(e)||Dt(e))return e;if(Array.isArray(e))return new Map(e);if(St(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return ae(21,e)}var rp={},tu=function(){function e(n,r,i){var s=this;r===void 0&&(r=bn),i===void 0&&(i="ObservableSet@"+gt()),this.name_=void 0,this[he]=rp,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,Me(Set)||ae(22),this.enhancer_=function(o,a){return r(o,a,i)},In(function(){s.atom_=Ta(s.name_),n&&s.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;Vt(function(){Se(function(){for(var i=Gn(r.data_.values()),s;!(s=i()).done;){var o=s.value;r.delete(o)}})})},t.forEach=function(r,i){for(var s=Gn(this),o;!(o=s()).done;){var a=o.value;r.call(i,a,a,this)}},t.add=function(r){var i=this;if(xt(this.atom_),ut(this)){var s=ct(this,{type:Qt,object:this,newValue:r});if(!s)return this;r=s.newValue}if(!this.has(r)){Vt(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var o=Ve(),a=It(this),l=a||o?{observableKind:"set",debugObjectName:this.name_,type:Qt,object:this,newValue:r}:null;o&&nt(l),a&&Et(this,l),o&&rt()}return this},t.delete=function(r){var i=this;if(ut(this)){var s=ct(this,{type:di,object:this,oldValue:r});if(!s)return!1}if(this.has(r)){var o=Ve(),a=It(this),l=a||o?{observableKind:"set",debugObjectName:this.name_,type:di,object:this,oldValue:r}:null;return o&&nt(l),Vt(function(){i.atom_.reportChanged(),i.data_.delete(r)}),a&&Et(this,l),o&&rt(),!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 oa({next:function(){var s=r.next(),o=s.value,a=s.done;return a?{value:void 0,done:a}:{value:[o,o],done:a}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var r=this,i=this.data_.values();return oa({next:function(){var o=i.next(),a=o.value,l=o.done;return l?{value:void 0,done:l}:{value:r.dehanceValue_(a),done:l}}})},t.intersection=function(r){if(Kt(r)&&!Ot(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(Kt(r)&&!Ot(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(Kt(r)&&!Ot(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(Kt(r)&&!Ot(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},t.replace=function(r){var i=this;return Ot(r)&&(r=new Set(r)),Vt(function(){Array.isArray(r)?(i.clear(),r.forEach(function(s){return i.add(s)})):Kt(r)?(i.clear(),r.forEach(function(s){return i.add(s)})):r!=null&&ae("Cannot initialize set from "+r)}),this},t.observe_=function(r,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with sets."),Rr(this,r)},t.intercept_=function(r){return Pr(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Hn(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Ot=tn("ObservableSet",tu);function oa(e){return e[Symbol.toStringTag]="SetIterator",Lo(e)}var sa=Object.create(null),aa="remove",Ao=function(){function e(n,r,i,s){r===void 0&&(r=new Map),s===void 0&&(s=Xf),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_=s,this.keysAtom_=new nn(this.name_+".keys"),this.isPlainObject_=St(this.target_),ou(this.defaultAnnotation_)||ae("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 s=this.values_.get(r);if(s instanceof yt)return s.set(i),!0;if(ut(this)){var o=ct(this,{type:At,object:this.proxy_||this.target_,name:r,newValue:i});if(!o)return null;i=o.newValue}if(i=s.prepareNewValue_(i),i!==H.UNCHANGED){var a=It(this),l=Ve(),c=a||l?{type:At,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:r,newValue:i}:null;l&&nt(c),s.setNewValue_(i),a&&Et(this,c),l&&rt()}return!0},t.get_=function(r){return H.trackingDerivation&&!dt(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,s){return s===void 0&&(s=!1),dt(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):s?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},t.has_=function(r){if(!H.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new Zt(r in this.target_,bi,this.name_+"."+ho(r)+"?",!1),this.pendingKeys_.set(r,i)),i.get()},t.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(la(this,i,r),!(r in this.target_)){var s;if((s=this.target_[Ye])!=null&&s[r])return;ae(1,i.annotationType_,this.name_+"."+r.toString())}for(var o=this.target_;o&&o!==Tr;){var a=oi(o,r);if(a){var l=i.make_(this,r,a,o);if(l===0)return;if(l===1)break}o=Object.getPrototypeOf(o)}ca(this,i,r)}},t.extend_=function(r,i,s,o){if(o===void 0&&(o=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(r,i,o);la(this,s,r);var a=s.extend_(this,r,i,o);return a&&ca(this,s,r),a},t.defineProperty_=function(r,i,s){s===void 0&&(s=!1),xt(this.keysAtom_);try{lt();var o=this.delete_(r);if(!o)return o;if(ut(this)){var a=ct(this,{object:this.proxy_||this.target_,name:r,type:Qt,newValue:i.value});if(!a)return null;var l=a.newValue;i.value!==l&&(i=qt({},i,{value:l}))}if(s){if(!Reflect.defineProperty(this.target_,r,i))return!1}else Ut(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{ft()}return!0},t.defineObservableProperty_=function(r,i,s,o){o===void 0&&(o=!1),xt(this.keysAtom_);try{lt();var a=this.delete_(r);if(!a)return a;if(ut(this)){var l=ct(this,{object:this.proxy_||this.target_,name:r,type:Qt,newValue:i});if(!l)return null;i=l.newValue}var c=ua(r),d={configurable:H.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,r,d))return!1}else Ut(this.target_,r,d);var g=new Zt(i,s,this.name_+"."+r.toString(),!1);this.values_.set(r,g),this.notifyPropertyAddition_(r,g.value_)}finally{ft()}return!0},t.defineComputedProperty_=function(r,i,s){s===void 0&&(s=!1),xt(this.keysAtom_);try{lt();var o=this.delete_(r);if(!o)return o;if(ut(this)){var a=ct(this,{object:this.proxy_||this.target_,name:r,type:Qt,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+r.toString()),i.context=this.proxy_||this.target_;var l=ua(r),c={configurable:H.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(s){if(!Reflect.defineProperty(this.target_,r,c))return!1}else Ut(this.target_,r,c);this.values_.set(r,new yt(i)),this.notifyPropertyAddition_(r,void 0)}finally{ft()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),xt(this.keysAtom_),!dt(this.target_,r))return!0;if(ut(this)){var s=ct(this,{object:this.proxy_||this.target_,name:r,type:aa});if(!s)return null}try{var o;lt();var a=It(this),l=Ve(),c=this.values_.get(r),d=void 0;if(!c&&(a||l)){var g;d=(g=oi(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 Zt&&(d=c.value_),ja(c)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(r in this.target_),a||l){var C={type:aa,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:r};l&&nt(C),a&&Et(this,C),l&&rt()}}finally{ft()}return!0},t.observe_=function(r,i){return i===!0&&ae("`observe` doesn't support the fire immediately property for observable objects."),Rr(this,r)},t.intercept_=function(r){return Pr(this,r)},t.notifyPropertyAddition_=function(r,i){var s,o=It(this),a=Ve();if(o||a){var l=o||a?{type:Qt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;a&&nt(l),o&&Et(this,l),a&&rt()}(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),mi(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Qn(e,t){var n;if(t&&wn(e)&&ae("Options can't be provided for already observable objects."),dt(e,he))return Mo(e)instanceof Ao||ae("Cannot convert '"+pi(e)+`' into observable object:
|
|
25
|
+
`)()}}function ku(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 ku(r,t,n+1)})}var Dt=function(){function e(n,r,i,o){n===void 0&&(n="Reaction@"+At()),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_=_t.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),ju())},t.runReaction_=function(){if(!this.isDisposed){mt(),this.isScheduled=!1;var r=X.trackingContext;if(X.trackingContext=this,is(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&He()&&Dn({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}X.trackingContext=r,vt()}},t.track=function(r){if(!this.isDisposed){mt();var i=He(),o;i&&(o=Date.now(),ct({name:this.name_,type:"reaction"})),this.isRunning=!0;var s=X.trackingContext;X.trackingContext=this;var a=Ru(this,r,void 0);X.trackingContext=s,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&os(this),Ri(a)&&this.reportExceptionInDerivation_(a.cause),i&<({time:Date.now()-o}),vt()}},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),He()&&Dn({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||(mt(),os(this),vt()))},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),ms(this,r)},yr(e,[{key:"isDisposed",get:function(){return at(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=ut(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return at(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=ut(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return at(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=ut(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return at(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=ut(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return at(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ut(this.flags_,e.diffValueMask_,r===1)}}])}();Dt.isDisposedMask_=1;Dt.isScheduledMask_=2;Dt.isTrackPendingMask_=4;Dt.isRunningMask_=8;Dt.diffValueMask_=16;var Za=100,ss=function(t){return t()};function ju(){X.inBatch>0||X.isRunningReactions||ss(th)}function th(){X.isRunningReactions=!0;for(var e=X.pendingReactions,t=0;e.length>0;){++t===Za&&(console.error("Reaction doesn't converge to a stable state after "+Za+" 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 Li=yn("Reaction",Dt);function nh(e){var t=ss;ss=function(r){return e(function(){return t(r)})}}function He(){return!!X.spyListeners.length}function Dn(e){if(X.spyListeners.length)for(var t=X.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function ct(e){var t=tn({},e,{spyReportStart:!0});Dn(t)}var rh={type:"report-end",spyReportEnd:!0};function lt(e){Dn(e?tn({},e,{type:"report-end",spyReportEnd:!0}):rh)}function ih(e){return X.spyListeners.push(e),ds(function(){X.spyListeners=X.spyListeners.filter(function(t){return t!==e})})}var gs="action",oh="action.bound",Fu="autoAction",sh="autoAction.bound",Vu="<unnamed action>",as=Wr(gs),ah=Wr(oh,{bound:!0}),us=Wr(Fu,{autoAction:!0}),uh=Wr(sh,{autoAction:!0,bound:!0});function Ku(e){var t=function(r,i){if(je(r))return Bn(r.name||Vu,r,e);if(je(i))return Bn(r,i,e);if(Gr(i))return(e?us:as).decorate_20223_(r,i);if(Un(i))return qr(r,i,e?us:as);if(Un(r))return qt(Wr(e?Fu:gs,{name:r,autoAction:e}));ce("Invalid arguments for `action`")};return t}var ot=Ku(!1);Object.assign(ot,as);var Vr=Ku(!0);Object.assign(Vr,us);ot.bound=qt(ah);Vr.bound=qt(uh);function gr(e){return Nu(e.name||Vu,!1,e,this,void 0)}function hn(e){return je(e)&&e.isMobxAction===!0}function Ot(e,t){var n,r,i,o;t===void 0&&(t=fs),je(e)||ce("Autorun expects a function as first argument"),hn(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@"+At(),a=!t.scheduler&&!t.delay,l;if(a)l=new Dt(s,function(){this.track(g)},t.onError,t.requiresObservable);else{var c=zu(t),d=!1;l=new Dt(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 ch=function(t){return t()};function zu(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:ch}function qu(e,t,n){var r,i,o;n===void 0&&(n=fs),(!je(e)||!je(t))&&ce("First and second argument to reaction should be functions"),Bt(n)||ce("Third argument of reactions should be an object");var s=(r=n.name)!=null?r:"Reaction@"+At(),a=ot(s,n.onError?lh(n.onError,t):t),l=!n.scheduler&&!n.delay,c=zu(n),d=!0,g=!1,C,I=n.compareStructural?Ve.structural:n.equals||Ve.default,S=new Dt(s,function(){d||l?V():g||(g=!0,c(V))},n.onError,n.requiresObservable);function V(){if(g=!1,!S.isDisposed){var J=!1,F=C;S.track(function(){var k=Kp(!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 lh(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var fh="onBO",dh="onBUO";function mr(e,t,n){return Gu(fh,e,t,n)}function jn(e,t,n){return Gu(dh,e,t,n)}function Gu(e,t,n,r){var i=typeof r=="function"?Tt(t,n):Tt(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",Ni="always",hh="observed";function Wu(e){e.isolateGlobalState===!0&&Jp();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(X.useProxies=t===Ni?!0:t===ph?!1:typeof Proxy<"u"),t==="ifavailable"&&(X.verifyProxies=!0),n!==void 0){var r=n===Ni?Ni:n===hh;X.enforceActions=r,X.allowStateChanges=!(r===!0||r===Ni)}["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&&nh(e.reactionScheduler)}function yh(e,t,n,r){arguments.length>4&&ce("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&ce("'extendObservable' expects an object as first argument"),Gt(e)&&ce("'extendObservable' should not be used on maps, use map.merge instead"),Bt(t)||ce("'extendObservable' only accepts plain objects as second argument"),(pr(t)||pr(n))&&ce("Extending an object with another observable (object) is not supported");var i=Wd(t);return Fn(function(){var o=br(e,r)[ve];qi(i).forEach(function(s){o.extend_(s,i[s],n&&s in n?n[s]:!0)})}),e}function Jr(e,t){return Hu(Tt(e,t))}function Hu(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=gh(e.observing_).map(Hu)),t}function Xr(e,t){return Ju(Tt(e,t))}function Ju(e){var t={name:e.name_};return Xp(e)&&(t.observers=Array.from(Yp(e)).map(Ju)),t}function gh(e){return Array.from(new Set(e))}var mh=0;function Xu(){this.message="FLOW_CANCELLED"}Xu.prototype=Object.create(Error.prototype);var Qo=wu("flow"),vh=wu("flow.bound",{bound:!0}),dr=Object.assign(function(t,n){if(Gr(n))return Qo.decorate_20223_(t,n);if(Un(n))return qr(t,n,Qo);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=ot(i+" - runid: "+c+" - init",r).apply(a,l),g,C=void 0,I=new Promise(function(S,V){var J=0;g=V;function F(W){C=void 0;var j;try{j=ot(i+" - runid: "+c+" - yield "+J++,d.next).call(d,W)}catch(Z){return V(Z)}z(j)}function k(W){C=void 0;var j;try{j=ot(i+" - runid: "+c+" - yield "+J++,d.throw).call(d,W)}catch(Z){return V(Z)}z(j)}function z(W){if(je(W?.then)){W.then(z,V);return}return W.done?S(W.value):(C=Promise.resolve(W.value),C.then(F,k))}F(void 0)});return I.cancel=ot(i+" - runid: "+c+" - cancel",function(){try{C&&eu(C);var S=d.return(void 0),V=Promise.resolve(S.value);V.then(lr,lr),eu(V),g(new Xu)}catch(J){g(J)}}),I};return o.isMobXFlow=!0,o},Qo);dr.bound=qt(vh);function eu(e){je(e.cancel)&&e.cancel()}function Kr(e){return e?.isMobXFlow===!0}function bh(e,t){return e?t!==void 0?Gt(e)||vr(e)?ce("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):Ln(e)?e[ve].values_.has(t):!1:Ln(e)||!!e[ve]||ps(e)||Li(e)||Hr(e):!1}function pr(e){return arguments.length!==1&&ce("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),bh(e)}function _h(e){if(Ln(e))return e[ve].ownKeys_();ce(38)}function $i(e,t,n){return e.set(t,n),n}function cr(e,t){if(e==null||typeof e!="object"||e instanceof Date||!pr(e))return e;if(qp(e)||Hr(e))return cr(e.get(),t);if(t.has(e))return t.get(e);if(vr(e)){var n=$i(t,e,new Array(e.length));return e.forEach(function(s,a){n[a]=cr(s,t)}),n}if(Ct(e)){var r=$i(t,e,new Set);return e.forEach(function(s){r.add(cr(s,t))}),r}if(Gt(e)){var i=$i(t,e,new Map);return e.forEach(function(s,a){i.set(a,cr(s,t))}),i}else{var o=$i(t,e,{});return _h(e).forEach(function(s){zr.propertyIsEnumerable.call(e,s)&&(o[s]=cr(e[s],t))}),o}}function nn(e,t){return t&&ce("toJS no longer supports options"),cr(e,new Map)}function ms(){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=wh(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_===_t.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?_t.BREAK:_t.LOG}function wh(e){switch(e.length){case 0:return X.trackingDerivation;case 1:return Tt(e[0]);case 2:return Tt(e[0],e[1])}}function Zt(e,t){t===void 0&&(t=void 0),mt();try{return e.apply(t)}finally{vt()}}function xn(e){return e[ve]}var Th={has:function(t,n){return X.trackingDerivation&&jr("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),xn(t).has_(n)},get:function(t,n){return xn(t).get_(n)},set:function(t,n,r){var i;return Un(n)?(xn(t).values_.has(n)||jr("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=xn(t).set_(n,r,!0))!=null?i:!0):!1},deleteProperty:function(t,n){var r;return jr("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Un(n)?(r=xn(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return jr("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=xn(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return X.trackingDerivation&&jr("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),xn(t).ownKeys_()},preventExtensions:function(t){ce(13)}};function Ah(e,t){var n,r;return pu(),e=br(e,t),(r=(n=e[ve]).proxy_)!=null?r:n.proxy_=new Proxy(e,Th)}function yt(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Yr(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),ds(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function gt(e,t){var n=kn();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{en(n)}}function Ut(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Qr(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),ds(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function Mt(e,t){var n=kn(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](t);en(n)}}function mn(e,t,n){return Fn(function(){var r,i=br(e,n)[ve];t&&e[it]&&ce("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(r=t)!=null||(t=Qd(e)),qi(t).forEach(function(o){return i.make_(o,t[o])})}),e}var tu="splice",xt="update",Oh=1e4,Eh={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)):bt(ki,n)?ki[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)}},vs=function(){function e(n,r,i,o){n===void 0&&(n="ObservableArray@"+At()),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 gn(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 Yr(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}),Qr(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&&nc(r+i+1)},t.spliceWithArray_=function(r,i,o){var s=this;Kt(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=Ui),yt(this)){var l=gt(this,{object:this.proxy_,type:tu,index:r,removedCount:i,added:o});if(!l)return Ui;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<Oh){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_&&He(),a=Ut(this),l=a||s?{observableKind:"array",object:this.proxy_,type:xt,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:o}:null;s&&ct(l),this.atom_.reportChanged(),a&&Mt(this,l),s&<()},t.notifyArraySplice_=function(r,i,o){var s=!this.owned_&&He(),a=Ut(this),l=a||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:tu,index:r,removed:o,added:i,removedCount:o.length,addedCount:i.length}:null;s&&ct(l),this.atom_.reportChanged(),a&&Mt(this,l),s&<()},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){Kt(this.atom_);var s=o[r];if(yt(this)){var a=gt(this,{type:xt,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 Ih(e,t,n,r){return n===void 0&&(n="ObservableArray@"+At()),r===void 0&&(r=!1),pu(),Fn(function(){var i=new vs(n,t,r,!1);yu(i.values_,ve,i);var o=new Proxy(i.values_,Eh);return i.proxy_=o,e&&e.length&&i.spliceWithArray_(0,0,e),o})}var ki={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",ft);xe("concat",ft);xe("flat",ft);xe("includes",ft);xe("indexOf",ft);xe("join",ft);xe("lastIndexOf",ft);xe("slice",ft);xe("toString",ft);xe("toLocaleString",ft);xe("toSorted",ft);xe("toSpliced",ft);xe("with",ft);xe("every",Lt);xe("filter",Lt);xe("find",Lt);xe("findIndex",Lt);xe("findLast",Lt);xe("findLastIndex",Lt);xe("flatMap",Lt);xe("forEach",Lt);xe("map",Lt);xe("some",Lt);xe("toReversed",Lt);xe("reduce",Yu);xe("reduceRight",Yu);function xe(e,t){typeof Array.prototype[e]=="function"&&(ki[e]=t(e))}function ft(e){return function(){var t=this[ve];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function Lt(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 Yu(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 Sh=yn("ObservableArrayAdministration",vs);function vr(e){return Ki(e)&&Sh(e[ve])}var Nh={},dn="add",ji="delete",Qu=function(){function e(n,r,i){var o=this;r===void 0&&(r=Mn),i===void 0&&(i="ObservableMap@"+At()),this.enhancer_=void 0,this.name_=void 0,this[ve]=Nh,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),Fn(function(){o.keysAtom_=bu(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 pn(this.has_(r),Wi,this.name_+"."+es(r)+"?",!1);this.hasMap_.set(r,s),jn(s,function(){return i.hasMap_.delete(r)})}return o.get()},t.set=function(r,i){var o=this.has_(r);if(yt(this)){var s=gt(this,{type:o?xt:dn,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(Kt(this.keysAtom_),yt(this)){var o=gt(this,{type:ji,object:this,name:r});if(!o)return!1}if(this.has_(r)){var s=He(),a=Ut(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:ji,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return s&&ct(l),Zt(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&&Mt(this,l),s&<(),!0}return!1},t.updateValue_=function(r,i){var o=this.data_.get(r);if(i=o.prepareNewValue_(i),i!==X.UNCHANGED){var s=He(),a=Ut(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:xt,object:this,oldValue:o.value_,name:r,newValue:i}:null;s&&ct(l),o.setNewValue_(i),a&&Mt(this,l),s&<()}},t.addValue_=function(r,i){var o=this;Kt(this.keysAtom_),Zt(function(){var c,d=new pn(i,o.enhancer_,o.name_+"."+es(r),!1);o.data_.set(r,d),i=d.value_,(c=o.hasMap_.get(r))==null||c.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=He(),a=Ut(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:dn,object:this,name:r,newValue:i}:null;s&&ct(l),a&&Mt(this,l),s&<()},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 nu({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 nu({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=fr(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 Gt(r)&&(r=new Map(r)),Zt(function(){Bt(r)?Gd(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)}):hr(r)?(qd(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;Zt(function(){Pe(function(){for(var i=fr(r.keys()),o;!(o=i()).done;){var s=o.value;r.delete(s)}})})},t.replace=function(r){var i=this;return Zt(function(){for(var o=$h(r),s=new Map,a=!1,l=fr(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=fr(o.entries()),S;!(S=I()).done;){var V=S.value,J=V[0],F=V[1],k=i.data_.has(J);if(i.set(J,F),i.data_.has(J)){var z=i.data_.get(J);s.set(J,z),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."),Qr(this,r)},t.intercept_=function(r){return Yr(this,r)},yr(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Gt=yn("ObservableMap",Qu);function nu(e){return e[Symbol.toStringTag]="MapIterator",Ts(e)}function $h(e){if(hr(e)||Gt(e))return e;if(Array.isArray(e))return new Map(e);if(Bt(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return ce(21,e)}var Rh={},Zu=function(){function e(n,r,i){var o=this;r===void 0&&(r=Mn),i===void 0&&(i="ObservableSet@"+At()),this.name_=void 0,this[ve]=Rh,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)},Fn(function(){o.atom_=bu(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;Zt(function(){Pe(function(){for(var i=fr(r.data_.values()),o;!(o=i()).done;){var s=o.value;r.delete(s)}})})},t.forEach=function(r,i){for(var o=fr(this),s;!(s=o()).done;){var a=s.value;r.call(i,a,a,this)}},t.add=function(r){var i=this;if(Kt(this.atom_),yt(this)){var o=gt(this,{type:dn,object:this,newValue:r});if(!o)return this;r=o.newValue}if(!this.has(r)){Zt(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var s=He(),a=Ut(this),l=a||s?{observableKind:"set",debugObjectName:this.name_,type:dn,object:this,newValue:r}:null;s&&ct(l),a&&Mt(this,l),s&<()}return this},t.delete=function(r){var i=this;if(yt(this)){var o=gt(this,{type:ji,object:this,oldValue:r});if(!o)return!1}if(this.has(r)){var s=He(),a=Ut(this),l=a||s?{observableKind:"set",debugObjectName:this.name_,type:ji,object:this,oldValue:r}:null;return s&&ct(l),Zt(function(){i.atom_.reportChanged(),i.data_.delete(r)}),a&&Mt(this,l),s&<(),!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 ru({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 ru({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(Qt(r)&&!Ct(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(Qt(r)&&!Ct(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(Qt(r)&&!Ct(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(Qt(r)&&!Ct(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},t.replace=function(r){var i=this;return Ct(r)&&(r=new Set(r)),Zt(function(){Array.isArray(r)?(i.clear(),r.forEach(function(o){return i.add(o)})):Qt(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."),Qr(this,r)},t.intercept_=function(r){return Yr(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},yr(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Ct=yn("ObservableSet",Zu);function ru(e){return e[Symbol.toStringTag]="SetIterator",Ts(e)}var iu=Object.create(null),ou="remove",cs=function(){function e(n,r,i,o){r===void 0&&(r=new Map),o===void 0&&(o=Ap),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 gn(this.name_+".keys"),this.isPlainObject_=Bt(this.target_),rc(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 wt)return o.set(i),!0;if(yt(this)){var s=gt(this,{type:xt,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=Ut(this),l=He(),c=a||l?{type:xt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:r,newValue:i}:null;l&&ct(c),o.setNewValue_(i),a&&Mt(this,c),l&<()}return!0},t.get_=function(r){return X.trackingDerivation&&!bt(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,o){return o===void 0&&(o=!1),bt(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 pn(r in this.target_,Wi,this.name_+"."+es(r)+"?",!1),this.pendingKeys_.set(r,i)),i.get()},t.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(uu(this,i,r),!(r in this.target_)){var o;if((o=this.target_[it])!=null&&o[r])return;ce(1,i.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==zr;){var a=xi(s,r);if(a){var l=i.make_(this,r,a,s);if(l===0)return;if(l===1)break}s=Object.getPrototypeOf(s)}au(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);uu(this,o,r);var a=o.extend_(this,r,i,s);return a&&au(this,o,r),a},t.defineProperty_=function(r,i,o){o===void 0&&(o=!1),Kt(this.keysAtom_);try{mt();var s=this.delete_(r);if(!s)return s;if(yt(this)){var a=gt(this,{object:this.proxy_||this.target_,name:r,type:dn,newValue:i.value});if(!a)return null;var l=a.newValue;i.value!==l&&(i=tn({},i,{value:l}))}if(o){if(!Reflect.defineProperty(this.target_,r,i))return!1}else zt(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{vt()}return!0},t.defineObservableProperty_=function(r,i,o,s){s===void 0&&(s=!1),Kt(this.keysAtom_);try{mt();var a=this.delete_(r);if(!a)return a;if(yt(this)){var l=gt(this,{object:this.proxy_||this.target_,name:r,type:dn,newValue:i});if(!l)return null;i=l.newValue}var c=su(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 zt(this.target_,r,d);var g=new pn(i,o,this.name_+"."+r.toString(),!1);this.values_.set(r,g),this.notifyPropertyAddition_(r,g.value_)}finally{vt()}return!0},t.defineComputedProperty_=function(r,i,o){o===void 0&&(o=!1),Kt(this.keysAtom_);try{mt();var s=this.delete_(r);if(!s)return s;if(yt(this)){var a=gt(this,{object:this.proxy_||this.target_,name:r,type:dn,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+r.toString()),i.context=this.proxy_||this.target_;var l=su(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 zt(this.target_,r,c);this.values_.set(r,new wt(i)),this.notifyPropertyAddition_(r,void 0)}finally{vt()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),Kt(this.keysAtom_),!bt(this.target_,r))return!0;if(yt(this)){var o=gt(this,{object:this.proxy_||this.target_,name:r,type:ou});if(!o)return null}try{var s;mt();var a=Ut(this),l=He(),c=this.values_.get(r),d=void 0;if(!c&&(a||l)){var g;d=(g=xi(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 pn&&(d=c.value_),Du(c)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),a||l){var C={type:ou,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:r};l&&ct(C),a&&Mt(this,C),l&<()}}finally{vt()}return!0},t.observe_=function(r,i){return i===!0&&ce("`observe` doesn't support the fire immediately property for observable objects."),Qr(this,r)},t.intercept_=function(r){return Yr(this,r)},t.notifyPropertyAddition_=function(r,i){var o,s=Ut(this),a=He();if(s||a){var l=s||a?{type:dn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;a&&ct(l),s&&Mt(this,l),a&<()}(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),qi(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function br(e,t){var n;if(t&&Ln(e)&&ce("Options can't be provided for already observable objects."),bt(e,ve))return _s(e)instanceof cs||ce("Cannot convert '"+Fi(e)+`' into observable object:
|
|
26
26
|
The target is already observable of different type.
|
|
27
|
-
Extending builtins is not supported.`),e;Object.isExtensible(e)||
|
|
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:(Bt(e)?"ObservableObject":e.constructor.name)+"@"+At(),i=new cs(e,new Map,String(r),Up(t));return zi(e,ve,i),e}var Ph=yn("ObservableObjectAdministration",cs);function su(e){return iu[e]||(iu[e]={get:function(){return this[ve].getObservablePropValue_(e)},set:function(n){return this[ve].setObservablePropValue_(e,n)}})}function Ln(e){return Ki(e)?Ph(e[ve]):!1}function au(e,t,n){var r;e.appliedAnnotations_[n]=t,(r=e.target_[it])==null||delete r[n]}function uu(e,t,n){if(rc(t)||ce("Cannot annotate '"+e.name_+"."+n.toString()+"': Invalid annotation."),!Mi(t)&&bt(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 op=ru(0),sp=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),yo=0,nu=function(){};function ap(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}ap(nu,Array.prototype);var Uo=function(e){function t(r,i,s,o){var a;return s===void 0&&(s="ObservableArray@"+gt()),o===void 0&&(o=!1),a=e.call(this)||this,In(function(){var l=new xo(s,i,o,!0);l.proxy_=a,ma(a,he,l),r&&r.length&&a.spliceWithArray(0,0,r),sp&&Object.defineProperty(a,"0",op)}),a}_a(t,e);var n=t.prototype;return n.concat=function(){this[he].atom_.reportObserved();for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),s.map(function(a){return Yn(a)?a.slice():a}))},n[Symbol.iterator]=function(){var r=this,i=0;return Lo({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},Hn(t,[{key:"length",get:function(){return this[he].getArrayLength_()},set:function(i){this[he].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(nu);Object.entries(fi).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&gi(Uo.prototype,t,n)});function ru(e){return{enumerable:!1,configurable:!0,get:function(){return this[he].get_(e)},set:function(n){this[he].set_(e,n)}}}function up(e){Ut(Uo.prototype,""+e,ru(e))}function iu(e){if(e>yo){for(var t=yo;t<e+100;t++)up(t);yo=e}}iu(1e3);function cp(e,t,n){return new Uo(e,t,n)}function ht(e,t){if(typeof e=="object"&&e!==null){if(Yn(e))return t!==void 0&&ae(23),e[he].atom_;if(Ot(e))return e.atom_;if(Dt(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||ae(25,t,pi(e)),n}if(wn(e)){if(!t)return ae(26);var r=e[he].values_.get(t);return r||ae(27,t,pi(e)),r}if(Po(e)||Ir(e)||li(e))return e}else if(Me(e)&&li(e[he]))return e[he];ae(28)}function Mo(e,t){if(e||ae(29),t!==void 0)return Mo(ht(e,t));if(Po(e)||Ir(e)||li(e)||Dt(e)||Ot(e))return e;if(e[he])return e[he];ae(24,e)}function pi(e,t){var n;if(t!==void 0)n=ht(e,t);else{if(en(e))return e.name;wn(e)||Dt(e)||Ot(e)?n=Mo(e):n=ht(e)}return n.name_}function In(e){var t=On(),n=Ti(!0);lt();try{return e()}finally{ft(),wi(n),Gt(t)}}var fa=Tr.toString;function Do(e,t,n){return n===void 0&&(n=-1),Io(e,t,n)}function Io(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 s=typeof e;if(s!=="function"&&s!=="object"&&typeof t!="object")return!1;var o=fa.call(e);if(o!==fa.call(t))return!1;switch(o){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=da(e),t=da(t);var a=o==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(Me(l)&&l instanceof l&&Me(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(!Io(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 E=0;E<C;E++){var D=g[E];if(!(dt(t,D)&&Io(e[D],t[D],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function da(e){return Yn(e)?e.slice():zn(e)||Dt(e)||Kt(e)||Ot(e)?Array.from(e.entries()):e}var pa,lp=((pa=yi().Iterator)==null?void 0:pa.prototype)||{};function Lo(e){return e[Symbol.iterator]=fp,Object.assign(Object.create(lp),e)}function fp(){return this}function ou(e){return e instanceof Object&&typeof e.annotationType_=="string"&&Me(e.make_)&&Me(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=yi();typeof t[e]>"u"&&ae("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:$d,extras:{getDebugName:pi},$mobx:he});var dp=Object.create,Bo=Object.defineProperty,pp=Object.getOwnPropertyDescriptor,su=Object.getOwnPropertyNames,yp=Object.getPrototypeOf,hp=Object.prototype.hasOwnProperty,xe=(e,t)=>function(){return t||(0,e[su(e)[0]])((t={exports:{}}).exports,t),t.exports},jo=(e,t)=>{for(var n in t)Bo(e,n,{get:t[n],enumerable:!0})},gp=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of su(t))!hp.call(e,i)&&i!==n&&Bo(e,i,{get:()=>t[i],enumerable:!(r=pp(t,i))||r.enumerable});return e},vt=(e,t,n)=>(n=e!=null?dp(yp(e)):{},gp(t||!e||!e.__esModule?Bo(n,"default",{value:e,enumerable:!0}):n,e));var zt=xe({"../../../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 I(){return new Map(_)}f.Entries=I;function U(){return _.clear()}f.Clear=U;function N(T){return _.delete(T)}f.Delete=N;function S(T){return _.has(T)}f.Has=S;function h(T,u){_.set(T,u)}f.Set=h;function w(T){return _.get(T)}f.Get=w})(t||(e.TypeRegistry=t={}));var n=class extends Error{constructor(f){super(f)}};e.TypeBoxError=n;var r;(function(f){let _=new Map;function I(){return new Map(_)}f.Entries=I;function U(){return _.clear()}f.Clear=U;function N(T){return _.delete(T)}f.Delete=N;function S(T){return _.has(T)}f.Has=S;function h(T,u){_.set(T,u)}f.Set=h;function w(T){return _.get(T)}f.Get=w})(r||(e.FormatRegistry=r={}));var i;(function(f){function _(b){return Array.isArray(b)}f.IsArray=_;function I(b){return typeof b=="bigint"}f.IsBigInt=I;function U(b){return typeof b=="boolean"}f.IsBoolean=U;function N(b){return b instanceof globalThis.Date}f.IsDate=N;function S(b){return b===null}f.IsNull=S;function h(b){return typeof b=="number"}f.IsNumber=h;function w(b){return typeof b=="object"&&b!==null}f.IsObject=w;function T(b){return typeof b=="string"}f.IsString=T;function u(b){return b instanceof globalThis.Uint8Array}f.IsUint8Array=u;function O(b){return b===void 0}f.IsUndefined=O})(i||(e.ValueGuard=i={}));var s=class extends n{};e.TypeGuardUnknownTypeError=s;var o;(function(f){function _(m){try{return new RegExp(m),!0}catch{return!1}}function I(m){if(!i.IsString(m))return!1;for(let Ee=0;Ee<m.length;Ee++){let at=m.charCodeAt(Ee);if(at>=7&&at<=13||at===27||at===127)return!1}return!0}function U(m){return h(m)||je(m)}function N(m){return i.IsUndefined(m)||i.IsBigInt(m)}function S(m){return i.IsUndefined(m)||i.IsNumber(m)}function h(m){return i.IsUndefined(m)||i.IsBoolean(m)}function w(m){return i.IsUndefined(m)||i.IsString(m)}function T(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)&&_(m)}function u(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)}function O(m){return i.IsUndefined(m)||je(m)}function b(m){return me(m,"Any")&&w(m.$id)}f.TAny=b;function v(m){return me(m,"Array")&&m.type==="array"&&w(m.$id)&&je(m.items)&&S(m.minItems)&&S(m.maxItems)&&h(m.uniqueItems)&&O(m.contains)&&S(m.minContains)&&S(m.maxContains)}f.TArray=v;function P(m){return me(m,"AsyncIterator")&&m.type==="AsyncIterator"&&w(m.$id)&&je(m.items)}f.TAsyncIterator=P;function K(m){return me(m,"BigInt")&&m.type==="bigint"&&w(m.$id)&&N(m.exclusiveMaximum)&&N(m.exclusiveMinimum)&&N(m.maximum)&&N(m.minimum)&&N(m.multipleOf)}f.TBigInt=K;function ee(m){return me(m,"Boolean")&&m.type==="boolean"&&w(m.$id)}f.TBoolean=ee;function ne(m){return me(m,"Constructor")&&m.type==="Constructor"&&w(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Ee=>je(Ee))&&je(m.returns)}f.TConstructor=ne;function pe(m){return me(m,"Date")&&m.type==="Date"&&w(m.$id)&&S(m.exclusiveMaximumTimestamp)&&S(m.exclusiveMinimumTimestamp)&&S(m.maximumTimestamp)&&S(m.minimumTimestamp)&&S(m.multipleOfTimestamp)}f.TDate=pe;function ge(m){return me(m,"Function")&&m.type==="Function"&&w(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Ee=>je(Ee))&&je(m.returns)}f.TFunction=ge;function Ne(m){return me(m,"Integer")&&m.type==="integer"&&w(m.$id)&&S(m.exclusiveMaximum)&&S(m.exclusiveMinimum)&&S(m.maximum)&&S(m.minimum)&&S(m.multipleOf)}f.TInteger=Ne;function De(m){return me(m,"Intersect")&&!(i.IsString(m.type)&&m.type!=="object")&&i.IsArray(m.allOf)&&m.allOf.every(Ee=>je(Ee)&&!hr(Ee))&&w(m.type)&&(h(m.unevaluatedProperties)||O(m.unevaluatedProperties))&&w(m.$id)}f.TIntersect=De;function pn(m){return me(m,"Iterator")&&m.type==="Iterator"&&w(m.$id)&&je(m.items)}f.TIterator=pn;function me(m,Ee){return Yt(m)&&m[e.Kind]===Ee}f.TKindOf=me;function Yt(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}f.TKind=Yt;function yn(m){return R(m)&&i.IsString(m.const)}f.TLiteralString=yn;function A(m){return R(m)&&i.IsNumber(m.const)}f.TLiteralNumber=A;function ue(m){return R(m)&&i.IsBoolean(m.const)}f.TLiteralBoolean=ue;function R(m){return me(m,"Literal")&&w(m.$id)&&(i.IsBoolean(m.const)||i.IsNumber(m.const)||i.IsString(m.const))}f.TLiteral=R;function ye(m){return me(m,"Never")&&i.IsObject(m.not)&&Object.getOwnPropertyNames(m.not).length===0}f.TNever=ye;function re(m){return me(m,"Not")&&je(m.not)}f.TNot=re;function ce(m){return me(m,"Null")&&m.type==="null"&&w(m.$id)}f.TNull=ce;function Oe(m){return me(m,"Number")&&m.type==="number"&&w(m.$id)&&S(m.exclusiveMaximum)&&S(m.exclusiveMinimum)&&S(m.maximum)&&S(m.minimum)&&S(m.multipleOf)}f.TNumber=Oe;function Ue(m){return me(m,"Object")&&m.type==="object"&&w(m.$id)&&i.IsObject(m.properties)&&U(m.additionalProperties)&&S(m.minProperties)&&S(m.maxProperties)&&Object.entries(m.properties).every(([Ee,at])=>I(Ee)&&je(at))}f.TObject=Ue;function He(m){return me(m,"Promise")&&m.type==="Promise"&&w(m.$id)&&je(m.item)}f.TPromise=He;function We(m){return me(m,"Record")&&m.type==="object"&&w(m.$id)&&U(m.additionalProperties)&&i.IsObject(m.patternProperties)&&(Ee=>{let at=Object.getOwnPropertyNames(Ee.patternProperties);return at.length===1&&_(at[0])&&i.IsObject(Ee.patternProperties)&&je(Ee.patternProperties[at[0]])})(m)}f.TRecord=We;function Xe(m){return i.IsObject(m)&&e.Hint in m&&m[e.Hint]==="Recursive"}f.TRecursive=Xe;function Ft(m){return me(m,"Ref")&&w(m.$id)&&i.IsString(m.$ref)}f.TRef=Ft;function jn(m){return me(m,"String")&&m.type==="string"&&w(m.$id)&&S(m.minLength)&&S(m.maxLength)&&T(m.pattern)&&u(m.format)}f.TString=jn;function kn(m){return me(m,"Symbol")&&m.type==="symbol"&&w(m.$id)}f.TSymbol=kn;function hn(m){return me(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}f.TTemplateLiteral=hn;function Jr(m){return me(m,"This")&&w(m.$id)&&i.IsString(m.$ref)}f.TThis=Jr;function hr(m){return i.IsObject(m)&&e.Transform in m}f.TTransform=hr;function Be(m){return me(m,"Tuple")&&m.type==="array"&&w(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(Ee=>je(Ee)))}f.TTuple=Be;function Xr(m){return me(m,"Undefined")&&m.type==="undefined"&&w(m.$id)}f.TUndefined=Xr;function uo(m){return gn(m)&&m.anyOf.every(Ee=>yn(Ee)||A(Ee))}f.TUnionLiteral=uo;function gn(m){return me(m,"Union")&&w(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every(Ee=>je(Ee))}f.TUnion=gn;function Fn(m){return me(m,"Uint8Array")&&m.type==="Uint8Array"&&w(m.$id)&&S(m.minByteLength)&&S(m.maxByteLength)}f.TUint8Array=Fn;function Je(m){return me(m,"Unknown")&&w(m.$id)}f.TUnknown=Je;function Yr(m){return me(m,"Unsafe")}f.TUnsafe=Yr;function gr(m){return me(m,"Void")&&m.type==="void"&&w(m.$id)}f.TVoid=gr;function co(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}f.TReadonly=co;function lo(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}f.TOptional=lo;function je(m){return i.IsObject(m)&&(b(m)||v(m)||ee(m)||K(m)||P(m)||ne(m)||pe(m)||ge(m)||Ne(m)||De(m)||pn(m)||R(m)||ye(m)||re(m)||ce(m)||Oe(m)||Ue(m)||He(m)||We(m)||Ft(m)||jn(m)||kn(m)||hn(m)||Jr(m)||Be(m)||Xr(m)||gn(m)||Fn(m)||Je(m)||Yr(m)||gr(m)||Yt(m)&&t.Has(m[e.Kind]))}f.TSchema=je})(o||(e.TypeGuard=o={}));var a;(function(f){function _(I){return I[e.Kind]==="Intersect"?I.allOf.every(U=>_(U)):I[e.Kind]==="Union"?I.anyOf.some(U=>_(U)):I[e.Kind]==="Undefined"?!0:I[e.Kind]==="Not"?!_(I.not):!1}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 I(p){throw new l(p)}function U(p){return o.TNever(p)||o.TIntersect(p)||o.TUnion(p)||o.TUnknown(p)||o.TAny(p)}function N(p,y){return o.TNever(y)?me(p,y):o.TIntersect(y)?ge(p,y):o.TUnion(y)?fo(p,y):o.TUnknown(y)?Js(p,y):o.TAny(y)?S(p,y):I("StructuralRight")}function S(p,y){return c.True}function h(p,y){return o.TIntersect(y)?ge(p,y):o.TUnion(y)&&y.anyOf.some(_e=>o.TAny(_e)||o.TUnknown(_e))?c.True:o.TUnion(y)?c.Union:o.TUnknown(y)||o.TAny(y)?c.True:c.Union}function w(p,y){return o.TUnknown(p)?c.False:o.TAny(p)?c.Union:o.TNever(p)?c.True:c.False}function T(p,y){return o.TObject(y)&&hn(y)?c.True:U(y)?N(p,y):o.TArray(y)?_(Ie(p.items,y.items)):c.False}function u(p,y){return U(y)?N(p,y):o.TAsyncIterator(y)?_(Ie(p.items,y.items)):c.False}function O(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TBigInt(y)?c.True:c.False}function b(p,y){return o.TLiteral(p)&&i.IsBoolean(p.const)||o.TBoolean(p)?c.True:c.False}function v(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TBoolean(y)?c.True:c.False}function P(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TConstructor(y)?p.parameters.length>y.parameters.length?c.False:p.parameters.every((_e,wt)=>_(Ie(y.parameters[wt],_e))===c.True)?_(Ie(p.returns,y.returns)):c.False:c.False}function K(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TDate(y)?c.True:c.False}function ee(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TFunction(y)?p.parameters.length>y.parameters.length?c.False:p.parameters.every((_e,wt)=>_(Ie(y.parameters[wt],_e))===c.True)?_(Ie(p.returns,y.returns)):c.False:c.False}function ne(p,y){return o.TLiteral(p)&&i.IsNumber(p.const)||o.TNumber(p)||o.TInteger(p)?c.True:c.False}function pe(p,y){return o.TInteger(y)||o.TNumber(y)?c.True:U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):c.False}function ge(p,y){return y.allOf.every(_e=>Ie(p,_e)===c.True)?c.True:c.False}function Ne(p,y){return p.allOf.some(_e=>Ie(_e,y)===c.True)?c.True:c.False}function De(p,y){return U(y)?N(p,y):o.TIterator(y)?_(Ie(p.items,y.items)):c.False}function pn(p,y){return o.TLiteral(y)&&y.const===p.const?c.True:U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TString(y)?gr(p,y):o.TNumber(y)?R(p,y):o.TInteger(y)?ne(p,y):o.TBoolean(y)?b(p,y):c.False}function me(p,y){return c.False}function Yt(p,y){return c.True}function yn(p){let[y,_e]=[p,0];for(;o.TNot(y);)y=y.not,_e+=1;return _e%2===0?y:e.Type.Unknown()}function A(p,y){return o.TNot(p)?Ie(yn(p),y):o.TNot(y)?Ie(p,yn(y)):I("Invalid fallthrough for Not")}function ue(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TNull(y)?c.True:c.False}function R(p,y){return o.TLiteralNumber(p)||o.TNumber(p)||o.TInteger(p)?c.True:c.False}function ye(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TInteger(y)||o.TNumber(y)?c.True:c.False}function re(p,y){return Object.getOwnPropertyNames(p.properties).length===y}function ce(p){return hn(p)}function Oe(p){return re(p,0)||re(p,1)&&"description"in p.properties&&o.TUnion(p.properties.description)&&p.properties.description.anyOf.length===2&&(o.TString(p.properties.description.anyOf[0])&&o.TUndefined(p.properties.description.anyOf[1])||o.TString(p.properties.description.anyOf[1])&&o.TUndefined(p.properties.description.anyOf[0]))}function Ue(p){return re(p,0)}function He(p){return re(p,0)}function We(p){return re(p,0)}function Xe(p){return re(p,0)}function Ft(p){return hn(p)}function jn(p){let y=e.Type.Number();return re(p,0)||re(p,1)&&"length"in p.properties&&_(Ie(p.properties.length,y))===c.True}function kn(p){return re(p,0)}function hn(p){let y=e.Type.Number();return re(p,0)||re(p,1)&&"length"in p.properties&&_(Ie(p.properties.length,y))===c.True}function Jr(p){let y=e.Type.Function([e.Type.Any()],e.Type.Any());return re(p,0)||re(p,1)&&"then"in p.properties&&_(Ie(p.properties.then,y))===c.True}function hr(p,y){return Ie(p,y)===c.False||o.TOptional(p)&&!o.TOptional(y)?c.False:c.True}function Be(p,y){return o.TUnknown(p)?c.False:o.TAny(p)?c.Union:o.TNever(p)||o.TLiteralString(p)&&ce(y)||o.TLiteralNumber(p)&&Ue(y)||o.TLiteralBoolean(p)&&He(y)||o.TSymbol(p)&&Oe(y)||o.TBigInt(p)&&We(y)||o.TString(p)&&ce(y)||o.TSymbol(p)&&Oe(y)||o.TNumber(p)&&Ue(y)||o.TInteger(p)&&Ue(y)||o.TBoolean(p)&&He(y)||o.TUint8Array(p)&&Ft(y)||o.TDate(p)&&Xe(y)||o.TConstructor(p)&&kn(y)||o.TFunction(p)&&jn(y)?c.True:o.TRecord(p)&&o.TString(gn(p))?y[e.Hint]==="Record"?c.True:c.False:o.TRecord(p)&&o.TNumber(gn(p))?re(y,0)?c.True:c.False:c.False}function Xr(p,y){return U(y)?N(p,y):o.TRecord(y)?Je(p,y):o.TObject(y)?(()=>{for(let _e of Object.getOwnPropertyNames(y.properties)){if(!(_e in p.properties)&&!o.TOptional(y.properties[_e]))return c.False;if(o.TOptional(y.properties[_e]))return c.True;if(hr(p.properties[_e],y.properties[_e])===c.False)return c.False}return c.True})():c.False}function uo(p,y){return U(y)?N(p,y):o.TObject(y)&&Jr(y)?c.True:o.TPromise(y)?_(Ie(p.item,y.item)):c.False}function gn(p){return e.PatternNumberExact in p.patternProperties?e.Type.Number():e.PatternStringExact in p.patternProperties?e.Type.String():I("Unknown record key pattern")}function Fn(p){return e.PatternNumberExact in p.patternProperties?p.patternProperties[e.PatternNumberExact]:e.PatternStringExact in p.patternProperties?p.patternProperties[e.PatternStringExact]:I("Unable to get record value schema")}function Je(p,y){let[_e,wt]=[gn(y),Fn(y)];return o.TLiteralString(p)&&o.TNumber(_e)&&_(Ie(p,wt))===c.True?c.True:o.TUint8Array(p)&&o.TNumber(_e)||o.TString(p)&&o.TNumber(_e)||o.TArray(p)&&o.TNumber(_e)?Ie(p,wt):o.TObject(p)?(()=>{for(let df of Object.getOwnPropertyNames(p.properties))if(hr(wt,p.properties[df])===c.False)return c.False;return c.True})():c.False}function Yr(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Ie(Fn(p),Fn(y)):c.False}function gr(p,y){return o.TLiteral(p)&&i.IsString(p.const)||o.TString(p)?c.True:c.False}function co(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TString(y)?c.True:c.False}function lo(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TSymbol(y)?c.True:c.False}function je(p,y){return o.TTemplateLiteral(p)?Ie(k.Resolve(p),y):o.TTemplateLiteral(y)?Ie(p,k.Resolve(y)):I("Invalid fallthrough for TemplateLiteral")}function m(p,y){return o.TArray(y)&&p.items!==void 0&&p.items.every(_e=>Ie(_e,y.items)===c.True)}function Ee(p,y){return o.TNever(p)?c.True:o.TUnknown(p)?c.False:o.TAny(p)?c.Union:c.False}function at(p,y){return U(y)?N(p,y):o.TObject(y)&&hn(y)||o.TArray(y)&&m(p,y)?c.True:o.TTuple(y)?i.IsUndefined(p.items)&&!i.IsUndefined(y.items)||!i.IsUndefined(p.items)&&i.IsUndefined(y.items)?c.False:i.IsUndefined(p.items)&&!i.IsUndefined(y.items)||p.items.every((_e,wt)=>Ie(_e,y.items[wt])===c.True)?c.True:c.False:c.False}function of(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TUint8Array(y)?c.True:c.False}function sf(p,y){return U(y)?N(p,y):o.TObject(y)?Be(p,y):o.TRecord(y)?Je(p,y):o.TVoid(y)?cf(p,y):o.TUndefined(y)?c.True:c.False}function fo(p,y){return y.anyOf.some(_e=>Ie(p,_e)===c.True)?c.True:c.False}function af(p,y){return p.anyOf.every(_e=>Ie(_e,y)===c.True)?c.True:c.False}function Js(p,y){return c.True}function uf(p,y){return o.TNever(y)?me(p,y):o.TIntersect(y)?ge(p,y):o.TUnion(y)?fo(p,y):o.TAny(y)?S(p,y):o.TString(y)?gr(p,y):o.TNumber(y)?R(p,y):o.TInteger(y)?ne(p,y):o.TBoolean(y)?b(p,y):o.TArray(y)?w(p,y):o.TTuple(y)?Ee(p,y):o.TObject(y)?Be(p,y):o.TUnknown(y)?c.True:c.False}function cf(p,y){return o.TUndefined(p)||o.TUndefined(p)?c.True:c.False}function lf(p,y){return o.TIntersect(y)?ge(p,y):o.TUnion(y)?fo(p,y):o.TUnknown(y)?Js(p,y):o.TAny(y)?S(p,y):o.TObject(y)?Be(p,y):o.TVoid(y)?c.True:c.False}function Ie(p,y){return o.TTemplateLiteral(p)||o.TTemplateLiteral(y)?je(p,y):o.TNot(p)||o.TNot(y)?A(p,y):o.TAny(p)?h(p,y):o.TArray(p)?T(p,y):o.TBigInt(p)?O(p,y):o.TBoolean(p)?v(p,y):o.TAsyncIterator(p)?u(p,y):o.TConstructor(p)?P(p,y):o.TDate(p)?K(p,y):o.TFunction(p)?ee(p,y):o.TInteger(p)?pe(p,y):o.TIntersect(p)?Ne(p,y):o.TIterator(p)?De(p,y):o.TLiteral(p)?pn(p,y):o.TNever(p)?Yt(p,y):o.TNull(p)?ue(p,y):o.TNumber(p)?ye(p,y):o.TObject(p)?Xr(p,y):o.TRecord(p)?Yr(p,y):o.TString(p)?co(p,y):o.TSymbol(p)?lo(p,y):o.TTuple(p)?at(p,y):o.TPromise(p)?uo(p,y):o.TUint8Array(p)?of(p,y):o.TUndefined(p)?sf(p,y):o.TUnion(p)?af(p,y):o.TUnknown(p)?uf(p,y):o.TVoid(p)?lf(p,y):I(`Unknown left type operand '${p[e.Kind]}'`)}function ff(p,y){return Ie(p,y)}f.Extends=ff})(d||(e.TypeExtends=d={}));var g;(function(f){function _(T){return T.map(u=>S(u))}function I(T){return new Date(T.getTime())}function U(T){return new Uint8Array(T)}function N(T){let u=Object.getOwnPropertyNames(T).reduce((b,v)=>({...b,[v]:S(T[v])}),{}),O=Object.getOwnPropertySymbols(T).reduce((b,v)=>({...b,[v]:S(T[v])}),{});return{...u,...O}}function S(T){return i.IsArray(T)?_(T):i.IsDate(T)?I(T):i.IsUint8Array(T)?U(T):i.IsObject(T)?N(T):T}function h(T){return T.map(u=>w(u))}f.Rest=h;function w(T,u={}){return{...S(T),...u}}f.Type=w})(g||(e.TypeClone=g={}));var C;(function(f){function _(P){return P.map(K=>{let{[e.Optional]:ee,...ne}=g.Type(K);return ne})}function I(P){return P.every(K=>o.TOptional(K))}function U(P){return P.some(K=>o.TOptional(K))}function N(P){return I(P.allOf)?e.Type.Optional(e.Type.Intersect(_(P.allOf))):P}function S(P){return U(P.anyOf)?e.Type.Optional(e.Type.Union(_(P.anyOf))):P}function h(P){return P[e.Kind]==="Intersect"?N(P):P[e.Kind]==="Union"?S(P):P}function w(P,K){let ee=P.allOf.reduce((ne,pe)=>{let ge=b(pe,K);return ge[e.Kind]==="Never"?ne:[...ne,ge]},[]);return h(e.Type.Intersect(ee))}function T(P,K){let ee=P.anyOf.map(ne=>b(ne,K));return h(e.Type.Union(ee))}function u(P,K){let ee=P.properties[K];return i.IsUndefined(ee)?e.Type.Never():e.Type.Union([ee])}function O(P,K){let ee=P.items;if(i.IsUndefined(ee))return e.Type.Never();let ne=ee[K];return i.IsUndefined(ne)?e.Type.Never():ne}function b(P,K){return P[e.Kind]==="Intersect"?w(P,K):P[e.Kind]==="Union"?T(P,K):P[e.Kind]==="Object"?u(P,K):P[e.Kind]==="Tuple"?O(P,K):e.Type.Never()}function v(P,K,ee={}){let ne=K.map(pe=>b(P,pe.toString()));return h(e.Type.Union(ne,ee))}f.Resolve=v})(C||(e.IndexedAccessor=C={}));var E;(function(f){function _(O){let[b,v]=[O.slice(0,1),O.slice(1)];return`${b.toLowerCase()}${v}`}function I(O){let[b,v]=[O.slice(0,1),O.slice(1)];return`${b.toUpperCase()}${v}`}function U(O){return O.toUpperCase()}function N(O){return O.toLowerCase()}function S(O,b){let v=W.ParseExact(O.pattern);if(!x.Check(v))return{...O,pattern:h(O.pattern,b)};let ee=[...B.Generate(v)].map(ge=>e.Type.Literal(ge)),ne=w(ee,b),pe=e.Type.Union(ne);return e.Type.TemplateLiteral([pe])}function h(O,b){return typeof O=="string"?b==="Uncapitalize"?_(O):b==="Capitalize"?I(O):b==="Uppercase"?U(O):b==="Lowercase"?N(O):O:O.toString()}function w(O,b){if(O.length===0)return[];let[v,...P]=O;return[u(v,b),...w(P,b)]}function T(O,b){return o.TTemplateLiteral(O)?S(O,b):o.TUnion(O)?e.Type.Union(w(O.anyOf,b)):o.TLiteral(O)?e.Type.Literal(h(O.const,b)):O}function u(O,b){return T(O,b)}f.Map=u})(E||(e.Intrinsic=E={}));var D;(function(f){function _(h,w){return e.Type.Intersect(h.allOf.map(T=>N(T,w)),{...h})}function I(h,w){return e.Type.Union(h.anyOf.map(T=>N(T,w)),{...h})}function U(h,w){return w(h)}function N(h,w){return h[e.Kind]==="Intersect"?_(h,w):h[e.Kind]==="Union"?I(h,w):h[e.Kind]==="Object"?U(h,w):h}function S(h,w,T){return{...N(g.Type(h),w),...T}}f.Map=S})(D||(e.ObjectMap=D={}));var V;(function(f){function _(u){return u[0]==="^"&&u[u.length-1]==="$"?u.slice(1,u.length-1):u}function I(u,O){return u.allOf.reduce((b,v)=>[...b,...h(v,O)],[])}function U(u,O){let b=u.anyOf.map(v=>h(v,O));return[...b.reduce((v,P)=>P.map(K=>b.every(ee=>ee.includes(K))?v.add(K):v)[0],new Set)]}function N(u,O){return Object.getOwnPropertyNames(u.properties)}function S(u,O){return O.includePatterns?Object.getOwnPropertyNames(u.patternProperties):[]}function h(u,O){return o.TIntersect(u)?I(u,O):o.TUnion(u)?U(u,O):o.TObject(u)?N(u,O):o.TRecord(u)?S(u,O):[]}function w(u,O){return[...new Set(h(u,O))]}f.ResolveKeys=w;function T(u){return`^(${w(u,{includePatterns:!0}).map(v=>`(${_(v)})`).join("|")})$`}f.ResolvePattern=T})(V||(e.KeyResolver=V={}));var Y=class extends n{};e.KeyArrayResolverError=Y;var F;(function(f){function _(I){return Array.isArray(I)?I:o.TUnionLiteral(I)?I.anyOf.map(U=>U.const.toString()):o.TLiteral(I)?[I.const]:o.TTemplateLiteral(I)?(()=>{let U=W.ParseExact(I.pattern);if(!x.Check(U))throw new Y("Cannot resolve keys from infinite template expression");return[...B.Generate(U)]})():[]}f.Resolve=_})(F||(e.KeyArrayResolver=F={}));var j;(function(f){function*_(U){for(let N of U.anyOf)N[e.Kind]==="Union"?yield*_(N):yield N}function I(U){return e.Type.Union([..._(U)],{...U})}f.Resolve=I})(j||(e.UnionResolver=j={}));var q=class extends n{};e.TemplateLiteralPatternError=q;var z;(function(f){function _(S){throw new q(S)}function I(S){return S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U(S,h){return o.TTemplateLiteral(S)?S.pattern.slice(1,S.pattern.length-1):o.TUnion(S)?`(${S.anyOf.map(w=>U(w,h)).join("|")})`:o.TNumber(S)?`${h}${e.PatternNumber}`:o.TInteger(S)?`${h}${e.PatternNumber}`:o.TBigInt(S)?`${h}${e.PatternNumber}`:o.TString(S)?`${h}${e.PatternString}`:o.TLiteral(S)?`${h}${I(S.const.toString())}`:o.TBoolean(S)?`${h}${e.PatternBoolean}`:_(`Unexpected Kind '${S[e.Kind]}'`)}function N(S){return`^${S.map(h=>U(h,"")).join("")}$`}f.Create=N})(z||(e.TemplateLiteralPattern=z={}));var k;(function(f){function _(I){let U=W.ParseExact(I.pattern);if(!x.Check(U))return e.Type.String();let N=[...B.Generate(U)].map(S=>e.Type.Literal(S));return e.Type.Union(N)}f.Resolve=_})(k||(e.TemplateLiteralResolver=k={}));var te=class extends n{};e.TemplateLiteralParserError=te;var W;(function(f){function _(P,K,ee){return P[K]===ee&&P.charCodeAt(K-1)!==92}function I(P,K){return _(P,K,"(")}function U(P,K){return _(P,K,")")}function N(P,K){return _(P,K,"|")}function S(P){if(!(I(P,0)&&U(P,P.length-1)))return!1;let K=0;for(let ee=0;ee<P.length;ee++)if(I(P,ee)&&(K+=1),U(P,ee)&&(K-=1),K===0&&ee!==P.length-1)return!1;return!0}function h(P){return P.slice(1,P.length-1)}function w(P){let K=0;for(let ee=0;ee<P.length;ee++)if(I(P,ee)&&(K+=1),U(P,ee)&&(K-=1),N(P,ee)&&K===0)return!0;return!1}function T(P){for(let K=0;K<P.length;K++)if(I(P,K))return!0;return!1}function u(P){let[K,ee]=[0,0],ne=[];for(let ge=0;ge<P.length;ge++)if(I(P,ge)&&(K+=1),U(P,ge)&&(K-=1),N(P,ge)&&K===0){let Ne=P.slice(ee,ge);Ne.length>0&&ne.push(b(Ne)),ee=ge+1}let pe=P.slice(ee);return pe.length>0&&ne.push(b(pe)),ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"or",expr:ne}}function O(P){function K(pe,ge){if(!I(pe,ge))throw new te("TemplateLiteralParser: Index must point to open parens");let Ne=0;for(let De=ge;De<pe.length;De++)if(I(pe,De)&&(Ne+=1),U(pe,De)&&(Ne-=1),Ne===0)return[ge,De];throw new te("TemplateLiteralParser: Unclosed group parens in expression")}function ee(pe,ge){for(let Ne=ge;Ne<pe.length;Ne++)if(I(pe,Ne))return[ge,Ne];return[ge,pe.length]}let ne=[];for(let pe=0;pe<P.length;pe++)if(I(P,pe)){let[ge,Ne]=K(P,pe),De=P.slice(ge,Ne+1);ne.push(b(De)),pe=Ne}else{let[ge,Ne]=ee(P,pe),De=P.slice(ge,Ne);De.length>0&&ne.push(b(De)),pe=Ne-1}return ne.length===0?{type:"const",const:""}:ne.length===1?ne[0]:{type:"and",expr:ne}}function b(P){return S(P)?b(h(P)):w(P)?u(P):T(P)?O(P):{type:"const",const:P}}f.Parse=b;function v(P){return b(P.slice(1,P.length-1))}f.ParseExact=v})(W||(e.TemplateLiteralParser=W={}));var le=class extends n{};e.TemplateLiteralFiniteError=le;var x;(function(f){function _(h){throw new le(h)}function I(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="0"&&h.expr[1].type==="const"&&h.expr[1].const==="[1-9][0-9]*"}function U(h){return h.type==="or"&&h.expr.length===2&&h.expr[0].type==="const"&&h.expr[0].const==="true"&&h.expr[1].type==="const"&&h.expr[1].const==="false"}function N(h){return h.type==="const"&&h.const===".*"}function S(h){return U(h)?!0:I(h)||N(h)?!1:h.type==="and"?h.expr.every(w=>S(w)):h.type==="or"?h.expr.every(w=>S(w)):h.type==="const"?!0:_("Unknown expression type")}f.Check=S})(x||(e.TemplateLiteralFinite=x={}));var M=class extends n{};e.TemplateLiteralGeneratorError=M;var B;(function(f){function*_(h){if(h.length===1)return yield*h[0];for(let w of h[0])for(let T of _(h.slice(1)))yield`${w}${T}`}function*I(h){return yield*_(h.expr.map(w=>[...S(w)]))}function*U(h){for(let w of h.expr)yield*S(w)}function*N(h){return yield h.const}function*S(h){return h.type==="and"?yield*I(h):h.type==="or"?yield*U(h):h.type==="const"?yield*N(h):(()=>{throw new M("Unknown expression")})()}f.Generate=S})(B||(e.TemplateLiteralGenerator=B={}));var Q;(function(f){function*_(S){let h=S.trim().replace(/"|'/g,"");return h==="boolean"?yield e.Type.Boolean():h==="number"?yield e.Type.Number():h==="bigint"?yield e.Type.BigInt():h==="string"?yield e.Type.String():yield(()=>{let w=h.split("|").map(T=>e.Type.Literal(T.trim()));return w.length===0?e.Type.Never():w.length===1?w[0]:e.Type.Union(w)})()}function*I(S){if(S[1]!=="{"){let h=e.Type.Literal("$"),w=U(S.slice(1));return yield*[h,...w]}for(let h=2;h<S.length;h++)if(S[h]==="}"){let w=_(S.slice(2,h)),T=U(S.slice(h+1));return yield*[...w,...T]}yield e.Type.Literal(S)}function*U(S){for(let h=0;h<S.length;h++)if(S[h]==="$"){let w=e.Type.Literal(S.slice(0,h)),T=I(S.slice(h));return yield*[w,...T]}yield e.Type.Literal(S)}function N(S){return[...U(S)]}f.Parse=N})(Q||(e.TemplateLiteralDslParser=Q={}));var ie=class{constructor(f){this.schema=f}Decode(f){return new X(this.schema,f)}};e.TransformDecodeBuilder=ie;var X=class{constructor(f,_){this.schema=f,this.decode=_}Encode(f){let _=g.Type(this.schema);return o.TTransform(_)?(()=>{let N={Encode:S=>_[e.Transform].Encode(f(S)),Decode:S=>this.decode(_[e.Transform].Decode(S))};return{..._,[e.Transform]:N}})():(()=>{let I={Decode:this.decode,Encode:f};return{..._,[e.Transform]:I}})()}};e.TransformEncodeBuilder=X;var se=0,L=class extends n{};e.TypeBuilderError=L;var G=class{Create(f){return f}Throw(f){throw new L(f)}Discard(f,_){return _.reduce((I,U)=>{let{[U]:N,...S}=I;return S},f)}Strict(f){return JSON.parse(JSON.stringify(f))}};e.TypeBuilder=G;var J=class extends G{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{...E.Map(g.Type(f),"Capitalize"),..._}}Composite(f,_){let I=e.Type.Intersect(f,{}),N=V.ResolveKeys(I,{includePatterns:!1}).reduce((S,h)=>({...S,[h]:e.Type.Index(I,[h])}),{});return e.Type.Object(N,_)}Enum(f,_={}){if(i.IsUndefined(f))return this.Throw("Enum undefined or empty");let I=Object.getOwnPropertyNames(f).filter(S=>isNaN(S)).map(S=>f[S]),N=[...new Set(I)].map(S=>e.Type.Literal(S));return this.Union(N,{..._,[e.Hint]:"Enum"})}Extends(f,_,I,U,N={}){switch(d.Extends(f,_)){case c.Union:return this.Union([g.Type(I,N),g.Type(U,N)]);case c.True:return g.Type(I,N);case c.False:return g.Type(U,N)}}Exclude(f,_,I={}){return o.TTemplateLiteral(f)?this.Exclude(k.Resolve(f),_,I):o.TTemplateLiteral(_)?this.Exclude(f,k.Resolve(_),I):o.TUnion(f)?(()=>{let U=f.anyOf.filter(N=>d.Extends(N,_)===c.False);return U.length===1?g.Type(U[0],I):this.Union(U,I)})():d.Extends(f,_)!==c.False?this.Never(I):g.Type(f,I)}Extract(f,_,I={}){return o.TTemplateLiteral(f)?this.Extract(k.Resolve(f),_,I):o.TTemplateLiteral(_)?this.Extract(f,k.Resolve(_),I):o.TUnion(f)?(()=>{let U=f.anyOf.filter(N=>d.Extends(N,_)!==c.False);return U.length===1?g.Type(U[0],I):this.Union(U,I)})():d.Extends(f,_)!==c.False?g.Type(f,I):this.Never(I)}Index(f,_,I={}){return o.TArray(f)&&o.TNumber(_)?g.Type(f.items,I):o.TTuple(f)&&o.TNumber(_)?(()=>{let N=(i.IsUndefined(f.items)?[]:f.items).map(S=>g.Type(S));return this.Union(N,I)})():(()=>{let U=F.Resolve(_),N=g.Type(f);return C.Resolve(N,U,I)})()}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=>o.TTransform(S))&&this.Throw("Cannot intersect transform types");let I=f.every(S=>o.TObject(S)),U=g.Rest(f),N=o.TSchema(_.unevaluatedProperties)?{unevaluatedProperties:g.Type(_.unevaluatedProperties)}:{};return _.unevaluatedProperties===!1||o.TSchema(_.unevaluatedProperties)||I?this.Create({..._,...N,[e.Kind]:"Intersect",type:"object",allOf:U}):this.Create({..._,...N,[e.Kind]:"Intersect",allOf:U})}KeyOf(f,_={}){return o.TRecord(f)?(()=>{let I=Object.getOwnPropertyNames(f.patternProperties)[0];return I===e.PatternNumberExact?this.Number(_):I===e.PatternStringExact?this.String(_):this.Throw("Unable to resolve key type from Record key pattern")})():o.TTuple(f)?(()=>{let U=(i.IsUndefined(f.items)?[]:f.items).map((N,S)=>e.Type.Literal(S.toString()));return this.Union(U,_)})():o.TArray(f)?this.Number(_):(()=>{let I=V.ResolveKeys(f,{includePatterns:!1});if(I.length===0)return this.Never(_);let U=I.map(N=>this.Literal(N));return this.Union(U,_)})()}Literal(f,_={}){return this.Create({..._,[e.Kind]:"Literal",const:f,type:typeof f})}Lowercase(f,_={}){return{...E.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 I=Object.getOwnPropertyNames(f),U=I.filter(w=>o.TOptional(f[w])),N=I.filter(w=>!U.includes(w)),S=o.TSchema(_.additionalProperties)?{additionalProperties:g.Type(_.additionalProperties)}:{},h=I.reduce((w,T)=>({...w,[T]:g.Type(f[T])}),{});return N.length>0?this.Create({..._,...S,[e.Kind]:"Object",type:"object",properties:h,required:N}):this.Create({..._,...S,[e.Kind]:"Object",type:"object",properties:h})}Omit(f,_,I={}){let U=F.Resolve(_);return D.Map(this.Discard(g.Type(f),["$id",e.Transform]),N=>{i.IsArray(N.required)&&(N.required=N.required.filter(S=>!U.includes(S)),N.required.length===0&&delete N.required);for(let S of Object.getOwnPropertyNames(N.properties))U.includes(S)&&delete N.properties[S];return this.Create(N)},I)}Partial(f,_={}){return D.Map(this.Discard(g.Type(f),["$id",e.Transform]),I=>{let U=Object.getOwnPropertyNames(I.properties).reduce((N,S)=>({...N,[S]:this.Optional(I.properties[S])}),{});return this.Object(U,this.Discard(I,["required"]))},_)}Pick(f,_,I={}){let U=F.Resolve(_);return D.Map(this.Discard(g.Type(f),["$id",e.Transform]),N=>{i.IsArray(N.required)&&(N.required=N.required.filter(S=>U.includes(S)),N.required.length===0&&delete N.required);for(let S of Object.getOwnPropertyNames(N.properties))U.includes(S)||delete N.properties[S];return this.Create(N)},I)}Record(f,_,I={}){return o.TTemplateLiteral(f)?(()=>{let U=W.ParseExact(f.pattern);return x.Check(U)?this.Object([...B.Generate(U)].reduce((N,S)=>({...N,[S]:g.Type(_)}),{}),I):this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[f.pattern]:g.Type(_)}})})():o.TUnion(f)?(()=>{let U=j.Resolve(f);if(o.TUnionLiteral(U)){let N=U.anyOf.reduce((S,h)=>({...S,[h.const]:g.Type(_)}),{});return this.Object(N,{...I,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():o.TLiteral(f)?i.IsString(f.const)||i.IsNumber(f.const)?this.Object({[f.const]:g.Type(_)},I):this.Throw("Record key of type literal is not of type string or number"):o.TInteger(f)||o.TNumber(f)?this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:g.Type(_)}}):o.TString(f)?(()=>{let U=i.IsUndefined(f.pattern)?e.PatternStringExact:f.pattern;return this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[U]:g.Type(_)}})})():this.Never()}Recursive(f,_={}){i.IsUndefined(_.$id)&&(_.$id=`T${se++}`);let I=f({[e.Kind]:"This",$ref:`${_.$id}`});return I.$id=_.$id,this.Create({..._,[e.Hint]:"Recursive",...I})}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 D.Map(this.Discard(g.Type(f),["$id",e.Transform]),I=>{let U=Object.getOwnPropertyNames(I.properties).reduce((N,S)=>({...N,[S]:this.Discard(I.properties[S],[e.Optional])}),{});return this.Object(U,I)},_)}Rest(f){return o.TTuple(f)&&!i.IsUndefined(f.items)?g.Rest(f.items):o.TIntersect(f)?g.Rest(f.allOf):o.TUnion(f)?g.Rest(f.anyOf):[]}String(f={}){return this.Create({...f,[e.Kind]:"String",type:"string"})}TemplateLiteral(f,_={}){let I=i.IsString(f)?z.Create(Q.Parse(f)):z.Create(f);return this.Create({..._,[e.Kind]:"TemplateLiteral",type:"string",pattern:I})}Transform(f){return new ie(f)}Tuple(f,_={}){let[I,U,N]=[!1,f.length,f.length],S=g.Rest(f),h=f.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:S,additionalItems:I,minItems:U,maxItems:N}:{..._,[e.Kind]:"Tuple",type:"array",minItems:U,maxItems:N};return this.Create(h)}Uncapitalize(f,_={}){return{...E.Map(g.Type(f),"Uncapitalize"),..._}}Union(f,_={}){return o.TTemplateLiteral(f)?k.Resolve(f):(()=>{let I=f;if(I.length===0)return this.Never(_);if(I.length===1)return this.Create(g.Type(I[0],_));let U=g.Rest(I);return this.Create({..._,[e.Kind]:"Union",anyOf:U})})()}Unknown(f={}){return this.Create({...f,[e.Kind]:"Unknown"})}Unsafe(f={}){return this.Create({...f,[e.Kind]:f[e.Kind]||"Unsafe"})}Uppercase(f,_={}){return{...E.Map(g.Type(f),"Uppercase"),..._}}};e.JsonTypeBuilder=J;var fe=class extends J{AsyncIterator(f,_={}){return this.Create({..._,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:g.Type(f)})}Awaited(f,_={}){let I=U=>U.length>0?(()=>{let[N,...S]=U;return[this.Awaited(N),...I(S)]})():U;return o.TIntersect(f)?e.Type.Intersect(I(f.allOf)):o.TUnion(f)?e.Type.Union(I(f.anyOf)):o.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,_,I){let[U,N]=[g.Rest(f),g.Type(_)];return this.Create({...I,[e.Kind]:"Constructor",type:"Constructor",parameters:U,returns:N})}Date(f={}){return this.Create({...f,[e.Kind]:"Date",type:"Date"})}Function(f,_,I){let[U,N]=[g.Rest(f),g.Type(_)];return this.Create({...I,[e.Kind]:"Function",type:"Function",parameters:U,returns:N})}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 I=i.IsString(f)?f:f.source;return this.Create({..._,[e.Kind]:"String",type:"string",pattern:I})}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=fe,e.JsonType=new J,e.Type=new fe}}),Zn=vt(zt(),1),{String:mp,Optional:vp,Boolean:bp,Object:_p,Number:Tp}=Zn.Type,wp=mp.bind(Zn.Type),Op=Tp.bind(Zn.Type),gA=_p.bind(Zn.Type),mA=vp.bind(Zn.Type),Ap=bp.bind(Zn.Type),vA=wp(),bA=Op(),_A=Ap();function au(e){return Array.isArray(e)?e:[e]}var Ip=xe({"../../../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",s=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),o=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=n,e.isWebWorker=i,e.isNode=r,e.isJsDom=s,e.isDeno=o}}),Ep=xe({"../../../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,s=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),o=[];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(o.indexOf(l)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=o.push(l)-1,C=Object.keys(l).sort(s&&s(l));for(d="",c=0;c<C.length;c++){var E=C[c],D=a(l[E]);D&&(d&&(d+=","),d+=JSON.stringify(E)+":"+D)}return o.splice(g,1),"{"+d+"}"}}(n)}}}),Sp=xe({"../../../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 s(j){return j.length<5e3&&!i.test(j)?`"${j}"`:JSON.stringify(j)}function o(j,q){if(j.length>200||q)return j.sort(q);for(let z=1;z<j.length;z++){let k=j[z],te=z;for(;te!==0&&j[te-1]>k;)j[te]=j[te-1],te--;j[te]=k}return j}var a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(j){return a.call(j)!==void 0&&j.length!==0}function c(j,q,z){j.length<z&&(z=j.length);let k=q===","?"":" ",te=`"0":${k}${j[0]}`;for(let W=1;W<z;W++)te+=`${q}"${W}":${k}${j[W]}`;return te}function d(j){if(n.call(j,"circularValue")){let q=j.circularValue;if(typeof q=="string")return`"${q}"`;if(q==null)return q;if(q===Error||q===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(j){let q;if(n.call(j,"deterministic")&&(q=j.deterministic,typeof q!="boolean"&&typeof q!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return q===void 0?!0:q}function C(j,q){let z;if(n.call(j,q)&&(z=j[q],typeof z!="boolean"))throw new TypeError(`The "${q}" argument must be of type boolean`);return z===void 0?!0:z}function E(j,q){let z;if(n.call(j,q)){if(z=j[q],typeof z!="number")throw new TypeError(`The "${q}" argument must be of type number`);if(!Number.isInteger(z))throw new TypeError(`The "${q}" argument must be an integer`);if(z<1)throw new RangeError(`The "${q}" argument must be >= 1`)}return z===void 0?1/0:z}function D(j){return j===1?"1 item":`${j} items`}function V(j){let q=new Set;for(let z of j)(typeof z=="string"||typeof z=="number")&&q.add(String(z));return q}function Y(j){if(n.call(j,"strict")){let q=j.strict;if(typeof q!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(q)return z=>{let k=`Object can not safely be stringified. Received type ${typeof z}`;throw typeof z!="function"&&(k+=` (${z.toString()})`),new Error(k)}}}function F(j){j={...j};let q=Y(j);q&&(j.bigint===void 0&&(j.bigint=!1),"circularValue"in j||(j.circularValue=Error));let z=d(j),k=C(j,"bigint"),te=g(j),W=typeof te=="function"?te:void 0,le=E(j,"maximumDepth"),x=E(j,"maximumBreadth");function M(se,L,G,J,fe,f){let _=L[se];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(se)),_=J.call(L,se,_),typeof _){case"string":return s(_);case"object":{if(_===null)return"null";if(G.indexOf(_)!==-1)return z;let I="",U=",",N=f;if(Array.isArray(_)){if(_.length===0)return"[]";if(le<G.length+1)return'"[Array]"';G.push(_),fe!==""&&(f+=fe,I+=`
|
|
30
|
+
Use 'override' annotation for methods overridden by subclass.`)}}var Ch=tc(0),xh=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Zo=0,ec=function(){};function Uh(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Uh(ec,Array.prototype);var bs=function(e){function t(r,i,o,s){var a;return o===void 0&&(o="ObservableArray@"+At()),s===void 0&&(s=!1),a=e.call(this)||this,Fn(function(){var l=new vs(o,i,s,!0);l.proxy_=a,yu(a,ve,l),r&&r.length&&a.spliceWithArray(0,0,r),xh&&Object.defineProperty(a,"0",Ch)}),a}vu(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 vr(a)?a.slice():a}))},n[Symbol.iterator]=function(){var r=this,i=0;return Ts({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},yr(t,[{key:"length",get:function(){return this[ve].getArrayLength_()},set:function(i){this[ve].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(ec);Object.entries(ki).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&zi(bs.prototype,t,n)});function tc(e){return{enumerable:!1,configurable:!0,get:function(){return this[ve].get_(e)},set:function(n){this[ve].set_(e,n)}}}function Mh(e){zt(bs.prototype,""+e,tc(e))}function nc(e){if(e>Zo){for(var t=Zo;t<e+100;t++)Mh(t);Zo=e}}nc(1e3);function Bh(e,t,n){return new bs(e,t,n)}function Tt(e,t){if(typeof e=="object"&&e!==null){if(vr(e))return t!==void 0&&ce(23),e[ve].atom_;if(Ct(e))return e.atom_;if(Gt(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||ce(25,t,Fi(e)),n}if(Ln(e)){if(!t)return ce(26);var r=e[ve].values_.get(t);return r||ce(27,t,Fi(e)),r}if(ps(e)||Hr(e)||Li(e))return e}else if(je(e)&&Li(e[ve]))return e[ve];ce(28)}function _s(e,t){if(e||ce(29),t!==void 0)return _s(Tt(e,t));if(ps(e)||Hr(e)||Li(e)||Gt(e)||Ct(e))return e;if(e[ve])return e[ve];ce(24,e)}function Fi(e,t){var n;if(t!==void 0)n=Tt(e,t);else{if(hn(e))return e.name;Ln(e)||Gt(e)||Ct(e)?n=_s(e):n=Tt(e)}return n.name_}function Fn(e){var t=kn(),n=Ji(!0);mt();try{return e()}finally{vt(),Xi(n),en(t)}}var cu=zr.toString;function ws(e,t,n){return n===void 0&&(n=-1),ls(e,t,n)}function ls(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=cu.call(e);if(s!==cu.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=lu(e),t=lu(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(!ls(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(!(bt(t,S)&&ls(e[S],t[S],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function lu(e){return vr(e)?e.slice():hr(e)||Gt(e)||Qt(e)||Ct(e)?Array.from(e.entries()):e}var fu,Dh=((fu=Vi().Iterator)==null?void 0:fu.prototype)||{};function Ts(e){return e[Symbol.iterator]=Lh,Object.assign(Object.create(Dh),e)}function Lh(){return this}function rc(e){return e instanceof Object&&typeof e.annotationType_=="string"&&je(e.make_)&&je(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Vi();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:ih,extras:{getDebugName:Fi},$mobx:ve});var kh=Object.create,As=Object.defineProperty,jh=Object.getOwnPropertyDescriptor,ic=Object.getOwnPropertyNames,Fh=Object.getPrototypeOf,Vh=Object.prototype.hasOwnProperty,Le=(e,t)=>function(){return t||(0,e[ic(e)[0]])((t={exports:{}}).exports,t),t.exports},Os=(e,t)=>{for(var n in t)As(e,n,{get:t[n],enumerable:!0})},Kh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ic(t))!Vh.call(e,i)&&i!==n&&As(e,i,{get:()=>t[i],enumerable:!(r=jh(t,i))||r.enumerable});return e},Et=(e,t,n)=>(n=e!=null?kh(Fh(e)):{},Kh(t||!e||!e.__esModule?As(n,"default",{value:e,enumerable:!0}):n,e));var rn=Le({"../../../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 N(w){return _.has(w)}f.Has=N;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 N(w){return _.has(w)}f.Has=N;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 N(b){return b===null}f.IsNull=N;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 ht=m.charCodeAt(Re);if(ht>=7&&ht<=13||ht===27||ht===127)return!1}return!0}function U(m){return y(m)||ze(m)}function P(m){return i.IsUndefined(m)||i.IsBigInt(m)}function N(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)||ze(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)&&ze(m.items)&&N(m.minItems)&&N(m.maxItems)&&y(m.uniqueItems)&&A(m.contains)&&N(m.minContains)&&N(m.maxContains)}f.TArray=v;function $(m){return _e(m,"AsyncIterator")&&m.type==="AsyncIterator"&&T(m.$id)&&ze(m.items)}f.TAsyncIterator=$;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=>ze(Re))&&ze(m.returns)}f.TConstructor=ne;function ge(m){return _e(m,"Date")&&m.type==="Date"&&T(m.$id)&&N(m.exclusiveMaximumTimestamp)&&N(m.exclusiveMinimumTimestamp)&&N(m.maximumTimestamp)&&N(m.minimumTimestamp)&&N(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=>ze(Re))&&ze(m.returns)}f.TFunction=be;function Ue(m){return _e(m,"Integer")&&m.type==="integer"&&T(m.$id)&&N(m.exclusiveMaximum)&&N(m.exclusiveMinimum)&&N(m.maximum)&&N(m.minimum)&&N(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=>ze(Re)&&!Lr(Re))&&T(m.type)&&(y(m.unevaluatedProperties)||A(m.unevaluatedProperties))&&T(m.$id)}f.TIntersect=Fe;function $n(m){return _e(m,"Iterator")&&m.type==="Iterator"&&T(m.$id)&&ze(m.items)}f.TIterator=$n;function _e(m,Re){return fn(m)&&m[e.Kind]===Re}f.TKindOf=_e;function fn(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}f.TKind=fn;function Rn(m){return R(m)&&i.IsString(m.const)}f.TLiteralString=Rn;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")&&ze(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)&&N(m.exclusiveMaximum)&&N(m.exclusiveMinimum)&&N(m.maximum)&&N(m.minimum)&&N(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)&&N(m.minProperties)&&N(m.maxProperties)&&Object.entries(m.properties).every(([Re,ht])=>E(Re)&&ze(ht))}f.TObject=ke;function tt(m){return _e(m,"Promise")&&m.type==="Promise"&&T(m.$id)&&ze(m.item)}f.TPromise=tt;function Qe(m){return _e(m,"Record")&&m.type==="object"&&T(m.$id)&&U(m.additionalProperties)&&i.IsObject(m.patternProperties)&&(Re=>{let ht=Object.getOwnPropertyNames(Re.patternProperties);return ht.length===1&&_(ht[0])&&i.IsObject(Re.patternProperties)&&ze(Re.patternProperties[ht[0]])})(m)}f.TRecord=Qe;function rt(m){return i.IsObject(m)&&e.Hint in m&&m[e.Hint]==="Recursive"}f.TRecursive=rt;function Yt(m){return _e(m,"Ref")&&T(m.$id)&&i.IsString(m.$ref)}f.TRef=Yt;function sr(m){return _e(m,"String")&&m.type==="string"&&T(m.$id)&&N(m.minLength)&&N(m.maxLength)&&w(m.pattern)&&u(m.format)}f.TString=sr;function ar(m){return _e(m,"Symbol")&&m.type==="symbol"&&T(m.$id)}f.TSymbol=ar;function Pn(m){return _e(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}f.TTemplateLiteral=Pn;function Ai(m){return _e(m,"This")&&T(m.$id)&&i.IsString(m.$ref)}f.TThis=Ai;function Lr(m){return i.IsObject(m)&&e.Transform in m}f.TTransform=Lr;function Ke(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=>ze(Re)))}f.TTuple=Ke;function Oi(m){return _e(m,"Undefined")&&m.type==="undefined"&&T(m.$id)}f.TUndefined=Oi;function Ho(m){return Cn(m)&&m.anyOf.every(Re=>Rn(Re)||O(Re))}f.TUnionLiteral=Ho;function Cn(m){return _e(m,"Union")&&T(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every(Re=>ze(Re))}f.TUnion=Cn;function ur(m){return _e(m,"Uint8Array")&&m.type==="Uint8Array"&&T(m.$id)&&N(m.minByteLength)&&N(m.maxByteLength)}f.TUint8Array=ur;function nt(m){return _e(m,"Unknown")&&T(m.$id)}f.TUnknown=nt;function Ei(m){return _e(m,"Unsafe")}f.TUnsafe=Ei;function kr(m){return _e(m,"Void")&&m.type==="void"&&T(m.$id)}f.TVoid=kr;function Jo(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}f.TReadonly=Jo;function Xo(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}f.TOptional=Xo;function ze(m){return i.IsObject(m)&&(b(m)||v(m)||te(m)||q(m)||$(m)||ne(m)||ge(m)||be(m)||Ue(m)||Fe(m)||$n(m)||R(m)||me(m)||re(m)||de(m)||Se(m)||ke(m)||tt(m)||Qe(m)||Yt(m)||sr(m)||ar(m)||Pn(m)||Ai(m)||Ke(m)||Oi(m)||Cn(m)||ur(m)||nt(m)||Ei(m)||kr(m)||fn(m)&&t.Has(m[e.Kind]))}f.TSchema=ze})(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)?Yo(p,h):s.TUnknown(h)?Wa(p,h):s.TAny(h)?N(p,h):E("StructuralRight")}function N(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)&&Pn(h)?c.True:U(h)?P(p,h):s.TArray(h)?_($e(p.items,h.items)):c.False}function u(p,h){return U(h)?P(p,h):s.TAsyncIterator(h)?_($e(p.items,h.items)):c.False}function A(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TRecord(h)?nt(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)?Ke(p,h):s.TRecord(h)?nt(p,h):s.TBoolean(h)?c.True:c.False}function $(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TConstructor(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((Ae,Pt)=>_($e(h.parameters[Pt],Ae))===c.True)?_($e(p.returns,h.returns)):c.False:c.False}function q(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TRecord(h)?nt(p,h):s.TDate(h)?c.True:c.False}function te(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TFunction(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((Ae,Pt)=>_($e(h.parameters[Pt],Ae))===c.True)?_($e(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)?Ke(p,h):s.TRecord(h)?nt(p,h):c.False}function be(p,h){return h.allOf.every(Ae=>$e(p,Ae)===c.True)?c.True:c.False}function Ue(p,h){return p.allOf.some(Ae=>$e(Ae,h)===c.True)?c.True:c.False}function Fe(p,h){return U(h)?P(p,h):s.TIterator(h)?_($e(p.items,h.items)):c.False}function $n(p,h){return s.TLiteral(h)&&h.const===p.const?c.True:U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TRecord(h)?nt(p,h):s.TString(h)?kr(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 fn(p,h){return c.True}function Rn(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)?$e(Rn(p),h):s.TNot(h)?$e(p,Rn(h)):E("Invalid fallthrough for Not")}function le(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TRecord(h)?nt(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)?Ke(p,h):s.TRecord(h)?nt(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 Pn(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 tt(p){return re(p,0)}function Qe(p){return re(p,0)}function rt(p){return re(p,0)}function Yt(p){return Pn(p)}function sr(p){let h=e.Type.Number();return re(p,0)||re(p,1)&&"length"in p.properties&&_($e(p.properties.length,h))===c.True}function ar(p){return re(p,0)}function Pn(p){let h=e.Type.Number();return re(p,0)||re(p,1)&&"length"in p.properties&&_($e(p.properties.length,h))===c.True}function Ai(p){let h=e.Type.Function([e.Type.Any()],e.Type.Any());return re(p,0)||re(p,1)&&"then"in p.properties&&_($e(p.properties.then,h))===c.True}function Lr(p,h){return $e(p,h)===c.False||s.TOptional(p)&&!s.TOptional(h)?c.False:c.True}function Ke(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)&&tt(h)||s.TSymbol(p)&&Se(h)||s.TBigInt(p)&&Qe(h)||s.TString(p)&&de(h)||s.TSymbol(p)&&Se(h)||s.TNumber(p)&&ke(h)||s.TInteger(p)&&ke(h)||s.TBoolean(p)&&tt(h)||s.TUint8Array(p)&&Yt(h)||s.TDate(p)&&rt(h)||s.TConstructor(p)&&ar(h)||s.TFunction(p)&&sr(h)?c.True:s.TRecord(p)&&s.TString(Cn(p))?h[e.Hint]==="Record"?c.True:c.False:s.TRecord(p)&&s.TNumber(Cn(p))?re(h,0)?c.True:c.False:c.False}function Oi(p,h){return U(h)?P(p,h):s.TRecord(h)?nt(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(Lr(p.properties[Ae],h.properties[Ae])===c.False)return c.False}return c.True})():c.False}function Ho(p,h){return U(h)?P(p,h):s.TObject(h)&&Ai(h)?c.True:s.TPromise(h)?_($e(p.item,h.item)):c.False}function Cn(p){return e.PatternNumberExact in p.patternProperties?e.Type.Number():e.PatternStringExact in p.patternProperties?e.Type.String():E("Unknown record key pattern")}function ur(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 nt(p,h){let[Ae,Pt]=[Cn(h),ur(h)];return s.TLiteralString(p)&&s.TNumber(Ae)&&_($e(p,Pt))===c.True?c.True:s.TUint8Array(p)&&s.TNumber(Ae)||s.TString(p)&&s.TNumber(Ae)||s.TArray(p)&&s.TNumber(Ae)?$e(p,Pt):s.TObject(p)?(()=>{for(let kd of Object.getOwnPropertyNames(p.properties))if(Lr(Pt,p.properties[kd])===c.False)return c.False;return c.True})():c.False}function Ei(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TRecord(h)?$e(ur(p),ur(h)):c.False}function kr(p,h){return s.TLiteral(p)&&i.IsString(p.const)||s.TString(p)?c.True:c.False}function Jo(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TRecord(h)?nt(p,h):s.TString(h)?c.True:c.False}function Xo(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TRecord(h)?nt(p,h):s.TSymbol(h)?c.True:c.False}function ze(p,h){return s.TTemplateLiteral(p)?$e(j.Resolve(p),h):s.TTemplateLiteral(h)?$e(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=>$e(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 ht(p,h){return U(h)?P(p,h):s.TObject(h)&&Pn(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,Pt)=>$e(Ae,h.items[Pt])===c.True)?c.True:c.False:c.False}function Cd(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TRecord(h)?nt(p,h):s.TUint8Array(h)?c.True:c.False}function xd(p,h){return U(h)?P(p,h):s.TObject(h)?Ke(p,h):s.TRecord(h)?nt(p,h):s.TVoid(h)?Bd(p,h):s.TUndefined(h)?c.True:c.False}function Yo(p,h){return h.anyOf.some(Ae=>$e(p,Ae)===c.True)?c.True:c.False}function Ud(p,h){return p.anyOf.every(Ae=>$e(Ae,h)===c.True)?c.True:c.False}function Wa(p,h){return c.True}function Md(p,h){return s.TNever(h)?_e(p,h):s.TIntersect(h)?be(p,h):s.TUnion(h)?Yo(p,h):s.TAny(h)?N(p,h):s.TString(h)?kr(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)?Ke(p,h):s.TUnknown(h)?c.True:c.False}function Bd(p,h){return s.TUndefined(p)||s.TUndefined(p)?c.True:c.False}function Dd(p,h){return s.TIntersect(h)?be(p,h):s.TUnion(h)?Yo(p,h):s.TUnknown(h)?Wa(p,h):s.TAny(h)?N(p,h):s.TObject(h)?Ke(p,h):s.TVoid(h)?c.True:c.False}function $e(p,h){return s.TTemplateLiteral(p)||s.TTemplateLiteral(h)?ze(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)?$(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)?$n(p,h):s.TNever(p)?fn(p,h):s.TNull(p)?le(p,h):s.TNumber(p)?me(p,h):s.TObject(p)?Oi(p,h):s.TRecord(p)?Ei(p,h):s.TString(p)?Jo(p,h):s.TSymbol(p)?Xo(p,h):s.TTuple(p)?ht(p,h):s.TPromise(p)?Ho(p,h):s.TUint8Array(p)?Cd(p,h):s.TUndefined(p)?xd(p,h):s.TUnion(p)?Ud(p,h):s.TUnknown(p)?Md(p,h):s.TVoid(p)?Dd(p,h):E(`Unknown left type operand '${p[e.Kind]}'`)}function Ld(p,h){return $e(p,h)}f.Extends=Ld})(d||(e.TypeExtends=d={}));var g;(function(f){function _(w){return w.map(u=>N(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]:N(w[v])}),{}),A=Object.getOwnPropertySymbols(w).reduce((b,v)=>({...b,[v]:N(w[v])}),{});return{...u,...A}}function N(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{...N(w),...u}}f.Type=T})(g||(e.TypeClone=g={}));var C;(function(f){function _($){return $.map(q=>{let{[e.Optional]:te,...ne}=g.Type(q);return ne})}function E($){return $.every(q=>s.TOptional(q))}function U($){return $.some(q=>s.TOptional(q))}function P($){return E($.allOf)?e.Type.Optional(e.Type.Intersect(_($.allOf))):$}function N($){return U($.anyOf)?e.Type.Optional(e.Type.Union(_($.anyOf))):$}function y($){return $[e.Kind]==="Intersect"?P($):$[e.Kind]==="Union"?N($):$}function T($,q){let te=$.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($,q){let te=$.anyOf.map(ne=>b(ne,q));return y(e.Type.Union(te))}function u($,q){let te=$.properties[q];return i.IsUndefined(te)?e.Type.Never():e.Type.Union([te])}function A($,q){let te=$.items;if(i.IsUndefined(te))return e.Type.Never();let ne=te[q];return i.IsUndefined(ne)?e.Type.Never():ne}function b($,q){return $[e.Kind]==="Intersect"?T($,q):$[e.Kind]==="Union"?w($,q):$[e.Kind]==="Object"?u($,q):$[e.Kind]==="Tuple"?A($,q):e.Type.Never()}function v($,q,te={}){let ne=q.map(ge=>b($,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 N(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,...$]=A;return[u(v,b),...T($,b)]}function w(A,b){return s.TTemplateLiteral(A)?N(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 N(y,T,w){return{...P(g.Type(y),T),...w}}f.Map=N})(S||(e.ObjectMap=S={}));var V;(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,$)=>$.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 N(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)?N(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})(V||(e.KeyResolver=V={}));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 z=class extends n{};e.TemplateLiteralPatternError=z;var W;(function(f){function _(N){throw new z(N)}function E(N){return N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U(N,y){return s.TTemplateLiteral(N)?N.pattern.slice(1,N.pattern.length-1):s.TUnion(N)?`(${N.anyOf.map(T=>U(T,y)).join("|")})`:s.TNumber(N)?`${y}${e.PatternNumber}`:s.TInteger(N)?`${y}${e.PatternNumber}`:s.TBigInt(N)?`${y}${e.PatternNumber}`:s.TString(N)?`${y}${e.PatternString}`:s.TLiteral(N)?`${y}${E(N.const.toString())}`:s.TBoolean(N)?`${y}${e.PatternBoolean}`:_(`Unexpected Kind '${N[e.Kind]}'`)}function P(N){return`^${N.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(N=>e.Type.Literal(N));return e.Type.Union(P)}f.Resolve=_})(j||(e.TemplateLiteralResolver=j={}));var Z=class extends n{};e.TemplateLiteralParserError=Z;var G;(function(f){function _($,q,te){return $[q]===te&&$.charCodeAt(q-1)!==92}function E($,q){return _($,q,"(")}function U($,q){return _($,q,")")}function P($,q){return _($,q,"|")}function N($){if(!(E($,0)&&U($,$.length-1)))return!1;let q=0;for(let te=0;te<$.length;te++)if(E($,te)&&(q+=1),U($,te)&&(q-=1),q===0&&te!==$.length-1)return!1;return!0}function y($){return $.slice(1,$.length-1)}function T($){let q=0;for(let te=0;te<$.length;te++)if(E($,te)&&(q+=1),U($,te)&&(q-=1),P($,te)&&q===0)return!0;return!1}function w($){for(let q=0;q<$.length;q++)if(E($,q))return!0;return!1}function u($){let[q,te]=[0,0],ne=[];for(let be=0;be<$.length;be++)if(E($,be)&&(q+=1),U($,be)&&(q-=1),P($,be)&&q===0){let Ue=$.slice(te,be);Ue.length>0&&ne.push(b(Ue)),te=be+1}let ge=$.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($){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<$.length;ge++)if(E($,ge)){let[be,Ue]=q($,ge),Fe=$.slice(be,Ue+1);ne.push(b(Fe)),ge=Ue}else{let[be,Ue]=te($,ge),Fe=$.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($){return N($)?b(y($)):T($)?u($):w($)?A($):{type:"const",const:$}}f.Parse=b;function v($){return b($.slice(1,$.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 N(y){return U(y)?!0:E(y)||P(y)?!1:y.type==="and"?y.expr.every(T=>N(T)):y.type==="or"?y.expr.every(T=>N(T)):y.type==="const"?!0:_("Unknown expression type")}f.Check=N})(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=>[...N(T)]))}function*U(y){for(let T of y.expr)yield*N(T)}function*P(y){return yield y.const}function*N(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=N})(L||(e.TemplateLiteralGenerator=L={}));var ee;(function(f){function*_(N){let y=N.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(N){if(N[1]!=="{"){let y=e.Type.Literal("$"),T=U(N.slice(1));return yield*[y,...T]}for(let y=2;y<N.length;y++)if(N[y]==="}"){let T=_(N.slice(2,y)),w=U(N.slice(y+1));return yield*[...T,...w]}yield e.Type.Literal(N)}function*U(N){for(let y=0;y<N.length;y++)if(N[y]==="$"){let T=e.Type.Literal(N.slice(0,y)),w=E(N.slice(y));return yield*[T,...w]}yield e.Type.Literal(N)}function P(N){return[...U(N)]}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:N=>_[e.Transform].Encode(f(N)),Decode:N=>this.decode(_[e.Transform].Decode(N))};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,...N}=E;return N},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=V.ResolveKeys(E,{includePatterns:!1}).reduce((N,y)=>({...N,[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(N=>isNaN(N)).map(N=>f[N]),P=[...new Set(E)].map(N=>e.Type.Literal(N));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(N=>g.Type(N));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(N=>s.TTransform(N))&&this.Throw("Cannot intersect transform types");let E=f.every(N=>s.TObject(N)),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,N)=>e.Type.Literal(N.toString()));return this.Union(U,_)})():s.TArray(f)?this.Number(_):(()=>{let E=V.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)),N=s.TSchema(_.additionalProperties)?{additionalProperties:g.Type(_.additionalProperties)}:{},y=E.reduce((T,w)=>({...T,[w]:g.Type(f[w])}),{});return P.length>0?this.Create({..._,...N,[e.Kind]:"Object",type:"object",properties:y,required:P}):this.Create({..._,...N,[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(N=>!U.includes(N)),P.required.length===0&&delete P.required);for(let N of Object.getOwnPropertyNames(P.properties))U.includes(N)&&delete P.properties[N];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,N)=>({...P,[N]:this.Optional(E.properties[N])}),{});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(N=>U.includes(N)),P.required.length===0&&delete P.required);for(let N of Object.getOwnPropertyNames(P.properties))U.includes(N)||delete P.properties[N];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,N)=>({...P,[N]: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((N,y)=>({...N,[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,N)=>({...P,[N]:this.Discard(E.properties[N],[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],N=g.Rest(f),y=f.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:N,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,...N]=U;return[this.Awaited(P),...E(N)]})():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}}),_r=Et(rn(),1),{String:zh,Optional:qh,Boolean:Gh,Object:Wh,Number:Hh}=_r.Type,Jh=zh.bind(_r.Type),Xh=Hh.bind(_r.Type),kI=Wh.bind(_r.Type),jI=qh.bind(_r.Type),Yh=Gh.bind(_r.Type),FI=Jh(),VI=Xh(),KI=Yh();function oc(e){return Array.isArray(e)?e:[e]}var Qh=Le({"../../../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}}),Zh=Le({"../../../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)}}}),ey=Le({"../../../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,z){if(k.length>200||z)return k.sort(z);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,z,W){k.length<W&&(W=k.length);let j=z===","?"":" ",Z=`"0":${j}${k[0]}`;for(let G=1;G<W;G++)Z+=`${z}"${G}":${j}${k[G]}`;return Z}function d(k){if(n.call(k,"circularValue")){let z=k.circularValue;if(typeof z=="string")return`"${z}"`;if(z==null)return z;if(z===Error||z===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 z;if(n.call(k,"deterministic")&&(z=k.deterministic,typeof z!="boolean"&&typeof z!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return z===void 0?!0:z}function C(k,z){let W;if(n.call(k,z)&&(W=k[z],typeof W!="boolean"))throw new TypeError(`The "${z}" argument must be of type boolean`);return W===void 0?!0:W}function I(k,z){let W;if(n.call(k,z)){if(W=k[z],typeof W!="number")throw new TypeError(`The "${z}" argument must be of type number`);if(!Number.isInteger(W))throw new TypeError(`The "${z}" argument must be an integer`);if(W<1)throw new RangeError(`The "${z}" argument must be >= 1`)}return W===void 0?1/0:W}function S(k){return k===1?"1 item":`${k} items`}function V(k){let z=new Set;for(let W of k)(typeof W=="string"||typeof W=="number")&&z.add(String(W));return z}function J(k){if(n.call(k,"strict")){let z=k.strict;if(typeof z!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(z)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 z=J(k);z&&(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
|
-
${f}`);let
|
|
33
|
-
${
|
|
34
|
-
${f}`,
|
|
35
|
-
${f}${
|
|
36
|
-
${
|
|
32
|
+
${f}`);let A=Math.min(_.length,x),b=0;for(;b<A-1;b++){let $=M(String(b),_,H,Y,he,f);E+=$!==void 0?$:"null",E+=U}let v=M(String(b),_,H,Y,he,f);if(E+=v!==void 0?v:"null",_.length-1>x){let $=_.length-x-1;E+=`${U}"... ${S($)} not stringified"`}return he!==""&&(E+=`
|
|
33
|
+
${P}`),H.pop(),`[${E}]`}let N=Object.keys(_),y=N.length;if(y===0)return"{}";if(fe<H.length+1)return'"[Object]"';let T="",w="";he!==""&&(f+=he,U=`,
|
|
34
|
+
${f}`,T=" ");let u=Math.min(y,x);Z&&!l(_)&&(N=s(N,G)),H.push(_);for(let A=0;A<u;A++){let b=N[A],v=M(b,_,H,Y,he,f);v!==void 0&&(E+=`${w}${o(b)}:${T}${v}`,w=U)}if(y>x){let A=y-x;E+=`${w}"...":${T}"${S(A)} not stringified"`,w=U}return he!==""&&w.length>1&&(E=`
|
|
35
|
+
${f}${E}
|
|
36
|
+
${P}`),H.pop(),`{${E}}`}case"number":return isFinite(_)?String(_):z?z(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(_);default:return z?z(_):void 0}}function L(ae,D,H,Y,he,f){switch(typeof D=="object"&&D!==null&&typeof D.toJSON=="function"&&(D=D.toJSON(ae)),typeof D){case"string":return o(D);case"object":{if(D===null)return"null";if(H.indexOf(D)!==-1)return W;let _=f,E="",U=",";if(Array.isArray(D)){if(D.length===0)return"[]";if(fe<H.length+1)return'"[Array]"';H.push(D),he!==""&&(f+=he,E+=`
|
|
37
37
|
${f}`,U=`,
|
|
38
|
-
${f}`);let
|
|
39
|
-
${_}`),
|
|
40
|
-
${f}`,
|
|
41
|
-
${f}${
|
|
42
|
-
${_}`),
|
|
43
|
-
${
|
|
44
|
-
${
|
|
45
|
-
${f}`,
|
|
46
|
-
${
|
|
47
|
-
${
|
|
48
|
-
${f}`),G.pop(),`{${N}}`}case"number":return isFinite(L)?String(L):q?q(L):"null";case"boolean":return L===!0?"true":"false";case"undefined":return;case"bigint":if(k)return String(L);default:return q?q(L):void 0}}function ie(se,L,G){switch(typeof L){case"string":return s(L);case"object":{if(L===null)return"null";if(typeof L.toJSON=="function"){if(L=L.toJSON(se),typeof L!="object")return ie(se,L,G);if(L===null)return"null"}if(G.indexOf(L)!==-1)return z;let J="",fe=L.length!==void 0;if(fe&&Array.isArray(L)){if(L.length===0)return"[]";if(le<G.length+1)return'"[Array]"';G.push(L);let N=Math.min(L.length,x),S=0;for(;S<N-1;S++){let w=ie(String(S),L[S],G);J+=w!==void 0?w:"null",J+=","}let h=ie(String(S),L[S],G);if(J+=h!==void 0?h:"null",L.length-1>x){let w=L.length-x-1;J+=`,"... ${D(w)} not stringified"`}return G.pop(),`[${J}]`}let f=Object.keys(L),_=f.length;if(_===0)return"{}";if(le<G.length+1)return'"[Object]"';let I="",U=Math.min(_,x);fe&&l(L)&&(J+=c(L,",",x),f=f.slice(L.length),U-=L.length,I=","),te&&(f=o(f,W)),G.push(L);for(let N=0;N<U;N++){let S=f[N],h=ie(S,L[S],G);h!==void 0&&(J+=`${I}${s(S)}:${h}`,I=",")}if(_>x){let N=_-x;J+=`${I}"...":"${D(N)} not stringified"`}return G.pop(),`{${J}}`}case"number":return isFinite(L)?String(L):q?q(L):"null";case"boolean":return L===!0?"true":"false";case"undefined":return;case"bigint":if(k)return String(L);default:return q?q(L):void 0}}function X(se,L,G){if(arguments.length>1){let J="";if(typeof G=="number"?J=" ".repeat(Math.min(G,10)):typeof G=="string"&&(J=G.slice(0,10)),L!=null){if(typeof L=="function")return M("",{"":se},[],L,J,"");if(Array.isArray(L))return B("",se,[],V(L),J,"")}if(J.length!==0)return Q("",se,[],J,"")}return ie("",se,[])}return X}}}),rr=xe({"../../../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(k){return c(k)&&Symbol.asyncIterator in k}e.IsAsyncIterator=t;function n(k){return c(k)&&Symbol.iterator in k}e.IsIterator=n;function r(k){return ArrayBuffer.isView(k)}e.IsTypedArray=r;function i(k){return k instanceof Promise}e.IsPromise=i;function s(k){return k instanceof Uint8Array}e.IsUint8Array=s;function o(k){return k instanceof Date&&Number.isFinite(k.getTime())}e.IsDate=o;function a(k,te){return te in k}e.HasPropertyKey=a;function l(k){return c(k)&&j(k.constructor)&&k.constructor.name==="Object"}e.IsPlainObject=l;function c(k){return k!==null&&typeof k=="object"}e.IsObject=c;function d(k){return Array.isArray(k)&&!ArrayBuffer.isView(k)}e.IsArray=d;function g(k){return k===void 0}e.IsUndefined=g;function C(k){return k===null}e.IsNull=C;function E(k){return typeof k=="boolean"}e.IsBoolean=E;function D(k){return typeof k=="number"}e.IsNumber=D;function V(k){return D(k)&&Number.isInteger(k)}e.IsInteger=V;function Y(k){return typeof k=="bigint"}e.IsBigInt=Y;function F(k){return typeof k=="string"}e.IsString=F;function j(k){return typeof k=="function"}e.IsFunction=j;function q(k){return typeof k=="symbol"}e.IsSymbol=q;function z(k){return Y(k)||E(k)||C(k)||D(k)||F(k)||q(k)||g(k)}e.IsValueType=z}}),vc=xe({"../../../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=rr(),n=qi(),r=zt(),i=class extends r.TypeBoxError{constructor(d){super(`Duplicate type kind '${d}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var s=class extends r.TypeBoxError{constructor(d){super(`Duplicate string format '${d}' detected`)}};e.TypeSystemDuplicateFormat=s;var o;(function(d){function g(E,D){if(r.TypeRegistry.Has(E))throw new i(E);return r.TypeRegistry.Set(E,D),(V={})=>r.Type.Unsafe({...V,[r.Kind]:E})}d.Type=g;function C(E,D){if(r.FormatRegistry.Has(E))throw new s(E);return r.FormatRegistry.Set(E,D),E}d.Format=C})(o||(e.TypeSystem=o={}));var a;(function(d){let g=c;function C(){g=c}d.Reset=C;function E(V){g=V}d.Set=E;function D(){return g}d.Get=D})(a||(e.TypeSystemErrorFunction=a={}));var l;(function(d){d.ExactOptionalPropertyTypes=!1,d.AllowArrayObject=!1,d.AllowNaN=!1,d.AllowNullVoid=!1;function g(Y,F){return d.ExactOptionalPropertyTypes?F in Y:Y[F]!==void 0}d.IsExactOptionalProperty=g;function C(Y){let F=(0,t.IsObject)(Y);return d.AllowArrayObject?F:F&&!(0,t.IsArray)(Y)}d.IsObjectLike=C;function E(Y){return C(Y)&&!(Y instanceof Date)&&!(Y instanceof Uint8Array)}d.IsRecordLike=E;function D(Y){let F=(0,t.IsNumber)(Y);return d.AllowNaN?F:F&&Number.isFinite(Y)}d.IsNumberLike=D;function V(Y){let F=(0,t.IsUndefined)(Y);return d.AllowNullVoid?F||Y===null:F}d.IsVoidLike=V})(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}}),Gi=xe({"../../../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=zt(),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,s){let o=s.findIndex(a=>a.$id===i.$ref);if(o===-1)throw new n(i);return s[o]}e.Deref=r}}),cs=xe({"../../../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=rr(),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"),[s,o]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],a=Array.from({length:256}).map((M,B)=>BigInt(B)),l=new Float64Array(1),c=new DataView(l.buffer),d=new Uint8Array(l.buffer);function*g(M){let B=M===0?1:Math.ceil(Math.floor(Math.log2(M)+1)/8);for(let Q=0;Q<B;Q++)yield M>>8*(B-1-Q)&255}function C(M){le(r.Array);for(let B of M)W(B)}function E(M){le(r.Boolean),le(M?1:0)}function D(M){le(r.BigInt),c.setBigInt64(0,M);for(let B of d)le(B)}function V(M){le(r.Date),W(M.getTime())}function Y(M){le(r.Null)}function F(M){le(r.Number),c.setFloat64(0,M);for(let B of d)le(B)}function j(M){le(r.Object);for(let B of globalThis.Object.keys(M).sort())W(B),W(M[B])}function q(M){le(r.String);for(let B=0;B<M.length;B++)for(let Q of g(M.charCodeAt(B)))le(Q)}function z(M){le(r.Symbol),W(M.description)}function k(M){le(r.Uint8Array);for(let B=0;B<M.length;B++)le(M[B])}function te(M){return le(r.Undefined)}function W(M){if((0,t.IsArray)(M))return C(M);if((0,t.IsBoolean)(M))return E(M);if((0,t.IsBigInt)(M))return D(M);if((0,t.IsDate)(M))return V(M);if((0,t.IsNull)(M))return Y(M);if((0,t.IsNumber)(M))return F(M);if((0,t.IsPlainObject)(M))return j(M);if((0,t.IsString)(M))return q(M);if((0,t.IsSymbol)(M))return z(M);if((0,t.IsUint8Array)(M))return k(M);if((0,t.IsUndefined)(M))return te(M);throw new n(M)}function le(M){i=i^a[M],i=i*s%o}function x(M){return i=BigInt("14695981039346656037"),W(M),i}e.Hash=x}}),qi=xe({"../../../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=rr(),n=vc(),r=Gi(),i=cs(),s=zt(),o;(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"})(o||(e.ValueErrorType=o={}));var a=class extends s.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,O,b,v){return{type:u,schema:O,path:b,value:v,message:n.TypeSystemErrorFunction.Get()(O,u)}}function*C(u,O,b,v){}function*E(u,O,b,v){if(!(0,t.IsArray)(v))return yield g(o.Array,u,b,v);c(u.minItems)&&!(v.length>=u.minItems)&&(yield g(o.ArrayMinItems,u,b,v)),c(u.maxItems)&&!(v.length<=u.maxItems)&&(yield g(o.ArrayMaxItems,u,b,v));for(let ee=0;ee<v.length;ee++)yield*w(u.items,O,`${b}/${ee}`,v[ee]);if(u.uniqueItems===!0&&!function(){let ee=new Set;for(let ne of v){let pe=(0,i.Hash)(ne);if(ee.has(pe))return!1;ee.add(pe)}return!0}()&&(yield g(o.ArrayUniqueItems,u,b,v)),!(c(u.contains)||c(u.minContains)||c(u.maxContains)))return;let P=c(u.contains)?u.contains:s.Type.Never(),K=v.reduce((ee,ne,pe)=>w(P,O,`${b}${pe}`,ne).next().done===!0?ee+1:ee,0);K===0&&(yield g(o.ArrayContains,u,b,v)),(0,t.IsNumber)(u.minContains)&&K<u.minContains&&(yield g(o.ArrayMinContains,u,b,v)),(0,t.IsNumber)(u.maxContains)&&K>u.maxContains&&(yield g(o.ArrayMaxContains,u,b,v))}function*D(u,O,b,v){(0,t.IsAsyncIterator)(v)||(yield g(o.AsyncIterator,u,b,v))}function*V(u,O,b,v){if(!(0,t.IsBigInt)(v))return yield g(o.BigInt,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(o.BigIntExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(o.BigIntExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(o.BigIntMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(o.BigIntMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==BigInt(0)&&(yield g(o.BigIntMultipleOf,u,b,v))}function*Y(u,O,b,v){(0,t.IsBoolean)(v)||(yield g(o.Boolean,u,b,v))}function*F(u,O,b,v){yield*w(u.returns,O,b,v.prototype)}function*j(u,O,b,v){if(!(0,t.IsDate)(v))return yield g(o.Date,u,b,v);c(u.exclusiveMaximumTimestamp)&&!(v.getTime()<u.exclusiveMaximumTimestamp)&&(yield g(o.DateExclusiveMaximumTimestamp,u,b,v)),c(u.exclusiveMinimumTimestamp)&&!(v.getTime()>u.exclusiveMinimumTimestamp)&&(yield g(o.DateExclusiveMinimumTimestamp,u,b,v)),c(u.maximumTimestamp)&&!(v.getTime()<=u.maximumTimestamp)&&(yield g(o.DateMaximumTimestamp,u,b,v)),c(u.minimumTimestamp)&&!(v.getTime()>=u.minimumTimestamp)&&(yield g(o.DateMinimumTimestamp,u,b,v)),c(u.multipleOfTimestamp)&&v.getTime()%u.multipleOfTimestamp!==0&&(yield g(o.DateMultipleOfTimestamp,u,b,v))}function*q(u,O,b,v){(0,t.IsFunction)(v)||(yield g(o.Function,u,b,v))}function*z(u,O,b,v){if(!(0,t.IsInteger)(v))return yield g(o.Integer,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(o.IntegerExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(o.IntegerExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(o.IntegerMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(o.IntegerMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==0&&(yield g(o.IntegerMultipleOf,u,b,v))}function*k(u,O,b,v){for(let P of u.allOf){let K=w(P,O,b,v).next();K.done||(yield g(o.Intersect,u,b,v),yield K.value)}if(u.unevaluatedProperties===!1){let P=new RegExp(s.KeyResolver.ResolvePattern(u));for(let K of Object.getOwnPropertyNames(v))P.test(K)||(yield g(o.IntersectUnevaluatedProperties,u,`${b}/${K}`,v))}if(typeof u.unevaluatedProperties=="object"){let P=new RegExp(s.KeyResolver.ResolvePattern(u));for(let K of Object.getOwnPropertyNames(v))if(!P.test(K)){let ee=w(u.unevaluatedProperties,O,`${b}/${K}`,v[K]).next();ee.done||(yield ee.value)}}}function*te(u,O,b,v){(0,t.IsIterator)(v)||(yield g(o.Iterator,u,b,v))}function*W(u,O,b,v){v!==u.const&&(yield g(o.Literal,u,b,v))}function*le(u,O,b,v){yield g(o.Never,u,b,v)}function*x(u,O,b,v){w(u.not,O,b,v).next().done===!0&&(yield g(o.Not,u,b,v))}function*M(u,O,b,v){(0,t.IsNull)(v)||(yield g(o.Null,u,b,v))}function*B(u,O,b,v){if(!n.TypeSystemPolicy.IsNumberLike(v))return yield g(o.Number,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(o.NumberExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(o.NumberExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(o.NumberMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(o.NumberMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==0&&(yield g(o.NumberMultipleOf,u,b,v))}function*Q(u,O,b,v){if(!n.TypeSystemPolicy.IsObjectLike(v))return yield g(o.Object,u,b,v);c(u.minProperties)&&!(Object.getOwnPropertyNames(v).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,b,v)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,b,v));let P=Array.isArray(u.required)?u.required:[],K=Object.getOwnPropertyNames(u.properties),ee=Object.getOwnPropertyNames(v);for(let ne of P)ee.includes(ne)||(yield g(o.ObjectRequiredProperty,u.properties[ne],`${b}/${l(ne)}`,void 0));if(u.additionalProperties===!1)for(let ne of ee)K.includes(ne)||(yield g(o.ObjectAdditionalProperties,u,`${b}/${l(ne)}`,v[ne]));if(typeof u.additionalProperties=="object")for(let ne of ee)K.includes(ne)||(yield*w(u.additionalProperties,O,`${b}/${l(ne)}`,v[ne]));for(let ne of K){let pe=u.properties[ne];u.required&&u.required.includes(ne)?(yield*w(pe,O,`${b}/${l(ne)}`,v[ne]),s.ExtendsUndefined.Check(u)&&!(ne in v)&&(yield g(o.ObjectRequiredProperty,pe,`${b}/${l(ne)}`,void 0))):n.TypeSystemPolicy.IsExactOptionalProperty(v,ne)&&(yield*w(pe,O,`${b}/${l(ne)}`,v[ne]))}}function*ie(u,O,b,v){(0,t.IsPromise)(v)||(yield g(o.Promise,u,b,v))}function*X(u,O,b,v){if(!n.TypeSystemPolicy.IsRecordLike(v))return yield g(o.Object,u,b,v);c(u.minProperties)&&!(Object.getOwnPropertyNames(v).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,b,v)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,b,v));let[P,K]=Object.entries(u.patternProperties)[0],ee=new RegExp(P);for(let[ne,pe]of Object.entries(v))ee.test(ne)&&(yield*w(K,O,`${b}/${l(ne)}`,pe));if(typeof u.additionalProperties=="object")for(let[ne,pe]of Object.entries(v))ee.test(ne)||(yield*w(u.additionalProperties,O,`${b}/${l(ne)}`,pe));if(u.additionalProperties===!1){for(let[ne,pe]of Object.entries(v))if(!ee.test(ne))return yield g(o.ObjectAdditionalProperties,u,`${b}/${l(ne)}`,pe)}}function*se(u,O,b,v){yield*w((0,r.Deref)(u,O),O,b,v)}function*L(u,O,b,v){if(!(0,t.IsString)(v))return yield g(o.String,u,b,v);c(u.minLength)&&!(v.length>=u.minLength)&&(yield g(o.StringMinLength,u,b,v)),c(u.maxLength)&&!(v.length<=u.maxLength)&&(yield g(o.StringMaxLength,u,b,v)),(0,t.IsString)(u.pattern)&&(new RegExp(u.pattern).test(v)||(yield g(o.StringPattern,u,b,v))),(0,t.IsString)(u.format)&&(s.FormatRegistry.Has(u.format)?s.FormatRegistry.Get(u.format)(v)||(yield g(o.StringFormat,u,b,v)):yield g(o.StringFormatUnknown,u,b,v))}function*G(u,O,b,v){(0,t.IsSymbol)(v)||(yield g(o.Symbol,u,b,v))}function*J(u,O,b,v){if(!(0,t.IsString)(v))return yield g(o.String,u,b,v);new RegExp(u.pattern).test(v)||(yield g(o.StringPattern,u,b,v))}function*fe(u,O,b,v){yield*w((0,r.Deref)(u,O),O,b,v)}function*f(u,O,b,v){if(!(0,t.IsArray)(v))return yield g(o.Tuple,u,b,v);if(u.items===void 0&&v.length!==0)return yield g(o.TupleLength,u,b,v);if(v.length!==u.maxItems)return yield g(o.TupleLength,u,b,v);if(u.items)for(let P=0;P<u.items.length;P++)yield*w(u.items[P],O,`${b}/${P}`,v[P])}function*_(u,O,b,v){(0,t.IsUndefined)(v)||(yield g(o.Undefined,u,b,v))}function*I(u,O,b,v){let P=0;for(let K of u.anyOf){let ee=[...w(K,O,b,v)];if(ee.length===0)return;P+=ee.length}P>0&&(yield g(o.Union,u,b,v))}function*U(u,O,b,v){if(!(0,t.IsUint8Array)(v))return yield g(o.Uint8Array,u,b,v);c(u.maxByteLength)&&!(v.length<=u.maxByteLength)&&(yield g(o.Uint8ArrayMaxByteLength,u,b,v)),c(u.minByteLength)&&!(v.length>=u.minByteLength)&&(yield g(o.Uint8ArrayMinByteLength,u,b,v))}function*N(u,O,b,v){}function*S(u,O,b,v){n.TypeSystemPolicy.IsVoidLike(v)||(yield g(o.Void,u,b,v))}function*h(u,O,b,v){s.TypeRegistry.Get(u[s.Kind])(u,v)||(yield g(o.Kind,u,b,v))}function*w(u,O,b,v){let P=c(u.$id)?[...O,u]:O,K=u;switch(K[s.Kind]){case"Any":return yield*C(K,P,b,v);case"Array":return yield*E(K,P,b,v);case"AsyncIterator":return yield*D(K,P,b,v);case"BigInt":return yield*V(K,P,b,v);case"Boolean":return yield*Y(K,P,b,v);case"Constructor":return yield*F(K,P,b,v);case"Date":return yield*j(K,P,b,v);case"Function":return yield*q(K,P,b,v);case"Integer":return yield*z(K,P,b,v);case"Intersect":return yield*k(K,P,b,v);case"Iterator":return yield*te(K,P,b,v);case"Literal":return yield*W(K,P,b,v);case"Never":return yield*le(K,P,b,v);case"Not":return yield*x(K,P,b,v);case"Null":return yield*M(K,P,b,v);case"Number":return yield*B(K,P,b,v);case"Object":return yield*Q(K,P,b,v);case"Promise":return yield*ie(K,P,b,v);case"Record":return yield*X(K,P,b,v);case"Ref":return yield*se(K,P,b,v);case"String":return yield*L(K,P,b,v);case"Symbol":return yield*G(K,P,b,v);case"TemplateLiteral":return yield*J(K,P,b,v);case"This":return yield*fe(K,P,b,v);case"Tuple":return yield*f(K,P,b,v);case"Undefined":return yield*_(K,P,b,v);case"Union":return yield*I(K,P,b,v);case"Uint8Array":return yield*U(K,P,b,v);case"Unknown":return yield*N(K,P,b,v);case"Void":return yield*S(K,P,b,v);default:if(!s.TypeRegistry.Has(K[s.Kind]))throw new a(u);return yield*h(K,P,b,v)}}function T(...u){let O=u.length===3?w(u[0],u[1],"",u[2]):w(u[0],[],"",u[1]);return new d(O)}e.Errors=T}}),Pp=xe({"../../../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,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=e&&e.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(qi(),e)}}),bc=xe({"../../../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,s,o,a){a===void 0&&(a=o);var l=Object.getOwnPropertyDescriptor(s,o);(!l||("get"in l?!s.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,l)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),n=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var r=qi();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),n(vc(),e)}}),Rp=xe({"../../../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=rr(),n=bc(),r=Gi(),i=cs(),s=zt(),o=class extends s.TypeBoxError{constructor(h){super("Unknown type"),this.schema=h}};e.ValueCheckUnknownTypeError=o;function a(h){return h[s.Kind]==="Any"||h[s.Kind]==="Unknown"}function l(h){return h!==void 0}function c(h,w,T){return!0}function d(h,w,T){if(!(0,t.IsArray)(T)||l(h.minItems)&&!(T.length>=h.minItems)||l(h.maxItems)&&!(T.length<=h.maxItems)||!T.every(b=>N(h.items,w,b))||h.uniqueItems===!0&&!function(){let b=new Set;for(let v of T){let P=(0,i.Hash)(v);if(b.has(P))return!1;b.add(P)}return!0}())return!1;if(!(l(h.contains)||(0,t.IsNumber)(h.minContains)||(0,t.IsNumber)(h.maxContains)))return!0;let u=l(h.contains)?h.contains:s.Type.Never(),O=T.reduce((b,v)=>N(u,w,v)?b+1:b,0);return!(O===0||(0,t.IsNumber)(h.minContains)&&O<h.minContains||(0,t.IsNumber)(h.maxContains)&&O>h.maxContains)}function g(h,w,T){return(0,t.IsAsyncIterator)(T)}function C(h,w,T){return!(!(0,t.IsBigInt)(T)||l(h.exclusiveMaximum)&&!(T<h.exclusiveMaximum)||l(h.exclusiveMinimum)&&!(T>h.exclusiveMinimum)||l(h.maximum)&&!(T<=h.maximum)||l(h.minimum)&&!(T>=h.minimum)||l(h.multipleOf)&&T%h.multipleOf!==BigInt(0))}function E(h,w,T){return(0,t.IsBoolean)(T)}function D(h,w,T){return N(h.returns,w,T.prototype)}function V(h,w,T){return!(!(0,t.IsDate)(T)||l(h.exclusiveMaximumTimestamp)&&!(T.getTime()<h.exclusiveMaximumTimestamp)||l(h.exclusiveMinimumTimestamp)&&!(T.getTime()>h.exclusiveMinimumTimestamp)||l(h.maximumTimestamp)&&!(T.getTime()<=h.maximumTimestamp)||l(h.minimumTimestamp)&&!(T.getTime()>=h.minimumTimestamp)||l(h.multipleOfTimestamp)&&T.getTime()%h.multipleOfTimestamp!==0)}function Y(h,w,T){return(0,t.IsFunction)(T)}function F(h,w,T){return!(!(0,t.IsInteger)(T)||l(h.exclusiveMaximum)&&!(T<h.exclusiveMaximum)||l(h.exclusiveMinimum)&&!(T>h.exclusiveMinimum)||l(h.maximum)&&!(T<=h.maximum)||l(h.minimum)&&!(T>=h.minimum)||l(h.multipleOf)&&T%h.multipleOf!==0)}function j(h,w,T){let u=h.allOf.every(O=>N(O,w,T));if(h.unevaluatedProperties===!1){let O=new RegExp(s.KeyResolver.ResolvePattern(h)),b=Object.getOwnPropertyNames(T).every(v=>O.test(v));return u&&b}else if(s.TypeGuard.TSchema(h.unevaluatedProperties)){let O=new RegExp(s.KeyResolver.ResolvePattern(h)),b=Object.getOwnPropertyNames(T).every(v=>O.test(v)||N(h.unevaluatedProperties,w,T[v]));return u&&b}else return u}function q(h,w,T){return(0,t.IsIterator)(T)}function z(h,w,T){return T===h.const}function k(h,w,T){return!1}function te(h,w,T){return!N(h.not,w,T)}function W(h,w,T){return(0,t.IsNull)(T)}function le(h,w,T){return!(!n.TypeSystemPolicy.IsNumberLike(T)||l(h.exclusiveMaximum)&&!(T<h.exclusiveMaximum)||l(h.exclusiveMinimum)&&!(T>h.exclusiveMinimum)||l(h.minimum)&&!(T>=h.minimum)||l(h.maximum)&&!(T<=h.maximum)||l(h.multipleOf)&&T%h.multipleOf!==0)}function x(h,w,T){if(!n.TypeSystemPolicy.IsObjectLike(T)||l(h.minProperties)&&!(Object.getOwnPropertyNames(T).length>=h.minProperties)||l(h.maxProperties)&&!(Object.getOwnPropertyNames(T).length<=h.maxProperties))return!1;let u=Object.getOwnPropertyNames(h.properties);for(let O of u){let b=h.properties[O];if(h.required&&h.required.includes(O)){if(!N(b,w,T[O])||(s.ExtendsUndefined.Check(b)||a(b))&&!(O in T))return!1}else if(n.TypeSystemPolicy.IsExactOptionalProperty(T,O)&&!N(b,w,T[O]))return!1}if(h.additionalProperties===!1){let O=Object.getOwnPropertyNames(T);return h.required&&h.required.length===u.length&&O.length===u.length?!0:O.every(b=>u.includes(b))}else return typeof h.additionalProperties=="object"?Object.getOwnPropertyNames(T).every(b=>u.includes(b)||N(h.additionalProperties,w,T[b])):!0}function M(h,w,T){return(0,t.IsPromise)(T)}function B(h,w,T){if(!n.TypeSystemPolicy.IsRecordLike(T)||l(h.minProperties)&&!(Object.getOwnPropertyNames(T).length>=h.minProperties)||l(h.maxProperties)&&!(Object.getOwnPropertyNames(T).length<=h.maxProperties))return!1;let[u,O]=Object.entries(h.patternProperties)[0],b=new RegExp(u),v=Object.entries(T).every(([ee,ne])=>b.test(ee)?N(O,w,ne):!0),P=typeof h.additionalProperties=="object"?Object.entries(T).every(([ee,ne])=>b.test(ee)?!0:N(h.additionalProperties,w,ne)):!0,K=h.additionalProperties===!1?Object.getOwnPropertyNames(T).every(ee=>b.test(ee)):!0;return v&&P&&K}function Q(h,w,T){return N((0,r.Deref)(h,w),w,T)}function ie(h,w,T){return!(0,t.IsString)(T)||l(h.minLength)&&!(T.length>=h.minLength)||l(h.maxLength)&&!(T.length<=h.maxLength)||l(h.pattern)&&!new RegExp(h.pattern).test(T)?!1:l(h.format)?s.FormatRegistry.Has(h.format)?s.FormatRegistry.Get(h.format)(T):!1:!0}function X(h,w,T){return(0,t.IsSymbol)(T)}function se(h,w,T){return(0,t.IsString)(T)&&new RegExp(h.pattern).test(T)}function L(h,w,T){return N((0,r.Deref)(h,w),w,T)}function G(h,w,T){if(!(0,t.IsArray)(T)||h.items===void 0&&T.length!==0||T.length!==h.maxItems)return!1;if(!h.items)return!0;for(let u=0;u<h.items.length;u++)if(!N(h.items[u],w,T[u]))return!1;return!0}function J(h,w,T){return(0,t.IsUndefined)(T)}function fe(h,w,T){return h.anyOf.some(u=>N(u,w,T))}function f(h,w,T){return!(!(0,t.IsUint8Array)(T)||l(h.maxByteLength)&&!(T.length<=h.maxByteLength)||l(h.minByteLength)&&!(T.length>=h.minByteLength))}function _(h,w,T){return!0}function I(h,w,T){return n.TypeSystemPolicy.IsVoidLike(T)}function U(h,w,T){return s.TypeRegistry.Has(h[s.Kind])?s.TypeRegistry.Get(h[s.Kind])(h,T):!1}function N(h,w,T){let u=l(h.$id)?[...w,h]:w,O=h;switch(O[s.Kind]){case"Any":return c(O,u,T);case"Array":return d(O,u,T);case"AsyncIterator":return g(O,u,T);case"BigInt":return C(O,u,T);case"Boolean":return E(O,u,T);case"Constructor":return D(O,u,T);case"Date":return V(O,u,T);case"Function":return Y(O,u,T);case"Integer":return F(O,u,T);case"Intersect":return j(O,u,T);case"Iterator":return q(O,u,T);case"Literal":return z(O,u,T);case"Never":return k(O,u,T);case"Not":return te(O,u,T);case"Null":return W(O,u,T);case"Number":return le(O,u,T);case"Object":return x(O,u,T);case"Promise":return M(O,u,T);case"Record":return B(O,u,T);case"Ref":return Q(O,u,T);case"String":return ie(O,u,T);case"Symbol":return X(O,u,T);case"TemplateLiteral":return se(O,u,T);case"This":return L(O,u,T);case"Tuple":return G(O,u,T);case"Undefined":return J(O,u,T);case"Union":return fe(O,u,T);case"Uint8Array":return f(O,u,T);case"Unknown":return _(O,u,T);case"Void":return I(O,u,T);default:if(!s.TypeRegistry.Has(O[s.Kind]))throw new o(O);return U(O,u,T)}}function S(...h){return h.length===3?N(h[0],h[1],h[2]):N(h[0],[],h[1])}e.Check=S}}),Np=xe({"../../../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=rr(),n=Gi(),r=Rp(),i=zt(),s=class extends i.TypeBoxError{constructor(C,E,D){super("Unable to decode due to invalid value"),this.schema=C,this.value=E,this.error=D}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(C,E,D){super("Unable to encode due to invalid value"),this.schema=C,this.value=E,this.error=D}};e.TransformEncodeCheckError=o;var a=class extends i.TypeBoxError{constructor(C,E,D){super(`${D instanceof Error?D.message:"Unknown error"}`),this.schema=C,this.value=E}};e.TransformDecodeError=a;var l=class extends i.TypeBoxError{constructor(C,E,D){super(`${D instanceof Error?D.message:"Unknown error"}`),this.schema=C,this.value=E}};e.TransformEncodeError=l;var c;(function(C){function E(X,se){return i.TypeGuard.TTransform(X)||B(X.items,se)}function D(X,se){return i.TypeGuard.TTransform(X)||B(X.items,se)}function V(X,se){return i.TypeGuard.TTransform(X)||B(X.returns,se)||X.parameters.some(L=>B(L,se))}function Y(X,se){return i.TypeGuard.TTransform(X)||B(X.returns,se)||X.parameters.some(L=>B(L,se))}function F(X,se){return i.TypeGuard.TTransform(X)||i.TypeGuard.TTransform(X.unevaluatedProperties)||X.allOf.some(L=>B(L,se))}function j(X,se){return i.TypeGuard.TTransform(X)||B(X.items,se)}function q(X,se){return i.TypeGuard.TTransform(X)||B(X.not,se)}function z(X,se){return i.TypeGuard.TTransform(X)||Object.values(X.properties).some(L=>B(L,se))||i.TypeGuard.TSchema(X.additionalProperties)&&B(X.additionalProperties,se)}function k(X,se){return i.TypeGuard.TTransform(X)||B(X.item,se)}function te(X,se){let L=Object.getOwnPropertyNames(X.patternProperties)[0],G=X.patternProperties[L];return i.TypeGuard.TTransform(X)||B(G,se)||i.TypeGuard.TSchema(X.additionalProperties)&&i.TypeGuard.TTransform(X.additionalProperties)}function W(X,se){return i.TypeGuard.TTransform(X)?!0:B((0,n.Deref)(X,se),se)}function le(X,se){return i.TypeGuard.TTransform(X)?!0:B((0,n.Deref)(X,se),se)}function x(X,se){return i.TypeGuard.TTransform(X)||!(0,t.IsUndefined)(X.items)&&X.items.some(L=>B(L,se))}function M(X,se){return i.TypeGuard.TTransform(X)||X.anyOf.some(L=>B(L,se))}function B(X,se){let L=(0,t.IsString)(X.$id)?[...se,X]:se,G=X;if(X.$id&&Q.has(X.$id))return!1;switch(X.$id&&Q.add(X.$id),X[i.Kind]){case"Array":return E(G,L);case"AsyncIterator":return D(G,L);case"Constructor":return V(G,L);case"Function":return Y(G,L);case"Intersect":return F(G,L);case"Iterator":return j(G,L);case"Not":return q(G,L);case"Object":return z(G,L);case"Promise":return k(G,L);case"Record":return te(G,L);case"Ref":return W(G,L);case"This":return le(G,L);case"Tuple":return x(G,L);case"Union":return M(G,L);default:return i.TypeGuard.TTransform(X)}}let Q=new Set;function ie(X,se){return Q.clear(),B(X,se)}C.Has=ie})(c||(e.HasTransform=c={}));var d;(function(C){function E(x,M){try{return i.TypeGuard.TTransform(x)?x[i.Transform].Decode(M):M}catch(B){throw new a(x,M,B)}}function D(x,M,B){return(0,t.IsArray)(B)?E(x,B.map(Q=>W(x.items,M,Q))):E(x,B)}function V(x,M,B){if(!(0,t.IsPlainObject)(B)||(0,t.IsValueType)(B))return E(x,B);let Q=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),ie=Q.reduce((G,J)=>J in G?{...G,[J]:W(i.IndexedAccessor.Resolve(x,[J]),M,G[J])}:G,B);if(!i.TypeGuard.TTransform(x.unevaluatedProperties))return E(x,ie);let X=Object.getOwnPropertyNames(ie),se=x.unevaluatedProperties,L=X.reduce((G,J)=>Q.includes(J)?G:{...G,[J]:E(se,G[J])},ie);return E(x,L)}function Y(x,M,B){return E(x,W(x.not,M,B))}function F(x,M,B){if(!(0,t.IsPlainObject)(B))return E(x,B);let Q=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),ie=Q.reduce((G,J)=>J in G?{...G,[J]:W(x.properties[J],M,G[J])}:G,B);if(!i.TypeGuard.TSchema(x.additionalProperties))return E(x,ie);let X=Object.getOwnPropertyNames(ie),se=x.additionalProperties,L=X.reduce((G,J)=>Q.includes(J)?G:{...G,[J]:E(se,G[J])},ie);return E(x,L)}function j(x,M,B){if(!(0,t.IsPlainObject)(B))return E(x,B);let Q=Object.getOwnPropertyNames(x.patternProperties)[0],ie=new RegExp(Q),X=Object.getOwnPropertyNames(B).reduce((J,fe)=>ie.test(fe)?{...J,[fe]:W(x.patternProperties[Q],M,J[fe])}:J,B);if(!i.TypeGuard.TSchema(x.additionalProperties))return E(x,X);let se=Object.getOwnPropertyNames(X),L=x.additionalProperties,G=se.reduce((J,fe)=>ie.test(fe)?J:{...J,[fe]:E(L,J[fe])},X);return E(x,G)}function q(x,M,B){let Q=(0,n.Deref)(x,M);return E(x,W(Q,M,B))}function z(x,M,B){let Q=(0,n.Deref)(x,M);return E(x,W(Q,M,B))}function k(x,M,B){return(0,t.IsArray)(B)&&(0,t.IsArray)(x.items)?E(x,x.items.map((Q,ie)=>W(Q,M,B[ie]))):E(x,B)}function te(x,M,B){let Q=E(x,B);for(let ie of x.anyOf)if((0,r.Check)(ie,M,Q))return W(ie,M,Q);return Q}function W(x,M,B){let Q=typeof x.$id=="string"?[...M,x]:M,ie=x;switch(x[i.Kind]){case"Array":return D(ie,Q,B);case"Intersect":return V(ie,Q,B);case"Not":return Y(ie,Q,B);case"Object":return F(ie,Q,B);case"Record":return j(ie,Q,B);case"Ref":return q(ie,Q,B);case"Symbol":return E(ie,B);case"This":return z(ie,Q,B);case"Tuple":return k(ie,Q,B);case"Union":return te(ie,Q,B);default:return E(ie,B)}}function le(x,M,B){return W(x,M,B)}C.Decode=le})(d||(e.DecodeTransform=d={}));var g;(function(C){function E(x,M){try{return i.TypeGuard.TTransform(x)?x[i.Transform].Encode(M):M}catch(B){throw new l(x,M,B)}}function D(x,M,B){let Q=E(x,B);return(0,t.IsArray)(Q)?Q.map(ie=>W(x.items,M,ie)):Q}function V(x,M,B){let Q=E(x,B);if(!(0,t.IsPlainObject)(B)||(0,t.IsValueType)(B))return Q;let ie=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),X=ie.reduce((G,J)=>J in Q?{...G,[J]:W(i.IndexedAccessor.Resolve(x,[J]),M,G[J])}:G,Q);if(!i.TypeGuard.TTransform(x.unevaluatedProperties))return E(x,X);let se=Object.getOwnPropertyNames(X),L=x.unevaluatedProperties;return se.reduce((G,J)=>ie.includes(J)?G:{...G,[J]:E(L,G[J])},X)}function Y(x,M,B){return E(x.not,E(x,B))}function F(x,M,B){let Q=E(x,B);if(!(0,t.IsPlainObject)(B))return Q;let ie=i.KeyResolver.ResolveKeys(x,{includePatterns:!1}),X=ie.reduce((G,J)=>J in G?{...G,[J]:W(x.properties[J],M,G[J])}:G,Q);if(!i.TypeGuard.TSchema(x.additionalProperties))return X;let se=Object.getOwnPropertyNames(X),L=x.additionalProperties;return se.reduce((G,J)=>ie.includes(J)?G:{...G,[J]:E(L,G[J])},X)}function j(x,M,B){let Q=E(x,B);if(!(0,t.IsPlainObject)(B))return Q;let ie=Object.getOwnPropertyNames(x.patternProperties)[0],X=new RegExp(ie),se=Object.getOwnPropertyNames(B).reduce((J,fe)=>X.test(fe)?{...J,[fe]:W(x.patternProperties[ie],M,J[fe])}:J,Q);if(!i.TypeGuard.TSchema(x.additionalProperties))return E(x,se);let L=Object.getOwnPropertyNames(se),G=x.additionalProperties;return L.reduce((J,fe)=>X.test(fe)?J:{...J,[fe]:E(G,J[fe])},se)}function q(x,M,B){let Q=(0,n.Deref)(x,M),ie=W(Q,M,B);return E(x,ie)}function z(x,M,B){let Q=(0,n.Deref)(x,M),ie=W(Q,M,B);return E(x,ie)}function k(x,M,B){let Q=E(x,B);return(0,t.IsArray)(x.items)?x.items.map((ie,X)=>W(ie,M,Q[X])):[]}function te(x,M,B){for(let Q of x.anyOf){if(!(0,r.Check)(Q,M,B))continue;let ie=W(Q,M,B);return E(x,ie)}for(let Q of x.anyOf){let ie=W(Q,M,B);if((0,r.Check)(x,M,ie))return E(x,ie)}return E(x,B)}function W(x,M,B){let Q=typeof x.$id=="string"?[...M,x]:M,ie=x;switch(x[i.Kind]){case"Array":return D(ie,Q,B);case"Intersect":return V(ie,Q,B);case"Not":return Y(ie,Q,B);case"Object":return F(ie,Q,B);case"Record":return j(ie,Q,B);case"Ref":return q(ie,Q,B);case"This":return z(ie,Q,B);case"Tuple":return k(ie,Q,B);case"Union":return te(ie,Q,B);default:return E(ie,B)}}function le(x,M,B){return W(x,M,B)}C.Encode=le})(g||(e.EncodeTransform=g={}))}}),$p=xe({"../../../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=Np(),n=rr(),r=qi(),i=bc(),s=Gi(),o=cs(),a=zt(),l=class{constructor(F,j,q,z){this.schema=F,this.references=j,this.checkFunc=q,this.code=z,this.hasTransform=t.HasTransform.Has(F,j)}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 j=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,F):F;if(!this.checkFunc(j))throw new t.TransformEncodeCheckError(this.schema,F,this.Errors(F).First());return j}};e.TypeCheck=l;var c;(function(F){function j(te){return te===36}F.DollarSign=j;function q(te){return te===95}F.IsUnderscore=q;function z(te){return te>=65&&te<=90||te>=97&&te<=122}F.IsAlpha=z;function k(te){return te>=48&&te<=57}F.IsNumeric=k})(c||(c={}));var d;(function(F){function j(te){return te.length===0?!1:c.IsNumeric(te.charCodeAt(0))}function q(te){if(j(te))return!1;for(let W=0;W<te.length;W++){let le=te.charCodeAt(W);if(!(c.IsAlpha(le)||c.IsNumeric(le)||c.DollarSign(le)||c.IsUnderscore(le)))return!1}return!0}function z(te){return te.replace(/'/g,"\\'")}function k(te,W){return q(W)?`${te}.${W}`:`${te}['${z(W)}']`}F.Encode=k})(d||(d={}));var g;(function(F){function j(q){let z=[];for(let k=0;k<q.length;k++){let te=q.charCodeAt(k);c.IsNumeric(te)||c.IsAlpha(te)?z.push(q.charAt(k)):z.push(`_${te}_`)}return z.join("").replace(/__/g,"_")}F.Encode=j})(g||(g={}));var C;(function(F){function j(q){return q.replace(/'/g,"\\'")}F.Escape=j})(C||(C={}));var E=class extends a.TypeBoxError{constructor(F){super("Unknown type"),this.schema=F}};e.TypeCompilerUnknownTypeError=E;var D=class extends a.TypeBoxError{constructor(F){super("Preflight validation check failed to guard for the given schema"),this.schema=F}};e.TypeCompilerTypeGuardError=D;var V;(function(F){function j(W,le,x){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${le}' in ${W} ? ${x} : true)`:`(${d.Encode(W,le)} !== undefined ? ${x} : true)`}F.IsExactOptionalProperty=j;function q(W){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${W} === 'object' && ${W} !== null)`:`(typeof ${W} === 'object' && ${W} !== null && !Array.isArray(${W}))`}F.IsObjectLike=q;function z(W){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${W} === 'object' && ${W} !== null && !(${W} instanceof Date) && !(${W} instanceof Uint8Array))`:`(typeof ${W} === 'object' && ${W} !== null && !Array.isArray(${W}) && !(${W} instanceof Date) && !(${W} instanceof Uint8Array))`}F.IsRecordLike=z;function k(W){return i.TypeSystemPolicy.AllowNaN?`typeof ${W} === 'number'`:`(typeof ${W} === 'number' && Number.isFinite(${W}))`}F.IsNumberLike=k;function te(W){return i.TypeSystemPolicy.AllowNullVoid?`(${W} === undefined || ${W} === null)`:`${W} === undefined`}F.IsVoidLike=te})(V||(e.Policy=V={}));var Y;(function(F){function j(A){return A[a.Kind]==="Any"||A[a.Kind]==="Unknown"}function*q(A,ue,R){yield"true"}function*z(A,ue,R){yield`Array.isArray(${R})`;let[ye,re]=[De("value","any"),De("acc","number")];(0,n.IsNumber)(A.maxItems)&&(yield`${R}.length <= ${A.maxItems}`),(0,n.IsNumber)(A.minItems)&&(yield`${R}.length >= ${A.minItems}`);let ce=ne(A.items,ue,"value");if(yield`${R}.every((${ye}) => ${ce})`,a.TypeGuard.TSchema(A.contains)||(0,n.IsNumber)(A.minContains)||(0,n.IsNumber)(A.maxContains)){let Oe=a.TypeGuard.TSchema(A.contains)?A.contains:a.Type.Never(),Ue=ne(Oe,ue,"value"),He=(0,n.IsNumber)(A.minContains)?[`(count >= ${A.minContains})`]:[],We=(0,n.IsNumber)(A.maxContains)?[`(count <= ${A.maxContains})`]:[],Xe=`const count = value.reduce((${re}, ${ye}) => ${Ue} ? acc + 1 : acc, 0)`,Ft=["(count > 0)",...He,...We].join(" && ");yield`((${ye}) => { ${Xe}; return ${Ft}})(${R})`}A.uniqueItems===!0&&(yield`((${ye}) => { 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*k(A,ue,R){yield`(typeof value === 'object' && Symbol.asyncIterator in ${R})`}function*te(A,ue,R){yield`(typeof ${R} === 'bigint')`,(0,n.IsBigInt)(A.exclusiveMaximum)&&(yield`${R} < BigInt(${A.exclusiveMaximum})`),(0,n.IsBigInt)(A.exclusiveMinimum)&&(yield`${R} > BigInt(${A.exclusiveMinimum})`),(0,n.IsBigInt)(A.maximum)&&(yield`${R} <= BigInt(${A.maximum})`),(0,n.IsBigInt)(A.minimum)&&(yield`${R} >= BigInt(${A.minimum})`),(0,n.IsBigInt)(A.multipleOf)&&(yield`(${R} % BigInt(${A.multipleOf})) === 0`)}function*W(A,ue,R){yield`(typeof ${R} === 'boolean')`}function*le(A,ue,R){yield*K(A.returns,ue,`${R}.prototype`)}function*x(A,ue,R){yield`(${R} instanceof Date) && Number.isFinite(${R}.getTime())`,(0,n.IsNumber)(A.exclusiveMaximumTimestamp)&&(yield`${R}.getTime() < ${A.exclusiveMaximumTimestamp}`),(0,n.IsNumber)(A.exclusiveMinimumTimestamp)&&(yield`${R}.getTime() > ${A.exclusiveMinimumTimestamp}`),(0,n.IsNumber)(A.maximumTimestamp)&&(yield`${R}.getTime() <= ${A.maximumTimestamp}`),(0,n.IsNumber)(A.minimumTimestamp)&&(yield`${R}.getTime() >= ${A.minimumTimestamp}`),(0,n.IsNumber)(A.multipleOfTimestamp)&&(yield`(${R}.getTime() % ${A.multipleOfTimestamp}) === 0`)}function*M(A,ue,R){yield`(typeof ${R} === 'function')`}function*B(A,ue,R){yield`(typeof ${R} === 'number' && Number.isInteger(${R}))`,(0,n.IsNumber)(A.exclusiveMaximum)&&(yield`${R} < ${A.exclusiveMaximum}`),(0,n.IsNumber)(A.exclusiveMinimum)&&(yield`${R} > ${A.exclusiveMinimum}`),(0,n.IsNumber)(A.maximum)&&(yield`${R} <= ${A.maximum}`),(0,n.IsNumber)(A.minimum)&&(yield`${R} >= ${A.minimum}`),(0,n.IsNumber)(A.multipleOf)&&(yield`(${R} % ${A.multipleOf}) === 0`)}function*Q(A,ue,R){let ye=A.allOf.map(re=>ne(re,ue,R)).join(" && ");if(A.unevaluatedProperties===!1){let re=ge(`${new RegExp(a.KeyResolver.ResolvePattern(A))};`),ce=`Object.getOwnPropertyNames(${R}).every(key => ${re}.test(key))`;yield`(${ye} && ${ce})`}else if(a.TypeGuard.TSchema(A.unevaluatedProperties)){let re=ge(`${new RegExp(a.KeyResolver.ResolvePattern(A))};`),ce=`Object.getOwnPropertyNames(${R}).every(key => ${re}.test(key) || ${ne(A.unevaluatedProperties,ue,`${R}[key]`)})`;yield`(${ye} && ${ce})`}else yield`(${ye})`}function*ie(A,ue,R){yield`(typeof value === 'object' && Symbol.iterator in ${R})`}function*X(A,ue,R){typeof A.const=="number"||typeof A.const=="boolean"?yield`(${R} === ${A.const})`:yield`(${R} === '${C.Escape(A.const)}')`}function*se(A,ue,R){yield"false"}function*L(A,ue,R){yield`(!${ne(A.not,ue,R)})`}function*G(A,ue,R){yield`(${R} === null)`}function*J(A,ue,R){yield V.IsNumberLike(R),(0,n.IsNumber)(A.exclusiveMaximum)&&(yield`${R} < ${A.exclusiveMaximum}`),(0,n.IsNumber)(A.exclusiveMinimum)&&(yield`${R} > ${A.exclusiveMinimum}`),(0,n.IsNumber)(A.maximum)&&(yield`${R} <= ${A.maximum}`),(0,n.IsNumber)(A.minimum)&&(yield`${R} >= ${A.minimum}`),(0,n.IsNumber)(A.multipleOf)&&(yield`(${R} % ${A.multipleOf}) === 0`)}function*fe(A,ue,R){yield V.IsObjectLike(R),(0,n.IsNumber)(A.minProperties)&&(yield`Object.getOwnPropertyNames(${R}).length >= ${A.minProperties}`),(0,n.IsNumber)(A.maxProperties)&&(yield`Object.getOwnPropertyNames(${R}).length <= ${A.maxProperties}`);let ye=Object.getOwnPropertyNames(A.properties);for(let re of ye){let ce=d.Encode(R,re),Oe=A.properties[re];if(A.required&&A.required.includes(re))yield*K(Oe,ue,ce),(a.ExtendsUndefined.Check(Oe)||j(Oe))&&(yield`('${re}' in ${R})`);else{let Ue=ne(Oe,ue,ce);yield V.IsExactOptionalProperty(R,re,Ue)}}if(A.additionalProperties===!1)if(A.required&&A.required.length===ye.length)yield`Object.getOwnPropertyNames(${R}).length === ${ye.length}`;else{let re=`[${ye.map(ce=>`'${ce}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${R}).every(key => ${re}.includes(key))`}if(typeof A.additionalProperties=="object"){let re=ne(A.additionalProperties,ue,`${R}[key]`),ce=`[${ye.map(Oe=>`'${Oe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${R}).every(key => ${ce}.includes(key) || ${re}))`}}function*f(A,ue,R){yield`(typeof value === 'object' && typeof ${R}.then === 'function')`}function*_(A,ue,R){yield V.IsRecordLike(R),(0,n.IsNumber)(A.minProperties)&&(yield`Object.getOwnPropertyNames(${R}).length >= ${A.minProperties}`),(0,n.IsNumber)(A.maxProperties)&&(yield`Object.getOwnPropertyNames(${R}).length <= ${A.maxProperties}`);let[ye,re]=Object.entries(A.patternProperties)[0],ce=ge(`${new RegExp(ye)}`),Oe=ne(re,ue,"value"),Ue=a.TypeGuard.TSchema(A.additionalProperties)?ne(A.additionalProperties,ue,R):A.additionalProperties===!1?"false":"true",He=`(${ce}.test(key) ? ${Oe} : ${Ue})`;yield`(Object.entries(${R}).every(([key, value]) => ${He}))`}function*I(A,ue,R){let ye=(0,s.Deref)(A,ue);if(ee.functions.has(A.$ref))return yield`${pe(A.$ref)}(${R})`;yield*K(ye,ue,R)}function*U(A,ue,R){yield`(typeof ${R} === 'string')`,(0,n.IsNumber)(A.maxLength)&&(yield`${R}.length <= ${A.maxLength}`),(0,n.IsNumber)(A.minLength)&&(yield`${R}.length >= ${A.minLength}`),A.pattern!==void 0&&(yield`${ge(`${new RegExp(A.pattern)};`)}.test(${R})`),A.format!==void 0&&(yield`format('${A.format}', ${R})`)}function*N(A,ue,R){yield`(typeof ${R} === 'symbol')`}function*S(A,ue,R){yield`(typeof ${R} === 'string')`,yield`${ge(`${new RegExp(A.pattern)};`)}.test(${R})`}function*h(A,ue,R){yield`${pe(A.$ref)}(${R})`}function*w(A,ue,R){if(yield`Array.isArray(${R})`,A.items===void 0)return yield`${R}.length === 0`;yield`(${R}.length === ${A.maxItems})`;for(let ye=0;ye<A.items.length;ye++)yield`${ne(A.items[ye],ue,`${R}[${ye}]`)}`}function*T(A,ue,R){yield`${R} === undefined`}function*u(A,ue,R){yield`(${A.anyOf.map(re=>ne(re,ue,R)).join(" || ")})`}function*O(A,ue,R){yield`${R} instanceof Uint8Array`,(0,n.IsNumber)(A.maxByteLength)&&(yield`(${R}.length <= ${A.maxByteLength})`),(0,n.IsNumber)(A.minByteLength)&&(yield`(${R}.length >= ${A.minByteLength})`)}function*b(A,ue,R){yield"true"}function*v(A,ue,R){yield V.IsVoidLike(R)}function*P(A,ue,R){let ye=ee.instances.size;ee.instances.set(ye,A),yield`kind('${A[a.Kind]}', ${ye}, ${R})`}function*K(A,ue,R,ye=!0){let re=(0,n.IsString)(A.$id)?[...ue,A]:ue,ce=A;if(ye&&(0,n.IsString)(A.$id)){let Oe=pe(A.$id);if(ee.functions.has(Oe))return yield`${Oe}(${R})`;{let Ue=Ne(Oe,A,ue,"value",!1);return ee.functions.set(Oe,Ue),yield`${Oe}(${R})`}}switch(ce[a.Kind]){case"Any":return yield*q(ce,re,R);case"Array":return yield*z(ce,re,R);case"AsyncIterator":return yield*k(ce,re,R);case"BigInt":return yield*te(ce,re,R);case"Boolean":return yield*W(ce,re,R);case"Constructor":return yield*le(ce,re,R);case"Date":return yield*x(ce,re,R);case"Function":return yield*M(ce,re,R);case"Integer":return yield*B(ce,re,R);case"Intersect":return yield*Q(ce,re,R);case"Iterator":return yield*ie(ce,re,R);case"Literal":return yield*X(ce,re,R);case"Never":return yield*se(ce,re,R);case"Not":return yield*L(ce,re,R);case"Null":return yield*G(ce,re,R);case"Number":return yield*J(ce,re,R);case"Object":return yield*fe(ce,re,R);case"Promise":return yield*f(ce,re,R);case"Record":return yield*_(ce,re,R);case"Ref":return yield*I(ce,re,R);case"String":return yield*U(ce,re,R);case"Symbol":return yield*N(ce,re,R);case"TemplateLiteral":return yield*S(ce,re,R);case"This":return yield*h(ce,re,R);case"Tuple":return yield*w(ce,re,R);case"Undefined":return yield*T(ce,re,R);case"Union":return yield*u(ce,re,R);case"Uint8Array":return yield*O(ce,re,R);case"Unknown":return yield*b(ce,re,R);case"Void":return yield*v(ce,re,R);default:if(!a.TypeRegistry.Has(ce[a.Kind]))throw new E(A);return yield*P(ce,re,R)}}let ee={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function ne(A,ue,R,ye=!0){return`(${[...K(A,ue,R,ye)].join(" && ")})`}function pe(A){return`check_${g.Encode(A)}`}function ge(A){let ue=`local_${ee.variables.size}`;return ee.variables.set(ue,`const ${ue} = ${A}`),ue}function Ne(A,ue,R,ye,re=!0){let[ce,Oe]=[`
|
|
49
|
-
`,
|
|
50
|
-
}`}function
|
|
51
|
-
return ${
|
|
52
|
-
}`:`return ${
|
|
53
|
-
`)}function
|
|
54
|
-
`)){let i=r.match(/^\s+at\s+(.*)/);if(i){if(n)return i[1].trim().replace(__dirname,"");n=!0}}}};
|
|
38
|
+
${f}`);let y=Math.min(D.length,x),T=0;for(;T<y-1;T++){let u=L(String(T),D[T],H,Y,he,f);E+=u!==void 0?u:"null",E+=U}let w=L(String(T),D[T],H,Y,he,f);if(E+=w!==void 0?w:"null",D.length-1>x){let u=D.length-x-1;E+=`${U}"... ${S(u)} not stringified"`}return he!==""&&(E+=`
|
|
39
|
+
${_}`),H.pop(),`[${E}]`}H.push(D);let P="";he!==""&&(f+=he,U=`,
|
|
40
|
+
${f}`,P=" ");let N="";for(let y of Y){let T=L(y,D[y],H,Y,he,f);T!==void 0&&(E+=`${N}${o(y)}:${P}${T}`,N=U)}return he!==""&&N.length>1&&(E=`
|
|
41
|
+
${f}${E}
|
|
42
|
+
${_}`),H.pop(),`{${E}}`}case"number":return isFinite(D)?String(D):z?z(D):"null";case"boolean":return D===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(D);default:return z?z(D):void 0}}function ee(ae,D,H,Y,he){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 ee(ae,D,H,Y,he);if(D===null)return"null"}if(H.indexOf(D)!==-1)return W;let f=he;if(Array.isArray(D)){if(D.length===0)return"[]";if(fe<H.length+1)return'"[Array]"';H.push(D),he+=Y;let T=`
|
|
43
|
+
${he}`,w=`,
|
|
44
|
+
${he}`,u=Math.min(D.length,x),A=0;for(;A<u-1;A++){let v=ee(String(A),D[A],H,Y,he);T+=v!==void 0?v:"null",T+=w}let b=ee(String(A),D[A],H,Y,he);if(T+=b!==void 0?b:"null",D.length-1>x){let v=D.length-x-1;T+=`${w}"... ${S(v)} not stringified"`}return T+=`
|
|
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
|
+
${he}`,P="",N="",y=Math.min(E,x);l(D)&&(P+=c(D,U,x),_=_.slice(D.length),y-=D.length,N=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+=`${N}${o(w)}: ${u}`,N=U)}if(E>x){let T=E-x;P+=`${N}"...": "${S(T)} not stringified"`,N=U}return N!==""&&(P=`
|
|
47
|
+
${he}${P}
|
|
48
|
+
${f}`),H.pop(),`{${P}}`}case"number":return isFinite(D)?String(D):z?z(D):"null";case"boolean":return D===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(D);default:return z?z(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),N=0;for(;N<P-1;N++){let T=oe(String(N),D[N],H);Y+=T!==void 0?T:"null",Y+=","}let y=oe(String(N),D[N],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 N=f[P],y=oe(N,D[N],H);y!==void 0&&(Y+=`${E}${o(N)}:${y}`,E=",")}if(_>x){let P=_-x;Y+=`${E}"...":"${S(P)} not stringified"`}return H.pop(),`{${Y}}`}case"number":return isFinite(D)?String(D):z?z(D):"null";case"boolean":return D===!0?"true":"false";case"undefined":return;case"bigint":if(j)return String(D);default:return z?z(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,[],V(D),Y,"")}if(Y.length!==0)return ee("",ae,[],Y,"")}return oe("",ae,[])}return Q}}}),Or=Le({"../../../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 V(j){return S(j)&&Number.isInteger(j)}e.IsInteger=V;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 z(j){return typeof j=="symbol"}e.IsSymbol=z;function W(j){return J(j)||I(j)||C(j)||S(j)||F(j)||z(j)||g(j)}e.IsValueType=W}}),gl=Le({"../../../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=Or(),n=_o(),r=rn(),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),(V={})=>r.Type.Unsafe({...V,[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(V){g=V}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 V(J){let F=(0,t.IsUndefined)(J);return d.AllowNullVoid?F||J===null:F}d.IsVoidLike=V})(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}}),bo=Le({"../../../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=rn(),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}}),Hs=Le({"../../../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=Or(),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 V(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 z(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 V(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 z(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}}),_o=Le({"../../../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=Or(),n=gl(),r=bo(),i=Hs(),o=rn(),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 $=c(u.contains)?u.contains:o.Type.Never(),q=v.reduce((te,ne,ge)=>T($,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*V(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*z(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 $ of u.allOf){let q=T($,A,b,v).next();q.done||(yield g(s.Intersect,u,b,v),yield q.value)}if(u.unevaluatedProperties===!1){let $=new RegExp(o.KeyResolver.ResolvePattern(u));for(let q of Object.getOwnPropertyNames(v))$.test(q)||(yield g(s.IntersectUnevaluatedProperties,u,`${b}/${q}`,v))}if(typeof u.unevaluatedProperties=="object"){let $=new RegExp(o.KeyResolver.ResolvePattern(u));for(let q of Object.getOwnPropertyNames(v))if(!$.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 $=Array.isArray(u.required)?u.required:[],q=Object.getOwnPropertyNames(u.properties),te=Object.getOwnPropertyNames(v);for(let ne of $)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[$,q]=Object.entries(u.patternProperties)[0],te=new RegExp($);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 $=0;$<u.items.length;$++)yield*T(u.items[$],A,`${b}/${$}`,v[$])}function*_(u,A,b,v){(0,t.IsUndefined)(v)||(yield g(s.Undefined,u,b,v))}function*E(u,A,b,v){let $=0;for(let q of u.anyOf){let te=[...T(q,A,b,v)];if(te.length===0)return;$+=te.length}$>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*N(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 $=c(u.$id)?[...A,u]:A,q=u;switch(q[o.Kind]){case"Any":return yield*C(q,$,b,v);case"Array":return yield*I(q,$,b,v);case"AsyncIterator":return yield*S(q,$,b,v);case"BigInt":return yield*V(q,$,b,v);case"Boolean":return yield*J(q,$,b,v);case"Constructor":return yield*F(q,$,b,v);case"Date":return yield*k(q,$,b,v);case"Function":return yield*z(q,$,b,v);case"Integer":return yield*W(q,$,b,v);case"Intersect":return yield*j(q,$,b,v);case"Iterator":return yield*Z(q,$,b,v);case"Literal":return yield*G(q,$,b,v);case"Never":return yield*fe(q,$,b,v);case"Not":return yield*x(q,$,b,v);case"Null":return yield*M(q,$,b,v);case"Number":return yield*L(q,$,b,v);case"Object":return yield*ee(q,$,b,v);case"Promise":return yield*oe(q,$,b,v);case"Record":return yield*Q(q,$,b,v);case"Ref":return yield*ae(q,$,b,v);case"String":return yield*D(q,$,b,v);case"Symbol":return yield*H(q,$,b,v);case"TemplateLiteral":return yield*Y(q,$,b,v);case"This":return yield*he(q,$,b,v);case"Tuple":return yield*f(q,$,b,v);case"Undefined":return yield*_(q,$,b,v);case"Union":return yield*E(q,$,b,v);case"Uint8Array":return yield*U(q,$,b,v);case"Unknown":return yield*P(q,$,b,v);case"Void":return yield*N(q,$,b,v);default:if(!o.TypeRegistry.Has(q[o.Kind]))throw new a(u);return yield*y(q,$,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}}),ty=Le({"../../../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(_o(),e)}}),ml=Le({"../../../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=_o();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),n(gl(),e)}}),ny=Le({"../../../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=Or(),n=ml(),r=bo(),i=Hs(),o=rn(),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 $=(0,i.Hash)(v);if(b.has($))return!1;b.add($)}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 V(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 z(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),$=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&&$&&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 V(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 z(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 N(...y){return y.length===3?P(y[0],y[1],y[2]):P(y[0],[],y[1])}e.Check=N}}),ry=Le({"../../../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=Or(),n=bo(),r=ny(),i=rn(),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 V(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 z(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 V(H,D);case"Function":return J(H,D);case"Intersect":return F(H,D);case"Iterator":return k(H,D);case"Not":return z(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 V(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 z(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 V(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 z(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 V(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 z(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 V(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 z(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={}))}}),iy=Le({"../../../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=ry(),n=Or(),r=_o(),i=ml(),o=bo(),s=Hs(),a=rn(),l=class{constructor(F,k,z,W){this.schema=F,this.references=k,this.checkFunc=z,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 z(Z){return Z===95}F.IsUnderscore=z;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 z(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 z(G)?`${Z}.${G}`:`${Z}['${W(G)}']`}F.Encode=j})(d||(d={}));var g;(function(F){function k(z){let W=[];for(let j=0;j<z.length;j++){let Z=z.charCodeAt(j);c.IsNumeric(Z)||c.IsAlpha(Z)?W.push(z.charAt(j)):W.push(`_${Z}_`)}return W.join("").replace(/__/g,"_")}F.Encode=k})(g||(g={}));var C;(function(F){function k(z){return z.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 V;(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 z(G){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${G} === 'object' && ${G} !== null)`:`(typeof ${G} === 'object' && ${G} !== null && !Array.isArray(${G}))`}F.IsObjectLike=z;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})(V||(e.Policy=V={}));var J;(function(F){function k(O){return O[a.Kind]==="Any"||O[a.Kind]==="Unknown"}function*z(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"),tt=(0,n.IsNumber)(O.minContains)?[`(count >= ${O.minContains})`]:[],Qe=(0,n.IsNumber)(O.maxContains)?[`(count <= ${O.maxContains})`]:[],rt=`const count = value.reduce((${re}, ${me}) => ${ke} ? acc + 1 : acc, 0)`,Yt=["(count > 0)",...tt,...Qe].join(" && ");yield`((${me}) => { ${rt}; return ${Yt}})(${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 V.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 V.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 V.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 V.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",tt=`(${de}.test(key) ? ${Se} : ${ke})`;yield`(Object.entries(${R}).every(([key, value]) => ${tt}))`}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*N(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 V.IsVoidLike(R)}function*$(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*z(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*N(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*$(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
|
+
`,rt=>"".padStart(rt," ")],ke=Fe("value","any"),tt=$n("boolean"),Qe=[...q(le,R,me,re)].map(rt=>`${Se(4)}${rt}`).join(` &&${de}`);return`function ${O}(${ke})${tt} {${de}${Se(2)}return (${de}${Qe}${de}${Se(2)})
|
|
50
|
+
}`}function Fe(O,le){let R=te.language==="typescript"?`: ${le}`:"";return`${O}${R}`}function $n(O){return te.language==="typescript"?`: ${O}`:""}function _e(O,le,R){let me=Ue("check",O,le,"value"),re=Fe("value","any"),de=$n("boolean"),Se=[...te.functions.values()],ke=[...te.variables.values()],tt=(0,n.IsString)(O.$id)?`return function check(${re})${de} {
|
|
51
|
+
return ${ge(O.$id)}(value)
|
|
52
|
+
}`:`return ${me}`;return[...ke,...Se,tt].join(`
|
|
53
|
+
`)}function fn(...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=fn;function Rn(O,le=[]){let R=fn(O,le,{language:"javascript"}),me=globalThis.Function("kind","format","hash",R),re=new Map(te.instances);function de(Qe,rt,Yt){if(!a.TypeRegistry.Has(Qe)||!re.has(rt))return!1;let sr=a.TypeRegistry.Get(Qe),ar=re.get(rt);return sr(ar,Yt)}function Se(Qe,rt){return a.FormatRegistry.Has(Qe)?a.FormatRegistry.Get(Qe)(rt):!1}function ke(Qe){return(0,s.Hash)(Qe)}let tt=me(de,Se,ke);return new l(O,le,tt,R)}F.Compile=Rn})(J||(e.TypeCompiler=J={}))}}),oy=Le({"../../../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=ty();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return r.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return r.ValueErrorIterator}}),n(iy(),e)}}),ro=Et(Qh(),1),sy=Et(Zh(),1),vl=!1,bl=!1;ro.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(vl=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(bl=process?.env?.LOGGER_PERF_PREFIX==="true"));var ay={prefix:void 0,time:vl,delta:bl,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},Es=[],_l=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(",")}]`}},wl=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},ni=!1,Ne=class st{static ERROR=2;static WARN=4;static INFO=6;static LOG=6;static DEBUG=8;static VERBOSE=10;static firstLog=0;static lastLog=0;static setup(t=st.INFO,n={}){n=Object.assign({},ay,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>=st.ERROR,this.wrapLog(console.error,n));return{ERROR:(...l)=>(a(...l),new Error(l.map(c=>typeof c=="string"?c:(0,sy.default)(c)).join(" "))),WARN:s(t>=st.WARN,this.wrapLog(console.warn,n)),LOG:s(t>=st.INFO,this.wrapLog(console.log,n)),DEBUG:s(t>=st.DEBUG,this.wrapLog(console.log,{...n,dim:n.dimDebugOnServer})),VERBOSE:s(t>=st.VERBOSE,this.wrapLog(console.debug,{...n,dim:n.dimDebugOnServer}))}}static wrapLog(t,n){if(ro.isNode)return t.bind(console);{let r=[];if(n.time||n.delta){let i=ro.isBrowser&&navigator.userAgent.includes("Chrome")?["",st.timeStr(!!n.time,!!n.delta)]:[];r.push(...i)}return n.prefix&&(ni?r.push(new wl("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();st.firstLog||(st.firstLog=i,st.lastLog=i);let o=new _l(i-st.firstLog,i-st.lastLog,t,n);return st.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}}}};ro.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Es&&Es.length){for(let t of Es)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof _l))return null;ni||(ni=!0);let t=Ne.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof wl?(ni||(ni=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var uy=typeof global=="object"&&global&&global.Object===Object&&global,Tl=uy,cy=typeof self=="object"&&self&&self.Object===Object&&self,ly=Tl||cy||Function("return this")(),dt=ly,fy=dt.Symbol,Ht=fy,Al=Object.prototype,dy=Al.hasOwnProperty,py=Al.toString,Zr=Ht?Ht.toStringTag:void 0;function hy(e){var t=dy.call(e,Zr),n=e[Zr];try{e[Zr]=void 0;var r=!0}catch{}var i=py.call(e);return r&&(t?e[Zr]=n:delete e[Zr]),i}var yy=hy,gy=Object.prototype,my=gy.toString;function vy(e){return my.call(e)}var by=vy,_y="[object Null]",wy="[object Undefined]",sc=Ht?Ht.toStringTag:void 0;function Ty(e){return e==null?e===void 0?wy:_y:sc&&sc in Object(e)?yy(e):by(e)}var Er=Ty;function Ay(e){return e!=null&&typeof e=="object"}var Tn=Ay,Oy="[object Symbol]";function Ey(e){return typeof e=="symbol"||Tn(e)&&Er(e)==Oy}var Tr=Ey;function Iy(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 Ol=Iy,Sy=Array.isArray,Ft=Sy,Ny=1/0,ac=Ht?Ht.prototype:void 0,uc=ac?ac.toString:void 0;function El(e){if(typeof e=="string")return e;if(Ft(e))return Ol(e,El)+"";if(Tr(e))return uc?uc.call(e):"";var t=e+"";return t=="0"&&1/e==-Ny?"-0":t}var $y=El,Ry=/\s/;function Py(e){for(var t=e.length;t--&&Ry.test(e.charAt(t)););return t}var Cy=Py,xy=/^\s+/;function Uy(e){return e&&e.slice(0,Cy(e)+1).replace(xy,"")}var My=Uy;function By(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var on=By,cc=NaN,Dy=/^[-+]0x[0-9a-f]+$/i,Ly=/^0b[01]+$/i,ky=/^0o[0-7]+$/i,jy=parseInt;function Fy(e){if(typeof e=="number")return e;if(Tr(e))return cc;if(on(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=on(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=My(e);var n=Ly.test(e);return n||ky.test(e)?jy(e.slice(2),n?2:8):Dy.test(e)?cc:+e}var Vy=Fy,lc=1/0,Ky=17976931348623157e292;function zy(e){if(!e)return e===0?e:0;if(e=Vy(e),e===lc||e===-lc){var t=e<0?-1:1;return t*Ky}return e===e?e:0}var qy=zy;function Gy(e){var t=qy(e),n=t%1;return t===t?n?t-n:t:0}var fc=Gy;function Wy(e){return e}var wo=Wy,Hy="[object AsyncFunction]",Jy="[object Function]",Xy="[object GeneratorFunction]",Yy="[object Proxy]";function Qy(e){if(!on(e))return!1;var t=Er(e);return t==Jy||t==Xy||t==Hy||t==Yy}var Il=Qy,Zy=dt["__core-js_shared__"],Is=Zy,dc=function(){var e=/[^.]+$/.exec(Is&&Is.keys&&Is.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function eg(e){return!!dc&&dc in e}var tg=eg,ng=Function.prototype,rg=ng.toString;function ig(e){if(e!=null){try{return rg.call(e)}catch{}try{return e+""}catch{}}return""}var Wn=ig,og=/[\\^$.*+?()[\]{}|]/g,sg=/^\[object .+?Constructor\]$/,ag=Function.prototype,ug=Object.prototype,cg=ag.toString,lg=ug.hasOwnProperty,fg=RegExp("^"+cg.call(lg).replace(og,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dg(e){if(!on(e)||tg(e))return!1;var t=Il(e)?fg:sg;return t.test(Wn(e))}var pg=dg;function hg(e,t){return e?.[t]}var yg=hg;function gg(e,t){var n=yg(e,t);return pg(n)?n:void 0}var Hn=gg,mg=Hn(dt,"WeakMap"),ii=mg,vg=ii&&new ii,io=vg,bg=io?function(e,t){return io.set(e,t),e}:wo,Sl=bg,pc=Object.create,_g=function(){function e(){}return function(t){if(!on(t))return{};if(pc)return pc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Js=_g;function wg(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=Js(e.prototype),r=e.apply(n,t);return on(r)?r:n}}var oi=wg,Tg=1;function Ag(e,t,n){var r=t&Tg,i=oi(e);function o(){var s=this&&this!==dt&&this instanceof o?i:e;return s.apply(r?n:this,arguments)}return o}var Og=Ag;function Eg(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 Xs=Eg,Ig=Math.max;function Sg(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,l=t.length,c=Ig(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 Nl=Sg,Ng=Math.max;function $g(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,l=-1,c=t.length,d=Ng(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 $l=$g;function Rg(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Pg=Rg;function Cg(){}var Ys=Cg,xg=4294967295;function oo(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=xg,this.__views__=[]}oo.prototype=Js(Ys.prototype);oo.prototype.constructor=oo;var Qs=oo;function Ug(){}var Rl=Ug,Mg=io?function(e){return io.get(e)}:Rl,Pl=Mg,Bg={},hc=Bg,Dg=Object.prototype,Lg=Dg.hasOwnProperty;function kg(e){for(var t=e.name+"",n=hc[t],r=Lg.call(hc,t)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==e)return i.name}return t}var jg=kg;function so(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}so.prototype=Js(Ys.prototype);so.prototype.constructor=so;var Ls=so;function Fg(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Cl=Fg;function Vg(e){if(e instanceof Qs)return e.clone();var t=new Ls(e.__wrapped__,e.__chain__);return t.__actions__=Cl(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Kg=Vg,zg=Object.prototype,qg=zg.hasOwnProperty;function ao(e){if(Tn(e)&&!Ft(e)&&!(e instanceof Qs)){if(e instanceof Ls)return e;if(qg.call(e,"__wrapped__"))return Kg(e)}return new Ls(e)}ao.prototype=Ys.prototype;ao.prototype.constructor=ao;var Gg=ao;function Wg(e){var t=jg(e),n=Gg[t];if(typeof n!="function"||!(t in Qs.prototype))return!1;if(e===n)return!0;var r=Pl(n);return!!r&&e===r[0]}var Hg=Wg,Jg=800,Xg=16,Yg=Date.now;function Qg(e){var t=0,n=0;return function(){var r=Yg(),i=Xg-(r-n);if(n=r,i>0){if(++t>=Jg)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var xl=Qg,Zg=xl(Sl),Ul=Zg,em=/\{\n\/\* \[wrapped with (.+)\] \*/,tm=/,? & /;function nm(e){var t=e.match(em);return t?t[1].split(tm):[]}var rm=nm,im=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function om(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(im,`{
|
|
55
55
|
/* [wrapped with `+t+`] */
|
|
56
|
-
`)}var xh=Ch;function Uh(e){return function(){return e}}var Mh=Uh,Dh=function(){try{var e=Cn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ui=Dh,Lh=Ui?function(e,t){return Ui(e,"toString",{configurable:!0,enumerable:!1,value:Mh(t),writable:!0})}:Wi,Bh=Lh,jh=Mc(Bh),ys=jh;function kh(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Fh=kh;function Kh(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var Vh=Kh;function Gh(e){return e!==e}var qh=Gh;function Wh(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var zh=Wh;function Hh(e,t,n){return t===t?zh(e,t,n):Vh(e,qh,n)}var Jh=Hh;function Xh(e,t){var n=e==null?0:e.length;return!!n&&Jh(e,t,0)>-1}var Lc=Xh,Yh=1,Qh=2,Zh=8,eg=16,tg=32,ng=64,rg=128,ig=256,og=512,sg=[["ary",rg],["bind",Yh],["bindKey",Qh],["curry",Zh],["curryRight",eg],["flip",og],["partial",tg],["partialRight",ng],["rearg",ig]];function ag(e,t){return Fh(sg,function(n){var r="_."+n[0];t&n[1]&&!Lc(e,r)&&e.push(r)}),e.sort()}var ug=ag;function cg(e,t,n){var r=t+"";return ys(e,xh(r,ug(Nh(r),n)))}var Bc=cg,lg=1,fg=2,dg=4,pg=8,mu=32,vu=64;function yg(e,t,n,r,i,s,o,a,l,c){var d=t&pg,g=d?o:void 0,C=d?void 0:o,E=d?s:void 0,D=d?void 0:s;t|=d?mu:vu,t&=~(d?vu:mu),t&dg||(t&=~(lg|fg));var V=[e,t,i,E,g,D,C,a,l,c],Y=n.apply(void 0,V);return Th(e)&&Dc(Y,V),Y.placeholder=r,Bc(Y,e,t)}var jc=yg;function hg(e){var t=e;return t.placeholder}var hs=hg,gg=9007199254740991,mg=/^(?:0|[1-9]\d*)$/;function vg(e,t){var n=typeof e;return t=t??gg,!!t&&(n=="number"||n!="symbol"&&mg.test(e))&&e>-1&&e%1==0&&e<t}var zi=vg,bg=Math.min;function _g(e,t){for(var n=e.length,r=bg(t.length,n),i=Uc(e);r--;){var s=t[r];e[r]=zi(s,n)?i[s]:void 0}return e}var Tg=_g,bu="__lodash_placeholder__";function wg(e,t){for(var n=-1,r=e.length,i=0,s=[];++n<r;){var o=e[n];(o===t||o===bu)&&(e[n]=bu,s[i++]=n)}return s}var Lr=wg,Og=1,Ag=2,Ig=8,Eg=16,Sg=128,Pg=512;function kc(e,t,n,r,i,s,o,a,l,c){var d=t&Sg,g=t&Og,C=t&Ag,E=t&(Ig|Eg),D=t&Pg,V=C?void 0:Dr(e);function Y(){for(var F=arguments.length,j=Array(F),q=F;q--;)j[q]=arguments[q];if(E)var z=hs(Y),k=ih(j,z);if(r&&(j=Nc(j,r,i,E)),s&&(j=$c(j,s,o,E)),F-=k,E&&F<c){var te=Lr(j,z);return jc(e,t,kc,Y.placeholder,n,j,te,a,l,c-F)}var W=g?n:this,le=C?W[e]:e;return F=j.length,a?j=Tg(j,a):D&&F>1&&j.reverse(),d&&l<F&&(j.length=l),this&&this!==ot&&this instanceof Y&&(le=V||Dr(le)),le.apply(W,j)}return Y}var Fc=kc;function Rg(e,t,n){var r=Dr(e);function i(){for(var s=arguments.length,o=Array(s),a=s,l=hs(i);a--;)o[a]=arguments[a];var c=s<3&&o[0]!==l&&o[s-1]!==l?[]:Lr(o,l);if(s-=c.length,s<n)return jc(e,t,Fc,i.placeholder,void 0,o,c,void 0,void 0,n-s);var d=this&&this!==ot&&this instanceof i?r:e;return fs(d,this,o)}return i}var Ng=Rg,$g=1;function Cg(e,t,n,r){var i=t&$g,s=Dr(e);function o(){for(var a=-1,l=arguments.length,c=-1,d=r.length,g=Array(d+l),C=this&&this!==ot&&this instanceof o?s:e;++c<d;)g[c]=r[c];for(;l--;)g[c++]=arguments[++a];return fs(C,i?n:this,g)}return o}var xg=Cg,_u="__lodash_placeholder__",Ko=1,Ug=2,Mg=4,Tu=8,$r=128,wu=256,Dg=Math.min;function Lg(e,t){var n=e[1],r=t[1],i=n|r,s=i<(Ko|Ug|$r),o=r==$r&&n==Tu||r==$r&&n==wu&&e[7].length<=t[8]||r==($r|wu)&&t[7].length<=t[8]&&n==Tu;if(!(s||o))return e;r&Ko&&(e[2]=t[2],i|=n&Ko?0:Mg);var a=t[3];if(a){var l=e[3];e[3]=l?Nc(l,a,t[4]):a,e[4]=l?Lr(e[3],_u):t[4]}return a=t[5],a&&(l=e[5],e[5]=l?$c(l,a,t[6]):a,e[6]=l?Lr(e[5],_u):t[6]),a=t[7],a&&(e[7]=a),r&$r&&(e[8]=e[8]==null?t[8]:Dg(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var Bg=Lg,jg="Expected a function",Ou=1,kg=2,Vo=8,Go=16,qo=32,Au=64,Iu=Math.max;function Fg(e,t,n,r,i,s,o,a){var l=t&kg;if(!l&&typeof e!="function")throw new TypeError(jg);var c=r?r.length:0;if(c||(t&=~(qo|Au),r=i=void 0),o=o===void 0?o:Iu(pu(o),0),a=a===void 0?a:pu(a),c-=i?i.length:0,t&Au){var d=r,g=i;r=i=void 0}var C=l?void 0:xc(e),E=[e,t,n,r,i,d,g,s,o,a];if(C&&Bg(E,C),e=E[0],t=E[1],n=E[2],r=E[3],i=E[4],a=E[9]=E[9]===void 0?l?0:e.length:Iu(E[9]-c,0),!a&&t&(Vo|Go)&&(t&=~(Vo|Go)),!t||t==Ou)var D=Yy(e,t,n);else t==Vo||t==Go?D=Ng(e,t,a):(t==qo||t==(Ou|qo))&&!i.length?D=xg(e,t,n,r):D=Fc.apply(void 0,E);var V=C?Rc:Dc;return Bc(V(D,E),e,t)}var Kg=Fg;function Vg(e,t,n){t=="__proto__"&&Ui?Ui(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Gg=Vg;function qg(e,t){return e===t||e!==e&&t!==t}var gs=qg,Wg=Object.prototype,zg=Wg.hasOwnProperty;function Hg(e,t,n){var r=e[t];(!(zg.call(e,t)&&gs(r,n))||n===void 0&&!(t in e))&&Gg(e,t,n)}var Jg=Hg,Eu=Math.max;function Xg(e,t,n){return t=Eu(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=Eu(r.length-t,0),o=Array(s);++i<s;)o[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(o),fs(e,this,a)}}var Kc=Xg;function Yg(e,t){return ys(Kc(e,t,Wi),e+"")}var Vc=Yg,Qg=9007199254740991;function Zg(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Qg}var ms=Zg;function em(e){return e!=null&&ms(e.length)&&!Pc(e)}var Gc=em,tm=Object.prototype;function nm(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||tm;return e===n}var rm=nm;function im(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var om=im,sm="[object Arguments]";function am(e){return cn(e)&&ir(e)==sm}var Su=am,qc=Object.prototype,um=qc.hasOwnProperty,cm=qc.propertyIsEnumerable,lm=Su(function(){return arguments}())?Su:function(e){return cn(e)&&um.call(e,"callee")&&!cm.call(e,"callee")},vs=lm;function fm(){return!1}var dm=fm,Wc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Pu=Wc&&typeof module=="object"&&module&&!module.nodeType&&module,pm=Pu&&Pu.exports===Wc,Ru=pm?ot.Buffer:void 0,ym=Ru?Ru.isBuffer:void 0,hm=ym||dm,es=hm,gm="[object Arguments]",mm="[object Array]",vm="[object Boolean]",bm="[object Date]",_m="[object Error]",Tm="[object Function]",wm="[object Map]",Om="[object Number]",Am="[object Object]",Im="[object RegExp]",Em="[object Set]",Sm="[object String]",Pm="[object WeakMap]",Rm="[object ArrayBuffer]",Nm="[object DataView]",$m="[object Float32Array]",Cm="[object Float64Array]",xm="[object Int8Array]",Um="[object Int16Array]",Mm="[object Int32Array]",Dm="[object Uint8Array]",Lm="[object Uint8ClampedArray]",Bm="[object Uint16Array]",jm="[object Uint32Array]",$e={};$e[$m]=$e[Cm]=$e[xm]=$e[Um]=$e[Mm]=$e[Dm]=$e[Lm]=$e[Bm]=$e[jm]=!0;$e[gm]=$e[mm]=$e[Rm]=$e[vm]=$e[Nm]=$e[bm]=$e[_m]=$e[Tm]=$e[wm]=$e[Om]=$e[Am]=$e[Im]=$e[Em]=$e[Sm]=$e[Pm]=!1;function km(e){return cn(e)&&ms(e.length)&&!!$e[ir(e)]}var Fm=km;function Km(e){return function(t){return e(t)}}var zc=Km,Hc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ur=Hc&&typeof module=="object"&&module&&!module.nodeType&&module,Vm=Ur&&Ur.exports===Hc,Wo=Vm&&Ac.process,Gm=function(){try{var e=Ur&&Ur.require&&Ur.require("util").types;return e||Wo&&Wo.binding&&Wo.binding("util")}catch{}}(),Nu=Gm,$u=Nu&&Nu.isTypedArray,qm=$u?zc($u):Fm,Jc=qm,Wm=Object.prototype,zm=Wm.hasOwnProperty;function Hm(e,t){var n=Ct(e),r=!n&&vs(e),i=!n&&!r&&es(e),s=!n&&!r&&!i&&Jc(e),o=n||r||i||s,a=o?om(e.length,String):[],l=a.length;for(var c in e)(t||zm.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||zi(c,l)))&&a.push(c);return a}var Jm=Hm;function Xm(e,t){return function(n){return e(t(n))}}var Ym=Xm,Qm=Ym(Object.keys,Object),Zm=Qm,ev=Object.prototype,tv=ev.hasOwnProperty;function nv(e){if(!rm(e))return Zm(e);var t=[];for(var n in Object(e))tv.call(e,n)&&n!="constructor"&&t.push(n);return t}var rv=nv;function iv(e){return Gc(e)?Jm(e):rv(e)}var Xc=iv,ov=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sv=/^\w*$/;function av(e,t){if(Ct(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||tr(e)?!0:sv.test(e)||!ov.test(e)||t!=null&&e in Object(t)}var bs=av,uv=Cn(Object,"create"),Br=uv;function cv(){this.__data__=Br?Br(null):{},this.size=0}var lv=cv;function fv(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var dv=fv,pv="__lodash_hash_undefined__",yv=Object.prototype,hv=yv.hasOwnProperty;function gv(e){var t=this.__data__;if(Br){var n=t[e];return n===pv?void 0:n}return hv.call(t,e)?t[e]:void 0}var mv=gv,vv=Object.prototype,bv=vv.hasOwnProperty;function _v(e){var t=this.__data__;return Br?t[e]!==void 0:bv.call(t,e)}var Tv=_v,wv="__lodash_hash_undefined__";function Ov(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Br&&t===void 0?wv:t,this}var Av=Ov;function or(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])}}or.prototype.clear=lv;or.prototype.delete=dv;or.prototype.get=mv;or.prototype.has=Tv;or.prototype.set=Av;var Cu=or;function Iv(){this.__data__=[],this.size=0}var Ev=Iv;function Sv(e,t){for(var n=e.length;n--;)if(gs(e[n][0],t))return n;return-1}var Hi=Sv,Pv=Array.prototype,Rv=Pv.splice;function Nv(e){var t=this.__data__,n=Hi(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Rv.call(t,n,1),--this.size,!0}var $v=Nv;function Cv(e){var t=this.__data__,n=Hi(t,e);return n<0?void 0:t[n][1]}var xv=Cv;function Uv(e){return Hi(this.__data__,e)>-1}var Mv=Uv;function Dv(e,t){var n=this.__data__,r=Hi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Lv=Dv;function sr(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])}}sr.prototype.clear=Ev;sr.prototype.delete=$v;sr.prototype.get=xv;sr.prototype.has=Mv;sr.prototype.set=Lv;var Ji=sr,Bv=Cn(ot,"Map"),jr=Bv;function jv(){this.size=0,this.__data__={hash:new Cu,map:new(jr||Ji),string:new Cu}}var kv=jv;function Fv(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Kv=Fv;function Vv(e,t){var n=e.__data__;return Kv(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Xi=Vv;function Gv(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t}var qv=Gv;function Wv(e){return Xi(this,e).get(e)}var zv=Wv;function Hv(e){return Xi(this,e).has(e)}var Jv=Hv;function Xv(e,t){var n=Xi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var Yv=Xv;function ar(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])}}ar.prototype.clear=kv;ar.prototype.delete=qv;ar.prototype.get=zv;ar.prototype.has=Jv;ar.prototype.set=Yv;var Yi=ar,Qv="Expected a function";function _s(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Qv);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(_s.Cache||Yi),n}_s.Cache=Yi;var Zv=_s,eb=500;function tb(e){var t=Zv(e,function(r){return n.size===eb&&n.clear(),r}),n=t.cache;return t}var nb=tb,rb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ib=/\\(\\)?/g,ob=nb(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(rb,function(n,r,i,s){t.push(i?s.replace(ib,"$1"):r||n)}),t}),sb=ob;function ab(e){return e==null?"":ny(e)}var ub=ab;function cb(e,t){return Ct(e)?e:bs(e,t)?[e]:sb(ub(e))}var Qi=cb,lb=1/0;function fb(e){if(typeof e=="string"||tr(e))return e;var t=e+"";return t=="0"&&1/e==-lb?"-0":t}var Vr=fb;function db(e,t){t=Qi(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Vr(t[n++])];return n&&n==r?e:void 0}var Ts=db;function pb(e,t,n){var r=e==null?void 0:Ts(e,t);return r===void 0?n:r}var yb=pb;function hb(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Yc=hb,xu=Bt?Bt.isConcatSpreadable:void 0;function gb(e){return Ct(e)||vs(e)||!!(xu&&e&&e[xu])}var mb=gb;function Qc(e,t,n,r,i){var s=-1,o=e.length;for(n||(n=mb),i||(i=[]);++s<o;){var a=e[s];t>0&&n(a)?t>1?Qc(a,t-1,n,r,i):Yc(i,a):r||(i[i.length]=a)}return i}var vb=Qc;function bb(e){var t=e==null?0:e.length;return t?vb(e,1):[]}var _b=bb;function Tb(e){return ys(Kc(e,void 0,_b),e+"")}var wb=Tb;function Ob(){this.__data__=new Ji,this.size=0}var Ab=Ob;function Ib(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Eb=Ib;function Sb(e){return this.__data__.get(e)}var Pb=Sb;function Rb(e){return this.__data__.has(e)}var Nb=Rb,$b=200;function Cb(e,t){var n=this.__data__;if(n instanceof Ji){var r=n.__data__;if(!jr||r.length<$b-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Yi(r)}return n.set(e,t),this.size=n.size,this}var xb=Cb;function ur(e){var t=this.__data__=new Ji(e);this.size=t.size}ur.prototype.clear=Ab;ur.prototype.delete=Eb;ur.prototype.get=Pb;ur.prototype.has=Nb;ur.prototype.set=xb;var Ai=ur;function Ub(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}var Mb=Ub;function Db(){return[]}var Lb=Db,Bb=Object.prototype,jb=Bb.propertyIsEnumerable,Uu=Object.getOwnPropertySymbols,kb=Uu?function(e){return e==null?[]:(e=Object(e),Mb(Uu(e),function(t){return jb.call(e,t)}))}:Lb,Fb=kb;function Kb(e,t,n){var r=t(e);return Ct(e)?r:Yc(r,n(e))}var Vb=Kb;function Gb(e){return Vb(e,Xc,Fb)}var Mu=Gb,qb=Cn(ot,"DataView"),ts=qb,Wb=Cn(ot,"Promise"),ns=Wb,zb=Cn(ot,"Set"),er=zb,Du="[object Map]",Hb="[object Object]",Lu="[object Promise]",Bu="[object Set]",ju="[object WeakMap]",ku="[object DataView]",Jb=$n(ts),Xb=$n(jr),Yb=$n(ns),Qb=$n(er),Zb=$n(Mr),Pn=ir;(ts&&Pn(new ts(new ArrayBuffer(1)))!=ku||jr&&Pn(new jr)!=Du||ns&&Pn(ns.resolve())!=Lu||er&&Pn(new er)!=Bu||Mr&&Pn(new Mr)!=ju)&&(Pn=function(e){var t=ir(e),n=t==Hb?e.constructor:void 0,r=n?$n(n):"";if(r)switch(r){case Jb:return ku;case Xb:return Du;case Yb:return Lu;case Qb:return Bu;case Zb:return ju}return t});var Fu=Pn,e_=ot.Uint8Array,Ku=e_,t_="__lodash_hash_undefined__";function n_(e){return this.__data__.set(e,t_),this}var r_=n_;function i_(e){return this.__data__.has(e)}var o_=i_;function Mi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Yi;++t<n;)this.add(e[t])}Mi.prototype.add=Mi.prototype.push=r_;Mi.prototype.has=o_;var Zc=Mi;function s_(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 a_=s_;function u_(e,t){return e.has(t)}var el=u_,c_=1,l_=2;function f_(e,t,n,r,i,s){var o=n&c_,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var g=-1,C=!0,E=n&l_?new Zc:void 0;for(s.set(e,t),s.set(t,e);++g<a;){var D=e[g],V=t[g];if(r)var Y=o?r(V,D,g,t,e,s):r(D,V,g,e,t,s);if(Y!==void 0){if(Y)continue;C=!1;break}if(E){if(!a_(t,function(F,j){if(!el(E,j)&&(D===F||i(D,F,n,r,s)))return E.push(j)})){C=!1;break}}else if(!(D===V||i(D,V,n,r,s))){C=!1;break}}return s.delete(e),s.delete(t),C}var tl=f_;function d_(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var p_=d_;function y_(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var nl=y_,h_=1,g_=2,m_="[object Boolean]",v_="[object Date]",b_="[object Error]",__="[object Map]",T_="[object Number]",w_="[object RegExp]",O_="[object Set]",A_="[object String]",I_="[object Symbol]",E_="[object ArrayBuffer]",S_="[object DataView]",Vu=Bt?Bt.prototype:void 0,zo=Vu?Vu.valueOf:void 0;function P_(e,t,n,r,i,s,o){switch(n){case S_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E_:return!(e.byteLength!=t.byteLength||!s(new Ku(e),new Ku(t)));case m_:case v_:case T_:return gs(+e,+t);case b_:return e.name==t.name&&e.message==t.message;case w_:case A_:return e==t+"";case __:var a=p_;case O_:var l=r&h_;if(a||(a=nl),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;r|=g_,o.set(e,t);var d=tl(a(e),a(t),r,i,s,o);return o.delete(e),d;case I_:if(zo)return zo.call(e)==zo.call(t)}return!1}var R_=P_,N_=1,$_=Object.prototype,C_=$_.hasOwnProperty;function x_(e,t,n,r,i,s){var o=n&N_,a=Mu(e),l=a.length,c=Mu(t),d=c.length;if(l!=d&&!o)return!1;for(var g=l;g--;){var C=a[g];if(!(o?C in t:C_.call(t,C)))return!1}var E=s.get(e),D=s.get(t);if(E&&D)return E==t&&D==e;var V=!0;s.set(e,t),s.set(t,e);for(var Y=o;++g<l;){C=a[g];var F=e[C],j=t[C];if(r)var q=o?r(j,F,C,t,e,s):r(F,j,C,e,t,s);if(!(q===void 0?F===j||i(F,j,n,r,s):q)){V=!1;break}Y||(Y=C=="constructor")}if(V&&!Y){var z=e.constructor,k=t.constructor;z!=k&&"constructor"in e&&"constructor"in t&&!(typeof z=="function"&&z instanceof z&&typeof k=="function"&&k instanceof k)&&(V=!1)}return s.delete(e),s.delete(t),V}var U_=x_,M_=1,Gu="[object Arguments]",qu="[object Array]",Oi="[object Object]",D_=Object.prototype,Wu=D_.hasOwnProperty;function L_(e,t,n,r,i,s){var o=Ct(e),a=Ct(t),l=o?qu:Fu(e),c=a?qu:Fu(t);l=l==Gu?Oi:l,c=c==Gu?Oi:c;var d=l==Oi,g=c==Oi,C=l==c;if(C&&es(e)){if(!es(t))return!1;o=!0,d=!1}if(C&&!d)return s||(s=new Ai),o||Jc(e)?tl(e,t,n,r,i,s):R_(e,t,l,n,r,i,s);if(!(n&M_)){var E=d&&Wu.call(e,"__wrapped__"),D=g&&Wu.call(t,"__wrapped__");if(E||D){var V=E?e.value():e,Y=D?t.value():t;return s||(s=new Ai),i(V,Y,n,r,s)}}return C?(s||(s=new Ai),U_(e,t,n,r,i,s)):!1}var B_=L_;function rl(e,t,n,r,i){return e===t?!0:e==null||t==null||!cn(e)&&!cn(t)?e!==e&&t!==t:B_(e,t,n,r,rl,i)}var il=rl,j_=1,k_=2;function F_(e,t,n,r){var i=n.length,s=i,o=!r;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var l=a[0],c=e[l],d=a[1];if(o&&a[2]){if(c===void 0&&!(l in e))return!1}else{var g=new Ai;if(r)var C=r(c,d,l,e,t,g);if(!(C===void 0?il(d,c,j_|k_,r,g):C))return!1}}return!0}var K_=F_;function V_(e){return e===e&&!Ht(e)}var ol=V_;function G_(e){for(var t=Xc(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ol(i)]}return t}var q_=G_;function W_(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var sl=W_;function z_(e){var t=q_(e);return t.length==1&&t[0][2]?sl(t[0][0],t[0][1]):function(n){return n===e||K_(n,e,t)}}var H_=z_;function J_(e,t){return e!=null&&t in Object(e)}var X_=J_;function Y_(e,t,n){t=Qi(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var o=Vr(t[r]);if(!(s=e!=null&&n(e,o)))break;e=e[o]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&ms(i)&&zi(o,i)&&(Ct(e)||vs(e)))}var Q_=Y_;function Z_(e,t){return e!=null&&Q_(e,t,X_)}var al=Z_,eT=1,tT=2;function nT(e,t){return bs(e)&&ol(t)?sl(Vr(e),t):function(n){var r=yb(n,e);return r===void 0&&r===t?al(n,e):il(t,r,eT|tT)}}var rT=nT;function iT(e){return function(t){return t?.[e]}}var oT=iT;function sT(e){return function(t){return Ts(t,e)}}var aT=sT;function uT(e){return bs(e)?oT(Vr(e)):aT(e)}var cT=uT;function lT(e){return typeof e=="function"?e:e==null?Wi:typeof e=="object"?Ct(e)?rT(e[0],e[1]):H_(e):cT(e)}var fT=lT;function dT(e){return cn(e)&&Gc(e)}var pT=dT;function yT(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 hT=yT,gT=200;function mT(e,t,n,r){var i=-1,s=Lc,o=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Ec(t,zc(n))),r?(s=hT,o=!1):t.length>=gT&&(s=el,o=!1,t=new Zc(t));e:for(;++i<a;){var d=e[i],g=n==null?d:n(d);if(d=r||d!==0?d:0,o&&g===g){for(var C=c;C--;)if(t[C]===g)continue e;l.push(d)}else s(t,g,r)||l.push(d)}return l}var vT=mT;function bT(e,t,n,r){if(!Ht(e))return e;t=Qi(t,e);for(var i=-1,s=t.length,o=s-1,a=e;a!=null&&++i<s;){var l=Vr(t[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=o){var d=a[l];c=r?r(d,l,a):void 0,c===void 0&&(c=Ht(d)?d:zi(t[i+1])?[]:{})}Jg(a,l,c),a=a[l]}return e}var _T=bT;function TT(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var o=t[r],a=Ts(e,o);n(a,o)&&_T(s,Qi(o,e),a)}return s}var wT=TT,OT=32,ws=Vc(function(e,t){var n=Lr(t,hs(ws));return Kg(e,OT,void 0,t,n)});ws.placeholder={};var AT=ws;function IT(e,t){return wT(e,t,function(n,r){return al(e,r)})}var ET=IT,ST=wb(function(e,t){return e==null?{}:ET(e,t)}),zu=ST,PT=4294967295,RT=PT-1,NT=Math.floor,$T=Math.min;function CT(e,t,n,r){var i=0,s=e==null?0:e.length;if(s===0)return 0;t=n(t);for(var o=t!==t,a=t===null,l=tr(t),c=t===void 0;i<s;){var d=NT((i+s)/2),g=n(e[d]),C=g!==void 0,E=g===null,D=g===g,V=tr(g);if(o)var Y=r||D;else c?Y=D&&(r||C):a?Y=D&&C&&(r||!E):l?Y=D&&C&&!E&&(r||!V):E||V?Y=!1:Y=r?g<=t:g<t;Y?i=d+1:s=d}return $T(s,RT)}var xT=CT;function UT(e,t,n){return xT(e,t,fT(n,2))}var MT=UT,DT=1/0,jA=er&&1/nl(new er([,-0]))[1]==DT?function(e){return new er(e)}:Cc;var LT=Vc(function(e,t){return pT(e)?vT(e,t):[]}),Hu=LT,ul=vt(Sp(),1),kA=ul.default.configure,Nn=ul.default,Ho=100,{WARN:BT,LOG:FA,DEBUG:ke,VERBOSE:ve,ERROR:KA}=Ae.setup(Ae.INFO),Di=Pe.set();Ja({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var Ke=({caller:e,thread:t,pattern:n,args:r})=>Se(()=>(r=r||n,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${r?`{${typeof r=="string"?r:Nn(r)}}`:""}`));function cl(e,t){return Se(()=>Le.structural(e.get(),t.get()))}function cr(e,t){return Le.shallow(e.applogs,t.applogs)}function Zi(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(ve.isEnabled&&ve("queryNodesComparer",n,r,i),!Le.structural(r.variables,i.variables))return ve.isEnabled&&ve("[queryNodesComparer] changed vars:",n,r,i),!1;if(!cr(r.logsOfThisNode,i.logsOfThisNode))return ve.isEnabled&&ve("[queryNodesComparer] changed logsOfThisNode:",n,r,i),!1}return ve.isEnabled&&ve("[queryNodesComparer] equal:",{a:e,b:t}),!0}var jT=0;function jt(e,{name:t,equals:n}={}){let r=`observableArrayMap@${++jT}{${t}}`;ve.isEnabled&&ve(`[${r}] create`,{fnname:e.name,fn:e,name:t,equals:n});let i,s=fl(e,a=>{i?Se(()=>(n??Le.structural)(i,a))?ke.isEnabled&&ke(`[${r}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),ke.isEnabled&&ke(`[${r}] updated`,{updatedItems:a,observableArr:i})):i=Pe.array(a,{deep:!1,name:t,equals:n})},{name:r});if(r.includes("useRoots")){var o=ht(i);ke(`[${r}] deps`,{disposeAutorun:s,rootsAtom:o,observableArr:i,observers:Sr(i)}),Jn(()=>Di.add(o))}return ve.isEnabled&&Xn(i,()=>{ve(`[${r}] observed`,Sr(i),{rootsAtom:o,observableArr:i})}),An(i,()=>{ve.isEnabled&&ve(`[${r}] dispose`),o&&Jn(()=>Di.delete(o)),s()}),i}var kT=0;function ll(e,{name:t}={}){let n=`observableSetMap@${++kT}{${t}}`;ve.isEnabled&&ve(`[${n}] create`,{fnname:e.name,fn:e,name:t});let r,i=fl(e,o=>{if(!r)r=Pe.set(o,{deep:!1,name:t});else{let{deleted:a,added:l}=Se(()=>{let c=new Set(r.values()),d=new Set;for(let g of o)r.has(g)?(ve.isEnabled&&ve(`[${n}] unchanged`,g,{updatedItems:o,observableSet:r}),c.delete(g)):d.add(g);return ke.isEnabled&&ke(`[${n}] updated:`,{unseen:c,added:d,updatedItems:o,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 s=ht(r);ke.isEnabled&&ke(`[${n}] deps`,{disposeAutorun:i,rootsAtom:s,observableSet:r,observers:Sr(r)}),Jn(()=>Di.add(s))}return ve.isEnabled&&Xn(r,()=>{ve(`[${n}] observed`,Sr(r),{rootsAtom:s,observableSet:r})}),An(r,()=>{ve.isEnabled&&ve(`[${n}] dispose`),s&&Jn(()=>Di.delete(s)),i()}),r}function fl(e,t=null,{name:n}={}){ke.isEnabled&&ke("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:n});let r=`${n}.autorunImm`,i,s=new Pt(r,function(...c){ke.isEnabled&&ke(`[${r}] reaction.invalidate`,c),o()});function o(){s.track(function(){let c=Ho&&performance.now();ke.isEnabled&&ke(`[${r}] runAndTrack:`,{name:n??e.name,fn:e}),i=e(),ke.isEnabled&&ke(`[${r}] runAndTrack =>`,i),Jn(()=>{t?.(i)}),Ho&&performance.now()-c>Ho&&BT(`[${r}] took ${performance.now()-c}ms`)})}return o(),ke.isEnabled&&ke(`[${r}] deps of reaction`,{reaction:s,result:i,deps:Er(s)}),()=>{ve.isEnabled&&ve(`[${r}] dispose`),setTimeout(()=>s.dispose())}}function qe(e,t,n=!1){if(en(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let r=!1,i=0,s=typeof n=="boolean"?{keepAlive:n}:n,o=new Map;return function(...a){let l,c=Se(()=>{let E=a;for(let D=0;D<a.length;D++)a[D]instanceof nr&&a===E&&(E=a.slice());return E}),d=`computedFnDeepCompare(${e||t.name}#${++i})${s.argsDebugName?`{${s.argsDebugName(...a)}}`:""}`;for(let[E,D]of o.entries())if(KT(E,c)){l=D;break}else if(ve.isEnabled)for(let V=0;V<E.length;V++)E[V]instanceof nr&&E[V].name===a[V].name&&Le.structural(Hu(E,E[V]),Hu(c,c[V]))&&ve.force(`[${d}] threadState mismatch => cachebust`,{diffFields:Object.keys(E[V]).filter(Y=>!Le.structural(E[V][Y],a[V][Y])),cacheArg:E[V],freshArg:a[V]});if(l){let E=l.get();return ve.isEnabled&&ve(`[${d}] cache hit`,{untrackedArgs:c,cachedResult:E}),E}if(!s.keepAlive&&!$a())return!r&&Ma().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);ve.isEnabled&&ve(`[${d}] new computation`,{untrackedArgs:c});let g,C=Ce(()=>(ve.isEnabled&&ve(`[${d}] update->rerun`,Se(()=>({args:a})),t),ve.isEnabled&&Co(),g=t.apply(this,a)),{...s,name:d});if(ve.isEnabled&&ve(`[${d}] deps`,Er(C),{untrackedArgs:c}),o.set(c,C),!s.keepAlive){let E=An(C,()=>{ve.isEnabled&&ve(`[${d}] dispose`,C),E(),o.delete(c),s.onCleanup&&s.onCleanup(g,...a),g=void 0})}return C.get()}}function FT(e){let t=0,n="",r=0;for(let i=0;i<e.length;i++){let s=e[i];s==="("?n+=s+`
|
|
57
|
-
`+" ".repeat(++t):
|
|
58
|
-
`+" ".repeat(--t)+
|
|
59
|
-
`+" ".repeat(t):
|
|
60
|
-
`+" ".repeat(t+1)):
|
|
61
|
-
`+" ".repeat(t)+s):s==="{"&&r>0?(r++,n+=s):(s==="}"&&r>1&&r--,n+=s)}return n}function KT(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]instanceof nr){if(t[n]!==e[n])return!1}else if(!Le.structural(e[n],t[n]))return!1;return!0}var{WARN:Ju,LOG:VA,DEBUG:VT,VERBOSE:GA,ERROR:En}=Ae.setup(Ae.INFO,{prefix:"[thread]"});function Jt(e){return e.init!==void 0}var nr=class{constructor(e,t,n,r=[],i={}){this.name=e,this._applogs=r,this.parents=t===null?null:au(t),this.filters=n,Se(()=>this.parents?.length===0)&&Ju("[Thread] empty parents array",e),i.skipObservable||rn(this,{applogsCids:Ce,applogsByCid:Ce,insert:Qe,size:Ce,isEmpty:Ce,firstLog:Ce,latestLog:Ce},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw En("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw En("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw En("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw En("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw En("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw En("[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):Ju("unsubscribe called for non-existent",e)}notifySubscribers(e){VT(`[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 En("[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 Se(()=>this.size)}get nameAndSizeUntracked(){return Se(()=>`${this.name} (${this.size})`)}get prettyName(){return FT(this.name)}get hasParents(){return!!this.parents?.length}};var dl=class pl extends nr{static fromArray(t,n){return new pl(n||"static",null,[],t)}constructor(t,n,r,i){super(t,n,r,i,{skipObservable:!0})}get readOnly(){return!0}},yl={};jo(yl,{code:()=>Ul,decode:()=>js,encode:()=>Bs,format:()=>sc,name:()=>Q0,parse:()=>eO,stringify:()=>sc});var GT=["string","number","bigint","symbol"],qT=["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 WT(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(GT.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(zT(e))return"Buffer";let n=HT(e);return n||"Object"}function zT(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function HT(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(qT.includes(t))return t}var $=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}};$.uint=new $(0,"uint",!0);$.negint=new $(1,"negint",!0);$.bytes=new $(2,"bytes",!0);$.string=new $(3,"string",!0);$.array=new $(4,"array",!1);$.map=new $(5,"map",!1);$.tag=new $(6,"tag",!1);$.float=new $(7,"float",!0);$.false=new $(7,"false",!0);$.true=new $(7,"true",!0);$.null=new $(7,"null",!0);$.undefined=new $(7,"undefined",!0);$.break=new $(7,"break",!0);var Z=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}`}},lr=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",JT=new TextDecoder,XT=new TextEncoder;function Li(e){return lr&&globalThis.Buffer.isBuffer(e)}function Os(e){return e instanceof Uint8Array?Li(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var YT=lr?(e,t,n)=>n-t>64?globalThis.Buffer.from(e.subarray(t,n)).toString("utf8"):Yu(e,t,n):(e,t,n)=>n-t>64?JT.decode(e.subarray(t,n)):Yu(e,t,n),hl=lr?e=>e.length>64?globalThis.Buffer.from(e):Xu(e):e=>e.length>64?XT.encode(e):Xu(e);var As=lr?(e,t,n)=>Li(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n):(e,t,n)=>e.slice(t,n),QT=lr?(e,t)=>(e=e.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),Os(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},ZT=lr?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function ew(e,t){if(Li(e)&&Li(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 Xu(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 Yu(e,t,n){let r=[];for(;t<n;){let i=e[t],s=null,o=i>239?4:i>223?3:i>191?2:1;if(t+o<=n){let a,l,c,d;switch(o){case 1:i<128&&(s=i);break;case 2:a=e[t+1],(a&192)===128&&(d=(i&31)<<6|a&63,d>127&&(s=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)&&(s=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&&(s=d))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),t+=o}return gl(r)}var Qu=4096;function gl(e){let t=e.length;if(t<=Qu)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Qu));return n}var tw=256,ml=class{constructor(e=tw){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=ZT(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=As(n,0,this.cursor)}else t=QT(this.chunks,this.cursor);return e&&this.reset(),t}},de="CBOR decode error:",Rn="CBOR encode error:",Gr=[];Gr[23]=1;Gr[24]=2;Gr[25]=3;Gr[26]=5;Gr[27]=9;function fr(e,t,n){if(e.length-t<n)throw new Error(`${de} not enough data for type`)}var Ge=[24,256,65536,4294967296,BigInt("18446744073709551616")];function xn(e,t,n){fr(e,t,1);let r=e[t];if(n.strict===!0&&r<Ge[0])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return r}function Un(e,t,n){fr(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<Ge[1])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return r}function Mn(e,t,n){fr(e,t,4);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(n.strict===!0&&r<Ge[2])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return r}function Dn(e,t,n){fr(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],s=(BigInt(r)<<BigInt(32))+BigInt(i);if(n.strict===!0&&s<Ge[3])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(n.allowBigInt===!0)return s;throw new Error(`${de} integers outside of the safe integer range are not supported`)}function nw(e,t,n,r){return new Z($.uint,xn(e,t+1,r),2)}function rw(e,t,n,r){return new Z($.uint,Un(e,t+1,r),3)}function iw(e,t,n,r){return new Z($.uint,Mn(e,t+1,r),5)}function ow(e,t,n,r){return new Z($.uint,Dn(e,t+1,r),9)}function Ln(e,t){return Tt(e,0,t.value)}function Tt(e,t,n){if(n<Ge[0]){let r=Number(n);e.push([t|r])}else if(n<Ge[1]){let r=Number(n);e.push([t|24,r])}else if(n<Ge[2]){let r=Number(n);e.push([t|25,r>>>8,r&255])}else if(n<Ge[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<Ge[4]){let i=[t|27,0,0,0,0,0,0,0],s=Number(r&BigInt(4294967295)),o=Number(r>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,e.push(i)}else throw new Error(`${de} encountered BigInt larger than allowable range`)}}Ln.encodedSize=function(t){return Tt.encodedSize(t.value)};Tt.encodedSize=function(t){return t<Ge[0]?1:t<Ge[1]?2:t<Ge[2]?3:t<Ge[3]?5:9};Ln.compareTokens=function(t,n){return t.value<n.value?-1:t.value>n.value?1:0};function sw(e,t,n,r){return new Z($.negint,-1-xn(e,t+1,r),2)}function aw(e,t,n,r){return new Z($.negint,-1-Un(e,t+1,r),3)}function uw(e,t,n,r){return new Z($.negint,-1-Mn(e,t+1,r),5)}var Is=BigInt(-1),vl=BigInt(1);function cw(e,t,n,r){let i=Dn(e,t+1,r);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new Z($.negint,s,9)}if(r.allowBigInt!==!0)throw new Error(`${de} integers outside of the safe integer range are not supported`);return new Z($.negint,Is-BigInt(i),9)}function Es(e,t){let n=t.value,r=typeof n=="bigint"?n*Is-vl:n*-1-1;Tt(e,t.type.majorEncoded,r)}Es.encodedSize=function(t){let n=t.value,r=typeof n=="bigint"?n*Is-vl:n*-1-1;return r<Ge[0]?1:r<Ge[1]?2:r<Ge[2]?3:r<Ge[3]?5:9};Es.compareTokens=function(t,n){return t.value<n.value?1:t.value>n.value?-1:0};function qr(e,t,n,r){fr(e,t,n+r);let i=As(e,t+n,t+n+r);return new Z($.bytes,i,n+r)}function lw(e,t,n,r){return qr(e,t,1,n)}function fw(e,t,n,r){return qr(e,t,2,xn(e,t+1,r))}function dw(e,t,n,r){return qr(e,t,3,Un(e,t+1,r))}function pw(e,t,n,r){return qr(e,t,5,Mn(e,t+1,r))}function yw(e,t,n,r){let i=Dn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer bytes lengths not supported`);return qr(e,t,9,i)}function Bi(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===$.string?hl(e.value):e.value),e.encodedBytes}function eo(e,t){let n=Bi(t);Tt(e,t.type.majorEncoded,n.length),e.push(n)}eo.encodedSize=function(t){let n=Bi(t);return Tt.encodedSize(n.length)+n.length};eo.compareTokens=function(t,n){return hw(Bi(t),Bi(n))};function hw(e,t){return e.length<t.length?-1:e.length>t.length?1:ew(e,t)}function Wr(e,t,n,r,i){let s=n+r;fr(e,t,s);let o=new Z($.string,YT(e,t+n,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=As(e,t+n,t+s)),o}function gw(e,t,n,r){return Wr(e,t,1,n,r)}function mw(e,t,n,r){return Wr(e,t,2,xn(e,t+1,r),r)}function vw(e,t,n,r){return Wr(e,t,3,Un(e,t+1,r),r)}function bw(e,t,n,r){return Wr(e,t,5,Mn(e,t+1,r),r)}function _w(e,t,n,r){let i=Dn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer string lengths not supported`);return Wr(e,t,9,i,r)}var Tw=eo;function dr(e,t,n,r){return new Z($.array,r,n)}function ww(e,t,n,r){return dr(e,t,1,n)}function Ow(e,t,n,r){return dr(e,t,2,xn(e,t+1,r))}function Aw(e,t,n,r){return dr(e,t,3,Un(e,t+1,r))}function Iw(e,t,n,r){return dr(e,t,5,Mn(e,t+1,r))}function Ew(e,t,n,r){let i=Dn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer array lengths not supported`);return dr(e,t,9,i)}function Sw(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return dr(e,t,1,1/0)}function Ss(e,t){Tt(e,$.array.majorEncoded,t.value)}Ss.compareTokens=Ln.compareTokens;Ss.encodedSize=function(t){return Tt.encodedSize(t.value)};function pr(e,t,n,r){return new Z($.map,r,n)}function Pw(e,t,n,r){return pr(e,t,1,n)}function Rw(e,t,n,r){return pr(e,t,2,xn(e,t+1,r))}function Nw(e,t,n,r){return pr(e,t,3,Un(e,t+1,r))}function $w(e,t,n,r){return pr(e,t,5,Mn(e,t+1,r))}function Cw(e,t,n,r){let i=Dn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer map lengths not supported`);return pr(e,t,9,i)}function xw(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return pr(e,t,1,1/0)}function Ps(e,t){Tt(e,$.map.majorEncoded,t.value)}Ps.compareTokens=Ln.compareTokens;Ps.encodedSize=function(t){return Tt.encodedSize(t.value)};function Uw(e,t,n,r){return new Z($.tag,n,1)}function Mw(e,t,n,r){return new Z($.tag,xn(e,t+1,r),2)}function Dw(e,t,n,r){return new Z($.tag,Un(e,t+1,r),3)}function Lw(e,t,n,r){return new Z($.tag,Mn(e,t+1,r),5)}function Bw(e,t,n,r){return new Z($.tag,Dn(e,t+1,r),9)}function Rs(e,t){Tt(e,$.tag.majorEncoded,t.value)}Rs.compareTokens=Ln.compareTokens;Rs.encodedSize=function(t){return Tt.encodedSize(t.value)};var jw=20,kw=21,Fw=22,Kw=23;function Vw(e,t,n,r){if(r.allowUndefined===!1)throw new Error(`${de} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new Z($.null,null,1):new Z($.undefined,void 0,1)}function Gw(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return new Z($.break,void 0,1)}function Ns(e,t,n){if(n){if(n.allowNaN===!1&&Number.isNaN(e))throw new Error(`${de} NaN values are not supported`);if(n.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${de} Infinity values are not supported`)}return new Z($.float,e,t)}function qw(e,t,n,r){return Ns(Cs(e,t+1),3,r)}function Ww(e,t,n,r){return Ns(xs(e,t+1),5,r)}function zw(e,t,n,r){return Ns(wl(e,t+1),9,r)}function $s(e,t,n){let r=t.value;if(r===!1)e.push([$.float.majorEncoded|jw]);else if(r===!0)e.push([$.float.majorEncoded|kw]);else if(r===null)e.push([$.float.majorEncoded|Fw]);else if(r===void 0)e.push([$.float.majorEncoded|Kw]);else{let i,s=!1;(!n||n.float64!==!0)&&(_l(r),i=Cs($t,1),r===i||Number.isNaN(r)?($t[0]=249,e.push($t.slice(0,3)),s=!0):(Tl(r),i=xs($t,1),r===i&&($t[0]=250,e.push($t.slice(0,5)),s=!0))),s||(Hw(r),i=wl($t,1),$t[0]=251,e.push($t.slice(0,9)))}}$s.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){_l(r);let i=Cs($t,1);if(r===i||Number.isNaN(r))return 3;if(Tl(r),i=xs($t,1),r===i)return 5}return 9};var bl=new ArrayBuffer(9),bt=new DataView(bl,1),$t=new Uint8Array(bl,0);function _l(e){if(e===1/0)bt.setUint16(0,31744,!1);else if(e===-1/0)bt.setUint16(0,64512,!1);else if(Number.isNaN(e))bt.setUint16(0,32256,!1);else{bt.setFloat32(0,e);let t=bt.getUint32(0),n=(t&2139095040)>>23,r=t&8388607;if(n===255)bt.setUint16(0,31744,!1);else if(n===0)bt.setUint16(0,(e&2147483648)>>16|r>>13,!1);else{let i=n-127;i<-24?bt.setUint16(0,0):i<-14?bt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):bt.setUint16(0,(t&2147483648)>>16|i+15<<10|r>>13,!1)}}}function Cs(e,t){if(e.length-t<2)throw new Error(`${de} 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,s;return r===0?s=i*2**-24:r!==31?s=(i+1024)*2**(r-25):s=i===0?1/0:NaN,n&32768?-s:s}function Tl(e){bt.setFloat32(0,e,!1)}function xs(e,t){if(e.length-t<4)throw new Error(`${de} not enough data for float32`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,4).getFloat32(0,!1)}function Hw(e){bt.setFloat64(0,e,!1)}function wl(e,t){if(e.length-t<8)throw new Error(`${de} not enough data for float64`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,8).getFloat64(0,!1)}$s.compareTokens=Ln.compareTokens;function we(e,t,n){throw new Error(`${de} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function to(e){return()=>{throw new Error(`${de} ${e}`)}}var oe=[];for(let e=0;e<=23;e++)oe[e]=we;oe[24]=nw;oe[25]=rw;oe[26]=iw;oe[27]=ow;oe[28]=we;oe[29]=we;oe[30]=we;oe[31]=we;for(let e=32;e<=55;e++)oe[e]=we;oe[56]=sw;oe[57]=aw;oe[58]=uw;oe[59]=cw;oe[60]=we;oe[61]=we;oe[62]=we;oe[63]=we;for(let e=64;e<=87;e++)oe[e]=lw;oe[88]=fw;oe[89]=dw;oe[90]=pw;oe[91]=yw;oe[92]=we;oe[93]=we;oe[94]=we;oe[95]=to("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)oe[e]=gw;oe[120]=mw;oe[121]=vw;oe[122]=bw;oe[123]=_w;oe[124]=we;oe[125]=we;oe[126]=we;oe[127]=to("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)oe[e]=ww;oe[152]=Ow;oe[153]=Aw;oe[154]=Iw;oe[155]=Ew;oe[156]=we;oe[157]=we;oe[158]=we;oe[159]=Sw;for(let e=160;e<=183;e++)oe[e]=Pw;oe[184]=Rw;oe[185]=Nw;oe[186]=$w;oe[187]=Cw;oe[188]=we;oe[189]=we;oe[190]=we;oe[191]=xw;for(let e=192;e<=215;e++)oe[e]=Uw;oe[216]=Mw;oe[217]=Dw;oe[218]=Lw;oe[219]=Bw;oe[220]=we;oe[221]=we;oe[222]=we;oe[223]=we;for(let e=224;e<=243;e++)oe[e]=to("simple values are not supported");oe[244]=we;oe[245]=we;oe[246]=we;oe[247]=Vw;oe[248]=to("simple values are not supported");oe[249]=qw;oe[250]=Ww;oe[251]=zw;oe[252]=we;oe[253]=we;oe[254]=we;oe[255]=Gw;var kt=[];for(let e=0;e<24;e++)kt[e]=new Z($.uint,e,1);for(let e=-1;e>=-24;e--)kt[31-e]=new Z($.negint,e,1);kt[64]=new Z($.bytes,new Uint8Array(0),1);kt[96]=new Z($.string,"",1);kt[128]=new Z($.array,0,1);kt[160]=new Z($.map,0,1);kt[244]=new Z($.false,!1,1);kt[245]=new Z($.true,!0,1);kt[246]=new Z($.null,null,1);function Us(){let e=[];return e[$.uint.major]=Ln,e[$.negint.major]=Es,e[$.bytes.major]=eo,e[$.string.major]=Tw,e[$.array.major]=Ss,e[$.map.major]=Ps,e[$.tag.major]=Rs,e[$.float.major]=$s,e}var qA=Us(),Jo=new ml,Zu=class Ol{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(`${Rn} object contains circular references`);return new Ol(n,t)}},on={null:new Z($.null,null),undefined:new Z($.undefined,void 0),true:new Z($.true,!0),false:new Z($.false,!1),emptyArray:new Z($.array,0),emptyMap:new Z($.map,0)},ln={number(e,t,n,r){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new Z($.float,e):e>=0?new Z($.uint,e):new Z($.negint,e)},bigint(e,t,n,r){return e>=BigInt(0)?new Z($.uint,e):new Z($.negint,e)},Uint8Array(e,t,n,r){return new Z($.bytes,e)},string(e,t,n,r){return new Z($.string,e)},boolean(e,t,n,r){return e?on.true:on.false},null(e,t,n,r){return on.null},undefined(e,t,n,r){return on.undefined},ArrayBuffer(e,t,n,r){return new Z($.bytes,new Uint8Array(e))},DataView(e,t,n,r){return new Z($.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,n,r){if(!e.length)return n.addBreakTokens===!0?[on.emptyArray,new Z($.break)]:on.emptyArray;r=Zu.createCheck(r,e);let i=[],s=0;for(let o of e)i[s++]=Ii(o,n,r);return n.addBreakTokens?[new Z($.array,e.length),i,new Z($.break)]:[new Z($.array,e.length),i]},Object(e,t,n,r){let i=t!=="Object",s=i?e.keys():Object.keys(e),o=i?e.size:s.length;if(!o)return n.addBreakTokens===!0?[on.emptyMap,new Z($.break)]:on.emptyMap;r=Zu.createCheck(r,e);let a=[],l=0;for(let c of s)a[l++]=[Ii(c,n,r),Ii(i?e.get(c):e[c],n,r)];return Jw(a,n),n.addBreakTokens?[new Z($.map,o),a,new Z($.break)]:[new Z($.map,o),a]}};ln.Map=ln.Object;ln.Buffer=ln.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))ln[`${e}Array`]=ln.DataView;function Ii(e,t={},n){let r=WT(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||ln[r];if(typeof i=="function"){let o=i(e,r,t,n);if(o!=null)return o}let s=ln[r];if(!s)throw new Error(`${Rn} unsupported type: ${r}`);return s(e,r,t,n)}function Jw(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Al(e,t,n,r){if(Array.isArray(t))for(let i of t)Al(e,i,n,r);else n[t.type.major](e,t,r)}function Xw(e,t,n){let r=Ii(e,n);if(!Array.isArray(r)&&n.quickEncodeToken){let i=n.quickEncodeToken(r);if(i)return i;let s=t[r.type.major];if(s.encodedSize){let o=s.encodedSize(r,n),a=new ml(o);if(s(a,r,n),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return Os(a.chunks[0])}}return Jo.reset(),Al(Jo,r,t,n),Jo.toBytes(!0)}var Yw={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Qw=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=kt[e];if(t===void 0){let n=oe[e];if(!n)throw new Error(`${de} 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}},kr=Symbol.for("DONE"),no=Symbol.for("BREAK");function Zw(e,t,n){let r=[];for(let i=0;i<e.value;i++){let s=Fr(t,n);if(s===no){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed array`)}if(s===kr)throw new Error(`${de} found array but not enough entries (got ${i}, expected ${e.value})`);r[i]=s}return r}function e0(e,t,n){let r=n.useMaps===!0,i=r?void 0:{},s=r?new Map:void 0;for(let o=0;o<e.value;o++){let a=Fr(t,n);if(a===no){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed map`)}if(a===kr)throw new Error(`${de} found map but not enough entries (got ${o} [no key], expected ${e.value})`);if(r!==!0&&typeof a!="string")throw new Error(`${de} non-string keys not supported (got ${typeof a})`);if(n.rejectDuplicateMapKeys===!0&&(r&&s.has(a)||!r&&a in i))throw new Error(`${de} found repeat map key "${a}"`);let l=Fr(t,n);if(l===kr)throw new Error(`${de} found map but not enough entries (got ${o} [no value], expected ${e.value})`);r?s.set(a,l):i[a]=l}return r?s:i}function Fr(e,t){if(e.done())return kr;let n=e.next();if(n.type===$.break)return no;if(n.type.terminal)return n.value;if(n.type===$.array)return Zw(n,e,t);if(n.type===$.map)return e0(n,e,t);if(n.type===$.tag){if(t.tags&&typeof t.tags[n.value]=="function"){let r=Fr(e,t);return t.tags[n.value](r)}throw new Error(`${de} tag not supported (${n.value})`)}throw new Error("unsupported")}function t0(e,t){if(!(e instanceof Uint8Array))throw new Error(`${de} data to decode must be a Uint8Array`);t=Object.assign({},Yw,t);let n=t.tokenizer||new Qw(e,t),r=Fr(n,t);if(r===kr)throw new Error(`${de} did not find any content to decode`);if(r===no)throw new Error(`${de} got unexpected break`);return[r,e.subarray(n.pos())]}function Il(e,t){let[n,r]=t0(e,t);if(r.length>0)throw new Error(`${de} too many terminals, data makes no sense`);return n}var n0=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(t.type===$.array&&(t.elements++,t.elements!==1&&e.push([44])),t.type===$.map&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[$.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)}[$.negint.major](e,t){this[$.uint.major](e,t)}[$.bytes.major](e,t){throw new Error(`${Rn} unsupported type: Uint8Array`)}[$.string.major](e,t){this.prefix(e);let n=hl(JSON.stringify(t.value));e.push(n.length>32?Os(n):n)}[$.array.major](e,t){this.prefix(e),this.inRecursive.push({type:$.array,elements:0}),e.push([91])}[$.map.major](e,t){this.prefix(e),this.inRecursive.push({type:$.map,elements:0}),e.push([123])}[$.tag.major](e,t){}[$.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(s.type===$.array)e.push([93]);else if(s.type===$.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(`${Rn} 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 s=0;s<n.length;s++)r[s]=n.charCodeAt(s),!i&&(r[s]===46||r[s]===101||r[s]===69)&&(i=!0);i||(r.push(46),r.push(48)),e.push(r)}};function r0(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Rn} complex map keys are not supported`);let n=e[0],r=t[0];if(n.type!==$.string||r.type!==$.string)throw new Error(`${Rn} non-string map keys are not supported`);if(n<r)return-1;if(n>r)return 1;throw new Error(`${Rn} unexpected duplicate map keys, this is not supported`)}var i0={addBreakTokens:!0,mapSorter:r0};function o0(e,t){return t=Object.assign({},i0,t),Xw(e,new n0,t)}var El=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(`${de} 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(`${de} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,n=!1,r=o=>{for(;!this.done();){let a=this.ch();if(o.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 Z($.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(`${de} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(n)throw new Error(`${de} 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)),s=parseFloat(i);return n?new Z($.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new Z(s>=0?$.uint:$.negint,s,this._pos-e):new Z(s>=0?$.uint:$.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${de} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,s=0;i<this.data.length&&s<65536;i++,s++){let o=this.data[i];if(o===92||o<32||o>=128)break;if(o===34){let a=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new Z($.string,a,s)}}let e=this._pos,t=[],n=()=>{if(this._pos+4>=this.data.length)throw new Error(`${de} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let s=0;s<4;s++){let o=this.ch();if(o>=48&&o<=57)o-=48;else if(o>=97&&o<=102)o=o-97+10;else if(o>=65&&o<=70)o=o-65+10;else throw new Error(`${de} unexpected unicode escape character at position ${this._pos}`);i=i*16+o,this._pos++}return i},r=()=>{let i=this.ch(),s=null,o=i>239?4:i>223?3:i>191?2:1;if(this._pos+o>this.data.length)throw new Error(`${de} unexpected unicode sequence at position ${this._pos}`);let a,l,c,d;switch(o){case 1:i<128&&(s=i);break;case 2:a=this.data[this._pos+1],(a&192)===128&&(d=(i&31)<<6|a&63,d>127&&(s=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)&&(s=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&&(s=d))}s===null?(s=65533,o=1):s>65535&&(s-=65536,t.push(s>>>10&1023|55296),s=56320|s&1023),t.push(s),this._pos+=o};for(;!this.done();){let i=this.ch(),s;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${de} unexpected string termination at position ${this._pos}`);switch(s=this.ch(),this._pos++,s){case 34:case 39:case 92:case 47:t.push(s);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(`${de} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new Z($.string,gl(t),this._pos-e);default:if(i<32)throw new Error(`${de} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):r()}}throw new Error(`${de} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new Z($.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new Z($.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new Z($.null,null,4);case 102:return this.expect([102,97,108,115,101]),new Z($.false,!1,5);case 116:return this.expect([116,114,117,101]),new Z($.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(`${de} 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 Z($.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} 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 Z($.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 Z($.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} 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 Z($.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${de} 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(`${de} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function s0(e,t){return t=Object.assign({tokenizer:new El(e,t)},t),Il(e,t)}var WA=new Uint8Array(0);function a0(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 Ms(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 u0(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 s=e.charAt(i),o=s.charCodeAt(0);if(n[o]!==255)throw new TypeError(s+" is ambiguous");n[o]=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(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var V=0,Y=0,F=0,j=D.length;F!==j&&D[F]===0;)F++,V++;for(var q=(j-F)*d+1>>>0,z=new Uint8Array(q);F!==j;){for(var k=D[F],te=0,W=q-1;(k!==0||te<Y)&&W!==-1;W--,te++)k+=256*z[W]>>>0,z[W]=k%a>>>0,k=k/a>>>0;if(k!==0)throw new Error("Non-zero carry");Y=te,F++}for(var le=q-Y;le!==q&&z[le]===0;)le++;for(var x=l.repeat(V);le<q;++le)x+=e.charAt(z[le]);return x}function C(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var V=0;if(D[V]!==" "){for(var Y=0,F=0;D[V]===l;)Y++,V++;for(var j=(D.length-V)*c+1>>>0,q=new Uint8Array(j);D[V];){var z=n[D.charCodeAt(V)];if(z===255)return;for(var k=0,te=j-1;(z!==0||k<F)&&te!==-1;te--,k++)z+=a*q[te]>>>0,q[te]=z%256>>>0,z=z/256>>>0;if(z!==0)throw new Error("Non-zero carry");F=k,V++}if(D[V]!==" "){for(var W=j-F;W!==j&&q[W]===0;)W++;for(var le=new Uint8Array(Y+(j-W)),x=Y;W!==j;)le[x++]=q[W++];return le}}}function E(D){var V=C(D);if(V)return V;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:C,decode:E}}var c0=u0,l0=c0,f0=l0,d0=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")}},p0=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 Sl(this,e)}},y0=class{decoders;constructor(e){this.decoders=e}or(e){return Sl(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 Sl(e,t){return new y0({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var h0=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 d0(e,t,n),this.decoder=new p0(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Pl({name:e,prefix:t,encode:n,decode:r}){return new h0(e,t,n,r)}function ro({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=f0(n,e);return Pl({prefix:t,name:e,encode:r,decode:s=>Ms(i(s))})}function g0(e,t,n,r){let i=e.length;for(;e[i-1]==="=";)--i;let s=new Uint8Array(i*n/8|0),o=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,o+=n,o>=8&&(o-=8,s[l++]=255&a>>o)}if(o>=n||255&a<<8-o)throw new SyntaxError("Unexpected end of data");return s}function m0(e,t,n){let r=t[t.length-1]==="=",i=(1<<n)-1,s="",o=0,a=0;for(let l=0;l<e.length;++l)for(a=a<<8|e[l],o+=8;o>n;)o-=n,s+=t[i&a>>o];if(o!==0&&(s+=t[i&a<<n-o]),r)for(;s.length*n&7;)s+="=";return s}function v0(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function st({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=v0(r);return Pl({prefix:t,name:e,encode(s){return m0(s,r,n)},decode(s){return g0(s,i,n,e)}})}var Ei=st({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zA=st({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),HA=st({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),JA=st({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),XA=st({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),YA=st({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),QA=st({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ZA=st({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),e1=st({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Xo=ro({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),t1=ro({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),un=ro({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),n1=ro({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Rl={};jo(Rl,{Digest:()=>io,create:()=>Ds,decode:()=>Ls,equals:()=>$l,hasCode:()=>L0});var b0=Nl,ec=128,_0=127,T0=~_0,w0=Math.pow(2,31);function Nl(e,t,n){t=t||[],n=n||0;for(var r=n;e>=w0;)t[n++]=e&255|ec,e/=128;for(;e&T0;)t[n++]=e&255|ec,e>>>=7;return t[n]=e|0,Nl.bytes=n-r+1,t}var O0=rs,A0=128,tc=127;function rs(e,r){var n=0,r=r||0,i=0,s=r,o,a=e.length;do{if(s>=a)throw rs.bytes=0,new RangeError("Could not decode varint");o=e[s++],n+=i<28?(o&tc)<<i:(o&tc)*Math.pow(2,i),i+=7}while(o>=A0);return rs.bytes=s-r,n}var I0=Math.pow(2,7),E0=Math.pow(2,14),S0=Math.pow(2,21),P0=Math.pow(2,28),R0=Math.pow(2,35),N0=Math.pow(2,42),$0=Math.pow(2,49),C0=Math.pow(2,56),x0=Math.pow(2,63),U0=function(e){return e<I0?1:e<E0?2:e<S0?3:e<P0?4:e<R0?5:e<N0?6:e<$0?7:e<C0?8:e<x0?9:10},M0={encode:b0,decode:O0,encodingLength:U0},D0=M0,ji=D0;function is(e,t=0){return[ji.decode(e,t),ji.decode.bytes]}function ki(e,t,n=0){return ji.encode(e,t,n),t}function Fi(e){return ji.encodingLength(e)}function Ds(e,t){let n=t.byteLength,r=Fi(e),i=r+Fi(n),s=new Uint8Array(i+n);return ki(e,s,0),ki(n,s,r),s.set(t,i),new io(e,n,t,s)}function Ls(e){let t=Ms(e),[n,r]=is(t),[i,s]=is(t.subarray(r)),o=t.subarray(r+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new io(n,i,o,t)}function $l(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&a0(e.bytes,n.bytes)}}var io=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};function L0(e,t){return e.code===t}function nc(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return j0(n,os(e),t??un.encoder);default:return k0(n,os(e),t??Ei.encoder)}}var rc=new WeakMap;function os(e){let t=rc.get(e);if(t==null){let n=new Map;return rc.set(e,n),n}return t}var yr=class ze{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!==Cr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==F0)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return ze.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=Ds(t,n);return ze.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 ze.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&$l(t.multihash,r.multihash)}toString(t){return nc(this,t)}toJSON(){return{"/":nc(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 ze)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:s,bytes:o}=n;return new ze(r,i,s,o??ic(r,i,s.bytes))}else if(n[K0]===!0){let{version:r,multihash:i,code:s}=n,o=Ls(i);return ze.create(r,s,o)}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!==Cr)throw new Error(`Version 0 CID must use dag-pb (code: ${Cr}) block encoding`);return new ze(t,n,r,r.bytes)}case 1:{let i=ic(t,n,r.bytes);return new ze(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return ze.create(0,Cr,t)}static createV1(t,n){return ze.create(1,t,n)}static decode(t){let[n,r]=ze.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=ze.inspectBytes(t),r=n.size-n.multihashSize,i=Ms(t.subarray(r,r+n.multihashSize));if(i.byteLength!==n.multihashSize)throw new Error("Incorrect length");let s=i.subarray(n.multihashSize-n.digestSize),o=new io(n.multihashCode,n.digestSize,s,i);return[n.version===0?ze.createV0(o):ze.createV1(n.codec,o),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[g,C]=is(t.subarray(n));return n+=C,g},i=r(),s=Cr;if(i===18?(i=0,n=0):s=r(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=n,a=r(),l=r(),c=n+l,d=c-o;return{version:i,codec:s,multihashCode:a,digestSize:l,multihashSize:d,size:c}}static parse(t,n){let[r,i]=B0(t,n),s=ze.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return os(s).set(r,t),s}};function B0(e,t){switch(e[0]){case"Q":{let n=t??un;return[un.prefix,n.decode(`${un.prefix}${e}`)]}case un.prefix:{let n=t??un;return[un.prefix,n.decode(e)]}case Ei.prefix:{let n=t??Ei;return[Ei.prefix,n.decode(e)]}case Xo.prefix:{let n=t??Xo;return[Xo.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 j0(e,t,n){let{prefix:r}=n;if(r!==un.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let i=t.get(r);if(i==null){let s=n.encode(e).slice(1);return t.set(r,s),s}else return i}function k0(e,t,n){let{prefix:r}=n,i=t.get(r);if(i==null){let s=n.encode(e);return t.set(r,s),s}else return i}var Cr=112,F0=18;function ic(e,t,n){let r=Fi(e),i=r+Fi(t),s=new Uint8Array(i+n.byteLength);return ki(e,s,0),ki(t,s,r),s.set(n,i),s}var K0=Symbol.for("@ipld/js-cid/CID"),V0=20;function Cl({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new G0(e,t,n,r,i)}var G0=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,r,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=r??V0,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?oc(n,this.code,t?.truncate):n.then(r=>oc(r,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function oc(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 Ds(t,e)}var xl=st({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),r1=st({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),i1=st({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),o1=st({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function q0(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function W0(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=yr.asCID(e);if(!t)return null;let n=t.toString();return[new Z($.map,1/0,1),new Z($.string,"/",1),new Z($.string,n,n.length),new Z($.break,void 0,1)]}function Ki(e){let t=xl.encode(e).slice(1);return[new Z($.map,1/0,1),new Z($.string,"/",1),new Z($.map,1/0,1),new Z($.string,"bytes",5),new Z($.string,t,t.length),new Z($.break,void 0,1),new Z($.break,void 0,1)]}function Nt(e){return Ki(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function z0(e){return Ki(new Uint8Array(e))}function H0(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function J0(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 X0={typeEncoders:{Object:W0,Buffer:Ki,Uint8Array:Ki,Int8Array:Nt,Uint16Array:Nt,Int16Array:Nt,Uint32Array:Nt,Int32Array:Nt,Float32Array:Nt,Float64Array:Nt,Uint8ClampedArray:Nt,BigInt64Array:Nt,BigUint64Array:Nt,DataView:Nt,ArrayBuffer:z0,undefined:H0,number:J0}},Y0=class extends El{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===$.map){let t=this._next();if(t.type===$.string&&t.value==="/"){let n=this._next();if(n.type===$.string){if(this._next().type!==$.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(n),new Z($.tag,42,0)}if(n.type===$.map){let r=this._next();if(r.type===$.string&&r.value==="bytes"){let i=this._next();if(i.type===$.string){for(let o=0;o<2;o++)if(this._next().type!==$.break)throw new Error("Invalid encoded Bytes form");let s=xl.decode(`m${i.value}`);return new Z($.bytes,s,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(r)}this.tokenBuffer.push(n)}this.tokenBuffer.push(t)}return e}},ss={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};ss.tags[42]=yr.parse;var Q0="dag-json",Ul=297,Bs=e=>o0(e,X0),js=e=>{let t=q0(e),n=Object.assign(ss,{tokenizer:new Y0(t,ss)});return s0(t,n)},sc=e=>Z0.decode(Bs(e)),Z0=new TextDecoder,eO=e=>js(tO.encode(e)),tO=new TextEncoder;function nO(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ml(e,t,n=""){let r=nO(e),i=e?.length,s=t!==void 0;if(!r||s&&i!==t){let o=n&&`"${n}" `,a=s?` of length ${t}`:"",l=r?`length=${i}`:`type=${typeof e}`;throw new Error(o+"expected Uint8Array"+a+", got "+l)}return e}function ac(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 rO(e,t){Ml(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 as(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Yo(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Lt(e,t){return e<<32-t|e>>>t}function iO(e,t={}){let n=(i,s)=>e(s).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 oO=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function sO(e,t,n){return e&t^~e&n}function aO(e,t,n){return e&t^e&n^t&n}var uO=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=Yo(this.buffer)}update(e){ac(this),Ml(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let s=0;s<i;){let o=Math.min(r-this.pos,i-s);if(o===r){let a=Yo(e);for(;r<=i-s;s+=r)this.process(a,s);continue}n.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ac(this),rO(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:s}=this;t[s++]=128,as(this.buffer.subarray(s)),this.padOffset>r-s&&(this.process(n,0),s=0);for(let d=s;d<r;d++)t[d]=0;n.setBigUint64(r-8,BigInt(this.length*8),i),this.process(n,0);let o=Yo(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++)o.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:s,pos:o}=this;return e.destroyed=s,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},sn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cO=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]),an=new Uint32Array(64),lO=class extends uO{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:s,G:o,H:a}=this;return[e,t,n,r,i,s,o,a]}set(e,t,n,r,i,s,o,a){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=s|0,this.G=o|0,this.H=a|0}process(e,t){for(let d=0;d<16;d++,t+=4)an[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let g=an[d-15],C=an[d-2],E=Lt(g,7)^Lt(g,18)^g>>>3,D=Lt(C,17)^Lt(C,19)^C>>>10;an[d]=D+an[d-7]+E+an[d-16]|0}let{A:n,B:r,C:i,D:s,E:o,F:a,G:l,H:c}=this;for(let d=0;d<64;d++){let g=Lt(o,6)^Lt(o,11)^Lt(o,25),C=c+g+sO(o,a,l)+cO[d]+an[d]|0,D=(Lt(n,2)^Lt(n,13)^Lt(n,22))+aO(n,r,i)|0;c=l,l=a,a=o,o=s+C|0,s=i,i=r,r=n,n=C+D|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(n,r,i,s,o,a,l,c)}roundClean(){as(an)}destroy(){this.set(0,0,0,0,0,0,0,0),as(this.buffer)}},fO=class extends lO{A=sn[0]|0;B=sn[1]|0;C=sn[2]|0;D=sn[3]|0;E=sn[4]|0;F=sn[5]|0;G=sn[6]|0;H=sn[7]|0;constructor(){super(32)}},dO=iO(()=>new fO,oO(1));var Fe=vt(zt(),1),Dl=vt(Cp(),1),uc=e=>Fe.Type.Union([e,Fe.Type.Null()]);var Ll=/^(k51qz|baguq)[0-9a-z]{56,57}$/,pO=/^[0-9A-Fa-f]{7,8}$/g;Fe.FormatRegistry.Set("EntityID",e=>!!e.match(pO)||!!e.match(Ll));var yO=Fe.Type.String(),hO=e=>e?.enc instanceof Uint8Array;Fe.FormatRegistry.Set("CID",e=>!!e.match(Ll));var Bl=Fe.Type.String({format:"CID"}),gO=/^http([s]?):\/\/.*\..*/;Fe.FormatRegistry.Set("URL",e=>!!e.match(gO));var s1=Fe.Type.String({format:"URL"}),jl=Fe.Type.Object({en:yO,at:Fe.Type.String(),vl:uc(Fe.Type.Union([Fe.Type.String(),Fe.Type.Boolean(),Fe.Type.Number()])),ts:Fe.Type.String(),ag:Fe.Type.String(),pv:uc(Bl)}),cc=Dl.TypeCompiler.Compile(jl);var a1=cc.Check.bind(cc),mO=Fe.Type.Composite([Fe.Type.Object({cid:Bl}),jl]),us=Dl.TypeCompiler.Compile(mO),vO=e=>Array.from(us.Errors(e)),kl=us.Check.bind(us);function Fl(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var bO=Cl({name:"sha2-256",code:18,encode:Fl("SHA-256")}),u1=Cl({name:"sha2-512",code:19,encode:Fl("SHA-512")}),{WARN:lc,LOG:c1,DEBUG:_O,VERBOSE:Kl,ERROR:TO}=Ae.setup(Ae.INFO);function Vl(e,t=["cid"]){if(!e)throw TO("falsy log",e);let n=e.cid;if(hO(e))return n||(n=ks(Gl(e).bytes).toString()),lc("preparing an encrypted applog - really?"),{log:e,cid:n};let r={};for(let[i,s]of Object.entries(e))s===void 0&&(lc(`log.${i} is undefined, which is not allowed - encoding as null`,e),s=null),t.includes(i)?Kl("excluding app log",{key:i,val:s}):r[i]=s;return{log:r,cid:n}}function wO(e){return ks(OO(e).bytes)}function OO(e){return Gl(Vl(e)?.log)}function ks(e){let t=dO(e),n=Rl.create(bO.code,t),r=yr.create(1,Ul,n);return Kl("[getCidSync]",{bytes:e,hash:t,digest:n,cid:r}),r}function Gl(e){_O("[encodeBlock]",e);let t=Bs(e);return{bytes:t,cid:ks(t)}}function fc(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 AO(e,t){let n=fc(e),r=fc(t);return+n<+r}var{WARN:l1,LOG:f1,DEBUG:d1,VERBOSE:IO,ERROR:dc}=Ae.setup(Ae.INFO),EO=(e,t,n="asc")=>n==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),ql=(e,t,n)=>Le.structural(zu(t,e),zu(n,e)),SO=(e,t,n="asc")=>EO(e.ts,t.ts,n),p1=AT(ql,["en","at"]);function Kr(e,t="asc"){return e.sort((n,r)=>SO(n,r,t))}var PO=(e,t)=>AO(new Date(e.ts),new Date(t.ts));var Wl=e=>{let t=new Map;for(let n of e){if(!n)throw dc("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!n.cid)throw dc("applog with missing CID",n),new Error("applog with missing CID");let r=n.cid;t.has(r)?IO("Skipping duplicate applog:",[t.get(r),n]):t.set(r,n)}return Array.from(t.values())};function RO(e){return typeof e=="string"&&e.startsWith("?")}function NO(e){return e.slice(1)}function Fs(e,t){let n={},r={};for(let[i,s]of Object.entries(e))if(RO(s)){let o=NO(s),a=t[o];a?r[i]=a:n[i]=o}else r[i]=s;return[r,n]}function $O(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 zl=function(t){for(var n=0,r=0,i=t.length;r<i;r++)n+=t[r];return n},pc=function(t){return zl(t)/t.length},_t={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return _t.max(e)-_t.min(e)},midrange:function(e){return _t.range(e)/2},sum:zl,mean:pc,average:pc,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=_t.mean(e);return _t.mean(e.map(function(n){return Math.pow(n-t,2)}))},standardDeviation:function(e){return Math.sqrt(_t.variance(e))},meanAbsoluteDeviation:function(e){var t=_t.mean(e);return _t.mean(e.map(function(n){return Math.abs(n-t)}))},zScores:function(e){var t=_t.mean(e),n=_t.standardDeviation(e);return e.map(function(r){return(r-t)/n})}};_t.average=_t.mean;var Hl=function(e,t=13,n){if(!e?.length)throw new Error(`Empty string: ${e}`);let r=3735928559^t,i=1103547991^t;for(let o=0,a;o<e.length;o++)a=e.charCodeAt(o),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 Jl(){return new Date().toISOString()}var{WARN:CO,LOG:y1,DEBUG:xO,VERBOSE:h1,ERROR:Vi}=Ae.setup(Ae.INFO);function UO(e,t){let n=Jl(),r=t;return e.map(s=>MO(s,{ts:n,threadForPv:r}))}function MO(e,{ts:t,threadForPv:n}={}){let r=BO(e,t??Jl()),i=jO(r,n),s=wO(i).toString();e.cid&&e.cid!==s&&CO("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:s,logWithPv:i});let o={...i,cid:s};if(!kl(o))throw Vi(`Bogus Applog ${JSON.stringify(o)}`,vO(o));return Object.freeze(o)}function DO(e){return!!e.ts}function LO(e){return!!e.pv}function BO(e,t){return DO(e)?e:{...e,ts:t}}function jO(e,t){if(e.pv!==void 0)return e;if(t){let{en:n,at:r}=e,i=t.findLast(o=>o.en==n&&o.at==r);if(ql(["en","at","vl","ts","ag"],e,i))throw Vi("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let s=(e.pv!==void 0?e.pv:i?.cid)??null;return{...e,pv:s}}else{if(!LO(e))throw Vi("[withPvFrom] no thread and no pv:",e);return e}}function oo(e){let t=()=>(Se(()=>e.length<2&&xO(`joinThreads with count=${e.length}`)),Kr(Wl(e.flatMap(i=>{let s=i.applogs;if(!s)throw Vi("falsy applogs of thread",i),new Error("falsy applogs of thread");return s})))),n=Se(()=>t()),r=Qe(function(i,s){return Jt(i)?{init:Se(()=>t())}:{added:i.added.filter(o=>!this.hasApplog(o,!0)),removed:i.removed?.filter(o=>!!this.parents.some(l=>l===s?!1:l.hasApplog(o,!0)))}});return new Ks(Se(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],n,r)}var{WARN:yc,LOG:g1,DEBUG:hc,VERBOSE:Sn,ERROR:gc}=Ae.setup(Ae.INFO),Ks=class Xl extends nr{constructor(t,n,r,i,s,o=null){super(t,n,r,s?Pe.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=s,this._writeMapper=o,rn(this,{onParentUpdate:Qe}),s&&this.subscribeToParents()}static mapWrites(t,n,r){return new Xl(`${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=mt(()=>{this.parents.length||yc("MappedThread has no parents",this),Sn(`[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)&&Sn(`[MappedThread: ${this.name}] Skipping re-sub to parent`,r.nameAndSizeUntracked),Sn(`[MappedThread: ${this.name}] sub to new parent`,r.nameAndSizeUntracked);let s=this.onParentUpdate.bind(this,r),o=r.subscribe(s);this._parentSubscriptions.set(r,o)}for(let r of n)Sn(`[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 gc("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);hc(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&yc(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Se(()=>Wt(t.applogs))})})}onParentUpdate(t,n){Sn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,n);let r=this._eventMapper?this._eventMapper(n,t):n;if(this._eventMapper)if(Sn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,r),Jt(r))this._applogs.replace([...r.init]);else{for(let i of r.added)this._applogs.splice(MT(this._applogs,i,"ts"),0,i);if(r.removed){for(let i of r.removed)if(!this._applogs.remove(i))if(!Jt(n)&&n.removed?.includes(i))hc("Ignoring remove event for non-existent because it was part of parent event's removed",i,n);else throw gc(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:n,mapResult:r})}}Sn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Er(this._applogs)),this.notifySubscribers(r)}get readOnly(){return!1}},{WARN:m1,LOG:v1,DEBUG:b1,VERBOSE:Qo,ERROR:kO}=Ae.setup(Ae.INFO),fn=qe("rollingFilter",function(t,n,r={}){let i=FO(n),s=mc(i),o=Pe.array(Se(function(){return s(t.applogs)}),{deep:!1,name:`${t.name} | ${r.name||`rollingFilter.array{${Nn(i)}}`}`}),a=g=>{let C;return Jt(g)?C={init:s(g.init)}:C={added:s(g.added),removed:g.removed},Qo(`rollingFilter{${t.nameAndSizeUntracked} | ${r.name?` '${r.name}'}`:""} parentUpdate`,i,g,"=>",C),C},l=new Ks(`${t.name} | ${r.name||`rollingFilter{${Nn(i)}}`}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],o,a),c=za(()=>Wt(n),g=>{Qo(`rollingFilter<${t.nameAndSizeUntracked}>${r.name?` '${r.name}'`:""} patternUpdate`,i,"=>",g),i=g,s=mc(i),l.triggerRemap()}),d=An(o,()=>{Qo(`rollingFilter<${Se(()=>t.name)}>${r.name?` '${r.name}'`:""} unobserve`,i),c(),d()});return l},{equals:cr,argsDebugName:(e,t,n)=>Ke({caller:"rollingFilter",thread:e,pattern:t,args:n})}),Yl=qe("rollingMapper",function(t,n,r={}){let i=Se(()=>n.call(null,{init:t.applogs},t));if(!Jt(i))throw kO("Initial run must return init event");let s=i.init;return new Ks(`${t.name} | ${r.name||"rollingMapper"}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],s,n)},{equals:cr,argsDebugName:(e,t,n)=>Ke({caller:"rollingMapper",thread:e,args:n})}),_1=qe("rollingAcc",function(t,n,r,i={}){let s=Qe(r);return s({init:t.applogs},n),t.subscribe(o=>{s(o,n)}),n},{argsDebugName:(e,t,n,r)=>`rollingAcc{${e.nameAndSizeUntracked}${r?.name?` | ${r?.name}`:""}}`}),FO=function(t){let n=Se(function(){return Object.fromEntries(Object.entries(Wt(t)).map(([i,s])=>[Wt(i),Wt(s)]))});if(!Object.entries(n).length)throw new Error("Pattern is empty");return n};function mc(e){return function(n){return n.filter(function(i){for(let s of Object.keys(e)){let o=e[s];if(o===void 0)continue;let a=i[s.startsWith("!")?s.slice(1):s];if(!$O(s,o,a))return!1}return!0})}}var{WARN:KO,LOG:VO,DEBUG:GO,VERBOSE:qO,ERROR:Si}=Ae.setup(Ae.INFO),WO=class extends nr{constructor(e,t=[],n){super(e,null,n,t),rn(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){let t=UO(e,this);return this.insertRaw(t)}insertRaw(e){let t=Wl(e);if(t.length!==e.length)throw Si(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});let n=e.filter(s=>!kl(s));if(n.length)throw Si(`[insertRaw] bogus applogs passed: ${n.length}`,{bogus:n});let r=e.filter(s=>this.hasApplog(s,!1));if(r.length)throw Si(`[insertRaw] already existing applogs passed: ${r.length}`,{existing:r});if(!e.length){KO("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof Vs)?VO:GO)("Inserting:",e.length===1?e[0]:e,{ds:this}),Kr(e);let i=this._applogs.length&&PO(e[0],this._applogs[this._applogs.length-1]);return this._applogs.push(...e),i&&Kr(this._applogs),this.notifySubscribers({added:e,removed:null}),this.persist(e),e}get readOnly(){return!1}},Vs=class Pi extends WO{constructor(t,n,r,i){super(t,n,r),this._readOnly=i,rn(this,{_applogs:Pe.shallow})}static empty(t){return Pi.fromArray([],t??"empty in-memory",!1)}static fromArray(t,n,r=!1){return new Pi(n??"in-memory",t,[],r)}static fromReadOnlyArray(t,n){return new Pi(n??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if(qO("[InMem.persist] no persist for",t),this.readOnly)throw Si("[persist] called for readOnly thread")}},{WARN:T1,LOG:w1,DEBUG:O1,VERBOSE:A1,ERROR:I1}=Ae.setup(Ae.INFO);var{WARN:cI,LOG:lI,DEBUG:fI,VERBOSE:dI,ERROR:pI}=Ae.setup(Ae.INFO);function Gs(e){return Hl(e,31,7)}var HO=class{constructor(e,t,n=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=n,rn(this,{threadOfTrail:Ce})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?oo([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},Ql=class{constructor(e){this.nodes=e,rn(this,{threadOfAllTrails:Ce,size:Ce,isEmpty:Ce})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Se(()=>this.records.length)}get records(){return jt(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return oo(jt(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogSet(){return jt(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogSet"})}get leafNodeLogs(){return jt(()=>this.nodes.flatMap(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return oo(jt(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:vI,LOG:so,DEBUG:Xt,VERBOSE:be,ERROR:Bn}=Ae.setup(Ae.INFO,{prefix:"[q]"}),qs=null,JO=qe("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:n,tolerateAlreadyFiltered:r}={}){if(be(`lastWriteWins${n?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(r)return Xt("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw Bn("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,s=Yl(t,function(a,l){let c=Jt(a),d,g=[],C=c?null:[];c?(i=new Map,d=a.init):d=a.added;let E;for(let D=n?0:d.length-1;n?D<d.length:D>=0;n?D++:D--){let V=d[D],Y=V.en+"|"+V.at;if(E&&(n?E>V.ts:E<V.ts))throw Bn("lastWriteWins.mapper logs not sorted:",E,n?">":"<",V.ts,{log:V,i:D,newLogs:d,inverseToOnlyReturnFirstLogs:n});E=V.ts;let F=i.get(Y);(!F||(n?F.ts>V.ts:F.ts<V.ts))&&(F&&!c&&C.push(F),g.push(V),i.set(Y,V))}return Kr(g),be.isDisabled||be(`lastWriteWins${n?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,c?{...Object.fromEntries(Object.entries(a).map(([D,V])=>[D,V?.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 be.isDisabled||mt(()=>{be(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,s.applogs.length)}),s},{equals:cr,argsDebugName:e=>Ke({caller:"lastWriteWins",thread:e})}),bI=qe("withoutDeleted",function(t){if(be.isEnabled&&be(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw Bn("thread already filtered withoutDeleted:",t.filters,{name:t.name});let n=fn(t,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});be.isEnabled&&be(`withoutDeleted<${t.nameAndSizeUntracked}> deletionLogs:`,Se(function(){return[...n.applogs]}));let r=Ke({caller:"allDeletedEntities",thread:t}),i=ll(function(){return n.map(o=>o.en)},{name:r});return be.isEnabled&&mt(()=>{be(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),fn(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:cr}),Zl=qe("query",function e(t,n,r={},i={}){rA();let s=ef(t);Xt(`query<${s.nameAndSizeUntracked}>:`,n);let o=Array.isArray(n)?n:[n],a;if(o.length===1)a=null;else{let d=o.slice(0,-1);a=e(s,d,r,i)}let l=o[o.length-1],c=XO(s,a,l,i);return be.isDisabled||mt(()=>be("query result:",Wt(c))),c},{equals:Zi,argsDebugName:(e,t,n)=>Ke({caller:"query",thread:e,args:n?{pattern:t,startVars:n}:t})}),XO=qe("queryStep",function(t,n,r,i={}){if(Xt(`queryStep<${t.nameAndSizeUntracked}> with`,n?.untrackedSize??"all","nodes, pattern:",r),!Object.entries(r).length)throw new Error("Pattern is empty");function s(a){let[l,c]=Fs(r,a?.variables??{});be("[queryStep.doQuery] patternWithoutVars: ",l);let d=fn(t,l),g=ao(c),C=jt(function(){let D=d.map(V=>({log:V,vars:g(V)}));return be.isEnabled&&be("[queryStep.doQuery] step node:",a?.variables," =>",D,"from:",Se(()=>d.applogs)),D.map(({log:V,vars:Y})=>{let F=Object.assign({},a?.variables,Y);return new HO(dl.fromArray([V],Ke({caller:"QueryNode",thread:d,pattern:`${Nn(F)}@${Nn(l)}`})),F,a)})},{name:Ke({caller:"doQuery.mapNodes",thread:d,pattern:r})});return be.isEnabled&&mt(()=>be("[queryStep.doQuery] resultNodes:",[...C])),i.debug&&so("[queryStep] step result:",Se(()=>C.map(({variables:E,logsOfThisNode:D})=>({variables:E,thread:D})))),C}let o=jt(function(){return Xt(`[queryStep] Running with ${n?.nodes?.length} input nodes:`),n?[...n.nodes.flatMap(s)]:[...s(null)]},{name:Ke({caller:"queryStep",thread:t,pattern:r})});return be.isEnabled&&mt(()=>be("[queryStep] observableResultNodes:",[...o])),new Ql(o)},{equals:Zi,argsDebugName:(e,t,n)=>Ke({caller:"queryStep",thread:e,pattern:n})}),_I=qe("queryNot",function(t,n,r,i={}){let s=n.nodes;Xt(`queryNot<${t.nameAndSizeUntracked}> from: ${s.length} nodes`);let o=Array.isArray(r)?r:[r];for(let a of o){if(!Object.entries(r).length)throw new Error("Pattern is empty");s=s.filter(function({variables:c}){let[d,g]=Fs(a,c??{});be("[queryNot] patternWithoutVars: ",d);let C=fn(t,d);return be("[queryNot] step node:",c," =>",C.size,"applogs"),be.isDisabled||be("[queryNot] step node:",c," => empty?",Se(()=>C.applogs)),i.debug&&so("[queryNot] node result:",c,"=>",C.applogs),C.isEmpty})}return new Ql(s)},{equals:Zi,argsDebugName:(e,t,n)=>Ke({caller:"queryNot",thread:e,pattern:n})}),TI=qe("filterAndMap",function(t,n,r){Xt(`filterAndMap<${t.nameAndSizeUntracked}>`,n);let i=fn(t,n);be.isEnabled&&(be("[filterAndMap] filtered:",i.untrackedSize),mt(()=>be("[filterAndMap] filtered:",i.applogs)));let s=Ke({thread:t,pattern:n,caller:"filterAndMap"}),o=jt(()=>ZO(i,r),{name:s});return be.isDisabled||mt(()=>be("[filterAndMap] mapped:",o)),o},{equals:Le.structural,argsDebugName:(e,t)=>Ke({caller:"filterAndMap",thread:e,pattern:t})}),wI=qe("queryAndMap",function(t,n,r,i={}){let s=ef(t);Xt(`queryAndMap<${s.nameAndSizeUntracked}>`,{patternOrPatterns:n,variables:i,map:r});let o=Ke({thread:s,caller:"queryAndMap"}),a=Zl(s,n);be("[queryAndMap] filtered count:",a.untrackedSize);let l=jt(()=>eA(a,r),{name:o});return be.isDisabled||mt(()=>be("[queryAndMap] result:",Wt(l))),l},{equals:Le.structural,argsDebugName:(e,t)=>Ke({caller:"queryAndMap",thread:e,pattern:t})}),OI=qe("queryEntity",function(t,n,r,i){Xt(`queryEntity<${t.nameAndSizeUntracked}>`,r,n);let s=fn(t,{en:r,at:tA(n,i)});return be("queryEntity applogs:",s.applogs),Ce(()=>s.isEmpty?null:Object.fromEntries(s.map(({at:o,vl:a})=>[o.slice(n.length+1),a])))},{equals:cl,argsDebugName:(e,t,n)=>Ke({caller:"queryEntity",thread:e,args:{name:t,entityID:n}})}),AI=qe("agentsOfThread",function(t){Xt(`agentsOfThread<${t.nameAndSizeUntracked}>`);let n=Pe.map(),r=Qe(s=>{for(let o of Jt(s)?s.init:s.added){let a=n.get(o.ag)??0;n.set(o.ag,a+1)}for(let o of!Jt(s)&&s.removed||[]){let a=n.get(o.ag);if(!a||a<1)throw Bn("[agentsOfThread] number is now negative",{log:o,event:s,mapped:n,prev:a});n.set(o.ag,a-1)}so(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:s,mapped:n})});r({init:t.applogs});let i=t.subscribe(r);return Xn(n,i),n}),YO=qe("entityOverlap",function(t,n){return so(`entityOverlap<${t.nameAndSizeUntracked}, ${n.nameAndSizeUntracked}>`),Ce(()=>{let r=new Set(t.map(s=>s.en)),i=new Set(n.map(s=>s.en));return[...r].filter(s=>i.has(s))})});var II=qe("entityOverlapCount",function(t,n){return Ce(()=>YO(t,n).get().length)}),QO=qe("querySingle",function(t,n,r={}){let i=Zl(t,n,r);return Ce(()=>{if(i.isEmpty)return null;if(i.size>1)throw Bn("[querySingle] got",i.size,"results:",i);let s=i.nodes[0].logsOfThisNode;if(s.size!=1)throw Bn("[querySingle] single result, but got",s.size,"logs:",s.applogs);return s.applogs[0]})},{equals:Le.structural,argsDebugName:(e,t)=>Ke({caller:"querySingle",thread:e,pattern:t})}),EI=qe("querySingleAndMap",function(t,n,r,i={}){let s=QO(t,n,i);return Ce(()=>{let o=s.get();if(o)return typeof r=="string"?o[r]:ao(r)(o)})},{equals:Le.structural,argsDebugName:(e,t)=>Ke({caller:"querySingleAndMap",thread:e,pattern:t})}),ZO=function(t,n){return typeof n=="function"?t.map(n):typeof n=="string"?t.map(r=>r[n]):t.map(ao(n))},eA=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 Bn(`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=>ao(n)(t))};function ao(e){return t=>Object.entries(e).reduce((n,[r,i])=>(n[i]=t[r],n),{})}function tA(e,t){return t.map(n=>nA(e,n))}function nA(e,t){return`${e}/${t}`}function ef(e,t){return Array.isArray(e)?Vs.fromArray(e,t||`threadFromArray[${e.length}]`,!0):e}function rA(){if(qs!=null&&performance.now()>=qs)throw new iA(qs)}var iA=class extends Error{constructor(e){super(e)}};var oA=xe({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=o;var n=128,r=127,i=~r,s=Math.pow(2,31);function o(a,l,c){if(Number.MAX_SAFE_INTEGER&&a>Number.MAX_SAFE_INTEGER)throw o.bytes=0,new RangeError("Could not encode varint");l=l||[],c=c||0;for(var d=c;a>=s;)l[c++]=a&255|n,a/=128;for(;a&i;)l[c++]=a&255|n,a>>>=7;return l[c]=a|0,o.bytes=c-d+1,l}}}),sA=xe({"../../../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(s,l){var a=0,l=l||0,c=0,d=l,g,C=s.length;do{if(d>=C||c>49)throw i.bytes=0,new RangeError("Could not decode varint");g=s[d++],a+=c<28?(g&r)<<c:(g&r)*Math.pow(2,c),c+=7}while(g>=n);return i.bytes=d-l,a}}}),aA=xe({"../../../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),s=Math.pow(2,28),o=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<s?4:g<o?5:g<a?6:g<l?7:g<c?8:g<d?9:10}}}),zs=xe({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:oA(),decode:sA(),encodingLength:aA()}}}),nf=42;function uA(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=yr.asCID(e);if(!t)return null;let n=new Uint8Array(t.bytes.byteLength+1);return n.set(t.bytes,1),[new Z($.tag,nf),new Z($.bytes,n)]}function cA(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function lA(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 fA(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 tf={float64:!0,typeEncoders:{Map:fA,Object:uA,undefined:cA,number:lA}},FI={...tf,typeEncoders:{...tf.typeEncoders}};function dA(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return yr.decode(e.subarray(1))}var Ws={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Ws.tags[nf]=dA;var KI={...Ws,tags:Ws.tags.slice()};var VI=vt(zs(),1);var dn={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},zr={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":dn.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(dn.List(e)!==void 0){for(let t=0;t<e.length;t++){let n=e[t];if(n=zr["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 s=e[i];if(s=zr["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;r.push(s)}return r}}return e}},Int:dn.Int,CarV1HeaderOrV2Pragma:e=>{if(dn.Map(e)===void 0)return;let t=Object.entries(e),n=e,r=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=zr["CarV1HeaderOrV2Pragma > roots (anon)"](e[s]);if(a===void 0)return;if(a!==o||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=zr.Int(e[s]);if(a===void 0)return;if(a!==o||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}},Hr={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":dn.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(dn.List(e)!==void 0){for(let t=0;t<e.length;t++){let n=e[t];if(n=Hr["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 s=e[i];if(s=Hr["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;r.push(s)}return r}}return e}},Int:dn.Int,CarV1HeaderOrV2Pragma:e=>{if(dn.Map(e)===void 0)return;let t=Object.entries(e),n=e,r=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=Hr["CarV1HeaderOrV2Pragma > roots (anon)"](o);if(a===void 0)return;if(a!==o||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=Hr.Int(o);if(a===void 0)return;if(a!==o||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}},GI={toTyped:zr.CarV1HeaderOrV2Pragma,toRepresentation:Hr.CarV1HeaderOrV2Pragma},qI=Us(),WI=vt(zs(),1),zI=[new Z($.map,2),new Z($.string,"version"),new Z($.uint,1),new Z($.string,"roots")],HI=new Z($.tag,42);var JI=vt(zs(),1);var{WARN:XI,LOG:YI,DEBUG:QI,VERBOSE:ZI,ERROR:eE}=Ae.setup(Ae.INFO);var{WARN:tE,LOG:nE,DEBUG:rE,VERBOSE:iE,ERROR:oE}=Ae.setup(Ae.INFO);var Hs=class{app;username;devicename;signer},rf=class extends Hs{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 Gs(this.agentString)}get shortDID(){return this.did?.slice(-8)}get agentString(){return`${this.username}.${this.shortDID}@${this.app}.${this.devicename}`}};export{rf as BaseAgent};
|
|
56
|
+
`)}var sm=om;function am(e){return function(){return e}}var um=am,cm=function(){try{var e=Hn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),uo=cm,lm=uo?function(e,t){return uo(e,"toString",{configurable:!0,enumerable:!1,value:um(t),writable:!0})}:wo,fm=lm,dm=xl(fm),Zs=dm;function pm(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var hm=pm;function ym(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 gm=ym;function mm(e){return e!==e}var vm=mm;function bm(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var _m=bm;function wm(e,t,n){return t===t?_m(e,t,n):gm(e,vm,n)}var Tm=wm;function Am(e,t){var n=e==null?0:e.length;return!!n&&Tm(e,t,0)>-1}var Ml=Am,Om=1,Em=2,Im=8,Sm=16,Nm=32,$m=64,Rm=128,Pm=256,Cm=512,xm=[["ary",Rm],["bind",Om],["bindKey",Em],["curry",Im],["curryRight",Sm],["flip",Cm],["partial",Nm],["partialRight",$m],["rearg",Pm]];function Um(e,t){return hm(xm,function(n){var r="_."+n[0];t&n[1]&&!Ml(e,r)&&e.push(r)}),e.sort()}var Mm=Um;function Bm(e,t,n){var r=t+"";return Zs(e,sm(r,Mm(rm(r),n)))}var Bl=Bm,Dm=1,Lm=2,km=4,jm=8,yc=32,gc=64;function Fm(e,t,n,r,i,o,s,a,l,c){var d=t&jm,g=d?s:void 0,C=d?void 0:s,I=d?o:void 0,S=d?void 0:o;t|=d?yc:gc,t&=~(d?gc:yc),t&km||(t&=~(Dm|Lm));var V=[e,t,i,I,g,S,C,a,l,c],J=n.apply(void 0,V);return Hg(e)&&Ul(J,V),J.placeholder=r,Bl(J,e,t)}var Dl=Fm;function Vm(e){var t=e;return t.placeholder}var ea=Vm,Km=9007199254740991,zm=/^(?:0|[1-9]\d*)$/;function qm(e,t){var n=typeof e;return t=t??Km,!!t&&(n=="number"||n!="symbol"&&zm.test(e))&&e>-1&&e%1==0&&e<t}var To=qm,Gm=Math.min;function Wm(e,t){for(var n=e.length,r=Gm(t.length,n),i=Cl(e);r--;){var o=t[r];e[r]=To(o,n)?i[o]:void 0}return e}var Hm=Wm,mc="__lodash_placeholder__";function Jm(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===mc)&&(e[n]=mc,o[i++]=n)}return o}var si=Jm,Xm=1,Ym=2,Qm=8,Zm=16,ev=128,tv=512;function Ll(e,t,n,r,i,o,s,a,l,c){var d=t&ev,g=t&Xm,C=t&Ym,I=t&(Qm|Zm),S=t&tv,V=C?void 0:oi(e);function J(){for(var F=arguments.length,k=Array(F),z=F;z--;)k[z]=arguments[z];if(I)var W=ea(J),j=Pg(k,W);if(r&&(k=Nl(k,r,i,I)),o&&(k=$l(k,o,s,I)),F-=j,I&&F<c){var Z=si(k,W);return Dl(e,t,Ll,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=Hm(k,a):S&&F>1&&k.reverse(),d&&l<F&&(k.length=l),this&&this!==dt&&this instanceof J&&(fe=V||oi(fe)),fe.apply(G,k)}return J}var kl=Ll;function nv(e,t,n){var r=oi(e);function i(){for(var o=arguments.length,s=Array(o),a=o,l=ea(i);a--;)s[a]=arguments[a];var c=o<3&&s[0]!==l&&s[o-1]!==l?[]:si(s,l);if(o-=c.length,o<n)return Dl(e,t,kl,i.placeholder,void 0,s,c,void 0,void 0,n-o);var d=this&&this!==dt&&this instanceof i?r:e;return Xs(d,this,s)}return i}var rv=nv,iv=1;function ov(e,t,n,r){var i=t&iv,o=oi(e);function s(){for(var a=-1,l=arguments.length,c=-1,d=r.length,g=Array(d+l),C=this&&this!==dt&&this instanceof s?o:e;++c<d;)g[c]=r[c];for(;l--;)g[c++]=arguments[++a];return Xs(C,i?n:this,g)}return s}var sv=ov,vc="__lodash_placeholder__",Ss=1,av=2,uv=4,bc=8,ei=128,_c=256,cv=Math.min;function lv(e,t){var n=e[1],r=t[1],i=n|r,o=i<(Ss|av|ei),s=r==ei&&n==bc||r==ei&&n==_c&&e[7].length<=t[8]||r==(ei|_c)&&t[7].length<=t[8]&&n==bc;if(!(o||s))return e;r&Ss&&(e[2]=t[2],i|=n&Ss?0:uv);var a=t[3];if(a){var l=e[3];e[3]=l?Nl(l,a,t[4]):a,e[4]=l?si(e[3],vc):t[4]}return a=t[5],a&&(l=e[5],e[5]=l?$l(l,a,t[6]):a,e[6]=l?si(e[5],vc):t[6]),a=t[7],a&&(e[7]=a),r&ei&&(e[8]=e[8]==null?t[8]:cv(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var fv=lv,dv="Expected a function",wc=1,pv=2,Ns=8,$s=16,Rs=32,Tc=64,Ac=Math.max;function hv(e,t,n,r,i,o,s,a){var l=t&pv;if(!l&&typeof e!="function")throw new TypeError(dv);var c=r?r.length:0;if(c||(t&=~(Rs|Tc),r=i=void 0),s=s===void 0?s:Ac(fc(s),0),a=a===void 0?a:fc(a),c-=i?i.length:0,t&Tc){var d=r,g=i;r=i=void 0}var C=l?void 0:Pl(e),I=[e,t,n,r,i,d,g,o,s,a];if(C&&fv(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:Ac(I[9]-c,0),!a&&t&(Ns|$s)&&(t&=~(Ns|$s)),!t||t==wc)var S=Og(e,t,n);else t==Ns||t==$s?S=rv(e,t,a):(t==Rs||t==(wc|Rs))&&!i.length?S=sv(e,t,n,r):S=kl.apply(void 0,I);var V=C?Sl:Ul;return Bl(V(S,I),e,t)}var yv=hv;function gv(e,t,n){t=="__proto__"&&uo?uo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var mv=gv;function vv(e,t){return e===t||e!==e&&t!==t}var ta=vv,bv=Object.prototype,_v=bv.hasOwnProperty;function wv(e,t,n){var r=e[t];(!(_v.call(e,t)&&ta(r,n))||n===void 0&&!(t in e))&&mv(e,t,n)}var Tv=wv,Oc=Math.max;function Av(e,t,n){return t=Oc(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Oc(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),Xs(e,this,a)}}var jl=Av;function Ov(e,t){return Zs(jl(e,t,wo),e+"")}var Fl=Ov,Ev=9007199254740991;function Iv(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ev}var na=Iv;function Sv(e){return e!=null&&na(e.length)&&!Il(e)}var Vl=Sv,Nv=Object.prototype;function $v(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Nv;return e===n}var Rv=$v;function Pv(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Cv=Pv,xv="[object Arguments]";function Uv(e){return Tn(e)&&Er(e)==xv}var Ec=Uv,Kl=Object.prototype,Mv=Kl.hasOwnProperty,Bv=Kl.propertyIsEnumerable,Dv=Ec(function(){return arguments}())?Ec:function(e){return Tn(e)&&Mv.call(e,"callee")&&!Bv.call(e,"callee")},ra=Dv;function Lv(){return!1}var kv=Lv,zl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ic=zl&&typeof module=="object"&&module&&!module.nodeType&&module,jv=Ic&&Ic.exports===zl,Sc=jv?dt.Buffer:void 0,Fv=Sc?Sc.isBuffer:void 0,Vv=Fv||kv,ks=Vv,Kv="[object Arguments]",zv="[object Array]",qv="[object Boolean]",Gv="[object Date]",Wv="[object Error]",Hv="[object Function]",Jv="[object Map]",Xv="[object Number]",Yv="[object Object]",Qv="[object RegExp]",Zv="[object Set]",eb="[object String]",tb="[object WeakMap]",nb="[object ArrayBuffer]",rb="[object DataView]",ib="[object Float32Array]",ob="[object Float64Array]",sb="[object Int8Array]",ab="[object Int16Array]",ub="[object Int32Array]",cb="[object Uint8Array]",lb="[object Uint8ClampedArray]",fb="[object Uint16Array]",db="[object Uint32Array]",Me={};Me[ib]=Me[ob]=Me[sb]=Me[ab]=Me[ub]=Me[cb]=Me[lb]=Me[fb]=Me[db]=!0;Me[Kv]=Me[zv]=Me[nb]=Me[qv]=Me[rb]=Me[Gv]=Me[Wv]=Me[Hv]=Me[Jv]=Me[Xv]=Me[Yv]=Me[Qv]=Me[Zv]=Me[eb]=Me[tb]=!1;function pb(e){return Tn(e)&&na(e.length)&&!!Me[Er(e)]}var hb=pb;function yb(e){return function(t){return e(t)}}var ql=yb,Gl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ri=Gl&&typeof module=="object"&&module&&!module.nodeType&&module,gb=ri&&ri.exports===Gl,Ps=gb&&Tl.process,mb=function(){try{var e=ri&&ri.require&&ri.require("util").types;return e||Ps&&Ps.binding&&Ps.binding("util")}catch{}}(),Nc=mb,$c=Nc&&Nc.isTypedArray,vb=$c?ql($c):hb,Wl=vb,bb=Object.prototype,_b=bb.hasOwnProperty;function wb(e,t){var n=Ft(e),r=!n&&ra(e),i=!n&&!r&&ks(e),o=!n&&!r&&!i&&Wl(e),s=n||r||i||o,a=s?Cv(e.length,String):[],l=a.length;for(var c in e)(t||_b.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||To(c,l)))&&a.push(c);return a}var Tb=wb;function Ab(e,t){return function(n){return e(t(n))}}var Ob=Ab,Eb=Ob(Object.keys,Object),Ib=Eb,Sb=Object.prototype,Nb=Sb.hasOwnProperty;function $b(e){if(!Rv(e))return Ib(e);var t=[];for(var n in Object(e))Nb.call(e,n)&&n!="constructor"&&t.push(n);return t}var Rb=$b;function Pb(e){return Vl(e)?Tb(e):Rb(e)}var Hl=Pb,Cb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xb=/^\w*$/;function Ub(e,t){if(Ft(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Tr(e)?!0:xb.test(e)||!Cb.test(e)||t!=null&&e in Object(t)}var ia=Ub,Mb=Hn(Object,"create"),ai=Mb;function Bb(){this.__data__=ai?ai(null):{},this.size=0}var Db=Bb;function Lb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var kb=Lb,jb="__lodash_hash_undefined__",Fb=Object.prototype,Vb=Fb.hasOwnProperty;function Kb(e){var t=this.__data__;if(ai){var n=t[e];return n===jb?void 0:n}return Vb.call(t,e)?t[e]:void 0}var zb=Kb,qb=Object.prototype,Gb=qb.hasOwnProperty;function Wb(e){var t=this.__data__;return ai?t[e]!==void 0:Gb.call(t,e)}var Hb=Wb,Jb="__lodash_hash_undefined__";function Xb(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ai&&t===void 0?Jb:t,this}var Yb=Xb;function Ir(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])}}Ir.prototype.clear=Db;Ir.prototype.delete=kb;Ir.prototype.get=zb;Ir.prototype.has=Hb;Ir.prototype.set=Yb;var Rc=Ir;function Qb(){this.__data__=[],this.size=0}var Zb=Qb;function e_(e,t){for(var n=e.length;n--;)if(ta(e[n][0],t))return n;return-1}var Ao=e_,t_=Array.prototype,n_=t_.splice;function r_(e){var t=this.__data__,n=Ao(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():n_.call(t,n,1),--this.size,!0}var i_=r_;function o_(e){var t=this.__data__,n=Ao(t,e);return n<0?void 0:t[n][1]}var s_=o_;function a_(e){return Ao(this.__data__,e)>-1}var u_=a_;function c_(e,t){var n=this.__data__,r=Ao(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var l_=c_;function Sr(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])}}Sr.prototype.clear=Zb;Sr.prototype.delete=i_;Sr.prototype.get=s_;Sr.prototype.has=u_;Sr.prototype.set=l_;var Oo=Sr,f_=Hn(dt,"Map"),ui=f_;function d_(){this.size=0,this.__data__={hash:new Rc,map:new(ui||Oo),string:new Rc}}var p_=d_;function h_(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var y_=h_;function g_(e,t){var n=e.__data__;return y_(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Eo=g_;function m_(e){var t=Eo(this,e).delete(e);return this.size-=t?1:0,t}var v_=m_;function b_(e){return Eo(this,e).get(e)}var __=b_;function w_(e){return Eo(this,e).has(e)}var T_=w_;function A_(e,t){var n=Eo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var O_=A_;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=p_;Nr.prototype.delete=v_;Nr.prototype.get=__;Nr.prototype.has=T_;Nr.prototype.set=O_;var Io=Nr,E_="Expected a function";function oa(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(E_);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(oa.Cache||Io),n}oa.Cache=Io;var I_=oa,S_=500;function N_(e){var t=I_(e,function(r){return n.size===S_&&n.clear(),r}),n=t.cache;return t}var $_=N_,R_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P_=/\\(\\)?/g,C_=$_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(R_,function(n,r,i,o){t.push(i?o.replace(P_,"$1"):r||n)}),t}),x_=C_;function U_(e){return e==null?"":$y(e)}var M_=U_;function B_(e,t){return Ft(e)?e:ia(e,t)?[e]:x_(M_(e))}var So=B_,D_=1/0;function L_(e){if(typeof e=="string"||Tr(e))return e;var t=e+"";return t=="0"&&1/e==-D_?"-0":t}var di=L_;function k_(e,t){t=So(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[di(t[n++])];return n&&n==r?e:void 0}var sa=k_;function j_(e,t,n){var r=e==null?void 0:sa(e,t);return r===void 0?n:r}var F_=j_;function V_(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Jl=V_,Pc=Ht?Ht.isConcatSpreadable:void 0;function K_(e){return Ft(e)||ra(e)||!!(Pc&&e&&e[Pc])}var z_=K_;function Xl(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=z_),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?Xl(a,t-1,n,r,i):Jl(i,a):r||(i[i.length]=a)}return i}var q_=Xl;function G_(e){var t=e==null?0:e.length;return t?q_(e,1):[]}var W_=G_;function H_(e){return Zs(jl(e,void 0,W_),e+"")}var J_=H_;function X_(){this.__data__=new Oo,this.size=0}var Y_=X_;function Q_(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Z_=Q_;function ew(e){return this.__data__.get(e)}var tw=ew;function nw(e){return this.__data__.has(e)}var rw=nw,iw=200;function ow(e,t){var n=this.__data__;if(n instanceof Oo){var r=n.__data__;if(!ui||r.length<iw-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Io(r)}return n.set(e,t),this.size=n.size,this}var sw=ow;function $r(e){var t=this.__data__=new Oo(e);this.size=t.size}$r.prototype.clear=Y_;$r.prototype.delete=Z_;$r.prototype.get=tw;$r.prototype.has=rw;$r.prototype.set=sw;var Qi=$r;function aw(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 uw=aw;function cw(){return[]}var lw=cw,fw=Object.prototype,dw=fw.propertyIsEnumerable,Cc=Object.getOwnPropertySymbols,pw=Cc?function(e){return e==null?[]:(e=Object(e),uw(Cc(e),function(t){return dw.call(e,t)}))}:lw,hw=pw;function yw(e,t,n){var r=t(e);return Ft(e)?r:Jl(r,n(e))}var gw=yw;function mw(e){return gw(e,Hl,hw)}var xc=mw,vw=Hn(dt,"DataView"),js=vw,bw=Hn(dt,"Promise"),Fs=bw,_w=Hn(dt,"Set"),wr=_w,Uc="[object Map]",ww="[object Object]",Mc="[object Promise]",Bc="[object Set]",Dc="[object WeakMap]",Lc="[object DataView]",Tw=Wn(js),Aw=Wn(ui),Ow=Wn(Fs),Ew=Wn(wr),Iw=Wn(ii),zn=Er;(js&&zn(new js(new ArrayBuffer(1)))!=Lc||ui&&zn(new ui)!=Uc||Fs&&zn(Fs.resolve())!=Mc||wr&&zn(new wr)!=Bc||ii&&zn(new ii)!=Dc)&&(zn=function(e){var t=Er(e),n=t==ww?e.constructor:void 0,r=n?Wn(n):"";if(r)switch(r){case Tw:return Lc;case Aw:return Uc;case Ow:return Mc;case Ew:return Bc;case Iw:return Dc}return t});var kc=zn,Sw=dt.Uint8Array,jc=Sw,Nw="__lodash_hash_undefined__";function $w(e){return this.__data__.set(e,Nw),this}var Rw=$w;function Pw(e){return this.__data__.has(e)}var Cw=Pw;function co(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Io;++t<n;)this.add(e[t])}co.prototype.add=co.prototype.push=Rw;co.prototype.has=Cw;var Yl=co;function xw(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 Uw=xw;function Mw(e,t){return e.has(t)}var Ql=Mw,Bw=1,Dw=2;function Lw(e,t,n,r,i,o){var s=n&Bw,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&Dw?new Yl:void 0;for(o.set(e,t),o.set(t,e);++g<a;){var S=e[g],V=t[g];if(r)var J=s?r(V,S,g,t,e,o):r(S,V,g,e,t,o);if(J!==void 0){if(J)continue;C=!1;break}if(I){if(!Uw(t,function(F,k){if(!Ql(I,k)&&(S===F||i(S,F,n,r,o)))return I.push(k)})){C=!1;break}}else if(!(S===V||i(S,V,n,r,o))){C=!1;break}}return o.delete(e),o.delete(t),C}var Zl=Lw;function kw(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var jw=kw;function Fw(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var ef=Fw,Vw=1,Kw=2,zw="[object Boolean]",qw="[object Date]",Gw="[object Error]",Ww="[object Map]",Hw="[object Number]",Jw="[object RegExp]",Xw="[object Set]",Yw="[object String]",Qw="[object Symbol]",Zw="[object ArrayBuffer]",eT="[object DataView]",Fc=Ht?Ht.prototype:void 0,Cs=Fc?Fc.valueOf:void 0;function tT(e,t,n,r,i,o,s){switch(n){case eT:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Zw:return!(e.byteLength!=t.byteLength||!o(new jc(e),new jc(t)));case zw:case qw:case Hw:return ta(+e,+t);case Gw:return e.name==t.name&&e.message==t.message;case Jw:case Yw:return e==t+"";case Ww:var a=jw;case Xw:var l=r&Vw;if(a||(a=ef),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=Kw,s.set(e,t);var d=Zl(a(e),a(t),r,i,o,s);return s.delete(e),d;case Qw:if(Cs)return Cs.call(e)==Cs.call(t)}return!1}var nT=tT,rT=1,iT=Object.prototype,oT=iT.hasOwnProperty;function sT(e,t,n,r,i,o){var s=n&rT,a=xc(e),l=a.length,c=xc(t),d=c.length;if(l!=d&&!s)return!1;for(var g=l;g--;){var C=a[g];if(!(s?C in t:oT.call(t,C)))return!1}var I=o.get(e),S=o.get(t);if(I&&S)return I==t&&S==e;var V=!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 z=s?r(k,F,C,t,e,o):r(F,k,C,e,t,o);if(!(z===void 0?F===k||i(F,k,n,r,o):z)){V=!1;break}J||(J=C=="constructor")}if(V&&!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)&&(V=!1)}return o.delete(e),o.delete(t),V}var aT=sT,uT=1,Vc="[object Arguments]",Kc="[object Array]",Yi="[object Object]",cT=Object.prototype,zc=cT.hasOwnProperty;function lT(e,t,n,r,i,o){var s=Ft(e),a=Ft(t),l=s?Kc:kc(e),c=a?Kc:kc(t);l=l==Vc?Yi:l,c=c==Vc?Yi:c;var d=l==Yi,g=c==Yi,C=l==c;if(C&&ks(e)){if(!ks(t))return!1;s=!0,d=!1}if(C&&!d)return o||(o=new Qi),s||Wl(e)?Zl(e,t,n,r,i,o):nT(e,t,l,n,r,i,o);if(!(n&uT)){var I=d&&zc.call(e,"__wrapped__"),S=g&&zc.call(t,"__wrapped__");if(I||S){var V=I?e.value():e,J=S?t.value():t;return o||(o=new Qi),i(V,J,n,r,o)}}return C?(o||(o=new Qi),aT(e,t,n,r,i,o)):!1}var fT=lT;function tf(e,t,n,r,i){return e===t?!0:e==null||t==null||!Tn(e)&&!Tn(t)?e!==e&&t!==t:fT(e,t,n,r,tf,i)}var nf=tf,dT=1,pT=2;function hT(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 Qi;if(r)var C=r(c,d,l,e,t,g);if(!(C===void 0?nf(d,c,dT|pT,r,g):C))return!1}}return!0}var yT=hT;function gT(e){return e===e&&!on(e)}var rf=gT;function mT(e){for(var t=Hl(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,rf(i)]}return t}var vT=mT;function bT(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var of=bT;function _T(e){var t=vT(e);return t.length==1&&t[0][2]?of(t[0][0],t[0][1]):function(n){return n===e||yT(n,e,t)}}var wT=_T;function TT(e,t){return e!=null&&t in Object(e)}var AT=TT;function OT(e,t,n){t=So(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=di(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&&na(i)&&To(s,i)&&(Ft(e)||ra(e)))}var ET=OT;function IT(e,t){return e!=null&&ET(e,t,AT)}var sf=IT,ST=1,NT=2;function $T(e,t){return ia(e)&&rf(t)?of(di(e),t):function(n){var r=F_(n,e);return r===void 0&&r===t?sf(n,e):nf(t,r,ST|NT)}}var RT=$T;function PT(e){return function(t){return t?.[e]}}var CT=PT;function xT(e){return function(t){return sa(t,e)}}var UT=xT;function MT(e){return ia(e)?CT(di(e)):UT(e)}var BT=MT;function DT(e){return typeof e=="function"?e:e==null?wo:typeof e=="object"?Ft(e)?RT(e[0],e[1]):wT(e):BT(e)}var LT=DT;function kT(e){return Tn(e)&&Vl(e)}var jT=kT;function FT(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 VT=FT,KT=200;function zT(e,t,n,r){var i=-1,o=Ml,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Ol(t,ql(n))),r?(o=VT,s=!1):t.length>=KT&&(o=Ql,s=!1,t=new Yl(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 qT=zT;function GT(e,t,n,r){if(!on(e))return e;t=So(t,e);for(var i=-1,o=t.length,s=o-1,a=e;a!=null&&++i<o;){var l=di(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=on(d)?d:To(t[i+1])?[]:{})}Tv(a,l,c),a=a[l]}return e}var WT=GT;function HT(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=sa(e,s);n(a,s)&&WT(o,So(s,e),a)}return o}var JT=HT,XT=32,aa=Fl(function(e,t){var n=si(t,ea(aa));return yv(e,XT,void 0,t,n)});aa.placeholder={};var YT=aa;function QT(e,t){return JT(e,t,function(n,r){return sf(e,r)})}var ZT=QT,e0=J_(function(e,t){return e==null?{}:ZT(e,t)}),qc=e0,t0=4294967295,n0=t0-1,r0=Math.floor,i0=Math.min;function o0(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=Tr(t),c=t===void 0;i<o;){var d=r0((i+o)/2),g=n(e[d]),C=g!==void 0,I=g===null,S=g===g,V=Tr(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||!V):I||V?J=!1:J=r?g<=t:g<t;J?i=d+1:o=d}return i0(o,n0)}var s0=o0;function a0(e,t,n){return s0(e,t,LT(n,2))}var u0=a0,c0=1/0,uS=wr&&1/ef(new wr([,-0]))[1]==c0?function(e){return new wr(e)}:Rl;var l0=Fl(function(e,t){return jT(e)?qT(e,t):[]}),Gc=l0,af=Et(ey(),1),cS=af.default.configure,Gn=af.default,xs=100,{WARN:f0,LOG:lS,DEBUG:qe,VERBOSE:we,ERROR:fS}=Ne.setup(Ne.INFO),lo=Ce.set();Wu({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var We=({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:Gn(r)}}`:""}`));function uf(e,t){return Pe(()=>Ve.structural(e.get(),t.get()))}function Rr(e,t){return Ve.shallow(e.applogs,t.applogs)}function No(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),!Ve.structural(r.variables,i.variables))return we.isEnabled&&we("[queryNodesComparer] changed vars:",n,r,i),!1;if(!Rr(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 d0=0;function Jt(e,{name:t,equals:n}={}){let r=`observableArrayMap@${++d0}{${t}}`;we.isEnabled&&we(`[${r}] create`,{fnname:e.name,fn:e,name:t,equals:n});let i,o=lf(e,a=>{i?Pe(()=>(n??Ve.structural)(i,a))?qe.isEnabled&&qe(`[${r}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),qe.isEnabled&&qe(`[${r}] updated`,{updatedItems:a,observableArr:i})):i=Ce.array(a,{deep:!1,name:t,equals:n})},{name:r});if(r.includes("useRoots")){var s=Tt(i);qe(`[${r}] deps`,{disposeAutorun:o,rootsAtom:s,observableArr:i,observers:Xr(i)}),gr(()=>lo.add(s))}return we.isEnabled&&mr(i,()=>{we(`[${r}] observed`,Xr(i),{rootsAtom:s,observableArr:i})}),jn(i,()=>{we.isEnabled&&we(`[${r}] dispose`),s&&gr(()=>lo.delete(s)),o()}),i}var p0=0;function cf(e,{name:t}={}){let n=`observableSetMap@${++p0}{${t}}`;we.isEnabled&&we(`[${n}] create`,{fnname:e.name,fn:e,name:t});let r,i=lf(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 qe.isEnabled&&qe(`[${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=Tt(r);qe.isEnabled&&qe(`[${n}] deps`,{disposeAutorun:i,rootsAtom:o,observableSet:r,observers:Xr(r)}),gr(()=>lo.add(o))}return we.isEnabled&&mr(r,()=>{we(`[${n}] observed`,Xr(r),{rootsAtom:o,observableSet:r})}),jn(r,()=>{we.isEnabled&&we(`[${n}] dispose`),o&&gr(()=>lo.delete(o)),i()}),r}function lf(e,t=null,{name:n}={}){qe.isEnabled&&qe("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:n});let r=`${n}.autorunImm`,i,o=new Dt(r,function(...c){qe.isEnabled&&qe(`[${r}] reaction.invalidate`,c),s()});function s(){o.track(function(){let c=xs&&performance.now();qe.isEnabled&&qe(`[${r}] runAndTrack:`,{name:n??e.name,fn:e}),i=e(),qe.isEnabled&&qe(`[${r}] runAndTrack =>`,i),gr(()=>{t?.(i)}),xs&&performance.now()-c>xs&&f0(`[${r}] took ${performance.now()-c}ms`)})}return s(),qe.isEnabled&&qe(`[${r}] deps of reaction`,{reaction:o,result:i,deps:Jr(o)}),()=>{we.isEnabled&&we(`[${r}] dispose`),setTimeout(()=>o.dispose())}}function Xe(e,t,n=!1){if(hn(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 Ar&&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(y0(I,c)){l=S;break}else if(we.isEnabled)for(let V=0;V<I.length;V++)I[V]instanceof Ar&&I[V].name===a[V].name&&Ve.structural(Gc(I,I[V]),Gc(c,c[V]))&&we.force(`[${d}] threadState mismatch => cachebust`,{diffFields:Object.keys(I[V]).filter(J=>!Ve.structural(I[V][J],a[V][J])),cacheArg:I[V],freshArg:a[V]});if(l){let I=l.get();return we.isEnabled&&we(`[${d}] cache hit`,{untrackedArgs:c,cachedResult:I}),I}if(!o.keepAlive&&!$u())return!r&&xu().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=De(()=>(we.isEnabled&&we(`[${d}] update->rerun`,Pe(()=>({args:a})),t),we.isEnabled&&ms(),g=t.apply(this,a)),{...o,name:d});if(we.isEnabled&&we(`[${d}] deps`,Jr(C),{untrackedArgs:c}),s.set(c,C),!o.keepAlive){let I=jn(C,()=>{we.isEnabled&&we(`[${d}] dispose`,C),I(),s.delete(c),o.onCleanup&&o.onCleanup(g,...a),g=void 0})}return C.get()}}function h0(e){let t=0,n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];o==="("?n+=o+`
|
|
57
|
+
`+" ".repeat(++t):o===")"?n+=`
|
|
58
|
+
`+" ".repeat(--t)+o:o===","&&r===0?n+=o+`
|
|
59
|
+
`+" ".repeat(t):o==="{"&&r===0?(r++,n+=o+`
|
|
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 y0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]instanceof Ar){if(t[n]!==e[n])return!1}else if(!Ve.structural(e[n],t[n]))return!1;return!0}var{WARN:Wc,LOG:dS,DEBUG:g0,VERBOSE:pS,ERROR:Vn}=Ne.setup(Ne.INFO,{prefix:"[thread]"});function sn(e){return e.init!==void 0}var Ar=class{constructor(e,t,n,r=[],i={}){this.name=e,this._applogs=r,this.parents=t===null?null:oc(t),this.filters=n,Pe(()=>this.parents?.length===0)&&Wc("[Thread] empty parents array",e),i.skipObservable||mn(this,{applogsCids:De,applogsByCid:De,insert:ot,size:De,isEmpty:De,firstLog:De,latestLog:De},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw Vn("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Vn("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Vn("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw Vn("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Vn("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Vn("[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):Wc("unsubscribe called for non-existent",e)}notifySubscribers(e){g0(`[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 Vn("[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 h0(this.name)}get hasParents(){return!!this.parents?.length}};var ff=class df extends Ar{static fromArray(t,n){return new df(n||"static",null,[],t)}constructor(t,n,r,i){super(t,n,r,i,{skipObservable:!0})}get readOnly(){return!0}},pf={};Os(pf,{code:()=>xf,decode:()=>Ta,encode:()=>wa,format:()=>il,name:()=>S1,parse:()=>$1,stringify:()=>il});var m0=["string","number","bigint","symbol"],v0=["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 b0(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(m0.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(_0(e))return"Buffer";let n=w0(e);return n||"Object"}function _0(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function w0(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(v0.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}`}},Pr=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",T0=new TextDecoder,A0=new TextEncoder;function fo(e){return Pr&&globalThis.Buffer.isBuffer(e)}function ua(e){return e instanceof Uint8Array?fo(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var O0=Pr?(e,t,n)=>n-t>64?globalThis.Buffer.from(e.subarray(t,n)).toString("utf8"):Jc(e,t,n):(e,t,n)=>n-t>64?T0.decode(e.subarray(t,n)):Jc(e,t,n),hf=Pr?e=>e.length>64?globalThis.Buffer.from(e):Hc(e):e=>e.length>64?A0.encode(e):Hc(e),ca=Pr?(e,t,n)=>fo(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n):(e,t,n)=>e.slice(t,n),E0=Pr?(e,t)=>(e=e.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),ua(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},I0=Pr?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function S0(e,t){if(fo(e)&&fo(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 Hc(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 Jc(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 yf(r)}var Xc=4096;function yf(e){let t=e.length;if(t<=Xc)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Xc));return n}var N0=256,gf=class{constructor(e=N0){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=I0(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=ca(n,0,this.cursor)}else t=E0(this.chunks,this.cursor);return e&&this.reset(),t}},ye="CBOR decode error:",qn="CBOR encode error:",pi=[];pi[23]=1;pi[24]=2;pi[25]=3;pi[26]=5;pi[27]=9;function Cr(e,t,n){if(e.length-t<n)throw new Error(`${ye} not enough data for type`)}var Je=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Jn(e,t,n){Cr(e,t,1);let r=e[t];if(n.strict===!0&&r<Je[0])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return r}function Xn(e,t,n){Cr(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<Je[1])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return r}function Yn(e,t,n){Cr(e,t,4);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(n.strict===!0&&r<Je[2])throw new Error(`${ye} integer encoded in more bytes than necessary (strict decode)`);return r}function Qn(e,t,n){Cr(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<Je[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 $0(e,t,n,r){return new ie(B.uint,Jn(e,t+1,r),2)}function R0(e,t,n,r){return new ie(B.uint,Xn(e,t+1,r),3)}function P0(e,t,n,r){return new ie(B.uint,Yn(e,t+1,r),5)}function C0(e,t,n,r){return new ie(B.uint,Qn(e,t+1,r),9)}function Zn(e,t){return Nt(e,0,t.value)}function Nt(e,t,n){if(n<Je[0]){let r=Number(n);e.push([t|r])}else if(n<Je[1]){let r=Number(n);e.push([t|24,r])}else if(n<Je[2]){let r=Number(n);e.push([t|25,r>>>8,r&255])}else if(n<Je[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<Je[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`)}}Zn.encodedSize=function(t){return Nt.encodedSize(t.value)};Nt.encodedSize=function(t){return t<Je[0]?1:t<Je[1]?2:t<Je[2]?3:t<Je[3]?5:9};Zn.compareTokens=function(t,n){return t.value<n.value?-1:t.value>n.value?1:0};function x0(e,t,n,r){return new ie(B.negint,-1-Jn(e,t+1,r),2)}function U0(e,t,n,r){return new ie(B.negint,-1-Xn(e,t+1,r),3)}function M0(e,t,n,r){return new ie(B.negint,-1-Yn(e,t+1,r),5)}var la=BigInt(-1),mf=BigInt(1);function B0(e,t,n,r){let i=Qn(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,la-BigInt(i),9)}function fa(e,t){let n=t.value,r=typeof n=="bigint"?n*la-mf:n*-1-1;Nt(e,t.type.majorEncoded,r)}fa.encodedSize=function(t){let n=t.value,r=typeof n=="bigint"?n*la-mf:n*-1-1;return r<Je[0]?1:r<Je[1]?2:r<Je[2]?3:r<Je[3]?5:9};fa.compareTokens=function(t,n){return t.value<n.value?1:t.value>n.value?-1:0};function hi(e,t,n,r){Cr(e,t,n+r);let i=ca(e,t+n,t+n+r);return new ie(B.bytes,i,n+r)}function D0(e,t,n,r){return hi(e,t,1,n)}function L0(e,t,n,r){return hi(e,t,2,Jn(e,t+1,r))}function k0(e,t,n,r){return hi(e,t,3,Xn(e,t+1,r))}function j0(e,t,n,r){return hi(e,t,5,Yn(e,t+1,r))}function F0(e,t,n,r){let i=Qn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer bytes lengths not supported`);return hi(e,t,9,i)}function po(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===B.string?hf(e.value):e.value),e.encodedBytes}function $o(e,t){let n=po(t);Nt(e,t.type.majorEncoded,n.length),e.push(n)}$o.encodedSize=function(t){let n=po(t);return Nt.encodedSize(n.length)+n.length};$o.compareTokens=function(t,n){return V0(po(t),po(n))};function V0(e,t){return e.length<t.length?-1:e.length>t.length?1:S0(e,t)}function yi(e,t,n,r,i){let o=n+r;Cr(e,t,o);let s=new ie(B.string,O0(e,t+n,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=ca(e,t+n,t+o)),s}function K0(e,t,n,r){return yi(e,t,1,n,r)}function z0(e,t,n,r){return yi(e,t,2,Jn(e,t+1,r),r)}function q0(e,t,n,r){return yi(e,t,3,Xn(e,t+1,r),r)}function G0(e,t,n,r){return yi(e,t,5,Yn(e,t+1,r),r)}function W0(e,t,n,r){let i=Qn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer string lengths not supported`);return yi(e,t,9,i,r)}var H0=$o;function xr(e,t,n,r){return new ie(B.array,r,n)}function J0(e,t,n,r){return xr(e,t,1,n)}function X0(e,t,n,r){return xr(e,t,2,Jn(e,t+1,r))}function Y0(e,t,n,r){return xr(e,t,3,Xn(e,t+1,r))}function Q0(e,t,n,r){return xr(e,t,5,Yn(e,t+1,r))}function Z0(e,t,n,r){let i=Qn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer array lengths not supported`);return xr(e,t,9,i)}function eA(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return xr(e,t,1,1/0)}function da(e,t){Nt(e,B.array.majorEncoded,t.value)}da.compareTokens=Zn.compareTokens;da.encodedSize=function(t){return Nt.encodedSize(t.value)};function Ur(e,t,n,r){return new ie(B.map,r,n)}function tA(e,t,n,r){return Ur(e,t,1,n)}function nA(e,t,n,r){return Ur(e,t,2,Jn(e,t+1,r))}function rA(e,t,n,r){return Ur(e,t,3,Xn(e,t+1,r))}function iA(e,t,n,r){return Ur(e,t,5,Yn(e,t+1,r))}function oA(e,t,n,r){let i=Qn(e,t+1,r);if(typeof i=="bigint")throw new Error(`${ye} 64-bit integer map lengths not supported`);return Ur(e,t,9,i)}function sA(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${ye} indefinite length items not allowed`);return Ur(e,t,1,1/0)}function pa(e,t){Nt(e,B.map.majorEncoded,t.value)}pa.compareTokens=Zn.compareTokens;pa.encodedSize=function(t){return Nt.encodedSize(t.value)};function aA(e,t,n,r){return new ie(B.tag,n,1)}function uA(e,t,n,r){return new ie(B.tag,Jn(e,t+1,r),2)}function cA(e,t,n,r){return new ie(B.tag,Xn(e,t+1,r),3)}function lA(e,t,n,r){return new ie(B.tag,Yn(e,t+1,r),5)}function fA(e,t,n,r){return new ie(B.tag,Qn(e,t+1,r),9)}function ha(e,t){Nt(e,B.tag.majorEncoded,t.value)}ha.compareTokens=Zn.compareTokens;ha.encodedSize=function(t){return Nt.encodedSize(t.value)};var dA=20,pA=21,hA=22,yA=23;function gA(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 mA(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 ya(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 vA(e,t,n,r){return ya(ma(e,t+1),3,r)}function bA(e,t,n,r){return ya(va(e,t+1),5,r)}function _A(e,t,n,r){return ya(wf(e,t+1),9,r)}function ga(e,t,n){let r=t.value;if(r===!1)e.push([B.float.majorEncoded|dA]);else if(r===!0)e.push([B.float.majorEncoded|pA]);else if(r===null)e.push([B.float.majorEncoded|hA]);else if(r===void 0)e.push([B.float.majorEncoded|yA]);else{let i,o=!1;(!n||n.float64!==!0)&&(bf(r),i=ma(jt,1),r===i||Number.isNaN(r)?(jt[0]=249,e.push(jt.slice(0,3)),o=!0):(_f(r),i=va(jt,1),r===i&&(jt[0]=250,e.push(jt.slice(0,5)),o=!0))),o||(wA(r),i=wf(jt,1),jt[0]=251,e.push(jt.slice(0,9)))}}ga.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){bf(r);let i=ma(jt,1);if(r===i||Number.isNaN(r))return 3;if(_f(r),i=va(jt,1),r===i)return 5}return 9};var vf=new ArrayBuffer(9),It=new DataView(vf,1),jt=new Uint8Array(vf,0);function bf(e){if(e===1/0)It.setUint16(0,31744,!1);else if(e===-1/0)It.setUint16(0,64512,!1);else if(Number.isNaN(e))It.setUint16(0,32256,!1);else{It.setFloat32(0,e);let t=It.getUint32(0),n=(t&2139095040)>>23,r=t&8388607;if(n===255)It.setUint16(0,31744,!1);else if(n===0)It.setUint16(0,(e&2147483648)>>16|r>>13,!1);else{let i=n-127;i<-24?It.setUint16(0,0):i<-14?It.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):It.setUint16(0,(t&2147483648)>>16|i+15<<10|r>>13,!1)}}}function ma(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 _f(e){It.setFloat32(0,e,!1)}function va(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 wA(e){It.setFloat64(0,e,!1)}function wf(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)}ga.compareTokens=Zn.compareTokens;function Ee(e,t,n){throw new Error(`${ye} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function Ro(e){return()=>{throw new Error(`${ye} ${e}`)}}var se=[];for(let e=0;e<=23;e++)se[e]=Ee;se[24]=$0;se[25]=R0;se[26]=P0;se[27]=C0;se[28]=Ee;se[29]=Ee;se[30]=Ee;se[31]=Ee;for(let e=32;e<=55;e++)se[e]=Ee;se[56]=x0;se[57]=U0;se[58]=M0;se[59]=B0;se[60]=Ee;se[61]=Ee;se[62]=Ee;se[63]=Ee;for(let e=64;e<=87;e++)se[e]=D0;se[88]=L0;se[89]=k0;se[90]=j0;se[91]=F0;se[92]=Ee;se[93]=Ee;se[94]=Ee;se[95]=Ro("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)se[e]=K0;se[120]=z0;se[121]=q0;se[122]=G0;se[123]=W0;se[124]=Ee;se[125]=Ee;se[126]=Ee;se[127]=Ro("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)se[e]=J0;se[152]=X0;se[153]=Y0;se[154]=Q0;se[155]=Z0;se[156]=Ee;se[157]=Ee;se[158]=Ee;se[159]=eA;for(let e=160;e<=183;e++)se[e]=tA;se[184]=nA;se[185]=rA;se[186]=iA;se[187]=oA;se[188]=Ee;se[189]=Ee;se[190]=Ee;se[191]=sA;for(let e=192;e<=215;e++)se[e]=aA;se[216]=uA;se[217]=cA;se[218]=lA;se[219]=fA;se[220]=Ee;se[221]=Ee;se[222]=Ee;se[223]=Ee;for(let e=224;e<=243;e++)se[e]=Ro("simple values are not supported");se[244]=Ee;se[245]=Ee;se[246]=Ee;se[247]=gA;se[248]=Ro("simple values are not supported");se[249]=vA;se[250]=bA;se[251]=_A;se[252]=Ee;se[253]=Ee;se[254]=Ee;se[255]=mA;var Xt=[];for(let e=0;e<24;e++)Xt[e]=new ie(B.uint,e,1);for(let e=-1;e>=-24;e--)Xt[31-e]=new ie(B.negint,e,1);Xt[64]=new ie(B.bytes,new Uint8Array(0),1);Xt[96]=new ie(B.string,"",1);Xt[128]=new ie(B.array,0,1);Xt[160]=new ie(B.map,0,1);Xt[244]=new ie(B.false,!1,1);Xt[245]=new ie(B.true,!0,1);Xt[246]=new ie(B.null,null,1);function TA(){let e=[];return e[B.uint.major]=Zn,e[B.negint.major]=fa,e[B.bytes.major]=$o,e[B.string.major]=H0,e[B.array.major]=da,e[B.map.major]=pa,e[B.tag.major]=ha,e[B.float.major]=ga,e}var hS=TA(),Us=new gf,Yc=class Tf{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(`${qn} object contains circular references`);return new Tf(n,t)}},vn={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)},An={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?vn.true:vn.false},null(e,t,n,r){return vn.null},undefined(e,t,n,r){return vn.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?[vn.emptyArray,new ie(B.break)]:vn.emptyArray;r=Yc.createCheck(r,e);let i=[],o=0;for(let s of e)i[o++]=Zi(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?[vn.emptyMap,new ie(B.break)]:vn.emptyMap;r=Yc.createCheck(r,e);let a=[],l=0;for(let c of o)a[l++]=[Zi(c,n,r),Zi(i?e.get(c):e[c],n,r)];return AA(a,n),n.addBreakTokens?[new ie(B.map,s),a,new ie(B.break)]:[new ie(B.map,s),a]}};An.Map=An.Object;An.Buffer=An.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))An[`${e}Array`]=An.DataView;function Zi(e,t={},n){let r=b0(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||An[r];if(typeof i=="function"){let s=i(e,r,t,n);if(s!=null)return s}let o=An[r];if(!o)throw new Error(`${qn} unsupported type: ${r}`);return o(e,r,t,n)}function AA(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Af(e,t,n,r){if(Array.isArray(t))for(let i of t)Af(e,i,n,r);else n[t.type.major](e,t,r)}function OA(e,t,n){let r=Zi(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 gf(s);if(o(a,r,n),a.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return ua(a.chunks[0])}}return Us.reset(),Af(Us,r,t,n),Us.toBytes(!0)}var EA={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},IA=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=Xt[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}},ci=Symbol.for("DONE"),Po=Symbol.for("BREAK");function SA(e,t,n){let r=[];for(let i=0;i<e.value;i++){let o=li(t,n);if(o===Po){if(e.value===1/0)break;throw new Error(`${ye} got unexpected break to lengthed array`)}if(o===ci)throw new Error(`${ye} found array but not enough entries (got ${i}, expected ${e.value})`);r[i]=o}return r}function NA(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=li(t,n);if(a===Po){if(e.value===1/0)break;throw new Error(`${ye} got unexpected break to lengthed map`)}if(a===ci)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=li(t,n);if(l===ci)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 li(e,t){if(e.done())return ci;let n=e.next();if(n.type===B.break)return Po;if(n.type.terminal)return n.value;if(n.type===B.array)return SA(n,e,t);if(n.type===B.map)return NA(n,e,t);if(n.type===B.tag){if(t.tags&&typeof t.tags[n.value]=="function"){let r=li(e,t);return t.tags[n.value](r)}throw new Error(`${ye} tag not supported (${n.value})`)}throw new Error("unsupported")}function $A(e,t){if(!(e instanceof Uint8Array))throw new Error(`${ye} data to decode must be a Uint8Array`);t=Object.assign({},EA,t);let n=t.tokenizer||new IA(e,t),r=li(n,t);if(r===ci)throw new Error(`${ye} did not find any content to decode`);if(r===Po)throw new Error(`${ye} got unexpected break`);return[r,e.subarray(n.pos())]}function RA(e,t){let[n,r]=$A(e,t);if(r.length>0)throw new Error(`${ye} too many terminals, data makes no sense`);return n}var PA=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(`${qn} unsupported type: Uint8Array`)}[B.string.major](e,t){this.prefix(e);let n=hf(JSON.stringify(t.value));e.push(n.length>32?ua(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(`${qn} 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 CA(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${qn} 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(`${qn} non-string map keys are not supported`);if(n<r)return-1;if(n>r)return 1;throw new Error(`${qn} unexpected duplicate map keys, this is not supported`)}var xA={addBreakTokens:!0,mapSorter:CA};function UA(e,t){return t=Object.assign({},xA,t),OA(e,new PA,t)}var Of=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,yf(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 MA(e,t){return t=Object.assign({tokenizer:new Of(e,t)},t),RA(e,t)}var yS=new Uint8Array(0);function BA(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 ba(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 DA(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 V=0,J=0,F=0,k=S.length;F!==k&&S[F]===0;)F++,V++;for(var z=(k-F)*d+1>>>0,W=new Uint8Array(z);F!==k;){for(var j=S[F],Z=0,G=z-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=z-J;fe!==z&&W[fe]===0;)fe++;for(var x=l.repeat(V);fe<z;++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 V=0;if(S[V]!==" "){for(var J=0,F=0;S[V]===l;)J++,V++;for(var k=(S.length-V)*c+1>>>0,z=new Uint8Array(k);S[V];){var W=n[S.charCodeAt(V)];if(W===255)return;for(var j=0,Z=k-1;(W!==0||j<F)&&Z!==-1;Z--,j++)W+=a*z[Z]>>>0,z[Z]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");F=j,V++}if(S[V]!==" "){for(var G=k-F;G!==k&&z[G]===0;)G++;for(var fe=new Uint8Array(J+(k-G)),x=J;G!==k;)fe[x++]=z[G++];return fe}}}function I(S){var V=C(S);if(V)return V;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:C,decode:I}}var LA=DA,kA=LA,jA=kA,FA=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")}},VA=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 Ef(this,e)}},KA=class{decoders;constructor(e){this.decoders=e}or(e){return Ef(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 Ef(e,t){return new KA({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var zA=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 FA(e,t,n),this.decoder=new VA(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function If({name:e,prefix:t,encode:n,decode:r}){return new zA(e,t,n,r)}function Co({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=jA(n,e);return If({prefix:t,name:e,encode:r,decode:o=>ba(i(o))})}function qA(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 GA(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 WA(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function pt({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=WA(r);return If({prefix:t,name:e,encode(o){return GA(o,r,n)},decode(o){return qA(o,i,n,e)}})}var eo=pt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),gS=pt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),mS=pt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),vS=pt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),bS=pt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),_S=pt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),wS=pt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),TS=pt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),AS=pt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Ms=Co({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),OS=Co({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),wn=Co({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ES=Co({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Sf={};Os(Sf,{Digest:()=>xo,create:()=>_a,decode:()=>$f,equals:()=>Rf,hasCode:()=>d1});var HA=Nf,Qc=128,JA=127,XA=~JA,YA=Math.pow(2,31);function Nf(e,t,n){t=t||[],n=n||0;for(var r=n;e>=YA;)t[n++]=e&255|Qc,e/=128;for(;e&XA;)t[n++]=e&255|Qc,e>>>=7;return t[n]=e|0,Nf.bytes=n-r+1,t}var QA=Vs,ZA=128,Zc=127;function Vs(e,r){var n=0,r=r||0,i=0,o=r,s,a=e.length;do{if(o>=a)throw Vs.bytes=0,new RangeError("Could not decode varint");s=e[o++],n+=i<28?(s&Zc)<<i:(s&Zc)*Math.pow(2,i),i+=7}while(s>=ZA);return Vs.bytes=o-r,n}var e1=Math.pow(2,7),t1=Math.pow(2,14),n1=Math.pow(2,21),r1=Math.pow(2,28),i1=Math.pow(2,35),o1=Math.pow(2,42),s1=Math.pow(2,49),a1=Math.pow(2,56),u1=Math.pow(2,63),c1=function(e){return e<e1?1:e<t1?2:e<n1?3:e<r1?4:e<i1?5:e<o1?6:e<s1?7:e<a1?8:e<u1?9:10},l1={encode:HA,decode:QA,encodingLength:c1},f1=l1,ho=f1;function Ks(e,t=0){return[ho.decode(e,t),ho.decode.bytes]}function yo(e,t,n=0){return ho.encode(e,t,n),t}function go(e){return ho.encodingLength(e)}function _a(e,t){let n=t.byteLength,r=go(e),i=r+go(n),o=new Uint8Array(i+n);return yo(e,o,0),yo(n,o,r),o.set(t,i),new xo(e,n,t,o)}function $f(e){let t=ba(e),[n,r]=Ks(t),[i,o]=Ks(t.subarray(r)),s=t.subarray(r+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new xo(n,i,s,t)}function Rf(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&BA(e.bytes,n.bytes)}}var xo=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};function d1(e,t){return e.code===t}function el(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return h1(n,zs(e),t??wn.encoder);default:return y1(n,zs(e),t??eo.encoder)}}var tl=new WeakMap;function zs(e){let t=tl.get(e);if(t==null){let n=new Map;return tl.set(e,n),n}return t}var Uo=class Ze{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!==ti)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==g1)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ze.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=_a(t,n);return Ze.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 Ze.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&Rf(t.multihash,r.multihash)}toString(t){return el(this,t)}toJSON(){return{"/":el(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 Ze)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:o,bytes:s}=n;return new Ze(r,i,o,s??nl(r,i,o.bytes))}else if(n[m1]===!0){let{version:r,multihash:i,code:o}=n,s=$f(i);return Ze.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!==ti)throw new Error(`Version 0 CID must use dag-pb (code: ${ti}) block encoding`);return new Ze(t,n,r,r.bytes)}case 1:{let i=nl(t,n,r.bytes);return new Ze(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return Ze.create(0,ti,t)}static createV1(t,n){return Ze.create(1,t,n)}static decode(t){let[n,r]=Ze.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=Ze.inspectBytes(t),r=n.size-n.multihashSize,i=ba(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 xo(n.multihashCode,n.digestSize,o,i);return[n.version===0?Ze.createV0(s):Ze.createV1(n.codec,s),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[g,C]=Ks(t.subarray(n));return n+=C,g},i=r(),o=ti;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]=p1(t,n),o=Ze.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return zs(o).set(r,t),o}};function p1(e,t){switch(e[0]){case"Q":{let n=t??wn;return[wn.prefix,n.decode(`${wn.prefix}${e}`)]}case wn.prefix:{let n=t??wn;return[wn.prefix,n.decode(e)]}case eo.prefix:{let n=t??eo;return[eo.prefix,n.decode(e)]}case Ms.prefix:{let n=t??Ms;return[Ms.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 h1(e,t,n){let{prefix:r}=n;if(r!==wn.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 y1(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 ti=112,g1=18;function nl(e,t,n){let r=go(e),i=r+go(t),o=new Uint8Array(i+n.byteLength);return yo(e,o,0),yo(t,o,r),o.set(n,i),o}var m1=Symbol.for("@ipld/js-cid/CID"),v1=20;function Pf({name:e,code:t,encode:n,minDigestLength:r,maxDigestLength:i}){return new b1(e,t,n,r,i)}var b1=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,n,r,i){this.name=e,this.code=t,this.encode=n,this.minDigestLength=r??v1,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?rl(n,this.code,t?.truncate):n.then(r=>rl(r,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function rl(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 _a(t,e)}var Cf=pt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),IS=pt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),SS=pt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),NS=pt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function _1(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function w1(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Uo.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 mo(e){let t=Cf.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 kt(e){return mo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function T1(e){return mo(new Uint8Array(e))}function A1(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function O1(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 E1={typeEncoders:{Object:w1,Buffer:mo,Uint8Array:mo,Int8Array:kt,Uint16Array:kt,Int16Array:kt,Uint32Array:kt,Int32Array:kt,Float32Array:kt,Float64Array:kt,Uint8ClampedArray:kt,BigInt64Array:kt,BigUint64Array:kt,DataView:kt,ArrayBuffer:T1,undefined:A1,number:O1}},I1=class extends Of{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=Cf.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}},qs={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};qs.tags[42]=Uo.parse;var S1="dag-json",xf=297,wa=e=>UA(e,E1),Ta=e=>{let t=_1(e),n=Object.assign(qs,{tokenizer:new I1(t,qs)});return MA(t,n)},il=e=>N1.decode(wa(e)),N1=new TextDecoder,$1=e=>Ta(R1.encode(e)),R1=new TextEncoder;function P1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Uf(e,t,n=""){let r=P1(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 ol(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 C1(e,t){Uf(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 Gs(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Bs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Wt(e,t){return e<<32-t|e>>>t}function x1(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 U1=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function M1(e,t,n){return e&t^~e&n}function B1(e,t,n){return e&t^e&n^t&n}var D1=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=Bs(this.buffer)}update(e){ol(this),Uf(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=Bs(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){ol(this),C1(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:o}=this;t[o++]=128,Gs(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=Bs(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()}},bn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),L1=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]),_n=new Uint32Array(64),k1=class extends D1{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)_n[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let g=_n[d-15],C=_n[d-2],I=Wt(g,7)^Wt(g,18)^g>>>3,S=Wt(C,17)^Wt(C,19)^C>>>10;_n[d]=S+_n[d-7]+I+_n[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=Wt(s,6)^Wt(s,11)^Wt(s,25),C=c+g+M1(s,a,l)+L1[d]+_n[d]|0,S=(Wt(n,2)^Wt(n,13)^Wt(n,22))+B1(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(){Gs(_n)}destroy(){this.set(0,0,0,0,0,0,0,0),Gs(this.buffer)}},j1=class extends k1{A=bn[0]|0;B=bn[1]|0;C=bn[2]|0;D=bn[3]|0;E=bn[4]|0;F=bn[5]|0;G=bn[6]|0;H=bn[7]|0;constructor(){super(32)}},F1=x1(()=>new j1,U1(1));var Ge=Et(rn(),1),Mf=Et(oy(),1),sl=e=>Ge.Type.Union([e,Ge.Type.Null()]);var Bf=/^(k51qz|baguq)[0-9a-z]{56,57}$/,V1=/^[0-9A-Fa-f]{7,8}$/g;Ge.FormatRegistry.Set("EntityID",e=>!!e.match(V1)||!!e.match(Bf));var K1=Ge.Type.String(),z1=e=>e?.enc instanceof Uint8Array;Ge.FormatRegistry.Set("CID",e=>!!e.match(Bf));var Df=Ge.Type.String({format:"CID"}),q1=/^http([s]?):\/\/.*\..*/;Ge.FormatRegistry.Set("URL",e=>!!e.match(q1));var $S=Ge.Type.String({format:"URL"}),Lf=Ge.Type.Object({en:K1,at:Ge.Type.String(),vl:sl(Ge.Type.Union([Ge.Type.String(),Ge.Type.Boolean(),Ge.Type.Number()])),ts:Ge.Type.String(),ag:Ge.Type.String(),pv:sl(Df)}),al=Mf.TypeCompiler.Compile(Lf);var RS=al.Check.bind(al),G1=Ge.Type.Composite([Ge.Type.Object({cid:Df}),Lf]),Ws=Mf.TypeCompiler.Compile(G1),W1=e=>Array.from(Ws.Errors(e)),kf=Ws.Check.bind(Ws);function jf(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var H1=Pf({name:"sha2-256",code:18,encode:jf("SHA-256")}),PS=Pf({name:"sha2-512",code:19,encode:jf("SHA-512")}),{WARN:ul,LOG:CS,DEBUG:J1,VERBOSE:Ff,ERROR:X1}=Ne.setup(Ne.INFO);function Vf(e,t=["cid"]){if(!e)throw X1("falsy log",e);let n=e.cid;if(z1(e))return n||(n=Aa(Kf(e).bytes).toString()),ul("preparing an encrypted applog - really?"),{log:e,cid:n};let r={};for(let[i,o]of Object.entries(e))o===void 0&&(ul(`log.${i} is undefined, which is not allowed - encoding as null`,e),o=null),t.includes(i)?Ff("excluding app log",{key:i,val:o}):r[i]=o;return{log:r,cid:n}}function Y1(e){return Aa(Q1(e).bytes)}function Q1(e){return Kf(Vf(e)?.log)}function Aa(e){let t=F1(e),n=Sf.create(H1.code,t),r=Uo.create(1,xf,n);return Ff("[getCidSync]",{bytes:e,hash:t,digest:n,cid:r}),r}function Kf(e){J1("[encodeBlock]",e);let t=wa(e);return{bytes:t,cid:Aa(t)}}function cl(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 Z1(e,t){let n=cl(e),r=cl(t);return+n<+r}var{WARN:xS,LOG:US,DEBUG:MS,VERBOSE:eO,ERROR:ll}=Ne.setup(Ne.INFO),tO=(e,t,n="asc")=>n==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),zf=(e,t,n)=>Ve.structural(qc(t,e),qc(n,e)),nO=(e,t,n="asc")=>tO(e.ts,t.ts,n),BS=YT(zf,["en","at"]);function fi(e,t="asc"){return e.sort((n,r)=>nO(n,r,t))}var rO=(e,t)=>Z1(new Date(e.ts),new Date(t.ts));var qf=e=>{let t=new Map;for(let n of e){if(!n)throw ll("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!n.cid)throw ll("applog with missing CID",n),new Error("applog with missing CID");let r=n.cid;t.has(r)?eO("Skipping duplicate applog:",[t.get(r),n]):t.set(r,n)}return Array.from(t.values())};function iO(e){return typeof e=="string"&&e.startsWith("?")}function oO(e){return e.slice(1)}function Oa(e,t){let n={},r={};for(let[i,o]of Object.entries(e))if(iO(o)){let s=oO(o),a=t[s];a?r[i]=a:n[i]=s}else r[i]=o;return[r,n]}function sO(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 Gf=function(t){for(var n=0,r=0,i=t.length;r<i;r++)n+=t[r];return n},fl=function(t){return Gf(t)/t.length},St={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return St.max(e)-St.min(e)},midrange:function(e){return St.range(e)/2},sum:Gf,mean:fl,average:fl,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=St.mean(e);return St.mean(e.map(function(n){return Math.pow(n-t,2)}))},standardDeviation:function(e){return Math.sqrt(St.variance(e))},meanAbsoluteDeviation:function(e){var t=St.mean(e);return St.mean(e.map(function(n){return Math.abs(n-t)}))},zScores:function(e){var t=St.mean(e),n=St.standardDeviation(e);return e.map(function(r){return(r-t)/n})}};St.average=St.mean;var Wf=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 Hf(){return new Date().toISOString()}var{WARN:aO,LOG:DS,DEBUG:uO,VERBOSE:LS,ERROR:vo}=Ne.setup(Ne.INFO);function cO(e,t){let n=Hf(),r=t;return e.map(o=>lO(o,{ts:n,threadForPv:r}))}function lO(e,{ts:t,threadForPv:n}={}){let r=pO(e,t??Hf()),i=hO(r,n),o=Y1(i).toString();e.cid&&e.cid!==o&&aO("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:o,logWithPv:i});let s={...i,cid:o};if(!kf(s))throw vo(`Bogus Applog ${JSON.stringify(s)}`,W1(s));return Object.freeze(s)}function fO(e){return!!e.ts}function dO(e){return!!e.pv}function pO(e,t){return fO(e)?e:{...e,ts:t}}function hO(e,t){if(e.pv!==void 0)return e;if(t){let{en:n,at:r}=e,i=t.findLast(s=>s.en==n&&s.at==r);if(zf(["en","at","vl","ts","ag"],e,i))throw vo("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let o=(e.pv!==void 0?e.pv:i?.cid)??null;return{...e,pv:o}}else{if(!dO(e))throw vo("[withPvFrom] no thread and no pv:",e);return e}}function Mo(e){let t=()=>(Pe(()=>e.length<2&&uO(`joinThreads with count=${e.length}`)),fi(qf(e.flatMap(i=>{let o=i.applogs;if(!o)throw vo("falsy applogs of thread",i),new Error("falsy applogs of thread");return o})))),n=Pe(()=>t()),r=ot(function(i,o){return sn(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 Ea(Pe(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],n,r)}var{WARN:dl,LOG:kS,DEBUG:pl,VERBOSE:Kn,ERROR:hl}=Ne.setup(Ne.INFO),Ea=class Jf extends Ar{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,mn(this,{onParentUpdate:ot}),o&&this.subscribeToParents()}static mapWrites(t,n,r){return new Jf(`${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=Ot(()=>{this.parents.length||dl("MappedThread has no parents",this),Kn(`[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)&&Kn(`[MappedThread: ${this.name}] Skipping re-sub to parent`,r.nameAndSizeUntracked),Kn(`[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)Kn(`[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 hl("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);pl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&dl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Pe(()=>nn(t.applogs))})})}onParentUpdate(t,n){Kn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,n);let r=this._eventMapper?this._eventMapper(n,t):n;if(this._eventMapper)if(Kn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,r),sn(r))this._applogs.replace([...r.init]);else{for(let i of r.added)this._applogs.splice(u0(this._applogs,i,"ts"),0,i);if(r.removed){for(let i of r.removed)if(!this._applogs.remove(i))if(!sn(n)&&n.removed?.includes(i))pl("Ignoring remove event for non-existent because it was part of parent event's removed",i,n);else throw hl(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:n,mapResult:r})}}Kn(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Jr(this._applogs)),this.notifySubscribers(r)}get readOnly(){return!1}},{WARN:jS,LOG:FS,DEBUG:VS,VERBOSE:Ds,ERROR:yO}=Ne.setup(Ne.INFO),On=Xe("rollingFilter",function(t,n,r={}){let i=gO(n),o=yl(i),s=Ce.array(Pe(function(){return o(t.applogs)}),{deep:!1,name:`${t.name} | ${r.name||`rollingFilter.array{${Gn(i)}}`}`}),a=g=>{let C;return sn(g)?C={init:o(g.init)}:C={added:o(g.added),removed:g.removed},Ds(`rollingFilter{${t.nameAndSizeUntracked} | ${r.name?` '${r.name}'}`:""} parentUpdate`,i,g,"=>",C),C},l=new Ea(`${t.name} | ${r.name||`rollingFilter{${Gn(i)}}`}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],s,a),c=qu(()=>nn(n),g=>{Ds(`rollingFilter<${t.nameAndSizeUntracked}>${r.name?` '${r.name}'`:""} patternUpdate`,i,"=>",g),i=g,o=yl(i),l.triggerRemap()}),d=jn(s,()=>{Ds(`rollingFilter<${Pe(()=>t.name)}>${r.name?` '${r.name}'`:""} unobserve`,i),c(),d()});return l},{equals:Rr,argsDebugName:(e,t,n)=>We({caller:"rollingFilter",thread:e,pattern:t,args:n})}),Xf=Xe("rollingMapper",function(t,n,r={}){let i=Pe(()=>n.call(null,{init:t.applogs},t));if(!sn(i))throw yO("Initial run must return init event");let o=i.init;return new Ea(`${t.name} | ${r.name||"rollingMapper"}`,t,[...t.filters,...r.extraFilterName?[r.extraFilterName]:[]],o,n)},{equals:Rr,argsDebugName:(e,t,n)=>We({caller:"rollingMapper",thread:e,args:n})}),KS=Xe("rollingAcc",function(t,n,r,i={}){let o=ot(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}`:""}}`}),gO=function(t){let n=Pe(function(){return Object.fromEntries(Object.entries(nn(t)).map(([i,o])=>[nn(i),nn(o)]))});if(!Object.entries(n).length)throw new Error("Pattern is empty");return n};function yl(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(!sO(o,s,a))return!1}return!0})}}var{WARN:mO,LOG:vO,DEBUG:bO,VERBOSE:_O,ERROR:to}=Ne.setup(Ne.INFO),wO=class extends Ar{constructor(e,t=[],n){super(e,null,n,t),mn(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){let t=cO(e,this);return this.insertRaw(t)}insertRaw(e){let t=qf(e);if(t.length!==e.length)throw to(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});let n=e.filter(o=>!kf(o));if(n.length)throw to(`[insertRaw] bogus applogs passed: ${n.length}`,{bogus:n});let r=e.filter(o=>this.hasApplog(o,!1));if(r.length)throw to(`[insertRaw] already existing applogs passed: ${r.length}`,{existing:r});if(!e.length){mO("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof Ia)?vO:bO)("Inserting:",e.length===1?e[0]:e,{ds:this}),fi(e);let i=this._applogs.length&&rO(e[0],this._applogs[this._applogs.length-1]);return this._applogs.push(...e),i&&fi(this._applogs),this.notifySubscribers({added:e,removed:null}),this.persist(e),e}get readOnly(){return!1}},Ia=class no extends wO{constructor(t,n,r,i){super(t,n,r),this._readOnly=i,mn(this,{_applogs:Ce.shallow})}static empty(t){return no.fromArray([],t??"empty in-memory",!1)}static fromArray(t,n,r=!1){return new no(n??"in-memory",t,[],r)}static fromReadOnlyArray(t,n){return new no(n??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if(_O("[InMem.persist] no persist for",t),this.readOnly)throw to("[persist] called for readOnly thread")}},{WARN:zS,LOG:qS,DEBUG:GS,VERBOSE:WS,ERROR:HS}=Ne.setup(Ne.INFO);var{WARN:CN,LOG:xN,DEBUG:UN,VERBOSE:MN,ERROR:BN}=Ne.setup(Ne.INFO);function Sa(e){return Wf(e,31,7)}var AO=class{constructor(e,t,n=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=n,mn(this,{threadOfTrail:De})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?Mo([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},Yf=class{constructor(e){this.nodes=e,mn(this,{threadOfAllTrails:De,size:De,isEmpty:De})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Pe(()=>this.records.length)}get records(){return Jt(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return Mo(Jt(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogSet(){return Jt(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogSet"})}get leafNodeLogs(){return Jt(()=>this.nodes.flatMap(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return Mo(Jt(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:FN,LOG:Bo,DEBUG:an,VERBOSE:Te,ERROR:er}=Ne.setup(Ne.INFO,{prefix:"[q]"}),Na=null,OO=Xe("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:n,tolerateAlreadyFiltered:r}={}){if(Te(`lastWriteWins${n?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(r)return an("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw er("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,o=Xf(t,function(a,l){let c=sn(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 V=d[S],J=V.en+"|"+V.at;if(I&&(n?I>V.ts:I<V.ts))throw er("lastWriteWins.mapper logs not sorted:",I,n?">":"<",V.ts,{log:V,i:S,newLogs:d,inverseToOnlyReturnFirstLogs:n});I=V.ts;let F=i.get(J);(!F||(n?F.ts>V.ts:F.ts<V.ts))&&(F&&!c&&C.push(F),g.push(V),i.set(J,V))}return fi(g),Te.isDisabled||Te(`lastWriteWins${n?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,c?{...Object.fromEntries(Object.entries(a).map(([S,V])=>[S,V?.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||Ot(()=>{Te(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,o.applogs.length)}),o},{equals:Rr,argsDebugName:e=>We({caller:"lastWriteWins",thread:e})}),VN=Xe("withoutDeleted",function(t){if(Te.isEnabled&&Te(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw er("thread already filtered withoutDeleted:",t.filters,{name:t.name});let n=On(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=We({caller:"allDeletedEntities",thread:t}),i=cf(function(){return n.map(s=>s.en)},{name:r});return Te.isEnabled&&Ot(()=>{Te(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),On(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:Rr}),Qf=Xe("query",function e(t,n,r={},i={}){CO();let o=Zf(t);an(`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=EO(o,a,l,i);return Te.isDisabled||Ot(()=>Te("query result:",nn(c))),c},{equals:No,argsDebugName:(e,t,n)=>We({caller:"query",thread:e,args:n?{pattern:t,startVars:n}:t})}),EO=Xe("queryStep",function(t,n,r,i={}){if(an(`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]=Oa(r,a?.variables??{});Te("[queryStep.doQuery] patternWithoutVars: ",l);let d=On(t,l),g=Do(c),C=Jt(function(){let S=d.map(V=>({log:V,vars:g(V)}));return Te.isEnabled&&Te("[queryStep.doQuery] step node:",a?.variables," =>",S,"from:",Pe(()=>d.applogs)),S.map(({log:V,vars:J})=>{let F=Object.assign({},a?.variables,J);return new AO(ff.fromArray([V],We({caller:"QueryNode",thread:d,pattern:`${Gn(F)}@${Gn(l)}`})),F,a)})},{name:We({caller:"doQuery.mapNodes",thread:d,pattern:r})});return Te.isEnabled&&Ot(()=>Te("[queryStep.doQuery] resultNodes:",[...C])),i.debug&&Bo("[queryStep] step result:",Pe(()=>C.map(({variables:I,logsOfThisNode:S})=>({variables:I,thread:S})))),C}let s=Jt(function(){return an(`[queryStep] Running with ${n?.nodes?.length} input nodes:`),n?[...n.nodes.flatMap(o)]:[...o(null)]},{name:We({caller:"queryStep",thread:t,pattern:r})});return Te.isEnabled&&Ot(()=>Te("[queryStep] observableResultNodes:",[...s])),new Yf(s)},{equals:No,argsDebugName:(e,t,n)=>We({caller:"queryStep",thread:e,pattern:n})}),KN=Xe("queryNot",function(t,n,r,i={}){let o=n.nodes;an(`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]=Oa(a,c??{});Te("[queryNot] patternWithoutVars: ",d);let C=On(t,d);return Te("[queryNot] step node:",c," =>",C.size,"applogs"),Te.isDisabled||Te("[queryNot] step node:",c," => empty?",Pe(()=>C.applogs)),i.debug&&Bo("[queryNot] node result:",c,"=>",C.applogs),C.isEmpty})}return new Yf(o)},{equals:No,argsDebugName:(e,t,n)=>We({caller:"queryNot",thread:e,pattern:n})}),zN=Xe("filterAndMap",function(t,n,r){an(`filterAndMap<${t.nameAndSizeUntracked}>`,n);let i=On(t,n);Te.isEnabled&&(Te("[filterAndMap] filtered:",i.untrackedSize),Ot(()=>Te("[filterAndMap] filtered:",i.applogs)));let o=We({thread:t,pattern:n,caller:"filterAndMap"}),s=Jt(()=>NO(i,r),{name:o});return Te.isDisabled||Ot(()=>Te("[filterAndMap] mapped:",s)),s},{equals:Ve.structural,argsDebugName:(e,t)=>We({caller:"filterAndMap",thread:e,pattern:t})}),qN=Xe("queryAndMap",function(t,n,r,i={}){let o=Zf(t);an(`queryAndMap<${o.nameAndSizeUntracked}>`,{patternOrPatterns:n,variables:i,map:r});let s=We({thread:o,caller:"queryAndMap"}),a=Qf(o,n);Te("[queryAndMap] filtered count:",a.untrackedSize);let l=Jt(()=>$O(a,r),{name:s});return Te.isDisabled||Ot(()=>Te("[queryAndMap] result:",nn(l))),l},{equals:Ve.structural,argsDebugName:(e,t)=>We({caller:"queryAndMap",thread:e,pattern:t})}),GN=Xe("queryEntity",function(t,n,r,i){an(`queryEntity<${t.nameAndSizeUntracked}>`,r,n);let o=On(t,{en:r,at:RO(n,i)});return Te("queryEntity applogs:",o.applogs),De(()=>o.isEmpty?null:Object.fromEntries(o.map(({at:s,vl:a})=>[s.slice(n.length+1),a])))},{equals:uf,argsDebugName:(e,t,n)=>We({caller:"queryEntity",thread:e,args:{name:t,entityID:n}})}),WN=Xe("agentsOfThread",function(t){an(`agentsOfThread<${t.nameAndSizeUntracked}>`);let n=Ce.map(),r=ot(o=>{for(let s of sn(o)?o.init:o.added){let a=n.get(s.ag)??0;n.set(s.ag,a+1)}for(let s of!sn(o)&&o.removed||[]){let a=n.get(s.ag);if(!a||a<1)throw er("[agentsOfThread] number is now negative",{log:s,event:o,mapped:n,prev:a});n.set(s.ag,a-1)}Bo(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:o,mapped:n})});r({init:t.applogs});let i=t.subscribe(r);return mr(n,i),n}),IO=Xe("entityOverlap",function(t,n){return Bo(`entityOverlap<${t.nameAndSizeUntracked}, ${n.nameAndSizeUntracked}>`),De(()=>{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 HN=Xe("entityOverlapCount",function(t,n){return De(()=>IO(t,n).get().length)}),SO=Xe("querySingle",function(t,n,r={}){let i=Qf(t,n,r);return De(()=>{if(i.isEmpty)return null;if(i.size>1)throw er("[querySingle] got",i.size,"results:",i);let o=i.nodes[0].logsOfThisNode;if(o.size!=1)throw er("[querySingle] single result, but got",o.size,"logs:",o.applogs);return o.applogs[0]})},{equals:Ve.structural,argsDebugName:(e,t)=>We({caller:"querySingle",thread:e,pattern:t})}),JN=Xe("querySingleAndMap",function(t,n,r,i={}){let o=SO(t,n,i);return De(()=>{let s=o.get();if(s)return typeof r=="string"?s[r]:Do(r)(s)})},{equals:Ve.structural,argsDebugName:(e,t)=>We({caller:"querySingleAndMap",thread:e,pattern:t})}),NO=function(t,n){return typeof n=="function"?t.map(n):typeof n=="string"?t.map(r=>r[n]):t.map(Do(n))},$O=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 er(`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=>Do(n)(t))};function Do(e){return t=>Object.entries(e).reduce((n,[r,i])=>(n[i]=t[r],n),{})}function RO(e,t){return t.map(n=>PO(e,n))}function PO(e,t){return`${e}/${t}`}function Zf(e,t){return Array.isArray(e)?Ia.fromArray(e,t||`threadFromArray[${e.length}]`,!0):e}function CO(){if(Na!=null&&performance.now()>=Na)throw new xO(Na)}var xO=class extends Error{constructor(e){super(e)}};var UO=Le({"../../../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}}}),MO=Le({"../../../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}}}),BO=Le({"../../../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}}}),Ua=Le({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:UO(),decode:MO(),encodingLength:BO()}}}),DO=["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 LO(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=kO(e);return n||"Object"}function kO(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(DO.includes(t))return t}var K=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}};K.uint=new K(0,"uint",!0);K.negint=new K(1,"negint",!0);K.bytes=new K(2,"bytes",!0);K.string=new K(3,"string",!0);K.array=new K(4,"array",!1);K.map=new K(5,"map",!1);K.tag=new K(6,"tag",!1);K.float=new K(7,"float",!0);K.false=new K(7,"false",!0);K.true=new K(7,"true",!0);K.null=new K(7,"null",!0);K.undefined=new K(7,"undefined",!0);K.break=new K(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}`}},bi=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",jO=new TextEncoder;function jo(e){return bi&&globalThis.Buffer.isBuffer(e)}function ld(e){return e instanceof Uint8Array?jo(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var FO=24,VO=200,KO=bi?e=>e.length>=FO?globalThis.Buffer.from(e):ed(e):e=>e.length>=VO?jO.encode(e):ed(e),un=e=>Uint8Array.from(e),zO=bi?(e,t,n)=>jo(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n):(e,t,n)=>e.slice(t,n),qO=bi?(e,t)=>(e=e.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),ld(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},GO=bi?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function fd(e,t){if(jo(e)&&jo(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 ed(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 WO=256,dd=class{constructor(e=WO){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=GO(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=zO(n,0,this.cursor)}else t=qO(this.chunks,this.cursor);return e&&this.reset(),t}},HO=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:",pd="CBOR encode error:",_i=[];_i[23]=1;_i[24]=2;_i[25]=3;_i[26]=5;_i[27]=9;function Mr(e,t,n){if(e.length-t<n)throw new Error(`${Be} not enough data for type`)}var Ye=[24,256,65536,4294967296,BigInt("18446744073709551616")];function tr(e,t,n){Mr(e,t,1);let r=e[t];if(n.strict===!0&&r<Ye[0])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);return r}function nr(e,t,n){Mr(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<Ye[1])throw new Error(`${Be} integer encoded in more bytes than necessary (strict decode)`);return r}function rr(e,t,n){Mr(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(`${Be} integer encoded in more bytes than necessary (strict decode)`);return r}function ir(e,t,n){Mr(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(`${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 JO(e,t,n,r){return new pe(K.uint,tr(e,t+1,r),2)}function XO(e,t,n,r){return new pe(K.uint,nr(e,t+1,r),3)}function YO(e,t,n,r){return new pe(K.uint,rr(e,t+1,r),5)}function QO(e,t,n,r){return new pe(K.uint,ir(e,t+1,r),9)}function or(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(`${Be} encountered BigInt larger than allowable range`)}}or.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};or.compareTokens=function(t,n){return t.value<n.value?-1:t.value>n.value?1:0};function ZO(e,t,n,r){return new pe(K.negint,-1-tr(e,t+1,r),2)}function eE(e,t,n,r){return new pe(K.negint,-1-nr(e,t+1,r),3)}function tE(e,t,n,r){return new pe(K.negint,-1-rr(e,t+1,r),5)}var Ma=BigInt(-1),hd=BigInt(1);function nE(e,t,n,r){let i=ir(e,t+1,r);if(typeof i!="bigint"){let o=-1-i;if(o>=Number.MIN_SAFE_INTEGER)return new pe(K.negint,o,9)}if(r.allowBigInt!==!0)throw new Error(`${Be} integers outside of the safe integer range are not supported`);return new pe(K.negint,Ma-BigInt(i),9)}function Ba(e,t){let n=t.value,r=typeof n=="bigint"?n*Ma-hd:n*-1-1;Rt(e,t.type.majorEncoded,r)}Ba.encodedSize=function(t){let n=t.value,r=typeof n=="bigint"?n*Ma-hd:n*-1-1;return r<Ye[0]?1:r<Ye[1]?2:r<Ye[2]?3:r<Ye[3]?5:9};Ba.compareTokens=function(t,n){return t.value<n.value?1:t.value>n.value?-1:0};function wi(e,t,n,r){Mr(e,t,n+r);let i=e.slice(t+n,t+n+r);return new pe(K.bytes,i,n+r)}function rE(e,t,n,r){return wi(e,t,1,n)}function iE(e,t,n,r){return wi(e,t,2,tr(e,t+1,r))}function oE(e,t,n,r){return wi(e,t,3,nr(e,t+1,r))}function sE(e,t,n,r){return wi(e,t,5,rr(e,t+1,r))}function aE(e,t,n,r){let i=ir(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer bytes lengths not supported`);return wi(e,t,9,i)}function Fo(e){return e.encodedBytes===void 0&&(e.encodedBytes=K.equals(e.type,K.string)?KO(e.value):e.value),e.encodedBytes}function qo(e,t){let n=Fo(t);Rt(e,t.type.majorEncoded,n.length),e.push(n)}qo.encodedSize=function(t){let n=Fo(t);return Rt.encodedSize(n.length)+n.length};qo.compareTokens=function(t,n){return uE(Fo(t),Fo(n))};function uE(e,t){return e.length<t.length?-1:e.length>t.length?1:fd(e,t)}var td=new TextDecoder,cE=32;function lE(e,t,n){if(n-t<cE){let i="";for(let o=t;o<n;o++){let s=e[o];if(s&128)return td.decode(e.subarray(t,n));i+=String.fromCharCode(s)}return i}return td.decode(e.subarray(t,n))}function Ti(e,t,n,r,i){let o=n+r;Mr(e,t,o);let s=new pe(K.string,lE(e,t+n,t+o),o);return i.retainStringBytes===!0&&(s.byteValue=e.slice(t+n,t+o)),s}function fE(e,t,n,r){return Ti(e,t,1,n,r)}function dE(e,t,n,r){return Ti(e,t,2,tr(e,t+1,r),r)}function pE(e,t,n,r){return Ti(e,t,3,nr(e,t+1,r),r)}function hE(e,t,n,r){return Ti(e,t,5,rr(e,t+1,r),r)}function yE(e,t,n,r){let i=ir(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer string lengths not supported`);return Ti(e,t,9,i,r)}var gE=qo;function Br(e,t,n,r){return new pe(K.array,r,n)}function mE(e,t,n,r){return Br(e,t,1,n)}function vE(e,t,n,r){return Br(e,t,2,tr(e,t+1,r))}function bE(e,t,n,r){return Br(e,t,3,nr(e,t+1,r))}function _E(e,t,n,r){return Br(e,t,5,rr(e,t+1,r))}function wE(e,t,n,r){let i=ir(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer array lengths not supported`);return Br(e,t,9,i)}function TE(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${Be} indefinite length items not allowed`);return Br(e,t,1,1/0)}function Da(e,t){Rt(e,K.array.majorEncoded,t.value)}Da.compareTokens=or.compareTokens;Da.encodedSize=function(t){return Rt.encodedSize(t.value)};function Dr(e,t,n,r){return new pe(K.map,r,n)}function AE(e,t,n,r){return Dr(e,t,1,n)}function OE(e,t,n,r){return Dr(e,t,2,tr(e,t+1,r))}function EE(e,t,n,r){return Dr(e,t,3,nr(e,t+1,r))}function IE(e,t,n,r){return Dr(e,t,5,rr(e,t+1,r))}function SE(e,t,n,r){let i=ir(e,t+1,r);if(typeof i=="bigint")throw new Error(`${Be} 64-bit integer map lengths not supported`);return Dr(e,t,9,i)}function NE(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${Be} indefinite length items not allowed`);return Dr(e,t,1,1/0)}function La(e,t){Rt(e,K.map.majorEncoded,t.value)}La.compareTokens=or.compareTokens;La.encodedSize=function(t){return Rt.encodedSize(t.value)};function $E(e,t,n,r){return new pe(K.tag,n,1)}function RE(e,t,n,r){return new pe(K.tag,tr(e,t+1,r),2)}function PE(e,t,n,r){return new pe(K.tag,nr(e,t+1,r),3)}function CE(e,t,n,r){return new pe(K.tag,rr(e,t+1,r),5)}function xE(e,t,n,r){return new pe(K.tag,ir(e,t+1,r),9)}function ka(e,t){Rt(e,K.tag.majorEncoded,t.value)}ka.compareTokens=or.compareTokens;ka.encodedSize=function(t){return Rt.encodedSize(t.value)};var yd=20,gd=21,md=22,vd=23;function UE(e,t,n,r){if(r.allowUndefined===!1)throw new Error(`${Be} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new pe(K.null,null,1):new pe(K.undefined,void 0,1)}function ME(e,t,n,r){if(r.allowIndefinite===!1)throw new Error(`${Be} indefinite length items not allowed`);return new pe(K.break,void 0,1)}function ja(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(K.float,e,t)}function BE(e,t,n,r){return ja(Va(e,t+1),3,r)}function DE(e,t,n,r){return ja(Ka(e,t+1),5,r)}function LE(e,t,n,r){return ja(Td(e,t+1),9,r)}function Fa(e,t,n){let r=t.value;if(r===!1)e.push([K.float.majorEncoded|yd]);else if(r===!0)e.push([K.float.majorEncoded|gd]);else if(r===null)e.push([K.float.majorEncoded|md]);else if(r===void 0)e.push([K.float.majorEncoded|vd]);else{let i,o=!1;(!n||n.float64!==!0)&&(_d(r),i=Va(Vt,1),r===i||Number.isNaN(r)?(Vt[0]=249,e.push(Vt.slice(0,3)),o=!0):(wd(r),i=Ka(Vt,1),r===i&&(Vt[0]=250,e.push(Vt.slice(0,5)),o=!0))),o||(kE(r),i=Td(Vt,1),Vt[0]=251,e.push(Vt.slice(0,9)))}}Fa.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){_d(r);let i=Va(Vt,1);if(r===i||Number.isNaN(r))return 3;if(wd(r),i=Ka(Vt,1),r===i)return 5}return 9};var bd=new ArrayBuffer(9),$t=new DataView(bd,1),Vt=new Uint8Array(bd,0);function _d(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 Va(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 wd(e){$t.setFloat32(0,e,!1)}function Ka(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 kE(e){$t.setFloat64(0,e,!1)}function Td(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)}Fa.compareTokens=or.compareTokens;function Ie(e,t,n){throw new Error(`${Be} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function Go(e){return()=>{throw new Error(`${Be} ${e}`)}}var ue=[];for(let e=0;e<=23;e++)ue[e]=Ie;ue[24]=JO;ue[25]=XO;ue[26]=YO;ue[27]=QO;ue[28]=Ie;ue[29]=Ie;ue[30]=Ie;ue[31]=Ie;for(let e=32;e<=55;e++)ue[e]=Ie;ue[56]=ZO;ue[57]=eE;ue[58]=tE;ue[59]=nE;ue[60]=Ie;ue[61]=Ie;ue[62]=Ie;ue[63]=Ie;for(let e=64;e<=87;e++)ue[e]=rE;ue[88]=iE;ue[89]=oE;ue[90]=sE;ue[91]=aE;ue[92]=Ie;ue[93]=Ie;ue[94]=Ie;ue[95]=Go("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ue[e]=fE;ue[120]=dE;ue[121]=pE;ue[122]=hE;ue[123]=yE;ue[124]=Ie;ue[125]=Ie;ue[126]=Ie;ue[127]=Go("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ue[e]=mE;ue[152]=vE;ue[153]=bE;ue[154]=_E;ue[155]=wE;ue[156]=Ie;ue[157]=Ie;ue[158]=Ie;ue[159]=TE;for(let e=160;e<=183;e++)ue[e]=AE;ue[184]=OE;ue[185]=EE;ue[186]=IE;ue[187]=SE;ue[188]=Ie;ue[189]=Ie;ue[190]=Ie;ue[191]=NE;for(let e=192;e<=215;e++)ue[e]=$E;ue[216]=RE;ue[217]=PE;ue[218]=CE;ue[219]=xE;ue[220]=Ie;ue[221]=Ie;ue[222]=Ie;ue[223]=Ie;for(let e=224;e<=243;e++)ue[e]=Go("simple values are not supported");ue[244]=Ie;ue[245]=Ie;ue[246]=Ie;ue[247]=UE;ue[248]=Go("simple values are not supported");ue[249]=BE;ue[250]=DE;ue[251]=LE;ue[252]=Ie;ue[253]=Ie;ue[254]=Ie;ue[255]=ME;var cn=[];for(let e=0;e<24;e++)cn[e]=new pe(K.uint,e,1);for(let e=-1;e>=-24;e--)cn[31-e]=new pe(K.negint,e,1);cn[64]=new pe(K.bytes,new Uint8Array(0),1);cn[96]=new pe(K.string,"",1);cn[128]=new pe(K.array,0,1);cn[160]=new pe(K.map,0,1);cn[244]=new pe(K.false,!1,1);cn[245]=new pe(K.true,!0,1);cn[246]=new pe(K.null,null,1);function jE(e){switch(e.type){case K.false:return un([244]);case K.true:return un([245]);case K.null:return un([246]);case K.bytes:return e.value.length?void 0:un([64]);case K.string:return e.value===""?un([96]):void 0;case K.array:return e.value===0?un([128]):void 0;case K.map:return e.value===0?un([160]):void 0;case K.uint:return e.value<24?un([Number(e.value)]):void 0;case K.negint:if(e.value>=-24)return un([31-Number(e.value)])}}var FE=Object.freeze({float64:!0,mapSorter:qE,quickEncodeToken:jE});function Ad(){let e=[];return e[K.uint.major]=or,e[K.negint.major]=Ba,e[K.bytes.major]=qo,e[K.string.major]=gE,e[K.array.major]=Da,e[K.map.major]=La,e[K.tag.major]=ka,e[K.float.major]=Fa,e}var VE=Ad(),KE=new dd,nd=class Od{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(`${pd} object contains circular references`);return new Od(n,t)}},En={null:new pe(K.null,null),undefined:new pe(K.undefined,void 0),true:new pe(K.true,!0),false:new pe(K.false,!1),emptyArray:new pe(K.array,0),emptyMap:new pe(K.map,0)},Nn={number(e,t,n,r){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new pe(K.float,e):e>=0?new pe(K.uint,e):new pe(K.negint,e)},bigint(e,t,n,r){return e>=BigInt(0)?new pe(K.uint,e):new pe(K.negint,e)},Uint8Array(e,t,n,r){return new pe(K.bytes,e)},string(e,t,n,r){return new pe(K.string,e)},boolean(e,t,n,r){return e?En.true:En.false},null(e,t,n,r){return En.null},undefined(e,t,n,r){return En.undefined},ArrayBuffer(e,t,n,r){return new pe(K.bytes,new Uint8Array(e))},DataView(e,t,n,r){return new pe(K.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,n,r){if(!e.length)return n.addBreakTokens===!0?[En.emptyArray,new pe(K.break)]:En.emptyArray;r=nd.createCheck(r,e);let i=[],o=0;for(let s of e)i[o++]=Lo(s,n,r);return n.addBreakTokens?[new pe(K.array,e.length),i,new pe(K.break)]:[new pe(K.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=nd.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++]=[Lo(d,n,r),Lo(g,n,r)])}c<s&&(a.length=c)}return a?.length?(zE(a,n),n.addBreakTokens?[new pe(K.map,a.length),a,new pe(K.break)]:[new pe(K.map,a.length),a]):n.addBreakTokens===!0?[En.emptyMap,new pe(K.break)]:En.emptyMap}};Nn.Map=Nn.Object;Nn.Buffer=Nn.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Nn[`${e}Array`]=Nn.DataView;function Lo(e,t={},n){let r=LO(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||Nn[r];if(typeof i=="function"){let s=i(e,r,t,n);if(s!=null)return s}let o=Nn[r];if(!o)throw new Error(`${pd} unsupported type: ${r}`);return o(e,r,t,n)}function zE(e,t){t.mapSorter&&e.sort(t.mapSorter)}function qE(e,t){if(e[0]instanceof pe&&t[0]instanceof pe){let n=e[0],r=t[0];return n._keyBytes||(n._keyBytes=rd(n.value)),r._keyBytes||(r._keyBytes=rd(r.value)),fd(n._keyBytes,r._keyBytes)}throw new Error("rfc8949MapSorter: complex key types are not supported yet")}function rd(e){return GE(e,VE,FE)}function Ed(e,t,n,r){if(Array.isArray(t))for(let i of t)Ed(e,i,n,r);else n[t.type.major](e,t,r)}var u$=K.uint.majorEncoded,c$=K.negint.majorEncoded,l$=K.bytes.majorEncoded,f$=K.string.majorEncoded,d$=K.array.majorEncoded,p$=K.float.majorEncoded|yd,h$=K.float.majorEncoded|gd,y$=K.float.majorEncoded|md,g$=K.float.majorEncoded|vd,m$=BigInt(-1),v$=BigInt(1);function GE(e,t,n,r){let i=r instanceof Uint8Array,o=i?new HO(r):KE,s=Lo(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 dd(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():ld(o.chunks[0])}}return o.reset(),Ed(o,s,t,n),o.toBytes(!0)}var b$=Symbol.for("DONE"),_$=Symbol.for("BREAK");var w$=new Uint8Array(0);function WE(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 za(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 HE(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 V=0,J=0,F=0,k=S.length;F!==k&&S[F]===0;)F++,V++;for(var z=(k-F)*d+1>>>0,W=new Uint8Array(z);F!==k;){for(var j=S[F],Z=0,G=z-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=z-J;fe!==z&&W[fe]===0;)fe++;for(var x=l.repeat(V);fe<z;++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 V=0;if(S[V]!==" "){for(var J=0,F=0;S[V]===l;)J++,V++;for(var k=(S.length-V)*c+1>>>0,z=new Uint8Array(k);S[V];){var W=n[S.charCodeAt(V)];if(W===255)return;for(var j=0,Z=k-1;(W!==0||j<F)&&Z!==-1;Z--,j++)W+=a*z[Z]>>>0,z[Z]=W%256>>>0,W=W/256>>>0;if(W!==0)throw new Error("Non-zero carry");F=j,V++}if(S[V]!==" "){for(var G=k-F;G!==k&&z[G]===0;)G++;for(var fe=new Uint8Array(J+(k-G)),x=J;G!==k;)fe[x++]=z[G++];return fe}}}function I(S){var V=C(S);if(V)return V;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:C,decode:I}}var JE=HE,XE=JE,YE=XE,QE=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")}},ZE=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 Id(this,e)}},eI=class{decoders;constructor(e){this.decoders=e}or(e){return Id(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 Id(e,t){return new eI({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var tI=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 QE(e,t,n),this.decoder=new ZE(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Sd({name:e,prefix:t,encode:n,decode:r}){return new tI(e,t,n,r)}function Wo({name:e,prefix:t,alphabet:n}){let{encode:r,decode:i}=YE(n,e);return Sd({prefix:t,name:e,encode:r,decode:o=>za(i(o))})}function nI(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 rI(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 iI(e){let t={};for(let n=0;n<e.length;++n)t[e[n]]=n;return t}function ln({name:e,prefix:t,bitsPerChar:n,alphabet:r}){let i=iI(r);return Sd({prefix:t,name:e,encode(o){return rI(o,r,n)},decode(o){return nI(o,i,n,e)}})}var ko=ln({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),T$=ln({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),A$=ln({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),O$=ln({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),E$=ln({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),I$=ln({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),S$=ln({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),N$=ln({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$$=ln({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),$a=Wo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),R$=Wo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),In=Wo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),P$=Wo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),oI=Nd,id=128,sI=127,aI=~sI,uI=Math.pow(2,31);function Nd(e,t,n){t=t||[],n=n||0;for(var r=n;e>=uI;)t[n++]=e&255|id,e/=128;for(;e&aI;)t[n++]=e&255|id,e>>>=7;return t[n]=e|0,Nd.bytes=n-r+1,t}var cI=Ra,lI=128,od=127;function Ra(e,r){var n=0,r=r||0,i=0,o=r,s,a=e.length;do{if(o>=a)throw Ra.bytes=0,new RangeError("Could not decode varint");s=e[o++],n+=i<28?(s&od)<<i:(s&od)*Math.pow(2,i),i+=7}while(s>=lI);return Ra.bytes=o-r,n}var fI=Math.pow(2,7),dI=Math.pow(2,14),pI=Math.pow(2,21),hI=Math.pow(2,28),yI=Math.pow(2,35),gI=Math.pow(2,42),mI=Math.pow(2,49),vI=Math.pow(2,56),bI=Math.pow(2,63),_I=function(e){return e<fI?1:e<dI?2:e<pI?3:e<hI?4:e<yI?5:e<gI?6:e<mI?7:e<vI?8:e<bI?9:10},wI={encode:oI,decode:cI,encodingLength:_I},TI=wI,Vo=TI;function Pa(e,t=0){return[Vo.decode(e,t),Vo.decode.bytes]}function Ko(e,t,n=0){return Vo.encode(e,t,n),t}function zo(e){return Vo.encodingLength(e)}function AI(e,t){let n=t.byteLength,r=zo(e),i=r+zo(n),o=new Uint8Array(i+n);return Ko(e,o,0),Ko(n,o,r),o.set(t,i),new qa(e,n,t,o)}function OI(e){let t=za(e),[n,r]=Pa(t),[i,o]=Pa(t.subarray(r)),s=t.subarray(r+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new qa(n,i,s,t)}function EI(e,t){if(e===t)return!0;{let n=t;return e.code===n.code&&e.size===n.size&&n.bytes instanceof Uint8Array&&WE(e.bytes,n.bytes)}}var qa=class{code;size;digest;bytes;constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}};function sd(e,t){let{bytes:n,version:r}=e;switch(r){case 0:return SI(n,Ca(e),t??In.encoder);default:return NI(n,Ca(e),t??ko.encoder)}}var ad=new WeakMap;function Ca(e){let t=ad.get(e);if(t==null){let n=new Map;return ad.set(e,n),n}return t}var $d=class et{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!==gi)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(n.code!==$I)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return et.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=AI(t,n);return et.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 et.equals(this,t)}static equals(t,n){let r=n;return r!=null&&t.code===r.code&&t.version===r.version&&EI(t.multihash,r.multihash)}toString(t){return sd(this,t)}toJSON(){return{"/":sd(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 et)return n;if(n["/"]!=null&&n["/"]===n.bytes||n.asCID===n){let{version:r,code:i,multihash:o,bytes:s}=n;return new et(r,i,o,s??ud(r,i,o.bytes))}else if(n[RI]===!0){let{version:r,multihash:i,code:o}=n,s=OI(i);return et.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!==gi)throw new Error(`Version 0 CID must use dag-pb (code: ${gi}) block encoding`);return new et(t,n,r,r.bytes)}case 1:{let i=ud(t,n,r.bytes);return new et(t,n,r,i)}default:throw new Error("Invalid version")}}static createV0(t){return et.create(0,gi,t)}static createV1(t,n){return et.create(1,t,n)}static decode(t){let[n,r]=et.decodeFirst(t);if(r.length!==0)throw new Error("Incorrect length");return n}static decodeFirst(t){let n=et.inspectBytes(t),r=n.size-n.multihashSize,i=za(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 qa(n.multihashCode,n.digestSize,o,i);return[n.version===0?et.createV0(s):et.createV1(n.codec,s),t.subarray(n.size)]}static inspectBytes(t){let n=0,r=()=>{let[g,C]=Pa(t.subarray(n));return n+=C,g},i=r(),o=gi;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]=II(t,n),o=et.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ca(o).set(r,t),o}};function II(e,t){switch(e[0]){case"Q":{let n=t??In;return[In.prefix,n.decode(`${In.prefix}${e}`)]}case In.prefix:{let n=t??In;return[In.prefix,n.decode(e)]}case ko.prefix:{let n=t??ko;return[ko.prefix,n.decode(e)]}case $a.prefix:{let n=t??$a;return[$a.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 SI(e,t,n){let{prefix:r}=n;if(r!==In.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 NI(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 gi=112,$I=18;function ud(e,t,n){let r=zo(e),i=r+zo(t),o=new Uint8Array(i+n.byteLength);return Ko(e,o,0),Ko(t,o,r),o.set(n,i),o}var RI=Symbol.for("@ipld/js-cid/CID"),Rd=42;function PI(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=$d.asCID(e);if(!t)return null;let n=new Uint8Array(t.bytes.byteLength+1);return n.set(t.bytes,1),[new pe(K.tag,Rd),new pe(K.bytes,n)]}function CI(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function xI(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 UI(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 cd={float64:!0,typeEncoders:{Map:UI,Object:PI,undefined:CI,number:xI}},C$={...cd,typeEncoders:{...cd.typeEncoders}};function MI(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return $d.decode(e.subarray(1))}var xa={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};xa.tags[Rd]=MI;var x$={...xa,tags:xa.tags.slice()};var U$=Et(Ua(),1);var Sn={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},mi={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Sn.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Sn.List(e)!==void 0){for(let t=0;t<e.length;t++){let n=e[t];if(n=mi["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=mi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;r.push(o)}return r}}return e}},Int:Sn.Int,CarV1HeaderOrV2Pragma:e=>{if(Sn.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=mi["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=mi.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}},vi={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":Sn.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(Sn.List(e)!==void 0){for(let t=0;t<e.length;t++){let n=e[t];if(n=vi["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=vi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](o),o===void 0)return;r.push(o)}return r}}return e}},Int:Sn.Int,CarV1HeaderOrV2Pragma:e=>{if(Sn.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=vi["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=vi.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}},M$={toTyped:mi.CarV1HeaderOrV2Pragma,toRepresentation:vi.CarV1HeaderOrV2Pragma},B$=Ad(),D$=Et(Ua(),1),L$=[new pe(K.map,2),new pe(K.string,"version"),new pe(K.uint,1),new pe(K.string,"roots")],k$=new pe(K.tag,42);var j$=Et(Ua(),1);var{WARN:F$,LOG:V$,DEBUG:K$,VERBOSE:z$,ERROR:q$}=Ne.setup(Ne.INFO);var{WARN:G$,LOG:W$,DEBUG:H$,VERBOSE:J$,ERROR:X$}=Ne.setup(Ne.INFO);var Ga=class{app;username;devicename;signer},Pd=class extends Ga{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 Sa(this.agentString)}get shortDID(){return this.did?.slice(-8)}get agentString(){return`${this.username}.${this.shortDID}@${this.app}.${this.devicename}`}};export{Pd as BaseAgent};
|
|
62
62
|
/*! Bundled license information:
|
|
63
63
|
|
|
64
64
|
lodash-es/lodash.js:
|