xframelib 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,6 +13,7 @@
13
13
 
14
14
  > 基于 VUE3+Hprose+Typescript+Widget 的前端框架,与ElementUI、AntDesign VUE、Quasar等界面库无关,一直是来源于项目和服务于项目。
15
15
 
16
+ - v1.0.6 移除vuewindow组件;修改XWindow组件:默认不显示最小化按钮和窗体图标,对外暴露updatePosition方法允许代码修改位置;更新基础依赖库版本;
16
17
  - v1.0.5 补充积累CommonTool公共方法;新增Grid计算工具类;更新基础依赖库版本;
17
18
  - v1.0.4 新增支持大图前端分片加载展示的webworker;增加默认mitt导出;更新基础依赖库版本;
18
19
  - v1.0.3 新增支持Webworker Service开发模式(取代vite-plugin-webworker-service功能,解决插件与@quasar/app-vite不兼容);增加基于lru-cache的前端缓存工具类WebCacheTool和webCacheWorker;批量使用globThis代替window全局对象,以支持node和webworker里使用本库;更新基础依赖库版本;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ const e=Symbol("Comlink.proxy"),r=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),t=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),o=e=>"object"==typeof e&&null!==e||"function"==typeof e,i={canHandle:r=>o(r)&&r[e],serialize(e){const{port1:r,port2:n}=new MessageChannel;return c(e,r),[n,[n]]},deserialize:e=>(e.start(),function(e){const r=new Map;return e.addEventListener("message",(function(e){const{data:n}=e;if(!n||!n.id)return;const t=r.get(n.id);if(t)try{t(n)}finally{r.delete(n.id)}})),p(e,r,[],void 0)}(e))},s=new Map([["proxy",i],["throw",{canHandle:e=>o(e)&&a in e,serialize({value:e}){let r;return r=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[r,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function c(r,n=globalThis,o=["*"]){n.addEventListener("message",(function i(s){if(!s||!s.data)return;if(!function(e,r){for(const n of e){if(r===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(r))return!0}return!1}(o,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:l,type:f,path:g}=Object.assign({path:[]},s.data),h=(s.data.argumentList||[]).map(v);let p;try{const n=g.slice(0,-1).reduce(((e,r)=>e[r]),r),t=g.reduce(((e,r)=>e[r]),r);switch(f){case"GET":p=t;break;case"SET":n[g.slice(-1)[0]]=v(s.data.value),p=!0;break;case"APPLY":p=t.apply(n,h);break;case"CONSTRUCT":p=function(r){return Object.assign(r,{[e]:!0})}(new t(...h));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;c(r,n),p=function(e,r){return d.set(e,r),e}(e,[e])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[a]:0}}Promise.resolve(p).catch((e=>({value:e,[a]:0}))).then((e=>{const[a,o]=w(e);n.postMessage(Object.assign(Object.assign({},a),{id:l}),o),"RELEASE"===f&&(n.removeEventListener("message",i),u(n),t in r&&"function"==typeof r[t]&&r[t]())})).catch((e=>{const[r,t]=w({value:new TypeError("Unserializable return value"),[a]:0});n.postMessage(Object.assign(Object.assign({},r),{id:l}),t)}))})),n.start&&n.start()}function u(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function l(e){if(e)throw new Error("Proxy has been released and is not useable")}function f(e){return m(e,new Map,{type:"RELEASE"}).then((()=>{u(e)}))}const g=new WeakMap,h="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const r=(g.get(e)||0)-1;g.set(e,r),0===r&&f(e)}));function p(e,t,a=[],o=function(){}){let i=!1;const s=new Proxy(o,{get(r,o){if(l(i),o===n)return()=>{!function(e){h&&h.unregister(e)}(s),f(e),t.clear(),i=!0};if("then"===o){if(0===a.length)return{then:()=>s};const r=m(e,t,{type:"GET",path:a.map((e=>e.toString()))}).then(v);return r.then.bind(r)}return p(e,t,[...a,o])},set(r,n,o){l(i);const[s,c]=w(o);return m(e,t,{type:"SET",path:[...a,n].map((e=>e.toString())),value:s},c).then(v)},apply(n,o,s){l(i);const c=a[a.length-1];if(c===r)return m(e,t,{type:"ENDPOINT"}).then(v);if("bind"===c)return p(e,t,a.slice(0,-1));const[u,f]=y(s);return m(e,t,{type:"APPLY",path:a.map((e=>e.toString())),argumentList:u},f).then(v)},construct(r,n){l(i);const[o,s]=y(n);return m(e,t,{type:"CONSTRUCT",path:a.map((e=>e.toString())),argumentList:o},s).then(v)}});return function(e,r){const n=(g.get(r)||0)+1;g.set(r,n),h&&h.register(e,r,e)}(s,e),s}function y(e){const r=e.map(w);return[r.map((e=>e[0])),(n=r.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const d=new WeakMap;function w(e){for(const[r,n]of s)if(n.canHandle(e)){const[t,a]=n.serialize(e);return[{type:"HANDLER",name:r,value:t},a]}return[{type:"RAW",value:e},d.get(e)||[]]}function v(e){switch(e.type){case"HANDLER":return s.get(e.name).deserialize(e.value);case"RAW":return e.value}}function m(e,r,n,t){return new Promise((a=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");r.set(o,a),e.start&&e.start(),e.postMessage(Object.assign({id:o},n),t)}))}let b=!0;try{String.fromCharCode.apply(String,[1,2])}catch(e){b=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var E=2654435769;function S(e,r){var n=e.length,t=n<<2;if(r){var a=e[n-1];if(a<(t-=4)-3||a>t)return null;t=a}for(var o=new Uint8Array(t),i=0;i<t;++i)o[i]=e[i>>2]>>((3&i)<<3);return o}function C(e,r){var n,t=e.length,a=t>>2;3&t&&++a,r?(n=new Uint32Array(a+1))[a]=t:n=new Uint32Array(a);for(var o=0;o<t;++o)n[o>>2]|=e[o]<<((3&o)<<3);return n}function A(e){return 4294967295&e}function T(e,r,n,t,a,o){return(n>>>5^r<<2)+(r>>>3^n<<4)^(e^r)+(o[3&t^a]^n)}function U(e){if(e.length<16){var r=new Uint8Array(16);r.set(e),e=r}return e}function k(e){for(var r=e.length,n=new Uint8Array(3*r),t=0,a=0;a<r;a++){var o=e.charCodeAt(a);if(o<128)n[t++]=o;else if(o<2048)n[t++]=192|o>>6,n[t++]=128|63&o;else{if(!(o<55296||o>57343)){if(a+1<r){var i=e.charCodeAt(a+1);if(o<56320&&56320<=i&&i<=57343){var s=65536+((1023&o)<<10|1023&i);n[t++]=240|s>>18,n[t++]=128|s>>12&63,n[t++]=128|s>>6&63,n[t++]=128|63&s,a++;continue}}throw new Error("Malformed string")}n[t++]=224|o>>12,n[t++]=128|o>>6&63,n[t++]=128|63&o}}return n.subarray(0,t)}function M(e){var r=e.length;return 0===r?"":r<32767?function(e,r){for(var n=new Array(r),t=0,a=0,o=e.length;t<r&&a<o;t++){var i=e[a++];switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n[t]=i;break;case 12:case 13:if(!(a<o))throw new Error("Unfinished UTF-8 octet sequence");n[t]=(31&i)<<6|63&e[a++];break;case 14:if(!(a+1<o))throw new Error("Unfinished UTF-8 octet sequence");n[t]=(15&i)<<12|(63&e[a++])<<6|63&e[a++];break;case 15:if(!(a+2<o))throw new Error("Unfinished UTF-8 octet sequence");var s=((7&i)<<18|(63&e[a++])<<12|(63&e[a++])<<6|63&e[a++])-65536;if(!(0<=s&&s<=1048575))throw new Error("Character outside valid Unicode range: 0x"+s.toString(16));n[t++]=s>>10&1023|55296,n[t]=1023&s|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+i.toString(16))}}return t<r&&(n.length=t),String.fromCharCode.apply(String,n)}(e,r):function(e,r){for(var n=[],t=new Array(32768),a=0,o=0,i=e.length;a<r&&o<i;a++){var s=e[o++];switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t[a]=s;break;case 12:case 13:if(!(o<i))throw new Error("Unfinished UTF-8 octet sequence");t[a]=(31&s)<<6|63&e[o++];break;case 14:if(!(o+1<i))throw new Error("Unfinished UTF-8 octet sequence");t[a]=(15&s)<<12|(63&e[o++])<<6|63&e[o++];break;case 15:if(!(o+2<i))throw new Error("Unfinished UTF-8 octet sequence");var c=((7&s)<<18|(63&e[o++])<<12|(63&e[o++])<<6|63&e[o++])-65536;if(!(0<=c&&c<=1048575))throw new Error("Character outside valid Unicode range: 0x"+c.toString(16));t[a++]=c>>10&1023|55296,t[a]=1023&c|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+s.toString(16))}if(a>=32766){var u=a+1;t.length=u,n.push(String.fromCharCode.apply(String,t)),r-=u,a=-1}}return a>0&&(t.length=a,n.push(String.fromCharCode.apply(String,t))),n.join("")}(e,r)}function j(e,r){return"string"==typeof e&&(e=k(e)),"string"==typeof r&&(r=k(r)),null==e||0===e.length?e:S(function(e,r){var n,t,a,o,i,s,c=e.length,u=c-1;for(t=e[u],a=0,s=0|Math.floor(6+52/c);s>0;--s){for(o=(a=A(a+E))>>>2&3,i=0;i<u;++i)n=e[i+1],t=e[i]=A(e[i]+T(a,n,t,i,o,r));n=e[0],t=e[u]=A(e[u]+T(a,n,t,u,o,r))}return e}(C(e,!0),C(U(r),!1)),!1)}function O(e,r){return"string"==typeof e&&(e=function(e){for(var r=globalThis.atob(e),n=r.length,t=new Uint8Array(n),a=0;a<n;a++)t[a]=r.charCodeAt(a);return t}(e)),"string"==typeof r&&(r=k(r)),null==e||0===e.length?e:S(function(e,r){var n,t,a,o,i,s=e.length,c=s-1;for(n=e[0],a=A(Math.floor(6+52/s)*E);0!==a;a=A(a-E)){for(o=a>>>2&3,i=c;i>0;--i)t=e[i-1],n=e[i]=A(e[i]-T(a,n,t,i,o,r));t=e[c],n=e[0]=A(e[0]-T(a,n,t,0,o,r))}return e}(C(e,!1),C(U(r),!1)),!0)}c(Object.freeze({__proto__:null,decrypt:O,decryptToString:function(e,r){return M(O(e,r))},encrypt:j,encryptToString:function(e,r){return globalThis.btoa(function(e){var r=e.length;if(0===r)return"";var n=b?e:function(e){for(var r=e.length,n=new Array(e.length),t=0;t<r;++t)n[t]=e[t];return n}(e);if(r<65535)return String.fromCharCode.apply(String,n);for(var t=32767&r,a=r>>15,o=new Array(t?a+1:a),i=0;i<a;++i)o[i]=String.fromCharCode.apply(String,n.subarray(i<<15,i+1<<15));return t&&(o[a]=String.fromCharCode.apply(String,n.subarray(a<<15,r))),o.join("")}(j(e,r)))},toBytes:k,toString:M}));
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ const e=Symbol("Comlink.proxy"),t=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),r=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),o=e=>"object"==typeof e&&null!==e||"function"==typeof e,i={canHandle:t=>o(t)&&t[e],serialize(e){const{port1:t,port2:n}=new MessageChannel;return c(e,t),[n,[n]]},deserialize:e=>(e.start(),function(e){const t=new Map;return e.addEventListener("message",(function(e){const{data:n}=e;if(!n||!n.id)return;const r=t.get(n.id);if(r)try{r(n)}finally{t.delete(n.id)}})),p(e,t,[],void 0)}(e))},s=new Map([["proxy",i],["throw",{canHandle:e=>o(e)&&a in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function c(t,n=globalThis,o=["*"]){n.addEventListener("message",(function i(s){if(!s||!s.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(o,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:u,type:f,path:h}=Object.assign({path:[]},s.data),g=(s.data.argumentList||[]).map(y);let p;try{const n=h.slice(0,-1).reduce(((e,t)=>e[t]),t),r=h.reduce(((e,t)=>e[t]),t);switch(f){case"GET":p=r;break;case"SET":n[h.slice(-1)[0]]=y(s.data.value),p=!0;break;case"APPLY":p=r.apply(n,g);break;case"CONSTRUCT":p=function(t){return Object.assign(t,{[e]:!0})}(new r(...g));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;c(t,n),p=function(e,t){return d.set(e,t),e}(e,[e])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[a]:0}}Promise.resolve(p).catch((e=>({value:e,[a]:0}))).then((e=>{const[a,o]=w(e);n.postMessage(Object.assign(Object.assign({},a),{id:u}),o),"RELEASE"===f&&(n.removeEventListener("message",i),l(n),r in t&&"function"==typeof t[r]&&t[r]())})).catch((e=>{const[t,r]=w({value:new TypeError("Unserializable return value"),[a]:0});n.postMessage(Object.assign(Object.assign({},t),{id:u}),r)}))})),n.start&&n.start()}function l(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function u(e){if(e)throw new Error("Proxy has been released and is not useable")}function f(e){return b(e,new Map,{type:"RELEASE"}).then((()=>{l(e)}))}const h=new WeakMap,g="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(h.get(e)||0)-1;h.set(e,t),0===t&&f(e)}));function p(e,r,a=[],o=function(){}){let i=!1;const s=new Proxy(o,{get(t,o){if(u(i),o===n)return()=>{!function(e){g&&g.unregister(e)}(s),f(e),r.clear(),i=!0};if("then"===o){if(0===a.length)return{then:()=>s};const t=b(e,r,{type:"GET",path:a.map((e=>e.toString()))}).then(y);return t.then.bind(t)}return p(e,r,[...a,o])},set(t,n,o){u(i);const[s,c]=w(o);return b(e,r,{type:"SET",path:[...a,n].map((e=>e.toString())),value:s},c).then(y)},apply(n,o,s){u(i);const c=a[a.length-1];if(c===t)return b(e,r,{type:"ENDPOINT"}).then(y);if("bind"===c)return p(e,r,a.slice(0,-1));const[l,f]=m(s);return b(e,r,{type:"APPLY",path:a.map((e=>e.toString())),argumentList:l},f).then(y)},construct(t,n){u(i);const[o,s]=m(n);return b(e,r,{type:"CONSTRUCT",path:a.map((e=>e.toString())),argumentList:o},s).then(y)}});return function(e,t){const n=(h.get(t)||0)+1;h.set(t,n),g&&g.register(e,t,e)}(s,e),s}function m(e){const t=e.map(w);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const d=new WeakMap;function w(e){for(const[t,n]of s)if(n.canHandle(e)){const[r,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},a]}return[{type:"RAW",value:e},d.get(e)||[]]}function y(e){switch(e.type){case"HANDLER":return s.get(e.name).deserialize(e.value);case"RAW":return e.value}}function b(e,t,n,r){return new Promise((a=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(o,a),e.start&&e.start(),e.postMessage(Object.assign({id:o},n),r)}))}function E(e,t=0,n=0,r=2){if(!e||4!=e.length)return;const a=(e[2]-e[0])/r,o=(e[3]-e[1])/r,i=e[0]+t*a,s=e[3]-n*o,c=i+a,l=s-o;return[[i,s],[c,s],[c,l],[i,l]]}c(Object.freeze({__proto__:null,loadBigImage:async function(e,t,n,r=1024){const a=await fetch(t);if(!a)throw new Error("加载失败:"+t);let o=await a.blob();if(!o)throw new Error("Blob数据对象为空!");const i=await createImageBitmap(o);o=null;const s=Math.ceil(i.width/r),c=Math.ceil(i.height/r),l=Math.max(s,c),u=l,f=l,h=i.width/u,g=i.height/f,p=new OffscreenCanvas(h,g),m=p.getContext("2d");if(!m)throw new Error("获取canvas的Context对象为空!");const d=[],w={id:e,width:i.width,height:i.height,maxUnitSize:r,colNum:u,rowNum:f,items:d};for(let y=0;y<f;y++)for(let t=0;t<u;t++){m.clearRect(0,0,p.width,p.height),m.drawImage(i,t*h,y*g,h,g,0,0,h,g);const r=await p.convertToBlob(),a=URL.createObjectURL(r),o={id:`${e}_${y}_${t}`,coords:E(n,t,y,l),imgURL:a};d.push(o)}return w}}));
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),i=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.finalizer"),n=Symbol("Comlink.thrown"),o=t=>"object"==typeof t&&null!==t||"function"==typeof t,r={canHandle:e=>o(e)&&e[t],serialize(t){const{port1:e,port2:i}=new MessageChannel;return a(t,e),[i,[i]]},deserialize:t=>(t.start(),function(t){const e=new Map;return t.addEventListener("message",(function(t){const{data:i}=t;if(!i||!i.id)return;const s=e.get(i.id);if(s)try{s(i)}finally{e.delete(i.id)}})),p(t,e,[],void 0)}(t))},h=new Map([["proxy",r],["throw",{canHandle:t=>o(t)&&n in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function a(e,i=globalThis,o=["*"]){i.addEventListener("message",(function r(h){if(!h||!h.data)return;if(!function(t,e){for(const i of t){if(e===i||"*"===i)return!0;if(i instanceof RegExp&&i.test(e))return!0}return!1}(o,h.origin))return void console.warn(`Invalid origin '${h.origin}' for comlink proxy`);const{id:c,type:u,path:f}=Object.assign({path:[]},h.data),d=(h.data.argumentList||[]).map(v);let p;try{const i=f.slice(0,-1).reduce(((t,e)=>t[e]),e),s=f.reduce(((t,e)=>t[e]),e);switch(u){case"GET":p=s;break;case"SET":i[f.slice(-1)[0]]=v(h.data.value),p=!0;break;case"APPLY":p=s.apply(i,d);break;case"CONSTRUCT":p=function(e){return Object.assign(e,{[t]:!0})}(new s(...d));break;case"ENDPOINT":{const{port1:t,port2:i}=new MessageChannel;a(e,i),p=function(t,e){return w.set(t,e),t}(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(t){p={value:t,[n]:0}}Promise.resolve(p).catch((t=>({value:t,[n]:0}))).then((t=>{const[n,o]=m(t);i.postMessage(Object.assign(Object.assign({},n),{id:c}),o),"RELEASE"===u&&(i.removeEventListener("message",r),l(i),s in e&&"function"==typeof e[s]&&e[s]())})).catch((t=>{const[e,s]=m({value:new TypeError("Unserializable return value"),[n]:0});i.postMessage(Object.assign(Object.assign({},e),{id:c}),s)}))})),i.start&&i.start()}function l(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function c(t){if(t)throw new Error("Proxy has been released and is not useable")}function u(t){return y(t,new Map,{type:"RELEASE"}).then((()=>{l(t)}))}const f=new WeakMap,d="FinalizationRegistry"in globalThis&&new FinalizationRegistry((t=>{const e=(f.get(t)||0)-1;f.set(t,e),0===e&&u(t)}));function p(t,s,n=[],o=function(){}){let r=!1;const h=new Proxy(o,{get(e,o){if(c(r),o===i)return()=>{!function(t){d&&d.unregister(t)}(h),u(t),s.clear(),r=!0};if("then"===o){if(0===n.length)return{then:()=>h};const e=y(t,s,{type:"GET",path:n.map((t=>t.toString()))}).then(v);return e.then.bind(e)}return p(t,s,[...n,o])},set(e,i,o){c(r);const[h,a]=m(o);return y(t,s,{type:"SET",path:[...n,i].map((t=>t.toString())),value:h},a).then(v)},apply(i,o,h){c(r);const a=n[n.length-1];if(a===e)return y(t,s,{type:"ENDPOINT"}).then(v);if("bind"===a)return p(t,s,n.slice(0,-1));const[l,u]=g(h);return y(t,s,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:l},u).then(v)},construct(e,i){c(r);const[o,h]=g(i);return y(t,s,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:o},h).then(v)}});return function(t,e){const i=(f.get(e)||0)+1;f.set(e,i),d&&d.register(t,e,t)}(h,t),h}function g(t){const e=t.map(m);return[e.map((t=>t[0])),(i=e.map((t=>t[1])),Array.prototype.concat.apply([],i))];var i}const w=new WeakMap;function m(t){for(const[e,i]of h)if(i.canHandle(t)){const[s,n]=i.serialize(t);return[{type:"HANDLER",name:e,value:s},n]}return[{type:"RAW",value:t},w.get(t)||[]]}function v(t){switch(t.type){case"HANDLER":return h.get(t.name).deserialize(t.value);case"RAW":return t.value}}function y(t,e,i,s){return new Promise((n=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.set(o,n),t.start&&t.start(),t.postMessage(Object.assign({id:o},i),s)}))}var S,b,A={exports:{}},_=A.exports={};function E(){throw new Error("setTimeout has not been defined")}function O(){throw new Error("clearTimeout has not been defined")}function T(t){if(S===setTimeout)return setTimeout(t,0);if((S===E||!S)&&setTimeout)return S=setTimeout,setTimeout(t,0);try{return S(t,0)}catch(e){try{return S.call(null,t,0)}catch(e){return S.call(this,t,0)}}}!function(){try{S="function"==typeof setTimeout?setTimeout:E}catch(t){S=E}try{b="function"==typeof clearTimeout?clearTimeout:O}catch(t){b=O}}();var x,z=[],F=!1,C=-1;function R(){F&&x&&(F=!1,x.length?z=x.concat(z):C=-1,z.length&&L())}function L(){if(!F){var t=T(R);F=!0;for(var e=z.length;e;){for(x=z,z=[];++C<e;)x&&x[C].run();C=-1,e=z.length}x=null,F=!1,function(t){if(b===clearTimeout)return clearTimeout(t);if((b===O||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(t);try{return b(t)}catch(e){try{return b.call(null,t)}catch(e){return b.call(this,t)}}}(t)}}function M(t,e){this.fun=t,this.array=e}function W(){}_.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];z.push(new M(t,e)),1!==z.length||F||T(L)},M.prototype.run=function(){this.fun.apply(null,this.array)},_.title="browser",_.browser=!0,_.env={},_.argv=[],_.version="",_.versions={},_.on=W,_.addListener=W,_.once=W,_.off=W,_.removeListener=W,_.removeAllListeners=W,_.emit=W,_.prependListener=W,_.prependOnceListener=W,_.listeners=function(t){return[]},_.binding=function(t){throw new Error("process.binding is not supported")},_.cwd=function(){return"/"},_.chdir=function(t){throw new Error("process.chdir is not supported")},_.umask=function(){return 0};const k=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}(A.exports),j="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,D=new Set,G="object"==typeof k&&k?k:{},U=(t,e,i,s)=>{"function"==typeof G.emitWarning?G.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)};let N=globalThis.AbortController,I=globalThis.AbortSignal;if(void 0===N){I=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},N=class{constructor(){e()}signal=new I;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==G.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,U("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const P=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),H=t=>P(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?B:null:null;class B extends Array{constructor(t){super(t),this.fill(0)}}class q{heap;length;static#t=!1;static create(t){const e=H(t);if(!e)return[];q.#t=!0;const i=new q(t,e);return q.#t=!1,i}constructor(t,e){if(!q.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class ${#e;#i;#s;#n;#o;#r;#h;#a;get perf(){return this.#a}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#c;#u;#f;#d;#p;#g;#w;#m;#v;#y;#S;#b;#A;#_;#E;#O;#T;static unsafeExposeInternals(t){return{starts:t.#b,ttls:t.#A,sizes:t.#S,keyMap:t.#u,keyList:t.#f,valList:t.#d,next:t.#p,prev:t.#g,get head(){return t.#w},get tail(){return t.#m},free:t.#v,isBackgroundFetch:e=>t.#x(e),backgroundFetch:(e,i,s,n)=>t.#z(e,i,s,n),moveToTail:e=>t.#F(e),indexes:e=>t.#C(e),rindexes:e=>t.#R(e),isStale:e=>t.#L(e)}}get max(){return this.#e}get maxSize(){return this.#i}get calculatedSize(){return this.#c}get size(){return this.#l}get fetchMethod(){return this.#r}get memoMethod(){return this.#h}get dispose(){return this.#s}get onInsert(){return this.#n}get disposeAfter(){return this.#o}constructor(t){const{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:r,allowStale:h,dispose:a,onInsert:l,disposeAfter:c,noDisposeOnSet:u,noUpdateTTL:f,maxSize:d=0,maxEntrySize:p=0,sizeCalculation:g,fetchMethod:w,memoMethod:m,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:b,ignoreFetchAbort:A,perf:_}=t;if(void 0!==_&&"function"!=typeof _?.now)throw new TypeError("perf option must have a now() method if specified");if(this.#a=_??j,0!==e&&!P(e))throw new TypeError("max option must be a nonnegative integer");const E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#e=e,this.#i=d,this.maxEntrySize=p||this.#i,this.sizeCalculation=g,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==m&&"function"!=typeof m)throw new TypeError("memoMethod must be a function if defined");if(this.#h=m,void 0!==w&&"function"!=typeof w)throw new TypeError("fetchMethod must be a function if specified");if(this.#r=w,this.#E=!!w,this.#u=new Map,this.#f=new Array(e).fill(void 0),this.#d=new Array(e).fill(void 0),this.#p=new E(e),this.#g=new E(e),this.#w=0,this.#m=0,this.#v=q.create(e),this.#l=0,this.#c=0,"function"==typeof a&&(this.#s=a),"function"==typeof l&&(this.#n=l),"function"==typeof c?(this.#o=c,this.#y=[]):(this.#o=void 0,this.#y=void 0),this.#_=!!this.#s,this.#T=!!this.#n,this.#O=!!this.#o,this.noDisposeOnSet=!!u,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!b,this.ignoreFetchAbort=!!A,0!==this.maxEntrySize){if(0!==this.#i&&!P(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!P(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#M()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!r,this.ttlResolution=P(s)||0===s?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!P(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#W()}if(0===this.#e&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!D.has(t))(t)&&(D.add(t),U("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,$))}}getRemainingTTL(t){return this.#u.has(t)?1/0:0}#W(){const t=new B(this.#e),e=new B(this.#e);this.#A=t,this.#b=e,this.#k=(i,s,n=this.#a.now())=>{if(e[i]=0!==s?n:0,t[i]=s,0!==s&&this.ttlAutopurge){const t=setTimeout((()=>{this.#L(i)&&this.#j(this.#f[i],"expire")}),s+1);t.unref&&t.unref()}},this.#D=i=>{e[i]=0!==t[i]?this.#a.now():0},this.#G=(n,o)=>{if(t[o]){const r=t[o],h=e[o];if(!r||!h)return;n.ttl=r,n.start=h,n.now=i||s();const a=n.now-h;n.remainingTTL=r-a}};let i=0;const s=()=>{const t=this.#a.now();if(this.ttlResolution>0){i=t;const e=setTimeout((()=>i=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=n=>{const o=this.#u.get(n);if(void 0===o)return 0;const r=t[o],h=e[o];return r&&h?r-((i||s())-h):1/0},this.#L=n=>{const o=e[n],r=t[n];return!!r&&!!o&&(i||s())-o>r}}#D=()=>{};#G=()=>{};#k=()=>{};#L=()=>!1;#M(){const t=new B(this.#e);this.#c=0,this.#S=t,this.#U=e=>{this.#c-=t[e],t[e]=0},this.#N=(t,e,i,s)=>{if(this.#x(e))return 0;if(!P(i)){if(!s)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof s)throw new TypeError("sizeCalculation must be a function");if(i=s(e,t),!P(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return i},this.#I=(e,i,s)=>{if(t[e]=i,this.#i){const i=this.#i-t[e];for(;this.#c>i;)this.#P(!0)}this.#c+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#c)}}#U=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#C({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#m;this.#H(e)&&(!t&&this.#L(e)||(yield e),e!==this.#w);)e=this.#g[e]}*#R({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#w;this.#H(e)&&(!t&&this.#L(e)||(yield e),e!==this.#m);)e=this.#p[e]}#H(t){return void 0!==t&&this.#u.get(this.#f[t])===t}*entries(){for(const t of this.#C())void 0===this.#d[t]||void 0===this.#f[t]||this.#x(this.#d[t])||(yield[this.#f[t],this.#d[t]])}*rentries(){for(const t of this.#R())void 0===this.#d[t]||void 0===this.#f[t]||this.#x(this.#d[t])||(yield[this.#f[t],this.#d[t]])}*keys(){for(const t of this.#C()){const e=this.#f[t];void 0===e||this.#x(this.#d[t])||(yield e)}}*rkeys(){for(const t of this.#R()){const e=this.#f[t];void 0===e||this.#x(this.#d[t])||(yield e)}}*values(){for(const t of this.#C())void 0===this.#d[t]||this.#x(this.#d[t])||(yield this.#d[t])}*rvalues(){for(const t of this.#R())void 0===this.#d[t]||this.#x(this.#d[t])||(yield this.#d[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const i of this.#C()){const s=this.#d[i],n=this.#x(s)?s.__staleWhileFetching:s;if(void 0!==n&&t(n,this.#f[i],this))return this.get(this.#f[i],e)}}forEach(t,e=this){for(const i of this.#C()){const s=this.#d[i],n=this.#x(s)?s.__staleWhileFetching:s;void 0!==n&&t.call(e,n,this.#f[i],this)}}rforEach(t,e=this){for(const i of this.#R()){const s=this.#d[i],n=this.#x(s)?s.__staleWhileFetching:s;void 0!==n&&t.call(e,n,this.#f[i],this)}}purgeStale(){let t=!1;for(const e of this.#R({allowStale:!0}))this.#L(e)&&(this.#j(this.#f[e],"expire"),t=!0);return t}info(t){const e=this.#u.get(t);if(void 0===e)return;const i=this.#d[e],s=this.#x(i)?i.__staleWhileFetching:i;if(void 0===s)return;const n={value:s};if(this.#A&&this.#b){const t=this.#A[e],i=this.#b[e];if(t&&i){const e=t-(this.#a.now()-i);n.ttl=e,n.start=Date.now()}}return this.#S&&(n.size=this.#S[e]),n}dump(){const t=[];for(const e of this.#C({allowStale:!0})){const i=this.#f[e],s=this.#d[e],n=this.#x(s)?s.__staleWhileFetching:s;if(void 0===n||void 0===i)continue;const o={value:n};if(this.#A&&this.#b){o.ttl=this.#A[e];const t=this.#a.now()-this.#b[e];o.start=Math.floor(Date.now()-t)}this.#S&&(o.size=this.#S[e]),t.unshift([i,o])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const t=Date.now()-i.start;i.start=this.#a.now()-t}this.set(e,i.value,i)}}set(t,e,i={}){if(void 0===e)return this.delete(t),this;const{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:r=this.sizeCalculation,status:h}=i;let{noUpdateTTL:a=this.noUpdateTTL}=i;const l=this.#N(t,e,i.size||0,r);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#j(t,"set"),this;let c=0===this.#l?void 0:this.#u.get(t);if(void 0===c)c=0===this.#l?this.#m:0!==this.#v.length?this.#v.pop():this.#l===this.#e?this.#P(!1):this.#l,this.#f[c]=t,this.#d[c]=e,this.#u.set(t,c),this.#p[this.#m]=c,this.#g[c]=this.#m,this.#m=c,this.#l++,this.#I(c,l,h),h&&(h.set="add"),a=!1,this.#T&&this.#n?.(e,t,"add");else{this.#F(c);const i=this.#d[c];if(e!==i){if(this.#E&&this.#x(i)){i.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=i;void 0===e||o||(this.#_&&this.#s?.(e,t,"set"),this.#O&&this.#y?.push([e,t,"set"]))}else o||(this.#_&&this.#s?.(i,t,"set"),this.#O&&this.#y?.push([i,t,"set"]));if(this.#U(c),this.#I(c,l,h),this.#d[c]=e,h){h.set="replace";const t=i&&this.#x(i)?i.__staleWhileFetching:i;void 0!==t&&(h.oldValue=t)}}else h&&(h.set="update");this.#T&&this.onInsert?.(e,t,e===i?"update":"replace")}if(0===s||this.#A||this.#W(),this.#A&&(a||this.#k(c,s,n),h&&this.#G(h,c)),!o&&this.#O&&this.#y){const t=this.#y;let e;for(;e=t?.shift();)this.#o?.(...e)}return this}pop(){try{for(;this.#l;){const t=this.#d[this.#w];if(this.#P(!0),this.#x(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#O&&this.#y){const t=this.#y;let e;for(;e=t?.shift();)this.#o?.(...e)}}}#P(t){const e=this.#w,i=this.#f[e],s=this.#d[e];return this.#E&&this.#x(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#O)&&(this.#_&&this.#s?.(s,i,"evict"),this.#O&&this.#y?.push([s,i,"evict"])),this.#U(e),t&&(this.#f[e]=void 0,this.#d[e]=void 0,this.#v.push(e)),1===this.#l?(this.#w=this.#m=0,this.#v.length=0):this.#w=this.#p[e],this.#u.delete(i),this.#l--,e}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#u.get(t);if(void 0!==n){const t=this.#d[n];if(this.#x(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#L(n))return i&&this.#D(n),s&&(s.has="hit",this.#G(s,n)),!0;s&&(s.has="stale",this.#G(s,n))}else s&&(s.has="miss");return!1}peek(t,e={}){const{allowStale:i=this.allowStale}=e,s=this.#u.get(t);if(void 0===s||!i&&this.#L(s))return;const n=this.#d[s];return this.#x(n)?n.__staleWhileFetching:n}#z(t,e,i,s){const n=void 0===e?void 0:this.#d[e];if(this.#x(n))return n;const o=new N,{signal:r}=i;r?.addEventListener("abort",(()=>o.abort(r.reason)),{signal:o.signal});const h={signal:o.signal,options:i,context:s},a=(s,n=!1)=>{const{aborted:r}=o.signal,a=i.ignoreFetchAbort&&void 0!==s;if(i.status&&(r&&!n?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,a&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),r&&!a&&!n)return l(o.signal.reason);const u=c,f=this.#d[e];return(f===c||a&&n&&void 0===f)&&(void 0===s?void 0!==u.__staleWhileFetching?this.#d[e]=u.__staleWhileFetching:this.#j(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,s,h.options))),s},l=s=>{const{aborted:n}=o.signal,r=n&&i.allowStaleOnFetchAbort,h=r||i.allowStaleOnFetchRejection,a=h||i.noDeleteOnFetchRejection,l=c;if(this.#d[e]===c&&(a&&void 0!==l.__staleWhileFetching?r||(this.#d[e]=l.__staleWhileFetching):this.#j(t,"fetch")),h)return i.status&&void 0!==l.__staleWhileFetching&&(i.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw s};i.status&&(i.status.fetchDispatched=!0);const c=new Promise(((e,s)=>{const r=this.#r?.(t,n,h);r&&r instanceof Promise&&r.then((t=>e(void 0===t?void 0:t)),s),o.signal.addEventListener("abort",(()=>{i.ignoreFetchAbort&&!i.allowStaleOnFetchAbort||(e(void 0),i.allowStaleOnFetchAbort&&(e=t=>a(t,!0)))}))})).then(a,(t=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=t),l(t)))),u=Object.assign(c,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return void 0===e?(this.set(t,u,{...h.options,status:void 0}),e=this.#u.get(t)):this.#d[e]=u,u}#x(t){if(!this.#E)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof N}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:h=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:w,signal:m}=e;if(!this.#E)return w&&(w.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:w});const v={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:r,size:h,sizeCalculation:a,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:d,ignoreFetchAbort:f,status:w,signal:m};let y=this.#u.get(t);if(void 0===y){w&&(w.fetch="miss");const e=this.#z(t,y,v,p);return e.__returned=e}{const e=this.#d[y];if(this.#x(e)){const t=i&&void 0!==e.__staleWhileFetching;return w&&(w.fetch="inflight",t&&(w.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const n=this.#L(y);if(!g&&!n)return w&&(w.fetch="hit"),this.#F(y),s&&this.#D(y),w&&this.#G(w,y),e;const o=this.#z(t,y,v,p),r=void 0!==o.__staleWhileFetching&&i;return w&&(w.fetch=n?"stale":"refresh",r&&n&&(w.returnedStale=!0)),r?o.__staleWhileFetching:o.__returned=o}}async forceFetch(t,e={}){const i=await this.fetch(t,e);if(void 0===i)throw new Error("fetch() returned undefined");return i}memo(t,e={}){const i=this.#h;if(!i)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:n,...o}=e,r=this.get(t,o);if(!n&&void 0!==r)return r;const h=i(t,r,{options:o,context:s});return this.set(t,h,o),h}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,r=this.#u.get(t);if(void 0!==r){const e=this.#d[r],h=this.#x(e);return o&&this.#G(o,r),this.#L(r)?(o&&(o.get="stale"),h?(o&&i&&void 0!==e.__staleWhileFetching&&(o.returnedStale=!0),i?e.__staleWhileFetching:void 0):(n||this.#j(t,"expire"),o&&i&&(o.returnedStale=!0),i?e:void 0)):(o&&(o.get="hit"),h?e.__staleWhileFetching:(this.#F(r),s&&this.#D(r),e))}o&&(o.get="miss")}#B(t,e){this.#g[e]=t,this.#p[t]=e}#F(t){t!==this.#m&&(t===this.#w?this.#w=this.#p[t]:this.#B(this.#g[t],this.#p[t]),this.#B(this.#m,t),this.#m=t)}delete(t){return this.#j(t,"delete")}#j(t,e){let i=!1;if(0!==this.#l){const s=this.#u.get(t);if(void 0!==s)if(i=!0,1===this.#l)this.#q(e);else{this.#U(s);const i=this.#d[s];if(this.#x(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#O)&&(this.#_&&this.#s?.(i,t,e),this.#O&&this.#y?.push([i,t,e])),this.#u.delete(t),this.#f[s]=void 0,this.#d[s]=void 0,s===this.#m)this.#m=this.#g[s];else if(s===this.#w)this.#w=this.#p[s];else{const t=this.#g[s];this.#p[t]=this.#p[s];const e=this.#p[s];this.#g[e]=this.#g[s]}this.#l--,this.#v.push(s)}}if(this.#O&&this.#y?.length){const t=this.#y;let e;for(;e=t?.shift();)this.#o?.(...e)}return i}clear(){return this.#q("delete")}#q(t){for(const e of this.#R({allowStale:!0})){const i=this.#d[e];if(this.#x(i))i.__abortController.abort(new Error("deleted"));else{const s=this.#f[e];this.#_&&this.#s?.(i,s,t),this.#O&&this.#y?.push([i,s,t])}}if(this.#u.clear(),this.#d.fill(void 0),this.#f.fill(void 0),this.#A&&this.#b&&(this.#A.fill(0),this.#b.fill(0)),this.#S&&this.#S.fill(0),this.#w=0,this.#m=0,this.#v.length=0,this.#c=0,this.#l=0,this.#O&&this.#y){const t=this.#y;let e;for(;e=t?.shift();)this.#o?.(...e)}}}class Y{static defaultOptions={max:1e3,maxAge:18e5};static cache=new $(this.defaultOptions);static createCache(t=this.defaultOptions){return new $(t)}static set(t,e,i=this.cache){let s=i;s||(s=this.cache),s.set(t,e)}static get(t,e=this.cache){let i=e;return i||(i=this.cache),i.get(t)}static remove(t,e=this.cache){let i=e;return i||(i=this.cache),i.del(t)}static has(t,e=this.cache){let i=e;return i||(i=this.cache),i.has(t)}static count(t=this.cache){let e=t;return e||(e=this.cache),e.size}static maxSize(t=this.cache){let e=t;return e||(e=this.cache),e.max}static peek(t,e=this.cache){let i=e;return i||(i=this.cache),i.peek(t)}static keys(t=this.cache){let e=t;return e||(e=this.cache),e.keys()}static clear(t=this.cache){let e=t;e||(e=this.cache),e.clear()}}const X=new Map;async function V(t,e=void 0){const i={max:1e3,maxAage:18e5};let s=i;e&&(s={...i,...e});const n=Y.createCache(s);return X.set(t,n),n}async function J(t=""){let e;return e=X.has(t)?X.get(t):await V(t),e}a(Object.freeze({__proto__:null,clear:async function(t=""){const e=await J(t);return e&&Y.clear(e),!1},count:async function(t=""){const e=await J(t);return e?Y.count(e):0},createCache:V,get:async function(t,e=""){const i=await J(e);if(i){const e=Y.get(t,i);return console.log("666000",t,e),e}},getCacheObject:J,has:async function(t,e=""){const i=await J(e);return!!i&&Y.has(t,i)},keys:async function(t=""){const e=await J(t);if(e)return Y.keys(e)},maxSize:async function(t=""){const e=await J(t);return e?Y.maxSize(e):0},peek:async function(t,e=""){const i=await J(e);return!!i&&Y.peek(t,i)},remove:async function(t,e=""){const i=await J(e);if(i)return Y.remove(t,i)},set:async function(t,e,i=""){const s=await J(i);return!!s&&(Y.set(t,e,s),!0)}}));