@blackglory/structures 0.10.15 → 0.10.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Structures={})}(this,(function(t){"use strict";class e{constructor(t){this.value=t}get[Symbol.toStringTag](){return this.constructor.name}set(t){this.value=t}get(){return this.value}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={},i={};function o(t){return Array.isArray(t)}i.isntEmptyArray=i.isEmptyArray=i.isntArray=i.isArray=void 0,i.isArray=o,i.isntArray=function(t){return!o(t)},i.isEmptyArray=function(t){return 0===t.length},i.isntEmptyArray=function(t){return 0!==t.length};var s={},a={};function u(t){return null===t}a.isntNull=a.isNull=void 0,a.isNull=u,a.isntNull=function(t){return!u(t)};var c={};function l(t){return void 0===t}c.isntUndefined=c.isUndefined=void 0,c.isUndefined=l,c.isntUndefined=function(t){return!l(t)};var h={};function f(t){return"function"==typeof t}h.isntFunction=h.isFunction=void 0,h.isFunction=f,h.isntFunction=function(t){return!f(t)},s.isntAsyncIterable=s.isAsyncIterable=void 0;const d=a,y=c,p=h;function v(t){return(0,d.isntNull)(t)&&(0,y.isntUndefined)(t)&&(0,p.isFunction)(t[Symbol.asyncIterator])}s.isAsyncIterable=v,s.isntAsyncIterable=function(t){return!v(t)};var m={};function b(t){return"bigint"==typeof t}m.isntBigInt=m.isBigInt=void 0,m.isBigInt=b,m.isntBigInt=function(t){return!b(t)};var g={};function w(t){return"boolean"==typeof t}g.isntBoolean=g.isBoolean=void 0,g.isBoolean=w,g.isntBoolean=function(t){return!w(t)};var x={},T={};function _(t){return"string"==typeof t}T.isntString=T.isString=void 0,T.isString=_,T.isntString=function(t){return!_(t)},x.isntChar=x.isChar=void 0;const S=T;function A(t){return(0,S.isString)(t)&&1===t.length}x.isChar=A,x.isntChar=function(t){return!A(t)};var E={};function I(t){return t instanceof Date}E.isntDate=E.isDate=void 0,E.isDate=I,E.isntDate=function(t){return!I(t)};var O={};O.inEnum=void 0,O.inEnum=function(t,e){return Object.values(e).includes(t)};var P={};function j(t){return t instanceof Error}P.isntError=P.isError=void 0,P.isError=j,P.isntError=function(t){return!j(t)};var k={};function N(t){return!t}k.isntFalsy=k.isFalsy=void 0,k.isFalsy=N,k.isntFalsy=function(t){return!N(t)};var M={};M.isntIterable=M.isIterable=void 0;const B=a,C=c,z=h;function F(t){return(0,B.isntNull)(t)&&(0,C.isntUndefined)(t)&&(0,z.isFunction)(t[Symbol.iterator])}M.isIterable=F,M.isntIterable=function(t){return!F(t)};var q={},D={};function V(t){return"number"==typeof t}function U(t){return Number.isNaN(t)}D.isntNaN=D.isNaN=D.isNegativeInfinity=D.isPositiveInfinity=D.isFinite=D.isntNumber=D.isNumber=void 0,D.isNumber=V,D.isntNumber=function(t){return!V(t)},D.isFinite=function(t){return Number.isFinite(t)},D.isPositiveInfinity=function(t){return t===1/0},D.isNegativeInfinity=function(t){return t===-1/0},D.isNaN=U,D.isntNaN=function(t){return!U(t)};var R={},L="object"==typeof n&&n&&n.Object===Object&&n,K="object"==typeof self&&self&&self.Object===Object&&self,J=(L||K||Function("return this")()).Symbol,W=J,Y=Object.prototype,H=Y.hasOwnProperty,$=Y.toString,Q=W?W.toStringTag:void 0;var X=function(t){var e=H.call(t,Q),n=t[Q];try{t[Q]=void 0;var r=!0}catch(t){}var i=$.call(t);return r&&(e?t[Q]=n:delete t[Q]),i},G=Object.prototype.toString;var Z=X,tt=function(t){return G.call(t)},et=J?J.toStringTag:void 0;var nt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":et&&et in Object(t)?Z(t):tt(t)};var rt=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);var it=nt,ot=rt,st=function(t){return null!=t&&"object"==typeof t},at=Function.prototype,ut=Object.prototype,ct=at.toString,lt=ut.hasOwnProperty,ht=ct.call(Object);var ft=function(t){if(!st(t)||"[object Object]"!=it(t))return!1;var e=ot(t);if(null===e)return!0;var n=lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ct.call(n)==ht},dt=n&&n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};R.isntEmptyObject=R.isEmptyObject=R.isntPlainObject=R.isPlainObject=R.isntObject=R.isObject=void 0;const yt=dt(ft);function pt(t){return null!==t&&"object"==typeof t}function vt(t){return(0,yt.default)(t)}R.isObject=pt,R.isntObject=function(t){return!pt(t)},R.isPlainObject=vt,R.isntPlainObject=function(t){return!vt(t)},R.isEmptyObject=function(t){return 0===Object.keys(t).length},R.isntEmptyObject=function(t){return 0!==Object.keys(t).length},q.isntJsonable=q.isJsonable=q.isntJson=q.isJson=void 0;const mt=a,bt=g,gt=T,wt=D,xt=i,Tt=R;function _t(t){return(0,mt.isNull)(t)||(0,bt.isBoolean)(t)||(0,gt.isString)(t)||(0,wt.isNumber)(t)||(0,xt.isArray)(t)&&t.every(_t)||(0,Tt.isPlainObject)(t)&&Object.values(t).every(_t)}q.isJson=_t,q.isntJson=function(t){return!_t(t)},q.isJsonable=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},q.isntJsonable=function t(e){return!t()};var St={};St.isPromiseLike=St.isntPromiseLike=St.isntPromise=St.isPromise=void 0;const At=R,Et=h;function It(t){return t instanceof Promise}function Ot(t){return(0,At.isObject)(t)&&(0,Et.isFunction)(t.then)}St.isPromise=It,St.isntPromise=function(t){return!It(t)},St.isntPromiseLike=function(t){return!Ot(t)},St.isPromiseLike=Ot;var Pt={};Pt.isAbsoluteURL=void 0,Pt.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}};var jt={};function kt(t){return t instanceof RegExp}jt.isntRegExp=jt.isRegExp=void 0,jt.isRegExp=kt,jt.isntRegExp=function(t){return!kt(t)};var Nt={};function Mt(t){return"symbol"==typeof t}Nt.isntSymbol=Nt.isSymbol=void 0,Nt.isSymbol=Mt,Nt.isntSymbol=function(t){return!Mt(t)},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(i,t),r(s,t),r(m,t),r(g,t),r(x,t),r(E,t),r(O,t),r(P,t),r(k,t),r(h,t),r(M,t),r(q,t),r(a,t),r(D,t),r(R,t),r(St,t),r(T,t),r(c,t),r(Pt,t),r(jt,t),r(Nt,t)}(r);class Bt{constructor(){this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}on(t,e){this.map.has(t)||this.map.set(t,new Set);return this.map.get(t).add(n),()=>{if(!this.map.has(t))return;const e=this.map.get(t);e.delete(n),0===e.size&&this.map.delete(t)};function n(...t){e(...t)}}once(t,e){const n=this.on(t,((...t)=>{e(...t),n()}));return n}emit(t,...e){this.map.has(t)&&this.map.get(t).forEach((t=>t(...e)))}}class Ct{constructor(t){this.hash=t,this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e){return this.map.set(this.hash(t),e),this}has(t){return this.map.has(this.hash(t))}get(t){return this.map.get(this.hash(t))}delete(t){return this.map.delete(this.hash(t))}clear(){this.map.clear()}}class zt{constructor(t){this.hash=t,this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}[Symbol.iterator](){return this.map.values()}add(t){return this.map.set(this.hash(t),t),this}delete(t){return this.map.delete(this.hash(t))}has(t){return this.map.has(this.hash(t))}clear(){this.map.clear()}values(){return this.map.values()}}class Ft{constructor(){this.items=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.items.length}empty(){this.items.length=0}enqueue(...t){this.items.push(...t)}dequeue(){return this.items.shift()}remove(t){let e;for(;(e=this.items.indexOf(t))>=0;)this.items.splice(e,1)}}var qt={},Dt={},Vt={},Ut={},Rt={},Lt={},Kt={};Kt.go=void 0,Kt.go=function(t){return t()};var Jt={};Jt.goMicrotask=void 0,Jt.goMicrotask=function(t){return new Promise(((e,n)=>{queueMicrotask((async()=>{try{e(await t())}catch(t){n(t)}}))}))};var Wt={},Yt={},Ht={},$t={},Qt={};Qt.random=void 0,Qt.random=function(t,e){return Math.random()*(e-t)+t};var Xt={};Xt.randomInt=void 0,Xt.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t};var Gt={};Gt.randomIntInclusive=void 0,Gt.randomIntInclusive=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Qt,t),r(Xt,t),r(Gt,t)}($t),Ht.calculateExponentialBackoffTimeout=void 0;const Zt=$t;Ht.calculateExponentialBackoffTimeout=function({baseTimeout:t,retries:e,maxTimeout:n=1/0,factor:r=2,jitter:i=!0}){const o=Math.min(r**e*t,n);return i?(0,Zt.randomIntInclusive)(0,o):o};var te={};te.setTimeout=void 0,te.setTimeout=function(t,e){const n=globalThis.setTimeout(e,t);return()=>clearTimeout(n)};var ee={setSchedule:void 0};const ne=te;ee.setSchedule=function(t,e){const n=t-Date.now();return(0,ne.setTimeout)(n,e)};var re={};re.setInterval=void 0,re.setInterval=function(t,e){const n=globalThis.setInterval(e,t);return()=>clearInterval(n)};var ie={setImmediate:void 0};const oe=te;ie.setImmediate=function(t){if(globalThis.setImmediate){const e=globalThis.setImmediate(t);return()=>clearImmediate(e)}return(0,oe.setTimeout)(0,t)};var se={setTimeoutLoop:void 0};const ae=te;se.setTimeoutLoop=function(t,e){let n=!1,r=(0,ae.setTimeout)(t,(async function i(){await e(),n||(r=(0,ae.setTimeout)(t,i))}));return()=>{n=!0,r()}};var ue={setDynamicTimeoutLoop:void 0};const ce=te;ue.setDynamicTimeoutLoop=function(t,e){let n=!1,r=(0,ce.setTimeout)(t,(async function i(){const o=Date.now();await e();const s=Date.now()-o;n||(r=(0,ce.setTimeout)(Math.max(t-s,0),i))}));return()=>{n=!0,r()}},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Ht,t),r(te,t),r(ee,t),r(re,t),r(ie,t),r(se,t),r(ue,t)}(Yt),Wt.goMacrotask=void 0;const le=Yt;Wt.goMacrotask=function(t){return new Promise(((e,n)=>{(0,le.setImmediate)((async()=>{try{e(await t())}catch(t){n(t)}}))}))},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Kt,t),r(Jt,t),r(Wt,t)}(Lt);var he={},fe={},de={},ye={},pe={};function ve(t){return Array.isArray(t)}pe.isntEmptyArray=pe.isEmptyArray=pe.isntArray=pe.isArray=void 0,pe.isArray=ve,pe.isntArray=function(t){return!ve(t)},pe.isEmptyArray=function(t){return 0===t.length},pe.isntEmptyArray=function(t){return 0!==t.length};var me={},be={};function ge(t){return null===t}be.isntNull=be.isNull=void 0,be.isNull=ge,be.isntNull=function(t){return!ge(t)};var we={};function xe(t){return void 0===t}we.isntUndefined=we.isUndefined=void 0,we.isUndefined=xe,we.isntUndefined=function(t){return!xe(t)};var Te={};function _e(t){return"function"==typeof t}Te.isntFunction=Te.isFunction=void 0,Te.isFunction=_e,Te.isntFunction=function(t){return!_e(t)},me.isntAsyncIterable=me.isAsyncIterable=void 0;const Se=be,Ae=we,Ee=Te;function Ie(t){return(0,Se.isntNull)(t)&&(0,Ae.isntUndefined)(t)&&(0,Ee.isFunction)(t[Symbol.asyncIterator])}me.isAsyncIterable=Ie,me.isntAsyncIterable=function(t){return!Ie(t)};var Oe={};function Pe(t){return"bigint"==typeof t}Oe.isntBigInt=Oe.isBigInt=void 0,Oe.isBigInt=Pe,Oe.isntBigInt=function(t){return!Pe(t)};var je={};function ke(t){return"boolean"==typeof t}je.isntBoolean=je.isBoolean=void 0,je.isBoolean=ke,je.isntBoolean=function(t){return!ke(t)};var Ne={},Me={};function Be(t){return"string"==typeof t}Me.isntString=Me.isString=void 0,Me.isString=Be,Me.isntString=function(t){return!Be(t)},Ne.isntChar=Ne.isChar=void 0;const Ce=Me;function ze(t){return(0,Ce.isString)(t)&&1===t.length}Ne.isChar=ze,Ne.isntChar=function(t){return!ze(t)};var Fe={};function qe(t){return t instanceof Date}Fe.isntDate=Fe.isDate=void 0,Fe.isDate=qe,Fe.isntDate=function(t){return!qe(t)};var De={};De.inEnum=void 0,De.inEnum=function(t,e){return Object.values(e).includes(t)};var Ve={};function Ue(t){return t instanceof Error}Ve.isntError=Ve.isError=void 0,Ve.isError=Ue,Ve.isntError=function(t){return!Ue(t)};var Re={};function Le(t){return!t}Re.isntFalsy=Re.isFalsy=void 0,Re.isFalsy=Le,Re.isntFalsy=function(t){return!Le(t)};var Ke={};Ke.isntIterable=Ke.isIterable=void 0;const Je=be,We=we,Ye=Te;function He(t){return(0,Je.isntNull)(t)&&(0,We.isntUndefined)(t)&&(0,Ye.isFunction)(t[Symbol.iterator])}Ke.isIterable=He,Ke.isntIterable=function(t){return!He(t)};var $e={},Qe={};function Xe(t){return"number"==typeof t}function Ge(t){return Number.isNaN(t)}Qe.isntNaN=Qe.isNaN=Qe.isNegativeInfinity=Qe.isPositiveInfinity=Qe.isFinite=Qe.isntNumber=Qe.isNumber=void 0,Qe.isNumber=Xe,Qe.isntNumber=function(t){return!Xe(t)},Qe.isFinite=function(t){return Number.isFinite(t)},Qe.isPositiveInfinity=function(t){return t===1/0},Qe.isNegativeInfinity=function(t){return t===-1/0},Qe.isNaN=Ge,Qe.isntNaN=function(t){return!Ge(t)};var Ze={},tn=n&&n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Ze.isntEmptyObject=Ze.isEmptyObject=Ze.isntPlainObject=Ze.isPlainObject=Ze.isntObject=Ze.isObject=void 0;const en=tn(ft);function nn(t){return null!==t&&"object"==typeof t}function rn(t){return(0,en.default)(t)}Ze.isObject=nn,Ze.isntObject=function(t){return!nn(t)},Ze.isPlainObject=rn,Ze.isntPlainObject=function(t){return!rn(t)},Ze.isEmptyObject=function(t){return 0===Object.keys(t).length},Ze.isntEmptyObject=function(t){return 0!==Object.keys(t).length},$e.isntJsonable=$e.isJsonable=$e.isntJson=$e.isJson=void 0;const on=be,sn=je,an=Me,un=Qe,cn=pe,ln=Ze;function hn(t){return(0,on.isNull)(t)||(0,sn.isBoolean)(t)||(0,an.isString)(t)||(0,un.isNumber)(t)||(0,cn.isArray)(t)&&t.every(hn)||(0,ln.isPlainObject)(t)&&Object.values(t).every(hn)}$e.isJson=hn,$e.isntJson=function(t){return!hn(t)},$e.isJsonable=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},$e.isntJsonable=function t(e){return!t()};var fn={};fn.isPromiseLike=fn.isntPromiseLike=fn.isntPromise=fn.isPromise=void 0;const dn=Ze,yn=Te;function pn(t){return t instanceof Promise}function vn(t){return(0,dn.isObject)(t)&&(0,yn.isFunction)(t.then)}fn.isPromise=pn,fn.isntPromise=function(t){return!pn(t)},fn.isntPromiseLike=function(t){return!vn(t)},fn.isPromiseLike=vn;var mn={};mn.isAbsoluteURL=void 0,mn.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}};var bn={};function gn(t){return t instanceof RegExp}bn.isntRegExp=bn.isRegExp=void 0,bn.isRegExp=gn,bn.isntRegExp=function(t){return!gn(t)},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(pe,t),r(me,t),r(Oe,t),r(je,t),r(Ne,t),r(Fe,t),r(De,t),r(Ve,t),r(Re,t),r(Te,t),r(Ke,t),r($e,t),r(be,t),r(Qe,t),r(Ze,t),r(fn,t),r(Me,t),r(we,t),r(mn,t),r(bn,t)}(ye);var wn={};wn.traverseErrorPrototypeChain=void 0,wn.traverseErrorPrototypeChain=function*(t){let e=t;for(;(e=Object.getPrototypeOf(e))&&(yield e,e!==Error.prototype););},de.getErrorNames=void 0;const xn=ye,Tn=wn;de.getErrorNames=function*(t){var e;if((0,xn.isError)(t))for(const n of(0,Tn.traverseErrorPrototypeChain)(t))(null===(e=n.constructor)||void 0===e?void 0:e.name)&&(yield n.constructor.name);else yield t.name,yield*t.ancestors};var _n={isSerializableError:void 0};const Sn=ye;var An;function En(){if(An)return fe;An=1,fe.CustomError=void 0;const t=lo(),e=de,n=ye,r=_n;class i extends Error{get name(){var n,r;return null!==(r=null!==(n=(0,t.first)((0,e.getErrorNames)(this)))&&void 0!==n?n:i.name)&&void 0!==r?r:"CustomError"}static[Symbol.hasInstance](i){var o;if((0,n.isError)(i)||(0,r.isSerializableError)(i)){const n=[null!==(o=this.prototype.constructor.name)&&void 0!==o?o:this.name,...(0,e.getErrorNames)(this.prototype)].reverse(),r=(0,t.toArray)((0,e.getErrorNames)(i)).reverse();return n.every(((t,e)=>t===r[e]))}return!1}}return fe.CustomError=i,fe}_n.isSerializableError=function(t){return(0,Sn.isObject)(t)&&(0,Sn.isString)(t.name)&&(0,Sn.isString)(t.message)&&((0,Sn.isString)(t.stack)||(0,Sn.isNull)(t.stack))&&(0,Sn.isArray)(t.ancestors)&&t.ancestors.every(Sn.isString)};var In,On={};function Pn(){if(In)return On;In=1,On.AssertionError=void 0;const t=En();class e extends t.CustomError{}return On.AssertionError=e,On}var jn,kn={};var Nn={},Mn={},Bn={};Bn.pass=void 0,Bn.pass=function(){};var Cn={};Cn.passAsync=void 0,Cn.passAsync=async function(){},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Bn,t),r(Cn,t)}(Mn),Nn.hydrate=void 0;const zn=Mn;function Fn(t,e){const n=function(){(0,zn.pass)()};return(n.prototype=Object.create(t.prototype)).constructor=n,Object.defineProperty(n,"name",{value:e}),n}Nn.hydrate=function(t){var e;const n=[t.name,...t.ancestors].slice(0,-1).reverse();let r=Error;for(const t of n)r=Fn(r,t);const i=new r;return i.name=t.name,i.message=t.message,i.stack=null!==(e=t.stack)&&void 0!==e?e:void 0,i};var qn,Dn,Vn,Un={};function Rn(){return Dn||(Dn=1,function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(En(),t),r(Pn(),t),r(_n,t),r(function(){if(jn)return kn;jn=1,kn.normalize=void 0;const t=de,e=lo();return kn.normalize=function(n){var r;const[i,...o]=(0,e.toArray)((0,t.getErrorNames)(n));return{name:i,ancestors:o,message:n.message,stack:null!==(r=n.stack)&&void 0!==r?r:null}},kn}(),t),r(Nn,t),r(function(){if(qn)return Un;qn=1,Un.assert=void 0;const t=Pn();return Un.assert=function(e,n){if(!e)throw new t.AssertionError(n)},Un}(),t),r(de,t),r(wn,t)}(he)),he}var Ln={chunkByAsync:void 0};const Kn=ye;Ln.chunkByAsync=function(t,e){return(0,Kn.isAsyncIterable)(t)?async function*(t,e){let n=[],r=0;for await(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t,e):async function*(t,e){let n=[],r=0;for(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t,e)};var Jn={};Jn.chunkBy=void 0,Jn.chunkBy=function*(t,e){let n=[],r=0;for(const i of t)n.push(i),e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)};var Wn,Yn={};var Hn={concatAsync:void 0};const $n=ye,Qn=Lt;Hn.concatAsync=function(t,...e){return(0,Qn.go)((async function*(){for(const n of[t,...e])if((0,$n.isAsyncIterable)(n))for await(const t of n)yield t;else for(const t of n)yield t}))};var Xn={concat:void 0};const Gn=Lt;Xn.concat=function(t,...e){return(0,Gn.go)((function*(){for(const n of[t,...e])yield*n}))};var Zn,tr={},er={};er.copyIterable=er.copyAsyncIterable=void 0,er.copyAsyncIterable=async function*(t){for await(const e of t)yield e},er.copyIterable=function*(t){for(const e of t)yield e};var nr,rr={};var ir,or={};var sr={dropUntilAsync:void 0};const ar=ye;sr.dropUntilAsync=function(t,e){return(0,ar.isAsyncIterable)(t)?async function*(t,e){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=await r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}(t,e):async function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}(t,e)};var ur={};ur.dropUntil=void 0,ur.dropUntil=function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}};var cr,lr={};var hr={filterAsync:void 0};const fr=ye;hr.filterAsync=function(t,e){return(0,fr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)await e(r,n)&&(yield r),n++}(t,e):async function*(t,e){let n=0;for(const r of t)await e(r,n)&&(yield r),n++}(t,e)};var dr={};dr.filter=void 0,dr.filter=function*(t,e){let n=0;for(const r of t)e(r,n)&&(yield r),n++};var yr={},pr={},vr={flattenByAsync:void 0};const mr=ye;async function*br(t,e,n){for(const r of t)gr(r)&&await e(r,n)?yield*br(r,e,n+1):yield r}function gr(t){return(0,mr.isIterable)(t)&&(0,mr.isntChar)(t)}var wr,xr;function Tr(){if(wr)return pr;wr=1,pr.flattenDeepAsync=void 0;const t=vr,e=Rn();return pr.flattenDeepAsync=function(n,r=1/0){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter depth must be an integer"),(0,e.assert)(r>=0,"The parameter depth must be greater than or equal to 0"),(0,t.flattenByAsync)(n,((t,e)=>e<=r))},pr}vr.flattenByAsync=function(t,e){return(0,mr.isAsyncIterable)(t)?async function*(t,e){const n=1;for await(const r of t)gr(r)&&await e(r,n)?yield*br(r,e,n+1):yield r}(t,e):function(t,e){return br(t,e,1)}(t,e)};var _r={flattenBy:void 0};const Sr=ye;function*Ar(t,e,n){for(const i of t)(0,Sr.isIterable)(r=i)&&(0,Sr.isntChar)(r)&&e(i,n)?yield*Ar(i,e,n+1):yield i;var r}_r.flattenBy=function(t,e){return Ar(t,e,1)};var Er,Ir={};function Or(){if(Er)return Ir;Er=1,Ir.flattenDeep=void 0;const t=_r,e=Rn();return Ir.flattenDeep=function(n,r=1/0){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter depth must be an integer"),(0,e.assert)(r>=0,"The parameter depth must be greater than or equal to 0"),(0,t.flattenBy)(n,((t,e)=>e<=r))},Ir}var Pr,jr={};var kr={mapAsync:void 0};const Nr=ye;kr.mapAsync=function(t,e){return(0,Nr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)yield await e(r,n),n++}(t,e):async function*(t,e){let n=0;for(const r of t)yield await e(r,n),n++}(t,e)};var Mr={};Mr.map=void 0,Mr.map=function*(t,e){let n=0;for(const r of t)yield e(r,n),n++};var Br,Cr={};function zr(){if(Br)return Cr;Br=1,Cr.repeatAsync=void 0;const t=Lt,e=Rn();return Cr.repeatAsync=function(n,r){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter times must be an integer"),(0,e.assert)(r>=0,"The parameter times must be greater than or equal to 0"),r===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,t.go)((async function*(){const t=[];if(r>0){for await(const e of n)yield e,t.push(e);r--}for(;r>0;)yield*t,r--}))},Cr}var Fr,qr={};function Dr(){if(Fr)return qr;Fr=1,qr.repeat=void 0;const t=Lt,e=Rn();return qr.repeat=function(n,r){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter times must be an integer"),(0,e.assert)(r>=0,"The parameter times must be greater than or equal to 0"),r===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,t.go)((function*(){const t=[];if(r>0){for(const e of n)yield e,t.push(e);r--}for(;r>0;)yield*t,r--}))},qr}var Vr,Ur={};var Rr,Lr={};var Kr={};Kr.splitAsync=void 0,Kr.splitAsync=async function*(t,e){let n=[];for await(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Jr={splitByAsync:void 0};const Wr=ye;Jr.splitByAsync=function(t,e){return(0,Wr.isAsyncIterable)(t)?async function*(t,e){let n=[],r=0;for await(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t,e):async function*(t,e){let n=[],r=0;for(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t,e)};var Yr={};Yr.splitBy=void 0,Yr.splitBy=function*(t,e){let n=[],r=0;for(const i of t)e(i,r)?(yield n,n=[]):n.push(i),r++;yield n};var Hr={};Hr.split=void 0,Hr.split=function*(t,e){let n=[];for(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var $r,Qr={};var Xr,Gr={};var Zr,ti={};var ei={takeUntilAsync:void 0};const ni=ye;ei.takeUntilAsync=function(t,e){return(0,ni.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t){if(await e(r,n))break;yield r,n++}}(t,e):async function*(t,e){let n=0;for(const r of t){if(await e(r,n))break;yield r,n++}}(t,e)};var ri={};ri.takeUntil=void 0,ri.takeUntil=function*(t,e){let n=0;for(const r of t){if(e(r,n))break;yield r,n++}};var ii,oi={};var si={tapAsync:void 0};const ai=ye;si.tapAsync=function(t,e){return(0,ai.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)await e(r,n),yield r,n++}(t,e):async function*(t,e){let n=0;for(const r of t)await e(r,n),yield r,n++}(t,e)};var ui={};ui.tap=void 0,ui.tap=function*(t,e){let n=0;for(const r of t)e(r,n),yield r,n++};var ci={};ci.toAsyncIterable=void 0,ci.toAsyncIterable=async function*(t){for(const e of t)yield e};var li={};li.transformAsync=void 0,li.transformAsync=async function*(t,e){yield*e(t)};var hi={};hi.transform=void 0,hi.transform=function*(t,e){yield*e(t)};var fi={};fi.uniqAsync=void 0,fi.uniqAsync=async function*(t){const e=new Set;for await(const n of t)e.has(n)||(yield n,e.add(n))};var di={uniqByAsync:void 0};const yi=ye;di.uniqByAsync=function(t,e){return(0,yi.isAsyncIterable)(t)?async function*(t,e){const n=new Set;let r=0;for await(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t,e):async function*(t,e){const n=new Set;let r=0;for(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t,e)};var pi={};pi.uniqBy=void 0,pi.uniqBy=function*(t,e){const n=new Set;let r=0;for(const i of t){const t=e(i,r);n.has(t)||(yield i,n.add(t)),r++}};var vi={};vi.uniq=void 0,vi.uniq=function*(t){const e=new Set;for(const n of t)e.has(n)||(yield n,e.add(n))};var mi={zipAsync:void 0};const bi=ye;var gi;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(gi||(gi={})),mi.zipAsync=function(t,...e){return async function*(...t){var e,n,r,i;const o=t.length,s=t.map((t=>(0,bi.isAsyncIterable)(t)?[gi.Async,t[Symbol.asyncIterator]()]:[gi.Sync,t[Symbol.iterator]()])),a=s.map((()=>!1));try{for(;;){const t=new Array(o);for(let e=0;e<o;e++){const[n,r]=s[e];let i;if(i=n===gi.Async?await r.next():r.next(),i.done)return void(a[e]=!0);t[e]=i.value}yield t}}finally{const t=s.filter(((t,e)=>!a[e]));for(const[o,s]of t)o===gi.Async?await(null===(n=(e=s).return)||void 0===n?void 0:n.call(e)):null===(i=(r=s).return)||void 0===i||i.call(r)}}(t,...e)};var wi,xi={};function Ti(){return wi||(wi=1,function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(function(){if(Vn)return Rt;Vn=1,Rt.chunkAsync=void 0;const t=Lt,e=Rn();return Rt.chunkAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter size must be an integer"),(0,e.assert)(r>0,"The parameter size must be greater than 0"),(0,t.go)((async function*(){let t=[];for await(const e of n)t.push(e),t.length>=r&&(yield t,t=[]);t.length&&(yield t)}))},Rt}(),t),r(Ln,t),r(Jn,t),r(function(){if(Wn)return Yn;Wn=1,Yn.chunk=void 0;const t=Lt,e=Rn();return Yn.chunk=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter size must be an integer"),(0,e.assert)(r>0,"The parameter size must be greater than 0"),(0,t.go)((function*(){let t=[];for(const e of n)t.push(e),t.length>=r&&(yield t,t=[]);t.length&&(yield t)}))},Yn}(),t),r(Hn,t),r(Xn,t),r(function(){if(Zn)return tr;Zn=1,tr.dropAsync=void 0;const t=Lt,e=er,n=Rn();return tr.dropAsync=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyAsyncIterable)(r):(0,t.go)((async function*(){var t;const e=r[Symbol.asyncIterator]();let n;try{let r;for(;({value:r,done:n}=await e.next()),!(n||i<=0);)i--;for(;!n;)yield r,({value:r,done:n}=await e.next())}finally{n||await(null===(t=e.return)||void 0===t?void 0:t.call(e))}}))},tr}(),t),r(function(){if(nr)return rr;nr=1,rr.dropRightAsync=void 0;const t=Lt,e=er,n=Rn();return rr.dropRightAsync=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyAsyncIterable)(r):(0,t.go)((async function*(){const t=(await async function(t){const e=[];for await(const n of t)e.push(n);return e}(r)).slice(0,-i);for(const e of t)yield e}))},rr}(),t),r(function(){if(ir)return or;ir=1,or.dropRight=void 0;const t=Lt,e=er,n=Rn();return or.dropRight=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyIterable)(r):(0,t.go)((function*(){const t=Array.from(r);yield*t.slice(0,-i)}))},or}(),t),r(sr,t),r(ur,t),r(function(){if(cr)return lr;cr=1,lr.drop=void 0;const t=Lt,e=er,n=Rn();return lr.drop=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyIterable)(r):(0,t.go)((function*(){var t;const e=r[Symbol.iterator]();let n;try{let r;for(;({value:r,done:n}=e.next()),!(n||i<=0);)i--;for(;!n;)yield r,({value:r,done:n}=e.next())}finally{n||null===(t=e.return)||void 0===t||t.call(e)}}))},lr}(),t),r(hr,t),r(dr,t),r(function(){if(xr)return yr;xr=1,yr.flattenAsync=void 0;const t=Tr();return yr.flattenAsync=function(e){return(0,t.flattenDeepAsync)(e,1)},yr}(),t),r(vr,t),r(_r,t),r(Tr(),t),r(Or(),t),r(function(){if(Pr)return jr;Pr=1,jr.flatten=void 0;const t=Or();return jr.flatten=function(e){return(0,t.flattenDeep)(e,1)},jr}(),t),r(kr,t),r(Mr,t),r(zr(),t),r(Dr(),t),r(function(){if(Vr)return Ur;Vr=1,Ur.sliceAsync=void 0;const t=Lt,e=Rn();return Ur.sliceAsync=function(n,r,i=1/0){return(0,e.assert)(Number.isInteger(r),"The parameter start must be an integer"),(0,e.assert)(r>=0,"The parameter start must be greater than or equal to 0"),(0,e.assert)(Number.isInteger(i),"The parameter end must be an integer"),(0,e.assert)(i>=r,"The parameter end must be greater than or equal to start"),(0,t.go)((async function*(){let t=0;for await(const e of n){if(t>=i)break;t>=r&&(yield e),t++}}))},Ur}(),t),r(function(){if(Rr)return Lr;Rr=1,Lr.slice=void 0;const t=Lt,e=Rn();return Lr.slice=function(n,r,i=1/0){return(0,e.assert)(Number.isInteger(r),"The parameter start must be an integer"),(0,e.assert)(r>=0,"The parameter start must be greater than or equal to 0"),(0,e.assert)(Number.isInteger(i),"The parameter end must be an integer"),(0,e.assert)(i>=r,"The parameter end must be greater than or equal to start"),(0,t.go)((function*(){let t=0;for(const e of n){if(t>=i)break;t>=r&&(yield e),t++}}))},Lr}(),t),r(Kr,t),r(Jr,t),r(Yr,t),r(Hr,t),r(function(){if($r)return Qr;$r=1,Qr.takeAsync=void 0;const t=Lt,e=Rn();return Qr.takeAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((async function*(){if(0!==r)for await(const t of n)if(yield t,0==--r)break}))},Qr}(),t),r(function(){if(Xr)return Gr;Xr=1,Gr.takeRightAsync=void 0;const t=Lt,e=Rn();return Gr.takeRightAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((async function*(){var t;const e=n[Symbol.asyncIterator]();let i;try{const n=[];let o;for(;({value:o,done:i}=await e.next()),!i;)n.push(o),n.length>r&&n.shift();yield*n}finally{i||await(null===(t=e.return)||void 0===t?void 0:t.call(e))}}))},Gr}(),t),r(function(){if(Zr)return ti;Zr=1,ti.takeRight=void 0;const t=Lt,e=Rn();return ti.takeRight=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((function*(){var t;const e=n[Symbol.iterator]();let i;try{const n=[];let o;for(;({value:o,done:i}=e.next()),!i;)n.push(o),n.length>r&&n.shift();yield*n}finally{i||null===(t=e.return)||void 0===t||t.call(e)}}))},ti}(),t),r(ei,t),r(ri,t),r(function(){if(ii)return oi;ii=1,oi.take=void 0;const t=Lt,e=Rn();return oi.take=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((function*(){if(0!==r)for(const t of n)if(yield t,0==--r)break}))},oi}(),t),r(si,t),r(ui,t),r(ci,t),r(li,t),r(hi,t),r(fi,t),r(di,t),r(pi,t),r(vi,t),r(mi,t),r(xi,t)}(Ut)),Ut}xi.zip=void 0,xi.zip=function(t,...e){return function*(...t){const e=t.length,n=t.map((t=>t[Symbol.iterator]())),r=n.map((()=>!1));try{for(;;){const t=new Array(e);for(let i=0;i<e;i++){const{value:e,done:o}=n[i].next();if(o)return void(r[i]=!0);t[i]=e}yield t}}finally{n.filter(((t,e)=>!r[e])).forEach((t=>{var e;return null===(e=t.return)||void 0===e?void 0:e.call(t)}))}}(t,...e)};var _i={},Si={};Si.consume=void 0,Si.consume=function(t,e){return e(t)};var Ai={eachAsync:void 0};const Ei=ye;Ai.eachAsync=function(t,e){return(0,Ei.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t)await e(r,n),n++}(t,e):async function(t,e){let n=0;for(const r of t)await e(r,n),n++}(t,e)};var Ii={};Ii.each=void 0,Ii.each=function(t,e){let n=0;for(const r of t)e(r,n),n++};var Oi={everyAsync:void 0};const Pi=ye;Oi.everyAsync=function(t,e){return(0,Pi.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(!await e(r,n))return!1;n++}return!0}(t,e):async function(t,e){let n=0;for(const r of t){if(!await e(r,n))return!1;n++}return!0}(t,e)};var ji={};ji.every=void 0,ji.every=function(t,e){let n=0;for(const r of t){if(!e(r,n))return!1;n++}return!0};var ki={findAsync:void 0};const Ni=ye;ki.findAsync=function(t,e){return(0,Ni.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(await e(r,n))return r;n++}return}(t,e):async function(t,e){let n=0;for(const r of t){if(await e(r,n))return r;n++}return}(t,e)};var Mi={};Mi.find=void 0,Mi.find=function(t,e){let n=0;for(const r of t){if(e(r,n))return r;n++}};var Bi={};Bi.firstAsync=void 0,Bi.firstAsync=async function(t){for await(const e of t)return e};var Ci={};Ci.first=void 0,Ci.first=function(t){for(const e of t)return e};var zi={};zi.includesAsync=void 0,zi.includesAsync=async function(t,e){for await(const n of t)if(n===e)return!0;return!1};var Fi={};Fi.includes=void 0,Fi.includes=function(t,e){for(const n of t)if(n===e)return!0;return!1};var qi={};qi.matchAsync=void 0,qi.matchAsync=async function(t,e){const n=e.length;let r=0;for await(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var Di={};Di.match=void 0,Di.match=function(t,e){const n=e.length;let r=0;for(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var Vi={reduceAsync:void 0};const Ui=ye;Vi.reduceAsync=function(t,e,n){return(0,Ui.isUndefined)(n)?function(t,e){return(0,Ui.isAsyncIterable)(t)?n(t):r(t);async function n(t){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,s=await o(r),a=1;for(;({value:t,done:i}=await r.next()),!i;)s=await e(s,t,a++);return s}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}async function o(t){const e=await t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}async function r(t){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=await e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}}(t,e):function(t,e,n){return(0,Ui.isAsyncIterable)(t)?i(t):r(t);async function r(t){let r=n,i=0;for(const n of t)r=await e(r,n,i++);return r}async function i(t){let r=n,i=0;for await(const n of t)r=await e(r,n,i++);return r}}(t,e,n)};var Ri={reduce:void 0};const Li=ye;Ri.reduce=function(t,e,n){return(0,Li.isUndefined)(n)?function(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}(t,e):function(t,e,n){let r=n,i=0;for(const n of t)r=e(r,n,i++);return r}(t,e,n)};var Ki={someAsync:void 0};const Ji=ye;Ki.someAsync=function(t,e){return(0,Ji.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(await e(r,n))return!0;n++}return!1}(t,e):async function(t,e){let n=0;for(const r of t){if(await e(r,n))return!0;n++}return!1}(t,e)};var Wi={};Wi.some=void 0,Wi.some=function(t,e){let n=0;for(const r of t){if(e(r,n))return!0;n++}return!1};var Yi={};Yi.lastAsync=void 0,Yi.lastAsync=async function(t){var e;const n=t[Symbol.asyncIterator]();let r;try{let t,i;for(;({value:t,done:r}=await n.next()),!r;)i=t;return i}finally{r||await(null===(e=n.return)||void 0===e?void 0:e.call(n))}};var Hi={};Hi.last=void 0,Hi.last=function(t){var e;const n=t[Symbol.iterator]();let r;try{let t,i;for(;({value:t,done:r}=n.next()),!r;)i=t;return i}finally{r||null===(e=n.return)||void 0===e||e.call(n)}};var $i={toArrayAsync:void 0};const Qi=Si;$i.toArrayAsync=function(t){return(0,Qi.consume)(t,(async t=>{const e=[];for await(const n of t)e.push(n);return e}))};var Xi={toArray:void 0};const Gi=Si;Xi.toArray=function(t){return(0,Gi.consume)(t,(t=>Array.from(t)))};var Zi={toSetAsync:void 0};const to=Si;Zi.toSetAsync=function(t){return(0,to.consume)(t,(async t=>{const e=new Set;for await(const n of t)e.add(n);return e}))};var eo={toSet:void 0};const no=Si;eo.toSet=function(t){return(0,no.consume)(t,(t=>new Set(t)))};var ro={};ro.count=void 0,ro.count=function(t){let e=0;for(const n of t)e++;return e};var io={};io.countAsync=void 0,io.countAsync=async function(t){let e=0;for await(const n of t)e++;return e};var oo={groupBy:void 0};const so=Ii;oo.groupBy=function(t,e){const n=new Map;return(0,so.each)(t,((t,r)=>{const i=e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)})),n};var ao={groupByAsync:void 0};const uo=Ai;var co;function lo(){return co||(co=1,function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Ti(),t),r(_i,t)}(Vt)),Vt}ao.groupByAsync=async function(t,e){const n=new Map;return await(0,uo.eachAsync)(t,(async(t,r)=>{const i=await e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)})),n},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Si,t),r(Ai,t),r(Ii,t),r(Oi,t),r(ji,t),r(ki,t),r(Mi,t),r(Bi,t),r(Ci,t),r(zi,t),r(Fi,t),r(qi,t),r(Di,t),r(Vi,t),r(Ri,t),r(Ki,t),r(Wi,t),r(Yi,t),r(Hi,t),r($i,t),r(Xi,t),r(Zi,t),r(eo,t),r(ro,t),r(io,t),r(oo,t),r(ao,t)}(_i);var ho={},fo={};fo.traverseErrorPrototypeChain=void 0,fo.traverseErrorPrototypeChain=function*(t){let e=t;for(;(e=Object.getPrototypeOf(e))&&(yield e,e!==Error.prototype););},ho.getErrorNames=void 0;const yo=r,po=fo;ho.getErrorNames=function*(t){var e;if((0,yo.isError)(t))for(const n of(0,po.traverseErrorPrototypeChain)(t))(null===(e=n.constructor)||void 0===e?void 0:e.name)&&(yield n.constructor.name);else yield t.name,yield*t.ancestors};var vo={isSerializableError:void 0};const mo=r;vo.isSerializableError=function(t){return(0,mo.isObject)(t)&&(0,mo.isString)(t.name)&&(0,mo.isString)(t.message)&&((0,mo.isString)(t.stack)||(0,mo.isNull)(t.stack))&&(0,mo.isArray)(t.ancestors)&&t.ancestors.every(mo.isString)},Dt.CustomError=void 0;const bo=lo(),go=ho,wo=r,xo=vo;class To extends Error{get name(){var t,e;return null!==(e=null!==(t=(0,bo.first)((0,go.getErrorNames)(this)))&&void 0!==t?t:To.name)&&void 0!==e?e:"CustomError"}static[Symbol.hasInstance](t){var e;if((0,wo.isError)(t)||(0,xo.isSerializableError)(t)){const n=[null!==(e=this.prototype.constructor.name)&&void 0!==e?e:this.name,...(0,go.getErrorNames)(this.prototype)].reverse(),r=(0,bo.toArray)((0,go.getErrorNames)(t)).reverse();return n.every(((t,e)=>t===r[e]))}return!1}}Dt.CustomError=To;var _o={AssertionError:void 0};const So=Dt;class Ao extends So.CustomError{}_o.AssertionError=Ao;var Eo={normalize:void 0};const Io=ho,Oo=lo();Eo.normalize=function(t){var e;const[n,...r]=(0,Oo.toArray)((0,Io.getErrorNames)(t));return{name:n,ancestors:r,message:t.message,stack:null!==(e=t.stack)&&void 0!==e?e:null}};var Po={hydrate:void 0};const jo=Mn;function ko(t,e){const n=function(){(0,jo.pass)()};return(n.prototype=Object.create(t.prototype)).constructor=n,Object.defineProperty(n,"name",{value:e}),n}Po.hydrate=function(t){var e;const n=[t.name,...t.ancestors].slice(0,-1).reverse();let r=Error;for(const t of n)r=ko(r,t);const i=new r;return i.name=t.name,i.message=t.message,i.stack=null!==(e=t.stack)&&void 0!==e?e:void 0,i};var No={assert:void 0};const Mo=_o;No.assert=function(t,e){if(!t)throw new Mo.AssertionError(e)},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Dt,t),r(_o,t),r(vo,t),r(Eo,t),r(Po,t),r(No,t),r(ho,t),r(fo,t)}(qt);var Bo=lo();class Co{constructor(t){this.map=new Map,qt.assert(Number.isInteger(t),"The parameter limit must be an integer"),qt.assert(t>0,"The parameter limit must be a positive value"),this.limit=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e){return this.map.has(t)?this.updateItem(t,e):(this.map.size===this.limit&&this.map.delete(this.getColdestKey()),this.map.set(t,e)),this}has(t){return this.map.has(t)}get(t){if(!this.has(t))return;const e=this.map.get(t);return this.updateItem(t,e),e}delete(t){return this.map.delete(t)}clear(){this.map.clear()}updateItem(t,e){this.map.delete(t),this.map.set(t,e)}getColdestKey(){return Bo.first(this.map.keys())}}class zo{constructor(){this.map=new Map,this.itemMetadataSortedByExpirationTime=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e,n){return this.map.set(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n),this}has(t){return this.map.has(t)}get(t){return this.map.get(t)}delete(t){const e=this.map.delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;this.map.clear(),null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>this.map.delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=Yt.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));this.cancelClearTimeout=()=>{e(),this.cancelClearTimeout=void 0}}}}}class Fo{constructor(t){this.map=new Map,this.itemMetadataSortedByExpirationTime=[],qt.assert(Number.isInteger(t),"The parameter limit must be an integer"),qt.assert(t>0,"The parameter limit must be a positive value"),this.limit=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e,n){return this.map.has(t)?(this.updateItem(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n)):(this.map.size===this.limit&&this.map.delete(this.getColdestKey()),this.map.set(t,e),this.addItemMetadata(t,Date.now()+n)),this}has(t){return this.map.has(t)}get(t){if(this.has(t)){const e=this.map.get(t);return this.updateItem(t,e),e}}delete(t){const e=this.map.delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;this.map.clear(),null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}updateItem(t,e){this.map.delete(t),this.map.set(t,e)}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>this.map.delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=Yt.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));this.cancelClearTimeout=()=>{e(),this.cancelClearTimeout=void 0}}}}getColdestKey(){return Bo.first(this.map.keys())}}class qo{constructor(t){this.value=t,this.children=new Map}}class Do{constructor(){this.root=new qo}get[Symbol.toStringTag](){return this.constructor.name}*entries(){yield*function*t(e,n){for(const[i,o]of e.children){const e=[...n,i];r.isntUndefined(o.value)&&(yield[e,o.value]),yield*t(o,e)}}(this.root,[])}keys(){return Bo.map(this.entries(),(([t])=>t))}values(){return Bo.map(this.entries(),(([t,e])=>e))}set(t,e){let n=this.root;for(const e of t)n.children.has(e)||n.children.set(e,new qo),n=n.children.get(e);return n.value=e,this}has(t){let e=this.root;for(const n of t){if(!e.children.has(n))return!1;e=e.children.get(n)}return void 0!==e.value}get(t){let e=this.root;for(const n of t){if(!e.children.has(n))return;e=e.children.get(n)}return e.value}delete(t){const e=[];let n=this.root;for(const r of t){if(!n.children.has(r))return!1;e.push(n),n=n.children.get(r)}if(delete n.value,0===n.children.size)for(const[n,r]of Bo.toArray(Bo.zip(t,e)).reverse())if(r.children.delete(n),0!==r.children.size)break;return!0}}class Vo{constructor(t,e){this.schema=t,this._state=e}get[Symbol.toStringTag](){return this.constructor.name}get state(){return this._state}matches(t){return this._state===t}can(t){return t in this.schema[this.state]}send(t){if(!this.can(t))throw new Uo(this.state,t);this._state=this.schema[this.state][t]}}class Uo extends qt.CustomError{constructor(t,e){super(`State ${t} cannot react to event ${e}`)}}
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Structures={})}(this,(function(t){"use strict";class e{constructor(t){this.value=t}get[Symbol.toStringTag](){return this.constructor.name}set(t){this.value=t}get(){return this.value}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={},i={};function o(t){return Array.isArray(t)}i.isntEmptyArray=i.isEmptyArray=i.isntArray=i.isArray=void 0,i.isArray=o,i.isntArray=function(t){return!o(t)},i.isEmptyArray=function(t){return 0===t.length},i.isntEmptyArray=function(t){return 0!==t.length};var s={},a={};function u(t){return null===t}a.isntNull=a.isNull=void 0,a.isNull=u,a.isntNull=function(t){return!u(t)};var c={};function l(t){return void 0===t}c.isntUndefined=c.isUndefined=void 0,c.isUndefined=l,c.isntUndefined=function(t){return!l(t)};var h={};function f(t){return"function"==typeof t}h.isntFunction=h.isFunction=void 0,h.isFunction=f,h.isntFunction=function(t){return!f(t)},s.isntAsyncIterable=s.isAsyncIterable=void 0;const d=a,y=c,p=h;function v(t){return(0,d.isntNull)(t)&&(0,y.isntUndefined)(t)&&(0,p.isFunction)(t[Symbol.asyncIterator])}s.isAsyncIterable=v,s.isntAsyncIterable=function(t){return!v(t)};var m={};function b(t){return"bigint"==typeof t}m.isntBigInt=m.isBigInt=void 0,m.isBigInt=b,m.isntBigInt=function(t){return!b(t)};var g={};function x(t){return"boolean"==typeof t}g.isntBoolean=g.isBoolean=void 0,g.isBoolean=x,g.isntBoolean=function(t){return!x(t)};var w={},T={};function _(t){return"string"==typeof t}T.isntString=T.isString=void 0,T.isString=_,T.isntString=function(t){return!_(t)},w.isntChar=w.isChar=void 0;const S=T;function A(t){return(0,S.isString)(t)&&1===t.length}w.isChar=A,w.isntChar=function(t){return!A(t)};var I={};function E(t){return t instanceof Date}I.isntDate=I.isDate=void 0,I.isDate=E,I.isntDate=function(t){return!E(t)};var O={};O.inEnum=void 0,O.inEnum=function(t,e){return Object.values(e).includes(t)};var P={};function j(t){return t instanceof Error}P.isntError=P.isError=void 0,P.isError=j,P.isntError=function(t){return!j(t)};var k={};function M(t){return!t}k.isntFalsy=k.isFalsy=void 0,k.isFalsy=M,k.isntFalsy=function(t){return!M(t)};var N={};N.isntIterable=N.isIterable=void 0;const B=a,C=c,F=h;function z(t){return(0,B.isntNull)(t)&&(0,C.isntUndefined)(t)&&(0,F.isFunction)(t[Symbol.iterator])}N.isIterable=z,N.isntIterable=function(t){return!z(t)};var q={},D={};function V(t){return"number"==typeof t}function U(t){return Number.isNaN(t)}D.isntNaN=D.isNaN=D.isNegativeInfinity=D.isPositiveInfinity=D.isFinite=D.isntNumber=D.isNumber=void 0,D.isNumber=V,D.isntNumber=function(t){return!V(t)},D.isFinite=function(t){return Number.isFinite(t)},D.isPositiveInfinity=function(t){return t===1/0},D.isNegativeInfinity=function(t){return t===-1/0},D.isNaN=U,D.isntNaN=function(t){return!U(t)};var R={},L="object"==typeof n&&n&&n.Object===Object&&n,K="object"==typeof self&&self&&self.Object===Object&&self,J=(L||K||Function("return this")()).Symbol,W=J,Y=Object.prototype,H=Y.hasOwnProperty,$=Y.toString,Q=W?W.toStringTag:void 0;var X=function(t){var e=H.call(t,Q),n=t[Q];try{t[Q]=void 0;var r=!0}catch(t){}var i=$.call(t);return r&&(e?t[Q]=n:delete t[Q]),i},G=Object.prototype.toString;var Z=X,tt=function(t){return G.call(t)},et=J?J.toStringTag:void 0;var nt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":et&&et in Object(t)?Z(t):tt(t)};var rt=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);var it=nt,ot=rt,st=function(t){return null!=t&&"object"==typeof t},at=Function.prototype,ut=Object.prototype,ct=at.toString,lt=ut.hasOwnProperty,ht=ct.call(Object);var ft=function(t){if(!st(t)||"[object Object]"!=it(t))return!1;var e=ot(t);if(null===e)return!0;var n=lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ct.call(n)==ht},dt=n&&n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};R.isntEmptyObject=R.isEmptyObject=R.isntPlainObject=R.isPlainObject=R.isntObject=R.isObject=void 0;const yt=dt(ft);function pt(t){return null!==t&&"object"==typeof t}function vt(t){return(0,yt.default)(t)}R.isObject=pt,R.isntObject=function(t){return!pt(t)},R.isPlainObject=vt,R.isntPlainObject=function(t){return!vt(t)},R.isEmptyObject=function(t){return 0===Object.keys(t).length},R.isntEmptyObject=function(t){return 0!==Object.keys(t).length},q.isntJsonable=q.isJsonable=q.isntJson=q.isJson=void 0;const mt=a,bt=g,gt=T,xt=D,wt=i,Tt=R;function _t(t){return(0,mt.isNull)(t)||(0,bt.isBoolean)(t)||(0,gt.isString)(t)||(0,xt.isNumber)(t)||(0,wt.isArray)(t)&&t.every(_t)||(0,Tt.isPlainObject)(t)&&Object.values(t).every(_t)}q.isJson=_t,q.isntJson=function(t){return!_t(t)},q.isJsonable=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},q.isntJsonable=function t(e){return!t()};var St={};St.isPromiseLike=St.isntPromiseLike=St.isntPromise=St.isPromise=void 0;const At=R,It=h;function Et(t){return t instanceof Promise}function Ot(t){return(0,At.isObject)(t)&&(0,It.isFunction)(t.then)}St.isPromise=Et,St.isntPromise=function(t){return!Et(t)},St.isntPromiseLike=function(t){return!Ot(t)},St.isPromiseLike=Ot;var Pt={};Pt.isAbsoluteURL=void 0,Pt.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}};var jt={};function kt(t){return t instanceof RegExp}jt.isntRegExp=jt.isRegExp=void 0,jt.isRegExp=kt,jt.isntRegExp=function(t){return!kt(t)};var Mt={};function Nt(t){return"symbol"==typeof t}Mt.isntSymbol=Mt.isSymbol=void 0,Mt.isSymbol=Nt,Mt.isntSymbol=function(t){return!Nt(t)},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(i,t),r(s,t),r(m,t),r(g,t),r(w,t),r(I,t),r(O,t),r(P,t),r(k,t),r(h,t),r(N,t),r(q,t),r(a,t),r(D,t),r(R,t),r(St,t),r(T,t),r(c,t),r(Pt,t),r(jt,t),r(Mt,t)}(r);class Bt{constructor(){this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}on(t,e){this.map.has(t)||this.map.set(t,new Set);return this.map.get(t).add(n),()=>{if(!this.map.has(t))return;const e=this.map.get(t);e.delete(n),0===e.size&&this.map.delete(t)};function n(...t){e(...t)}}once(t,e){const n=this.on(t,((...t)=>{e(...t),n()}));return n}emit(t,...e){this.map.has(t)&&this.map.get(t).forEach((t=>t(...e)))}}class Ct{constructor(t){this.hash=t,this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e){return this.map.set(this.hash(t),e),this}has(t){return this.map.has(this.hash(t))}get(t){return this.map.get(this.hash(t))}delete(t){return this.map.delete(this.hash(t))}clear(){this.map.clear()}}class Ft{constructor(t){this.hash=t,this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}[Symbol.iterator](){return this.map.values()}add(t){return this.map.set(this.hash(t),t),this}delete(t){return this.map.delete(this.hash(t))}has(t){return this.map.has(this.hash(t))}clear(){this.map.clear()}values(){return this.map.values()}}class zt{constructor(){this.items=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.items.length}empty(){this.items.length=0}enqueue(...t){this.items.push(...t)}dequeue(){return this.items.shift()}remove(t){let e;for(;(e=this.items.indexOf(t))>=0;)this.items.splice(e,1)}}var qt={},Dt={},Vt={},Ut={},Rt={},Lt={},Kt={};Kt.go=void 0,Kt.go=function(t){return t()};var Jt={};Jt.goMicrotask=void 0,Jt.goMicrotask=function(t){return new Promise(((e,n)=>{queueMicrotask((async()=>{try{e(await t())}catch(t){n(t)}}))}))};var Wt={},Yt={},Ht={},$t={},Qt={};Qt.random=void 0,Qt.random=function(t,e){return Math.random()*(e-t)+t};var Xt={};Xt.randomInt=void 0,Xt.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t};var Gt={};Gt.randomIntInclusive=void 0,Gt.randomIntInclusive=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Qt,t),r(Xt,t),r(Gt,t)}($t),Ht.calculateExponentialBackoffTimeout=void 0;const Zt=$t;Ht.calculateExponentialBackoffTimeout=function({baseTimeout:t,retries:e,maxTimeout:n=1/0,factor:r=2,jitter:i=!0}){const o=Math.min(r**e*t,n);return i?(0,Zt.randomIntInclusive)(0,o):o};var te={};te.setTimeout=void 0,te.setTimeout=function(t,e){const n=globalThis.setTimeout(e,t);return()=>clearTimeout(n)};var ee={setSchedule:void 0};const ne=te;ee.setSchedule=function(t,e){const n=t-Date.now();return(0,ne.setTimeout)(n,e)};var re={};re.setInterval=void 0,re.setInterval=function(t,e){const n=globalThis.setInterval(e,t);return()=>clearInterval(n)};var ie={setImmediate:void 0};const oe=te;ie.setImmediate=function(t){if(globalThis.setImmediate){const e=globalThis.setImmediate(t);return()=>clearImmediate(e)}return(0,oe.setTimeout)(0,t)};var se={setTimeoutLoop:void 0};const ae=te;se.setTimeoutLoop=function(t,e){let n=!1,r=(0,ae.setTimeout)(t,(async function i(){await e(),n||(r=(0,ae.setTimeout)(t,i))}));return()=>{n=!0,r()}};var ue={setDynamicTimeoutLoop:void 0};const ce=te;ue.setDynamicTimeoutLoop=function(t,e){let n=!1,r=(0,ce.setTimeout)(t,(async function i(){const o=Date.now();await e();const s=Date.now()-o;n||(r=(0,ce.setTimeout)(Math.max(t-s,0),i))}));return()=>{n=!0,r()}},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Ht,t),r(te,t),r(ee,t),r(re,t),r(ie,t),r(se,t),r(ue,t)}(Yt),Wt.goMacrotask=void 0;const le=Yt;var he;Wt.goMacrotask=function(t){return new Promise(((e,n)=>{(0,le.setImmediate)((async()=>{try{e(await t())}catch(t){n(t)}}))}))},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Kt,t),r(Jt,t),r(Wt,t)}(Lt);var fe={},de={},ye={};function pe(t){return Array.isArray(t)}ye.isntEmptyArray=ye.isEmptyArray=ye.isntArray=ye.isArray=void 0,ye.isArray=pe,ye.isntArray=function(t){return!pe(t)},ye.isEmptyArray=function(t){return 0===t.length},ye.isntEmptyArray=function(t){return 0!==t.length};var ve={},me={};function be(t){return null===t}me.isntNull=me.isNull=void 0,me.isNull=be,me.isntNull=function(t){return!be(t)};var ge={};function xe(t){return void 0===t}ge.isntUndefined=ge.isUndefined=void 0,ge.isUndefined=xe,ge.isntUndefined=function(t){return!xe(t)};var we={};function Te(t){return"function"==typeof t}we.isntFunction=we.isFunction=void 0,we.isFunction=Te,we.isntFunction=function(t){return!Te(t)},ve.isntAsyncIterable=ve.isAsyncIterable=void 0;const _e=me,Se=ge,Ae=we;function Ie(t){return(0,_e.isntNull)(t)&&(0,Se.isntUndefined)(t)&&(0,Ae.isFunction)(t[Symbol.asyncIterator])}ve.isAsyncIterable=Ie,ve.isntAsyncIterable=function(t){return!Ie(t)};var Ee={};function Oe(t){return"bigint"==typeof t}Ee.isntBigInt=Ee.isBigInt=void 0,Ee.isBigInt=Oe,Ee.isntBigInt=function(t){return!Oe(t)};var Pe={};function je(t){return"boolean"==typeof t}Pe.isntBoolean=Pe.isBoolean=void 0,Pe.isBoolean=je,Pe.isntBoolean=function(t){return!je(t)};var ke={},Me={};function Ne(t){return"string"==typeof t}Me.isntString=Me.isString=void 0,Me.isString=Ne,Me.isntString=function(t){return!Ne(t)},ke.isntChar=ke.isChar=void 0;const Be=Me;function Ce(t){return(0,Be.isString)(t)&&1===t.length}ke.isChar=Ce,ke.isntChar=function(t){return!Ce(t)};var Fe={};function ze(t){return t instanceof Date}Fe.isntDate=Fe.isDate=void 0,Fe.isDate=ze,Fe.isntDate=function(t){return!ze(t)};var qe={};qe.inEnum=void 0,qe.inEnum=function(t,e){return Object.values(e).includes(t)};var De={};function Ve(t){return t instanceof Error}De.isntError=De.isError=void 0,De.isError=Ve,De.isntError=function(t){return!Ve(t)};var Ue={};function Re(t){return!t}Ue.isntFalsy=Ue.isFalsy=void 0,Ue.isFalsy=Re,Ue.isntFalsy=function(t){return!Re(t)};var Le={};Le.isntIterable=Le.isIterable=void 0;const Ke=me,Je=ge,We=we;function Ye(t){return(0,Ke.isntNull)(t)&&(0,Je.isntUndefined)(t)&&(0,We.isFunction)(t[Symbol.iterator])}Le.isIterable=Ye,Le.isntIterable=function(t){return!Ye(t)};var He={},$e={};function Qe(t){return"number"==typeof t}function Xe(t){return Number.isNaN(t)}$e.isntNaN=$e.isNaN=$e.isNegativeInfinity=$e.isPositiveInfinity=$e.isFinite=$e.isntNumber=$e.isNumber=void 0,$e.isNumber=Qe,$e.isntNumber=function(t){return!Qe(t)},$e.isFinite=function(t){return Number.isFinite(t)},$e.isPositiveInfinity=function(t){return t===1/0},$e.isNegativeInfinity=function(t){return t===-1/0},$e.isNaN=Xe,$e.isntNaN=function(t){return!Xe(t)};var Ge={},Ze=n&&n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Ge.isntEmptyObject=Ge.isEmptyObject=Ge.isntPlainObject=Ge.isPlainObject=Ge.isntObject=Ge.isObject=void 0;const tn=Ze(ft);function en(t){return null!==t&&"object"==typeof t}function nn(t){return(0,tn.default)(t)}Ge.isObject=en,Ge.isntObject=function(t){return!en(t)},Ge.isPlainObject=nn,Ge.isntPlainObject=function(t){return!nn(t)},Ge.isEmptyObject=function(t){return 0===Object.keys(t).length},Ge.isntEmptyObject=function(t){return 0!==Object.keys(t).length},He.isntJsonable=He.isJsonable=He.isntJson=He.isJson=void 0;const rn=me,on=Pe,sn=Me,an=$e,un=ye,cn=Ge;function ln(t){return(0,rn.isNull)(t)||(0,on.isBoolean)(t)||(0,sn.isString)(t)||(0,an.isNumber)(t)||(0,un.isArray)(t)&&t.every(ln)||(0,cn.isPlainObject)(t)&&Object.values(t).every(ln)}He.isJson=ln,He.isntJson=function(t){return!ln(t)},He.isJsonable=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},He.isntJsonable=function t(e){return!t()};var hn={};hn.isPromiseLike=hn.isntPromiseLike=hn.isntPromise=hn.isPromise=void 0;const fn=Ge,dn=we;function yn(t){return t instanceof Promise}function pn(t){return(0,fn.isObject)(t)&&(0,dn.isFunction)(t.then)}hn.isPromise=yn,hn.isntPromise=function(t){return!yn(t)},hn.isntPromiseLike=function(t){return!pn(t)},hn.isPromiseLike=pn;var vn={};vn.isAbsoluteURL=void 0,vn.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}};var mn={};function bn(t){return t instanceof RegExp}mn.isntRegExp=mn.isRegExp=void 0,mn.isRegExp=bn,mn.isntRegExp=function(t){return!bn(t)},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(ye,t),r(ve,t),r(Ee,t),r(Pe,t),r(ke,t),r(Fe,t),r(qe,t),r(De,t),r(Ue,t),r(we,t),r(Le,t),r(He,t),r(me,t),r($e,t),r(Ge,t),r(hn,t),r(Me,t),r(ge,t),r(vn,t),r(mn,t)}(de),fe.chunkByAsync=void 0;const gn=de;fe.chunkByAsync=function(t,e){return(0,gn.isAsyncIterable)(t)?async function*(t,e){let n=[],r=0;for await(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t,e):async function*(t,e){let n=[],r=0;for(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t,e)};var xn={};xn.chunkBy=void 0,xn.chunkBy=function*(t,e){let n=[],r=0;for(const i of t)n.push(i),e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)};var wn,Tn={};var _n={concatAsync:void 0};const Sn=de,An=Lt;_n.concatAsync=function(t,...e){return(0,An.go)((async function*(){for(const n of[t,...e])if((0,Sn.isAsyncIterable)(n))for await(const t of n)yield t;else for(const t of n)yield t}))};var In={concat:void 0};const En=Lt;In.concat=function(t,...e){return(0,En.go)((function*(){for(const n of[t,...e])yield*n}))};var On,Pn={},jn={};jn.copyIterable=jn.copyAsyncIterable=void 0,jn.copyAsyncIterable=async function*(t){for await(const e of t)yield e},jn.copyIterable=function*(t){for(const e of t)yield e};var kn,Mn={};var Nn,Bn={};var Cn={dropUntilAsync:void 0};const Fn=de;Cn.dropUntilAsync=function(t,e){return(0,Fn.isAsyncIterable)(t)?async function*(t,e){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=await r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}(t,e):async function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}(t,e)};var zn={};zn.dropUntil=void 0,zn.dropUntil=function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}};var qn,Dn={};var Vn={filterAsync:void 0};const Un=de;Vn.filterAsync=function(t,e){return(0,Un.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)await e(r,n)&&(yield r),n++}(t,e):async function*(t,e){let n=0;for(const r of t)await e(r,n)&&(yield r),n++}(t,e)};var Rn={};Rn.filter=void 0,Rn.filter=function*(t,e){let n=0;for(const r of t)e(r,n)&&(yield r),n++};var Ln={},Kn={},Jn={flattenByAsync:void 0};const Wn=de;async function*Yn(t,e,n){for(const r of t)Hn(r)&&await e(r,n)?yield*Yn(r,e,n+1):yield r}function Hn(t){return(0,Wn.isIterable)(t)&&(0,Wn.isntChar)(t)}var $n,Qn;function Xn(){if($n)return Kn;$n=1,Kn.flattenDeepAsync=void 0;const t=Jn,e=uo();return Kn.flattenDeepAsync=function(n,r=1/0){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter depth must be an integer"),(0,e.assert)(r>=0,"The parameter depth must be greater than or equal to 0"),(0,t.flattenByAsync)(n,((t,e)=>e<=r))},Kn}Jn.flattenByAsync=function(t,e){return(0,Wn.isAsyncIterable)(t)?async function*(t,e){const n=1;for await(const r of t)Hn(r)&&await e(r,n)?yield*Yn(r,e,n+1):yield r}(t,e):function(t,e){return Yn(t,e,1)}(t,e)};var Gn={flattenBy:void 0};const Zn=de;function*tr(t,e,n){for(const i of t)(0,Zn.isIterable)(r=i)&&(0,Zn.isntChar)(r)&&e(i,n)?yield*tr(i,e,n+1):yield i;var r}Gn.flattenBy=function(t,e){return tr(t,e,1)};var er,nr={};function rr(){if(er)return nr;er=1,nr.flattenDeep=void 0;const t=Gn,e=uo();return nr.flattenDeep=function(n,r=1/0){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter depth must be an integer"),(0,e.assert)(r>=0,"The parameter depth must be greater than or equal to 0"),(0,t.flattenBy)(n,((t,e)=>e<=r))},nr}var ir,or={};var sr={mapAsync:void 0};const ar=de;sr.mapAsync=function(t,e){return(0,ar.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)yield await e(r,n),n++}(t,e):async function*(t,e){let n=0;for(const r of t)yield await e(r,n),n++}(t,e)};var ur={};ur.map=void 0,ur.map=function*(t,e){let n=0;for(const r of t)yield e(r,n),n++};var cr,lr={};function hr(){if(cr)return lr;cr=1,lr.repeatAsync=void 0;const t=Lt,e=uo();return lr.repeatAsync=function(n,r){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter times must be an integer"),(0,e.assert)(r>=0,"The parameter times must be greater than or equal to 0"),r===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,t.go)((async function*(){const t=[];if(r>0){for await(const e of n)yield e,t.push(e);r--}for(;r>0;)yield*t,r--}))},lr}var fr,dr={};function yr(){if(fr)return dr;fr=1,dr.repeat=void 0;const t=Lt,e=uo();return dr.repeat=function(n,r){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter times must be an integer"),(0,e.assert)(r>=0,"The parameter times must be greater than or equal to 0"),r===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,t.go)((function*(){const t=[];if(r>0){for(const e of n)yield e,t.push(e);r--}for(;r>0;)yield*t,r--}))},dr}var pr,vr={};var mr,br={};var gr={};gr.splitAsync=void 0,gr.splitAsync=async function*(t,e){let n=[];for await(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var xr={splitByAsync:void 0};const wr=de;xr.splitByAsync=function(t,e){return(0,wr.isAsyncIterable)(t)?async function*(t,e){let n=[],r=0;for await(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t,e):async function*(t,e){let n=[],r=0;for(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t,e)};var Tr={};Tr.splitBy=void 0,Tr.splitBy=function*(t,e){let n=[],r=0;for(const i of t)e(i,r)?(yield n,n=[]):n.push(i),r++;yield n};var _r={};_r.split=void 0,_r.split=function*(t,e){let n=[];for(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Sr,Ar={};var Ir,Er={};var Or,Pr={};var jr={takeUntilAsync:void 0};const kr=de;jr.takeUntilAsync=function(t,e){return(0,kr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t){if(await e(r,n))break;yield r,n++}}(t,e):async function*(t,e){let n=0;for(const r of t){if(await e(r,n))break;yield r,n++}}(t,e)};var Mr={};Mr.takeUntil=void 0,Mr.takeUntil=function*(t,e){let n=0;for(const r of t){if(e(r,n))break;yield r,n++}};var Nr,Br={};var Cr={tapAsync:void 0};const Fr=de;Cr.tapAsync=function(t,e){return(0,Fr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)await e(r,n),yield r,n++}(t,e):async function*(t,e){let n=0;for(const r of t)await e(r,n),yield r,n++}(t,e)};var zr={};zr.tap=void 0,zr.tap=function*(t,e){let n=0;for(const r of t)e(r,n),yield r,n++};var qr={};qr.toAsyncIterable=void 0,qr.toAsyncIterable=async function*(t){for(const e of t)yield e};var Dr={};Dr.transformAsync=void 0,Dr.transformAsync=async function*(t,e){yield*e(t)};var Vr={};Vr.transform=void 0,Vr.transform=function*(t,e){yield*e(t)};var Ur={};Ur.uniqAsync=void 0,Ur.uniqAsync=async function*(t){const e=new Set;for await(const n of t)e.has(n)||(yield n,e.add(n))};var Rr={uniqByAsync:void 0};const Lr=de;Rr.uniqByAsync=function(t,e){return(0,Lr.isAsyncIterable)(t)?async function*(t,e){const n=new Set;let r=0;for await(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t,e):async function*(t,e){const n=new Set;let r=0;for(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t,e)};var Kr={};Kr.uniqBy=void 0,Kr.uniqBy=function*(t,e){const n=new Set;let r=0;for(const i of t){const t=e(i,r);n.has(t)||(yield i,n.add(t)),r++}};var Jr={};Jr.uniq=void 0,Jr.uniq=function*(t){const e=new Set;for(const n of t)e.has(n)||(yield n,e.add(n))};var Wr={zipAsync:void 0};const Yr=de;var Hr;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(Hr||(Hr={})),Wr.zipAsync=function(t,...e){return async function*(...t){var e,n,r,i;const o=t.length,s=t.map((t=>(0,Yr.isAsyncIterable)(t)?[Hr.Async,t[Symbol.asyncIterator]()]:[Hr.Sync,t[Symbol.iterator]()])),a=s.map((()=>!1));try{for(;;){const t=new Array(o);for(let e=0;e<o;e++){const[n,r]=s[e];let i;if(i=n===Hr.Async?await r.next():r.next(),i.done)return void(a[e]=!0);t[e]=i.value}yield t}}finally{const t=s.filter(((t,e)=>!a[e]));for(const[o,s]of t)o===Hr.Async?await(null===(n=(e=s).return)||void 0===n?void 0:n.call(e)):null===(i=(r=s).return)||void 0===i||i.call(r)}}(t,...e)};var $r,Qr={};function Xr(){return $r||($r=1,function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(function(){if(he)return Rt;he=1,Rt.chunkAsync=void 0;const t=Lt,e=uo();return Rt.chunkAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter size must be an integer"),(0,e.assert)(r>0,"The parameter size must be greater than 0"),(0,t.go)((async function*(){let t=[];for await(const e of n)t.push(e),t.length>=r&&(yield t,t=[]);t.length&&(yield t)}))},Rt}(),t),r(fe,t),r(xn,t),r(function(){if(wn)return Tn;wn=1,Tn.chunk=void 0;const t=Lt,e=uo();return Tn.chunk=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter size must be an integer"),(0,e.assert)(r>0,"The parameter size must be greater than 0"),(0,t.go)((function*(){let t=[];for(const e of n)t.push(e),t.length>=r&&(yield t,t=[]);t.length&&(yield t)}))},Tn}(),t),r(_n,t),r(In,t),r(function(){if(On)return Pn;On=1,Pn.dropAsync=void 0;const t=Lt,e=jn,n=uo();return Pn.dropAsync=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyAsyncIterable)(r):(0,t.go)((async function*(){var t;const e=r[Symbol.asyncIterator]();let n;try{let r;for(;({value:r,done:n}=await e.next()),!(n||i<=0);)i--;for(;!n;)yield r,({value:r,done:n}=await e.next())}finally{n||await(null===(t=e.return)||void 0===t?void 0:t.call(e))}}))},Pn}(),t),r(function(){if(kn)return Mn;kn=1,Mn.dropRightAsync=void 0;const t=Lt,e=jn,n=uo();return Mn.dropRightAsync=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyAsyncIterable)(r):(0,t.go)((async function*(){const t=(await async function(t){const e=[];for await(const n of t)e.push(n);return e}(r)).slice(0,-i);for(const e of t)yield e}))},Mn}(),t),r(function(){if(Nn)return Bn;Nn=1,Bn.dropRight=void 0;const t=Lt,e=jn,n=uo();return Bn.dropRight=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyIterable)(r):(0,t.go)((function*(){const t=Array.from(r);yield*t.slice(0,-i)}))},Bn}(),t),r(Cn,t),r(zn,t),r(function(){if(qn)return Dn;qn=1,Dn.drop=void 0;const t=Lt,e=jn,n=uo();return Dn.drop=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyIterable)(r):(0,t.go)((function*(){var t;const e=r[Symbol.iterator]();let n;try{let r;for(;({value:r,done:n}=e.next()),!(n||i<=0);)i--;for(;!n;)yield r,({value:r,done:n}=e.next())}finally{n||null===(t=e.return)||void 0===t||t.call(e)}}))},Dn}(),t),r(Vn,t),r(Rn,t),r(function(){if(Qn)return Ln;Qn=1,Ln.flattenAsync=void 0;const t=Xn();return Ln.flattenAsync=function(e){return(0,t.flattenDeepAsync)(e,1)},Ln}(),t),r(Jn,t),r(Gn,t),r(Xn(),t),r(rr(),t),r(function(){if(ir)return or;ir=1,or.flatten=void 0;const t=rr();return or.flatten=function(e){return(0,t.flattenDeep)(e,1)},or}(),t),r(sr,t),r(ur,t),r(hr(),t),r(yr(),t),r(function(){if(pr)return vr;pr=1,vr.sliceAsync=void 0;const t=Lt,e=uo();return vr.sliceAsync=function(n,r,i=1/0){return(0,e.assert)(Number.isInteger(r),"The parameter start must be an integer"),(0,e.assert)(r>=0,"The parameter start must be greater than or equal to 0"),(0,e.assert)(Number.isInteger(i),"The parameter end must be an integer"),(0,e.assert)(i>=r,"The parameter end must be greater than or equal to start"),(0,t.go)((async function*(){let t=0;for await(const e of n){if(t>=i)break;t>=r&&(yield e),t++}}))},vr}(),t),r(function(){if(mr)return br;mr=1,br.slice=void 0;const t=Lt,e=uo();return br.slice=function(n,r,i=1/0){return(0,e.assert)(Number.isInteger(r),"The parameter start must be an integer"),(0,e.assert)(r>=0,"The parameter start must be greater than or equal to 0"),(0,e.assert)(Number.isInteger(i),"The parameter end must be an integer"),(0,e.assert)(i>=r,"The parameter end must be greater than or equal to start"),(0,t.go)((function*(){let t=0;for(const e of n){if(t>=i)break;t>=r&&(yield e),t++}}))},br}(),t),r(gr,t),r(xr,t),r(Tr,t),r(_r,t),r(function(){if(Sr)return Ar;Sr=1,Ar.takeAsync=void 0;const t=Lt,e=uo();return Ar.takeAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((async function*(){if(0!==r)for await(const t of n)if(yield t,0==--r)break}))},Ar}(),t),r(function(){if(Ir)return Er;Ir=1,Er.takeRightAsync=void 0;const t=Lt,e=uo();return Er.takeRightAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((async function*(){var t;const e=n[Symbol.asyncIterator]();let i;try{const n=[];let o;for(;({value:o,done:i}=await e.next()),!i;)n.push(o),n.length>r&&n.shift();yield*n}finally{i||await(null===(t=e.return)||void 0===t?void 0:t.call(e))}}))},Er}(),t),r(function(){if(Or)return Pr;Or=1,Pr.takeRight=void 0;const t=Lt,e=uo();return Pr.takeRight=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((function*(){var t;const e=n[Symbol.iterator]();let i;try{const n=[];let o;for(;({value:o,done:i}=e.next()),!i;)n.push(o),n.length>r&&n.shift();yield*n}finally{i||null===(t=e.return)||void 0===t||t.call(e)}}))},Pr}(),t),r(jr,t),r(Mr,t),r(function(){if(Nr)return Br;Nr=1,Br.take=void 0;const t=Lt,e=uo();return Br.take=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((function*(){if(0!==r)for(const t of n)if(yield t,0==--r)break}))},Br}(),t),r(Cr,t),r(zr,t),r(qr,t),r(Dr,t),r(Vr,t),r(Ur,t),r(Rr,t),r(Kr,t),r(Jr,t),r(Wr,t),r(Qr,t)}(Ut)),Ut}Qr.zip=void 0,Qr.zip=function(t,...e){return function*(...t){const e=t.length,n=t.map((t=>t[Symbol.iterator]())),r=n.map((()=>!1));try{for(;;){const t=new Array(e);for(let i=0;i<e;i++){const{value:e,done:o}=n[i].next();if(o)return void(r[i]=!0);t[i]=e}yield t}}finally{n.filter(((t,e)=>!r[e])).forEach((t=>{var e;return null===(e=t.return)||void 0===e?void 0:e.call(t)}))}}(t,...e)};var Gr={},Zr={};Zr.consume=void 0,Zr.consume=function(t,e){return e(t)};var ti={eachAsync:void 0};const ei=de;ti.eachAsync=function(t,e){return(0,ei.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t)await e(r,n),n++}(t,e):async function(t,e){let n=0;for(const r of t)await e(r,n),n++}(t,e)};var ni={};ni.each=void 0,ni.each=function(t,e){let n=0;for(const r of t)e(r,n),n++};var ri={everyAsync:void 0};const ii=de;ri.everyAsync=function(t,e){return(0,ii.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(!await e(r,n))return!1;n++}return!0}(t,e):async function(t,e){let n=0;for(const r of t){if(!await e(r,n))return!1;n++}return!0}(t,e)};var oi={};oi.every=void 0,oi.every=function(t,e){let n=0;for(const r of t){if(!e(r,n))return!1;n++}return!0};var si={findAsync:void 0};const ai=de;si.findAsync=function(t,e){return(0,ai.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(await e(r,n))return r;n++}return}(t,e):async function(t,e){let n=0;for(const r of t){if(await e(r,n))return r;n++}return}(t,e)};var ui={};ui.find=void 0,ui.find=function(t,e){let n=0;for(const r of t){if(e(r,n))return r;n++}};var ci={};ci.firstAsync=void 0,ci.firstAsync=async function(t){for await(const e of t)return e};var li={};li.first=void 0,li.first=function(t){for(const e of t)return e};var hi={};hi.includesAsync=void 0,hi.includesAsync=async function(t,e){for await(const n of t)if(n===e)return!0;return!1};var fi={};fi.includes=void 0,fi.includes=function(t,e){for(const n of t)if(n===e)return!0;return!1};var di={};di.matchAsync=void 0,di.matchAsync=async function(t,e){const n=e.length;let r=0;for await(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var yi={};yi.match=void 0,yi.match=function(t,e){const n=e.length;let r=0;for(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var pi={reduceAsync:void 0};const vi=de;pi.reduceAsync=function(t,e,n){return(0,vi.isUndefined)(n)?function(t,e){return(0,vi.isAsyncIterable)(t)?n(t):r(t);async function n(t){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,s=await o(r),a=1;for(;({value:t,done:i}=await r.next()),!i;)s=await e(s,t,a++);return s}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}async function o(t){const e=await t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}async function r(t){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=await e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}}(t,e):function(t,e,n){return(0,vi.isAsyncIterable)(t)?i(t):r(t);async function r(t){let r=n,i=0;for(const n of t)r=await e(r,n,i++);return r}async function i(t){let r=n,i=0;for await(const n of t)r=await e(r,n,i++);return r}}(t,e,n)};var mi={reduce:void 0};const bi=de;mi.reduce=function(t,e,n){return(0,bi.isUndefined)(n)?function(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}(t,e):function(t,e,n){let r=n,i=0;for(const n of t)r=e(r,n,i++);return r}(t,e,n)};var gi={someAsync:void 0};const xi=de;gi.someAsync=function(t,e){return(0,xi.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(await e(r,n))return!0;n++}return!1}(t,e):async function(t,e){let n=0;for(const r of t){if(await e(r,n))return!0;n++}return!1}(t,e)};var wi={};wi.some=void 0,wi.some=function(t,e){let n=0;for(const r of t){if(e(r,n))return!0;n++}return!1};var Ti={};Ti.lastAsync=void 0,Ti.lastAsync=async function(t){var e;const n=t[Symbol.asyncIterator]();let r;try{let t,i;for(;({value:t,done:r}=await n.next()),!r;)i=t;return i}finally{r||await(null===(e=n.return)||void 0===e?void 0:e.call(n))}};var _i={};_i.last=void 0,_i.last=function(t){var e;const n=t[Symbol.iterator]();let r;try{let t,i;for(;({value:t,done:r}=n.next()),!r;)i=t;return i}finally{r||null===(e=n.return)||void 0===e||e.call(n)}};var Si={toArrayAsync:void 0};const Ai=Zr;Si.toArrayAsync=function(t){return(0,Ai.consume)(t,(async t=>{const e=[];for await(const n of t)e.push(n);return e}))};var Ii={toArray:void 0};const Ei=Zr;Ii.toArray=function(t){return(0,Ei.consume)(t,(t=>Array.from(t)))};var Oi={toSetAsync:void 0};const Pi=Zr;Oi.toSetAsync=function(t){return(0,Pi.consume)(t,(async t=>{const e=new Set;for await(const n of t)e.add(n);return e}))};var ji={toSet:void 0};const ki=Zr;ji.toSet=function(t){return(0,ki.consume)(t,(t=>new Set(t)))};var Mi={};Mi.count=void 0,Mi.count=function(t){let e=0;for(const n of t)e++;return e};var Ni={};Ni.countAsync=void 0,Ni.countAsync=async function(t){let e=0;for await(const n of t)e++;return e};var Bi={groupBy:void 0};const Ci=ni;Bi.groupBy=function(t,e){const n=new Map;return(0,Ci.each)(t,((t,r)=>{const i=e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)})),n};var Fi={groupByAsync:void 0};const zi=ti;var qi;function Di(){return qi||(qi=1,function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Xr(),t),r(Gr,t)}(Vt)),Vt}Fi.groupByAsync=async function(t,e){const n=new Map;return await(0,zi.eachAsync)(t,(async(t,r)=>{const i=await e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)})),n},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Zr,t),r(ti,t),r(ni,t),r(ri,t),r(oi,t),r(si,t),r(ui,t),r(ci,t),r(li,t),r(hi,t),r(fi,t),r(di,t),r(yi,t),r(pi,t),r(mi,t),r(gi,t),r(wi,t),r(Ti,t),r(_i,t),r(Si,t),r(Ii,t),r(Oi,t),r(ji,t),r(Mi,t),r(Ni,t),r(Bi,t),r(Fi,t)}(Gr);var Vi={},Ui={};Ui.traverseErrorPrototypeChain=void 0,Ui.traverseErrorPrototypeChain=function*(t){let e=t;for(;(e=Object.getPrototypeOf(e))&&(yield e,e!==Error.prototype););},Vi.getErrorNames=void 0;const Ri=r,Li=Ui;Vi.getErrorNames=function*(t){var e;if((0,Ri.isError)(t))for(const n of(0,Li.traverseErrorPrototypeChain)(t))(null===(e=n.constructor)||void 0===e?void 0:e.name)&&(yield n.constructor.name);else yield t.name,yield*t.ancestors};var Ki={isSerializableError:void 0};const Ji=r;var Wi;function Yi(){if(Wi)return Dt;Wi=1,Dt.CustomError=void 0;const t=Di(),e=Vi,n=r,i=Ki;class o extends Error{get name(){var n,r;return null!==(r=null!==(n=(0,t.first)((0,e.getErrorNames)(this)))&&void 0!==n?n:o.name)&&void 0!==r?r:"CustomError"}static[Symbol.hasInstance](r){var o;if((0,n.isError)(r)||(0,i.isSerializableError)(r)){const n=[null!==(o=this.prototype.constructor.name)&&void 0!==o?o:this.name,...(0,e.getErrorNames)(this.prototype)].reverse(),i=(0,t.toArray)((0,e.getErrorNames)(r)).reverse();return n.every(((t,e)=>t===i[e]))}return!1}}return Dt.CustomError=o,Dt}Ki.isSerializableError=function(t){return(0,Ji.isObject)(t)&&(0,Ji.isString)(t.name)&&(0,Ji.isString)(t.message)&&((0,Ji.isString)(t.stack)||(0,Ji.isNull)(t.stack))&&(0,Ji.isArray)(t.ancestors)&&t.ancestors.every(Ji.isString)};var Hi,$i={};function Qi(){if(Hi)return $i;Hi=1,$i.AssertionError=void 0;const t=Yi();class e extends t.CustomError{}return $i.AssertionError=e,$i}var Xi,Gi={};var Zi={},to={},eo={};eo.pass=void 0,eo.pass=function(){};var no={};no.passAsync=void 0,no.passAsync=async function(){},function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(eo,t),r(no,t)}(to),Zi.hydrate=void 0;const ro=to;function io(t,e){const n=function(){(0,ro.pass)()};return(n.prototype=Object.create(t.prototype)).constructor=n,Object.defineProperty(n,"name",{value:e}),n}Zi.hydrate=function(t){var e;const n=[t.name,...t.ancestors].slice(0,-1).reverse();let r=Error;for(const t of n)r=io(r,t);const i=new r;return i.name=t.name,i.message=t.message,i.stack=null!==(e=t.stack)&&void 0!==e?e:void 0,i};var oo,so,ao={};function uo(){return so||(so=1,function(t){var e=n&&n.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=n&&n.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};r(Yi(),t),r(Qi(),t),r(Ki,t),r(function(){if(Xi)return Gi;Xi=1,Gi.normalize=void 0;const t=Vi,e=Di();return Gi.normalize=function(n){var r;const[i,...o]=(0,e.toArray)((0,t.getErrorNames)(n));return{name:i,ancestors:o,message:n.message,stack:null!==(r=n.stack)&&void 0!==r?r:null}},Gi}(),t),r(Zi,t),r(function(){if(oo)return ao;oo=1,ao.assert=void 0;const t=Qi();return ao.assert=function(e,n){if(!e)throw new t.AssertionError(n)},ao}(),t),r(Vi,t),r(Ui,t)}(qt)),qt}var co=uo(),lo=Di();class ho{constructor(t){this.map=new Map,co.assert(Number.isInteger(t),"The parameter limit must be an integer"),co.assert(t>0,"The parameter limit must be a positive value"),this.limit=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e){return this.map.has(t)?this.updateItem(t,e):(this.map.size===this.limit&&this.map.delete(this.getColdestKey()),this.map.set(t,e)),this}has(t){return this.map.has(t)}get(t){if(!this.has(t))return;const e=this.map.get(t);return this.updateItem(t,e),e}delete(t){return this.map.delete(t)}clear(){this.map.clear()}updateItem(t,e){this.map.delete(t),this.map.set(t,e)}getColdestKey(){return lo.first(this.map.keys())}}class fo{constructor(){this.map=new Map,this.itemMetadataSortedByExpirationTime=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e,n){return this.map.set(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n),this}has(t){return this.map.has(t)}get(t){return this.map.get(t)}delete(t){const e=this.map.delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;this.map.clear(),null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>this.map.delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=Yt.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));this.cancelClearTimeout=()=>{e(),this.cancelClearTimeout=void 0}}}}}class yo{constructor(t){this.map=new Map,this.itemMetadataSortedByExpirationTime=[],co.assert(Number.isInteger(t),"The parameter limit must be an integer"),co.assert(t>0,"The parameter limit must be a positive value"),this.limit=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e,n){return this.map.has(t)?(this.updateItem(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n)):(this.map.size===this.limit&&this.map.delete(this.getColdestKey()),this.map.set(t,e),this.addItemMetadata(t,Date.now()+n)),this}has(t){return this.map.has(t)}get(t){if(this.has(t)){const e=this.map.get(t);return this.updateItem(t,e),e}}delete(t){const e=this.map.delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;this.map.clear(),null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}updateItem(t,e){this.map.delete(t),this.map.set(t,e)}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>this.map.delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=Yt.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));this.cancelClearTimeout=()=>{e(),this.cancelClearTimeout=void 0}}}}getColdestKey(){return lo.first(this.map.keys())}}class po{constructor(t){this.value=t,this.children=new Map}}class vo{constructor(){this.root=new po}get[Symbol.toStringTag](){return this.constructor.name}*entries(){yield*function*t(e,n){for(const[i,o]of e.children){const e=[...n,i];r.isntUndefined(o.value)&&(yield[e,o.value]),yield*t(o,e)}}(this.root,[])}keys(){return lo.map(this.entries(),(([t])=>t))}values(){return lo.map(this.entries(),(([t,e])=>e))}set(t,e){let n=this.root;for(const e of t)n.children.has(e)||n.children.set(e,new po),n=n.children.get(e);return n.value=e,this}has(t){let e=this.root;for(const n of t){if(!e.children.has(n))return!1;e=e.children.get(n)}return void 0!==e.value}get(t){let e=this.root;for(const n of t){if(!e.children.has(n))return;e=e.children.get(n)}return e.value}delete(t){const e=[];let n=this.root;for(const r of t){if(!n.children.has(r))return!1;e.push(n),n=n.children.get(r)}if(delete n.value,0===n.children.size)for(const[n,r]of lo.toArray(lo.zip(t,e)).reverse())if(r.children.delete(n),0!==r.children.size)break;return!0}}class mo{constructor(t,e){this.schema=t,this._state=e}get[Symbol.toStringTag](){return this.constructor.name}get state(){return this._state}matches(t){return this._state===t}can(t){return t in this.schema[this.state]}send(t){if(!this.can(t))throw new bo(this.state,t);this._state=this.schema[this.state][t]}}class bo extends co.CustomError{constructor(t,e){super(`State ${t} cannot react to event ${e}`)}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var Ro=function(t,e){return(Ro=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function Lo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ro(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Ko(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Jo(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function Wo(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function Yo(t){return"function"==typeof t}function Ho(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var $o=Ho((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Qo(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Xo=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Ko(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(Yo(u))try{u()}catch(t){i=t instanceof $o?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var l=Ko(c),h=l.next();!h.done;h=l.next()){var f=h.value;try{ts(f)}catch(t){i=null!=i?i:[],t instanceof $o?i=Wo(Wo([],Jo(i)),Jo(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new $o(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)ts(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Qo(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&Qo(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Go=Xo.EMPTY;function Zo(t){return t instanceof Xo||t&&"closed"in t&&Yo(t.remove)&&Yo(t.add)&&Yo(t.unsubscribe)}function ts(t){Yo(t)?t():t.unsubscribe()}var es={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ns=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Wo([t,e],Jo(n)))};function rs(){}function is(t){t()}var os=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Zo(e)&&e.add(n)):n.destination=hs,n}return Lo(e,t),e.create=function(t,e,n){return new cs(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Xo),ss=Function.prototype.bind;function as(t,e){return ss.call(t,e)}var us=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){ls(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){ls(t)}else ls(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){ls(t)}},t}(),cs=function(t){function e(e,n,r){var i,o,s=t.call(this)||this;Yo(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&es.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},i={next:e.next&&as(e.next,o),error:e.error&&as(e.error,o),complete:e.complete&&as(e.complete,o)}):i=e;return s.destination=new us(i),s}return Lo(e,t),e}(os);function ls(t){var e;e=t,ns((function(){throw e}))}var hs={closed:!0,next:rs,error:function(t){throw t},complete:rs},fs="function"==typeof Symbol&&Symbol.observable||"@@observable";function ds(t){return t}function ys(t){return 0===t.length?ds:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ps=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof os||function(t){return t&&Yo(t.next)&&Yo(t.error)&&Yo(t.complete)}(r)&&Zo(r)?t:new cs(t,e,n);return is((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=vs(e))((function(e,r){var i=new cs({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[fs]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ys(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=vs(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function vs(t){var e;return null!==(e=null!=t?t:es.Promise)&&void 0!==e?e:Promise}function ms(t){return Yo(null==t?void 0:t.lift)}function bs(t,e,n,r,i){return new gs(t,e,n,r,i)}var gs=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return Lo(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(os);function ws(){return t=function(t,e){var n=null;t._refCount++;var r=bs(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())},function(e){if(ms(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")};var t}!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,ms(e)&&(r.lift=e.lift),r}Lo(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new Xo;var n=this.getSubject();e.add(this.source.subscribe(bs(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=Xo.EMPTY)}return e},e.prototype.refCount=function(){return ws()(this)}}(ps);var xs,Ts,_s={now:function(){return(_s.delegate||performance).now()},delegate:void 0},Ss={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new Xo((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ss.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,Wo([],Jo(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,Wo([],Jo(t)))},delegate:void 0};Ts=Ss.schedule,new ps((function(t){var e=new Xo,n=xs||_s,r=n.now(),i=function(o){var s=n.now();t.next({timestamp:xs?s:o,elapsed:s-r}),t.closed||e.add(Ts(i))};return e.add(Ts(i)),e}));var As=Ho((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Es=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Lo(e,t),e.prototype.lift=function(t){var e=new Is(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new As},e.prototype.next=function(t){var e=this;is((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=Ko(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;is((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;is((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?Go:(this.currentObservers=null,o.push(t),new Xo((function(){e.currentObservers=null,Qo(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new ps;return t.source=this,t},e.create=function(t,e){return new Is(t,e)},e}(ps),Is=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Lo(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:Go},e}(Es);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}Lo(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(Es);var Os={now:function(){return(Os.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Os);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}Lo(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,u=1;u<r.length&&r[u]<=s;u+=2)a=u;a&&r.splice(0,a+1)}}}(Es),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}Lo(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,s=e.isStopped,a=e._isComplete;n?t.error(o):(s||a)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(Es);var Ps,js=function(t){function e(e,n){return t.call(this)||this}return Lo(e,t),e.prototype.schedule=function(t,e){return this},e}(Xo),ks=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Wo([t,e],Jo(n)))},Ns=function(t){return clearInterval(t)},Ms=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return Lo(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),ks(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;Ns(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Qo(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(js),Bs=1,Cs={};function zs(t){return t in Cs&&(delete Cs[t],!0)}var Fs=function(t){var e=Bs++;return Cs[e]=!0,Ps||(Ps=Promise.resolve()),Ps.then((function(){return zs(e)&&t()})),e},qs=function(t){zs(t)},Ds={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ds.delegate;return((null==n?void 0:n.setImmediate)||Fs).apply(void 0,Wo([],Jo(t)))},clearImmediate:function(t){return qs(t)},delegate:void 0},Vs=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Lo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Ds.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(Ds.clearImmediate(n),e._scheduled=void 0)},e}(Ms),Us=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=Os.now,t}(),Rs=function(t){function e(e,n){void 0===n&&(n=Us.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return Lo(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(Us);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Lo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Rs))(Vs),new Rs(Ms);var Ls=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Lo(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(Ms);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Lo(e,t),e}(Rs))(Ls);var Ks=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Lo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Ss.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(Ss.cancelAnimationFrame(n),e._scheduled=void 0)},e}(Ms);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Lo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Rs))(Ks),function(t){function e(e,n){void 0===e&&(e=Ws),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}Lo(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(Rs);var Js,Ws=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return Lo(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return Xo.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(Ms);new ps((function(t){return t.complete()})),function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(Js||(Js={})),Ho((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),Ho((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),Ho((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),Ho((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}})),Ho((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}})),new ps(rs);class Ys extends Vo{constructor(){super(...arguments),this.stateChanges=new Es}get[Symbol.toStringTag](){return this.constructor.name}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const n=this.state;this.stateChanges.next({event:t,oldState:e,newState:n}),r.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}}class Hs{constructor(t=[]){this.indexToValue=[];const e=[];if(t.length>0)for(const[n,r]of t.entries())e[r]=n;this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.indexToValue[Symbol.iterator]()}values(){return this.indexToValue[Symbol.iterator]()}has(t){return t in this.valueToIndex}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){if(this.has(t)){const e=this.indexToValue.pop();if(t===e)delete this.valueToIndex[t];else{const n=this.valueToIndex[t];this.indexToValue[n]=e,this.valueToIndex[e]=n,delete this.valueToIndex[t]}return!0}return!1}}class $s{constructor(){this.keyToIndex=[],this.indexToKey=[],this.indexToValue=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalArray(){return this.indexToValue}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue[t]]}keys(){return this.indexToKey.values()}values(){return this.indexToValue.values()}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){return t in this.keyToIndex}get(t){if(this.has(t)){const e=this.keyToIndex[t];return this.indexToValue[e]}}set(t,e){if(this.has(t)){const n=this.keyToIndex[t];this.indexToValue[n]=e}else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){if(this.has(t)){const e=this.indexToKey.pop(),n=this.indexToValue.pop();if(t===e)delete this.keyToIndex[t];else{const r=this.keyToIndex[t];this.indexToKey[r]=e,this.indexToValue[r]=n,this.keyToIndex[e]=r,delete this.keyToIndex[t]}}}}class Qs{constructor(t){this.keyToIndex=[],this.indexToKey=[],qt.assert(0===t.length,"array should be empty"),this.indexToValue=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalTypedArray(){return this.indexToValue.internalTypedArray}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue.internalTypedArray[t]]}keys(){return this.indexToKey.values()}*values(){for(let t=0;t<this.indexToKey.length;t++)yield this.indexToValue.internalTypedArray[t]}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t}get(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t?this.indexToValue.internalTypedArray[e]:void 0}set(t,e){const n=this.keyToIndex[t];if(this.indexToKey[n]===t)this.indexToValue.internalTypedArray[n]=e;else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){const e=this.keyToIndex[t];if(this.indexToKey[e]===t){const n=this.indexToKey.pop(),r=this.indexToValue.pop();t!==n&&(this.indexToKey[e]=n,this.indexToValue.internalTypedArray[e]=r,this.keyToIndex[n]=e)}}}class Xs{constructor(t){const e=[];if(t.length>0)for(const[n,r]of t.internalTypedArray.entries())e[r]=n;this.indexToValue=t,this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}*values(){for(let t=0;t<this.indexToValue.length;t++)yield this.indexToValue.internalTypedArray[t]}has(t){const e=this.valueToIndex[t];return this.indexToValue.internalTypedArray[e]===t}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){const e=this.valueToIndex[t];if(this.indexToValue.internalTypedArray[e]===t){const n=this.indexToValue.pop();return t!==n&&(this.indexToValue.internalTypedArray[e]=n,this.valueToIndex[n]=e),!0}return!1}}class Gs{constructor(t,{capacity:e=0,growthFactor:n=1.5}={}){this.typedArrayConstructor=t,this._length=0,qt.assert(Number.isInteger(e),"capacity must be an integer"),qt.assert(e>=0,"capacity must be greater than or equal to 0"),qt.assert(n>=1,"growthFactory must be greater than or equal to 1"),this.array=new t(e),this.growthFactor=n}get internalTypedArray(){return this.array}get[Symbol.toStringTag](){return this.constructor.name}get capacity(){return this.array.length}get length(){return this._length}set(t,e){if(t>=this.capacity){const e=Zs(this.capacity,t+1,this.growthFactor);this.resize(e)}t>=this._length&&(this._length=t+1),this.array[t]=e}get(t){return t<this._length?this.array[t]:void 0}push(...t){const e=this._length+t.length;if(e>this.capacity){const t=Zs(this.capacity,e,this.growthFactor);this.resize(t)}for(const e of t)this.array[this._length++]=e}pop(){if(this._length>0){const t=this.array[this._length-1];this._length--;const e=Zs(this.capacity,this.length,this.growthFactor);return this.resize(e),t}}sort(t){const e=this.capacity;this.resize(this.length),this.array.sort(t),this.resize(e)}resize(t){if(this.array.length!==t)if(this.array.length<t){const e=new this.typedArrayConstructor(t);e.set(this.array),this.array=e}else if(this.array.length>t){const e=new this.typedArrayConstructor(t);for(let n=t;n--;)e[n]=this.array[n];this.array=e}}}function Zs(t,e,n){if(1===n)return e;if(t===e)return e;if(t<e){let r=Math.max(t,1);for(;r<e;)r*=n;return Math.floor(r)}if(0===e)return 0;{let r=t;for(;;){const t=r/n;if(t<e)break;r=t}return Math.floor(r)}}class ta{constructor(t){this.value=t,this.previous=null,this.next=null,this.up=null,this.down=null}}class ea{constructor(t){this.compare=t,this.head=new ta(null),this.tail=new ta(null),this.height=0,this._size=0,this.head.next=this.tail,this.tail.previous=this.head}get size(){return this._size}*elements(){let t=this.head;for(;t.down;)t=t.down;for(;t.next&&r.isntNull(t.next.value);)t=t.next,yield t}dumpList(){const t=[];let e=this.head;do{t.push([]);let n=e;do{t[t.length-1].push(n.value),n=n.next}while(n)}while(e=e.down);return t}delete(t){let e=this.findNode(t);for(;e;)e.previous.next=e.next,e.next.previous=e.previous,e=e.down;this._size--}has(t){return r.isntNull(this.findNode(t))}findNode(t){let e=this.head;for(;;){for(;e.next&&r.isntNull(e.next.value);){const n=this.compare(e.next.value,t);if(0===n)return e.next;if(!(n<0))break;e=e.next}if(!e.down)return null;e=e.down}}add(t){let e=this.findPreviousNode(t);if(e.next&&r.isntNull(e.next.value)&&0===this.compare(e.next.value,t))return;let n=new ta(t);e.next&&(n.next=e.next,e.next.previous=n),e.next=n,n.previous=e;let i=0;for(;Math.random()<.5;){if(i===this.height){const t=new ta(null),e=new ta(null);t.next=e,t.down=this.head,e.previous=t,e.down=this.tail,this.head.up=t,this.tail.up=e,this.head=t,this.tail=e,this.height++}for(;!e.up;)e=e.previous;e=e.up;const r=new ta(t);e.next&&(r.next=e.next,e.next.previous=r),e.next=r,r.previous=e,r.down=n,n.up=r,n=r,i++}this._size++}findPreviousNode(t){let e=this.head;for(;;){for(;e.next&&r.isntNull(e.next.value);){if(this.compare(e.next.value,t)>=0)break;e=e.next}if(!e.down)return e;e=e.down}}}class na{constructor(t){this.skipList=new ea(t)}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}values(){return Bo.map(this.skipList.elements(),(t=>t.value))}has(t){return this.skipList.has(t)}add(t){this.skipList.add(t)}delete(t){this.skipList.delete(t)}}class ra{constructor(t=8){this.bitsPerElement=t,this.array=[],this.length=0}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.length}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){const e=this.array[t];for(let n=0;n<this.bitsPerElement;n++){const r=this.getMask(n);(e&r)===r&&(yield t*this.bitsPerElement+n)}}const r=this.array[t-1];for(let t=0;t<e;t++){const e=this.getMask(t);(r&e)===e&&(yield n*this.bitsPerElement+t)}}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array[n])&&void 0!==e?e:0)&r)===r}add(t){var e;qt.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t);this.array[n]=(null!==(e=this.array[n])&&void 0!==e?e:0)|r}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;return this.array[n]=i&~r,(i&r)===r}clear(){for(let t=this.array.length;t--;)this.array[t]=0}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return Math.pow(2,t)}}class ia{constructor(t){this.array=t,this.bitsPerElement=8*this.array.internalTypedArray.BYTES_PER_ELEMENT,this.length=0}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.length}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){const e=this.array.internalTypedArray[t];for(let n=0;n<this.bitsPerElement;n++){const r=this.getMask(n);(e&r)===r&&(yield t*this.bitsPerElement+n)}}const r=this.array.internalTypedArray[t-1];for(let t=0;t<e;t++){const e=this.getMask(t);(r&e)===e&&(yield n*this.bitsPerElement+t)}}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array.internalTypedArray[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array.get(n))&&void 0!==e?e:0)&r)===r}add(t){var e;qt.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t);this.array.set(n,(null!==(e=this.array.get(n))&&void 0!==e?e:0)|r)}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;return this.array.set(n,i&~r),(i&r)===r}clear(){for(let t=this.array.length;t--;)this.array.set(t,0)}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return Math.pow(2,t)}}t.BadEventError=Uo,t.BitSet=ra,t.Box=e,t.DynamicTypedArray=Gs,t.Emitter=Bt,t.ExpirableMap=zo,t.FiniteStateMachine=Vo,t.HashMap=Ct,t.HashSet=zt,t.LRUMap=Co,t.ObservableFiniteStateMachine=Ys,t.Queue=Ft,t.SortedSet=na,t.SparseMap=$s,t.SparseSet=Hs,t.TLRUMap=Fo,t.TrieMap=Do,t.TypedBitSet=ia,t.TypedSparseMap=Qs,t.TypedSparseSet=Xs,t.convertArrayToCons=function t([e,...n]){return[e,n.length?t(n):null]},t.convertConsToArray=function t([e,n]){return r.isNull(n)?[e]:[e,...t(n)]},t.sliceArrayLeft=function(t,e){return t.slice(0,e)},t.sliceArrayRight=function(t,e){const n=t.length-e;return t.slice(n>=0?n:0)},t.truncateArrayLeft=function(t,e){t.length>e&&(t.length=e)},t.truncateArrayRight=function(t,e){const n=t.length-e;t.splice(0,n)},Object.defineProperty(t,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */var go=function(t,e){return(go=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function xo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}go(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function wo(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function To(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function _o(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function So(t){return"function"==typeof t}function Ao(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Io=Ao((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Eo(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Oo=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=wo(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(So(u))try{u()}catch(t){i=t instanceof Io?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var l=wo(c),h=l.next();!h.done;h=l.next()){var f=h.value;try{ko(f)}catch(t){i=null!=i?i:[],t instanceof Io?i=_o(_o([],To(i)),To(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new Io(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)ko(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Eo(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&Eo(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Po=Oo.EMPTY;function jo(t){return t instanceof Oo||t&&"closed"in t&&So(t.remove)&&So(t.add)&&So(t.unsubscribe)}function ko(t){So(t)?t():t.unsubscribe()}var Mo={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},No=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,_o([t,e],To(n)))};function Bo(){}function Co(t){t()}var Fo=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,jo(e)&&e.add(n)):n.destination=Ro,n}return xo(e,t),e.create=function(t,e,n){return new Vo(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Oo),zo=Function.prototype.bind;function qo(t,e){return zo.call(t,e)}var Do=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Uo(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Uo(t)}else Uo(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Uo(t)}},t}(),Vo=function(t){function e(e,n,r){var i,o,s=t.call(this)||this;So(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&Mo.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},i={next:e.next&&qo(e.next,o),error:e.error&&qo(e.error,o),complete:e.complete&&qo(e.complete,o)}):i=e;return s.destination=new Do(i),s}return xo(e,t),e}(Fo);function Uo(t){var e;e=t,No((function(){throw e}))}var Ro={closed:!0,next:Bo,error:function(t){throw t},complete:Bo},Lo="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ko(t){return t}function Jo(t){return 0===t.length?Ko:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Wo=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof Fo||function(t){return t&&So(t.next)&&So(t.error)&&So(t.complete)}(r)&&jo(r)?t:new Vo(t,e,n);return Co((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=Yo(e))((function(e,r){var i=new Vo({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Lo]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jo(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Yo(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function Yo(t){var e;return null!==(e=null!=t?t:Mo.Promise)&&void 0!==e?e:Promise}function Ho(t){return So(null==t?void 0:t.lift)}function $o(t,e,n,r,i){return new Qo(t,e,n,r,i)}var Qo=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return xo(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(Fo);function Xo(){return t=function(t,e){var n=null;t._refCount++;var r=$o(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())},function(e){if(Ho(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")};var t}!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Ho(e)&&(r.lift=e.lift),r}xo(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new Oo;var n=this.getSubject();e.add(this.source.subscribe($o(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=Oo.EMPTY)}return e},e.prototype.refCount=function(){return Xo()(this)}}(Wo);var Go,Zo,ts={now:function(){return(ts.delegate||performance).now()},delegate:void 0},es={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new Oo((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=es.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,_o([],To(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,_o([],To(t)))},delegate:void 0};Zo=es.schedule,new Wo((function(t){var e=new Oo,n=Go||ts,r=n.now(),i=function(o){var s=n.now();t.next({timestamp:Go?s:o,elapsed:s-r}),t.closed||e.add(Zo(i))};return e.add(Zo(i)),e}));var ns=Ao((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),rs=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return xo(e,t),e.prototype.lift=function(t){var e=new is(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new ns},e.prototype.next=function(t){var e=this;Co((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=wo(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;Co((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Co((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?Po:(this.currentObservers=null,o.push(t),new Oo((function(){e.currentObservers=null,Eo(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new Wo;return t.source=this,t},e.create=function(t,e){return new is(t,e)},e}(Wo),is=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return xo(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:Po},e}(rs);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}xo(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(rs);var os={now:function(){return(os.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=os);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}xo(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,u=1;u<r.length&&r[u]<=s;u+=2)a=u;a&&r.splice(0,a+1)}}}(rs),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}xo(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,s=e.isStopped,a=e._isComplete;n?t.error(o):(s||a)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(rs);var ss,as=function(t){function e(e,n){return t.call(this)||this}return xo(e,t),e.prototype.schedule=function(t,e){return this},e}(Oo),us=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,_o([t,e],To(n)))},cs=function(t){return clearInterval(t)},ls=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return xo(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),us(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;cs(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Eo(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(as),hs=1,fs={};function ds(t){return t in fs&&(delete fs[t],!0)}var ys=function(t){var e=hs++;return fs[e]=!0,ss||(ss=Promise.resolve()),ss.then((function(){return ds(e)&&t()})),e},ps=function(t){ds(t)},vs={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vs.delegate;return((null==n?void 0:n.setImmediate)||ys).apply(void 0,_o([],To(t)))},clearImmediate:function(t){return ps(t)},delegate:void 0},ms=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return xo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=vs.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(vs.clearImmediate(n),e._scheduled=void 0)},e}(ls),bs=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=os.now,t}(),gs=function(t){function e(e,n){void 0===n&&(n=bs.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return xo(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(bs);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(gs))(ms),new gs(ls);var xs=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return xo(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(ls);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xo(e,t),e}(gs))(xs);var ws=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return xo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=es.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(es.cancelAnimationFrame(n),e._scheduled=void 0)},e}(ls);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(gs))(ws),function(t){function e(e,n){void 0===e&&(e=_s),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}xo(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(gs);var Ts,_s=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return xo(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return Oo.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(ls);new Wo((function(t){return t.complete()})),function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(Ts||(Ts={})),Ao((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),Ao((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),Ao((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),Ao((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}})),Ao((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}})),new Wo(Bo);class Ss extends mo{constructor(){super(...arguments),this.stateChanges=new rs}get[Symbol.toStringTag](){return this.constructor.name}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const n=this.state;this.stateChanges.next({event:t,oldState:e,newState:n}),r.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}}class As{constructor(t=[]){this.indexToValue=[];const e=[];if(t.length>0)for(const[n,r]of t.entries())e[r]=n;this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.indexToValue[Symbol.iterator]()}values(){return this.indexToValue[Symbol.iterator]()}has(t){return t in this.valueToIndex}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){if(this.has(t)){const e=this.indexToValue.pop();if(t===e)delete this.valueToIndex[t];else{const n=this.valueToIndex[t];this.indexToValue[n]=e,this.valueToIndex[e]=n,delete this.valueToIndex[t]}return!0}return!1}}class Is{constructor(){this.keyToIndex=[],this.indexToKey=[],this.indexToValue=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalArray(){return this.indexToValue}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue[t]]}keys(){return this.indexToKey.values()}values(){return this.indexToValue.values()}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){return t in this.keyToIndex}get(t){if(this.has(t)){const e=this.keyToIndex[t];return this.indexToValue[e]}}set(t,e){if(this.has(t)){const n=this.keyToIndex[t];this.indexToValue[n]=e}else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){if(this.has(t)){const e=this.indexToKey.pop(),n=this.indexToValue.pop();if(t===e)delete this.keyToIndex[t];else{const r=this.keyToIndex[t];this.indexToKey[r]=e,this.indexToValue[r]=n,this.keyToIndex[e]=r,delete this.keyToIndex[t]}}}}class Es{constructor(t){this.keyToIndex=[],this.indexToKey=[],co.assert(0===t.length,"array should be empty"),this.indexToValue=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalTypedArray(){return this.indexToValue.internalTypedArray}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue.internalTypedArray[t]]}keys(){return this.indexToKey.values()}*values(){for(let t=0;t<this.indexToKey.length;t++)yield this.indexToValue.internalTypedArray[t]}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t}get(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t?this.indexToValue.internalTypedArray[e]:void 0}set(t,e){const n=this.keyToIndex[t];if(this.indexToKey[n]===t)this.indexToValue.internalTypedArray[n]=e;else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){const e=this.keyToIndex[t];if(this.indexToKey[e]===t){const n=this.indexToKey.pop(),r=this.indexToValue.pop();t!==n&&(this.indexToKey[e]=n,this.indexToValue.internalTypedArray[e]=r,this.keyToIndex[n]=e)}}}class Os{constructor(t){const e=[];if(t.length>0)for(const[n,r]of t.internalTypedArray.entries())e[r]=n;this.indexToValue=t,this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}*values(){for(let t=0;t<this.indexToValue.length;t++)yield this.indexToValue.internalTypedArray[t]}has(t){const e=this.valueToIndex[t];return this.indexToValue.internalTypedArray[e]===t}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){const e=this.valueToIndex[t];if(this.indexToValue.internalTypedArray[e]===t){const n=this.indexToValue.pop();return t!==n&&(this.indexToValue.internalTypedArray[e]=n,this.valueToIndex[n]=e),!0}return!1}}class Ps{constructor(t,{capacity:e=0,growthFactor:n=1.5}={}){this.typedArrayConstructor=t,this._length=0,co.assert(Number.isInteger(e),"capacity must be an integer"),co.assert(e>=0,"capacity must be greater than or equal to 0"),co.assert(n>=1,"growthFactory must be greater than or equal to 1"),this.array=new t(e),this.growthFactor=n}get internalTypedArray(){return this.array}get[Symbol.toStringTag](){return this.constructor.name}get capacity(){return this.array.length}get length(){return this._length}set(t,e){if(t>=this.capacity){const e=js(this.capacity,t+1,this.growthFactor);this.resize(e)}t>=this._length&&(this._length=t+1),this.array[t]=e}get(t){return t<this._length?this.array[t]:void 0}push(...t){const e=this._length+t.length;if(e>this.capacity){const t=js(this.capacity,e,this.growthFactor);this.resize(t)}for(const e of t)this.array[this._length++]=e}pop(){if(this._length>0){const t=this.array[this._length-1];this._length--;const e=js(this.capacity,this.length,this.growthFactor);return this.resize(e),t}}sort(t){const e=this.capacity;this.resize(this.length),this.array.sort(t),this.resize(e)}resize(t){if(this.array.length!==t)if(this.array.length<t){const e=new this.typedArrayConstructor(t);e.set(this.array),this.array=e}else if(this.array.length>t){const e=new this.typedArrayConstructor(t);for(let n=t;n--;)e[n]=this.array[n];this.array=e}}}function js(t,e,n){if(1===n)return e;if(t===e)return e;if(t<e){let r=Math.max(t,1);for(;r<e;)r*=n;return Math.floor(r)}if(0===e)return 0;{let r=t;for(;;){const t=r/n;if(t<e)break;r=t}return Math.floor(r)}}class ks{constructor(t){this.value=t,this.previous=null,this.next=null,this.up=null,this.down=null}}class Ms{constructor(t){this.compare=t,this.head=new ks(null),this.tail=new ks(null),this.height=0,this._size=0,this.head.next=this.tail,this.tail.previous=this.head}get size(){return this._size}*elements(){let t=this.head;for(;t.down;)t=t.down;for(;t.next&&r.isntNull(t.next.value);)t=t.next,yield t}dumpList(){const t=[];let e=this.head;do{t.push([]);let n=e;do{t[t.length-1].push(n.value),n=n.next}while(n)}while(e=e.down);return t}delete(t){let e=this.findNode(t);for(;e;)e.previous.next=e.next,e.next.previous=e.previous,e=e.down;this._size--}has(t){return r.isntNull(this.findNode(t))}findNode(t){let e=this.head;for(;;){for(;e.next&&r.isntNull(e.next.value);){const n=this.compare(e.next.value,t);if(0===n)return e.next;if(!(n<0))break;e=e.next}if(!e.down)return null;e=e.down}}add(t){let e=this.findPreviousNode(t);if(e.next&&r.isntNull(e.next.value)&&0===this.compare(e.next.value,t))return;let n=new ks(t);e.next&&(n.next=e.next,e.next.previous=n),e.next=n,n.previous=e;let i=0;for(;Math.random()<.5;){if(i===this.height){const t=new ks(null),e=new ks(null);t.next=e,t.down=this.head,e.previous=t,e.down=this.tail,this.head.up=t,this.tail.up=e,this.head=t,this.tail=e,this.height++}for(;!e.up;)e=e.previous;e=e.up;const r=new ks(t);e.next&&(r.next=e.next,e.next.previous=r),e.next=r,r.previous=e,r.down=n,n.up=r,n=r,i++}this._size++}findPreviousNode(t){let e=this.head;for(;;){for(;e.next&&r.isntNull(e.next.value);){if(this.compare(e.next.value,t)>=0)break;e=e.next}if(!e.down)return e;e=e.down}}}class Ns{constructor(t){this.skipList=new Ms(t)}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}values(){return lo.map(this.skipList.elements(),(t=>t.value))}has(t){return this.skipList.has(t)}add(t){this.skipList.add(t)}delete(t){this.skipList.delete(t)}}class Bs{constructor(t=8){this.bitsPerElement=t,this.array=[],this.length=0}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.length}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){const e=this.array[t];for(let n=0;n<this.bitsPerElement;n++){const r=this.getMask(n);(e&r)===r&&(yield t*this.bitsPerElement+n)}}const r=this.array[t-1];for(let t=0;t<e;t++){const e=this.getMask(t);(r&e)===e&&(yield n*this.bitsPerElement+t)}}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array[n])&&void 0!==e?e:0)&r)===r}add(t){var e;co.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t);this.array[n]=(null!==(e=this.array[n])&&void 0!==e?e:0)|r}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;return this.array[n]=i&~r,(i&r)===r}clear(){for(let t=this.array.length;t--;)this.array[t]=0}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}class Cs{constructor(t){this.array=t,this.bitsPerElement=8*this.array.internalTypedArray.BYTES_PER_ELEMENT,this.length=0}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.length}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){const e=this.array.internalTypedArray[t];for(let n=0;n<this.bitsPerElement;n++){const r=this.getMask(n);(e&r)===r&&(yield t*this.bitsPerElement+n)}}const r=this.array.internalTypedArray[t-1];for(let t=0;t<e;t++){const e=this.getMask(t);(r&e)===e&&(yield n*this.bitsPerElement+t)}}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array.internalTypedArray[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array.get(n))&&void 0!==e?e:0)&r)===r}add(t){var e;co.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t);this.array.set(n,(null!==(e=this.array.get(n))&&void 0!==e?e:0)|r)}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;return this.array.set(n,i&~r),(i&r)===r}clear(){for(let t=this.array.length;t--;)this.array.set(t,0)}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}t.BadEventError=bo,t.BitSet=Bs,t.Box=e,t.DynamicTypedArray=Ps,t.Emitter=Bt,t.ExpirableMap=fo,t.FiniteStateMachine=mo,t.HashMap=Ct,t.HashSet=Ft,t.LRUMap=ho,t.ObservableFiniteStateMachine=Ss,t.Queue=zt,t.SortedSet=Ns,t.SparseMap=Is,t.SparseSet=As,t.TLRUMap=yo,t.TrieMap=vo,t.TypedBitSet=Cs,t.TypedSparseMap=Es,t.TypedSparseSet=Os,t.convertArrayToCons=function t([e,...n]){return[e,n.length?t(n):null]},t.convertConsToArray=function t([e,n]){return r.isNull(n)?[e]:[e,...t(n)]},t.sliceArrayLeft=function(t,e){return t.slice(0,e)},t.sliceArrayRight=function(t,e){const n=t.length-e;return t.slice(n>=0?n:0)},t.truncateArrayLeft=function(t,e){t.length>e&&(t.length=e)},t.truncateArrayRight=function(t,e){const n=t.length-e;t.splice(0,n)},Object.defineProperty(t,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=index.umd.min.js.map