zeed 0.11.1 → 0.11.3

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.
@@ -0,0 +1,16 @@
1
+ function Bn(){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 W(){let e=Bn();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}function ge(e={}){let{level:t=void 0,filter:n=void 0}=e,r=Z(n),o=de(t);return i=>{if(!o(i.level)||!r(i.name))return;let a=i.name?`[${i.name}]`:"";switch(i.level){case N:console.info(`I|* ${a}`,...i.messages);break;case j:console.warn(`W|** ${a}`,...i.messages);break;case H:console.error(`E|*** ${a}`,...i.messages);break;default:console.debug(`D| ${a}`,...i.messages);break}}}var $=-1,z=0,N=1,j=2,H=3,ye=4,Y=9007199254740991,At={"*":$,a:$,all:$,d:z,dbg:z,debug:z,i:N,inf:N,info:N,w:j,warn:j,warning:j,e:H,err:H,error:H,fatal:ye,off:Y,"-":Y};function Lt(e=""){let t=[ge()],n=u=>!0,r=!1,o=a,i=!1;function a(u="",c){let f=Ne(c??$);function l(p,y){return f<=p?y:()=>{}}let d=l(z,(...p)=>{g({name:u,messages:p,level:z});});d.label=u,d.extend=function(p){return o(u?`${u}:${p}`:p)};let g=p=>{if(n(u))for(let y of t)y&&y(p);};return d.debug=l(z,(...p)=>{g({name:u,messages:p,level:z});}),d.info=l(N,(...p)=>{g({name:u,messages:p,level:N});}),d.warn=l(j,(...p)=>{g({name:u,messages:p,level:j});}),d.error=l(H,(...p)=>{g({name:u,messages:p,level:H});}),d.fatal=l(ye,(...p)=>{throw g({name:u,messages:p,level:ye}),new Error(`${p.map(String).join(" ")}`)}),d.assert=l(ye,(p,...y)=>{(p==null||typeof p=="number"&&Number.isNaN(p)||!p)&&d.fatal(...y);}),d}function s(u="",c){let f=o(u,c);return i&&f.debug(`+++ init of logger "${u}" on level "${f.level}".`),f}return s.registerHandler=function(u){t.push(u);},s.setFilter=function(u){n=Z(u);},s.setLock=(u=!0)=>r=u,s.setDebug=(u=!0)=>i=u,s.setHandlers=function(u=[]){o!==a&&(o=a),!r&&(t=[...u].filter(c=>typeof c=="function"));},s.level=$,s.setLogLevel=function(u=$){r||(s.level=u);},s.setFactory=function(u){r||(o=u);},s}function On(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 _n(){return On(typeof process<"u"?process.env.ZEED??process.env.DEBUG:typeof localStorage<"u"?localStorage.zeed??localStorage.debug:"*")}function Z(e=_n()){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,]+/),a=i.length;for(o=0;o<a;o++){if(!i[o])continue;let s=i[o].replace(/\*/g,".*?");s[0]==="-"?n.push(new RegExp(`^${s.substr(1)}$`)):r.push(new RegExp(`^${s}$`));}t=function(s){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(s))return !1;for(u=0,c=r.length;u<c;u++)if(r[u].test(s))return !0;return !1};}return t.accept=r,t.reject=n,t.filter=e,t}function $n(){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 Ne(e){if(e===!1)return Y;if(typeof e=="number")return e;if(typeof e=="string"){let t=At[e.toLocaleLowerCase().trim()];if(t!=null)return t}return $}function de(e=$n()){let t=Ne(e);return n=>n>=t}var O;function je(e){let t=Lt();return e?e(t):t.setHandlers([ge()]),t}function Vn(e){if(O==null)try{let t=W();t!=null?t?.logger==null?(O=je(e),t.logger=O):O=t.logger:O=je(e);}catch{O=je(e);}return O}function Ct(){if(O!=null)return O;try{let e=W();if(e?.logger!=null)return e.logger}catch{}}function R(e,t){return Vn()(e,t)}function Nn(...e){throw Ct()?.("assert")?.fatal(...e),new Error(`${e.map(String).join(" ")}`)}function jn(e,...t){(e==null||typeof e=="number"&&Number.isNaN(e)||!e)&&Nn(...t);}function Ut(e,...t){jn(e,...t);}var Hn=(e,t)=>t instanceof Object&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,r)=>(n[r]=t[r],n),{}):t;function vo(e,t=void 0){return JSON.stringify(e,Hn,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 a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?r.splice(a,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 M(e,t,n,r){return JSON.stringify(e,zn(t??void 0,r),n??void 0)}var Eo=M;function Gn(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 qn(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 me;function Dt(e){if(me==null&&(me=Gn,typeof TextEncoder<"u")){let t=new TextEncoder;me=n=>t.encode(n);}return me(e.normalize("NFC"))}var he;function vt(e){if(he==null&&(he=qn,typeof TextDecoder<"u")){let t=new TextDecoder("utf-8",{ignoreBOM:!0});he=n=>t.decode(n);}return he(e).normalize("NFC")}function L(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Dt(e):e.length?new Uint8Array(e):e}function Ro(...e){let t=0,n=e.flat(1).map(i=>{let a=L(i);return t+=a.length,a}),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(L(e)).toString("hex");let t="0123456789abcdef",n="";for(let r of [...L(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 ie(e,t=!1){let n=L(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 So(e){let t=L(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 xe(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 Mo(e){return vt(xe(e))}function Pt(e,t){if(e.byteLength!==t.byteLength)return !1;let n=L(e),r=L(t);for(let o=0;o<n.length;o++)if(n[o]!==r[o])return !1;return !0}function He(e){return Dt(M(e))}function ze(e){return JSON.parse(vt(e))}function Rt(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)),a=`0000${o.toString(16)}`.slice(-4),s=i.split("").map(c=>{let f=c.charCodeAt(0);return ` ${r[(240&f)>>4]}${r[15&f]}`}).join("");s+=" ".repeat(t-i.length);let u=i.replace(/[\x00-\x1F\x20\x7F-\xA0\xAD]/g,".");u+=" ".repeat(t-i.length),n.push(`${a} ${s} ${u}`);}return n.join(`
2
+ `)}var K;function Mt(){return K===void 0&&(K=(typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}))??null,K&&K.decode(new Uint8Array).length===1&&(K=null)),K}var kt="Unexpected end of array",Bt="Integer out of Range",Ge=class{constructor(t){this.arr=t,this.pos=0;}};function Ae(e){return new Ge(e)}function qe(e,t){let n=ue(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n}function X(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(Bt)}throw new Error(kt)}function Le(e){return qe(e,X(e))}function ae(e){return e.arr[e.pos++]}function Ot(e){let t=e.arr[e.pos]+(e.arr[e.pos+1]<<8);return e.pos+=2,t}function _t(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 Je(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(Bt)}throw new Error(kt)}function Zn(e){let t=X(e);if(t===0)return "";{let n=String.fromCodePoint(ae(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(ae(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 we(e){let t=Mt();return t?t.decode(Le(e)):Zn(e)}function We(e,t){let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n}function Ze(e){return We(e,4).getFloat32(0,!1)}function Yn(e){return We(e,8).getFloat64(0,!1)}function Kn(e){return We(e,8).getBigInt64(0,!1)}var Xn=[e=>{},e=>null,Je,Ze,Yn,Kn,e=>!1,e=>!0,we,e=>{let t=X(e),n={};for(let r=0;r<t;r++){let o=we(e);n[o]=Q(e);}return n},e=>{let t=X(e),n=[];for(let r=0;r<t;r++)n.push(Q(e));return n},Le];function Q(e){return Xn[127-ae(e)](e)}function ue(e,t,n){return new Uint8Array(e,t,n)}var Ye=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[];}};function De(){return new Ye}function Ke(e){let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t}function ve(e){let t=new Uint8Array(Ke(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(ue(e.cbuf.buffer,0,e.cpos),n),t}function Qn(e,t){let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(ue(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 Nt=C;function jt(e,t){C(e,t&255),C(e,t>>>8&255);}function Ht(e,t){for(let n=0;n<4;n++)C(e,t&255),t>>>=8;}function G(e,t){for(;t>127;)C(e,128|127&t),t=Math.floor(t/128);C(e,127&t);}function er(e){return e!==0?e<0:1/e<0}function Xe(e,t){let n=er(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 Ee(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 Fe(e,t){G(e,t.byteLength),Ee(e,t);}function nr(e,t){let n=unescape(encodeURIComponent(t)),r=n.length;G(e,r);for(let o=0;o<r;o++)C(e,n.codePointAt(o));}function Ue(e,t){return nr(e,t)}function Qe(e,t){Qn(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n}function et(e,t){return Qe(e,4).setFloat32(0,t,!1)}function rr(e,t){return Qe(e,8).setFloat64(0,t,!1)}function or(e,t){return Qe(e,8).setBigInt64(0,t,!1)}var Ce;function ir(e){return Ce==null&&(Ce=new DataView(new ArrayBuffer(4))),Ce.setFloat32(0,e),Ce.getFloat32(0)===e}function te(e,t){switch(typeof t){case"string":C(e,119),Ue(e,t);break;case"number":Number.isInteger(t)&&Math.abs(t)<=2147483647?(C(e,125),Xe(e,t)):ir(t)?(C(e,124),et(e,t)):(C(e,123),rr(e,t));break;case"bigint":C(e,122),or(e,t);break;case"object":if(t===null)C(e,126);else if(Array.isArray(t)){C(e,117),G(e,t.length);for(let n=0;n<t.length;n++)te(e,t[n]);}else if(t instanceof Uint8Array)C(e,116),Fe(e,t);else {C(e,118);let n=Object.keys(t);G(e,n.length);for(let r=0;r<n.length;r++){let o=n[r];Ue(e,o),te(e,t[o]);}}break;case"boolean":C(e,t?120:121);break;default:C(e,127);}}var zt=class{async encode(t){let n=De();return te(n,t),ve(n)}async decode(t){return Q(Ae(L(t)))}};function Yo(e){let t=De();return te(t,e),ve(t)}function Ko(e){return Q(Ae(L(e)))}function Xo(e){let t=De();return e!=null&&Ee(t,L(e)),{writeBytes:(n,r)=>{let o=L(n);Ut(!(r!=null&&o.length!==r),`Expected ${r} bytes, got ${o.length}`),Ee(t,o);},writeBytesVar:n=>Fe(t,L(n)),writeUintVar:n=>G(t,n),writeUint8:n=>Nt(t,n),writeUint16:n=>jt(t,n),writeUint32:n=>Ht(t,n),writeIntVar:n=>Xe(t,n),writeFloat:n=>et(t,n),writeStringVar:n=>Ue(t,n),write:n=>te(t,n),getUint8Array:()=>ve(t),getLength:()=>Ke(t)}}function Qo(e){let t=Ae(L(e));return {readBytes:n=>qe(t,n),readBytesVar:()=>Le(t),readUintVar:()=>X(t),readUint8:()=>ae(t),readUint16:()=>Ot(t),readUint32:()=>_t(t),readIntVar:()=>Je(t),readFloat:()=>Ze(t),readStringVar:()=>we(t),read:()=>Q(t),getOffset:()=>t.pos||0}}function ei(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 sr(e){return await e.arrayBuffer()}async function ti(e){let t=await sr(e);if(t!=null)return L(t)}function ne(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 qt="SHA-256",tt="AES-GCM",Gt="PBKDF2",ar=1e5;async function oi(e,t=qt){return L(await crypto.subtle.digest(t,L(e)))}async function ii(e,t={}){let n=L(e),r=await crypto.subtle.importKey("raw",n,Gt,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:Gt,salt:t.salt?L(t.salt):new Uint8Array(0),iterations:t.iterations??ar,hash:qt},r,{name:tt,length:256},!0,["encrypt","decrypt"])}function Jt(){return new Uint8Array([1,1])}async function Wt(e,t){let n=Jt(),r=ne(12),o=await crypto.subtle.encrypt({name:tt,iv:r},t,e),i=new Uint8Array(o),a=n.length+r.length+i.length,s=new Uint8Array(a),u=0;return s.set(n,u),u+=n.length,s.set(r,u),u+=r.length,s.set(i,u),s}async function Zt(e,t){let n=e.subarray(0,2);if(!Pt(n,Jt()))return Promise.reject(new Error(`Unknown magic ${n}`));let r=e.subarray(2,2+12),o=e.subarray(2+12,e.length),i=await crypto.subtle.decrypt({name:tt,iv:r},t,o);return new Uint8Array(i)}function ur(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}function v(){return typeof crypto<"u"?ur():Math.random()}function ai(e=.25){return v()<e}function ui(e=100,t=0){return t+Math.floor(v()*(e-t))}function ci(e=100,t=0){return t+v()*(e-t)}function li(e,t,n){return Math.max(e,Math.min(n,t))}function cr(e){return e.reduce((t,n)=>t+n,0)}function fi(e){return cr(e)/e.length}function pi(e){return !/^1?$|^(11+?)\1+$/.test("1".repeat(e))}function di(e){for(let t=2;t<e;t++)if(e%t===0)return !1;return e>1}var nt=6;function gi(e=0,t=1,n){nt=((n??nt)*9301+49297)%233280;let r=nt/233280;return t+r*(e-t)}function lr(e=""){let[t="",n="asc"]=e.split(" ");return n=n.toLowerCase(),{field:t,orderby:n,asc:n!=="desc",desc:n==="desc"}}function mi(e,t=!0){return `${e} ${t?"asc":"desc"}`}function rt(e,t,n=!0){let r=e||0,o=t||0;return r>o?n?1:-1:r<o?n?-1:1:0}function hi(e,...t){if(t.length>0){let n=t.map(lr),r=Array.from(e);return r.sort((o,i)=>{for(let{field:a,asc:s}of n){let u=rt(o[a],i[a],s);if(u!==0)return u}return 0}),r}return e}function ot(e){return e.filter((t,n)=>e.indexOf(t)===n)}function fr(e,t){return ot(e.filter(n=>!t.includes(n)))}function pr(...e){return ot(e.reduce((t=[],n)=>t.concat(n),[]))}function re(...e){return e.flat(Number.POSITIVE_INFINITY)}function dr(e,t){return ot(e).filter(n=>t.includes(n))}function wi(e,t){return fr(pr(e,t),dr(e,t))}function Yt(e,t){if(e&&Array.isArray(e)){let n;for(;(n=e.indexOf(t))!==-1;)e.splice(n,1);return e}return []}function Ai(e,t){return e.includes(t)||e.push(t),e}function it(e,t){return e.splice(0,e.length,...e.filter(t)),e}function Li(e,t){let n=e.findIndex(r=>r===t);return n>=0?e.splice(n,1):e.push(t),e}function Ci(e){return e.splice(0,e.length),e}function gr(e,t=rt){return Array.from(e).sort(t)}function Ui(e){return gr(e,(t,n)=>t-n)}function yr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function Kt(e){return e.sort(()=>v()>.5?1:-1),e}function Di(e){return Kt(Array.from(e))}function vi(e){for(;e.length>1;){let t=Array.from(e);if(Kt(t),!yr(e,t))return t}return e}function Ei(e){return e[Math.floor(v()*e.length)]}function Fi(...e){return re(e).reduce((t,n)=>t!=null?n>t?n:t:n,void 0)}function Pi(...e){return re(e).reduce((t,n)=>t!=null?n<t?n:t:n,void 0)}function Ri(...e){return re(e).reduce((t,n)=>t+n,0)}function Si(...e){let t=re(e);return t.reduce((n,r)=>n+r,0)/t.length}function Mi(e,t){let n=[],r=0,o=e.length;for(;r<o;)n.push(e.slice(r,r+=t));return n}function Ii(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 mr={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 hr(e){let t=mr[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),a=Math.log(256)/Math.log(r);function s(c,f=-1){let l=L(c);if(l.byteLength===0)return "";let d=0,g=0,p=l.byteLength;for(;g!==p&&l[g]===0;)g++;let y=(p-g)*a+1>>>0,b=new Uint8Array(y);for(;g!==p;){let E=l[g],B=0;for(let h=y-1;(E!==0||B<d)&&h!==-1;h--,B++)E+=256*b[h]>>>0,b[h]=E%r>>>0,E=E/r>>>0;if(E!==0)throw new Error("Non-zero carry");d=B,g++;}let x=y-d;for(;x!==y&&b[x]===0;)x++;let U="";for(;x<y;++x)U+=t.charAt(b[x]);return f>0?U.padStart(f,o):U}function u(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,d=0;for(;c[l]===o;)l++;let g=(c.length-l)*i+1>>>0,p=new Uint8Array(g);for(;c[l];){let b=n[c.charCodeAt(l)];if(b===255)throw new Error(`Unsupported character "${c[l]}"`);let x=0;for(let U=g-1;(b!==0||x<d)&&U!==-1;U--,x++)b+=r*p[U]>>>0,p[U]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");d=x,l++;}let y=g-d;for(;y!==g&&p[y]===0;)y++;return f>0?new Uint8Array([...new Uint8Array(f-p.length+y),...p.slice(y)]):p.slice(y)}return {encode:s,decode:u}}var Pe;function V(e){Pe==null&&(Pe=new Map);function t(){let o=Pe.get(e);return o==null&&(o=hr(e),Pe.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 st(e,t=-1){return V(32).encode(e,t)}function Xt(e,t=-1){return V(32).decode(e.toLocaleLowerCase().replaceAll("l","1").replaceAll("s","5").replaceAll("o","0").replaceAll("i","1"),t)}function Oi(e,t=-1){return V(16).encode(e,t)}function _i(e,t=-1){return V(16).decode(e,t)}function $i(e,t=-1){return V(58).encode(e,t)}function Vi(e,t=-1){return V(58).decode(e,t)}function at(e,t=-1){return V(62).encode(e,t)}function Qt(e,t=-1){return V(62).decode(e,t)}function Ni(e,t){return Math.ceil(e*(Math.log(256)/Math.log(t)))}function Hi(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 xr(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}function zi(e){return e.replace(/\w\S*/g,xr)}function Gi(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 en=["1","true","yes","y","on"];function Wi(e,t=!1){return e==null||typeof e!="string"?t:en.includes(String(e).trim().toLowerCase())}function Zi(e,t=0){return e==null||typeof e!="string"?t:Number.parseInt(e.trim(),10)??t}function Yi(e,t=0){return e==null||typeof e!="string"?t:Number.parseFloat(e.trim())??t}function br(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:en.includes(String(e).trim().toLowerCase())}function Tr(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 wr(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 ut(e,t=""){return e==null?t:String(e)??t}var Ki=wr,Xi=Tr,Qi=ut,es=br;function Ar(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
+ ${Rt(o)}
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 ts(e,t={}){return Ar(e,t).join(" ")}function ns(e){try{return decodeURIComponent(escape(e))}catch{}return e}function is(e){if(e.startsWith("data:"))return xe(e.split(",",2)[1])}function ss(e){if(e.startsWith("data:"))return e.slice(5).split(",",2)[0]}function as(e){if(e.startsWith("data:")){let[t,n]=e.slice(5).split(",",2);return new Blob([xe(n)],{type:t})}}async function us(e){let t=await e.arrayBuffer();if(t)return `data:${e.type},${ie(t)}`}function cs(e,t="application/octet-stream"){return `data:${t},${ie(e)}`}var tn=864e5;function lt(e){return Math.floor(e/1e4)}function nn(e){return Math.floor(e/100%100)}function Lr(e){return Math.floor(e%100)}function fs(e){return [lt(e),nn(e),Lr(e)]}function rn(e,t=!1){return t?new Date(`${Ur(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}function on(){return Se(new Date)}function ps(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return sn(e);if(Array.isArray(e)&&e.length===3){let[n,r,o]=e;return ft(n,r,o)}else if(e instanceof Date)return Se(e,t)}function ds(e){return rn(e,!0)}function Se(e,t=!1){return t?sn(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}function gs(e){return Se(e,!0)}function ct(e,t=!0){return rn(e,t).getTime()}function Cr(e,t=!0){return Se(new Date(e),t)}function Ur(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}function ft(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}function sn(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return +t}function ys(e,t=0){let n=lt(e),r=nn(e);return t!==0&&(r+=t,n+=Math.floor((r-1)/12),r=Math.floor((r-1)%12)+1,r===0&&(r=12)),ft(n,r,1)}function ms(e,t=0){let n=lt(e);return ft(n+t,1,1)}function Re(e,t){return Cr(ct(e)+t*864e5)}function hs(e,t){return Math.round((ct(t)-ct(e))/864e5)}function xs(e,t){let n=[];for(t==null&&(t=on()),e<0&&(e=Re(t,e+1));e<=t;)n.push(e),e=Re(e,1);return n}function*bs(e,t){let n=[];for(t==null&&(t=on()),e<0&&(e=Re(t,e+1));e<=t;)yield e,e=Re(e,1);return n}function an(){let e,t;return [new Promise((r,o)=>{e=r,t=o;}),e,t]}async function ws(e){return new Promise(t=>setTimeout(t,e))}async function As(){return new Promise(e=>setTimeout(e,0))}async function Ls(e,t,n="timeoutReached"){return new Promise(async(r,o)=>{let i=!1,a=setTimeout(()=>{i=!0,r(n);},t);try{let s=await e;clearTimeout(a),i||r(s);}catch(s){clearTimeout(a),i||o(s);}})}function Cs(e){return e==="timeoutReached"||e?.name==="Timeout reached"}async function un(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 a=await e;clearTimeout(i),o||n(a);}catch(a){clearTimeout(i),o||r(a);}})}function Us(e,t,n=1e3){return new Promise((r,o)=>{let i=u=>{s&&(clearTimeout(s),a(),r(u));},a=()=>{s=null,e.off?e.off(t,i):e.removeEventListener&&e.removeEventListener(t,i);},s=setTimeout(()=>{a(),o(new Error("Did not response in time"));},n);e.on?e.on(t,i):e.addEventListener&&e.addEventListener(t,i);})}function F(e){return !!(e&&(e instanceof Promise||typeof e.then=="function"))}function le(e){return Promise.resolve(e)}var q=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 Es(e,t,n){let r=q.from(e),o=q.from(t);for(;r&&o&&r?.days<=o?.days;){let i=n(r);F(i)&&await i,r=r.dayOffset(1);}}function Fs(){return new q}function Ps(e){return new q(e)}function Rs(e){return q.fromDate(new Date(e)).days}function Dr(e,t=2){return +(+e).toFixed(t)}function Ms(e,t=2){return +(+e/10**t).toFixed(t)}function Is(e,t=2){return Math.round(+e*10**t)}function ks(e,t=2){return t*(Dr(e,t)%1)}function _s(e,t,n){let r=e[t];return r===void 0&&(r=n(t,e),e[t]=r),r}async function $s(e,t,n){let r=e[t];return r===void 0&&(r=await n(t,e),e[t]=r),r}function cn(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 Ns(e){return e!=null&&e.length>0?e[e.length-1]:void 0}function js(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 pt(e){return Object(e)!==e?e:JSON.parse(M(e))}function Hs(e){return Object(e)!==e?e:JSON.parse(M(e))}function zs(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 Gs(e){let t=new Map;return async(...n)=>{let r=M(n);if(t.has(r))return t.get(r);let o=await e(...n);return t.set(r,o),o}}function qs(e,t){let n=[];for(let r=0;r<e;r++)n.push(t(r,e));return n}function k(e){return e!=null&&typeof e=="object"}function dt(e){return Object(e)!==e}function _(e){return Array.isArray(e)}function Me(e){return k(e)&&!_(e)}function Zs(e){return e?.constructor===Object}function ln(e){return typeof e=="string"}function fn(e){return typeof e=="number"&&!Number.isNaN(e)}function Ys(e){return fn(e)&&Number.isInteger(e)}function Ks(e){return fn(e)&&Number.isSafeInteger(e)}function pn(e){return typeof e=="boolean"}function Xs(e){return e==null}function Qs(e){return e==null}function ea(e){return k(e)&&e.constructor.name==="Uint8Array"}function ta(e){return e!=null}function vr(e){return e==null||e===""||k(e)&&cn(e)<=0}function na(e){return !vr(e)}function ra(e){return e!=null&&e!==!1&&e!==!0}function oa(e){return e!=null&&e!==!1&&e!==0&&e!==""}function Er(e,t,n=new WeakSet){if(e===t)return !0;if(n.has(t)||(dt(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(!Er(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(dt(e)||t.add(e),Me(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(_(e))for(let n=e.length-1;n>=0;n--)e[n]===void 0&&e.splice(n,1);return e}function Ie(e,...t){for(let n of t)k(e)||(e={}),!(n==null||!k(n))&&Object.keys(n).forEach(r=>{let o=e[r],i=n[r];Array.isArray(o)&&Array.isArray(i)?e[r]=o.concat(i):k(o)&&k(i)?e[r]=Ie(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 s in e){let u=e[s],c=i?+s:s;if(!(s in t)){o.push({type:"del",path:[c]});continue}let f=t[s],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 d=Pr(u,f,n,n.cyclesFix?r.concat([u]):[]);o=[...o,...d.map(g=>(g.path.unshift(c),g))];}else u!==f&&!(l&&(Number.isNaN(u)?`${u}`==`${f}`:+u==+f))&&o.push({path:[c],type:"upd",value:f});}let a=Array.isArray(t);for(let s in t)s in e||o.push({type:"new",path:[a?+s:s],value:t[s]});return o}function dn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;")}function ca(e){return e.replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&apos;/gi,"'").replace(/&amp;/gi,"&")}function fa(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 pa(e,t){return e.reduce((n,r)=>{let o=String(r[t]);return (n[o]=n[o]||[]).push(r),n},{})}function da(e,t){return Array.from(e.reduce((n,r)=>n.add(r[t]),new Set))}function ga(e,t){return e.map(n=>n[t])}function ha(e,t){return k(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>{let o=t(n,r);return _(o)&&o.length===2?o:[n,o]}).filter(n=>n!=null)):{}}function xa(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}function ba(e){return Object.keys(e).length<=0}var Rr=/[\\\-\[\]\/{}()*+?.^$|]/g;function ke(e){return e?e instanceof RegExp?e.source:e.replace(Rr,"\\$&"):""}var Sr=100,Mr=/^\.+/,Ir=/\.+$/,kr=/[<>:\"/\\|?*\u0000-\u001F\u0080-\u009F]+/gm;function gn(){return kr}function Br(){return /^(con|prn|aux|nul|com\d|lpt\d)$/i}function La(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(gn().test(t))throw new Error("Replacement string cannot contain reserved filename characters");let n=`(${ke(t)})+`;return e=e.replace(gn(),t).replace(Mr,t).replace(Ir,"").replace(new RegExp(n,"gm"),t).trim(),e=Br().test(e)?e+t:e,e.slice(0,Sr)}function fe(e){return Math.abs(e)%1===.5}function yn(e){return e%2===0}var Ua=e=>Math.ceil(e),Da=e=>Math.floor(e),va=e=>Math.round(e),Ea=e=>{let t=Math.round(e);return fe(e)&&yn(t)?t-1:t},Fa=e=>fe(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),Pa=e=>fe(e)?Math.floor(e):Math.round(e),Ra=e=>{let t=Math.round(e);return fe(e)?yn(t)?t:t-1:t},Sa=e=>fe(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e);function mn(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-v()}function hn(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+v()}function ka(e,t,n){let r=n.length,o=e<t;if(r<=0||e>=r-1)return hn(n);if(e<=0)return mn(n);n=Or([...n]);let i=o?-1:0,a=n[e+i].sort_weight||0,u=(n[e+i+1].sort_weight||0)-a;if(u===0)return o?mn(n):hn(n);let c=a+u/2,f=u*.01*(v()-.5);return c+f}function Or(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}function _a(e={}){let{getter:t=s=>s.sort}=e;function n(s){return s.sort((u,c)=>(t(u)||0)-(t(c)||0)),s}function r(s){return s.reduce((u,c)=>Math.min(u,t(c)||0),0)-1-v()}function o(s){return s.reduce((u,c)=>Math.max(u,t(c)||0),0)+1+v()}function i(s,u){s==null&&(s=(u??0)-1),u==null&&(u=(s??0)+1);let c=u-s,f=s+c/2,l=c*.01*(v()-.5);return f+l}function a(s,u,c){let f=c.length,l=s<u;if(f<=0||s>=f-1)return o(c);if(s<=0)return r(c);c=n([...c]);let d=l?-1:0,g=t(c[s+d])||0,y=(t(c[s+d+1])||0)-g;if(y===0)return l?r(c):o(c);let b=g+y/2,x=y*.01*(v()-.5);return b+x}return {start:r,end:o,between:i,move:a,items:n}}var _r=/((?:(?:(?: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 Na(e){return e.split(_r).map((t,n)=>{let r=dn(t);return n%2?`<a target="_blank" href="${r}">${$r(r)}</a>`:r}).join("")}function $r(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}function xn(e){let t=[];for(let[n,r]of Object.entries(e))if(r!=null){Array.isArray(r)||(r=[r]);for(let o of r)o!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(o))}`);}return t.join("&")}function ja(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]),a=decodeURIComponent(o[1]||"");t[i]!=null?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(a)):t[i]=a;}return t}var Vr=/\\\s|\s+|#[^\n]*\n?/gm,Nr=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,bn=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm;function jr(e){return typeof e=="string"?e:e.source||""}function za(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(Vr,s=>s[0]==="\\"?s:"")),!(t instanceof RegExp)){let s=0;o=o.replace(Nr,(u,c)=>(s+=1,c?(c!=="index"&&c!=="length"&&!this.namedGroups[c]&&(this.namedGroups[c]=s),"("):u)),this.names=Object.keys(this.namedGroups);}o=jr(o),bn.lastIndex=0;let a=bn.exec(o);a&&(this.lookBehind={rx:new RegExp(`${a[3]}$(?!\\s)`),expect:a?a[2]==="=":!a},o=o.substr(a[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))}};var Hr=",";function Ja(e,t={}){let{separator:n=Hr}=t,r="";for(let o=0;o<e.length;o++)r+=`${e[o].map(i=>{if(i==null||i==="")return "";if(pn(i))return i?1:0;let a=String(i);return (Me(i)||_(i))&&(a=M(i)),a.includes('"')||a.includes(`
6
+ `)||a.includes(n)?`"${a.replace(/"/g,'""')}"`:a}).join(n)}
7
+ `;return r}function zr(e,t={}){let n=/("((?:(?:[^"]*?)(?:"")?)*)"|([^,;\t\n]*))([,;\t]|\n|\r\n)/g;t.separator&&(n=new RegExp(n.source.replaceAll(",;\\t",ke(t.separator)),n.flags));let r=[],o=[],i,a=`${e.replaceAll(`\r
8
+ `,`
9
+ `).trim()}
10
+ `;for(;i=n.exec(a);){let s=i[2]??i[3]??"";s=s.replaceAll('""','"'),o.push(s),i[4]===`
11
+ `&&(r.push(o),o=[]);}return r}function Wa(e,t={}){let n=zr(e,t),r=n[0];return n.slice(1).map(o=>Object.fromEntries(o.map((i,a)=>[r[a],i])))}function Gr(e){let t;if(typeof e=="function"?t=e():F(e)?t=e:typeof e.dispose=="function"?t=e.dispose():F(e.dispose)?t=e.dispose:typeof e.cleanup=="function"?t=e.cleanup():F(e.cleanup)&&(t=e.cleanup),F(t))return t}function Be(e){let t=e;t!=null&&(ln(t)?t={name:t}:"debug"in t&&"label"in t&&(t={name:t.label,log:t}));let n=t?.name,r=t?.log??R("zeed:dispose"),o=[];function i(c){if(c!=null&&o.includes(c)){it(o,l=>l!==c);let f=Gr(c);if(F(f))return f}}function a(c){if(c!=null)return o.unshift(c),()=>i(c)}function s(c=!1){n&&r.debug(`dispose "${n}": ${o.length} entries`);let f=[];for(;o.length>0;){let l=o[0],d=i(l);if(F(d)){if(c)throw new Error(`Async disposable found: ${l} -> ${d}`);f.push(d);}}if(f.length>0)return Promise.all(f)}function u(){s(!0);}return Object.assign(s,{add:a,remove:i,track:a,untrack:i,dispose:s,disposeSync:u,sync:u,exec:s,getSize(){return o.length},isDisposed(){return o.length<=0}})}function eu(e={}){let{mode:t="fifo"}=e,n=[],r=async(i=!1)=>{for(;n.length>0;){let a=n[0];if(it(n,s=>s!==a),typeof a=="function"){let s=a();if(F(s)){if(i)throw new Error(`Expected sync only function, but found async: ${a}`);await s;}}else if(F(a)){if(i)throw new Error(`Expected sync only function, but found async: ${a}`);await a;}else throw new Error(`Unhandled disposable: ${a}`)}};return Object.assign(r,{add:i=>{t==="lifo"?n.unshift(i):n.push(i);},exec:r,getSize(){return n.length}})}function tu(e,t=0){let n=setTimeout(e,t);return ()=>{n&&(clearTimeout(n),n=void 0);}}function nu(e,t){let n=setInterval(e,t);return ()=>{n&&(clearInterval(n),n=void 0);}}function ru(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 su(){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 au(){let e=!0;return async(t,n)=>{let r=!1;if(e){e=!1;try{let o=t();F(o)&&await o,r=!0;}finally{e=!0;}}else if(n!==void 0){let o=n();F(o)&&await o;}return r}}var S=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this._logEmitter=R("zeed:emitter","warn");this.dispose=Be();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(a=>{try{return le(a(...n))}catch(s){this._logEmitter.warn("emit warning:",s);}return null}).filter(a=>a!=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){let r=this.subscribers[t]||[];return r.push(n),this.subscribers[t]=r,()=>{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 le(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!==n),this}removeAllListeners(){return this.subscribers={},this}};function gu(){let e=W().emitter;return e||(e=new S,W().emitter=e),e}function yu(e,t){let n=Math.round(v()*100),r=[],o,i=(s,u)=>{let c={key:s,obj:u};r.push(c),o&&o();};return t?e.on?e.on(t,s=>{i(t,s);}):e.addEventListener?e.addEventListener(t,s=>{i(t,s);}):e.log.error(n,"Cannot listen to key"):e.onAny?e.onAny((s,u)=>{i(s,u);}):e.log.error(n,"cannot listen to all for",e),(s,u=!0)=>new Promise((c,f)=>{s||(s=t,s||r.length&&(s=r[0].key)),o=()=>{for(;r.length>0;){let l=r.shift();if(l.key===s)o=void 0,c(l.obj);else {if(u)continue;f(new Error(`Expected ${s}, but found ${l.key} with value=${l.obj}`));}break}},o();})}function Oe(){return Date.now()}function qr(e){return e>999?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}function hu(...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 wn(){return typeof performance<"u"?performance.now():Date.now()}function xu(){let e=wn();return function(){let t=wn()-e;return qr(t)}}var _e=16;function yt(){return ne(_e)}function Jr(e=yt()){return at(e,22)}function Wr(e){return at(e,22)}function Zr(e){return Qt(e,_e)}function Yr(e=yt()){return st(e,26)}function Kr(e){return st(e,26)}function Xr(e){return Xt(e,_e)}var Qr="10000000-1000-4000-8000-100000000000",eo=function(){return typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID():Qr.replace(/[018]/g,e=>(e^ne(1)[0]&15>>e/4).toString(16))};function to(e){let t=Et(e);return `${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}function no(e){return Ft(e.replaceAll("-",""))}var An=16e11;function ro(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 Ln(){let e=Oe()-An;return new Uint8Array([...ro(e),...ne(10)])}function Cu(){return io(Ln())}function Uu(e){return oo(Un(e))}function oo(e){return new Date(An+e.slice(0,6).reduce((t,n)=>t*256+n,0))}function Du(){return new Uint32Array(ne(4))[0]}var mt={base62:{uuid:Jr,uuidDecode:Zr,uuidEncode:Wr},base32:{uuid:Yr,uuidDecode:Xr,uuidEncode:Kr},uuidv4:{uuid:eo,uuidDecode:no,uuidEncode:to}},$e="base62",Cn=!1;function vu(e,t=!1){$e=e,Cn=t;}function J(){return mt[$e].uuid(Cn?Ln():yt())}function Un(e){return mt[$e].uuidDecode(e)}function io(e){return mt[$e].uuidEncode(e)}function Eu(e){try{return Un(e).length===_e}catch{}return !1}var gt={};function I(e="id"){return gt[e]==null&&(gt[e]=0),`${e}-${gt[e]++}`}var so=0;function Fu(){return `id-${so++}`}var ht=class extends S{constructor(){super(...arguments);this.id=J();}close(){this.dispose();}},Ve=class extends ht{constructor(){super(...arguments);this.isConnected=!0;}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:J()});}};function Mu(){let e=new Ve,t=new Ve;return e.other=t,t.other=e,[e,t]}var Dn=class{async encode(t){return t}async decode(t){return t}},oe=class{async encode(t){return He(t)}async decode(t){return ze(t)}},vn=class{constructor(t){this.key=t;}async encode(t){let n=He(t);return await Wt(n,this.key)}async decode(t){let n=await Zt(t,this.key);return ze(n)}};function En(e,t,n={}){return new Proxy(n,{get:(r,o)=>o in r?r[o]:(...i)=>e(o,i,t)})}function Hu(e={}){let{name:t=I("hub"),encoder:n=new oe,retryAfter:r=1e3,ignoreUnhandled:o=!0,logLevel:i=!1}=e,a=R(t,i),s={},u,c=[],f,l={},d=()=>{clearTimeout(f);},g=async()=>{if(clearTimeout(f),u){if(u.isConnected)for(;c.length;){let x=c[0];try{u.postMessage(await n.encode(x)),c.shift();}catch(U){a.warn("postMessage",U);break}}c.length>0&&r>0&&(f=setTimeout(g,r));}},p=async x=>{a("enqueue postMessage",x),c.push(x),await g();},y=async x=>{u=x,u.on("connect",g),u.on("message",async U=>{a("onmessage",typeof U);let{name:E,args:B,id:h,result:m,error:w}=await n.decode(U.data);if(E){a(`name ${E} id ${h}`);try{if(s[E]==null)throw new Error(`handler for ${E} was not found`);let A=s[E](...B);F(A)&&(A=await A),a(`result ${A}`),h&&await p({id:h,result:A});}catch(A){let T=A instanceof Error?A:new Error(ut(A));a.warn("execution error",T.name),await p({id:h,error:{message:T.message,stack:T.stack,name:T.name}});}}else if(h)if(a(`response for id=${h}: result=${m}, error=${w}`),l[h]==null)m===void 0?a(`skip response for ${h}`):a.warn(`no response hook for ${h}`);else {let[A,T]=l[h];if(A&&T)if(delete l[h],w){let D=new Error(w.message);D.stack=w.stack,D.name=w.name,a.warn("reject",D.name),T(D);}else a("resolve",m),A(m);}else o||a.warn("Unhandled message",U);}),await g();},b=async(x,U,E={})=>{let{timeout:B=5e3}=E,h=J();return await p({name:x,args:U,id:h}),un(new Promise((m,w)=>l[h]=[m,w]),B)};return e.channel&&y(e.channel),{dispose:d,connect:y,listen(x){Object.assign(s,x);},send(){return En(b,{},{options(x){return En(b,{...x})}})}}}var xt=class extends S{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:r,encoder:o=new oe,channel:i,debug:a=!1}=n;this.channel=i,this.encoder=o,this.debug=a,this.name=r??this.channel.id??I("pubsub"),this.log=R(`${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:s})=>{let u=await this.encoder.decode(s);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 Zu(e){return new xt(e)}var Fn=1;var bt=e=>e,Pn=bt;function Ku(e,t){let{post:n,on:r,eventNames:o=[],serialize:i=bt,deserialize:a=Pn}=t,s=new Map;return r(async u=>{let c=a(u),[f,l,d,g]=c;if(f===1||f===2){let p,y;if(g!=null)try{let b=e[g];p=await b(...l);}catch(b){y=String(b);}else y="Method implementation missing";f===1&&d&&n(i(y?[4,y,d]:[3,p,d]));}else if(d){let p=s.get(d);p!=null&&(f===4?p.reject(l):p.resolve(l)),s.delete(d);}}),new Proxy({},{get(u,c){let f=(...d)=>{n(i([2,d,null,c]));};if(t.onlyEvents||o.includes(c))return f.asEvent=f,f;let l=(...d)=>new Promise((g,p)=>{let y=Fn++;s.set(y,{resolve:g,reject:p}),n(i([1,d,y,c]));});return l.asEvent=f,l}})}function Xu(e){let{post:t,on:n,serialize:r=bt,deserialize:o=Pn}=e,i=[],a={},s=new Map;n(async c=>{let f=o(c),[l,d,g,p]=f;if(l===1||l===2){let y,b;if(p!=null)try{let x=a[p];y=await x(...d);}catch(x){b=String(x);}else b="Method implementation missing";l===1&&g&&t(r(b?[4,b,g]:[3,y,g]));}else if(g){let y=s.get(g);y!=null&&(l===4?y.reject(d):y.resolve(d)),s.delete(g);}});function u(){return new Proxy({},{get(c,f){let l=(...g)=>{t(r([2,g,null,f]));};if(e.onlyEvents||i.includes(f))return l.asEvent=l,l;let d=(...g)=>new Promise((p,y)=>{let b=Fn++;s.set(b,{resolve:p,reject:y}),t(r([1,g,b,f]));});return d.asEvent=l,d}})}return function(c,f=[]){return Object.assign(a,c??{}),i.push(...f),u()}}var pe=class e extends S{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??I("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){Yt(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 cc(e={}){let{maxParallel:t=3,name:n=I("pool"),idConflictResolution:r="memoize"}=e,o=new S,i=Be();i.add(U);let a=new pe({name:n});a.on("progressCancelled",U);let s=0,u=0,c=0,f=0,l={};async function d(){if(s>0){let[h,m]=an();return o.once("didFinish",m),h}}async function g(){for(let h of Object.keys(l))l[h].state==="finished"&&(await l[h].progress.dispose(),delete l[h]);}function p(){o.emit("didFinish"),s=0,u=0,g(),a.reset();}function y(){let h=0,m=0;for(let{max:w,resolved:A,state:T}of Object.values(l))h+=w,m+=T==="finished"?w:Math.min(w,A);o.emit("didUpdate",s,u,h,m);}function b(){if(y(),s>0&&s===u&&p(),c>=t)return;let h=Object.values(l).filter(m=>m.state==="waiting");if(h.length>0){let m;for(let w of h)w.group!=null&&Object.values(l).some(A=>A.state==="running"&&A.id!==w.id&&A.group===w.group)||(m==null||w.priority<m.priority)&&(m=w);if(m!=null){let w=m.id,A=m.done;m.state="running",++c,o.emit("didStart",w);let T=D=>{m&&(m.result=D,m.state="finished",m.resolved=m.max,m.progress?.setCompleted()),--c,++u,b();};m.task(m).then(D=>{A(D),o.emit("didResolve",w,D),T(D);}).catch(D=>{A(),o.emit("didReject",w,D),T();});}}}function x(h){let m=l[h];m&&m.state==="waiting"&&(l[h].state="finished",++u,o.emit("didCancel",h),l[h].progress.dispose(),y());}function U(){Object.keys(l).forEach(x);}function E(h){return l[h]!=null}function B(h,m={}){let w,A=new Promise(P=>w=P),T=m.id??J();if(l[T]!=null){let P=m.idConflictResolution??r;if(P==="replace")x(T);else if(P==="memoize"||P==="prioritize"){let wt=l[T];return P==="prioritize"&&(wt.priority=++f),{id:T,promise:(async()=>{if(wt.state==="finished")return l[T].result})(),dispose:()=>x(T),cancel:()=>x(T)}}else throw new Error(`Pool task with id=${T} already exists!`)}let D=new pe({name:T,totalUnits:m.max??1,completeUnits:m.resolved??0});return a.addChild(D),l[T]={id:T,task:h,priority:++f,group:m.group,state:"waiting",max:m.max??1,resolved:m.resolved??0,done:w,payload:m.payload,progress:D,setMax(P){D.setTotalUnits(P),l[T].max=P,y();},setResolved(P){D.setCompletetedUnits(P),l[T].resolved=P,y();},incResolved(P=1){D.incCompletedUnits(P),l[T].resolved+=P,y();}},++s,b(),{id:T,promise:A,dispose:()=>x(T),cancel:()=>x(T)}}return {events:o,cancel:x,cancelAll:U,hasById:E,progress:a,enqueue:B,dispose:i,waitFinishAll:d}}var Rn=class extends S{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:r=I("queue"),logLevel:o}=n;this.name=r,this.log=R(`zeed:queue:${r}`,o??Y);}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 a;try{this.log.info(`start task ${r}`),a=await this.currentTask,this.log(`finished task ${r} with result =`,a);}catch(s){this.log.warn("Error performing task",s);}i(a),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=I(this.name)}=r;return o?(this.log.info(`immediate execution ${i}`),await n()):(this.log(`enqueue ${i}`),new Promise(a=>{this.queue.push({name:i,task:n,resolve:a}),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 hc(e,t={}){let{delay:n=100,trailing:r=!0,leading:o=!0}=t,i=0,a=0,s=0,u;function c(){return i?(clearTimeout(i),i=void 0,!0):!1}function f(...l){let d=Date.now(),g=d-a,p=()=>{s=0,a=Date.now(),e.apply(this,l);};if(u=p,g>n||!i){o&&(g>n?p():++s);let y=g>n?n:n-g;c(),a=d,i=setTimeout(()=>{i=0,r&&(!o||s>0)&&u?.();},y);}else ++s;}return f.cancel=c,f.stop=()=>{c()&&u&&u();},f.immediate=async function(...d){c(),a=Date.now(),e.apply(this,d);},f.dispose=()=>f.stop(),f}function xc(e,t={}){let{delay:n=100}=t,r=0,o=!1,i;function a(){r&&(clearTimeout(r),r=0);}async function s(){try{if(a(),i!=null){let f=[...i];i=void 0,o=!0,await le(e(...f)),o=!1,i!=null&&(a(),r=setTimeout(s,n));}}catch{}}function u(...f){i=[...f],a(),o===!1&&(r=setTimeout(s,n));}async function c(...f){a(),i=[...f],await s();}return u.cancel=a,u.dispose=a,u.immediate=c,u}function Tc(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 Sn=["#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 Ac(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Sn[Math.abs(t)%Sn.length]}function Dc(e){let{level:t=void 0,filter:n=void 0,messages:r=[]}=e,o=Z(n),i=de(t);return a=>{i(a.level)&&o(a.name)&&(a.timestamp=Oe(),r.push(a));}}var Tt={cache:"no-cache",redirect:"follow",headers:{}};function ao(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 Mn(e,t={},n=fetch){try{_(t)&&(t=Ie({},...re(t)));let r=ao(String(e));r&&(e=r.url,t=Ie({},t,uo(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=R("zeed:network");try{i.warn(`Fetch of ${String(e)} returned status=${o.status}. Options:`,t),i.warn(`Response: ${await o.text()}`);}catch(a){i.error("Exception:",a);}}catch(r){R("zeed:network").error("fetchBasic",r);}}async function Rc(e,t={},n=fetch){try{let r=await Mn(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(r)return await r.json()}catch(r){R("zeed:network").error("fetchJSON error:",r);}}async function Sc(e,t={},n=fetch){try{let r=await Mn(e,[Tt,{method:"GET"},t],n);if(r)return await r.text()}catch(r){R("zeed:network").error("fetchHTML error:",r);}}function Mc(e,t="POST"){return {method:t,...Tt,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:xn(e)}}function Ic(e,t="POST"){return {method:t,...Tt,headers:{"Content-Type":"application/json; charset=utf-8"},body:M(e)}}function uo(e,t){return {headers:{Authorization:`Basic ${ie(`${e}:${t}`)}`}}}function In(){if(typeof window<"u")return window}function co(){if(typeof navigator<"u")return navigator}function Bc(){return In()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}function Oc(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=co(),n=In();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 lo(){return typeof window<"u"&&globalThis===window}function _c(e){lo()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e);}var kn=class{constructor(t={}){this.store={};}setItem(t,n){this.store[t]=pt(n);}getItem(t){return pt(this.store[t])}removeItem(t){delete this.store[t];}clear(){this.store={};}allKeys(){return Object.keys(this.store)}};function jc(){}
13
+
14
+ export { oi as $, Hi as $a, q as $b, yn as $c, vu as $d, Dt as A, it as Aa, fs as Ab, Ys as Ac, nu as Ad, ao as Ae, vt as B, Li as Ba, rn as Bb, Ks as Bc, ru as Bd, Mn as Be, L as C, Ci as Ca, on as Cb, pn as Cc, su as Cd, Rc as Ce, Ro as D, gr as Da, ps as Db, Xs as Dc, au as Dd, Sc as De, Et as E, Ui as Ea, ds as Eb, Qs as Ec, S as Ed, Mc as Ee, Ft as F, yr as Fa, Se as Fb, ea as Fc, gu as Fd, Ic as Fe, ie as G, Kt as Ga, gs as Gb, ta as Gc, yu as Gd, uo as Ge, So as H, Di as Ha, ct as Hb, vr as Hc, Oe as Hd, In as He, xe as I, vi as Ia, Cr as Ib, na as Ic, qr as Id, co as Ie, Mo as J, Ei as Ja, Ur as Jb, ra as Jc, hu as Jd, Bc as Je, Pt as K, Fi as Ka, ft as Kb, oa as Kc, wn as Kd, Oc as Ke, He as L, Pi as La, sn as Lb, Er as Lc, xu as Ld, lo as Le, ze as M, Ri as Ma, ys as Mb, Fr as Mc, yt as Md, _c as Me, Rt as N, Si as Na, ms as Nb, Ie as Nc, Jr as Nd, kn as Ne, zt as O, Mi as Oa, Re as Ob, Pr as Oc, Wr as Od, jc as Oe, Yo as P, Ii as Pa, hs as Pb, dn as Pc, Zr as Pd, Ko as Q, hr as Qa, xs as Qb, ca as Qc, Yr as Qd, Xo as R, V as Ra, bs as Rb, fa as Rc, Kr as Rd, Qo as S, st as Sa, an as Sb, pa as Sc, Xr as Sd, ei as T, Xt as Ta, ws as Tb, da as Tc, eo as Td, sr as U, Oi as Ua, As as Ub, ga as Uc, to as Ud, ti as V, _i as Va, Ls as Vb, ha as Vc, no as Vd, ne as W, $i as Wa, Cs as Wb, xa as Wc, Ln as Wd, qt as X, Vi as Xa, un as Xb, ba as Xc, Cu as Xd, tt as Y, at as Ya, Us as Yb, ke as Yc, Uu as Yd, Gt as Z, Qt as Za, F as Zb, La as Zc, oo as Zd, ar as _, Ni as _a, le as _b, fe as _c, Du as _d, W as a, ii as aa, xr as ab, Es as ac, Ua as ad, J as ae, On as b, Wt as ba, zi as bb, Fs as bc, Da as bd, Un as be, Z as c, Zt as ca, Gi as cb, Ps as cc, va as cd, io as ce, Ne as d, ur as da, Wi as db, Rs as dc, Ea as dd, Eu as de, de as e, v as ea, Zi as eb, Dr as ec, Fa as ed, I as ee, ge as f, ai as fa, Yi as fb, Ms as fc, Pa as fd, Fu as fe, $ as g, ui as ga, br as gb, Is as gc, Ra as gd, ht as ge, z as h, ci as ha, Tr as hb, ks as hc, Sa as hd, Ve as he, N as i, li as ia, wr as ib, _s as ic, mn as id, Mu as ie, j, cr as ja, ut as jb, $s as jc, hn as jd, Dn as je, H as k, fi as ka, Ki as kb, cn as kc, ka as kd, oe as ke, ye as l, pi as la, Xi as lb, Vs as lc, Or as ld, vn as le, Y as m, di as ma, Qi as mb, Ns as mc, _a as md, En as me, At as n, gi as na, es as nb, js as nc, Na as nd, Hu as ne, Lt as o, lr as oa, Ar as ob, pt as oc, $r as od, xt as oe, Vn as p, mi as pa, ts as pb, Hs as pc, xn as pd, Zu as pe, Ct as q, rt as qa, ns as qb, zs as qc, ja as qd, Ku as qe, R as r, hi as ra, is as rb, Gs as rc, jr as rd, Xu as re, Nn as s, ot as sa, ss as sb, qs as sc, za as sd, pe as se, jn as t, fr as ta, as as tb, k as tc, Tn as td, cc as te, Ut as u, pr as ua, us as ub, dt as uc, Ja as ud, Rn as ue, vo as v, re as va, cs as vb, _ as vc, zr as vd, hc as ve, M as w, dr as wa, tn as wb, Me as wc, Wa as wd, xc as we, Eo as x, wi as xa, lt as xb, Zs as xc, Be as xd, Tc as xe, Gn as y, Yt as ya, nn as yb, ln as yc, eu as yd, Ac as ye, qn as z, Ai as za, Lr as zb, fn as zc, tu as zd, Dc as ze };
15
+ //# sourceMappingURL=out.js.map
16
+ //# sourceMappingURL=chunk-VH66FUYV.js.map