@blackglory/structures 0.2.7 → 0.3.2

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.
Files changed (37) hide show
  1. package/README.md +41 -0
  2. package/dist/es2015/index.min.mjs +1 -1
  3. package/dist/es2015/index.min.mjs.map +1 -1
  4. package/dist/es2015/index.mjs +1532 -310
  5. package/dist/es2015/index.mjs.map +1 -1
  6. package/dist/es2015/index.umd.js +1534 -309
  7. package/dist/es2015/index.umd.js.map +1 -1
  8. package/dist/es2015/index.umd.min.js +1 -1
  9. package/dist/es2015/index.umd.min.js.map +1 -1
  10. package/dist/es2018/index.min.mjs +1 -1
  11. package/dist/es2018/index.min.mjs.map +1 -1
  12. package/dist/es2018/index.mjs +1532 -310
  13. package/dist/es2018/index.mjs.map +1 -1
  14. package/dist/es2018/index.umd.js +1534 -309
  15. package/dist/es2018/index.umd.js.map +1 -1
  16. package/dist/es2018/index.umd.min.js +1 -1
  17. package/dist/es2018/index.umd.min.js.map +1 -1
  18. package/lib/es2015/finite-state-machine.d.ts +13 -0
  19. package/lib/es2015/finite-state-machine.js +46 -0
  20. package/lib/es2015/finite-state-machine.js.map +1 -0
  21. package/lib/es2015/index.d.ts +2 -0
  22. package/lib/es2015/index.js +2 -0
  23. package/lib/es2015/index.js.map +1 -1
  24. package/lib/es2015/observable-finite-state-machine.d.ts +13 -0
  25. package/lib/es2015/observable-finite-state-machine.js +28 -0
  26. package/lib/es2015/observable-finite-state-machine.js.map +1 -0
  27. package/lib/es2018/finite-state-machine.d.ts +13 -0
  28. package/lib/es2018/finite-state-machine.js +46 -0
  29. package/lib/es2018/finite-state-machine.js.map +1 -0
  30. package/lib/es2018/index.d.ts +2 -0
  31. package/lib/es2018/index.js +2 -0
  32. package/lib/es2018/index.js.map +1 -1
  33. package/lib/es2018/observable-finite-state-machine.d.ts +13 -0
  34. package/lib/es2018/observable-finite-state-machine.js +28 -0
  35. package/lib/es2018/observable-finite-state-machine.js.map +1 -0
  36. package/package.json +20 -17
  37. package/CHANGELOG.md +0 -148
