zeed 0.14.3 → 0.15.1
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/LICENSE +1 -1
- package/README.md +19 -16
- package/dist/{chunk-RO2LDCKK.js → chunk-PJUDSJKG.js} +9 -9
- package/dist/chunk-PJUDSJKG.js.map +1 -0
- package/dist/index.browser.cjs +67 -68
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +2 -2
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +65 -66
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.cts +2 -2
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.js +5 -5
- package/dist/index.node.js.map +1 -1
- package/dist/{uuid-Mf9SJKN2.d.ts → uuid-SUiCz6WF.d.cts} +18 -17
- package/dist/uuid-SUiCz6WF.d.ts +1337 -0
- package/package.json +1 -1
- package/dist/chunk-RO2LDCKK.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> Plant the "zeed" for your next Typescript project and let it grow with this useful lib, providing basic functionalities handy in most projects.
|
|
4
4
|
|
|
5
|
-
- Strict TypeScript
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
5
|
+
- Strict **TypeScript**
|
|
6
|
+
- **Zero dependencies** and lightweight, **tree-shakable**
|
|
7
|
+
- **Universal** for browsers, as well as node, deno and bun
|
|
8
|
+
- Modern **ESM**, fallback to CommonJS available
|
|
9
|
+
- Mostly covered by **tests**
|
|
10
10
|
|
|
11
11
|
Get started like this:
|
|
12
12
|
|
|
@@ -253,7 +253,7 @@ deepMerge({ a: { b: 1 } }, { c: 3, a: { d: 4 } }) // {a:{b:1, d:4}, c:4}
|
|
|
253
253
|
|
|
254
254
|
## Disposer
|
|
255
255
|
|
|
256
|
-
`
|
|
256
|
+
`useDispose` will simplify cleaning up objects. You just need to `add` a function or and object with `dispose` method to be called for cleanup. This can also be nested. A simple example is a timer:
|
|
257
257
|
|
|
258
258
|
```ts
|
|
259
259
|
function disposableTimer() {
|
|
@@ -261,20 +261,19 @@ function disposableTimer() {
|
|
|
261
261
|
return () => clearTimeout(timeout)
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
const
|
|
264
|
+
const dispose = useDispose()
|
|
265
265
|
|
|
266
266
|
const obj = disposableTimer()
|
|
267
|
-
|
|
267
|
+
dispose.add(obj)
|
|
268
268
|
|
|
269
269
|
// or
|
|
270
270
|
|
|
271
|
-
const untrackTimer =
|
|
271
|
+
const untrackTimer = dispose.add(disposableTimer())
|
|
272
|
+
untrackTimer() // dispose single object by return value of .track
|
|
272
273
|
|
|
273
|
-
// then later
|
|
274
|
+
// then later dispose all
|
|
274
275
|
|
|
275
|
-
|
|
276
|
-
untrackTimer() // dispose single object by return value of .track
|
|
277
|
-
disposer.dispose() // will dispose all tracked elements
|
|
276
|
+
dispose()
|
|
278
277
|
```
|
|
279
278
|
|
|
280
279
|
You can also `untrack` single entries. Entries are untracked LIFO. Disposers can also return a Promise and therefore `await` async disposals.
|
|
@@ -285,18 +284,22 @@ The disposer itself is also a call to dispose i.e. for convenience you can add i
|
|
|
285
284
|
class DisposeExample {
|
|
286
285
|
// the trick is to assign to member `dispose`, will be both
|
|
287
286
|
// the destructor and the registration point for disposables
|
|
288
|
-
dispose =
|
|
287
|
+
dispose = useDispose()
|
|
289
288
|
|
|
290
289
|
constructor() {
|
|
291
|
-
this.dispose.
|
|
290
|
+
this.dispose.add(disposableTimer())
|
|
292
291
|
}
|
|
293
292
|
}
|
|
294
293
|
|
|
295
294
|
const obj = new DisposeExample()
|
|
296
295
|
// ...
|
|
297
|
-
obj.dispose()
|
|
296
|
+
obj.dispose() // or async via `await obj.dispose()`
|
|
298
297
|
```
|
|
299
298
|
|
|
299
|
+
## Much more...
|
|
300
|
+
|
|
301
|
+
...browse the source!
|
|
302
|
+
|
|
300
303
|
## Related and Links
|
|
301
304
|
|
|
302
305
|
Related projects:
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
function $n(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}function z(){let e=$n();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}var te=-1,le=0,_e=1,$e=2,Ve=3,Ne=4,je=9007199254740991,At={"*":-1,a:-1,all:-1,d:0,dbg:0,debug:0,i:1,inf:1,info:1,w:2,warn:2,warning:2,e:3,err:3,error:3,fatal:4,off:9007199254740991,"-":9007199254740991};function Vn(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}function
|
|
2
|
-
`)}var Xn={2:"01",8:"01234567",11:"0123456789a",16:"0123456789abcdef",32:"0123456789abcdefghjkmnpqrtuvwxyz","32-crockford":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","32-geohash":"0123456789bcdefghjkmnpqrstuvwxyz","32-agnoster":"0123456789abcdefghjkmnpqrtuvwxyz","32-rfc":"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567","32-hex":"0123456789ABCDEFGHIJKLMNOPQRSTUV","32-zbase":"ybndrfg8ejkmcpqxot1uwisza345h769",36:"0123456789abcdefghijklmnopqrstuvwxyz",58:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",62:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","64-url":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",66:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~",85:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"};function Qn(e){let t=Xn[String(e)];if(!t)if(typeof e=="string")t=e;else throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let n=new Uint8Array(256);for(let c=0;c<n.length;c++)n[c]=255;for(let c=0;c<t.length;c++){let f=t.charAt(c),l=f.charCodeAt(0);if(n[l]!==255)throw new TypeError(`${f} is ambiguous`);n[l]=c;}let r=t.length,o=t.charAt(0),i=Math.log(r)/Math.log(256),s=Math.log(256)/Math.log(r);function
|
|
3
|
-
${
|
|
1
|
+
function $n(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}function z(){let e=$n();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}var te=-1,le=0,_e=1,$e=2,Ve=3,Ne=4,je=9007199254740991,At={"*":-1,a:-1,all:-1,d:0,dbg:0,debug:0,i:1,inf:1,info:1,w:2,warn:2,warning:2,e:3,err:3,error:3,fatal:4,off:9007199254740991,"-":9007199254740991};function Vn(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}function F(){return typeof crypto<"u"?Vn():Math.random()}function Bo(e=.25){return F()<e}function Oo(e=100,t=0){return t+Math.floor(F()*(e-t))}function _o(e=100,t=0){return t+F()*(e-t)}function $o(e,t,n){return Math.max(e,Math.min(n,t))}function Nn(e){return e.reduce((t,n)=>t+n,0)}function Vo(e){return Nn(e)/e.length}function No(e){return !/^1?$|^(11+?)\1+$/.test("1".repeat(e))}function jo(e){for(let t=2;t<e;t++)if(e%t===0)return !1;return e>1}var He=6;function Ho(e=0,t=1,n){He=((n??He)*9301+49297)%233280;let r=He/233280;return t+r*(e-t)}function jn(e=""){let[t="",n="asc"]=e.split(" ");return n=n.toLowerCase(),{field:t,orderby:n,asc:n!=="desc",desc:n==="desc"}}function Go(e,t=!0){return `${e} ${t?"asc":"desc"}`}function ze(e,t,n=!0){let r=e||0,o=t||0;return r>o?n?1:-1:r<o?n?-1:1:0}function qo(e,...t){if(t.length>0){let n=t.map(jn),r=Array.from(e);return r.sort((o,i)=>{for(let{field:s,asc:u}of n){let a=ze(o[s],i[s],u);if(a!==0)return a}return 0}),r}return e}function Ge(e){return e.filter((t,n)=>e.indexOf(t)===n)}function Hn(e,t){return Ge(e.filter(n=>!t.includes(n)))}function zn(...e){return Ge(e.reduce((t=[],n)=>t.concat(n),[]))}function G(...e){return e.flat(Number.POSITIVE_INFINITY)}function Gn(e,t){return Ge(e).filter(n=>t.includes(n))}function Ko(e,t){return Hn(zn(e,t),Gn(e,t))}function vt(e,t){if(e&&Array.isArray(e)){let n;for(;(n=e.indexOf(t))!==-1;)e.splice(n,1);return e}return []}function Yo(e,t){return e.includes(t)||e.push(t),e}function qe(e,t){return e.splice(0,e.length,...e.filter(t)),e}function Xo(e,t){let n=e.findIndex(r=>r===t);return n>=0?e.splice(n,1):e.push(t),e}function Qo(e){return e.splice(0,e.length),e}function ei(e,t){return e.splice(0,e.length,...t),e}function qn(e,t=ze){return Array.from(e).sort(t)}function ti(e){return qn(e,(t,n)=>t-n)}function Wn(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Ct(e){return e.sort(()=>F()>.5?1:-1),e}function ni(e){return Ct(Array.from(e))}function ri(e){for(;e.length>1;){let t=Array.from(e);if(Ct(t),!Wn(e,t))return t}return e}function oi(e){return e[Math.floor(F()*e.length)]}function ii(...e){return G(e).reduce((t,n)=>t!=null?n>t?n:t:n,void 0)}function si(...e){return G(e).reduce((t,n)=>t!=null?n<t?n:t:n,void 0)}function ai(...e){return G(e).reduce((t,n)=>t+n,0)}function ui(...e){let t=G(e);return t.reduce((n,r)=>n+r,0)/t.length}function ci(e,t){let n=[],r=0,o=e.length;for(;r<o;)n.push(e.slice(r,r+=t));return n}function li(e=0,t){if(e<=0)return [];let n=Array.from({length:e});for(let r=0;r<e;r++)n[r]=t instanceof Function?t(r):t;return n}var Jn=(e,t)=>t instanceof Object&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,r)=>(n[r]=t[r],n),{}):t;function pi(e,t=void 0){return JSON.stringify(e,Jn,t)}function Zn(e,t){let n=[],r=[];return t==null&&(t=function(o,i){return n[0]===i?"[Circular ~]":`[Circular ~.${r.slice(0,n.indexOf(i)).join(".")}]`}),function(o,i){if(n.length>0){let s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?r.splice(s,Number.POSITIVE_INFINITY,o):r.push(o),~n.indexOf(i)&&(i=t?.call(this,o,i));}else n.push(i);try{return e==null?i:e.call(this,o,i)}catch{}return String(i)}}function k(e,t,n,r){return JSON.stringify(e,Zn(t??void 0,r),n??void 0)}var di=k;function Kn(e){let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=t.codePointAt(o)||0;return r}function Yn(e){let t=e.length,n="",r=0;for(;t>0;){let o=t<1e4?t:1e4,i=e.subarray(r,r+o);r+=o,n+=String.fromCodePoint.apply(null,i),t-=o;}return decodeURIComponent(escape(n))}var fe;function Ut(e){if(fe==null&&(fe=Kn,typeof TextEncoder<"u")){let t=new TextEncoder;fe=n=>t.encode(n);}return fe(e.normalize("NFC"))}var pe;function Dt(e){if(pe==null&&(pe=Yn,typeof TextDecoder<"u")){let t=new TextDecoder("utf-8",{ignoreBOM:!0});pe=n=>t.decode(n);}return pe(e).normalize("NFC")}function A(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Ut(e):e.length?new Uint8Array(e):e}function yi(...e){let t=0,n=e.flat(1).map(i=>{let s=A(i);return t+=s.length,s}),r=new Uint8Array(t),o=0;for(let i of n)r.set(i,o),o+=i.length;return r}function Et(e){if(typeof Buffer<"u")return Buffer.from(A(e)).toString("hex");let t="0123456789abcdef",n="";for(let r of [...A(e)])n+=t[r>>4]+t[r&15];return n}function Ft(e){return Uint8Array.from(e.match(/.{1,2}/g).map(t=>Number.parseInt(t,16)))}function ne(e,t=!1){let n=A(e),r="";if(typeof Buffer<"u")r=Buffer.from(n).toString("base64");else {let o="";for(let i=0;i<n.byteLength;i++)o+=String.fromCharCode(n[i]);r=btoa(o);}return t?r.replaceAll("=",""):r}function hi(e){let t=A(e);if(typeof Buffer<"u")return Buffer.from(t).toString("base64url").replaceAll("=","");let n="";for(let r=0;r<t.byteLength;r++)n+=String.fromCharCode(t[r]);return btoa(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function de(e){if(e=e.replaceAll("-","+").replaceAll("_","/"),typeof Buffer<"u"){let r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function bi(e){return Dt(de(e))}function Pt(e,t){if(e.byteLength!==t.byteLength)return !1;let n=A(e),r=A(t);for(let o=0;o<n.length;o++)if(n[o]!==r[o])return !1;return !0}function We(e){return Ut(k(e))}function Je(e){return JSON.parse(Dt(e))}function It(e,t){if(typeof e!="string")if(e instanceof ArrayBuffer&&e.byteLength!==void 0)e=String.fromCharCode.apply(String,[].slice.call(new Uint8Array(e)));else if(Array.isArray(e))e=String.fromCharCode.apply(String,e);else if(e.constructor===Uint8Array)e=String.fromCharCode.apply(String,[].slice.call(e));else return !1;t=t||16;let n=[],r="0123456789ABCDEF";for(let o=0;o<e.length;o+=t){let i=e.slice(o,Math.min(o+t,e.length)),s=`0000${o.toString(16)}`.slice(-4),u=i.split("").map(c=>{let f=c.charCodeAt(0);return ` ${r[(240&f)>>4]}${r[15&f]}`}).join("");u+=" ".repeat(t-i.length);let a=i.replace(/[\x00-\x1F\x20\x7F-\xA0\xAD]/g,".");a+=" ".repeat(t-i.length),n.push(`${s} ${u} ${a}`);}return n.join(`
|
|
2
|
+
`)}var Xn={2:"01",8:"01234567",11:"0123456789a",16:"0123456789abcdef",32:"0123456789abcdefghjkmnpqrtuvwxyz","32-crockford":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","32-geohash":"0123456789bcdefghjkmnpqrstuvwxyz","32-agnoster":"0123456789abcdefghjkmnpqrtuvwxyz","32-rfc":"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567","32-hex":"0123456789ABCDEFGHIJKLMNOPQRSTUV","32-zbase":"ybndrfg8ejkmcpqxot1uwisza345h769",36:"0123456789abcdefghijklmnopqrstuvwxyz",58:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",62:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","64-url":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",66:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~",85:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"};function Qn(e){let t=Xn[String(e)];if(!t)if(typeof e=="string")t=e;else throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let n=new Uint8Array(256);for(let c=0;c<n.length;c++)n[c]=255;for(let c=0;c<t.length;c++){let f=t.charAt(c),l=f.charCodeAt(0);if(n[l]!==255)throw new TypeError(`${f} is ambiguous`);n[l]=c;}let r=t.length,o=t.charAt(0),i=Math.log(r)/Math.log(256),s=Math.log(256)/Math.log(r);function u(c,f=-1){let l=A(c);if(l.byteLength===0)return "";let g=0,d=0,p=l.byteLength;for(;d!==p&&l[d]===0;)d++;let b=(p-d)*s+1>>>0,w=new Uint8Array(b);for(;d!==p;){let D=l[d],B=0;for(let h=b-1;(D!==0||B<g)&&h!==-1;h--,B++)D+=256*w[h]>>>0,w[h]=D%r>>>0,D=D/r>>>0;if(D!==0)throw new Error("Non-zero carry");g=B,d++;}let m=b-g;for(;m!==b&&w[m]===0;)m++;let T="";for(;m<b;++m)T+=t.charAt(w[m]);return f>0?T.padStart(f,o):T}function a(c,f=-1){if(typeof c!="string")throw new TypeError("Expected String");if(c.length===0)return new Uint8Array;c=c.replace(/\s+/gi,"");let l=0,g=0;for(;c[l]===o;)l++;let d=(c.length-l)*i+1>>>0,p=new Uint8Array(d);for(;c[l];){let w=n[c.charCodeAt(l)];if(w===255)throw new Error(`Unsupported character "${c[l]}"`);let m=0;for(let T=d-1;(w!==0||m<g)&&T!==-1;T--,m++)w+=r*p[T]>>>0,p[T]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");g=m,l++;}let b=d-g;for(;b!==d&&p[b]===0;)b++;return f>0?new Uint8Array([...new Uint8Array(f-p.length+b),...p.slice(b)]):p.slice(b)}return {encode:u,decode:a}}var ge;function $(e){ge==null&&(ge=new Map);function t(){let o=ge.get(e);return o==null&&(o=Qn(e),ge.set(e,o)),o}function n(o,i=-1){return t().encode(o,i)}function r(o,i=-1){return t().decode(o,i)}return {encode:n,decode:r}}function Ze(e,t=-1){return $(32).encode(e,t)}function St(e,t=-1){return $(32).decode(e.toLocaleLowerCase().replaceAll("l","1").replaceAll("s","5").replaceAll("o","0").replaceAll("i","1"),t)}function Ti(e,t=-1){return $(16).encode(e,t)}function Li(e,t=-1){return $(16).decode(e,t)}function Ai(e,t=-1){return $(58).encode(e,t)}function vi(e,t=-1){return $(58).decode(e,t)}function Ke(e,t=-1){return $(62).encode(e,t)}function kt(e,t=-1){return $(62).decode(e,t)}function Ci(e,t){return Math.ceil(e*(Math.log(256)/Math.log(t)))}function Di(e){return e.length>0&&(/^[A-Z0-9_\-\ ]*$/g.test(e)&&(e=e.toLowerCase()),e=e.replace(/^[-_\ ]+/gi,"").replace(/[-_\ ]+$/gi,"").replace(/[-_\ ]+([a-z0-9])/gi,(t,n)=>n.toUpperCase()),e=e[0].toLowerCase()+e.substring(1)),e}function er(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}function Ei(e){return e.replace(/\w\S*/g,er)}function Fi(e,t="-"){return t=typeof t>"u"?"_":t,e.replace(/([a-z\d])([A-Z])/g,`$1${t}$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1${t}$2`).toLowerCase()}var Rt=["1","true","yes","y","on"];function Si(e,t=!1){return e==null||typeof e!="string"?t:Rt.includes(String(e).trim().toLowerCase())}function ki(e,t=0){return e==null||typeof e!="string"?t:Number.parseInt(e.trim(),10)??t}function Ri(e,t=0){return e==null||typeof e!="string"?t:Number.parseFloat(e.trim())??t}function tr(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:Rt.includes(String(e).trim().toLowerCase())}function nr(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):Number.parseInt(String(e).trim(),10)??t}function rr(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):Number.parseFloat(String(e).trim())??t}function Ye(e,t=""){return e==null?t:String(e)??t}var Mi=rr,Bi=nr,Oi=Ye,_i=tr;function or(e,t={}){let{trace:n=!0,pretty:r=!0}=t;return e.map(o=>{if(o&&typeof o=="object"){if(r&&(o instanceof Uint8Array||o instanceof ArrayBuffer))return `
|
|
3
|
+
${It(o)}
|
|
4
4
|
`;if(o instanceof Error)return n?`${o.name||"Error"}: ${o.message}
|
|
5
|
-
${o.stack}`:`${o.name||"Error"}: ${o.message}`;try{return r?JSON.stringify(o,null,2):JSON.stringify(o)}catch{}}return String(o)})}function $i(e,t={}){return or(e,t).join(" ")}function Vi(e){try{return decodeURIComponent(escape(e))}catch{}return e}function Hi(e){if(e.startsWith("data:"))return de(e.split(",",2)[1])}function zi(e){if(e.startsWith("data:"))return e.slice(5).split(",",2)[0]}function Gi(e){if(e.startsWith("data:")){let[t,n]=e.slice(5).split(",",2);return new Blob([de(n)],{type:t})}}async function qi(e){let t=await e.arrayBuffer();if(t)return `data:${e.type},${ne(t)}`}function Wi(e,t="application/octet-stream"){return `data:${t},${ne(e)}`}function Mt(){let e,t;return [new Promise((r,o)=>{e=r,t=o;}),e,t]}async function Zi(e){return new Promise(t=>setTimeout(t,e))}async function Yi(){return new Promise(e=>setTimeout(e,0))}async function Ki(e,t,n="timeoutReached"){return new Promise(async(r,o)=>{let i=!1,s=setTimeout(()=>{i=!0,r(n);},t);try{let a=await e;clearTimeout(s),i||r(a);}catch(a){clearTimeout(s),i||o(a);}})}function Xi(e){return e==="timeoutReached"||e?.name==="Timeout reached"}async function Bt(e,t){return t<=0?await e:new Promise(async(n,r)=>{let o=!1,i=setTimeout(()=>{o=!0,r(new Error("Timeout reached"));},t);try{let s=await e;clearTimeout(i),o||n(s);}catch(s){clearTimeout(i),o||r(s);}})}function Qi(e,t,n=1e3){return new Promise((r,o)=>{let i=u=>{a&&(clearTimeout(a),s(),r(u));},s=()=>{a=null,e.off?e.off(t,i):e.removeEventListener&&e.removeEventListener(t,i);},a=setTimeout(()=>{s(),o(new Error("Did not response in time"));},n);e.on?e.on(t,i):e.addEventListener&&e.addEventListener(t,i);})}function P(e){return !!(e&&(e instanceof Promise||typeof e.then=="function"))}function V(e){return Promise.resolve(e)}var Ot=864e5;function Qe(e){return Math.floor(e/1e4)}function _t(e){return Math.floor(e/100%100)}function ir(e){return Math.floor(e%100)}function ts(e){return [Qe(e),_t(e),ir(e)]}function $t(e,t=!1){return t?new Date(`${ar(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}function Vt(){return ye(new Date)}function ns(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return Nt(e);if(Array.isArray(e)&&e.length===3){let[n,r,o]=e;return et(n,r,o)}else if(e instanceof Date)return ye(e,t)}function rs(e){return $t(e,!0)}function ye(e,t=!1){return t?Nt(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}function os(e){return ye(e,!0)}function Xe(e,t=!0){return $t(e,t).getTime()}function sr(e,t=!0){return ye(new Date(e),t)}function ar(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}function et(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}function Nt(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return +t}function is(e,t=0){let n=Qe(e),r=_t(e);return t!==0&&(r+=t,n+=Math.floor((r-1)/12),r=Math.floor((r-1)%12)+1,r===0&&(r=12)),et(n,r,1)}function ss(e,t=0){let n=Qe(e);return et(n+t,1,1)}function me(e,t){return sr(Xe(e)+t*864e5)}function as(e,t){return Math.round((Xe(t)-Xe(e))/864e5)}function us(e,t){let n=[];for(t==null&&(t=Vt()),e<0&&(e=me(t,e+1));e<=t;)n.push(e),e=me(e,1);return n}function*cs(e,t){let n=[];for(t==null&&(t=Vt()),e<0&&(e=me(t,e+1));e<=t;)yield e,e=me(e,1);return n}var N=class e{get value(){return this.days}constructor(t){if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=e.from(t)?.days),t==null){let n=new Date;this.days=n.getFullYear()*1e4+(n.getMonth()+1)*100+n.getDate();}else this.days=t;}static fromNumber(t){return new e(t)}static fromString(t){return e.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,n=!1){return n?e.fromString(t.toISOString().substr(0,10)):e.from(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return e.fromDate(t,!0)}static from(t,n=!1){if(typeof t=="number")return t<100?void 0:new e(t);if(typeof t=="string")return e.fromString(t);if(Array.isArray(t)&&t.length===3){let[r,o=1,i=1]=t;return o<1||o>12||i<1||i>31?void 0:new e(r*1e4+o*100+i)}else {if(t instanceof Date)return e.fromDate(t,n);if(t instanceof e)return t}}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let n=String(this.days);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}toDate(t=!1){return t?new Date(`${this.toString()}T00:00:00.000Z`):new Date(this.days/1e4,this.days/100%100-1,this.days%100)}toDateGMT(){return this.toDate(!0)}get year(){return Math.floor(this.days/1e4)}get month(){return Math.floor(this.days/100%100)}get day(){return Math.floor(this.days%100)}dayOffset(t){return e.fromDateGMT(new Date(this.toDateGMT().getTime()+t*864e5))}monthStart(){return e.from([this.year,this.month,1])}yearStart(){return e.from([this.year,1,1])}monthOffset(t){let n=this.month+t,r=Math.floor((n-1)%12)+1;r===0&&(r=12);let o=Math.floor((n-1)/12);return e.from([this.year+o,r,this.day])}daysUntil(t){return Math.round((new e(t)?.toDateGMT().getTime()-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};async function ps(e,t,n){let r=N.from(e),o=N.from(t);for(;r&&o&&r?.days<=o?.days;){let i=n(r);P(i)&&await i,r=r.dayOffset(1);}}function ds(){return new N}function gs(e){return new N(e)}function ms(e){return N.fromDate(new Date(e)).days}function ur(e,t=2){return +(+e).toFixed(t)}function hs(e,t=2){return +(+e/10**t).toFixed(t)}function bs(e,t=2){return Math.round(+e*10**t)}function xs(e,t=2){return t*(ur(e,t)%1)}function Ls(e,t,n){let r=e[t];return r===void 0&&(r=n(t,e),e[t]=r),r}async function As(e,t,n){let r=e[t];return r===void 0&&(r=await n(t,e),e[t]=r),r}function jt(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}function vs(e){return e!=null&&e.length>0?e[0]:void 0}function Cs(e){return e!=null&&e.length>0?e[e.length-1]:void 0}function Us(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:e?.size!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.warn("Failed to check if empty for",e,t);}return !0}function tt(e){return Object(e)!==e?e:JSON.parse(S(e))}function Ds(e){return Object(e)!==e?e:JSON.parse(S(e))}function Es(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.set(n,r),r}}function Fs(e){let t=new Map;return async(...n)=>{let r=S(n);if(t.has(r))return t.get(r);let o=await e(...n);return t.set(r,o),o}}function Ps(e,t){let n=[];for(let r=0;r<e;r++)n.push(t(r,e));return n}function M(e){return e!=null&&typeof e=="object"}function nt(e){return Object(e)!==e}function O(e){return Array.isArray(e)}function he(e){return M(e)&&!O(e)}function Ss(e){return e?.constructor===Object}function be(e){return typeof e=="string"}function Ht(e){return typeof e=="number"&&!Number.isNaN(e)}function Rs(e){return Ht(e)&&Number.isInteger(e)}function Ms(e){return Ht(e)&&Number.isSafeInteger(e)}function zt(e){return typeof e=="boolean"}function Bs(e){return e==null}function Os(e){return e==null}function _s(e){return M(e)&&e.constructor.name==="Uint8Array"}function $s(e){return e!=null}function cr(e){return e==null||e===""||M(e)&&jt(e)<=0}function Vs(e){return !cr(e)}function Ns(e){return e!=null&&e!==!1&&e!==!0}function js(e){return e!=null&&e!==!1&&e!==0&&e!==""}function lr(e,t,n=new WeakSet){if(e===t)return !0;if(n.has(t)||(nt(t)||n.add(t),!(e instanceof Object)||!(t instanceof Object))||e.constructor!==t.constructor||e.length!==t.length)return !1;for(let r in e){if(!e.hasOwnProperty(r))continue;if(!t.hasOwnProperty(r))return !1;let o=e[r],i=t[r];if(!lr(o,i,n))return !1}for(let r in t)if(t.hasOwnProperty(r)&&!e.hasOwnProperty(r))return !1;return !0}function fr(e,t=new WeakSet){if(t.has(e))return "[Circular ~]";if(nt(e)||t.add(e),he(e)){for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===void 0){delete e[n];continue}fr(e[n],t);}}else if(O(e))for(let n=e.length-1;n>=0;n--)e[n]===void 0&&e.splice(n,1);return e}function xe(e,...t){for(let n of t)M(e)||(e={}),!(n==null||!M(n))&&Object.keys(n).forEach(r=>{let o=e[r],i=n[r];Array.isArray(o)&&Array.isArray(i)?e[r]=o.concat(i):M(o)&&M(i)?e[r]=xe(Object.assign({},o),i):e[r]=i;});return e}function pr(e,t,n={cyclesFix:!0},r=[]){let o=[],i=Array.isArray(e);for(let a in e){let u=e[a],c=i?+a:a;if(!(a in t)){o.push({type:"del",path:[c]});continue}let f=t[a],l=typeof u=="object"&&typeof f=="object";if(u&&f&&l&&!["Date","RegExp","String","Number"].includes(Object.getPrototypeOf(u).constructor.name)&&(!n.cyclesFix||!r.includes(u))){let m=pr(u,f,n,n.cyclesFix?r.concat([u]):[]);o=[...o,...m.map(d=>(d.path.unshift(c),d))];}else u!==f&&!(l&&(Number.isNaN(u)?`${u}`==`${f}`:+u==+f))&&o.push({path:[c],type:"upd",value:f});}let s=Array.isArray(t);for(let a in t)a in e||o.push({type:"new",path:[s?+a:a],value:t[a]});return o}function Gt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")}function Ws(e){return e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&")}function Zs(e,t,n=[]){return e.filter(r=>!t.some(o=>!o(r))).map(r=>{for(let o of n)r=o(r);return r}).filter(r=>r!=null)}function Ys(e,t){return e.reduce((n,r)=>{let o=String(r[t]);return (n[o]=n[o]||[]).push(r),n},{})}function Ks(e,t){return Array.from(e.reduce((n,r)=>n.add(r[t]),new Set))}function Xs(e,t){return e.map(n=>n[t])}function ta(e,t){return M(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>{let o=t(n,r);return O(o)&&o.length===2?o:[n,o]}).filter(n=>n!=null)):{}}function na(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}function ra(e){return Object.keys(e).length<=0}var dr=/[\\\-\[\]\/{}()*+?.^$|]/g;function we(e){return e?e instanceof RegExp?e.source:e.replace(dr,"\\$&"):""}var gr=100,mr=/^\.+/,yr=/\.+$/,hr=/[<>:\"/\\|?*\u0000-\u001F\u0080-\u009F]+/gm;function qt(){return hr}function br(){return /^(con|prn|aux|nul|com\d|lpt\d)$/i}function aa(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(qt().test(t))throw new Error("Replacement string cannot contain reserved filename characters");let n=`(${we(t)})+`;return e=e.replace(qt(),t).replace(mr,t).replace(yr,"").replace(new RegExp(n,"gm"),t).trim(),e=br().test(e)?e+t:e,e.slice(0,gr)}function re(e){return Math.abs(e)%1===.5}function Wt(e){return e%2===0}var ca=e=>Math.ceil(e),la=e=>Math.floor(e),fa=e=>Math.round(e),pa=e=>{let t=Math.round(e);return re(e)&&Wt(t)?t-1:t},da=e=>re(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),ga=e=>re(e)?Math.floor(e):Math.round(e),ma=e=>{let t=Math.round(e);return re(e)?Wt(t)?t:t-1:t},ya=e=>re(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e);function Jt(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-D()}function Zt(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+D()}function xa(e,t,n){let r=n.length,o=e<t;if(r<=0||e>=r-1)return Zt(n);if(e<=0)return Jt(n);n=xr([...n]);let i=o?-1:0,s=n[e+i].sort_weight||0,u=(n[e+i+1].sort_weight||0)-s;if(u===0)return o?Jt(n):Zt(n);let c=s+u/2,f=u*.01*(D()-.5);return c+f}function xr(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}function La(e={}){let{getter:t=a=>a.sort}=e;function n(a){return a.sort((u,c)=>(t(u)||0)-(t(c)||0)),a}function r(a){return a.reduce((u,c)=>Math.min(u,t(c)||0),0)-1-D()}function o(a){return a.reduce((u,c)=>Math.max(u,t(c)||0),0)+1+D()}function i(a,u){a==null&&(a=(u??0)-1),u==null&&(u=(a??0)+1);let c=u-a,f=a+c/2,l=c*.01*(D()-.5);return f+l}function s(a,u,c){let f=c.length,l=a<u;if(f<=0||a>=f-1)return o(c);if(a<=0)return r(c);c=n([...c]);let m=l?-1:0,d=t(c[a+m])||0,b=(t(c[a+m+1])||0)-d;if(b===0)return l?r(c):o(c);let w=d+b/2,g=b*.01*(D()-.5);return w+g}return {start:r,end:o,between:i,move:s,items:n}}function wr(e){return t=>e?.[t]}var Tr={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Lr=wr(Tr),Ar=/[\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0100-\u017F]/g,vr="\\u0300-\\u036f",Cr="\\ufe20-\\ufe2f",Ur="\\u20d0-\\u20ff",Dr="\\u1ab0-\\u1aff",Er="\\u1dc0-\\u1dff",Fr=vr+Cr+Ur+Dr+Er,Pr=`[${Fr}]`,kr=RegExp(Pr,"g");function Yt(e){return e&&e.replace(Ar,Lr).replace(kr,"")}var Ir=/((?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00A1-\uFFFF][a-z0-9\u00A1-\uFFFF_-]{0,62})?[a-z0-9\u00A1-\uFFFF]\.)+(?:[a-z\u00A1-\uFFFF]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?)/gim;function Ua(e){return e.split(Ir).map((t,n)=>{let r=Gt(t);return n%2?`<a target="_blank" href="${r}">${Sr(r)}</a>`:r}).join("")}function Sr(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}function Kt(e,t){let n=[];for(let[r,o]of Object.entries(e))if(o!=null){Array.isArray(o)||(o=[o]);for(let i of o)t&&!t(i)||i!=null&&n.push(`${encodeURIComponent(r)}=${encodeURIComponent(String(i))}`);}return n.join("&")}function Da(e){let t={},n=(e[0]==="?"?e.substr(1):e).split("&");for(let r=0;r<n.length;r++){let o=n[r].split("="),i=decodeURIComponent(o[0]),s=decodeURIComponent(o[1]||"");t[i]!=null?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(s)):t[i]=s;}return t}var Xt=["aardvark","absurd","accrue","acme","adrift","adult","afflict","ahead","aimless","Algol","allow","alone","ammo","ancient","apple","artist","assume","Athens","atlas","Aztec","baboon","backfield","backward","basalt","beaming","bedlamp","beehive","beeswax","befriend","Belfast","berserk","billiard","bison","blackjack","blockade","blowtorch","bluebird","bombast","bookshelf","brackish","breadline","breakup","brickyard","briefcase","Burbank","button","buzzard","cement","chairlift","chatter","checkup","chisel","choking","chopper","Christmas","clamshell","classic","classroom","cleanup","clockwork","cobra","commence","concert","cowbell","crackdown","cranky","crowfoot","crucial","crumpled","crusade","cubic","deadbolt","deckhand","dogsled","dosage","dragnet","drainage","dreadful","drifter","dropper","drumbeat","drunken","Dupont","dwelling","eating","edict","egghead","eightball","endorse","endow","enlist","erase","escape","exceed","eyeglass","eyetooth","facial","fallout","flagpole","flatfoot","flytrap","fracture","fragile","framework","freedom","frighten","gazelle","Geiger","Glasgow","glitter","glucose","goggles","goldfish","gremlin","guidance","hamlet","highchair","hockey","hotdog","indoors","indulge","inverse","involve","island","Janus","jawbone","keyboard","kickoff","kiwi","klaxon","lockup","merit","minnow","miser","Mohawk","mural","music","Neptune","newborn","nightbird","obtuse","offload","oilfield","optic","orca","payday","peachy","pheasant","physique","playhouse","Pluto","preclude","prefer","preshrunk","printer","profile","prowler","pupil","puppy","python","quadrant","quiver","quota","ragtime","ratchet","rebirth","reform","regain","reindeer","rematch","repay","retouch","revenge","reward","rhythm","ringbolt","robust","rocker","ruffled","sawdust","scallion","scenic","scorecard","Scotland","seabird","select","sentence","shadow","showgirl","skullcap","skydive","slingshot","slothful","slowdown","snapline","snapshot","snowcap","snowslide","solo","spaniel","spearhead","spellbind","spheroid","spigot","spindle","spoilage","spyglass","stagehand","stagnate","stairway","standard","stapler","steamship","stepchild","sterling","stockman","stopwatch","stormy","sugar","surmount","suspense","swelter","tactics","talon","tapeworm","tempest","tiger","tissue","tonic","tracker","transit","trauma","treadmill","Trojan","trouble","tumor","tunnel","tycoon","umpire","uncut","unearth","unwind","uproot","upset","upshot","vapor","village","virus","Vulcan","waffle","wallet","watchword","wayside","willow","woodlark","Zulu"],Qt=["adroitness","adviser","aggregate","alkali","almighty","amulet","amusement","antenna","applicant","Apollo","armistice","article","asteroid","Atlantic","atmosphere","autopsy","Babylon","backwater","barbecue","belowground","bifocals","bodyguard","borderline","bottomless","Bradbury","Brazilian","breakaway","Burlington","businessman","butterfat","Camelot","candidate","cannonball","Capricorn","caravan","caretaker","celebrate","cellulose","certify","chambermaid","Cherokee","Chicago","clergyman","coherence","combustion","commando","company","component","concurrent","confidence","conformist","congregate","consensus","consulting","corporate","corrosion","councilman","crossover","cumbersome","customer","Dakota","decadence","December","decimal","designing","detector","detergent","determine","dictator","dinosaur","direction","disable","disbelief","disruptive","distortion","divisive","document","embezzle","enchanting","enrollment","enterprise","equation","equipment","escapade","Eskimo","everyday","examine","existence","exodus","fascinate","filament","finicky","forever","fortitude","frequency","gadgetry","Galveston","getaway","glossary","gossamer","graduate","gravity","guitarist","hamburger","Hamilton","handiwork","hazardous","headwaters","hemisphere","hesitate","hideaway","holiness","hurricane","hydraulic","impartial","impetus","inception","indigo","inertia","infancy","inferno","informant","insincere","insurgent","integrate","intention","inventive","Istanbul","Jamaica","Jupiter","leprosy","letterhead","liberty","maritime","matchmaker","maverick","Medusa","megaton","microscope","microwave","midsummer","millionaire","miracle","misnomer","molasses","molecule","Montana","monument","mosquito","narrative","nebula","newsletter","Norwegian","October","Ohio","onlooker","opulent","Orlando","outfielder","Pacific","pandemic","pandora","paperweight","paragon","paragraph","paramount","passenger","pedigree","Pegasus","penetrate","perceptive","performance","pharmacy","phonetic","photograph","pioneer","pocketful","politeness","positive","potato","processor","prophecy","provincial","proximate","puberty","publisher","pyramid","quantity","racketeer","rebellion","recipe","recover","repellent","replica","reproduce","resistor","responsive","retraction","retrieval","retrospect","revenue","revival","revolver","Sahara","sandalwood","sardonic","Saturday","savagery","scavenger","sensation","sociable","souvenir","specialist","speculate","stethoscope","stupendous","supportive","surrender","suspicious","sympathy","tambourine","telephone","therapist","tobacco","tolerance","tomorrow","torpedo","tradition","travesty","trombonist","truncated","typewriter","ultimate","undaunted","underfoot","unicorn","unify","universe","unravel","upcoming","vacancy","vagabond","versatile","vertigo","Virginia","visitor","vocalist","voyager","warranty","Waterloo","whimsical","Wichita","Wilmington","Wyoming","yesteryear","Yucatan"];function ka(e,t=" ",n=" "){return Array.from(e).map((r,o)=>o%2?Qt[r]+n:Xt[r]+t).join("").slice(0,-(e.length%2?t:n).length)}function Ia(e){return A(e.map((t,n)=>(n%2?Qt:Xt).findIndex(r=>r.toLocaleLowerCase()===Yt(t).toLocaleLowerCase().trim())))}var Rr=/\\\s|\s+|#[^\n]*\n?/gm,Mr=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,en=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm;function Br(e){return typeof e=="string"?e:e.source||""}function Ra(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}var tn=class{constructor(t,n){this.namedGroups={};this.names=[];let r=n??"",o;if(t instanceof RegExp?(n==null&&(r=t.flags),o=t.source):o=t,r&&r.includes("x")&&(r=r.replace("x",""),o=o.replace(Rr,a=>a[0]==="\\"?a:"")),!(t instanceof RegExp)){let a=0;o=o.replace(Mr,(u,c)=>(a+=1,c?(c!=="index"&&c!=="length"&&!this.namedGroups[c]&&(this.namedGroups[c]=a),"("):u)),this.names=Object.keys(this.namedGroups);}o=Br(o),en.lastIndex=0;let s=en.exec(o);s&&(this.lookBehind={rx:new RegExp(`${s[3]}$(?!\\s)`),expect:s?s[2]==="=":!s},o=o.substr(s[0].length)),this.rx=new RegExp(o,r);}get lastIndex(){return this.rx.lastIndex}set lastIndex(t){this.rx.lastIndex=t;}_handleMatch(t){if(this.lookBehind){let n=t.input.slice(0,t.index);if(this.lookBehind.expect!==this.lookBehind.rx.test(n))return null}for(let n of this.names)t[n]=t[this.namedGroups[n]];return t}exec(t){let n;for(;n=this.rx.exec(t);)if(this.rx.lastIndex===n.index&&this.rx.lastIndex++,n=this._handleMatch(n),n!=null)return n}execAll(t){let n=[],r;for(this.rx.lastIndex=0;r=this.exec(t);)n.push(r);return this.rx.lastIndex=0,n}replace(t,n){let r=typeof n=="function"?n:()=>n;return t.replace(this.rx,o=>r(o))}};function Or(e){return e===!0||e==="true"||e==="1"||typeof e=="number"&&e!==0?e="*":e===!1||e==="false"||e===0||e==="0"||e==null||e==="null"||e==="undefined"?e="":e=String(e),e}function _r(){return Or(typeof process<"u"?process.env.ZEED??process.env.DEBUG:typeof localStorage<"u"?localStorage.zeed??localStorage.debug:"*")}function q(e=_r()){let t,n=[],r=[];if(!e)t=function(o){return !1};else if(e==="*")t=function(o){return !0};else {let o,i=e.split(/[\s,]+/),s=i.length;for(o=0;o<s;o++){if(!i[o])continue;let a=i[o].replace(/\*/g,".*?");a[0]==="-"?n.push(new RegExp(`^${a.substr(1)}`)):r.push(new RegExp(`^${a}`));}t=function(a){if(n.length===0&&r.length===0)return !0;let u,c;for(u=0,c=n.length;u<c;u++)if(n[u].test(a))return !1;for(u=0,c=r.length;u<c;u++)if(r[u].test(a))return !0;return !1};}return t.accept=r,t.reject=n,t.filter=e,t}function $r(){return typeof process<"u"?process.env.ZEED_LEVEL??process.env.LEVEL??process.env.DEBUG_LEVEL:typeof localStorage<"u"?localStorage.zeed_level??localStorage.level??localStorage.debug_level:void 0}function rt(e){if(e===!1)return 9007199254740991;if(typeof e=="number")return e;if(typeof e=="string"){let t=At[e.toLocaleLowerCase().trim()];if(t!=null)return t}return -1}function Te(e=$r()){let t=rt(e);return n=>n>=t}function oe(...e){return be(e[1])?[`${String(e[0])} ${String(e[1])}`,...e.slice(2)]:e}function Le(e={}){let{level:t=void 0,filter:n=void 0}=e,r=q(n),o=Te(t);return i=>{if(!o(i.level)||!r(i.name))return;let s=i.name?`[${i.name}]`:"";switch(i.level){case 1:console.info(...oe(`I|* ${s}`,...i.messages));break;case 2:console.warn(...oe(`W|** ${s}`,...i.messages));break;case 3:console.error(...oe(`E|*** ${s}`,...i.messages));break;default:console.debug(...oe(`D| ${s}`,...i.messages));break}}}function nn(e=""){let t=[Le()],n=u=>!0,r=!1,o=s,i=!1;function s(u="",c){let f=rt(c??-1);function l(p,b){return f<=p?b:()=>{}}let m=p=>{if(n(u))for(let b of t)b&&b(p);},d=l(0,(...p)=>{m({name:u,messages:p,level:0});});return d.label=u,d.extend=function(p){return o(u?`${u}:${p}`:p)},d.debug=l(0,(...p)=>{m({name:u,messages:p,level:0});}),d.info=l(1,(...p)=>{m({name:u,messages:p,level:1});}),d.warn=l(2,(...p)=>{m({name:u,messages:p,level:2});}),d.error=l(3,(...p)=>{m({name:u,messages:p,level:3});}),d.fatal=l(4,(...p)=>{throw m({name:u,messages:p,level:4}),new Error(`${p.map(String).join(" ")}`)}),d.assert=l(4,(p,...b)=>{(p==null||typeof p=="number"&&Number.isNaN(p)||!p)&&d.fatal(...b);}),d}function a(u="",c){let f=o(u,c);return i&&f.debug(`+++ init of logger "${u}" on level "${f.level}".`),f}return a.registerHandler=function(u){t.push(u);},a.setFilter=function(u){n=q(u);},a.setLock=(u=!0)=>r=u,a.setDebug=(u=!0)=>i=u,a.setHandlers=function(u=[]){o!==s&&(o=s),!r&&(t=[...u].filter(c=>typeof c=="function"));},a.level=-1,a.setLogLevel=function(u=-1){r||(a.level=u);},a.setFactory=function(u){r||(o=u);},a}var _;function ot(e){let t=nn();return e?e(t):t.setHandlers([Le()]),t}function Vr(e){if(_==null)try{let t=z();t!=null?t?.logger==null?(_=ot(e),t.logger=_):_=t.logger:_=ot(e);}catch{_=ot(e);}return _}function rn(){if(_!=null)return _;try{let e=z();if(e?.logger!=null)return e.logger}catch{}}function k(e,t){return Vr()(e,t)}var on=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ja(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return on[Math.abs(t)%on.length]}function Ae(){return Date.now()}function Nr(e){return e>999?`${(e/1e3).toFixed(1)} s`:`${e.toFixed(2)} ms`}function Ya(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let n=null;if(t.includes(":"))try{n=new Date(t);}catch{}if(!(n instanceof Date)){let r=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);r&&(n=new Date(+r[1],+r[2]-1,+r[3],12,0));}if(n instanceof Date)return n}}}function sn(){return typeof performance<"u"?performance.now():Date.now()}function Ka(){let e=sn();return function(){let t=sn()-e;return Nr(t)}}function tu(e){let{level:t=void 0,filter:n=void 0,messages:r=[]}=e,o=q(n),i=Te(t);return s=>{i(s.level)&&o(s.name)&&(s.timestamp=Ae(),r.push(s));}}function jr(...e){throw rn()?.("assert")?.fatal(...e),new Error(`${e.map(String).join(" ")}`)}function Hr(e,...t){(e==null||typeof e=="number"&&Number.isNaN(e)||!e)&&jr(...t);}function an(e,...t){Hr(e,...t);}function ie(e,t,n){return new Uint8Array(e,t,n)}var W;function cn(){return W===void 0&&(W=(typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}))??null,W&&W.decode(new Uint8Array).length===1&&(W=null)),W}var it=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[];}};function Ee(){return new it}function st(e){let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t}function Fe(e){let t=new Uint8Array(st(e)),n=0;for(let r=0;r<e.bufs.length;r++){let o=e.bufs[r];t.set(o,n),n+=o.length;}return t.set(ie(e.cbuf.buffer,0,e.cpos),n),t}function qr(e,t){let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(ie(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Math.max(n,t)*2),e.cpos=0);}function C(e,t){let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t;}var dn=C;function gn(e,t){C(e,t&255),C(e,t>>>8&255);}function mn(e,t){for(let n=0;n<4;n++)C(e,t&255),t>>>=8;}function j(e,t){for(;t>127;)C(e,128|127&t),t=Math.floor(t/128);C(e,127&t);}function Wr(e){return e!==0?e<0:1/e<0}function at(e,t){let n=Wr(t);for(n&&(t=-t),C(e,(t>63?128:0)|(n?64:0)|63&t),t=Math.floor(t/64);t>0;)C(e,(t>127?128:0)|127&t),t=Math.floor(t/128);}function Pe(e,t){let n=e.cbuf.length,r=e.cpos,o=Math.min(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Math.max(n*2,i)),e.cbuf.set(t.subarray(o)),e.cpos=i);}function ke(e,t){j(e,t.byteLength),Pe(e,t);}function Zr(e,t){let n=unescape(encodeURIComponent(t)),r=n.length;j(e,r);for(let o=0;o<r;o++)C(e,n.codePointAt(o));}function De(e,t){return Zr(e,t)}function ut(e,t){qr(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n}function ct(e,t){return ut(e,4).setFloat32(0,t,!1)}function Yr(e,t){return ut(e,8).setFloat64(0,t,!1)}function Kr(e,t){return ut(e,8).setBigInt64(0,t,!1)}var Ue;function Xr(e){return Ue==null&&(Ue=new DataView(new ArrayBuffer(4))),Ue.setFloat32(0,e),Ue.getFloat32(0)===e}function Z(e,t){switch(typeof t){case"string":C(e,119),De(e,t);break;case"number":Number.isInteger(t)&&Math.abs(t)<=2147483647?(C(e,125),at(e,t)):Xr(t)?(C(e,124),ct(e,t)):(C(e,123),Yr(e,t));break;case"bigint":C(e,122),Kr(e,t);break;case"object":if(t===null)C(e,126);else if(Array.isArray(t)){C(e,117),j(e,t.length);for(let n=0;n<t.length;n++)Z(e,t[n]);}else if(t instanceof Uint8Array)C(e,116),ke(e,t);else {C(e,118);let n=Object.keys(t);j(e,n.length);for(let r=0;r<n.length;r++){let o=n[r];De(e,o),Z(e,t[o]);}}break;case"boolean":C(e,t?120:121);break;default:C(e,127);}}var yn="Unexpected end of array",hn="Integer out of Range",lt=class{constructor(t){this.arr=t,this.pos=0;}};function Se(e){return new lt(e)}function ft(e,t){let n=ie(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n}function Y(e){let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let o=e.arr[e.pos++];if(t=t+(o&127)*n,n*=128,o<128)return t;if(t>Number.MAX_SAFE_INTEGER)throw new Error(hn)}throw new Error(yn)}function Re(e){return ft(e,Y(e))}function ue(e){return e.arr[e.pos++]}function bn(e){let t=e.arr[e.pos]+(e.arr[e.pos+1]<<8);return e.pos+=2,t}function xn(e){let t=e.arr[e.pos]+(e.arr[e.pos+1]<<8)+(e.arr[e.pos+2]<<16)+(e.arr[e.pos+3]<<24)>>>0;return e.pos+=4,t}function pt(e){let t=e.arr[e.pos++],n=t&63,r=64,o=(t&64)>0?-1:1;if(!(t&128))return o*n;let i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n=n+(t&127)*r,r*=128,t<128)return o*n;if(n>Number.MAX_SAFE_INTEGER)throw new Error(hn)}throw new Error(yn)}function Qr(e){let t=Y(e);if(t===0)return "";{let n=String.fromCodePoint(ue(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(ue(e));else for(;t>0;){let r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r;}return decodeURIComponent(escape(n))}}function Ie(e){let t=cn();return t?t.decode(Re(e)):Qr(e)}function dt(e,t){let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n}function gt(e){return dt(e,4).getFloat32(0,!1)}function eo(e){return dt(e,8).getFloat64(0,!1)}function to(e){return dt(e,8).getBigInt64(0,!1)}var no=[e=>{},e=>null,pt,gt,eo,to,e=>!1,e=>!0,Ie,e=>{let t=Y(e),n={};for(let r=0;r<t;r++){let o=Ie(e);n[o]=K(e);}return n},e=>{let t=Y(e),n=[];for(let r=0;r<t;r++)n.push(K(e));return n},Re];function K(e){return no[127-ue(e)](e)}var wn=class{async encode(t){let n=Ee();return Z(n,t),Fe(n)}async decode(t){return K(Se(A(t)))}};function wu(e){let t=Ee();return Z(t,e),Fe(t)}function Tu(e){return K(Se(A(e)))}function Lu(e){let t=Ee();return e!=null&&Pe(t,A(e)),{writeBytes:(n,r)=>{let o=A(n);an(!(r!=null&&o.length!==r),`Expected ${r} bytes, got ${o.length}`),Pe(t,o);},writeBytesVar:n=>ke(t,A(n)),writeUintVar:n=>j(t,n),writeUint8:n=>dn(t,n),writeUint16:n=>gn(t,n),writeUint32:n=>mn(t,n),writeIntVar:n=>at(t,n),writeFloat:n=>ct(t,n),writeStringVar:n=>De(t,n),write:n=>Z(t,n),getUint8Array:()=>Fe(t),getLength:()=>st(t)}}function Au(e){let t=Se(A(e));return {readBytes:n=>ft(t,n),readBytesVar:()=>Re(t),readUintVar:()=>Y(t),readUint8:()=>ue(t),readUint16:()=>bn(t),readUint32:()=>xn(t),readIntVar:()=>pt(t),readFloat:()=>gt(t),readStringVar:()=>Ie(t),read:()=>K(t),getOffset:()=>t.pos||0}}function vu(e=0){return {setBit:(t,n=!0)=>n?e|=1<<t:e&=~(1<<t),unsetBit:t=>e&=1<<t,toggleBit:t=>e^=1<<t,getBit:t=>(e&1<<t)!==0,getValue:()=>e}}async function ro(e){return await e.arrayBuffer()}async function Cu(e){let t=await ro(e);if(t!=null)return A(t)}function X(e=16){let t=new Uint8Array(e);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<e;n++)t[n]=Math.floor(Math.random()*256);return t}var Ln="SHA-256",mt="AES-GCM",Tn="PBKDF2",oo=1e5;async function Eu(e,t=Ln){return A(await crypto.subtle.digest(t,A(e)))}async function Fu(e,t={}){let n=A(e),r=await crypto.subtle.importKey("raw",n,Tn,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:Tn,salt:t.salt?A(t.salt):new Uint8Array(0),iterations:t.iterations??oo,hash:Ln},r,{name:mt,length:256},!0,["encrypt","decrypt"])}function An(){return new Uint8Array([1,1])}async function vn(e,t){let n=An(),r=X(12),o=await crypto.subtle.encrypt({name:mt,iv:r},t,e),i=new Uint8Array(o),s=n.length+r.length+i.length,a=new Uint8Array(s),u=0;return a.set(n,u),u+=n.length,a.set(r,u),u+=r.length,a.set(i,u),a}async function Cn(e,t){let n=e.subarray(0,2);if(!Pt(n,An()))return Promise.reject(new Error(`Unknown magic ${n}`));let r=e.subarray(2,14),o=e.subarray(14,e.length),i=await crypto.subtle.decrypt({name:mt,iv:r},t,o);return new Uint8Array(i)}var io=",";function Iu(e,t={}){let{separator:n=io}=t,r="";for(let o=0;o<e.length;o++)r+=`${e[o].map(i=>{if(i==null||i==="")return "";if(zt(i))return i?1:0;let s=String(i);return (he(i)||O(i))&&(s=S(i)),s.includes('"')||s.includes(`
|
|
5
|
+
${o.stack}`:`${o.name||"Error"}: ${o.message}`;try{return r?JSON.stringify(o,null,2):JSON.stringify(o)}catch{}}return String(o)})}function $i(e,t={}){return or(e,t).join(" ")}function Vi(e){try{return decodeURIComponent(escape(e))}catch{}return e}function Hi(e){if(e.startsWith("data:"))return de(e.split(",",2)[1])}function zi(e){if(e.startsWith("data:"))return e.slice(5).split(",",2)[0]}function Gi(e){if(e.startsWith("data:")){let[t,n]=e.slice(5).split(",",2);return new Blob([de(n)],{type:t})}}async function qi(e){let t=await e.arrayBuffer();if(t)return `data:${e.type},${ne(t)}`}function Wi(e,t="application/octet-stream"){return `data:${t},${ne(e)}`}function Mt(){let e,t;return [new Promise((r,o)=>{e=r,t=o;}),e,t]}async function Zi(e){return new Promise(t=>setTimeout(t,e))}async function Ki(){return new Promise(e=>setTimeout(e,0))}async function Yi(e,t,n="timeoutReached"){return new Promise(async(r,o)=>{let i=!1,s=setTimeout(()=>{i=!0,r(n);},t);try{let u=await e;clearTimeout(s),i||r(u);}catch(u){clearTimeout(s),i||o(u);}})}function Xi(e){return e==="timeoutReached"||e?.name==="Timeout reached"}async function Bt(e,t){return t<=0?await e:new Promise(async(n,r)=>{let o=!1,i=setTimeout(()=>{o=!0,r(new Error("Timeout reached"));},t);try{let s=await e;clearTimeout(i),o||n(s);}catch(s){clearTimeout(i),o||r(s);}})}function Qi(e,t,n=1e3){return new Promise((r,o)=>{let i=a=>{u&&(clearTimeout(u),s(),r(a));},s=()=>{u=null,e.off?e.off(t,i):e.removeEventListener&&e.removeEventListener(t,i);},u=setTimeout(()=>{s(),o(new Error("Did not response in time"));},n);e.on?e.on(t,i):e.addEventListener&&e.addEventListener(t,i);})}function P(e){return !!(e&&(e instanceof Promise||typeof e.then=="function"))}function V(e){return Promise.resolve(e)}var Ot=864e5;function Qe(e){return Math.floor(e/1e4)}function _t(e){return Math.floor(e/100%100)}function ir(e){return Math.floor(e%100)}function ts(e){return [Qe(e),_t(e),ir(e)]}function $t(e,t=!1){return t?new Date(`${ar(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}function Vt(){return ye(new Date)}function ns(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return Nt(e);if(Array.isArray(e)&&e.length===3){let[n,r,o]=e;return et(n,r,o)}else if(e instanceof Date)return ye(e,t)}function rs(e){return $t(e,!0)}function ye(e,t=!1){return t?Nt(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}function os(e){return ye(e,!0)}function Xe(e,t=!0){return $t(e,t).getTime()}function sr(e,t=!0){return ye(new Date(e),t)}function ar(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}function et(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}function Nt(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return +t}function is(e,t=0){let n=Qe(e),r=_t(e);return t!==0&&(r+=t,n+=Math.floor((r-1)/12),r=Math.floor((r-1)%12)+1,r===0&&(r=12)),et(n,r,1)}function ss(e,t=0){let n=Qe(e);return et(n+t,1,1)}function me(e,t){return sr(Xe(e)+t*864e5)}function as(e,t){return Math.round((Xe(t)-Xe(e))/864e5)}function us(e,t){let n=[];for(t==null&&(t=Vt()),e<0&&(e=me(t,e+1));e<=t;)n.push(e),e=me(e,1);return n}function*cs(e,t){let n=[];for(t==null&&(t=Vt()),e<0&&(e=me(t,e+1));e<=t;)yield e,e=me(e,1);return n}var N=class e{get value(){return this.days}constructor(t){if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=e.from(t)?.days),t==null){let n=new Date;this.days=n.getFullYear()*1e4+(n.getMonth()+1)*100+n.getDate();}else this.days=t;}static fromNumber(t){return new e(t)}static fromString(t){return e.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,n=!1){return n?e.fromString(t.toISOString().substr(0,10)):e.from(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return e.fromDate(t,!0)}static from(t,n=!1){if(typeof t=="number")return t<100?void 0:new e(t);if(typeof t=="string")return e.fromString(t);if(Array.isArray(t)&&t.length===3){let[r,o=1,i=1]=t;return o<1||o>12||i<1||i>31?void 0:new e(r*1e4+o*100+i)}else {if(t instanceof Date)return e.fromDate(t,n);if(t instanceof e)return t}}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let n=String(this.days);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}toDate(t=!1){return t?new Date(`${this.toString()}T00:00:00.000Z`):new Date(this.days/1e4,this.days/100%100-1,this.days%100)}toDateGMT(){return this.toDate(!0)}get year(){return Math.floor(this.days/1e4)}get month(){return Math.floor(this.days/100%100)}get day(){return Math.floor(this.days%100)}dayOffset(t){return e.fromDateGMT(new Date(this.toDateGMT().getTime()+t*864e5))}monthStart(){return e.from([this.year,this.month,1])}yearStart(){return e.from([this.year,1,1])}monthOffset(t){let n=this.month+t,r=Math.floor((n-1)%12)+1;r===0&&(r=12);let o=Math.floor((n-1)/12);return e.from([this.year+o,r,this.day])}daysUntil(t){return Math.round((new e(t)?.toDateGMT().getTime()-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};async function ps(e,t,n){let r=N.from(e),o=N.from(t);for(;r&&o&&r?.days<=o?.days;){let i=n(r);P(i)&&await i,r=r.dayOffset(1);}}function ds(){return new N}function gs(e){return new N(e)}function ms(e){return N.fromDate(new Date(e)).days}function ur(e,t=2){return +(+e).toFixed(t)}function hs(e,t=2){return +(+e/10**t).toFixed(t)}function bs(e,t=2){return Math.round(+e*10**t)}function xs(e,t=2){return t*(ur(e,t)%1)}function Ls(e,t,n){let r=e[t];return r===void 0&&(r=n(t,e),e[t]=r),r}async function As(e,t,n){let r=e[t];return r===void 0&&(r=await n(t,e),e[t]=r),r}function jt(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}function vs(e){return e!=null&&e.length>0?e[0]:void 0}function Cs(e){return e!=null&&e.length>0?e[e.length-1]:void 0}function Us(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:e?.size!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.warn("Failed to check if empty for",e,t);}return !0}function tt(e){return Object(e)!==e?e:JSON.parse(k(e))}function Ds(e){return Object(e)!==e?e:JSON.parse(k(e))}function Es(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.set(n,r),r}}function Fs(e){let t=new Map;return async(...n)=>{let r=k(n);if(t.has(r))return t.get(r);let o=await e(...n);return t.set(r,o),o}}function Ps(e,t){let n=[];for(let r=0;r<e;r++)n.push(t(r,e));return n}function M(e){return e!=null&&typeof e=="object"}function nt(e){return Object(e)!==e}function O(e){return Array.isArray(e)}function he(e){return M(e)&&!O(e)}function ks(e){return e?.constructor===Object}function be(e){return typeof e=="string"}function Ht(e){return typeof e=="number"&&!Number.isNaN(e)}function Rs(e){return Ht(e)&&Number.isInteger(e)}function Ms(e){return Ht(e)&&Number.isSafeInteger(e)}function zt(e){return typeof e=="boolean"}function Bs(e){return e==null}function Os(e){return e==null}function _s(e){return M(e)&&e.constructor.name==="Uint8Array"}function $s(e){return e!=null}function cr(e){return e==null||e===""||M(e)&&jt(e)<=0}function Vs(e){return !cr(e)}function Ns(e){return e!=null&&e!==!1&&e!==!0}function js(e){return e!=null&&e!==!1&&e!==0&&e!==""}function lr(e,t,n=new WeakSet){if(e===t)return !0;if(n.has(t)||(nt(t)||n.add(t),!(e instanceof Object)||!(t instanceof Object))||e.constructor!==t.constructor||e.length!==t.length)return !1;for(let r in e){if(!e.hasOwnProperty(r))continue;if(!t.hasOwnProperty(r))return !1;let o=e[r],i=t[r];if(!lr(o,i,n))return !1}for(let r in t)if(t.hasOwnProperty(r)&&!e.hasOwnProperty(r))return !1;return !0}function fr(e,t=new WeakSet){if(t.has(e))return "[Circular ~]";if(nt(e)||t.add(e),he(e)){for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===void 0){delete e[n];continue}fr(e[n],t);}}else if(O(e))for(let n=e.length-1;n>=0;n--)e[n]===void 0&&e.splice(n,1);return e}function xe(e,...t){for(let n of t)M(e)||(e={}),!(n==null||!M(n))&&Object.keys(n).forEach(r=>{let o=e[r],i=n[r];Array.isArray(o)&&Array.isArray(i)?e[r]=o.concat(i):M(o)&&M(i)?e[r]=xe(Object.assign({},o),i):e[r]=i;});return e}function pr(e,t,n={cyclesFix:!0},r=[]){let o=[],i=Array.isArray(e);for(let u in e){let a=e[u],c=i?+u:u;if(!(u in t)){o.push({type:"del",path:[c]});continue}let f=t[u],l=typeof a=="object"&&typeof f=="object";if(a&&f&&l&&!["Date","RegExp","String","Number"].includes(Object.getPrototypeOf(a).constructor.name)&&(!n.cyclesFix||!r.includes(a))){let g=pr(a,f,n,n.cyclesFix?r.concat([a]):[]);o=[...o,...g.map(d=>(d.path.unshift(c),d))];}else a!==f&&!(l&&(Number.isNaN(a)?`${a}`==`${f}`:+a==+f))&&o.push({path:[c],type:"upd",value:f});}let s=Array.isArray(t);for(let u in t)u in e||o.push({type:"new",path:[s?+u:u],value:t[u]});return o}function Gt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")}function Ws(e){return e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&")}function Zs(e,t,n=[]){return e.filter(r=>!t.some(o=>!o(r))).map(r=>{for(let o of n)r=o(r);return r}).filter(r=>r!=null)}function Ks(e,t){return e.reduce((n,r)=>{let o=String(r[t]);return (n[o]=n[o]||[]).push(r),n},{})}function Ys(e,t){return Array.from(e.reduce((n,r)=>n.add(r[t]),new Set))}function Xs(e,t){return e.map(n=>n[t])}function ta(e,t){return M(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>{let o=t(n,r);return O(o)&&o.length===2?o:[n,o]}).filter(n=>n!=null)):{}}function na(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}function ra(e){return Object.keys(e).length<=0}var dr=/[\\\-\[\]\/{}()*+?.^$|]/g;function we(e){return e?e instanceof RegExp?e.source:e.replace(dr,"\\$&"):""}var gr=100,mr=/^\.+/,yr=/\.+$/,hr=/[<>:\"/\\|?*\u0000-\u001F\u0080-\u009F]+/gm;function qt(){return hr}function br(){return /^(con|prn|aux|nul|com\d|lpt\d)$/i}function aa(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(qt().test(t))throw new Error("Replacement string cannot contain reserved filename characters");let n=`(${we(t)})+`;return e=e.replace(qt(),t).replace(mr,t).replace(yr,"").replace(new RegExp(n,"gm"),t).trim(),e=br().test(e)?e+t:e,e.slice(0,gr)}function re(e){return Math.abs(e)%1===.5}function Wt(e){return e%2===0}var ca=e=>Math.ceil(e),la=e=>Math.floor(e),fa=e=>Math.round(e),pa=e=>{let t=Math.round(e);return re(e)&&Wt(t)?t-1:t},da=e=>re(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),ga=e=>re(e)?Math.floor(e):Math.round(e),ma=e=>{let t=Math.round(e);return re(e)?Wt(t)?t:t-1:t},ya=e=>re(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e);function Jt(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-F()}function Zt(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+F()}function xa(e,t,n){let r=n.length,o=e<t;if(r<=0||e>=r-1)return Zt(n);if(e<=0)return Jt(n);n=xr([...n]);let i=o?-1:0,s=n[e+i].sort_weight||0,a=(n[e+i+1].sort_weight||0)-s;if(a===0)return o?Jt(n):Zt(n);let c=s+a/2,f=a*.01*(F()-.5);return c+f}function xr(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}function La(e={}){let{getter:t=u=>u.sort}=e;function n(u){return u.sort((a,c)=>(t(a)||0)-(t(c)||0)),u}function r(u){return u.reduce((a,c)=>Math.min(a,t(c)||0),0)-1-F()}function o(u){return u.reduce((a,c)=>Math.max(a,t(c)||0),0)+1+F()}function i(u,a){u==null&&(u=(a??0)-1),a==null&&(a=(u??0)+1);let c=a-u,f=u+c/2,l=c*.01*(F()-.5);return f+l}function s(u,a,c){let f=c.length,l=u<a;if(f<=0||u>=f-1)return o(c);if(u<=0)return r(c);c=n([...c]);let g=l?-1:0,d=t(c[u+g])||0,b=(t(c[u+g+1])||0)-d;if(b===0)return l?r(c):o(c);let w=d+b/2,m=b*.01*(F()-.5);return w+m}return {start:r,end:o,between:i,move:s,items:n}}function wr(e){return t=>e?.[t]}var Tr={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Lr=wr(Tr),Ar=/[\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0100-\u017F]/g,vr="\\u0300-\\u036f",Cr="\\ufe20-\\ufe2f",Ur="\\u20d0-\\u20ff",Dr="\\u1ab0-\\u1aff",Er="\\u1dc0-\\u1dff",Fr=vr+Cr+Ur+Dr+Er,Pr=`[${Fr}]`,Ir=RegExp(Pr,"g");function Kt(e){return e&&e.replace(Ar,Lr).replace(Ir,"")}var Sr=/((?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00A1-\uFFFF][a-z0-9\u00A1-\uFFFF_-]{0,62})?[a-z0-9\u00A1-\uFFFF]\.)+(?:[a-z\u00A1-\uFFFF]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?)/gim;function Ua(e){return e.split(Sr).map((t,n)=>{let r=Gt(t);return n%2?`<a target="_blank" href="${r}">${kr(r)}</a>`:r}).join("")}function kr(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}function Yt(e,t){let n=[];for(let[r,o]of Object.entries(e))if(o!=null){Array.isArray(o)||(o=[o]);for(let i of o)t&&!t(i)||i!=null&&n.push(`${encodeURIComponent(r)}=${encodeURIComponent(String(i))}`);}return n.join("&")}function Da(e){let t={},n=(e[0]==="?"?e.substr(1):e).split("&");for(let r=0;r<n.length;r++){let o=n[r].split("="),i=decodeURIComponent(o[0]),s=decodeURIComponent(o[1]||"");t[i]!=null?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(s)):t[i]=s;}return t}var Xt=["aardvark","absurd","accrue","acme","adrift","adult","afflict","ahead","aimless","Algol","allow","alone","ammo","ancient","apple","artist","assume","Athens","atlas","Aztec","baboon","backfield","backward","basalt","beaming","bedlamp","beehive","beeswax","befriend","Belfast","berserk","billiard","bison","blackjack","blockade","blowtorch","bluebird","bombast","bookshelf","brackish","breadline","breakup","brickyard","briefcase","Burbank","button","buzzard","cement","chairlift","chatter","checkup","chisel","choking","chopper","Christmas","clamshell","classic","classroom","cleanup","clockwork","cobra","commence","concert","cowbell","crackdown","cranky","crowfoot","crucial","crumpled","crusade","cubic","deadbolt","deckhand","dogsled","dosage","dragnet","drainage","dreadful","drifter","dropper","drumbeat","drunken","Dupont","dwelling","eating","edict","egghead","eightball","endorse","endow","enlist","erase","escape","exceed","eyeglass","eyetooth","facial","fallout","flagpole","flatfoot","flytrap","fracture","fragile","framework","freedom","frighten","gazelle","Geiger","Glasgow","glitter","glucose","goggles","goldfish","gremlin","guidance","hamlet","highchair","hockey","hotdog","indoors","indulge","inverse","involve","island","Janus","jawbone","keyboard","kickoff","kiwi","klaxon","lockup","merit","minnow","miser","Mohawk","mural","music","Neptune","newborn","nightbird","obtuse","offload","oilfield","optic","orca","payday","peachy","pheasant","physique","playhouse","Pluto","preclude","prefer","preshrunk","printer","profile","prowler","pupil","puppy","python","quadrant","quiver","quota","ragtime","ratchet","rebirth","reform","regain","reindeer","rematch","repay","retouch","revenge","reward","rhythm","ringbolt","robust","rocker","ruffled","sawdust","scallion","scenic","scorecard","Scotland","seabird","select","sentence","shadow","showgirl","skullcap","skydive","slingshot","slothful","slowdown","snapline","snapshot","snowcap","snowslide","solo","spaniel","spearhead","spellbind","spheroid","spigot","spindle","spoilage","spyglass","stagehand","stagnate","stairway","standard","stapler","steamship","stepchild","sterling","stockman","stopwatch","stormy","sugar","surmount","suspense","swelter","tactics","talon","tapeworm","tempest","tiger","tissue","tonic","tracker","transit","trauma","treadmill","Trojan","trouble","tumor","tunnel","tycoon","umpire","uncut","unearth","unwind","uproot","upset","upshot","vapor","village","virus","Vulcan","waffle","wallet","watchword","wayside","willow","woodlark","Zulu"],Qt=["adroitness","adviser","aggregate","alkali","almighty","amulet","amusement","antenna","applicant","Apollo","armistice","article","asteroid","Atlantic","atmosphere","autopsy","Babylon","backwater","barbecue","belowground","bifocals","bodyguard","borderline","bottomless","Bradbury","Brazilian","breakaway","Burlington","businessman","butterfat","Camelot","candidate","cannonball","Capricorn","caravan","caretaker","celebrate","cellulose","certify","chambermaid","Cherokee","Chicago","clergyman","coherence","combustion","commando","company","component","concurrent","confidence","conformist","congregate","consensus","consulting","corporate","corrosion","councilman","crossover","cumbersome","customer","Dakota","decadence","December","decimal","designing","detector","detergent","determine","dictator","dinosaur","direction","disable","disbelief","disruptive","distortion","divisive","document","embezzle","enchanting","enrollment","enterprise","equation","equipment","escapade","Eskimo","everyday","examine","existence","exodus","fascinate","filament","finicky","forever","fortitude","frequency","gadgetry","Galveston","getaway","glossary","gossamer","graduate","gravity","guitarist","hamburger","Hamilton","handiwork","hazardous","headwaters","hemisphere","hesitate","hideaway","holiness","hurricane","hydraulic","impartial","impetus","inception","indigo","inertia","infancy","inferno","informant","insincere","insurgent","integrate","intention","inventive","Istanbul","Jamaica","Jupiter","leprosy","letterhead","liberty","maritime","matchmaker","maverick","Medusa","megaton","microscope","microwave","midsummer","millionaire","miracle","misnomer","molasses","molecule","Montana","monument","mosquito","narrative","nebula","newsletter","Norwegian","October","Ohio","onlooker","opulent","Orlando","outfielder","Pacific","pandemic","pandora","paperweight","paragon","paragraph","paramount","passenger","pedigree","Pegasus","penetrate","perceptive","performance","pharmacy","phonetic","photograph","pioneer","pocketful","politeness","positive","potato","processor","prophecy","provincial","proximate","puberty","publisher","pyramid","quantity","racketeer","rebellion","recipe","recover","repellent","replica","reproduce","resistor","responsive","retraction","retrieval","retrospect","revenue","revival","revolver","Sahara","sandalwood","sardonic","Saturday","savagery","scavenger","sensation","sociable","souvenir","specialist","speculate","stethoscope","stupendous","supportive","surrender","suspicious","sympathy","tambourine","telephone","therapist","tobacco","tolerance","tomorrow","torpedo","tradition","travesty","trombonist","truncated","typewriter","ultimate","undaunted","underfoot","unicorn","unify","universe","unravel","upcoming","vacancy","vagabond","versatile","vertigo","Virginia","visitor","vocalist","voyager","warranty","Waterloo","whimsical","Wichita","Wilmington","Wyoming","yesteryear","Yucatan"];function Ia(e,t=" ",n=" "){return Array.from(e).map((r,o)=>o%2?Qt[r]+n:Xt[r]+t).join("").slice(0,-(e.length%2?t:n).length)}function Sa(e){return A(e.map((t,n)=>(n%2?Qt:Xt).findIndex(r=>r.toLocaleLowerCase()===Kt(t).toLocaleLowerCase().trim())))}var Rr=/\\\s|\s+|#[^\n]*\n?/gm,Mr=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,en=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm;function Br(e){return typeof e=="string"?e:e.source||""}function Ra(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}var tn=class{constructor(t,n){this.namedGroups={};this.names=[];let r=n??"",o;if(t instanceof RegExp?(n==null&&(r=t.flags),o=t.source):o=t,r&&r.includes("x")&&(r=r.replace("x",""),o=o.replace(Rr,u=>u[0]==="\\"?u:"")),!(t instanceof RegExp)){let u=0;o=o.replace(Mr,(a,c)=>(u+=1,c?(c!=="index"&&c!=="length"&&!this.namedGroups[c]&&(this.namedGroups[c]=u),"("):a)),this.names=Object.keys(this.namedGroups);}o=Br(o),en.lastIndex=0;let s=en.exec(o);s&&(this.lookBehind={rx:new RegExp(`${s[3]}$(?!\\s)`),expect:s?s[2]==="=":!s},o=o.substr(s[0].length)),this.rx=new RegExp(o,r);}get lastIndex(){return this.rx.lastIndex}set lastIndex(t){this.rx.lastIndex=t;}_handleMatch(t){if(this.lookBehind){let n=t.input.slice(0,t.index);if(this.lookBehind.expect!==this.lookBehind.rx.test(n))return null}for(let n of this.names)t[n]=t[this.namedGroups[n]];return t}exec(t){let n;for(;n=this.rx.exec(t);)if(this.rx.lastIndex===n.index&&this.rx.lastIndex++,n=this._handleMatch(n),n!=null)return n}execAll(t){let n=[],r;for(this.rx.lastIndex=0;r=this.exec(t);)n.push(r);return this.rx.lastIndex=0,n}replace(t,n){let r=typeof n=="function"?n:()=>n;return t.replace(this.rx,o=>r(o))}};function Or(e){return e===!0||e==="true"||e==="1"||typeof e=="number"&&e!==0?e="*":e===!1||e==="false"||e===0||e==="0"||e==null||e==="null"||e==="undefined"?e="":e=String(e),e}function _r(){return Or(typeof process<"u"?process.env.ZEED??process.env.DEBUG:typeof localStorage<"u"?localStorage.zeed??localStorage.debug:"*")}function q(e=_r()){let t,n=[],r=[];if(!e)t=function(o){return !1};else if(e==="*")t=function(o){return !0};else {let o,i=e.split(/[\s,]+/),s=i.length;for(o=0;o<s;o++){if(!i[o])continue;let u=i[o].replace(/\*/g,".*?");u[0]==="-"?n.push(new RegExp(`^${u.substr(1)}`)):r.push(new RegExp(`^${u}`));}t=function(u){if(n.length===0&&r.length===0)return !0;let a,c;for(a=0,c=n.length;a<c;a++)if(n[a].test(u))return !1;for(a=0,c=r.length;a<c;a++)if(r[a].test(u))return !0;return !1};}return t.accept=r,t.reject=n,t.filter=e,t}function $r(){return typeof process<"u"?process.env.ZEED_LEVEL??process.env.LEVEL??process.env.DEBUG_LEVEL:typeof localStorage<"u"?localStorage.zeed_level??localStorage.level??localStorage.debug_level:void 0}function rt(e){if(e===!1)return 9007199254740991;if(typeof e=="number")return e;if(typeof e=="string"){let t=At[e.toLocaleLowerCase().trim()];if(t!=null)return t}return -1}function Te(e=$r()){let t=rt(e);return n=>n>=t}function oe(...e){return be(e[1])?[`${String(e[0])} ${String(e[1])}`,...e.slice(2)]:e}function Le(e={}){let{level:t=void 0,filter:n=void 0}=e,r=q(n),o=Te(t);return i=>{if(!o(i.level)||!r(i.name))return;let s=i.name?`[${i.name}]`:"";switch(i.level){case 1:console.info(...oe(`I|* ${s}`,...i.messages));break;case 2:console.warn(...oe(`W|** ${s}`,...i.messages));break;case 3:console.error(...oe(`E|*** ${s}`,...i.messages));break;default:console.debug(...oe(`D| ${s}`,...i.messages));break}}}function nn(e=""){let t=[Le()],n=a=>!0,r=!1,o=s,i=!1;function s(a="",c){let f=rt(c??-1);function l(p,b){return f<=p?b:()=>{}}let g=p=>{if(n(a))for(let b of t)b&&b(p);},d=l(0,(...p)=>{g({name:a,messages:p,level:0});});return d.label=a,d.extend=function(p){return o(a?`${a}:${p}`:p)},d.debug=l(0,(...p)=>{g({name:a,messages:p,level:0});}),d.info=l(1,(...p)=>{g({name:a,messages:p,level:1});}),d.warn=l(2,(...p)=>{g({name:a,messages:p,level:2});}),d.error=l(3,(...p)=>{g({name:a,messages:p,level:3});}),d.fatal=l(4,(...p)=>{throw g({name:a,messages:p,level:4}),new Error(`${p.map(String).join(" ")}`)}),d.assert=l(4,(p,...b)=>{(p==null||typeof p=="number"&&Number.isNaN(p)||!p)&&d.fatal(...b);}),d}function u(a="",c){let f=o(a,c);return i&&f.debug(`+++ init of logger "${a}" on level "${f.level}".`),f}return u.registerHandler=function(a){t.push(a);},u.setFilter=function(a){n=q(a);},u.setLock=(a=!0)=>r=a,u.setDebug=(a=!0)=>i=a,u.setHandlers=function(a=[]){o!==s&&(o=s),!r&&(t=[...a].filter(c=>typeof c=="function"));},u.level=-1,u.setLogLevel=function(a=-1){r||(u.level=a);},u.setFactory=function(a){r||(o=a);},u}var _;function ot(e){let t=nn();return e?e(t):t.setHandlers([Le()]),t}function Vr(e){if(_==null)try{let t=z();t!=null?t?.logger==null?(_=ot(e),t.logger=_):_=t.logger:_=ot(e);}catch{_=ot(e);}return _}function rn(){if(_!=null)return _;try{let e=z();if(e?.logger!=null)return e.logger}catch{}}function I(e,t){return Vr()(e,t)}var on=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ja(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return on[Math.abs(t)%on.length]}function Ae(){return Date.now()}function Nr(e){return e>999?`${(e/1e3).toFixed(1)} s`:`${e.toFixed(2)} ms`}function Ka(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let n=null;if(t.includes(":"))try{n=new Date(t);}catch{}if(!(n instanceof Date)){let r=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);r&&(n=new Date(+r[1],+r[2]-1,+r[3],12,0));}if(n instanceof Date)return n}}}function sn(){return typeof performance<"u"?performance.now():Date.now()}function Ya(){let e=sn();return function(){let t=sn()-e;return Nr(t)}}function tu(e){let{level:t=void 0,filter:n=void 0,messages:r=[]}=e,o=q(n),i=Te(t);return s=>{i(s.level)&&o(s.name)&&(s.timestamp=Ae(),r.push(s));}}function jr(...e){throw rn()?.("assert")?.fatal(...e),new Error(`${e.map(String).join(" ")}`)}function Hr(e,...t){(e==null||typeof e=="number"&&Number.isNaN(e)||!e)&&jr(...t);}function an(e,...t){Hr(e,...t);}function ie(e,t,n){return new Uint8Array(e,t,n)}var W;function cn(){return W===void 0&&(W=(typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}))??null,W&&W.decode(new Uint8Array).length===1&&(W=null)),W}var it=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[];}};function Ee(){return new it}function st(e){let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t}function Fe(e){let t=new Uint8Array(st(e)),n=0;for(let r=0;r<e.bufs.length;r++){let o=e.bufs[r];t.set(o,n),n+=o.length;}return t.set(ie(e.cbuf.buffer,0,e.cpos),n),t}function qr(e,t){let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(ie(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Math.max(n,t)*2),e.cpos=0);}function C(e,t){let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t;}var dn=C;function gn(e,t){C(e,t&255),C(e,t>>>8&255);}function mn(e,t){for(let n=0;n<4;n++)C(e,t&255),t>>>=8;}function j(e,t){for(;t>127;)C(e,128|127&t),t=Math.floor(t/128);C(e,127&t);}function Wr(e){return e!==0?e<0:1/e<0}function at(e,t){let n=Wr(t);for(n&&(t=-t),C(e,(t>63?128:0)|(n?64:0)|63&t),t=Math.floor(t/64);t>0;)C(e,(t>127?128:0)|127&t),t=Math.floor(t/128);}function Pe(e,t){let n=e.cbuf.length,r=e.cpos,o=Math.min(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Math.max(n*2,i)),e.cbuf.set(t.subarray(o)),e.cpos=i);}function Ie(e,t){j(e,t.byteLength),Pe(e,t);}function Zr(e,t){let n=unescape(encodeURIComponent(t)),r=n.length;j(e,r);for(let o=0;o<r;o++)C(e,n.codePointAt(o));}function De(e,t){return Zr(e,t)}function ut(e,t){qr(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n}function ct(e,t){return ut(e,4).setFloat32(0,t,!1)}function Kr(e,t){return ut(e,8).setFloat64(0,t,!1)}function Yr(e,t){return ut(e,8).setBigInt64(0,t,!1)}var Ue;function Xr(e){return Ue==null&&(Ue=new DataView(new ArrayBuffer(4))),Ue.setFloat32(0,e),Ue.getFloat32(0)===e}function Z(e,t){switch(typeof t){case"string":C(e,119),De(e,t);break;case"number":Number.isInteger(t)&&Math.abs(t)<=2147483647?(C(e,125),at(e,t)):Xr(t)?(C(e,124),ct(e,t)):(C(e,123),Kr(e,t));break;case"bigint":C(e,122),Yr(e,t);break;case"object":if(t===null)C(e,126);else if(Array.isArray(t)){C(e,117),j(e,t.length);for(let n=0;n<t.length;n++)Z(e,t[n]);}else if(t instanceof Uint8Array)C(e,116),Ie(e,t);else {C(e,118);let n=Object.keys(t);j(e,n.length);for(let r=0;r<n.length;r++){let o=n[r];De(e,o),Z(e,t[o]);}}break;case"boolean":C(e,t?120:121);break;default:C(e,127);}}var yn="Unexpected end of array",hn="Integer out of Range",lt=class{constructor(t){this.arr=t,this.pos=0;}};function ke(e){return new lt(e)}function ft(e,t){let n=ie(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n}function K(e){let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let o=e.arr[e.pos++];if(t=t+(o&127)*n,n*=128,o<128)return t;if(t>Number.MAX_SAFE_INTEGER)throw new Error(hn)}throw new Error(yn)}function Re(e){return ft(e,K(e))}function ue(e){return e.arr[e.pos++]}function bn(e){let t=e.arr[e.pos]+(e.arr[e.pos+1]<<8);return e.pos+=2,t}function xn(e){let t=e.arr[e.pos]+(e.arr[e.pos+1]<<8)+(e.arr[e.pos+2]<<16)+(e.arr[e.pos+3]<<24)>>>0;return e.pos+=4,t}function pt(e){let t=e.arr[e.pos++],n=t&63,r=64,o=(t&64)>0?-1:1;if(!(t&128))return o*n;let i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n=n+(t&127)*r,r*=128,t<128)return o*n;if(n>Number.MAX_SAFE_INTEGER)throw new Error(hn)}throw new Error(yn)}function Qr(e){let t=K(e);if(t===0)return "";{let n=String.fromCodePoint(ue(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(ue(e));else for(;t>0;){let r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r;}return decodeURIComponent(escape(n))}}function Se(e){let t=cn();return t?t.decode(Re(e)):Qr(e)}function dt(e,t){let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n}function gt(e){return dt(e,4).getFloat32(0,!1)}function eo(e){return dt(e,8).getFloat64(0,!1)}function to(e){return dt(e,8).getBigInt64(0,!1)}var no=[e=>{},e=>null,pt,gt,eo,to,e=>!1,e=>!0,Se,e=>{let t=K(e),n={};for(let r=0;r<t;r++){let o=Se(e);n[o]=Y(e);}return n},e=>{let t=K(e),n=[];for(let r=0;r<t;r++)n.push(Y(e));return n},Re];function Y(e){return no[127-ue(e)](e)}var wn=class{async encode(t){let n=Ee();return Z(n,t),Fe(n)}async decode(t){return Y(ke(A(t)))}};function wu(e){let t=Ee();return Z(t,e),Fe(t)}function Tu(e){return Y(ke(A(e)))}function Lu(e){let t=Ee();return e!=null&&Pe(t,A(e)),{writeBytes:(n,r)=>{let o=A(n);an(!(r!=null&&o.length!==r),`Expected ${r} bytes, got ${o.length}`),Pe(t,o);},writeBytesVar:n=>Ie(t,A(n)),writeUintVar:n=>j(t,n),writeUint8:n=>dn(t,n),writeUint16:n=>gn(t,n),writeUint32:n=>mn(t,n),writeIntVar:n=>at(t,n),writeFloat:n=>ct(t,n),writeStringVar:n=>De(t,n),write:n=>Z(t,n),getUint8Array:()=>Fe(t),getLength:()=>st(t)}}function Au(e){let t=ke(A(e));return {readBytes:n=>ft(t,n),readBytesVar:()=>Re(t),readUintVar:()=>K(t),readUint8:()=>ue(t),readUint16:()=>bn(t),readUint32:()=>xn(t),readIntVar:()=>pt(t),readFloat:()=>gt(t),readStringVar:()=>Se(t),read:()=>Y(t),getOffset:()=>t.pos||0}}function vu(e=0){return {setBit:(t,n=!0)=>n?e|=1<<t:e&=~(1<<t),unsetBit:t=>e&=1<<t,toggleBit:t=>e^=1<<t,getBit:t=>(e&1<<t)!==0,getValue:()=>e}}async function ro(e){return await e.arrayBuffer()}async function Cu(e){let t=await ro(e);if(t!=null)return A(t)}function X(e=16){let t=new Uint8Array(e);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let n=0;n<e;n++)t[n]=Math.floor(Math.random()*256);return t}var Ln="SHA-256",mt="AES-GCM",Tn="PBKDF2",oo=1e5;async function Eu(e,t=Ln){return A(await crypto.subtle.digest(t,A(e)))}async function Fu(e,t={}){let n=A(e),r=await crypto.subtle.importKey("raw",n,Tn,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:Tn,salt:t.salt?A(t.salt):new Uint8Array(0),iterations:t.iterations??oo,hash:Ln},r,{name:mt,length:256},!0,["encrypt","decrypt"])}function An(){return new Uint8Array([1,1])}async function vn(e,t){let n=An(),r=X(12),o=await crypto.subtle.encrypt({name:mt,iv:r},t,e),i=new Uint8Array(o),s=n.length+r.length+i.length,u=new Uint8Array(s),a=0;return u.set(n,a),a+=n.length,u.set(r,a),a+=r.length,u.set(i,a),u}async function Cn(e,t){let n=e.subarray(0,2);if(!Pt(n,An()))return Promise.reject(new Error(`Unknown magic ${n}`));let r=e.subarray(2,14),o=e.subarray(14,e.length),i=await crypto.subtle.decrypt({name:mt,iv:r},t,o);return new Uint8Array(i)}var io=",";function Su(e,t={}){let{separator:n=io}=t,r="";for(let o=0;o<e.length;o++)r+=`${e[o].map(i=>{if(i==null||i==="")return "";if(zt(i))return i?1:0;let s=String(i);return (he(i)||O(i))&&(s=k(i)),s.includes('"')||s.includes(`
|
|
6
6
|
`)||s.includes(n)?`"${s.replace(/"/g,'""')}"`:s}).join(n)}
|
|
7
7
|
`;return r}function so(e,t={}){let n=/("((?:(?:[^"]*?)(?:"")?)*)"|([^,;\t\n]*))([,;\t]|\n|\r\n)/g;t.separator&&(n=new RegExp(n.source.replaceAll(",;\\t",we(t.separator)),n.flags));let r=[],o=[],i,s=`${e.replaceAll(`\r
|
|
8
8
|
`,`
|
|
9
9
|
`).trim()}
|
|
10
|
-
`;for(;i=n.exec(s);){let
|
|
11
|
-
`&&(r.push(o),o=[]);}return r}function Su(e,t={}){let n=so(e,t),r=n[0];return n.slice(1).map(o=>Object.fromEntries(o.map((i,s)=>[r[s],i])))}function ao(e){let t;if(typeof e=="function"?t=e():P(e)?t=e:typeof e.dispose=="function"?t=e.dispose():P(e.dispose)&&(t=e.dispose),P(t))return t}function Q(e){let t=e;t!=null&&(be(t)?t={name:t}:"debug"in t&&"label"in t&&(t={name:t.label,log:t}));let n=t?.name,r=t?.log??k("zeed:dispose"),o=[];function i(c){if(c!=null&&o.includes(c)){qe(o,l=>l!==c);let f=ao(c);if(P(f))return f}}function s(c){if(c!=null)return o.unshift(c),()=>i(c)}function a(c=!1){n&&r.debug(`dispose "${n}": ${o.length} entries`);let f=[];for(;o.length>0;){let l=o[0],m=i(l);if(P(m)){if(c)throw new Error(`Async disposable found: ${l} -> ${m}`);f.push(m);}}if(f.length>0)return Promise.all(f)}function u(){a(!0);}return Object.assign(a,{add:s,remove:i,track:s,untrack:i,dispose:a,disposeSync:u,sync:u,exec:a,getSize(){return o.length},isDisposed(){return o.length<=0}})}function $u(e={}){let{mode:t="fifo"}=e,n=[],r=async(i=!1)=>{for(;n.length>0;){let s=n[0];if(qe(n,a=>a!==s),typeof s=="function"){let a=s();if(P(a)){if(i)throw new Error(`Expected sync only function, but found async: ${s}`);await a;}}else if(P(s)){if(i)throw new Error(`Expected sync only function, but found async: ${s}`);await s;}else throw new Error(`Unhandled disposable: ${s}`)}};return Object.assign(r,{add:i=>{t==="lifo"?n.unshift(i):n.push(i);},exec:r,getSize(){return n.length}})}function ju(){let e=!0;return (t,n)=>{let r=!1;if(e){e=!1;try{t(),r=!0;}finally{e=!0;}}else n!==void 0&&n();return r}}function Hu(){let e=!0;return async(t,n)=>{let r=!1;if(e){e=!1;try{let o=t();P(o)&&await o,r=!0;}finally{e=!0;}}else if(n!==void 0){let o=n();P(o)&&await o;}return r}}var I=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this._logEmitter=k("zeed:emitter","warn");this.dispose=Q();this.call=new Proxy({},{get:(t,n)=>async(...r)=>await this.emit(n,...r)});}async emit(t,...n){let r=!1;try{let o=this.subscribers[t]||[];if(this._logEmitter.debug("emit",this?.constructor?.name,t,...n,o),this.subscribersOnAny.forEach(i=>i(t,...n)),o.length>0){let i=o.map(({fn:s})=>{try{return V(s(...n))}catch(a){this._logEmitter.warn("emit warning:",a);}return null}).filter(s=>s!=null);r=!0,await Promise.all(i);}}catch(o){this._logEmitter.error("emit exception",o);}return r}onAny(t){this.subscribersOnAny.push(t);}on(t,n,r={}){let{priority:o=0}=r,i=this.subscribers[t]||[],s=i.length,a={fn:n,priority:o};if(s<=0)this.subscribers[t]=[a];else {let u=s;for(let c=i.length-1;c>=0;c--){let f=i[c];if(o<=f.priority)break;u-=1;}i.splice(u,0,a);}return ()=>{this.off(t,n);}}onCall(t){for(let[n,r]of Object.entries(t))this.on(n,r);}once(t,n){let r=async(...o)=>(this.off(t,r),await V(n(...o)));return this.on(t,r),()=>{this.off(t,n);}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(r=>n&&r.fn!==n),this}removeAllListeners(){return this.subscribers={},this}};function Yu(){let e=z().emitter;return e||(e=new I,z().emitter=e),e}function Ku(e,t){let n=Math.round(D()*100),r=[],o,i=(a,u)=>{let c={key:a,obj:u};r.push(c),o&&o();};return t?e.on?e.on(t,a=>{i(t,a);}):e.addEventListener?e.addEventListener(t,a=>{i(t,a);}):e.log.error(n,"Cannot listen to key"):e.onAny?e.onAny((a,u)=>{i(a,u);}):e.log.error(n,"cannot listen to all for",e),(a,u=!0)=>new Promise((c,f)=>{a||(a=t,a||r.length&&(a=r[0].key)),o=()=>{for(;r.length>0;){let l=r.shift();if(l.key===a)o=void 0,c(l.obj);else {if(u)continue;f(new Error(`Expected ${a}, but found ${l.key} with value=${l.obj}`));}break}},o();})}var Me=16;function ht(){return X(Me)}function uo(e=ht()){return Ye(e,22)}function co(e){return Ye(e,22)}function lo(e){return St(e,Me)}function fo(e=ht()){return Ze(e,26)}function po(e){return Ze(e,26)}function go(e){return It(e,Me)}var mo="10000000-1000-4000-8000-100000000000",yo=function(){return typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID():mo.replace(/[018]/g,e=>(e^X(1)[0]&15>>e/4).toString(16))};function ho(e){let t=Et(e);return `${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}function bo(e){return Ft(e.replaceAll("-",""))}var Un=16e11;function xo(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let r=0;r<t.length;r++){let o=e&255;t[n-r]=o,e=(e-o)/256;}return t}function Dn(){let e=Ae()-Un;return new Uint8Array([...xo(e),...X(10)])}function rc(){return To(Dn())}function oc(e){return wo(Fn(e))}function wo(e){return new Date(Un+e.slice(0,6).reduce((t,n)=>t*256+n,0))}function ic(){return new Uint32Array(X(4))[0]}var bt={base62:{uuid:uo,uuidDecode:lo,uuidEncode:co},base32:{uuid:fo,uuidDecode:go,uuidEncode:po},uuidv4:{uuid:yo,uuidDecode:bo,uuidEncode:ho}},Be="base62",En=!1;function sc(e,t=!1){Be=e,En=t;}function H(){return bt[Be].uuid(En?Dn():ht())}function Fn(e){return bt[Be].uuidDecode(e)}function To(e){return bt[Be].uuidEncode(e)}function ac(e){try{return Fn(e).length===Me}catch{}return !1}var yt={};function R(e="id"){return yt[e]==null&&(yt[e]=0),`${e}-${yt[e]++}`}var Lo=0;function uc(){return `id-${Lo++}`}var xt=class extends I{constructor(){super(...arguments);this.id=H();}close(){this.dispose();}},Oe=class extends xt{constructor(){super(...arguments);this.isConnected=!0;}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:H()});}};function pc(){let e=new Oe,t=new Oe;return e.other=t,t.other=e,[e,t]}var Pn=class{async encode(t){return t}async decode(t){return t}},ee=class{async encode(t){return We(t)}async decode(t){return Je(t)}},kn=class{constructor(t){this.key=t;}async encode(t){let n=We(t);return await vn(n,this.key)}async decode(t){let n=await Cn(t,this.key);return Je(n)}};function In(e,t,n={}){return new Proxy(n,{get:(r,o)=>o in r?r[o]:(...i)=>e(o,i,t)})}function Lc(e={}){let{name:t=R("hub"),encoder:n=new ee,retryAfter:r=1e3,ignoreUnhandled:o=!0,logLevel:i=!1}=e,s=k(t,i),a={},u,c=[],f,l={},m=()=>{clearTimeout(f);},d=async()=>{if(clearTimeout(f),u){if(u.isConnected)for(;c.length;){let g=c[0];try{u.postMessage(await n.encode(g)),c.shift();}catch(T){s.warn("postMessage",T);break}}c.length>0&&r>0&&(f=setTimeout(d,r));}},p=async g=>{s("enqueue postMessage",g),c.push(g),await d();},b=async g=>{u=g,u.on("connect",d),u.on("message",async T=>{s("onmessage",typeof T);let{name:E,args:B,id:h,result:y,error:L}=await n.decode(T.data);if(E){s(`name ${E} id ${h}`);try{if(a[E]==null)throw new Error(`handler for ${E} was not found`);let v=a[E](...B);P(v)&&(v=await v),s(`result ${v}`),h&&await p({id:h,result:v});}catch(v){let x=v instanceof Error?v:new Error(Ke(v));s.warn("execution error",x.name),await p({id:h,error:{message:x.message,stack:x.stack,name:x.name}});}}else if(h)if(s(`response for id=${h}: result=${y}, error=${L}`),l[h]==null)y===void 0?s(`skip response for ${h}`):s.warn(`no response hook for ${h}`);else {let[v,x]=l[h];if(v&&x)if(delete l[h],L){let U=new Error(L.message);U.stack=L.stack,U.name=L.name,s.warn("reject",U.name),x(U);}else s("resolve",y),v(y);}else o||s.warn("Unhandled message",T);}),await d();},w=async(g,T,E={})=>{let{timeout:B=5e3}=E,h=H();return await p({name:g,args:T,id:h}),Bt(new Promise((y,L)=>l[h]=[y,L]),B)};return e.channel&&b(e.channel),{dispose:m,connect:b,listen(g){Object.assign(a,g);},send(){return In(w,{},{options(g){return In(w,{...g})}})}}}var wt=class extends I{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:r,encoder:o=new ee,channel:i,debug:s=!1}=n;this.channel=i,this.encoder=o,this.debug=s,this.name=r??this.channel.id??R("pubsub"),this.log=k(`${this.shortId}`),this.debug&&(this.channel.on("connect",()=>{this.log("channel connected");}),this.channel.on("disconnect",()=>{this.log("channel disconnected");})),this.channel.on("message",async({data:a})=>{let u=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${u?.event}, info=`,u):this.log(`channel message, event=${u?.event}`),u){let{event:c,args:f}=u;await this.emitSuper(c,...f);}});}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...r){return await super.emit(n,...r)}async emit(n,...r){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,r.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let o=await this.encoder.encode({event:n,args:r});return this.channel.postMessage(o),!0}catch(o){this.log.warn(`emit(${String(n)})`,o);}return !1}};function Ec(e){return new wt(e)}var Ao=1;var Sn=e=>e,vo=Sn;function Rn(e,t,n=[]){let{post:r,on:o,serialize:i=Sn,deserialize:s=vo,log:a}=e,u=new Map;return o(async f=>{try{let l=s(f),[m,d,p,b]=l;if(m===1||m===2){let w,g;if(b!=null)try{let T=t[b];w=await T(...d);}catch(T){g=String(T);}else g="Method implementation missing";g&&a?.warn("error",l,g),m===1&&p&&r(i(g?[4,g,p]:[3,w,p]));}else if(p){let w=u.get(p);w!=null&&(m===4?w.reject(d):w.resolve(d)),u.delete(p);}}catch(l){a?.warn("Error on handling RPC data. Invalid?",l,f);}}),{post:r,serialize:i,rpcPromiseMap:u,proxyHandler:{get(f,l){let m=(...p)=>{r(i([2,p,null,l]));};if(e.onlyEvents||n.includes(l))return m.asEvent=m,m;let d=(...p)=>new Promise((b,w)=>{let g=Ao++;u.set(g,{resolve:b,reject:w}),r(i([1,p,g,l]));});return d.asEvent=m,d}}}}function Pc(e,t){let{eventNames:n=[]}=t,{proxyHandler:r}=Rn(t,e,n);return new Proxy({},r)}function kc(e){let t=[],n={},{proxyHandler:r}=Rn(e,n);function o(){return new Proxy({},r)}return function(i,s=[]){return Object.assign(n,i??{}),t.push(...s),o()}}var ce=class e extends I{constructor(n={}){super();this._isCancelled=!1;this._resetWhenFinished=!0;this._children=[];this._totalUnits=n.totalUnits??0,this._completedUnits=n.completeUnits??0,this._resetWhenFinished=n.resetWhenFinished??!0,this.name=n.name??R("progress"),this.dispose.add(async()=>{for(let r of this._children)await r.dispose();await this.emit("progressDispose",this);});}update(){this.emit("progressChanged",this),this._isCancelled&&this._resetWhenFinished&&this.getTotalUnits()<=this.getCompletedUnits()&&this.reset();}reset(){if(this._isCancelled){this._isCancelled=!1;for(let n of this._children)n.reset();this.update();}}async cancel(){if(!this._isCancelled){this._isCancelled=!0,await this.emit("progressCancelled",this);for(let n of this._children)await n.cancel();this.update();}}addChild(n){n.on("progressDispose",()=>this.removeChild(n)),n.on("progressChanged",()=>this.update()),this._children.includes(n)||this._children.push(n),this.update();}createChildProgress(n){let r=new e(n);return this.addChild(r),r}removeChild(n){vt(this._children,n),this.update();}getTotalUnits(){if(this.isIndeterminate())return 0;let n=this._totalUnits;for(let r of this._children)n+=r.getTotalUnits();return n}getCompletedUnits(){if(this.isIndeterminate())return 0;let n=this._completedUnits;for(let r of this._children)n+=r.getCompletedUnits();return n}isIndeterminate(){return this._totalUnits<=0&&this._children.length<=0}isCancelled(){return this._isCancelled}isFinished(){return this.dispose.isDisposed()||!this.isIndeterminate()&&this.getTotalUnits()<=this.getCompletedUnits()}getFraction(){if(this.isIndeterminate())return 0;let n=this.getCompletedUnits()/this.getTotalUnits();return Number.isNaN(n)&&(n=0),Math.min(1,Math.max(0,n))}getChildrenCount(){return this._children.length}setTotalUnits(n,r){this._totalUnits=n,r!=null&&(this._completedUnits=r),this.update();}incTotalUnits(n=1){this._totalUnits+=n,this.update();}setCompletetedUnits(n){this._completedUnits=n,this.update();}setCompleted(){this._completedUnits=this._totalUnits,this.update();}incCompletedUnits(n=1){this._completedUnits+=n,this.update();}toString(n=0){let r=`${" ".repeat(n)}${this.name}: ${this._completedUnits} of ${this._totalUnits} units, ${Math.floor(this.getFraction()*100)} %, cancel=${this._isCancelled}
|
|
12
|
-
`;for(let o of this._children)r+=o.toString(n+1);return n===0?r.trim():r}};function
|
|
10
|
+
`;for(;i=n.exec(s);){let u=i[2]??i[3]??"";u=u.replaceAll('""','"'),o.push(u),i[4]===`
|
|
11
|
+
`&&(r.push(o),o=[]);}return r}function ku(e,t={}){let n=so(e,t),r=n[0];return n.slice(1).map(o=>Object.fromEntries(o.map((i,s)=>[r[s],i])))}function ao(e){let t;if(typeof e=="function"?t=e():P(e)?t=e:typeof e.dispose=="function"?t=e.dispose():P(e.dispose)&&(t=e.dispose),P(t))return t}function Q(e){let t=e;t!=null&&(be(t)?t={name:t}:"debug"in t&&"label"in t&&(t={name:t.label,log:t}));let n=t?.name,r=t?.log??I("zeed:dispose"),o=0,i=[];function s(f){if(f!=null&&i.includes(f)){qe(i,g=>g!==f);let l=ao(f);if(P(l))return l}}function u(f){if(f!=null)return i.unshift(f),()=>s(f)}function a(f=!1){n&&r.debug(`dispose "${n}": ${i.length} entries`),o+=1;let l=[];for(;i.length>0;){let g=i[0],d=s(g);if(P(d)){if(f)throw new Error(`Async disposable found: ${g} -> ${d}`);l.push(d);}}if(l.length>0)return Promise.all(l)}function c(){a(!0);}return Object.assign(a,{disposed:o,add:u,remove:s,track:u,untrack:s,dispose:a,disposeSync:c,sync:c,exec:a,getSize(){return i.length},isDisposed(){return i.length<=0}})}function $u(e={}){let{mode:t="fifo"}=e,n=[],r=async(i=!1)=>{for(;n.length>0;){let s=n[0];if(qe(n,u=>u!==s),typeof s=="function"){let u=s();if(P(u)){if(i)throw new Error(`Expected sync only function, but found async: ${s}`);await u;}}else if(P(s)){if(i)throw new Error(`Expected sync only function, but found async: ${s}`);await s;}else throw new Error(`Unhandled disposable: ${s}`)}};return Object.assign(r,{add:i=>{t==="lifo"?n.unshift(i):n.push(i);},exec:r,getSize(){return n.length}})}function ju(){let e=!0;return (t,n)=>{let r=!1;if(e){e=!1;try{t(),r=!0;}finally{e=!0;}}else n!==void 0&&n();return r}}function Hu(){let e=!0;return async(t,n)=>{let r=!1;if(e){e=!1;try{let o=t();P(o)&&await o,r=!0;}finally{e=!0;}}else if(n!==void 0){let o=n();P(o)&&await o;}return r}}var S=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this._logEmitter=I("zeed:emitter","warn");this.call=new Proxy({},{get:(t,n)=>async(...r)=>await this.emit(n,...r)});}async emit(t,...n){let r=!1;try{let o=this.subscribers[t]||[];if(this._logEmitter.debug("emit",this?.constructor?.name,t,...n,o),this.subscribersOnAny.forEach(i=>i(t,...n)),o.length>0){let i=o.map(({fn:s})=>{try{return V(s(...n))}catch(u){this._logEmitter.warn("emit warning:",u);}return null}).filter(s=>s!=null);r=!0,await Promise.all(i);}}catch(o){this._logEmitter.error("emit exception",o);}return r}onAny(t){this.subscribersOnAny.push(t);}on(t,n,r={}){let{priority:o=0}=r,i=this.subscribers[t]||[],s=i.length,u={fn:n,priority:o};if(s<=0)this.subscribers[t]=[u];else {let a=s;for(let c=i.length-1;c>=0;c--){let f=i[c];if(o<=f.priority)break;a-=1;}i.splice(a,0,u);}return ()=>{this.off(t,n);}}onCall(t){for(let[n,r]of Object.entries(t))this.on(n,r);}once(t,n){let r=async(...o)=>(this.off(t,r),await V(n(...o)));return this.on(t,r),()=>{this.off(t,n);}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(r=>n&&r.fn!==n),this}removeAllListeners(){return this.subscribers={},this}};function Ju(){let e=z().emitter;return e||(e=new S,z().emitter=e),e}var Me=16;function ht(){return X(Me)}function uo(e=ht()){return Ke(e,22)}function co(e){return Ke(e,22)}function lo(e){return kt(e,Me)}function fo(e=ht()){return Ze(e,26)}function po(e){return Ze(e,26)}function go(e){return St(e,Me)}var mo="10000000-1000-4000-8000-100000000000",yo=function(){return typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID():mo.replace(/[018]/g,e=>(e^X(1)[0]&15>>e/4).toString(16))};function ho(e){let t=Et(e);return `${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}function bo(e){return Ft(e.replaceAll("-",""))}var Un=16e11;function xo(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let r=0;r<t.length;r++){let o=e&255;t[n-r]=o,e=(e-o)/256;}return t}function Dn(){let e=Ae()-Un;return new Uint8Array([...xo(e),...X(10)])}function ec(){return To(Dn())}function tc(e){return wo(Fn(e))}function wo(e){return new Date(Un+e.slice(0,6).reduce((t,n)=>t*256+n,0))}function nc(){return new Uint32Array(X(4))[0]}var bt={base62:{uuid:uo,uuidDecode:lo,uuidEncode:co},base32:{uuid:fo,uuidDecode:go,uuidEncode:po},uuidv4:{uuid:yo,uuidDecode:bo,uuidEncode:ho}},Be="base62",En=!1;function rc(e,t=!1){Be=e,En=t;}function H(){return bt[Be].uuid(En?Dn():ht())}function Fn(e){return bt[Be].uuidDecode(e)}function To(e){return bt[Be].uuidEncode(e)}function oc(e){try{return Fn(e).length===Me}catch{}return !1}var yt={};function R(e="id"){return yt[e]==null&&(yt[e]=0),`${e}-${yt[e]++}`}var Lo=0;function ic(){return `id-${Lo++}`}var xt=class extends S{constructor(){super(...arguments);this.id=H();}},Oe=class extends xt{constructor(){super(...arguments);this.isConnected=!0;}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:H()});}};function cc(){let e=new Oe,t=new Oe;return e.other=t,t.other=e,[e,t]}var Pn=class{async encode(t){return t}async decode(t){return t}},ee=class{async encode(t){return We(t)}async decode(t){return Je(t)}},In=class{constructor(t){this.key=t;}async encode(t){let n=We(t);return await vn(n,this.key)}async decode(t){let n=await Cn(t,this.key);return Je(n)}};function Sn(e,t,n={}){return new Proxy(n,{get:(r,o)=>o in r?r[o]:(...i)=>e(o,i,t)})}function xc(e={}){let{name:t=R("hub"),encoder:n=new ee,retryAfter:r=1e3,ignoreUnhandled:o=!0,logLevel:i=!1}=e,s=I(t,i),u={},a,c=[],f,l={},g=()=>{clearTimeout(f);},d=async()=>{if(clearTimeout(f),a){if(a.isConnected)for(;c.length;){let m=c[0];try{a.postMessage(await n.encode(m)),c.shift();}catch(T){s.warn("postMessage",T);break}}c.length>0&&r>0&&(f=setTimeout(d,r));}},p=async m=>{s("enqueue postMessage",m),c.push(m),await d();},b=async m=>{a=m,a.on("connect",d),a.on("message",async T=>{s("onmessage",typeof T);let{name:D,args:B,id:h,result:y,error:L}=await n.decode(T.data);if(D){s(`name ${D} id ${h}`);try{if(u[D]==null)throw new Error(`handler for ${D} was not found`);let v=u[D](...B);P(v)&&(v=await v),s(`result ${v}`),h&&await p({id:h,result:v});}catch(v){let x=v instanceof Error?v:new Error(Ye(v));s.warn("execution error",x.name),await p({id:h,error:{message:x.message,stack:x.stack,name:x.name}});}}else if(h)if(s(`response for id=${h}: result=${y}, error=${L}`),l[h]==null)y===void 0?s(`skip response for ${h}`):s.warn(`no response hook for ${h}`);else {let[v,x]=l[h];if(v&&x)if(delete l[h],L){let U=new Error(L.message);U.stack=L.stack,U.name=L.name,s.warn("reject",U.name),x(U);}else s("resolve",y),v(y);}else o||s.warn("Unhandled message",T);}),await d();},w=async(m,T,D={})=>{let{timeout:B=5e3}=D,h=H();return await p({name:m,args:T,id:h}),Bt(new Promise((y,L)=>l[h]=[y,L]),B)};return e.channel&&b(e.channel),{dispose:g,connect:b,listen(m){Object.assign(u,m);},send(){return Sn(w,{},{options(m){return Sn(w,{...m})}})}}}var wt=class extends S{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:r,encoder:o=new ee,channel:i,debug:s=!1}=n;this.channel=i,this.encoder=o,this.debug=s,this.name=r??this.channel.id??R("pubsub"),this.log=I(`${this.shortId}`),this.debug&&(this.channel.on("connect",()=>{this.log("channel connected");}),this.channel.on("disconnect",()=>{this.log("channel disconnected");})),this.channel.on("message",async({data:u})=>{let a=await this.encoder.decode(u);if(this.debug?this.log(`channel message, event=${a?.event}, info=`,a):this.log(`channel message, event=${a?.event}`),a){let{event:c,args:f}=a;await this.emitSuper(c,...f);}});}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...r){return await super.emit(n,...r)}async emit(n,...r){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,r.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let o=await this.encoder.encode({event:n,args:r});return this.channel.postMessage(o),!0}catch(o){this.log.warn(`emit(${String(n)})`,o);}return !1}};function Cc(e){return new wt(e)}var Ao=1;var kn=e=>e,vo=kn;function Rn(e,t,n=[]){let{post:r,on:o,serialize:i=kn,deserialize:s=vo,log:u}=e,a=new Map;return o(async f=>{try{let l=s(f),[g,d,p,b]=l;if(g===1||g===2){let w,m;if(b!=null)try{let T=t[b];w=await T(...d);}catch(T){m=String(T);}else m="Method implementation missing";m&&u?.warn("error",l,m),g===1&&p&&r(i(m?[4,m,p]:[3,w,p]));}else if(p){let w=a.get(p);w!=null&&(g===4?w.reject(d):w.resolve(d)),a.delete(p);}}catch(l){u?.warn("Error on handling RPC data. Invalid?",l,f);}}),{post:r,serialize:i,rpcPromiseMap:a,proxyHandler:{get(f,l){let g=(...p)=>{r(i([2,p,null,l]));};if(e.onlyEvents||n.includes(l))return g.asEvent=g,g;let d=(...p)=>new Promise((b,w)=>{let m=Ao++;a.set(m,{resolve:b,reject:w}),r(i([1,p,m,l]));});return d.asEvent=g,d}}}}function Dc(e,t){let{eventNames:n=[]}=t,{proxyHandler:r}=Rn(t,e,n);return new Proxy({},r)}function Ec(e){let t=[],n={},{proxyHandler:r}=Rn(e,n);function o(){return new Proxy({},r)}return function(i,s=[]){return Object.assign(n,i??{}),t.push(...s),o()}}var ce=class e extends S{constructor(n={}){super();this._isCancelled=!1;this._resetWhenFinished=!0;this._children=[];this.dispose=Q();this._totalUnits=n.totalUnits??0,this._completedUnits=n.completeUnits??0,this._resetWhenFinished=n.resetWhenFinished??!0,this.name=n.name??R("progress"),this.dispose.add(async()=>{for(let r of this._children)await r.dispose();await this.emit("progressDispose",this);});}update(){this.emit("progressChanged",this),this._isCancelled&&this._resetWhenFinished&&this.getTotalUnits()<=this.getCompletedUnits()&&this.reset();}reset(){if(this._isCancelled){this._isCancelled=!1;for(let n of this._children)n.reset();this.update();}}async cancel(){if(!this._isCancelled){this._isCancelled=!0,await this.emit("progressCancelled",this);for(let n of this._children)await n.cancel();this.update();}}addChild(n){n.on("progressDispose",()=>this.removeChild(n)),n.on("progressChanged",()=>this.update()),this._children.includes(n)||this._children.push(n),this.update();}createChildProgress(n){let r=new e(n);return this.addChild(r),r}removeChild(n){vt(this._children,n),this.update();}getTotalUnits(){if(this.isIndeterminate())return 0;let n=this._totalUnits;for(let r of this._children)n+=r.getTotalUnits();return n}getCompletedUnits(){if(this.isIndeterminate())return 0;let n=this._completedUnits;for(let r of this._children)n+=r.getCompletedUnits();return n}isIndeterminate(){return this._totalUnits<=0&&this._children.length<=0}isCancelled(){return this._isCancelled}isFinished(){return this.dispose.isDisposed()||!this.isIndeterminate()&&this.getTotalUnits()<=this.getCompletedUnits()}getFraction(){if(this.isIndeterminate())return 0;let n=this.getCompletedUnits()/this.getTotalUnits();return Number.isNaN(n)&&(n=0),Math.min(1,Math.max(0,n))}getChildrenCount(){return this._children.length}setTotalUnits(n,r){this._totalUnits=n,r!=null&&(this._completedUnits=r),this.update();}incTotalUnits(n=1){this._totalUnits+=n,this.update();}setCompletetedUnits(n){this._completedUnits=n,this.update();}setCompleted(){this._completedUnits=this._totalUnits,this.update();}incCompletedUnits(n=1){this._completedUnits+=n,this.update();}toString(n=0){let r=`${" ".repeat(n)}${this.name}: ${this._completedUnits} of ${this._totalUnits} units, ${Math.floor(this.getFraction()*100)} %, cancel=${this._isCancelled}
|
|
12
|
+
`;for(let o of this._children)r+=o.toString(n+1);return n===0?r.trim():r}};function Vc(e={}){let{maxParallel:t=3,name:n=R("pool"),idConflictResolution:r="memoize"}=e,o=new S,i=Q();i.add(T);let s=new ce({name:n});s.on("progressCancelled",T);let u=0,a=0,c=0,f=0,l={};async function g(){if(u>0){let[h,y]=Mt();return o.once("didFinish",y),h}}async function d(){for(let h of Object.keys(l))l[h].state==="finished"&&(await l[h].progress.dispose(),delete l[h]);}function p(){o.emit("didFinish"),u=0,a=0,d(),s.reset();}function b(){let h=0,y=0;for(let{max:L,resolved:v,state:x}of Object.values(l))h+=L,y+=x==="finished"?L:Math.min(L,v);o.emit("didUpdate",u,a,h,y);}function w(){if(b(),u>0&&u===a&&p(),c>=t)return;let h=Object.values(l).filter(y=>y.state==="waiting");if(h.length>0){let y;for(let L of h)L.group!=null&&Object.values(l).some(v=>v.state==="running"&&v.id!==L.id&&v.group===L.group)||(y==null||L.priority<y.priority)&&(y=L);if(y!=null){let L=y.id,v=y.done;y.state="running",++c,o.emit("didStart",L);let x=U=>{y&&(y.result=U,y.state="finished",y.resolved=y.max,y.progress?.setCompleted()),--c,++a,w();};y.task(y).then(U=>{v(U),o.emit("didResolve",L,U),x(U);}).catch(U=>{v(),o.emit("didReject",L,U),x();});}}}function m(h){let y=l[h];y&&y.state==="waiting"&&(l[h].state="finished",++a,o.emit("didCancel",h),l[h].progress.dispose(),b());}function T(){Object.keys(l).forEach(m);}function D(h){return l[h]!=null}function B(h,y={}){let L,v=new Promise(E=>L=E),x=y.id??H();if(l[x]!=null){let E=y.idConflictResolution??r;if(E==="replace")m(x);else if(E==="memoize"||E==="prioritize"){let Lt=l[x];return E==="prioritize"&&(Lt.priority=++f),{id:x,promise:(async()=>{if(Lt.state==="finished")return l[x].result})(),dispose:()=>m(x),cancel:()=>m(x)}}else throw new Error(`Pool task with id=${x} already exists!`)}let U=new ce({name:x,totalUnits:y.max??1,completeUnits:y.resolved??0});return s.addChild(U),l[x]={id:x,task:h,priority:++f,group:y.group,state:"waiting",max:y.max??1,resolved:y.resolved??0,done:L,payload:y.payload,progress:U,setMax(E){U.setTotalUnits(E),l[x].max=E,b();},setResolved(E){U.setCompletetedUnits(E),l[x].resolved=E,b();},incResolved(E=1){U.incCompletedUnits(E),l[x].resolved+=E,b();}},++u,w(),{id:x,promise:v,dispose:()=>m(x),cancel:()=>m(x)}}return {events:o,cancel:m,cancelAll:T,hasById:D,progress:s,enqueue:B,dispose:i,waitFinishAll:g}}var Mn=class extends S{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:r=R("queue"),logLevel:o}=n;this.name=r,this.log=I(`zeed:queue:${r}`,o??9007199254740991);}async performNext(){if(this.log("performNext, queue.length =",this.queue.length),this.currentTask!=null){this.log("performNext => skip while another task is running");return}if(this.paused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.paused;){let n=this.queue.shift();if(this.log(`performNext => ${n?.name}`),n==null)break;this.countResolved===0&&this.emit("didStart",this.countMax);let{name:r,task:o,resolve:i}=n;this.currentTask=o();let s;try{this.log.info(`start task ${r}`),s=await this.currentTask,this.log(`finished task ${r} with result =`,s);}catch(u){this.log.warn("Error performing task",u);}i(s),this.currentTask=void 0,this.countResolved+=1,this.emit("didUpdate",this.countMax,this.countResolved);}for(this.queue.length===0&&(this.emit("didFinish"),this.countMax=0,this.countResolved=0);this.waitToFinish.length>0;)this.waitToFinish.shift()();}async enqueue(n,r={}){let{immediate:o=!1,name:i=R(this.name)}=r;return o?(this.log.info(`immediate execution ${i}`),await n()):(this.log(`enqueue ${i}`),new Promise(s=>{this.queue.push({name:i,task:n,resolve:s}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext();}))}async enqueueReentrant(n,r={}){return this.enqueue(n,{immediate:this.currentTask!=null,name:r.name})}async cancelAll(n=!0){this.log("cancelAll"),this.emit("didCancel");let r=this.queue.map(o=>o.resolve);this.queue=[],r.forEach(o=>o(void 0)),await this.wait();}async pause(){this.log("pause"),this.paused=!0,await this.wait();}resume(){this.log("resume"),this.paused=!1,this.performNext();}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.paused)))return new Promise(n=>{this.waitToFinish.push(n);})}get isPaused(){return this.paused}get hasTasks(){return this.queue.length!==0}};function Wc(e,t={}){let{delay:n=100,trailing:r=!0,leading:o=!0}=t,i=0,s=0,u=0,a;function c(){return i?(clearTimeout(i),i=void 0,!0):!1}function f(...l){let g=Date.now(),d=g-s,p=()=>{u=0,s=Date.now(),e.apply(this,l);};if(a=p,d>n||!i){o&&(d>n?p():++u);let b=d>n?n:n-d;c(),s=g,i=setTimeout(()=>{i=0,r&&(!o||u>0)&&a?.();},b);}else ++u;}return f.cancel=c,f.stop=()=>{c()&&a&&a();},f.immediate=async function(...g){c(),s=Date.now(),e.apply(this,g);},f.dispose=()=>f.stop(),f}function Jc(e,t={}){let{delay:n=100}=t,r=0,o=!1,i;function s(){r&&(clearTimeout(r),r=0);}async function u(){try{if(s(),i!=null){let f=[...i];i=void 0,o=!0,await V(e(...f)),o=!1,i!=null&&(s(),r=setTimeout(u,n));}}catch{}}function a(...f){i=[...f],s(),o===!1&&(r=setTimeout(u,n));}async function c(...f){s(),i=[...f],await u();}return a.cancel=s,a.dispose=s,a.immediate=c,a}function Co(e,t=0){let n=setTimeout(e,t);return ()=>{n&&(clearTimeout(n),n=void 0);}}function Uo(e,t){let n=setInterval(e,t);return ()=>{n&&(clearInterval(n),n=void 0);}}function Do(e,t,n=!1){let r,o=!1;async function i(s=!1){s&&await V(e()),o||(r=setTimeout(()=>i(!0),t));}return i(n),()=>{r&&(o=!0,clearInterval(r),r=void 0);}}function Eo(e,t,n,...r){return e==null?()=>{}:(e.on?e.on(t,n,...r):e.addEventListener&&e.addEventListener(t,n,...r),()=>{e.off?e.off(t,n,...r):e.removeEventListener&&e.removeEventListener(t,n,...r);})}function Fo(e,t,n,...r){return e==null?()=>{}:(e.on?e.once(t,n,...r):e.addEventListener&&e.addEventListener(t,n,...r),()=>{e.off?e.off(t,n,...r):e.removeEventListener&&e.removeEventListener(t,n,...r);})}function Xc(e){let t=Q(e);return Object.assign(t,{timeout:(n,r=0)=>t.add(Co(n,r)),interval:(n,r=0)=>t.add(Uo(n,r)),intervalPause:(n,r=0)=>t.add(Do(n,r)),on:(n,r,o,...i)=>t.add(Eo(n,r,o,...i)),once:(n,r,o,...i)=>t.add(Fo(n,r,o,...i))})}function el(e=globalThis?.location?.hostname??""){return ["::ffff:127.0.0.1","localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}var Tt={cache:"no-cache",redirect:"follow",headers:{}};function Po(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[n,r]=t[1].split(":",2);return {url:e.replace(`${t[1]}@`,""),username:n,password:r}}}async function Bn(e,t={},n=fetch){try{O(t)&&(t=xe({},...G(t)));let r=Po(String(e));r&&(e=r.url,t=xe({},t,Io(r.username,r.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let o=await n(String(e),t);if(o.status<400)return o;let i=I("zeed:network");try{i.warn(`Fetch of ${String(e)} returned status=${o.status}. Options:`,t),i.warn(`Response: ${await o.text()}`);}catch(s){i.error("Exception:",s);}}catch(r){I("zeed:network").error("fetchBasic",r);}}async function il(e,t={},n=fetch){try{let r=await Bn(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(r)return await r.json()}catch(r){I("zeed:network").error("fetchJSON error:",r);}}async function sl(e,t={},n=fetch){try{let r=await Bn(e,[Tt,{method:"GET"},t],n);if(r)return await r.text()}catch(r){I("zeed:network").error("fetchHTML error:",r);}}function al(e,t="POST"){return {method:t,...Tt,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:Yt(e)}}function ul(e,t="POST"){return {method:t,...Tt,headers:{"Content-Type":"application/json; charset=utf-8"},body:k(e)}}function Io(e,t){return {headers:{Authorization:`Basic ${ne(`${e}:${t}`)}`}}}function On(){if(typeof window<"u")return window}function So(){if(typeof navigator<"u")return navigator}function ll(){return On()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}function fl(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,test:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){let t=So(),n=On();return e.ios=t?.platform?.match(/(iPhone|iPod|iPad)/i)!=null,e.macos=!!t?.platform?.startsWith("Mac"),e.windows=!!t?.platform?.startsWith("Win"),e.beaker=n?.beaker!=null,e.electron=(t?.userAgent?.toLowerCase()?.indexOf(" electron/")||-1)>-1&&!e.beaker,e.wkwebview=n?.webkit?.messageHandlers!=null,e.pwa=t?.serviceWorker!=null,e.pwaInstalled=t?.standalone||n?.matchMedia?.("(display-mode: standalone)")?.matches,e.node=typeof process<"u"&&process?.release?.name==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,e.jest=typeof jest<"u"||typeof vitest<"u",e.test=e.jest,e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=n&&"ontouchstart"in n||(t?.maxTouchPoints||0)>1||t?.msPointerEnabled&&n?.MSGesture||n?.DocumentTouch&&document instanceof DocumentTouch,e}function ko(){return typeof window<"u"&&globalThis===window}function pl(e){ko()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e);}var _n=class{constructor(t={}){this.store={};}setItem(t,n){this.store[t]=tt(n);}getItem(t){return tt(this.store[t])}removeItem(t){delete this.store[t];}clear(){this.store={};}allKeys(){return Object.keys(this.store)}};function yl(){}
|
|
13
13
|
|
|
14
|
-
export {
|
|
14
|
+
export { Yn as $, Bt as $a, Ms as $b, oe as $c, tc as $d, zn as A, er as Aa, ps as Ab, ca as Ac, Tn as Ad, Co as Ae, G as B, Ei as Ba, ds as Bb, la as Bc, oo as Bd, Uo as Be, Gn as C, Fi as Ca, gs as Cb, fa as Cc, Eu as Cd, Do as Ce, Ko as D, Si as Da, ms as Db, pa as Dc, Fu as Dd, Eo as De, vt as E, ki as Ea, ur as Eb, da as Ec, vn as Ed, Fo as Ee, Yo as F, Ri as Fa, hs as Fb, ga as Fc, Cn as Fd, Xc as Fe, qe as G, tr as Ga, bs as Gb, ma as Gc, Su as Gd, el as Ge, Xo as H, nr as Ha, xs as Hb, ya as Hc, so as Hd, Po as He, Qo as I, rr as Ia, Ls as Ib, Jt as Ic, ku as Id, Bn as Ie, ei as J, Ye as Ja, As as Jb, Zt as Jc, Q as Jd, il as Je, qn as K, Mi as Ka, jt as Kb, xa as Kc, $u as Kd, sl as Ke, ti as L, Bi as La, vs as Lb, xr as Lc, ju as Ld, al as Le, Wn as M, Oi as Ma, Cs as Mb, La as Mc, Hu as Md, ul as Me, Ct as N, _i as Na, Us as Nb, Kt as Nc, S as Nd, Io as Ne, ni as O, or as Oa, tt as Ob, Ua as Oc, Ju as Od, On as Oe, ri as P, $i as Pa, Ds as Pb, kr as Pc, ht as Pd, So as Pe, oi as Q, Vi as Qa, Es as Qb, Yt as Qc, uo as Qd, ll as Qe, ii as R, Hi as Ra, Fs as Rb, Da as Rc, co as Rd, fl as Re, si as S, zi as Sa, Ps as Sb, Ia as Sc, lo as Sd, ko as Se, ai as T, Gi as Ta, M as Tb, Sa as Tc, fo as Td, pl as Te, ui as U, qi as Ua, nt as Ub, Br as Uc, po as Ud, _n as Ue, ci as V, Wi as Va, O as Vb, Ra as Vc, go as Vd, yl as Ve, li as W, Mt as Wa, he as Wb, tn as Wc, yo as Wd, pi as X, Zi as Xa, ks as Xb, Or as Xc, ho as Xd, k as Y, Ki as Ya, be as Yb, q as Yc, bo as Yd, di as Z, Yi as Za, Ht as Zb, rt as Zc, Dn as Zd, Kn as _, Xi as _a, Rs as _b, Te as _c, ec as _d, z as a, Ut as aa, Qi as ab, zt as ac, Le as ad, wo as ae, te as b, Dt as ba, P as bb, Bs as bc, nn as bd, nc as be, le as c, A as ca, V as cb, Os as cc, Vr as cd, rc as ce, _e as d, yi as da, Ot as db, _s as dc, rn as dd, H as de, $e as e, Et as ea, Qe as eb, $s as ec, I as ed, Fn as ee, Ve as f, Ft as fa, _t as fb, cr as fc, Ja as fd, To as fe, Ne as g, ne as ga, ir as gb, Vs as gc, Ae as gd, oc as ge, je as h, hi as ha, ts as hb, Ns as hc, Nr as hd, R as he, At as i, de as ia, $t as ib, js as ic, Ka as id, ic as ie, Vn as j, bi as ja, Vt as jb, lr as jc, sn as jd, xt as je, F as k, Pt as ka, ns as kb, fr as kc, Ya as kd, Oe as ke, Bo as l, We as la, rs as lb, xe as lc, tu as ld, cc as le, Oo as m, Je as ma, ye as mb, pr as mc, jr as md, Pn as me, _o as n, It as na, os as nb, Gt as nc, Hr as nd, ee as ne, $o as o, Qn as oa, Xe as ob, Ws as oc, an as od, In as oe, Nn as p, $ as pa, sr as pb, Zs as pc, wn as pd, Sn as pe, Vo as q, Ze as qa, ar as qb, Ks as qc, wu as qd, xc as qe, No as r, St as ra, et as rb, Ys as rc, Tu as rd, wt as re, jo as s, Ti as sa, Nt as sb, Xs as sc, Lu as sd, Cc as se, Ho as t, Li as ta, is as tb, ta as tc, Au as td, Dc as te, jn as u, Ai as ua, ss as ub, na as uc, vu as ud, Ec as ue, Go as v, vi as va, me as vb, ra as vc, ro as vd, ce as ve, ze as w, Ke as wa, as as wb, we as wc, Cu as wd, Vc as we, qo as x, kt as xa, us as xb, aa as xc, X as xd, Mn as xe, Ge as y, Ci as ya, cs as yb, re as yc, Ln as yd, Wc as ye, Hn as z, Di as za, N as zb, Wt as zc, mt as zd, Jc as ze };
|
|
15
15
|
//# sourceMappingURL=out.js.map
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-PJUDSJKG.js.map
|