@@ -12,5 +12,5 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */
15
- function t(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function e(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}var n,r,i,o,a;class s{constructor(t){n.set(this,void 0),e(this,n,t,"f")}set(t){e(this,n,t,"f")}get(){return t(this,n,"f")}}function c([t,e]){return null===e?[t]:[t,...c(e)]}function u([t,...e]){return[t,e.length?u(e):null]}n=new WeakMap;class f{constructor(){r.set(this,new Map)}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}on(e,n){t(this,r,"f").has(e)||t(this,r,"f").set(e,new Set);t(this,r,"f").get(e).add(n)}off(e,n){if(!t(this,r,"f").has(e))return;const i=t(this,r,"f").get(e);i.delete(n),0===i.size&&t(this,r,"f").delete(e)}emit(e,n){if(!t(this,r,"f").has(e))return;t(this,r,"f").get(e).forEach((t=>t(n)))}}class l{constructor(t){this.hash=t,i.set(this,new Map)}get[(i=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,i,"f").size}set(e,n){return t(this,i,"f").set(this.hash(e),n),this}has(e){return t(this,i,"f").has(this.hash(e))}get(e){return t(this,i,"f").get(this.hash(e))}delete(e){return t(this,i,"f").delete(this.hash(e))}clear(){t(this,i,"f").clear()}}class d{constructor(t){this.hash=t,o.set(this,new Map)}get[(o=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,o,"f").size}[Symbol.iterator](){return t(this,o,"f").values()}add(e){return t(this,o,"f").set(this.hash(e),e),this}delete(e){return t(this,o,"f").delete(this.hash(e))}has(e){return t(this,o,"f").has(this.hash(e))}clear(){t(this,o,"f").clear()}values(){return t(this,o,"f").values()}}class y{constructor(){a.set(this,[])}get[(a=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,a,"f").length}empty(){t(this,a,"f").length=0}enqueue(...e){t(this,a,"f").push(...e)}dequeue(){return t(this,a,"f").shift()}remove(e){let n;for(;(n=t(this,a,"f").indexOf(e))>=0;)t(this,a,"f").splice(n,1)}}var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},m={},v={CustomError:void 0};class p extends Error{get name(){return this.constructor.name}}v.CustomError=p;var g={ExpectedError:void 0};const b=v;class w extends b.CustomError{}g.ExpectedError=w;var T={AssertionError:void 0};const A=v;class S extends A.CustomError{}T.AssertionError=S;var I={};I.normalize=void 0,I.normalize=function(t){var e;return{name:t.name,message:t.message,stack:null!==(e=t.stack)&&void 0!==e?e:null}};var x={refute:void 0};const E=g;x.refute=function(t,e){if(t)throw new E.ExpectedError(e)};var M={assert:void 0};const B=T;var k,O,j;M.assert=function(t,e){if(!t)throw new B.AssertionError(e)},k=m,O=h&&h.__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]}),(j=h&&h.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||O(e,t,n)})(v,k),j(g,k),j(T,k),j(I,k),j(x,k),j(M,k);var N={},R={},_={},q={},C={};C.go=void 0,C.go=function(t){return t()},function(t){var e=h&&h.__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]});(h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)})(C,t)}(q),_.chunkAsync=void 0;const z=q,D=m;_.chunkAsync=function(t,e){return(0,D.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,D.assert)(e>0,"The parameter size must be greater than 0"),(0,z.go)((async function*(){let n=[];for await(const r of t)n.push(r),n.length>=e&&(yield n,n=[]);n.length&&(yield n)}))};var U={},J={},P={};function W(t){return Array.isArray(t)}P.isntEmptyArray=P.isEmptyArray=P.isntArray=P.isArray=void 0,P.isArray=W,P.isntArray=function(t){return!W(t)},P.isEmptyArray=function(t){return 0===t.length},P.isntEmptyArray=function(t){return 0!==t.length};var F={},L={};function K(t){return null===t}L.isntNull=L.isNull=void 0,L.isNull=K,L.isntNull=function(t){return!K(t)};var V={};function G(t){return void 0===t}V.isntUndefined=V.isUndefined=void 0,V.isUndefined=G,V.isntUndefined=function(t){return!G(t)},F.isntAsyncIterable=F.isAsyncIterable=void 0;const H=L,Q=V;function X(t){return(0,H.isntNull)(t)&&(0,Q.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}F.isAsyncIterable=X,F.isntAsyncIterable=function(t){return!X(t)};var Y={};function Z(t){return"bigint"==typeof t}Y.isntBigInt=Y.isBigInt=void 0,Y.isBigInt=Z,Y.isntBigInt=function(t){return!Z(t)};var $={};function tt(t){return"boolean"==typeof t}$.isntBoolean=$.isBoolean=void 0,$.isBoolean=tt,$.isntBoolean=function(t){return!tt(t)};var et={},nt={};function rt(t){return"string"==typeof t}nt.isntString=nt.isString=void 0,nt.isString=rt,nt.isntString=function(t){return!rt(t)},et.isntChar=et.isChar=void 0;const it=nt;function ot(t){return(0,it.isString)(t)&&1===t.length}et.isChar=ot,et.isntChar=function(t){return!ot(t)};var at={};function st(t){return t instanceof Date}at.isntDate=at.isDate=void 0,at.isDate=st,at.isntDate=function(t){return!st(t)};var ct={};ct.inEnum=void 0,ct.inEnum=function(t,e){return Object.values(e).includes(t)};var ut={};function ft(t){return t instanceof Error}ut.isntError=ut.isError=void 0,ut.isError=ft,ut.isntError=function(t){return!ft(t)};var lt={};function dt(t){return!t}lt.isntFalsy=lt.isFalsy=void 0,lt.isFalsy=dt,lt.isntFalsy=function(t){return!dt(t)};var yt={};function ht(t){return"function"==typeof t}yt.isntFunction=yt.isFunction=void 0,yt.isFunction=ht,yt.isntFunction=function(t){return!ht(t)};var mt={};mt.isntIterable=mt.isIterable=void 0;const vt=L,pt=V;function gt(t){return(0,vt.isntNull)(t)&&(0,pt.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}mt.isIterable=gt,mt.isntIterable=function(t){return!gt(t)};var bt={},wt={};function Tt(t){return null!==t&&"object"==typeof t}wt.isntEmptyObject=wt.isEmptyObject=wt.isRecord=wt.isntObject=wt.isObject=void 0,wt.isObject=Tt,wt.isntObject=function(t){return!Tt(t)},wt.isRecord=function(t){return Tt(t)},wt.isEmptyObject=function(t){return 0===Object.keys(t).length},wt.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var At={};function St(t){return"number"==typeof t}At.isntNumber=At.isNumber=void 0,At.isNumber=St,At.isntNumber=function(t){return!St(t)},bt.isntJsonRpcError=bt.isJsonRpcError=bt.isntJsonRpcSuccess=bt.isJsonRpcSuccess=bt.isntJsonRpcRequest=bt.isJsonRpcRequest=bt.isntJsonRpcNotification=bt.isJsonRpcNotification=void 0;const It=P,xt=wt,Et=nt,Mt=At,Bt=V;function kt(t){return(0,Et.isString)(t)||(0,Mt.isNumber)(t)}function Ot(t){return(0,It.isArray)(t)||(0,xt.isObject)(t)}function jt(t){return(0,xt.isRecord)(t)&&(0,Et.isString)(t.jsonrpc)&&(0,Et.isString)(t.method)&&(0,Bt.isUndefined)(t.id)&&Ot(t.params)}function Nt(t){return(0,xt.isRecord)(t)&&(0,Et.isString)(t.jsonrpc)&&(0,Et.isString)(t.method)&&kt(t.id)&&Ot(t.params)}function Rt(t){return(0,xt.isRecord)(t)&&(0,Et.isString)(t.jsonrpc)&&(0,Et.isString)(t.id)&&(0,Bt.isntUndefined)(t.result)}function _t(t){return(0,xt.isRecord)(t)&&(0,Et.isString)(t.jsonrpc)&&kt(t.id)&&function(t){return(0,xt.isRecord)(t)&&(0,Mt.isNumber)(t.code)&&(0,Et.isString)(t.message)&&((0,Bt.isUndefined)(t.data)||(0,xt.isObject)(t.data))}(t.error)}bt.isJsonRpcNotification=jt,bt.isntJsonRpcNotification=function(t){return!jt(t)},bt.isJsonRpcRequest=Nt,bt.isntJsonRpcRequest=function(t){return!Nt(t)},bt.isJsonRpcSuccess=Rt,bt.isntJsonRpcSuccess=function(t){return!Rt(t)},bt.isJsonRpcError=_t,bt.isntJsonRpcError=function(t){return!_t(t)};var qt={};qt.isntJson=qt.isJson=void 0,qt.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},qt.isntJson=function t(e){return!t()};var Ct={};Ct.isAbsoluteURL=void 0,Ct.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=h&&h.__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]}),n=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(P,t),n(F,t),n(Y,t),n($,t),n(et,t),n(at,t),n(ct,t),n(ut,t),n(lt,t),n(yt,t),n(mt,t),n(bt,t),n(qt,t),n(L,t),n(At,t),n(wt,t),n(nt,t),n(V,t),n(Ct,t)}(J),U.chunkByAsync=void 0;const zt=J;U.chunkByAsync=function(t,e){return(0,zt.isAsyncIterable)(t)?async function*(t){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):async function*(t){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)};var Dt={};Dt.chunkBy=void 0,Dt.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 Ut={chunk:void 0};const Jt=q,Pt=m;Ut.chunk=function(t,e){return(0,Pt.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,Pt.assert)(e>0,"The parameter size must be greater than 0"),(0,Jt.go)((function*(){let n=[];for(const r of t)n.push(r),n.length>=e&&(yield n,n=[]);n.length&&(yield n)}))};var Wt={concatAsync:void 0};const Ft=J,Lt=q;Wt.concatAsync=function(t,...e){return(0,Lt.go)((async function*(){for(const n of[t,...e])if((0,Ft.isAsyncIterable)(n))for await(const t of n)yield t;else for(const t of n)yield t}))};var Kt={concat:void 0};const Vt=q;Kt.concat=function(t,...e){return(0,Vt.go)((function*(){for(const n of[t,...e])yield*n}))};var Gt={},Ht={};Ht.copyIterable=Ht.copyAsyncIterable=void 0,Ht.copyAsyncIterable=async function*(t){for await(const e of t)yield e},Ht.copyIterable=function*(t){for(const e of t)yield e},Gt.dropAsync=void 0;const Qt=q,Xt=Ht,Yt=m;Gt.dropAsync=function(t,e){return(0,Yt.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,Yt.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,Xt.copyAsyncIterable)(t):(0,Qt.go)((async function*(){var n;const r=t[Symbol.asyncIterator]();let i;try{let t;for(;!(({value:t,done:i}=await r.next()),i||e<=0);)e--;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))}}))};var Zt={dropRightAsync:void 0};const $t=q,te=Ht,ee=m;Zt.dropRightAsync=function(t,e){return(0,ee.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,ee.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,te.copyAsyncIterable)(t):(0,$t.go)((async function*(){const n=(await async function(t){const e=[];for await(const n of t)e.push(n);return e}(t)).slice(0,-e);for(const t of n)yield t}))};var ne={dropRight:void 0};const re=q,ie=Ht,oe=m;ne.dropRight=function(t,e){return(0,oe.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,oe.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,ie.copyIterable)(t):(0,re.go)((function*(){const n=Array.from(t);yield*n.slice(0,-e)}))};var ae={dropUntilAsync:void 0};const se=J;ae.dropUntilAsync=function(t,e){return(0,se.isAsyncIterable)(t)?async function*(t){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):async function*(t){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)};var ce={};ce.dropUntil=void 0,ce.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 ue={drop:void 0};const fe=q,le=Ht,de=m;ue.drop=function(t,e){return(0,de.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,de.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,le.copyIterable)(t):(0,fe.go)((function*(){var n;const r=t[Symbol.iterator]();let i;try{let t;for(;!(({value:t,done:i}=r.next()),i||e<=0);)e--;for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}))};var ye={filterAsync:void 0};const he=J;ye.filterAsync=function(t,e){return(0,he.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)await e(r,n)&&(yield r),n++}(t):async function*(t){let n=0;for(const r of t)await e(r,n)&&(yield r),n++}(t)};var me={};me.filter=void 0,me.filter=function*(t,e){let n=0;for(const r of t)e(r,n)&&(yield r),n++};var ve={},pe={},ge={flattenByAsync:void 0};const be=J;function we(t){return(0,be.isIterable)(t)&&(0,be.isntChar)(t)}ge.flattenByAsync=function(t,e){return(0,be.isAsyncIterable)(t)?async function*(t){const r=1;for await(const i of t)we(i)&&await e(i,r)?yield*n(i,r+1):yield i}(t):function(t){return n(t,1)}(t);async function*n(t,r){for(const i of t)we(i)&&await e(i,r)?yield*n(i,r+1):yield i}},pe.flattenDeepAsync=void 0;const Te=ge,Ae=m;pe.flattenDeepAsync=function(t,e=1/0){return(0,Ae.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,Ae.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,Te.flattenByAsync)(t,((t,n)=>n<=e))},ve.flattenAsync=void 0;const Se=pe;ve.flattenAsync=function(t){return(0,Se.flattenDeepAsync)(t,1)};var Ie={flattenBy:void 0};const xe=J;Ie.flattenBy=function(t,e){return function*t(n,r){for(const o of n)(0,xe.isIterable)(i=o)&&(0,xe.isntChar)(i)&&e(o,r)?yield*t(o,r+1):yield o;var i}(t,1)};var Ee={flattenDeep:void 0};const Me=Ie,Be=m;Ee.flattenDeep=function(t,e=1/0){return(0,Be.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,Be.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,Me.flattenBy)(t,((t,n)=>n<=e))};var ke={flatten:void 0};const Oe=Ee;ke.flatten=function(t){return(0,Oe.flattenDeep)(t,1)};var je={mapAsync:void 0};const Ne=J;je.mapAsync=function(t,e){return(0,Ne.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)yield await e(r,n),n++}(t):async function*(t){let n=0;for(const r of t)yield await e(r,n),n++}(t)};var Re={};Re.map=void 0,Re.map=function*(t,e){let n=0;for(const r of t)yield e(r,n),n++};var _e={repeatAsync:void 0};const qe=q,Ce=m;_e.repeatAsync=function(t,e){return(0,Ce.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,Ce.assert)(e>=0,"The parameter times must be greater than or equal to 0"),e===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,qe.go)((async function*(){const n=[];if(e>0){for await(const e of t)yield e,n.push(e);e--}for(;e>0;)yield*n,e--}))};var ze={repeat:void 0};const De=q,Ue=m;ze.repeat=function(t,e){return(0,Ue.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,Ue.assert)(e>=0,"The parameter times must be greater than or equal to 0"),e===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,De.go)((function*(){const n=[];if(e>0){for(const e of t)yield e,n.push(e);e--}for(;e>0;)yield*n,e--}))};var Je={sliceAsync:void 0};const Pe=q,We=m;Je.sliceAsync=function(t,e,n=1/0){return(0,We.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,We.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,We.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,We.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,Pe.go)((async function*(){let r=0;for await(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var Fe={slice:void 0};const Le=q,Ke=m;Fe.slice=function(t,e,n=1/0){return(0,Ke.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,Ke.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,Ke.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,Ke.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,Le.go)((function*(){let r=0;for(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var Ve={};Ve.splitAsync=void 0,Ve.splitAsync=async function*(t,e){let n=[];for await(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Ge={splitByAsync:void 0};const He=J;Ge.splitByAsync=function(t,e){return(0,He.isAsyncIterable)(t)?async function*(t){let n=[],r=0;for await(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t):async function*(t){let n=[],r=0;for(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t)};var Qe={};Qe.splitBy=void 0,Qe.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 Xe={};Xe.split=void 0,Xe.split=function*(t,e){let n=[];for(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Ye={takeAsync:void 0};const Ze=q,$e=m;Ye.takeAsync=function(t,e){return(0,$e.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,$e.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,Ze.go)((async function*(){if(0!==e)for await(const n of t)if(yield n,0===--e)break}))};var tn={takeRightAsync:void 0};const en=q,nn=m;tn.takeRightAsync=function(t,e){return(0,nn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,nn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,en.go)((async function*(){var n;const r=t[Symbol.asyncIterator]();let i;try{const t=[];let o;for(;({value:o,done:i}=await r.next()),!i;)t.push(o),t.length>e&&t.shift();yield*t}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}))};var rn={takeRight:void 0};const on=q,an=m;rn.takeRight=function(t,e){return(0,an.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,an.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,on.go)((function*(){var n;const r=t[Symbol.iterator]();let i;try{const t=[];let o;for(;({value:o,done:i}=r.next()),!i;)t.push(o),t.length>e&&t.shift();yield*t}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}))};var sn={takeUntilAsync:void 0};const cn=J;sn.takeUntilAsync=function(t,e){return(0,cn.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t){if(await e(r,n))break;yield r,n++}}(t):async function*(t){let n=0;for(const r of t){if(await e(r,n))break;yield r,n++}}(t)};var un={};un.takeUntil=void 0,un.takeUntil=function*(t,e){let n=0;for(const r of t){if(e(r,n))break;yield r,n++}};var fn={take:void 0};const ln=q,dn=m;fn.take=function(t,e){return(0,dn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,dn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,ln.go)((function*(){if(0!==e)for(const n of t)if(yield n,0===--e)break}))};var yn={tapAsync:void 0};const hn=J;yn.tapAsync=function(t,e){return(0,hn.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)await e(r,n),yield r,n++}(t):async function*(t){let n=0;for(const r of t)await e(r,n),yield r,n++}(t)};var mn={};mn.tap=void 0,mn.tap=function*(t,e){let n=0;for(const r of t)e(r,n),yield r,n++};var vn={};vn.toAsyncIterable=void 0,vn.toAsyncIterable=async function*(t){for(const e of t)yield e};var pn={};pn.transformAsync=void 0,pn.transformAsync=async function*(t,e){yield*e(t)};var gn={};gn.transform=void 0,gn.transform=function*(t,e){yield*e(t)};var bn={};bn.uniqAsync=void 0,bn.uniqAsync=async function*(t){const e=new Set;for await(const n of t)e.has(n)||(yield n,e.add(n))};var wn={uniqByAsync:void 0};const Tn=J;wn.uniqByAsync=function(t,e){return(0,Tn.isAsyncIterable)(t)?async function*(t){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):async function*(t){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)};var An={};An.uniqBy=void 0,An.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 Sn={};Sn.uniq=void 0,Sn.uniq=function*(t){const e=new Set;for(const n of t)e.has(n)||(yield n,e.add(n))};var In={zipAsync:void 0};const xn=J;var En;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(En||(En={})),In.zipAsync=function(t,...e){return async function*(...t){var e,n,r,i;const o=t.length,a=t.map((t=>(0,xn.isAsyncIterable)(t)?[En.Async,t[Symbol.asyncIterator]()]:[En.Sync,t[Symbol.iterator]()])),s=a.map((()=>!1));try{for(;;){const t=new Array(o);for(let e=0;e<o;e++){const[n,r]=a[e];let i;if(i=n===En.Async?await r.next():r.next(),i.done)return void(s[e]=!0);t[e]=i.value}yield t}}finally{const t=a.filter(((t,e)=>!s[e]));for(const[o,a]of t)o===En.Async?await(null===(n=(e=a).return)||void 0===n?void 0:n.call(e)):null===(i=(r=a).return)||void 0===i||i.call(r)}}(t,...e)};var Mn={};Mn.zip=void 0,Mn.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)},function(t){var e=h&&h.__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]}),n=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(_,t),n(U,t),n(Dt,t),n(Ut,t),n(Wt,t),n(Kt,t),n(Gt,t),n(Zt,t),n(ne,t),n(ae,t),n(ce,t),n(ue,t),n(ye,t),n(me,t),n(ve,t),n(ge,t),n(Ie,t),n(pe,t),n(Ee,t),n(ke,t),n(je,t),n(Re,t),n(_e,t),n(ze,t),n(Je,t),n(Fe,t),n(Ve,t),n(Ge,t),n(Qe,t),n(Xe,t),n(Ye,t),n(tn,t),n(rn,t),n(sn,t),n(un,t),n(fn,t),n(yn,t),n(mn,t),n(vn,t),n(pn,t),n(gn,t),n(bn,t),n(wn,t),n(An,t),n(Sn,t),n(In,t),n(Mn,t)}(R);var Bn={},kn={};kn.consume=void 0,kn.consume=function(t,e){return e(t)};var On={eachAsync:void 0};const jn=J;On.eachAsync=function(t,e){return(0,jn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t)await e(r,n),n++}(t):async function(t){let n=0;for(const r of t)await e(r,n),n++}(t)};var Nn={};Nn.each=void 0,Nn.each=function(t,e){let n=0;for(const r of t)e(r,n),n++};var Rn={everyAsync:void 0};const _n=J;Rn.everyAsync=function(t,e){return(0,_n.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(!await e(r,n))return!1;n++}return!0}(t):async function(t){let n=0;for(const r of t){if(!await e(r,n))return!1;n++}return!0}(t)};var qn={};qn.every=void 0,qn.every=function(t,e){let n=0;for(const r of t){if(!e(r,n))return!1;n++}return!0};var Cn={findAsync:void 0};const zn=J;Cn.findAsync=function(t,e){return(0,zn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(await e(r,n))return r;n++}return}(t):async function(t){let n=0;for(const r of t){if(await e(r,n))return r;n++}return}(t)};var Dn={};Dn.find=void 0,Dn.find=function(t,e){let n=0;for(const r of t){if(e(r,n))return r;n++}};var Un={};Un.firstAsync=void 0,Un.firstAsync=async function(t){for await(const e of t)return e};var Jn={};Jn.first=void 0,Jn.first=function(t){for(const e of t)return e};var Pn={};Pn.includesAsync=void 0,Pn.includesAsync=async function(t,e){for await(const n of t)if(n===e)return!0;return!1};var Wn={};Wn.includes=void 0,Wn.includes=function(t,e){for(const n of t)if(n===e)return!0;return!1};var Fn={};Fn.matchAsync=void 0,Fn.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 Ln={};Ln.match=void 0,Ln.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 Kn={reduceAsync:void 0};const Vn=J;Kn.reduceAsync=function(t,e,n){return(0,Vn.isUndefined)(n)?function(t,e){return(0,Vn.isAsyncIterable)(t)?n(t):r(t);async function n(t){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,a=await o(r),s=1;for(;({value:t,done:i}=await r.next()),!i;)a=await e(a,t,s++);return a}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,a=o(r),s=1;for(;({value:t,done:i}=r.next()),!i;)a=await e(a,t,s++);return a}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,Vn.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 Gn={reduce:void 0};const Hn=J;Gn.reduce=function(t,e,n){return(0,Hn.isUndefined)(n)?function(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,a=o(r),s=1;for(;({value:t,done:i}=r.next()),!i;)a=e(a,t,s++);return a}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 Qn={someAsync:void 0};const Xn=J;Qn.someAsync=function(t,e){return(0,Xn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(await e(r,n))return!0;n++}return!1}(t):async function(t){let n=0;for(const r of t){if(await e(r,n))return!0;n++}return!1}(t)};var Yn={};Yn.some=void 0,Yn.some=function(t,e){let n=0;for(const r of t){if(e(r,n))return!0;n++}return!1};var Zn={};Zn.lastAsync=void 0,Zn.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 $n={};$n.last=void 0,$n.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 tr={toArrayAsync:void 0};const er=kn;tr.toArrayAsync=function(t){return(0,er.consume)(t,(async t=>{const e=[];for await(const n of t)e.push(n);return e}))};var nr={toArray:void 0};const rr=kn;nr.toArray=function(t){return(0,rr.consume)(t,(t=>Array.from(t)))};var ir={toSetAsync:void 0};const or=kn;ir.toSetAsync=function(t){return(0,or.consume)(t,(async t=>{const e=new Set;for await(const n of t)e.add(n);return e}))};var ar={toSet:void 0};const sr=kn;var cr,ur;ar.toSet=function(t){return(0,sr.consume)(t,(t=>new Set(t)))},function(t){var e=h&&h.__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]}),n=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(kn,t),n(On,t),n(Nn,t),n(Rn,t),n(qn,t),n(Cn,t),n(Dn,t),n(Un,t),n(Jn,t),n(Pn,t),n(Wn,t),n(Fn,t),n(Ln,t),n(Kn,t),n(Gn,t),n(Qn,t),n(Yn,t),n(Zn,t),n($n,t),n(tr,t),n(nr,t),n(ir,t),n(ar,t)}(Bn),function(t){var e=h&&h.__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]}),n=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(R,t),n(Bn,t)}(N);class fr{constructor(t){cr.set(this,void 0),ur.set(this,new Map),m.assert(Number.isInteger(t),"The parameter limit must be an integer"),m.assert(t>0,"The parameter limit must be a positive value"),e(this,cr,t,"f")}get[(cr=new WeakMap,ur=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,ur,"f").size}set(e,n){return t(this,ur,"f").has(e)?this.updateItem(e,n):(t(this,ur,"f").size===t(this,cr,"f")&&t(this,ur,"f").delete(this.getColdestKey()),t(this,ur,"f").set(e,n)),this}has(e){return t(this,ur,"f").has(e)}get(e){if(!this.has(e))return;const n=t(this,ur,"f").get(e);return this.updateItem(e,n),n}delete(e){return t(this,ur,"f").delete(e)}clear(){t(this,ur,"f").clear()}updateItem(e,n){t(this,ur,"f").delete(e),t(this,ur,"f").set(e,n)}getColdestKey(){return N.first(t(this,ur,"f").keys())}}var lr={},dr={},yr={},hr={};hr.random=void 0,hr.random=function(t,e){return Math.random()*(e-t)+t};var mr={};mr.randomInt=void 0,mr.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t};var vr={};vr.randomIntInclusive=void 0,vr.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=h&&h.__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]}),n=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(hr,t),n(mr,t),n(vr,t)}(yr),dr.calculateExponentialBackoffTimeout=void 0;const pr=yr;dr.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,pr.randomIntInclusive)(0,o):o};var gr={};gr.setTimeout=void 0,gr.setTimeout=function(t,e){const n=globalThis.setTimeout(e,t);return()=>clearTimeout(n)};var br={setSchedule:void 0};const wr=gr;br.setSchedule=function(t,e){const n=t-Date.now();return(0,wr.setTimeout)(n,e)};var Tr={};Tr.setInterval=void 0,Tr.setInterval=function(t,e){const n=globalThis.setInterval(e,t);return()=>clearInterval(n)};var Ar={setImmediate:void 0};const Sr=gr;Ar.setImmediate=function(t){if(globalThis.setImmediate){const e=globalThis.setImmediate(t);return()=>clearImmediate(e)}return(0,Sr.setTimeout)(0,t)};var Ir={setTimeoutLoop:void 0};const xr=gr;Ir.setTimeoutLoop=function(t,e){let n=!1,r=(0,xr.setTimeout)(t,(async function i(){await e(),n||(r=(0,xr.setTimeout)(t,i))}));return()=>{n=!0,r()}};var Er={setDynamicTimeoutLoop:void 0};const Mr=gr;var Br,kr,Or,jr,Nr,Rr;Er.setDynamicTimeoutLoop=function(t,e){let n=!1,r=(0,Mr.setTimeout)(t,(async function i(){const o=Date.now();await e();const a=Date.now()-o;n||(r=(0,Mr.setTimeout)(Math.max(t-a,0),i))}));return()=>{n=!0,r()}},function(t){var e=h&&h.__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]}),n=h&&h.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(dr,t),n(gr,t),n(br,t),n(Tr,t),n(Ar,t),n(Ir,t),n(Er,t)}(lr);class _r{constructor(){Br.set(this,new Map),kr.set(this,void 0),this.itemMetadataSortedByExpirationTime=[]}get[(Br=new WeakMap,kr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,Br,"f").size}set(e,n,r){return t(this,Br,"f").set(e,n),this.removeItemMetadata(e),this.addItemMetadata(e,Date.now()+r),this}has(e){return t(this,Br,"f").has(e)}get(e){return t(this,Br,"f").get(e)}delete(e){const n=t(this,Br,"f").delete(e);if(n){const t=this.itemMetadataSortedByExpirationTime.findIndex((t=>t.key===e));this.itemMetadataSortedByExpirationTime.splice(t,1),0===t&&this.rescheduleClearTimeout()}return n}clear(){var e;t(this,Br,"f").clear(),null===(e=t(this,kr,"f"))||void 0===e||e.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(e){const n=this.itemMetadataSortedByExpirationTime.findIndex((t=>t.expirationTime>e));(n>=0?this.itemMetadataSortedByExpirationTime.splice(0,n):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((e=>t(this,Br,"f").delete(e.key)))}rescheduleClearTimeout(){var n;if(null===(n=t(this,kr,"f"))||void 0===n||n.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const n=lr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));e(this,kr,(()=>{n(),e(this,kr,void 0,"f")}),"f")}}}}class qr{constructor(t){Or.set(this,void 0),jr.set(this,new Map),Nr.set(this,void 0),this.itemMetadataSortedByExpirationTime=[],m.assert(Number.isInteger(t),"The parameter limit must be an integer"),m.assert(t>0,"The parameter limit must be a positive value"),e(this,Or,t,"f")}get[(Or=new WeakMap,jr=new WeakMap,Nr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return t(this,jr,"f").size}set(e,n,r){return t(this,jr,"f").has(e)?(this.updateItem(e,n),this.removeItemMetadata(e),this.addItemMetadata(e,Date.now()+r)):(t(this,jr,"f").size===t(this,Or,"f")&&t(this,jr,"f").delete(this.getColdestKey()),t(this,jr,"f").set(e,n),this.addItemMetadata(e,Date.now()+r)),this}has(e){return t(this,jr,"f").has(e)}get(e){if(this.has(e)){const n=t(this,jr,"f").get(e);return this.updateItem(e,n),n}}delete(e){const n=t(this,jr,"f").delete(e);if(n){const t=this.itemMetadataSortedByExpirationTime.findIndex((t=>t.key===e));this.itemMetadataSortedByExpirationTime.splice(t,1),0===t&&this.rescheduleClearTimeout()}return n}clear(){var e;t(this,jr,"f").clear(),null===(e=t(this,Nr,"f"))||void 0===e||e.call(this),this.itemMetadataSortedByExpirationTime=[]}updateItem(e,n){t(this,jr,"f").delete(e),t(this,jr,"f").set(e,n)}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(e){const n=this.itemMetadataSortedByExpirationTime.findIndex((t=>t.expirationTime>e));(n>=0?this.itemMetadataSortedByExpirationTime.splice(0,n):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((e=>t(this,jr,"f").delete(e.key)))}rescheduleClearTimeout(){var n;if(null===(n=t(this,Nr,"f"))||void 0===n||n.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const n=lr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));e(this,Nr,(()=>{n(),e(this,Nr,void 0,"f")}),"f")}}}getColdestKey(){return N.first(t(this,jr,"f").keys())}}class Cr{constructor(t){this.value=t,this.children=new Map}}class zr{constructor(){Rr.set(this,new Cr)}get[(Rr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}set(e,n){let r=t(this,Rr,"f");for(const t of e)r.children.has(t)||r.children.set(t,new Cr),r=r.children.get(t);return r.value=n,this}has(e){let n=t(this,Rr,"f");for(const t of e){if(!n.children.has(t))return!1;n=n.children.get(t)}return void 0!==n.value}get(e){let n=t(this,Rr,"f");for(const t of e){if(!n.children.has(t))return;n=n.children.get(t)}return n.value}delete(e){const n=[];let r=t(this,Rr,"f");for(const t of e){if(!r.children.has(t))return!1;n.push(r),r=r.children.get(t)}if(delete r.value,0===r.children.size)for(const[t,r]of N.toArray(N.zip(e,n)).reverse())if(r.children.delete(t),0!==r.children.size)break;return!0}}export{s as Box,f as Emitter,_r as ExpirableMap,l as HashMap,d as HashSet,fr as LRUMap,y as Queue,qr as TLRUMap,zr as TrieMap,u as convertArrayToCons,c as convertConsToArray};
15
+ var t,e,n,r,i,o=function(t,e){return(o=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 s(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}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function a(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 c(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 u(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 l(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function f(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}class d{constructor(e){t.set(this,void 0),f(this,t,e,"f")}set(e){f(this,t,e,"f")}get(){return l(this,t,"f")}}function h([t,e]){return null===e?[t]:[t,...h(e)]}function y([t,...e]){return[t,e.length?y(e):null]}t=new WeakMap;class p{constructor(){e.set(this,new Map)}get[(e=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}on(t,n){l(this,e,"f").has(t)||l(this,e,"f").set(t,new Set);l(this,e,"f").get(t).add(n)}off(t,n){if(!l(this,e,"f").has(t))return;const r=l(this,e,"f").get(t);r.delete(n),0===r.size&&l(this,e,"f").delete(t)}emit(t,n){if(!l(this,e,"f").has(t))return;l(this,e,"f").get(t).forEach((t=>t(n)))}}class v{constructor(t){this.hash=t,n.set(this,new Map)}get[(n=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,n,"f").size}set(t,e){return l(this,n,"f").set(this.hash(t),e),this}has(t){return l(this,n,"f").has(this.hash(t))}get(t){return l(this,n,"f").get(this.hash(t))}delete(t){return l(this,n,"f").delete(this.hash(t))}clear(){l(this,n,"f").clear()}}class m{constructor(t){this.hash=t,r.set(this,new Map)}get[(r=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,r,"f").size}[Symbol.iterator](){return l(this,r,"f").values()}add(t){return l(this,r,"f").set(this.hash(t),t),this}delete(t){return l(this,r,"f").delete(this.hash(t))}has(t){return l(this,r,"f").has(this.hash(t))}clear(){l(this,r,"f").clear()}values(){return l(this,r,"f").values()}}class b{constructor(){i.set(this,[])}get[(i=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,i,"f").length}empty(){l(this,i,"f").length=0}enqueue(...t){l(this,i,"f").push(...t)}dequeue(){return l(this,i,"f").shift()}remove(t){let e;for(;(e=l(this,i,"f").indexOf(t))>=0;)l(this,i,"f").splice(e,1)}}var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},w={},S={CustomError:void 0};class A extends Error{get name(){return this.constructor.name}}S.CustomError=A;var T={ExpectedError:void 0};const I=S;class x extends I.CustomError{}T.ExpectedError=x;var E={AssertionError:void 0};const O=S;class _ extends O.CustomError{}E.AssertionError=_;var j={};j.normalize=void 0,j.normalize=function(t){var e;return{name:t.name,message:t.message,stack:null!==(e=t.stack)&&void 0!==e?e:null}};var B={refute:void 0};const M=T;B.refute=function(t,e){if(t)throw new M.ExpectedError(e)};var k={assert:void 0};const R=E;var N,C,P;k.assert=function(t,e){if(!t)throw new R.AssertionError(e)},N=w,C=g&&g.__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]}),(P=g&&g.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||C(e,t,n)})(S,N),P(T,N),P(E,N),P(j,N),P(B,N),P(k,N);var J={},U={},q={},D={},z={};z.go=void 0,z.go=function(t){return t()},function(t){var e=g&&g.__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]});(g&&g.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)})(z,t)}(D),q.chunkAsync=void 0;const F=D,W=w;q.chunkAsync=function(t,e){return(0,W.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,W.assert)(e>0,"The parameter size must be greater than 0"),(0,F.go)((async function*(){let n=[];for await(const r of t)n.push(r),n.length>=e&&(yield n,n=[]);n.length&&(yield n)}))};var L={},K={},H={};function V(t){return Array.isArray(t)}H.isntEmptyArray=H.isEmptyArray=H.isntArray=H.isArray=void 0,H.isArray=V,H.isntArray=function(t){return!V(t)},H.isEmptyArray=function(t){return 0===t.length},H.isntEmptyArray=function(t){return 0!==t.length};var Y={},$={};function G(t){return null===t}$.isntNull=$.isNull=void 0,$.isNull=G,$.isntNull=function(t){return!G(t)};var Q={};function X(t){return void 0===t}Q.isntUndefined=Q.isUndefined=void 0,Q.isUndefined=X,Q.isntUndefined=function(t){return!X(t)},Y.isntAsyncIterable=Y.isAsyncIterable=void 0;const Z=$,tt=Q;function et(t){return(0,Z.isntNull)(t)&&(0,tt.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}Y.isAsyncIterable=et,Y.isntAsyncIterable=function(t){return!et(t)};var nt={};function rt(t){return"bigint"==typeof t}nt.isntBigInt=nt.isBigInt=void 0,nt.isBigInt=rt,nt.isntBigInt=function(t){return!rt(t)};var it={};function ot(t){return"boolean"==typeof t}it.isntBoolean=it.isBoolean=void 0,it.isBoolean=ot,it.isntBoolean=function(t){return!ot(t)};var st={},at={};function ct(t){return"string"==typeof t}at.isntString=at.isString=void 0,at.isString=ct,at.isntString=function(t){return!ct(t)},st.isntChar=st.isChar=void 0;const ut=at;function lt(t){return(0,ut.isString)(t)&&1===t.length}st.isChar=lt,st.isntChar=function(t){return!lt(t)};var ft={};function dt(t){return t instanceof Date}ft.isntDate=ft.isDate=void 0,ft.isDate=dt,ft.isntDate=function(t){return!dt(t)};var ht={};ht.inEnum=void 0,ht.inEnum=function(t,e){return Object.values(e).includes(t)};var yt={};function pt(t){return t instanceof Error}yt.isntError=yt.isError=void 0,yt.isError=pt,yt.isntError=function(t){return!pt(t)};var vt={};function mt(t){return!t}vt.isntFalsy=vt.isFalsy=void 0,vt.isFalsy=mt,vt.isntFalsy=function(t){return!mt(t)};var bt={};function gt(t){return"function"==typeof t}bt.isntFunction=bt.isFunction=void 0,bt.isFunction=gt,bt.isntFunction=function(t){return!gt(t)};var wt={};wt.isntIterable=wt.isIterable=void 0;const St=$,At=Q;function Tt(t){return(0,St.isntNull)(t)&&(0,At.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}wt.isIterable=Tt,wt.isntIterable=function(t){return!Tt(t)};var It={},xt={};function Et(t){return null!==t&&"object"==typeof t}xt.isntEmptyObject=xt.isEmptyObject=xt.isRecord=xt.isntObject=xt.isObject=void 0,xt.isObject=Et,xt.isntObject=function(t){return!Et(t)},xt.isRecord=function(t){return Et(t)},xt.isEmptyObject=function(t){return 0===Object.keys(t).length},xt.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var Ot={};function _t(t){return"number"==typeof t}Ot.isntNumber=Ot.isNumber=void 0,Ot.isNumber=_t,Ot.isntNumber=function(t){return!_t(t)},It.isntJsonRpcError=It.isJsonRpcError=It.isntJsonRpcSuccess=It.isJsonRpcSuccess=It.isntJsonRpcRequest=It.isJsonRpcRequest=It.isntJsonRpcNotification=It.isJsonRpcNotification=void 0;const jt=H,Bt=xt,Mt=at,kt=Ot,Rt=Q;function Nt(t){return(0,Mt.isString)(t)||(0,kt.isNumber)(t)}function Ct(t){return(0,jt.isArray)(t)||(0,Bt.isObject)(t)}function Pt(t){return(0,Bt.isRecord)(t)&&(0,Mt.isString)(t.jsonrpc)&&(0,Mt.isString)(t.method)&&(0,Rt.isUndefined)(t.id)&&Ct(t.params)}function Jt(t){return(0,Bt.isRecord)(t)&&(0,Mt.isString)(t.jsonrpc)&&(0,Mt.isString)(t.method)&&Nt(t.id)&&Ct(t.params)}function Ut(t){return(0,Bt.isRecord)(t)&&(0,Mt.isString)(t.jsonrpc)&&(0,Mt.isString)(t.id)&&(0,Rt.isntUndefined)(t.result)}function qt(t){return(0,Bt.isRecord)(t)&&(0,Mt.isString)(t.jsonrpc)&&Nt(t.id)&&function(t){return(0,Bt.isRecord)(t)&&(0,kt.isNumber)(t.code)&&(0,Mt.isString)(t.message)&&((0,Rt.isUndefined)(t.data)||(0,Bt.isObject)(t.data))}(t.error)}It.isJsonRpcNotification=Pt,It.isntJsonRpcNotification=function(t){return!Pt(t)},It.isJsonRpcRequest=Jt,It.isntJsonRpcRequest=function(t){return!Jt(t)},It.isJsonRpcSuccess=Ut,It.isntJsonRpcSuccess=function(t){return!Ut(t)},It.isJsonRpcError=qt,It.isntJsonRpcError=function(t){return!qt(t)};var Dt={};Dt.isntJson=Dt.isJson=void 0,Dt.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},Dt.isntJson=function t(e){return!t()};var zt={};zt.isAbsoluteURL=void 0,zt.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=g&&g.__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]}),n=g&&g.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(H,t),n(Y,t),n(nt,t),n(it,t),n(st,t),n(ft,t),n(ht,t),n(yt,t),n(vt,t),n(bt,t),n(wt,t),n(It,t),n(Dt,t),n($,t),n(Ot,t),n(xt,t),n(at,t),n(Q,t),n(zt,t)}(K),L.chunkByAsync=void 0;const Ft=K;L.chunkByAsync=function(t,e){return(0,Ft.isAsyncIterable)(t)?async function*(t){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):async function*(t){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)};var Wt={};Wt.chunkBy=void 0,Wt.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 Lt={chunk:void 0};const Kt=D,Ht=w;Lt.chunk=function(t,e){return(0,Ht.assert)(Number.isInteger(e),"The parameter size must be an integer"),(0,Ht.assert)(e>0,"The parameter size must be greater than 0"),(0,Kt.go)((function*(){let n=[];for(const r of t)n.push(r),n.length>=e&&(yield n,n=[]);n.length&&(yield n)}))};var Vt={concatAsync:void 0};const Yt=K,$t=D;Vt.concatAsync=function(t,...e){return(0,$t.go)((async function*(){for(const n of[t,...e])if((0,Yt.isAsyncIterable)(n))for await(const t of n)yield t;else for(const t of n)yield t}))};var Gt={concat:void 0};const Qt=D;Gt.concat=function(t,...e){return(0,Qt.go)((function*(){for(const n of[t,...e])yield*n}))};var Xt={},Zt={};Zt.copyIterable=Zt.copyAsyncIterable=void 0,Zt.copyAsyncIterable=async function*(t){for await(const e of t)yield e},Zt.copyIterable=function*(t){for(const e of t)yield e},Xt.dropAsync=void 0;const te=D,ee=Zt,ne=w;Xt.dropAsync=function(t,e){return(0,ne.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,ne.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,ee.copyAsyncIterable)(t):(0,te.go)((async function*(){var n;const r=t[Symbol.asyncIterator]();let i;try{let t;for(;!(({value:t,done:i}=await r.next()),i||e<=0);)e--;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))}}))};var re={dropRightAsync:void 0};const ie=D,oe=Zt,se=w;re.dropRightAsync=function(t,e){return(0,se.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,se.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,oe.copyAsyncIterable)(t):(0,ie.go)((async function*(){const n=(await async function(t){const e=[];for await(const n of t)e.push(n);return e}(t)).slice(0,-e);for(const t of n)yield t}))};var ae={dropRight:void 0};const ce=D,ue=Zt,le=w;ae.dropRight=function(t,e){return(0,le.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,le.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,ue.copyIterable)(t):(0,ce.go)((function*(){const n=Array.from(t);yield*n.slice(0,-e)}))};var fe={dropUntilAsync:void 0};const de=K;fe.dropUntilAsync=function(t,e){return(0,de.isAsyncIterable)(t)?async function*(t){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):async function*(t){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)};var he={};he.dropUntil=void 0,he.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 ye={drop:void 0};const pe=D,ve=Zt,me=w;ye.drop=function(t,e){return(0,me.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,me.assert)(e>=0,"The parameter count must be greater than or equal to 0"),0===e?(0,ve.copyIterable)(t):(0,pe.go)((function*(){var n;const r=t[Symbol.iterator]();let i;try{let t;for(;!(({value:t,done:i}=r.next()),i||e<=0);)e--;for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}))};var be={filterAsync:void 0};const ge=K;be.filterAsync=function(t,e){return(0,ge.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)await e(r,n)&&(yield r),n++}(t):async function*(t){let n=0;for(const r of t)await e(r,n)&&(yield r),n++}(t)};var we={};we.filter=void 0,we.filter=function*(t,e){let n=0;for(const r of t)e(r,n)&&(yield r),n++};var Se={},Ae={},Te={flattenByAsync:void 0};const Ie=K;function xe(t){return(0,Ie.isIterable)(t)&&(0,Ie.isntChar)(t)}Te.flattenByAsync=function(t,e){return(0,Ie.isAsyncIterable)(t)?async function*(t){const r=1;for await(const i of t)xe(i)&&await e(i,r)?yield*n(i,r+1):yield i}(t):function(t){return n(t,1)}(t);async function*n(t,r){for(const i of t)xe(i)&&await e(i,r)?yield*n(i,r+1):yield i}},Ae.flattenDeepAsync=void 0;const Ee=Te,Oe=w;Ae.flattenDeepAsync=function(t,e=1/0){return(0,Oe.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,Oe.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,Ee.flattenByAsync)(t,((t,n)=>n<=e))},Se.flattenAsync=void 0;const _e=Ae;Se.flattenAsync=function(t){return(0,_e.flattenDeepAsync)(t,1)};var je={flattenBy:void 0};const Be=K;je.flattenBy=function(t,e){return function*t(n,r){for(const o of n)(0,Be.isIterable)(i=o)&&(0,Be.isntChar)(i)&&e(o,r)?yield*t(o,r+1):yield o;var i}(t,1)};var Me={flattenDeep:void 0};const ke=je,Re=w;Me.flattenDeep=function(t,e=1/0){return(0,Re.assert)(e===1/0||Number.isInteger(e),"The parameter depth must be an integer"),(0,Re.assert)(e>=0,"The parameter depth must be greater than or equal to 0"),(0,ke.flattenBy)(t,((t,n)=>n<=e))};var Ne={flatten:void 0};const Ce=Me;Ne.flatten=function(t){return(0,Ce.flattenDeep)(t,1)};var Pe={mapAsync:void 0};const Je=K;Pe.mapAsync=function(t,e){return(0,Je.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)yield await e(r,n),n++}(t):async function*(t){let n=0;for(const r of t)yield await e(r,n),n++}(t)};var Ue={};Ue.map=void 0,Ue.map=function*(t,e){let n=0;for(const r of t)yield e(r,n),n++};var qe={repeatAsync:void 0};const De=D,ze=w;qe.repeatAsync=function(t,e){return(0,ze.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,ze.assert)(e>=0,"The parameter times must be greater than or equal to 0"),e===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,De.go)((async function*(){const n=[];if(e>0){for await(const e of t)yield e,n.push(e);e--}for(;e>0;)yield*n,e--}))};var Fe={repeat:void 0};const We=D,Le=w;Fe.repeat=function(t,e){return(0,Le.assert)(e===1/0||Number.isInteger(e),"The parameter times must be an integer"),(0,Le.assert)(e>=0,"The parameter times must be greater than or equal to 0"),e===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,We.go)((function*(){const n=[];if(e>0){for(const e of t)yield e,n.push(e);e--}for(;e>0;)yield*n,e--}))};var Ke={sliceAsync:void 0};const He=D,Ve=w;Ke.sliceAsync=function(t,e,n=1/0){return(0,Ve.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,Ve.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,Ve.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,Ve.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,He.go)((async function*(){let r=0;for await(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var Ye={slice:void 0};const $e=D,Ge=w;Ye.slice=function(t,e,n=1/0){return(0,Ge.assert)(Number.isInteger(e),"The parameter start must be an integer"),(0,Ge.assert)(e>=0,"The parameter start must be greater than or equal to 0"),(0,Ge.assert)(Number.isInteger(n),"The parameter end must be an integer"),(0,Ge.assert)(n>=e,"The parameter end must be greater than or equal to start"),(0,$e.go)((function*(){let r=0;for(const i of t){if(r>=n)break;r>=e&&(yield i),r++}}))};var Qe={};Qe.splitAsync=void 0,Qe.splitAsync=async function*(t,e){let n=[];for await(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Xe={splitByAsync:void 0};const Ze=K;Xe.splitByAsync=function(t,e){return(0,Ze.isAsyncIterable)(t)?async function*(t){let n=[],r=0;for await(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t):async function*(t){let n=[],r=0;for(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t)};var tn={};tn.splitBy=void 0,tn.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 en={};en.split=void 0,en.split=function*(t,e){let n=[];for(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var nn={takeAsync:void 0};const rn=D,on=w;nn.takeAsync=function(t,e){return(0,on.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,on.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,rn.go)((async function*(){if(0!==e)for await(const n of t)if(yield n,0===--e)break}))};var sn={takeRightAsync:void 0};const an=D,cn=w;sn.takeRightAsync=function(t,e){return(0,cn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,cn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,an.go)((async function*(){var n;const r=t[Symbol.asyncIterator]();let i;try{const t=[];let o;for(;({value:o,done:i}=await r.next()),!i;)t.push(o),t.length>e&&t.shift();yield*t}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}))};var un={takeRight:void 0};const ln=D,fn=w;un.takeRight=function(t,e){return(0,fn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,fn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,ln.go)((function*(){var n;const r=t[Symbol.iterator]();let i;try{const t=[];let o;for(;({value:o,done:i}=r.next()),!i;)t.push(o),t.length>e&&t.shift();yield*t}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}))};var dn={takeUntilAsync:void 0};const hn=K;dn.takeUntilAsync=function(t,e){return(0,hn.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t){if(await e(r,n))break;yield r,n++}}(t):async function*(t){let n=0;for(const r of t){if(await e(r,n))break;yield r,n++}}(t)};var yn={};yn.takeUntil=void 0,yn.takeUntil=function*(t,e){let n=0;for(const r of t){if(e(r,n))break;yield r,n++}};var pn={take:void 0};const vn=D,mn=w;pn.take=function(t,e){return(0,mn.assert)(Number.isInteger(e),"The parameter count must be an integer"),(0,mn.assert)(e>=0,"The parameter count must be greater than or equal to 0"),(0,vn.go)((function*(){if(0!==e)for(const n of t)if(yield n,0===--e)break}))};var bn={tapAsync:void 0};const gn=K;bn.tapAsync=function(t,e){return(0,gn.isAsyncIterable)(t)?async function*(t){let n=0;for await(const r of t)await e(r,n),yield r,n++}(t):async function*(t){let n=0;for(const r of t)await e(r,n),yield r,n++}(t)};var wn={};wn.tap=void 0,wn.tap=function*(t,e){let n=0;for(const r of t)e(r,n),yield r,n++};var Sn={};Sn.toAsyncIterable=void 0,Sn.toAsyncIterable=async function*(t){for(const e of t)yield e};var An={};An.transformAsync=void 0,An.transformAsync=async function*(t,e){yield*e(t)};var Tn={};Tn.transform=void 0,Tn.transform=function*(t,e){yield*e(t)};var In={};In.uniqAsync=void 0,In.uniqAsync=async function*(t){const e=new Set;for await(const n of t)e.has(n)||(yield n,e.add(n))};var xn={uniqByAsync:void 0};const En=K;xn.uniqByAsync=function(t,e){return(0,En.isAsyncIterable)(t)?async function*(t){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):async function*(t){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)};var On={};On.uniqBy=void 0,On.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 _n={};_n.uniq=void 0,_n.uniq=function*(t){const e=new Set;for(const n of t)e.has(n)||(yield n,e.add(n))};var jn={zipAsync:void 0};const Bn=K;var Mn;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(Mn||(Mn={})),jn.zipAsync=function(t,...e){return async function*(...t){var e,n,r,i;const o=t.length,s=t.map((t=>(0,Bn.isAsyncIterable)(t)?[Mn.Async,t[Symbol.asyncIterator]()]:[Mn.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===Mn.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===Mn.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 kn={};kn.zip=void 0,kn.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)},function(t){var e=g&&g.__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]}),n=g&&g.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(q,t),n(L,t),n(Wt,t),n(Lt,t),n(Vt,t),n(Gt,t),n(Xt,t),n(re,t),n(ae,t),n(fe,t),n(he,t),n(ye,t),n(be,t),n(we,t),n(Se,t),n(Te,t),n(je,t),n(Ae,t),n(Me,t),n(Ne,t),n(Pe,t),n(Ue,t),n(qe,t),n(Fe,t),n(Ke,t),n(Ye,t),n(Qe,t),n(Xe,t),n(tn,t),n(en,t),n(nn,t),n(sn,t),n(un,t),n(dn,t),n(yn,t),n(pn,t),n(bn,t),n(wn,t),n(Sn,t),n(An,t),n(Tn,t),n(In,t),n(xn,t),n(On,t),n(_n,t),n(jn,t),n(kn,t)}(U);var Rn={},Nn={};Nn.consume=void 0,Nn.consume=function(t,e){return e(t)};var Cn={eachAsync:void 0};const Pn=K;Cn.eachAsync=function(t,e){return(0,Pn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t)await e(r,n),n++}(t):async function(t){let n=0;for(const r of t)await e(r,n),n++}(t)};var Jn={};Jn.each=void 0,Jn.each=function(t,e){let n=0;for(const r of t)e(r,n),n++};var Un={everyAsync:void 0};const qn=K;Un.everyAsync=function(t,e){return(0,qn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(!await e(r,n))return!1;n++}return!0}(t):async function(t){let n=0;for(const r of t){if(!await e(r,n))return!1;n++}return!0}(t)};var Dn={};Dn.every=void 0,Dn.every=function(t,e){let n=0;for(const r of t){if(!e(r,n))return!1;n++}return!0};var zn={findAsync:void 0};const Fn=K;zn.findAsync=function(t,e){return(0,Fn.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(await e(r,n))return r;n++}return}(t):async function(t){let n=0;for(const r of t){if(await e(r,n))return r;n++}return}(t)};var Wn={};Wn.find=void 0,Wn.find=function(t,e){let n=0;for(const r of t){if(e(r,n))return r;n++}};var Ln={};Ln.firstAsync=void 0,Ln.firstAsync=async function(t){for await(const e of t)return e};var Kn={};Kn.first=void 0,Kn.first=function(t){for(const e of t)return e};var Hn={};Hn.includesAsync=void 0,Hn.includesAsync=async function(t,e){for await(const n of t)if(n===e)return!0;return!1};var Vn={};Vn.includes=void 0,Vn.includes=function(t,e){for(const n of t)if(n===e)return!0;return!1};var Yn={};Yn.matchAsync=void 0,Yn.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 $n={};$n.match=void 0,$n.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 Gn={reduceAsync:void 0};const Qn=K;Gn.reduceAsync=function(t,e,n){return(0,Qn.isUndefined)(n)?function(t,e){return(0,Qn.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,Qn.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 Xn={reduce:void 0};const Zn=K;Xn.reduce=function(t,e,n){return(0,Zn.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 tr={someAsync:void 0};const er=K;tr.someAsync=function(t,e){return(0,er.isAsyncIterable)(t)?async function(t){let n=0;for await(const r of t){if(await e(r,n))return!0;n++}return!1}(t):async function(t){let n=0;for(const r of t){if(await e(r,n))return!0;n++}return!1}(t)};var nr={};nr.some=void 0,nr.some=function(t,e){let n=0;for(const r of t){if(e(r,n))return!0;n++}return!1};var rr={};rr.lastAsync=void 0,rr.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 ir={};ir.last=void 0,ir.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 or={toArrayAsync:void 0};const sr=Nn;or.toArrayAsync=function(t){return(0,sr.consume)(t,(async t=>{const e=[];for await(const n of t)e.push(n);return e}))};var ar={toArray:void 0};const cr=Nn;ar.toArray=function(t){return(0,cr.consume)(t,(t=>Array.from(t)))};var ur={toSetAsync:void 0};const lr=Nn;ur.toSetAsync=function(t){return(0,lr.consume)(t,(async t=>{const e=new Set;for await(const n of t)e.add(n);return e}))};var fr={toSet:void 0};const dr=Nn;var hr,yr;fr.toSet=function(t){return(0,dr.consume)(t,(t=>new Set(t)))},function(t){var e=g&&g.__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]}),n=g&&g.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(Nn,t),n(Cn,t),n(Jn,t),n(Un,t),n(Dn,t),n(zn,t),n(Wn,t),n(Ln,t),n(Kn,t),n(Hn,t),n(Vn,t),n(Yn,t),n($n,t),n(Gn,t),n(Xn,t),n(tr,t),n(nr,t),n(rr,t),n(ir,t),n(or,t),n(ar,t),n(ur,t),n(fr,t)}(Rn),function(t){var e=g&&g.__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]}),n=g&&g.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(U,t),n(Rn,t)}(J);class pr{constructor(t){hr.set(this,void 0),yr.set(this,new Map),w.assert(Number.isInteger(t),"The parameter limit must be an integer"),w.assert(t>0,"The parameter limit must be a positive value"),f(this,hr,t,"f")}get[(hr=new WeakMap,yr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,yr,"f").size}set(t,e){return l(this,yr,"f").has(t)?this.updateItem(t,e):(l(this,yr,"f").size===l(this,hr,"f")&&l(this,yr,"f").delete(this.getColdestKey()),l(this,yr,"f").set(t,e)),this}has(t){return l(this,yr,"f").has(t)}get(t){if(!this.has(t))return;const e=l(this,yr,"f").get(t);return this.updateItem(t,e),e}delete(t){return l(this,yr,"f").delete(t)}clear(){l(this,yr,"f").clear()}updateItem(t,e){l(this,yr,"f").delete(t),l(this,yr,"f").set(t,e)}getColdestKey(){return J.first(l(this,yr,"f").keys())}}var vr={},mr={},br={},gr={};gr.random=void 0,gr.random=function(t,e){return Math.random()*(e-t)+t};var wr={};wr.randomInt=void 0,wr.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t};var Sr={};Sr.randomIntInclusive=void 0,Sr.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=g&&g.__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]}),n=g&&g.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(gr,t),n(wr,t),n(Sr,t)}(br),mr.calculateExponentialBackoffTimeout=void 0;const Ar=br;mr.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,Ar.randomIntInclusive)(0,o):o};var Tr={};Tr.setTimeout=void 0,Tr.setTimeout=function(t,e){const n=globalThis.setTimeout(e,t);return()=>clearTimeout(n)};var Ir={setSchedule:void 0};const xr=Tr;Ir.setSchedule=function(t,e){const n=t-Date.now();return(0,xr.setTimeout)(n,e)};var Er={};Er.setInterval=void 0,Er.setInterval=function(t,e){const n=globalThis.setInterval(e,t);return()=>clearInterval(n)};var Or={setImmediate:void 0};const _r=Tr;Or.setImmediate=function(t){if(globalThis.setImmediate){const e=globalThis.setImmediate(t);return()=>clearImmediate(e)}return(0,_r.setTimeout)(0,t)};var jr={setTimeoutLoop:void 0};const Br=Tr;jr.setTimeoutLoop=function(t,e){let n=!1,r=(0,Br.setTimeout)(t,(async function i(){await e(),n||(r=(0,Br.setTimeout)(t,i))}));return()=>{n=!0,r()}};var Mr={setDynamicTimeoutLoop:void 0};const kr=Tr;var Rr,Nr,Cr,Pr,Jr,Ur,qr;Mr.setDynamicTimeoutLoop=function(t,e){let n=!1,r=(0,kr.setTimeout)(t,(async function i(){const o=Date.now();await e();const s=Date.now()-o;n||(r=(0,kr.setTimeout)(Math.max(t-s,0),i))}));return()=>{n=!0,r()}},function(t){var e=g&&g.__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]}),n=g&&g.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(mr,t),n(Tr,t),n(Ir,t),n(Er,t),n(Or,t),n(jr,t),n(Mr,t)}(vr);class Dr{constructor(){Rr.set(this,new Map),Nr.set(this,void 0),this.itemMetadataSortedByExpirationTime=[]}get[(Rr=new WeakMap,Nr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,Rr,"f").size}set(t,e,n){return l(this,Rr,"f").set(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n),this}has(t){return l(this,Rr,"f").has(t)}get(t){return l(this,Rr,"f").get(t)}delete(t){const e=l(this,Rr,"f").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;l(this,Rr,"f").clear(),null===(t=l(this,Nr,"f"))||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=>l(this,Rr,"f").delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=l(this,Nr,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=vr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));f(this,Nr,(()=>{e(),f(this,Nr,void 0,"f")}),"f")}}}}class zr{constructor(t){Cr.set(this,void 0),Pr.set(this,new Map),Jr.set(this,void 0),this.itemMetadataSortedByExpirationTime=[],w.assert(Number.isInteger(t),"The parameter limit must be an integer"),w.assert(t>0,"The parameter limit must be a positive value"),f(this,Cr,t,"f")}get[(Cr=new WeakMap,Pr=new WeakMap,Jr=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}get size(){return l(this,Pr,"f").size}set(t,e,n){return l(this,Pr,"f").has(t)?(this.updateItem(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n)):(l(this,Pr,"f").size===l(this,Cr,"f")&&l(this,Pr,"f").delete(this.getColdestKey()),l(this,Pr,"f").set(t,e),this.addItemMetadata(t,Date.now()+n)),this}has(t){return l(this,Pr,"f").has(t)}get(t){if(this.has(t)){const e=l(this,Pr,"f").get(t);return this.updateItem(t,e),e}}delete(t){const e=l(this,Pr,"f").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;l(this,Pr,"f").clear(),null===(t=l(this,Jr,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}updateItem(t,e){l(this,Pr,"f").delete(t),l(this,Pr,"f").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=>l(this,Pr,"f").delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=l(this,Jr,"f"))||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=vr.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));f(this,Jr,(()=>{e(),f(this,Jr,void 0,"f")}),"f")}}}getColdestKey(){return J.first(l(this,Pr,"f").keys())}}class Fr{constructor(t){this.value=t,this.children=new Map}}class Wr{constructor(){Ur.set(this,new Fr)}get[(Ur=new WeakMap,Symbol.toStringTag)](){return this.constructor.name}set(t,e){let n=l(this,Ur,"f");for(const e of t)n.children.has(e)||n.children.set(e,new Fr),n=n.children.get(e);return n.value=e,this}has(t){let e=l(this,Ur,"f");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=l(this,Ur,"f");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=l(this,Ur,"f");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 J.toArray(J.zip(t,e)).reverse())if(r.children.delete(n),0!==r.children.size)break;return!0}}class Lr{constructor(t,e){this.schema=t,qr.set(this,void 0),f(this,qr,e,"f")}get state(){return l(this,qr,"f")}matches(t){return l(this,qr,"f")===t}send(t){if(!(t in this.schema[this.state]))throw new Kr(this.state,t);f(this,qr,this.schema[this.state][t],"f")}}qr=new WeakMap;class Kr extends w.CustomError{constructor(t,e){super(`State ${t} cannot react to event ${e}`)}}function Hr(t){return"function"==typeof t}function Vr(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 Yr=Vr((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 $r(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Gr=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=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=a(o),l=s.next();!l.done;l=s.next()){l.value.remove(this)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(Hr(f))try{f()}catch(t){i=t instanceof Yr?t.errors:[t]}var d=this._teardowns;if(d){this._teardowns=null;try{for(var h=a(d),y=h.next();!y.done;y=h.next()){var p=y.value;try{Zr(p)}catch(t){i=null!=i?i:[],t instanceof Yr?i=u(u([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{y&&!y.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new Yr(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Zr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(n=this._teardowns)&&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)&&$r(e,t)},t.prototype.remove=function(e){var n=this._teardowns;n&&$r(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Qr=Gr.EMPTY;function Xr(t){return t instanceof Gr||t&&"closed"in t&&Hr(t.remove)&&Hr(t.add)&&Hr(t.unsubscribe)}function Zr(t){Hr(t)?t():t.unsubscribe()}var ti={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ei={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ei.delegate;return((null==n?void 0:n.setTimeout)||setTimeout).apply(void 0,u([],c(t)))},clearTimeout:function(t){var e=ei.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ni(t){ei.setTimeout((function(){throw t}))}function ri(){}var ii=null;function oi(t){if(ti.useDeprecatedSynchronousErrorHandling){var e=!ii;if(e&&(ii={errorThrown:!1,error:null}),t(),e){var n=ii,r=n.errorThrown,i=n.error;if(ii=null,r)throw i}}else t()}var si=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Xr(e)&&e.add(n)):n.destination=li,n}return s(e,t),e.create=function(t,e,n){return new ai(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}(Gr),ai=function(t){function e(e,n,r){var i,o=t.call(this)||this;if(Hr(e))i=e;else if(e){var s;i=e.next,n=e.error,r=e.complete,o&&ti.useDeprecatedNextContext?(s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()}:s=e,i=null==i?void 0:i.bind(s),n=null==n?void 0:n.bind(s),r=null==r?void 0:r.bind(s)}return o.destination={next:i?ci(i):ri,error:ci(null!=n?n:ui),complete:r?ci(r):ri},o}return s(e,t),e}(si);function ci(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(void 0,u([],c(e)))}catch(t){ni(t)}}}function ui(t){throw t}var li={closed:!0,next:ri,error:ui,complete:ri},fi="function"==typeof Symbol&&Symbol.observable||"@@observable";function di(t){return t}function hi(t){return 0===t.length?di:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var yi=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 si||function(t){return t&&Hr(t.next)&&Hr(t.error)&&Hr(t.complete)}(r)&&Xr(r)?t:new ai(t,e,n);return oi((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=pi(e))((function(e,r){var i=new ai({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[fi]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return hi(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=pi(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 pi(t){var e;return null!==(e=null!=t?t:ti.Promise)&&void 0!==e?e:Promise}var vi=Vr((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),mi=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return s(e,t),e.prototype.lift=function(t){var e=new bi(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new vi},e.prototype.next=function(t){var e=this;oi((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){var i=e.observers.slice();try{for(var o=a(i),s=o.next();!s.done;s=o.next()){s.value.next(t)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;oi((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;oi((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=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=e.hasError,r=e.isStopped,i=e.observers;return n||r?Qr:(i.push(t),new Gr((function(){return $r(i,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 yi;return t.source=this,t},e.create=function(t,e){return new bi(t,e)},e}(yi),bi=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return s(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:Qr},e}(mi),gi={},wi={};function Si(t){return Array.isArray(t)}wi.isntEmptyArray=wi.isEmptyArray=wi.isntArray=wi.isArray=void 0,wi.isArray=Si,wi.isntArray=function(t){return!Si(t)},wi.isEmptyArray=function(t){return 0===t.length},wi.isntEmptyArray=function(t){return 0!==t.length};var Ai={},Ti={};function Ii(t){return null===t}Ti.isntNull=Ti.isNull=void 0,Ti.isNull=Ii,Ti.isntNull=function(t){return!Ii(t)};var xi={};function Ei(t){return void 0===t}xi.isntUndefined=xi.isUndefined=void 0,xi.isUndefined=Ei,xi.isntUndefined=function(t){return!Ei(t)},Ai.isntAsyncIterable=Ai.isAsyncIterable=void 0;const Oi=Ti,_i=xi;function ji(t){return(0,Oi.isntNull)(t)&&(0,_i.isntUndefined)(t)&&"function"==typeof t[Symbol.asyncIterator]}Ai.isAsyncIterable=ji,Ai.isntAsyncIterable=function(t){return!ji(t)};var Bi={};function Mi(t){return"bigint"==typeof t}Bi.isntBigInt=Bi.isBigInt=void 0,Bi.isBigInt=Mi,Bi.isntBigInt=function(t){return!Mi(t)};var ki={};function Ri(t){return"boolean"==typeof t}ki.isntBoolean=ki.isBoolean=void 0,ki.isBoolean=Ri,ki.isntBoolean=function(t){return!Ri(t)};var Ni={},Ci={};function Pi(t){return"string"==typeof t}Ci.isntString=Ci.isString=void 0,Ci.isString=Pi,Ci.isntString=function(t){return!Pi(t)},Ni.isntChar=Ni.isChar=void 0;const Ji=Ci;function Ui(t){return(0,Ji.isString)(t)&&1===t.length}Ni.isChar=Ui,Ni.isntChar=function(t){return!Ui(t)};var qi={};function Di(t){return t instanceof Date}qi.isntDate=qi.isDate=void 0,qi.isDate=Di,qi.isntDate=function(t){return!Di(t)};var zi={};zi.inEnum=void 0,zi.inEnum=function(t,e){return Object.values(e).includes(t)};var Fi={};function Wi(t){return t instanceof Error}Fi.isntError=Fi.isError=void 0,Fi.isError=Wi,Fi.isntError=function(t){return!Wi(t)};var Li={};function Ki(t){return!t}Li.isntFalsy=Li.isFalsy=void 0,Li.isFalsy=Ki,Li.isntFalsy=function(t){return!Ki(t)};var Hi={};function Vi(t){return"function"==typeof t}Hi.isntFunction=Hi.isFunction=void 0,Hi.isFunction=Vi,Hi.isntFunction=function(t){return!Vi(t)};var Yi={};Yi.isntIterable=Yi.isIterable=void 0;const $i=Ti,Gi=xi;function Qi(t){return(0,$i.isntNull)(t)&&(0,Gi.isntUndefined)(t)&&"function"==typeof t[Symbol.iterator]}Yi.isIterable=Qi,Yi.isntIterable=function(t){return!Qi(t)};var Xi={},Zi={};var to=Function.prototype,eo=Object.prototype,no=to.toString,ro=eo.hasOwnProperty,io=no.call(Object),oo=eo.toString,so=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);var ao=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=oo.call(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=so(t);if(null===e)return!0;var n=ro.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&no.call(n)==io},co=g&&g.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Zi.isntEmptyObject=Zi.isEmptyObject=Zi.isntPlainObject=Zi.isPlainObject=Zi.isntObject=Zi.isObject=void 0;const uo=co(ao);function lo(t){return null!==t&&"object"==typeof t}function fo(t){return(0,uo.default)(t)}Zi.isObject=lo,Zi.isntObject=function(t){return!lo(t)},Zi.isPlainObject=fo,Zi.isntPlainObject=function(t){return!fo(t)},Zi.isEmptyObject=function(t){return 0===Object.keys(t).length},Zi.isntEmptyObject=function(t){return 0!==Object.keys(t).length};var ho={};function yo(t){return"number"==typeof t}ho.isntNumber=ho.isNumber=void 0,ho.isNumber=yo,ho.isntNumber=function(t){return!yo(t)},Xi.isntJsonRpcError=Xi.isJsonRpcError=Xi.isntJsonRpcSuccess=Xi.isJsonRpcSuccess=Xi.isntJsonRpcRequest=Xi.isJsonRpcRequest=Xi.isntJsonRpcNotification=Xi.isJsonRpcNotification=void 0;const po=wi,vo=Zi,mo=Ci,bo=ho,go=xi;function wo(t){return(0,mo.isString)(t)||(0,bo.isNumber)(t)}function So(t){return(0,po.isArray)(t)||(0,vo.isObject)(t)}function Ao(t){return(0,vo.isPlainObject)(t)&&(0,mo.isString)(t.jsonrpc)&&(0,mo.isString)(t.method)&&(0,go.isUndefined)(t.id)&&So(t.params)}function To(t){return(0,vo.isPlainObject)(t)&&(0,mo.isString)(t.jsonrpc)&&(0,mo.isString)(t.method)&&wo(t.id)&&So(t.params)}function Io(t){return(0,vo.isPlainObject)(t)&&(0,mo.isString)(t.jsonrpc)&&(0,mo.isString)(t.id)&&"result"in t}function xo(t){return(0,vo.isPlainObject)(t)&&(0,mo.isString)(t.jsonrpc)&&wo(t.id)&&function(t){return(0,vo.isPlainObject)(t)&&(0,bo.isNumber)(t.code)&&(0,mo.isString)(t.message)&&((0,go.isUndefined)(t.data)||(0,vo.isObject)(t.data))}(t.error)}Xi.isJsonRpcNotification=Ao,Xi.isntJsonRpcNotification=function(t){return!Ao(t)},Xi.isJsonRpcRequest=To,Xi.isntJsonRpcRequest=function(t){return!To(t)},Xi.isJsonRpcSuccess=Io,Xi.isntJsonRpcSuccess=function(t){return!Io(t)},Xi.isJsonRpcError=xo,Xi.isntJsonRpcError=function(t){return!xo(t)};var Eo={};Eo.isntJson=Eo.isJson=void 0,Eo.isJson=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},Eo.isntJson=function t(e){return!t()};var Oo={};Oo.isAbsoluteURL=void 0,Oo.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}},function(t){var e=g&&g.__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]}),n=g&&g.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};n(wi,t),n(Ai,t),n(Bi,t),n(ki,t),n(Ni,t),n(qi,t),n(zi,t),n(Fi,t),n(Li,t),n(Hi,t),n(Yi,t),n(Xi,t),n(Eo,t),n(Ti,t),n(ho,t),n(Zi,t),n(Ci,t),n(xi,t),n(Oo,t)}(gi);class _o extends Lr{constructor(){super(...arguments),this.stateChanges=new mi}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}),gi.isEmptyObject(this.schema[n])&&this.stateChanges.complete()}}export{Kr as BadEventError,d as Box,p as Emitter,Dr as ExpirableMap,Lr as FiniteStateMachine,v as HashMap,m as HashSet,pr as LRUMap,_o as ObservableFiniteStateMachine,b as Queue,zr as TLRUMap,Wr as TrieMap,y as convertArrayToCons,h as convertConsToArray};
16
16
  //# sourceMappingURL=index.min.mjs.map