zeed 0.9.13 → 0.9.15
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/dist/{chunk-WRWKAGRH.js → chunk-ILTCEHLM.js} +7 -7
- package/dist/chunk-ILTCEHLM.js.map +1 -0
- package/dist/index.all.d.ts +24 -4
- package/dist/index.browser.cjs +6 -6
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +1 -1
- package/dist/index.node.cjs +11 -11
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.js +1 -1
- package/dist/{uuid-2ce1cb74.d.ts → uuid-9445a6c1.d.ts} +24 -4
- package/package.json +1 -1
- package/dist/chunk-WRWKAGRH.js.map +0 -1
package/dist/index.all.d.ts
CHANGED
|
@@ -771,7 +771,7 @@ interface PoolConfig {
|
|
|
771
771
|
name?: string;
|
|
772
772
|
maxParallel?: number;
|
|
773
773
|
}
|
|
774
|
-
type PoolTaskFn<T = any> = (taskInfo
|
|
774
|
+
type PoolTaskFn<T = any> = (taskInfo: PoolTask<T>) => Promise<T>;
|
|
775
775
|
declare enum PoolTaskState {
|
|
776
776
|
waiting = 0,
|
|
777
777
|
running = 1,
|
|
@@ -796,11 +796,19 @@ interface PoolTask<T> {
|
|
|
796
796
|
payload?: unknown;
|
|
797
797
|
}
|
|
798
798
|
declare enum PoolTaskIdConflictResolution {
|
|
799
|
-
/**
|
|
799
|
+
/**
|
|
800
|
+
* Tasks with same `id` are replaced. Newest wins.
|
|
801
|
+
*/
|
|
800
802
|
replace = 0,
|
|
801
|
-
/**
|
|
803
|
+
/**
|
|
804
|
+
* Task with same `id` will continue to run. Reference is returned with option to cancel.
|
|
805
|
+
* Named "memoize" because the result of the task should always be the same for the same `id`,
|
|
806
|
+
* like e.g. a download.
|
|
807
|
+
*/
|
|
802
808
|
memoize = 1,
|
|
803
|
-
/**
|
|
809
|
+
/**
|
|
810
|
+
* Tasks with same `id` throw error
|
|
811
|
+
*/
|
|
804
812
|
error = 2
|
|
805
813
|
}
|
|
806
814
|
interface PoolTaskEvents {
|
|
@@ -834,9 +842,21 @@ declare function usePool<T = any>(config?: PoolConfig): {
|
|
|
834
842
|
};
|
|
835
843
|
type Pool = ReturnType<typeof usePool>;
|
|
836
844
|
|
|
845
|
+
/**
|
|
846
|
+
* Promise to be used with `await`. Example:
|
|
847
|
+
*
|
|
848
|
+
* ```
|
|
849
|
+
* const [promise, resolve, reject] = createPromise()
|
|
850
|
+
* setTimeout(() => {
|
|
851
|
+
* resolve(5)
|
|
852
|
+
* }, 50)
|
|
853
|
+
* const result = await promise
|
|
854
|
+
* ```
|
|
855
|
+
*/
|
|
837
856
|
declare function createPromise<T>(): [Promise<T>, any, any];
|
|
838
857
|
/** Sleep for `milliSeconds`. Example 1s: `await sleep(1000)` */
|
|
839
858
|
declare function sleep(milliSeconds: number): Promise<void>;
|
|
859
|
+
/** Same as `await sleep(0)`, just let the event loop execute. */
|
|
840
860
|
declare function immediate(): Promise<void>;
|
|
841
861
|
declare const timeoutReached: unique symbol;
|
|
842
862
|
declare function timeout<T>(promise: Promise<T>, milliSeconds: number, timeoutValue?: symbol): Promise<T | typeof timeoutValue>;
|
package/dist/index.browser.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";var ye=Object.defineProperty;var Gn=Object.getOwnPropertyDescriptor;var Vn=Object.getOwnPropertyNames;var qn=Object.prototype.hasOwnProperty;var r=(e,t)=>ye(e,"name",{value:t,configurable:!0});var Jn=(e,t)=>{for(var n in t)ye(e,n,{get:t[n],enumerable:!0})},Wn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Vn(t))!qn.call(e,i)&&i!==n&&ye(e,i,{get:()=>t[i],enumerable:!(o=Gn(t,i))||o.enumerable});return e};var Zn=e=>Wn(ye({},"__esModule",{value:!0}),e);var vs={};Jn(vs,{CRYPTO_DEFAULT_ALG:()=>Le,CRYPTO_DEFAULT_DERIVE_ALG:()=>et,CRYPTO_DEFAULT_DERIVE_ITERATIONS:()=>jt,CRYPTO_DEFAULT_HASH_ALG:()=>tt,Channel:()=>fe,CryptoEncoder:()=>Be,DAY_MS:()=>Pe,Day:()=>D,Emitter:()=>U,JsonEncoder:()=>G,LocalChannel:()=>ne,LocalStorage:()=>Ne,LogLevel:()=>H,LogLevelAlias:()=>Ge,Logger:()=>v,LoggerBrowserHandler:()=>Et,LoggerBrowserSetupDebugFactory:()=>Mt,LoggerConsoleHandler:()=>se,LoggerContext:()=>Ve,LoggerMemoryHandler:()=>ts,MemStorage:()=>ze,NoopEncoder:()=>_e,PoolTaskIdConflictResolution:()=>Rn,PoolTaskState:()=>Mn,Progress:()=>j,PubSub:()=>de,SerialQueue:()=>je,Uint8ArrayToHexDump:()=>Xe,Uint8ArrayToJson:()=>we,Uint8ArrayToString:()=>We,XRX:()=>Re,_decodeUtf8Polyfill:()=>_t,_encodeUtf8Polyfill:()=>Ot,activateConsoleDebug:()=>Ls,arrayAvg:()=>Pr,arrayBatches:()=>Ur,arrayEmptyInPlace:()=>wr,arrayFilterInPlace:()=>Ae,arrayFlatten:()=>Z,arrayIntersection:()=>qt,arrayIsEqual:()=>Wt,arrayMax:()=>Ar,arrayMin:()=>Fr,arrayMinus:()=>Gt,arrayRandomElement:()=>Cr,arrayRemoveElement:()=>it,arraySetElement:()=>xr,arrayShuffle:()=>Lr,arrayShuffleForce:()=>vr,arrayShuffleInPlace:()=>st,arraySorted:()=>Jt,arraySortedNumbers:()=>Tr,arraySum:()=>Dr,arraySymmetricDifference:()=>hr,arrayToggleInPlace:()=>br,arrayUnion:()=>Vt,arrayUnique:()=>Ce,avg:()=>fr,between:()=>lr,cloneJsonObject:()=>li,cloneObject:()=>Me,cmp:()=>ve,composeOrderby:()=>mr,createArray:()=>Sr,createLocalChannelPair:()=>Vi,createPromise:()=>ft,createPromiseProxy:()=>Dt,csvParse:()=>mn,csvParseToObjects:()=>wi,csvStringify:()=>bi,dateStringToDays:()=>bo,day:()=>xo,dayDay:()=>tn,dayDiff:()=>ao,dayFromAny:()=>no,dayFromDate:()=>ue,dayFromDateGMT:()=>oo,dayFromParts:()=>Se,dayFromString:()=>lt,dayFromTimestamp:()=>nn,dayFromToday:()=>ct,dayIterator:()=>co,dayMonth:()=>at,dayMonthStart:()=>io,dayOffset:()=>ae,dayRange:()=>uo,dayToDate:()=>ut,dayToDateGMT:()=>ro,dayToParts:()=>to,dayToString:()=>rn,dayToTimestamp:()=>De,dayYear:()=>Ue,dayYearStart:()=>so,debounce:()=>Xi,decimal:()=>sn,decimalCentsPart:()=>Lo,decimalFromCents:()=>wo,decimalToCents:()=>To,decodeBase16:()=>Or,decodeBase32:()=>Ir,decodeBase58:()=>Br,decodeBase62:()=>Hr,decrypt:()=>rt,deepEqual:()=>an,deepMerge:()=>le,deepStripUndefinedInPlace:()=>un,deriveKeyPbkdf2:()=>sr,detect:()=>On,digest:()=>ir,empty:()=>ci,encodeBase16:()=>$r,encodeBase32:()=>Rr,encodeBase58:()=>_r,encodeBase62:()=>jr,encodeQuery:()=>Tt,encrypt:()=>nt,endSortWeight:()=>wt,ensureKey:()=>ii,ensureKeyAsync:()=>si,equalBinary:()=>Qe,escapeHTML:()=>yt,escapeRegExp:()=>ht,estimateSizeForBase:()=>zr,fetchBasic:()=>Ut,fetchJson:()=>ns,fetchOptionsBasicAuth:()=>In,fetchOptionsFormURLEncoded:()=>os,fetchOptionsJson:()=>is,fetchText:()=>rs,fixBrokenUth8String:()=>eo,forEachDay:()=>yo,forTimes:()=>pi,formatMessages:()=>en,formatMilliseconds:()=>Lt,fromBase64:()=>Bt,fromBase64String:()=>or,fromCamelCase:()=>Vr,fromHex:()=>Ke,getGlobal:()=>ss,getGlobalContext:()=>Y,getGlobalEmitter:()=>Si,getGlobalLogger:()=>kt,getNamespaceFilterString:()=>Rt,getNavigator:()=>$n,getSecureRandom:()=>Ht,getSecureRandomIfPossible:()=>P,getTimestamp:()=>te,getWindow:()=>St,gravatarURLByEmail:()=>gs,immediate:()=>fo,isArray:()=>_,isBoolean:()=>mt,isBrowser:()=>He,isEven:()=>xt,isHalf:()=>X,isInteger:()=>Fo,isLocalHost:()=>es,isNotNull:()=>Eo,isNull:()=>Uo,isNullOrUndefined:()=>Po,isNumber:()=>Ao,isObject:()=>O,isPrime:()=>pr,isPrimeRX:()=>dr,isPrimitive:()=>Ee,isPromise:()=>M,isRecord:()=>ce,isRecordPlain:()=>vo,isSafeInteger:()=>Do,isString:()=>Co,isTimeout:()=>go,isUint8Array:()=>So,isValue:()=>Mo,joinToUint8Array:()=>nr,jsonStringify:()=>tr,jsonStringifySafe:()=>S,jsonStringifySorted:()=>Xn,jsonToUint8Array:()=>be,last:()=>ui,lazyListener:()=>Mi,linkifyPlainText:()=>ri,listDistinctUnion:()=>$o,listGroupBy:()=>Io,listOfKey:()=>Oo,listQuery:()=>ko,memoize:()=>fi,memoizeAsync:()=>di,messages:()=>Ei,moveSortWeight:()=>ei,noop:()=>cs,objectIsEmpty:()=>jo,objectMap:()=>_o,objectMergeDisposable:()=>Bo,parseBasicAuth:()=>kn,parseDate:()=>Ri,parseLogLevel:()=>Q,parseOrderby:()=>Nt,parseQuery:()=>oi,platform:()=>as,promisify:()=>$,qid:()=>Gi,randomBoolean:()=>ar,randomFloat:()=>cr,randomInt:()=>ur,randomUint8Array:()=>W,regExpEscape:()=>hi,regExpString:()=>gn,renderMessages:()=>Xr,roundDown:()=>Jo,roundHalfAwayFromZero:()=>Ko,roundHalfDown:()=>Yo,roundHalfEven:()=>Qo,roundHalfOdd:()=>Zo,roundHalfTowardsZero:()=>Xo,roundHalfUp:()=>Wo,roundUp:()=>qo,seededRandom:()=>gr,selectColor:()=>ge,setUuidDefaultEncoding:()=>Hi,setupBrowserLog:()=>Nn,size:()=>ai,sleep:()=>lo,sortedItems:()=>fn,sortedOrderby:()=>yr,startSortWeight:()=>bt,stringToBoolean:()=>qr,stringToFloat:()=>Wr,stringToInteger:()=>Jr,stringToUInt8Array:()=>Je,suid:()=>_i,suidBytes:()=>Ct,suidBytesDate:()=>Pn,suidDate:()=>Bi,sum:()=>zt,supportsColors:()=>pe,throttle:()=>Qi,timeout:()=>po,timeoutReached:()=>dt,timoutError:()=>pt,toBase64:()=>Ye,toBase64Url:()=>rr,toBool:()=>Qr,toCamelCase:()=>Nr,toCapitalize:()=>Zt,toCapitalizeWords:()=>Gr,toFloat:()=>Zr,toHex:()=>Ze,toHumanReadableUrl:()=>dn,toInt:()=>Kr,toString:()=>Yr,toUint8Array:()=>E,toValidFilename:()=>Go,today:()=>ho,tryTimeout:()=>gt,uname:()=>R,unescapeHTML:()=>Ro,urlBase64ToUint8Array:()=>fs,useAsyncMutex:()=>Ui,useBase:()=>z,useDefer:()=>Ci,useDispose:()=>ke,useDisposer:()=>vi,useEventListener:()=>Di,useExitHandler:()=>us,useInterval:()=>Fi,useLevelFilter:()=>q,useMessageHub:()=>qi,useMutex:()=>Pi,useNamespaceFilter:()=>k,usePool:()=>Yi,usePubSub:()=>Ji,useRPC:()=>Ki,useSorted:()=>ti,useTimeout:()=>Ai,uuid:()=>N,uuid32bit:()=>ji,uuidB32:()=>Tn,uuidB62:()=>xn,uuidBytes:()=>$e,uuidDecode:()=>Ft,uuidDecodeB32:()=>vn,uuidDecodeB62:()=>wn,uuidDecodeV4:()=>Fn,uuidEncode:()=>Sn,uuidEncodeB32:()=>Ln,uuidEncodeB62:()=>bn,uuidEncodeV4:()=>An,uuidIsValid:()=>zi,uuidv4:()=>Cn,valueToBoolean:()=>Yt,valueToFloat:()=>Xt,valueToInteger:()=>Qt,valueToString:()=>Fe,waitOn:()=>mo});module.exports=Zn(vs);function Kn(){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")}r(Kn,"_global");function Y(){let e=Kn();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}r(Y,"getGlobalContext");function Rt(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}r(Rt,"getNamespaceFilterString");var Yn=Rt(typeof process<"u"?process.env.ZEED??process.env.DEBUG:typeof localStorage<"u"?localStorage.zeed??localStorage.debug:"*");function k(e=Yn){let t,n=[],o=[];if(!e)t=r(function(i){return!1},"fn");else if(e==="*")t=r(function(i){return!0},"fn");else{let i,s=e.split(/[\s,]+/),c=s.length;for(i=0;i<c;i++){if(!s[i])continue;let u=s[i].replace(/\*/g,".*?");u[0]==="-"?n.push(new RegExp(`^${u.substr(1)}$`)):o.push(new RegExp(`^${u}$`))}t=r(function(u){if(n.length===0&&o.length===0)return!0;let p,m;for(p=0,m=n.length;p<m;p++)if(n[p].test(u))return!1;for(p=0,m=o.length;p<m;p++)if(o[p].test(u))return!0;return!1},"fn")}return t.accept=o,t.reject=n,t.filter=e,t}r(k,"useNamespaceFilter");var Qn=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 Q(e){if(e===!1)return 1/0;if(typeof e=="number")return e;if(typeof e=="string"){let t=Ge[e.toLocaleLowerCase().trim()];if(t!=null)return t}return-1}r(Q,"parseLogLevel");function q(e=Qn){let t=Q(e);return n=>n>=t}r(q,"useLevelFilter");function se(e={}){let{level:t=void 0,filter:n=void 0}=e,o=k(n),i=q(t);return s=>{if(!i(s.level)||!o(s.name))return;let c=s.name?`[${s.name}]`:"";switch(s.level){case 1:console.info(`I|* ${c}`,...s.messages);break;case 2:console.warn(`W|** ${c}`,...s.messages);break;case 3:console.error(`E|*** ${c}`,...s.messages);break;default:console.debug(`D| ${c}`,...s.messages);break}}}r(se,"LoggerConsoleHandler");var H=(u=>(u[u.all=-1]="all",u[u.debug=0]="debug",u[u.info=1]="info",u[u.warn=2]="warn",u[u.error=3]="error",u[u.fatal=4]="fatal",u[u.off=1/0]="off",u))(H||{}),Ge={"*":-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:1/0,"-":1/0};function Ve(e=""){let t=[se()],n=r(p=>!0,"logCheckNamespace"),o=!1,i=c,s=!1;function c(p="",m){let h=Q(m??-1);function x(w,T){return h<=w?T:()=>{}}r(x,"defineForLogLevel");let b=x(0,(...w)=>{L({name:p,messages:w,level:0})});b.label=p,b.extend=function(w){return i(p?`${p}:${w}`:w)};let L=r(w=>{if(n(p))for(let T of t)T&&T(w)},"emit");return b.debug=x(0,(...w)=>{L({name:p,messages:w,level:0})}),b.info=x(1,(...w)=>{L({name:p,messages:w,level:1})}),b.warn=x(2,(...w)=>{L({name:p,messages:w,level:2})}),b.error=x(3,(...w)=>{L({name:p,messages:w,level:3})}),b.fatal=x(4,(...w)=>{throw L({name:p,messages:w,level:4}),new Error(`${w.map(String).join(" ")}`)}),b.assert=x(4,(w,...T)=>{w||b.fatal(...T)}),b}r(c,"LoggerBaseFactory");function u(p="",m){let h=i(p,m);return s&&h.debug(`+++ init of logger "${p}" on level "${H[h.level]}".`),h}return r(u,"Logger"),u.registerHandler=function(p){t.push(p)},u.setFilter=function(p){n=k(p)},u.setLock=(p=!0)=>o=p,u.setDebug=(p=!0)=>s=p,u.setHandlers=function(p=[]){i!==c&&(i=c),!o&&(t=[...p].filter(m=>typeof m=="function"))},u.level=-1,u.setLogLevel=function(p=-1){o||(u.level=p)},u.setFactory=function(p){o||(i=p)},u}r(Ve,"LoggerContext");var J;function qe(){let e=Ve();return e.setHandlers([se()]),e}r(qe,"getLoggerContext");function kt(){if(J==null)try{let e=Y();e!=null?e?.logger==null?(J=qe(),e.logger=J):J=e.logger:J=qe()}catch{J=qe()}return J}r(kt,"getGlobalLogger");var v=kt();var It=r((e,t)=>t instanceof Object&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,o)=>(n[o]=t[o],n),{}):t,"_sortedReplacer");function Xn(e,t=void 0){return JSON.stringify(e,It,t)}r(Xn,"jsonStringifySorted");function er(e,t){let n=[],o=[];return t==null&&(t=r(function(i,s){return n[0]===s?"[Circular ~]":`[Circular ~.${o.slice(0,n.indexOf(s)).join(".")}]`},"cycleReplacer")),function(i,s){if(n.length>0){let c=n.indexOf(this);~c?n.splice(c+1):n.push(this),~c?o.splice(c,1/0,i):o.push(i),~n.indexOf(s)&&(s=t?.call(this,i,s))}else n.push(s);s=It(i,s);try{return e==null?s:e.call(this,i,s)}catch{}return String(s)}}r(er,"serializer");function S(e,t,n,o){return JSON.stringify(e,er(t,o),n)}r(S,"jsonStringifySafe");var tr=S;var $t=v("zeed:bin","error");function Ot(e){let t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let i=0;i<n;i++)o[i]=t.codePointAt(i)||0;return o}r(Ot,"_encodeUtf8Polyfill");function _t(e){let t=e.length,n="",o=0;for(;t>0;){let i=t<1e4?t:1e4,s=e.subarray(o,o+i);o+=i,n+=String.fromCodePoint.apply(null,s),t-=i}return decodeURIComponent(escape(n))}r(_t,"_decodeUtf8Polyfill");var he;function Je(e){if(he==null&&(he=Ot,typeof TextEncoder<"u")){let t=new TextEncoder;he=r(n=>t.encode(n),"_textEncoder")}return he(e.normalize("NFC"))}r(Je,"stringToUInt8Array");var xe;function We(e){if(xe==null&&(xe=_t,typeof TextDecoder<"u")){let t=new TextDecoder("utf-8",{ignoreBOM:!0});xe=r(n=>t.decode(n),"_textDecoder")}return xe(e).normalize("NFC")}r(We,"Uint8ArrayToString");function E(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Je(e):e.length?new Uint8Array(e):e}r(E,"toUint8Array");function nr(...e){let t=0,n=e.flat(1).map(s=>{let c=E(s);return t+=c.length,c}),o=new Uint8Array(t),i=0;for(let s of n)o.set(s,i),i+=s.length;return o}r(nr,"joinToUint8Array");function Ze(e){if(typeof Buffer<"u")return Buffer.from(E(e)).toString("hex");let t="0123456789abcdef",n="";for(let o of[...E(e)])n+=t[o>>4]+t[o&15];return n}r(Ze,"toHex");function Ke(e){return Uint8Array.from(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}r(Ke,"fromHex");function Ye(e,t=!1){let n=E(e),o="";if(typeof Buffer<"u")o=Buffer.from(n).toString("base64");else{let i="";for(let s=0;s<n.byteLength;s++)i+=String.fromCharCode(n[s]);o=btoa(i)}return t?o.replaceAll("=",""):o}r(Ye,"toBase64");function rr(e){let t=E(e);if(typeof Buffer<"u")return Buffer.from(t).toString("base64url").replaceAll("=","");let n="";for(let o=0;o<t.byteLength;o++)n+=String.fromCharCode(t[o]);return btoa(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}r(rr,"toBase64Url");function Bt(e){if(e=e.replaceAll("-","+").replaceAll("_","/"),typeof Buffer<"u"){let o=Buffer.from(e,"base64");return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}r(Bt,"fromBase64");function or(e){return We(Bt(e))}r(or,"fromBase64String");function Qe(e,t){if(e.byteLength!==t.byteLength)return!1;let n=E(e),o=E(t);for(let i=0;i<n.length;i++)if(n[i]!==o[i])return!1;return!0}r(Qe,"equalBinary");function be(e){try{return Je(S(e))}catch(t){throw $t.warn("jsonToUint8Array",e),t}}r(be,"jsonToUint8Array");function we(e){try{return JSON.parse(We(e))}catch(t){throw $t.warn("Uint8ArrayToJson",e),t}}r(we,"Uint8ArrayToJson");function Xe(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=[],o="0123456789ABCDEF";for(let i=0;i<e.length;i+=t){let s=e.slice(i,Math.min(i+t,e.length)),c=`0000${i.toString(16)}`.slice(-4),u=s.split("").map(m=>{let h=m.charCodeAt(0);return` ${o[(240&h)>>4]}${o[15&h]}`}).join("");u+=" ".repeat(t-s.length);let p=s.replace(/[\x00-\x1F\x20]/g,".");p+=" ".repeat(t-s.length),n.push(`${c} ${u} ${p}`)}return n.join(`
|
|
2
|
-
`)}r(Xe,"Uint8ArrayToHexDump");function W(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}r(W,"randomUint8Array");var tt="SHA-256",Le="AES-GCM",et="PBKDF2",
|
|
1
|
+
"use strict";var ye=Object.defineProperty;var Vn=Object.getOwnPropertyDescriptor;var qn=Object.getOwnPropertyNames;var Jn=Object.prototype.hasOwnProperty;var r=(e,t)=>ye(e,"name",{value:t,configurable:!0});var Wn=(e,t)=>{for(var n in t)ye(e,n,{get:t[n],enumerable:!0})},Zn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qn(t))!Jn.call(e,i)&&i!==n&&ye(e,i,{get:()=>t[i],enumerable:!(o=Vn(t,i))||o.enumerable});return e};var Kn=e=>Zn(ye({},"__esModule",{value:!0}),e);var vs={};Wn(vs,{CRYPTO_DEFAULT_ALG:()=>Le,CRYPTO_DEFAULT_DERIVE_ALG:()=>et,CRYPTO_DEFAULT_DERIVE_ITERATIONS:()=>Ht,CRYPTO_DEFAULT_HASH_ALG:()=>tt,Channel:()=>fe,CryptoEncoder:()=>Be,DAY_MS:()=>Pe,Day:()=>D,Emitter:()=>U,JsonEncoder:()=>G,LocalChannel:()=>ne,LocalStorage:()=>Ne,LogLevel:()=>H,LogLevelAlias:()=>Ge,Logger:()=>v,LoggerBrowserHandler:()=>Mt,LoggerBrowserSetupDebugFactory:()=>Rt,LoggerConsoleHandler:()=>se,LoggerContext:()=>Ve,LoggerMemoryHandler:()=>ts,MemStorage:()=>ze,NoopEncoder:()=>_e,PoolTaskIdConflictResolution:()=>kn,PoolTaskState:()=>Rn,Progress:()=>j,PubSub:()=>de,SerialQueue:()=>je,Uint8ArrayToHexDump:()=>Xe,Uint8ArrayToJson:()=>we,Uint8ArrayToString:()=>We,XRX:()=>Re,_decodeUtf8Polyfill:()=>Bt,_encodeUtf8Polyfill:()=>_t,activateConsoleDebug:()=>Ls,arrayAvg:()=>Ur,arrayBatches:()=>Sr,arrayEmptyInPlace:()=>Tr,arrayFilterInPlace:()=>Ae,arrayFlatten:()=>Z,arrayIntersection:()=>Jt,arrayIsEqual:()=>Zt,arrayMax:()=>Fr,arrayMin:()=>Dr,arrayMinus:()=>Vt,arrayRandomElement:()=>Ar,arrayRemoveElement:()=>it,arraySetElement:()=>br,arrayShuffle:()=>vr,arrayShuffleForce:()=>Cr,arrayShuffleInPlace:()=>st,arraySorted:()=>Wt,arraySortedNumbers:()=>Lr,arraySum:()=>Pr,arraySymmetricDifference:()=>xr,arrayToggleInPlace:()=>wr,arrayUnion:()=>qt,arrayUnique:()=>Ce,avg:()=>dr,between:()=>fr,cloneJsonObject:()=>li,cloneObject:()=>Me,cmp:()=>ve,composeOrderby:()=>yr,createArray:()=>Er,createLocalChannelPair:()=>Vi,createPromise:()=>ft,createPromiseProxy:()=>Pt,csvParse:()=>yn,csvParseToObjects:()=>wi,csvStringify:()=>bi,dateStringToDays:()=>wo,day:()=>bo,dayDay:()=>nn,dayDiff:()=>uo,dayFromAny:()=>ro,dayFromDate:()=>ue,dayFromDateGMT:()=>io,dayFromParts:()=>Se,dayFromString:()=>lt,dayFromTimestamp:()=>rn,dayFromToday:()=>ct,dayIterator:()=>lo,dayMonth:()=>at,dayMonthStart:()=>so,dayOffset:()=>ae,dayRange:()=>co,dayToDate:()=>ut,dayToDateGMT:()=>oo,dayToParts:()=>no,dayToString:()=>on,dayToTimestamp:()=>De,dayYear:()=>Ue,dayYearStart:()=>ao,debounce:()=>Xi,decimal:()=>an,decimalCentsPart:()=>vo,decimalFromCents:()=>To,decimalToCents:()=>Lo,decodeBase16:()=>_r,decodeBase32:()=>$r,decodeBase58:()=>jr,decodeBase62:()=>zr,decrypt:()=>rt,deepEqual:()=>un,deepMerge:()=>le,deepStripUndefinedInPlace:()=>cn,deriveKeyPbkdf2:()=>ar,detect:()=>_n,digest:()=>sr,empty:()=>ci,encodeBase16:()=>Or,encodeBase32:()=>kr,encodeBase58:()=>Br,encodeBase62:()=>Hr,encodeQuery:()=>Lt,encrypt:()=>nt,endSortWeight:()=>Tt,ensureKey:()=>ii,ensureKeyAsync:()=>si,equalBinary:()=>Qe,escapeHTML:()=>ht,escapeRegExp:()=>xt,estimateSizeForBase:()=>Nr,fetchBasic:()=>St,fetchJson:()=>ns,fetchOptionsBasicAuth:()=>$n,fetchOptionsFormURLEncoded:()=>os,fetchOptionsJson:()=>is,fetchText:()=>rs,fixBrokenUth8String:()=>to,forEachDay:()=>ho,forTimes:()=>pi,formatMessages:()=>tn,formatMilliseconds:()=>vt,fromBase64:()=>jt,fromBase64String:()=>ir,fromCamelCase:()=>qr,fromHex:()=>Ke,getGlobal:()=>ss,getGlobalContext:()=>Y,getGlobalEmitter:()=>Si,getGlobalLogger:()=>It,getNamespaceFilterString:()=>kt,getNavigator:()=>On,getSecureRandom:()=>zt,getSecureRandomIfPossible:()=>P,getTimestamp:()=>te,getWindow:()=>Et,gravatarURLByEmail:()=>gs,immediate:()=>po,isArray:()=>_,isBoolean:()=>yt,isBrowser:()=>He,isEven:()=>bt,isHalf:()=>X,isInteger:()=>Fo,isLocalHost:()=>es,isNotNull:()=>Eo,isNull:()=>Uo,isNullOrUndefined:()=>Po,isNumber:()=>mt,isObject:()=>O,isPrime:()=>gr,isPrimeRX:()=>pr,isPrimitive:()=>Ee,isPromise:()=>M,isRecord:()=>ce,isRecordPlain:()=>Co,isSafeInteger:()=>Do,isString:()=>Ao,isTimeout:()=>mo,isUint8Array:()=>So,isValue:()=>Mo,joinToUint8Array:()=>rr,jsonStringify:()=>nr,jsonStringifySafe:()=>S,jsonStringifySorted:()=>er,jsonToUint8Array:()=>be,last:()=>ui,lazyListener:()=>Mi,linkifyPlainText:()=>ri,listDistinctUnion:()=>$o,listGroupBy:()=>Io,listOfKey:()=>Oo,listQuery:()=>ko,memoize:()=>fi,memoizeAsync:()=>di,messages:()=>Ei,moveSortWeight:()=>ei,noop:()=>cs,objectIsEmpty:()=>jo,objectMap:()=>_o,objectMergeDisposable:()=>Bo,parseBasicAuth:()=>In,parseDate:()=>Ri,parseLogLevel:()=>Q,parseOrderby:()=>Gt,parseQuery:()=>oi,platform:()=>as,promisify:()=>$,qid:()=>Gi,randomBoolean:()=>ur,randomFloat:()=>lr,randomInt:()=>cr,randomUint8Array:()=>W,regExpEscape:()=>hi,regExpString:()=>mn,renderMessages:()=>eo,roundDown:()=>Jo,roundHalfAwayFromZero:()=>Ko,roundHalfDown:()=>Yo,roundHalfEven:()=>Qo,roundHalfOdd:()=>Zo,roundHalfTowardsZero:()=>Xo,roundHalfUp:()=>Wo,roundUp:()=>qo,seededRandom:()=>mr,selectColor:()=>ge,setUuidDefaultEncoding:()=>Hi,setupBrowserLog:()=>Gn,size:()=>ai,sleep:()=>fo,sortedItems:()=>dn,sortedOrderby:()=>hr,startSortWeight:()=>wt,stringToBoolean:()=>Jr,stringToFloat:()=>Zr,stringToInteger:()=>Wr,stringToUInt8Array:()=>Je,suid:()=>_i,suidBytes:()=>At,suidBytesDate:()=>Un,suidDate:()=>Bi,sum:()=>Nt,supportsColors:()=>pe,throttle:()=>Qi,timeout:()=>go,timeoutReached:()=>dt,timoutError:()=>pt,toBase64:()=>Ye,toBase64Url:()=>or,toBool:()=>Xr,toCamelCase:()=>Gr,toCapitalize:()=>Kt,toCapitalizeWords:()=>Vr,toFloat:()=>Kr,toHex:()=>Ze,toHumanReadableUrl:()=>pn,toInt:()=>Yr,toString:()=>Qr,toUint8Array:()=>E,toValidFilename:()=>Go,today:()=>xo,tryTimeout:()=>gt,uname:()=>R,unescapeHTML:()=>Ro,urlBase64ToUint8Array:()=>fs,useAsyncMutex:()=>Ui,useBase:()=>z,useDefer:()=>Ci,useDispose:()=>ke,useDisposer:()=>vi,useEventListener:()=>Di,useExitHandler:()=>us,useInterval:()=>Fi,useLevelFilter:()=>q,useMessageHub:()=>qi,useMutex:()=>Pi,useNamespaceFilter:()=>k,usePool:()=>Yi,usePubSub:()=>Ji,useRPC:()=>Ki,useSorted:()=>ti,useTimeout:()=>Ai,uuid:()=>N,uuid32bit:()=>ji,uuidB32:()=>Ln,uuidB62:()=>bn,uuidBytes:()=>$e,uuidDecode:()=>Dt,uuidDecodeB32:()=>Cn,uuidDecodeB62:()=>Tn,uuidDecodeV4:()=>Dn,uuidEncode:()=>En,uuidEncodeB32:()=>vn,uuidEncodeB62:()=>wn,uuidEncodeV4:()=>Fn,uuidIsValid:()=>zi,uuidv4:()=>An,valueToBoolean:()=>Qt,valueToFloat:()=>en,valueToInteger:()=>Xt,valueToString:()=>Fe,waitOn:()=>yo});module.exports=Kn(vs);function Yn(){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")}r(Yn,"_global");function Y(){let e=Yn();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}r(Y,"getGlobalContext");function kt(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}r(kt,"getNamespaceFilterString");var Qn=kt(typeof process<"u"?process.env.ZEED??process.env.DEBUG:typeof localStorage<"u"?localStorage.zeed??localStorage.debug:"*");function k(e=Qn){let t,n=[],o=[];if(!e)t=r(function(i){return!1},"fn");else if(e==="*")t=r(function(i){return!0},"fn");else{let i,s=e.split(/[\s,]+/),c=s.length;for(i=0;i<c;i++){if(!s[i])continue;let u=s[i].replace(/\*/g,".*?");u[0]==="-"?n.push(new RegExp(`^${u.substr(1)}$`)):o.push(new RegExp(`^${u}$`))}t=r(function(u){if(n.length===0&&o.length===0)return!0;let p,m;for(p=0,m=n.length;p<m;p++)if(n[p].test(u))return!1;for(p=0,m=o.length;p<m;p++)if(o[p].test(u))return!0;return!1},"fn")}return t.accept=o,t.reject=n,t.filter=e,t}r(k,"useNamespaceFilter");var Xn=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 Q(e){if(e===!1)return 1/0;if(typeof e=="number")return e;if(typeof e=="string"){let t=Ge[e.toLocaleLowerCase().trim()];if(t!=null)return t}return-1}r(Q,"parseLogLevel");function q(e=Xn){let t=Q(e);return n=>n>=t}r(q,"useLevelFilter");function se(e={}){let{level:t=void 0,filter:n=void 0}=e,o=k(n),i=q(t);return s=>{if(!i(s.level)||!o(s.name))return;let c=s.name?`[${s.name}]`:"";switch(s.level){case 1:console.info(`I|* ${c}`,...s.messages);break;case 2:console.warn(`W|** ${c}`,...s.messages);break;case 3:console.error(`E|*** ${c}`,...s.messages);break;default:console.debug(`D| ${c}`,...s.messages);break}}}r(se,"LoggerConsoleHandler");var H=(u=>(u[u.all=-1]="all",u[u.debug=0]="debug",u[u.info=1]="info",u[u.warn=2]="warn",u[u.error=3]="error",u[u.fatal=4]="fatal",u[u.off=1/0]="off",u))(H||{}),Ge={"*":-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:1/0,"-":1/0};function Ve(e=""){let t=[se()],n=r(p=>!0,"logCheckNamespace"),o=!1,i=c,s=!1;function c(p="",m){let h=Q(m??-1);function x(w,T){return h<=w?T:()=>{}}r(x,"defineForLogLevel");let b=x(0,(...w)=>{L({name:p,messages:w,level:0})});b.label=p,b.extend=function(w){return i(p?`${p}:${w}`:w)};let L=r(w=>{if(n(p))for(let T of t)T&&T(w)},"emit");return b.debug=x(0,(...w)=>{L({name:p,messages:w,level:0})}),b.info=x(1,(...w)=>{L({name:p,messages:w,level:1})}),b.warn=x(2,(...w)=>{L({name:p,messages:w,level:2})}),b.error=x(3,(...w)=>{L({name:p,messages:w,level:3})}),b.fatal=x(4,(...w)=>{throw L({name:p,messages:w,level:4}),new Error(`${w.map(String).join(" ")}`)}),b.assert=x(4,(w,...T)=>{w||b.fatal(...T)}),b}r(c,"LoggerBaseFactory");function u(p="",m){let h=i(p,m);return s&&h.debug(`+++ init of logger "${p}" on level "${H[h.level]}".`),h}return r(u,"Logger"),u.registerHandler=function(p){t.push(p)},u.setFilter=function(p){n=k(p)},u.setLock=(p=!0)=>o=p,u.setDebug=(p=!0)=>s=p,u.setHandlers=function(p=[]){i!==c&&(i=c),!o&&(t=[...p].filter(m=>typeof m=="function"))},u.level=-1,u.setLogLevel=function(p=-1){o||(u.level=p)},u.setFactory=function(p){o||(i=p)},u}r(Ve,"LoggerContext");var J;function qe(){let e=Ve();return e.setHandlers([se()]),e}r(qe,"getLoggerContext");function It(){if(J==null)try{let e=Y();e!=null?e?.logger==null?(J=qe(),e.logger=J):J=e.logger:J=qe()}catch{J=qe()}return J}r(It,"getGlobalLogger");var v=It();var $t=r((e,t)=>t instanceof Object&&!Array.isArray(t)?Object.keys(t).sort().reduce((n,o)=>(n[o]=t[o],n),{}):t,"_sortedReplacer");function er(e,t=void 0){return JSON.stringify(e,$t,t)}r(er,"jsonStringifySorted");function tr(e,t){let n=[],o=[];return t==null&&(t=r(function(i,s){return n[0]===s?"[Circular ~]":`[Circular ~.${o.slice(0,n.indexOf(s)).join(".")}]`},"cycleReplacer")),function(i,s){if(n.length>0){let c=n.indexOf(this);~c?n.splice(c+1):n.push(this),~c?o.splice(c,1/0,i):o.push(i),~n.indexOf(s)&&(s=t?.call(this,i,s))}else n.push(s);s=$t(i,s);try{return e==null?s:e.call(this,i,s)}catch{}return String(s)}}r(tr,"serializer");function S(e,t,n,o){return JSON.stringify(e,tr(t,o),n)}r(S,"jsonStringifySafe");var nr=S;var Ot=v("zeed:bin","error");function _t(e){let t=unescape(encodeURIComponent(e)),n=t.length,o=new Uint8Array(n);for(let i=0;i<n;i++)o[i]=t.codePointAt(i)||0;return o}r(_t,"_encodeUtf8Polyfill");function Bt(e){let t=e.length,n="",o=0;for(;t>0;){let i=t<1e4?t:1e4,s=e.subarray(o,o+i);o+=i,n+=String.fromCodePoint.apply(null,s),t-=i}return decodeURIComponent(escape(n))}r(Bt,"_decodeUtf8Polyfill");var he;function Je(e){if(he==null&&(he=_t,typeof TextEncoder<"u")){let t=new TextEncoder;he=r(n=>t.encode(n),"_textEncoder")}return he(e.normalize("NFC"))}r(Je,"stringToUInt8Array");var xe;function We(e){if(xe==null&&(xe=Bt,typeof TextDecoder<"u")){let t=new TextDecoder("utf-8",{ignoreBOM:!0});xe=r(n=>t.decode(n),"_textDecoder")}return xe(e).normalize("NFC")}r(We,"Uint8ArrayToString");function E(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Je(e):e.length?new Uint8Array(e):e}r(E,"toUint8Array");function rr(...e){let t=0,n=e.flat(1).map(s=>{let c=E(s);return t+=c.length,c}),o=new Uint8Array(t),i=0;for(let s of n)o.set(s,i),i+=s.length;return o}r(rr,"joinToUint8Array");function Ze(e){if(typeof Buffer<"u")return Buffer.from(E(e)).toString("hex");let t="0123456789abcdef",n="";for(let o of[...E(e)])n+=t[o>>4]+t[o&15];return n}r(Ze,"toHex");function Ke(e){return Uint8Array.from(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}r(Ke,"fromHex");function Ye(e,t=!1){let n=E(e),o="";if(typeof Buffer<"u")o=Buffer.from(n).toString("base64");else{let i="";for(let s=0;s<n.byteLength;s++)i+=String.fromCharCode(n[s]);o=btoa(i)}return t?o.replaceAll("=",""):o}r(Ye,"toBase64");function or(e){let t=E(e);if(typeof Buffer<"u")return Buffer.from(t).toString("base64url").replaceAll("=","");let n="";for(let o=0;o<t.byteLength;o++)n+=String.fromCharCode(t[o]);return btoa(n).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}r(or,"toBase64Url");function jt(e){if(e=e.replaceAll("-","+").replaceAll("_","/"),typeof Buffer<"u"){let o=Buffer.from(e,"base64");return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}r(jt,"fromBase64");function ir(e){return We(jt(e))}r(ir,"fromBase64String");function Qe(e,t){if(e.byteLength!==t.byteLength)return!1;let n=E(e),o=E(t);for(let i=0;i<n.length;i++)if(n[i]!==o[i])return!1;return!0}r(Qe,"equalBinary");function be(e){try{return Je(S(e))}catch(t){throw Ot.warn("jsonToUint8Array",e),t}}r(be,"jsonToUint8Array");function we(e){try{return JSON.parse(We(e))}catch(t){throw Ot.warn("Uint8ArrayToJson",e),t}}r(we,"Uint8ArrayToJson");function Xe(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=[],o="0123456789ABCDEF";for(let i=0;i<e.length;i+=t){let s=e.slice(i,Math.min(i+t,e.length)),c=`0000${i.toString(16)}`.slice(-4),u=s.split("").map(m=>{let h=m.charCodeAt(0);return` ${o[(240&h)>>4]}${o[15&h]}`}).join("");u+=" ".repeat(t-s.length);let p=s.replace(/[\x00-\x1F\x20]/g,".");p+=" ".repeat(t-s.length),n.push(`${c} ${u} ${p}`)}return n.join(`
|
|
2
|
+
`)}r(Xe,"Uint8ArrayToHexDump");function W(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}r(W,"randomUint8Array");var tt="SHA-256",Le="AES-GCM",et="PBKDF2",Ht=1e5;async function sr(e,t=tt){return E(await crypto.subtle.digest(t,E(e)))}r(sr,"digest");async function ar(e,t={}){let n=E(e),o=await crypto.subtle.importKey("raw",n,et,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:et,salt:t.salt?E(t.salt):new Uint8Array(0),iterations:t.iterations??Ht,hash:tt},o,{name:Le,length:256},!0,["encrypt","decrypt"])}r(ar,"deriveKeyPbkdf2");var Te=new Uint8Array([1,1]);async function nt(e,t){let n=W(12),o=await crypto.subtle.encrypt({name:Le,iv:n},t,e),i=new Uint8Array(o),s=Te.length+n.length+i.length,c=new Uint8Array(s),u=0;return c.set(Te,u),u+=Te.length,c.set(n,u),u+=n.length,c.set(i,u),c}r(nt,"encrypt");async function rt(e,t){let n=e.subarray(0,2);if(!Qe(n,Te))return Promise.reject(new Error(`Unknown magic ${n}`));let o=e.subarray(2,2+12),i=e.subarray(2+12,e.length),s=await crypto.subtle.decrypt({name:Le,iv:o},t,i);return new Uint8Array(s)}r(rt,"decrypt");function zt(){return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}r(zt,"getSecureRandom");function P(){return typeof crypto<"u"?zt():Math.random()}r(P,"getSecureRandomIfPossible");function ur(e=.25){return P()<e}r(ur,"randomBoolean");function cr(e=100,t=0){return t+Math.floor(P()*(e-t))}r(cr,"randomInt");function lr(e=100,t=0){return t+P()*(e-t)}r(lr,"randomFloat");function fr(e,t,n){return Math.max(e,Math.min(n,t))}r(fr,"between");function Nt(e){return e.reduce((t,n)=>t+n,0)}r(Nt,"sum");function dr(e){return Nt(e)/e.length}r(dr,"avg");function pr(e){return!/^1?$|^(11+?)\1+$/.test("1".repeat(e))}r(pr,"isPrimeRX");function gr(e){for(let t=2;t<e;t++)if(e%t===0)return!1;return e>1}r(gr,"isPrime");var ot=6;function mr(e=0,t=1,n){ot=((n??ot)*9301+49297)%233280;let o=ot/233280;return t+o*(e-t)}r(mr,"seededRandom");function Gt(e=""){let[t="",n="asc"]=e.split(" ");return n=n.toLowerCase(),{field:t,orderby:n,asc:n!=="desc",desc:n==="desc"}}r(Gt,"parseOrderby");function yr(e,t=!0){return`${e} ${t?"asc":"desc"}`}r(yr,"composeOrderby");function ve(e,t,n=!0){let o=e||0,i=t||0;return o>i?n?1:-1:o<i?n?-1:1:0}r(ve,"cmp");function hr(e,...t){if(t.length>0){let n=t.map(Gt),o=Array.from(e);return o.sort((i,s)=>{for(let{field:c,asc:u}of n){let p=ve(i[c],s[c],u);if(p!==0)return p}return 0}),o}return e}r(hr,"sortedOrderby");function Ce(e){return e.filter((t,n)=>e.indexOf(t)===n)}r(Ce,"arrayUnique");function Vt(e,t){return Ce(e.filter(n=>!t.includes(n)))}r(Vt,"arrayMinus");function qt(...e){return Ce(e.reduce((t=[],n)=>t.concat(n),[]))}r(qt,"arrayUnion");function Z(...e){return e.flat(1/0)}r(Z,"arrayFlatten");function Jt(e,t){return Ce(e).filter(n=>t.includes(n))}r(Jt,"arrayIntersection");function xr(e,t){return Vt(qt(e,t),Jt(e,t))}r(xr,"arraySymmetricDifference");function it(e,t){if(e&&Array.isArray(e)){let n;for(;(n=e.indexOf(t))!==-1;)e.splice(n,1);return e}return[]}r(it,"arrayRemoveElement");function br(e,t){return e.includes(t)||e.push(t),e}r(br,"arraySetElement");function Ae(e,t){return e.splice(0,e.length,...e.filter(t)),e}r(Ae,"arrayFilterInPlace");function wr(e,t){let n=e.findIndex(o=>o===t);return n>=0?e.splice(n,1):e.push(t),e}r(wr,"arrayToggleInPlace");function Tr(e){return e.splice(0,e.length),e}r(Tr,"arrayEmptyInPlace");function Wt(e,t=ve){return Array.from(e).sort(t)}r(Wt,"arraySorted");function Lr(e){return Wt(e,(t,n)=>t-n)}r(Lr,"arraySortedNumbers");function Zt(e,t){return e.length===t.length&&e.every((n,o)=>n===t[o])}r(Zt,"arrayIsEqual");function st(e){return e.sort(()=>P()>.5?1:-1),e}r(st,"arrayShuffleInPlace");function vr(e){return st(Array.from(e))}r(vr,"arrayShuffle");function Cr(e){for(;e.length>1;){let t=Array.from(e);if(st(t),!Zt(e,t))return t}return e}r(Cr,"arrayShuffleForce");function Ar(e){return e[Math.floor(P()*e.length)]}r(Ar,"arrayRandomElement");function Fr(...e){return Z(e).reduce((t,n)=>t!=null?n>t?n:t:n,void 0)}r(Fr,"arrayMax");function Dr(...e){return Z(e).reduce((t,n)=>t!=null?n<t?n:t:n,void 0)}r(Dr,"arrayMin");function Pr(...e){return Z(e).reduce((t,n)=>t+n,0)}r(Pr,"arraySum");function Ur(...e){let t=Z(e);return t.reduce((n,o)=>n+o,0)/t.length}r(Ur,"arrayAvg");function Sr(e,t){let n=[],o=0,i=e.length;for(;o<i;)n.push(e.slice(o,o+=t));return n}r(Sr,"arrayBatches");function Er(e=0,t){if(e<=0)return[];let n=new Array(e);for(let o=0;o<e;o++)n[o]=t instanceof Function?t(o):t;return n}r(Er,"createArray");var Mr=v("zeed:basex","error"),Rr={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 z(e){let t=Rr[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 m=0;m<n.length;m++)n[m]=255;for(let m=0;m<t.length;m++){let h=t.charAt(m),x=h.charCodeAt(0);if(n[x]!==255)throw new TypeError(`${h} is ambiguous`);n[x]=m}let o=t.length,i=t.charAt(0),s=Math.log(o)/Math.log(256),c=Math.log(256)/Math.log(o);function u(m,h=-1){let x=E(m);if(x.byteLength===0)return"";let b=0,L=0,w=x.byteLength;for(;L!==w&&x[L]===0;)L++;let T=(w-L)*c+1>>>0,C=new Uint8Array(T);for(;L!==w;){let a=x[L],l=0;for(let d=T-1;(a!==0||l<b)&&d!==-1;d--,l++)a+=256*C[d]>>>0,C[d]=a%o>>>0,a=a/o>>>0;if(a!==0)throw Mr.warn("Non-zero carry",x,h,l,T),new Error("Non-zero carry");b=l,L++}let y=T-b;for(;y!==T&&C[y]===0;)y++;let f="";for(;y<T;++y)f+=t.charAt(C[y]);return h>0?f.padStart(h,i):f}r(u,"encode");function p(m,h=-1){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;m=m.replace(/\s+/gi,"");let x=0,b=0;for(;m[x]===i;)x++;let L=(m.length-x)*s+1>>>0,w=new Uint8Array(L);for(;m[x];){let C=n[m.charCodeAt(x)];if(C===255)throw new Error(`Unsupported character "${m[x]}"`);let y=0;for(let f=L-1;(C!==0||y<b)&&f!==-1;f--,y++)C+=o*w[f]>>>0,w[f]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");b=y,x++}let T=L-b;for(;T!==L&&w[T]===0;)T++;return h>0?new Uint8Array([...new Uint8Array(h-w.length+T),...w.slice(T)]):w.slice(T)}return r(p,"decode"),{encode:u,decode:p}}r(z,"useBase");var{encode:kr,decode:Ir}=z(32);function $r(e){return Ir(e.toLocaleLowerCase().replaceAll("l","1").replaceAll("s","5").replaceAll("o","0").replaceAll("i","1"))}r($r,"decodeBase32");var{encode:Or,decode:_r}=z(16),{encode:Br,decode:jr}=z(58),{encode:Hr,decode:zr}=z(62);function Nr(e,t){return Math.ceil(e*(Math.log(256)/Math.log(t)))}r(Nr,"estimateSizeForBase");var Gr=r(e=>(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),"toCamelCase");function Kt(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}r(Kt,"toCapitalize");function Vr(e){return e.replace(/\w\S*/g,Kt)}r(Vr,"toCapitalizeWords");function qr(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()}r(qr,"fromCamelCase");var Yt=["1","true","yes","y","on"];function Jr(e,t=!1){return e==null||typeof e!="string"?t:Yt.includes(String(e).trim().toLowerCase())}r(Jr,"stringToBoolean");function Wr(e,t=0){return e==null||typeof e!="string"?t:parseInt(e.trim(),10)??t}r(Wr,"stringToInteger");function Zr(e,t=0){return e==null||typeof e!="string"?t:parseFloat(e.trim())??t}r(Zr,"stringToFloat");function Qt(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:Yt.includes(String(e).trim().toLowerCase())}r(Qt,"valueToBoolean");function Xt(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseInt(String(e).trim(),10)??t}r(Xt,"valueToInteger");function en(e,t=0){return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):parseFloat(String(e).trim())??t}r(en,"valueToFloat");function Fe(e,t=""){return e==null?t:String(e)??t}r(Fe,"valueToString");var Kr=en,Yr=Xt,Qr=Fe,Xr=Qt;function tn(e,t={}){let{trace:n=!0,pretty:o=!0}=t;return e.map(i=>{if(i&&typeof i=="object"){if(o&&(i instanceof Uint8Array||i instanceof ArrayBuffer))return`
|
|
3
3
|
${Xe(i)}
|
|
4
4
|
`;if(i instanceof Error)return n?`${i.name||"Error"}: ${i.message}
|
|
5
|
-
${i.stack}`:`${i.name||"Error"}: ${i.message}`;try{return o?JSON.stringify(i,null,2):JSON.stringify(i)}catch{}}return String(i)})}r(en,"formatMessages");function Xr(e,t={}){return en(e,t).join(" ")}r(Xr,"renderMessages");function eo(e){try{return decodeURIComponent(escape(e))}catch{}return e}r(eo,"fixBrokenUth8String");var Pe=864e5;function Ue(e){return Math.floor(e/1e4)}r(Ue,"dayYear");function at(e){return Math.floor(e/100%100)}r(at,"dayMonth");function tn(e){return Math.floor(e%100)}r(tn,"dayDay");function to(e){return[Ue(e),at(e),tn(e)]}r(to,"dayToParts");function ut(e,t=!1){return t?new Date(`${rn(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}r(ut,"dayToDate");function ct(){return ue(new Date)}r(ct,"dayFromToday");function no(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return lt(e);if(Array.isArray(e)&&e.length===3){let[n,o,i]=e;return Se(n,o,i)}else if(e instanceof Date)return ue(e,t)}r(no,"dayFromAny");function ro(e){return ut(e,!0)}r(ro,"dayToDateGMT");function ue(e,t=!1){return t?lt(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}r(ue,"dayFromDate");function oo(e){return ue(e,!0)}r(oo,"dayFromDateGMT");function De(e,t=!0){return ut(e,t).getTime()}r(De,"dayToTimestamp");function nn(e,t=!0){return ue(new Date(e),t)}r(nn,"dayFromTimestamp");function rn(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}r(rn,"dayToString");function Se(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}r(Se,"dayFromParts");function lt(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return+t}r(lt,"dayFromString");function io(e,t=0){let n=Ue(e),o=at(e);return t!==0&&(o+=t,n+=Math.floor((o-1)/12),o=Math.floor((o-1)%12)+1,o===0&&(o=12)),Se(n,o,1)}r(io,"dayMonthStart");function so(e,t=0){let n=Ue(e);return Se(n+t,1,1)}r(so,"dayYearStart");function ae(e,t){return nn(De(e)+t*864e5)}r(ae,"dayOffset");function ao(e,t){return Math.round((De(t)-De(e))/864e5)}r(ao,"dayDiff");function uo(e,t){let n=[];for(t==null&&(t=ct()),e<0&&(e=ae(t,e+1));e<=t;)n.push(e),e=ae(e,1);return n}r(uo,"dayRange");function*co(e,t){let n=[];for(t==null&&(t=ct()),e<0&&(e=ae(t,e+1));e<=t;)yield e,e=ae(e,1);return n}r(co,"dayIterator");var on=v("zeed:promise","error");function ft(){let e,t;return[new Promise((o,i)=>{e=o,t=i}),e,t]}r(ft,"createPromise");async function lo(e){return new Promise(t=>setTimeout(t,e))}r(lo,"sleep");async function fo(){return new Promise(e=>setTimeout(e,0))}r(fo,"immediate");var dt=Symbol("timeout");async function po(e,t,n=dt){return new Promise(async(o,i)=>{let s=!1,c=setTimeout(()=>{s=!0,o(n)},t);try{let u=await e;clearTimeout(c),s||o(u)}catch(u){clearTimeout(c),s||i(u)}})}r(po,"timeout");var pt=new Error("Timeout reached");function go(e){return e===dt||e===pt}r(go,"isTimeout");async function gt(e,t){return t<=0?await e:new Promise(async(n,o)=>{let i=!1,s=setTimeout(()=>{i=!0,o(pt)},t);try{let c=await e;clearTimeout(s),i||n(c)}catch(c){clearTimeout(s),i||o(c)}})}r(gt,"tryTimeout");function mo(e,t,n=1e3){return new Promise((o,i)=>{let s=r(p=>{u&&(clearTimeout(u),c(),o(p))},"fn"),c=r(()=>{u=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):on.warn("No remove listener method found for",e,t)},"done"),u=setTimeout(()=>{c(),i(new Error("Did not response in time"))},n);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):on.warn("No listener method found for",e)})}r(mo,"waitOn");function M(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}r(M,"isPromise");function $(e){return Promise.resolve(e)}r($,"promisify");var D=class{get value(){return this.days}constructor(t){if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=D.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 D(t)}static fromString(t){return D.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,n=!1){return n?D.fromString(t.toISOString().substr(0,10)):D.from(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return D.fromDate(t,!0)}static from(t,n=!1){if(typeof t=="number")return t<100?void 0:new D(t);if(typeof t=="string")return D.fromString(t);if(Array.isArray(t)&&t.length===3){let[o,i=1,s=1]=t;return i<1||i>12||s<1||s>31?void 0:new D(o*1e4+i*100+s)}else{if(t instanceof Date)return D.fromDate(t,n);if(t instanceof D)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 D.fromDateGMT(new Date(this.toDateGMT().getTime()+t*864e5))}monthStart(){return D.from([this.year,this.month,1])}yearStart(){return D.from([this.year,1,1])}monthOffset(t){let n=this.month+t,o=Math.floor((n-1)%12)+1;o===0&&(o=12);let i=Math.floor((n-1)/12);return D.from([this.year+i,o,this.day])}daysUntil(t){return Math.round((new D(t)?.toDateGMT().getTime()-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};r(D,"Day");async function yo(e,t,n){let o=D.from(e),i=D.from(t);for(;o&&i&&o?.days<=i?.days;){let s=n(o);M(s)&&await s,o=o.dayOffset(1)}}r(yo,"forEachDay");function ho(){return new D}r(ho,"today");function xo(e){return new D(e)}r(xo,"day");function bo(e){return D.fromDate(new Date(e)).days}r(bo,"dateStringToDays");function sn(e,t=2){return+(+e).toFixed(t)}r(sn,"decimal");function wo(e,t=2){return+(+e/10**t).toFixed(t)}r(wo,"decimalFromCents");function To(e,t=2){return Math.round(+e*10**t)}r(To,"decimalToCents");function Lo(e,t=2){return t*(sn(e,t)%1)}r(Lo,"decimalCentsPart");function O(e){return e!=null&&typeof e=="object"}r(O,"isObject");function Ee(e){return Object(e)!==e}r(Ee,"isPrimitive");function _(e){return Array.isArray(e)}r(_,"isArray");function ce(e){return O(e)&&!_(e)}r(ce,"isRecord");function vo(e){return e?.constructor===Object}r(vo,"isRecordPlain");function Co(e){return typeof e=="string"}r(Co,"isString");function Ao(e){return typeof e=="number"}r(Ao,"isNumber");function Fo(e){return typeof e=="number"&&Number.isInteger(e)}r(Fo,"isInteger");function Do(e){return typeof e=="number"&&Number.isSafeInteger(e)}r(Do,"isSafeInteger");function mt(e){return typeof e=="boolean"}r(mt,"isBoolean");function Po(e){return e==null}r(Po,"isNullOrUndefined");function Uo(e){return e==null}r(Uo,"isNull");function So(e){return O(e)&&e.constructor.name==="Uint8Array"}r(So,"isUint8Array");function Eo(e){return e!=null}r(Eo,"isNotNull");function Mo(e){return e!=null&&e!==!1&&e!==!0}r(Mo,"isValue");function an(e,t,n=new WeakSet){if(e===t)return!0;if(n.has(t)||(Ee(t)||n.add(t),!(e instanceof Object)||!(t instanceof Object))||e.constructor!==t.constructor||e.length!==t.length)return!1;for(let o in e){if(!e.hasOwnProperty(o))continue;if(!t.hasOwnProperty(o))return!1;let i=e[o],s=t[o];if(!an(i,s,n))return!1}for(let o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}r(an,"deepEqual");function un(e,t=new WeakSet){if(t.has(e))return"[Circular ~]";if(Ee(e)||t.add(e),ce(e)){for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===void 0){delete e[n];continue}un(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}r(un,"deepStripUndefinedInPlace");function le(e,...t){for(let n of t)O(e)||(e={}),!(n==null||!O(n))&&Object.keys(n).forEach(o=>{let i=e[o],s=n[o];Array.isArray(i)&&Array.isArray(s)?e[o]=i.concat(s):O(i)&&O(s)?e[o]=le(Object.assign({},i),s):e[o]=s});return e}r(le,"deepMerge");var yt=r(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),"escapeHTML"),Ro=r(e=>e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),"unescapeHTML");function ko(e,t,n=[]){return e.filter(o=>!t.some(i=>!i(o))).map(o=>{for(let i of n)o=i(o);return o}).filter(o=>o!=null)}r(ko,"listQuery");function Io(e,t){return e.reduce((n,o)=>{let i=String(o[t]);return(n[i]=n[i]||[]).push(o),n},{})}r(Io,"listGroupBy");function $o(e,t){return Array.from(e.reduce((n,o)=>n.add(o[t]),new Set))}r($o,"listDistinctUnion");function Oo(e,t){return e.map(n=>n[t])}r(Oo,"listOfKey");function _o(e,t){return O(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>{let i=t(n,o);return _(i)&&i.length===2?i:[n,i]}).filter(n=>n!=null)):{}}r(_o,"objectMap");function Bo(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}r(Bo,"objectMergeDisposable");function jo(e){return Object.keys(e).length<=0}r(jo,"objectIsEmpty");var cn=/[\u0000-\u001F\u0080-\u009F]/g,Ho=/^\.+/,zo=/\.+$/;function ln(){return/[<>:"/\\|?*\u0000-\u001F]/g}r(ln,"filenameReservedRegex");function No(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}r(No,"windowsReservedNameRegex");function Go(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(ln().test(t)&&cn.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(ln(),t).replace(cn,t).replace(Ho,t).replace(zo,""),e=No().test(e)?e+t:e,e.slice(0,100)}r(Go,"toValidFilename");var Vo=/[\\\-\[\]\/{}()*+?.^$|]/g;function ht(e){return e?e instanceof RegExp?e.source:e.replace(Vo,"\\$&"):""}r(ht,"escapeRegExp");var X=r(e=>Math.abs(e)%1===.5,"isHalf"),xt=r(e=>e%2===0,"isEven"),qo=r(e=>Math.ceil(e),"roundUp"),Jo=r(e=>Math.floor(e),"roundDown"),Wo=r(e=>Math.round(e),"roundHalfUp"),Zo=r(e=>{let t=Math.round(e);return X(e)&&xt(t)?t-1:t},"roundHalfOdd"),Ko=r(e=>X(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),Yo=r(e=>X(e)?Math.floor(e):Math.round(e),"roundHalfDown"),Qo=r(e=>{let t=Math.round(e);return X(e)?xt(t)?t:t-1:t},"roundHalfEven"),Xo=r(e=>X(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");function bt(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-P()}r(bt,"startSortWeight");function wt(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+P()}r(wt,"endSortWeight");function ei(e,t,n){let o=n.length,i=e<t;if(o<=0||e>=o-1)return wt(n);if(e<=0)return bt(n);n=fn([...n]);let s=i?-1:0,c=n[e+s].sort_weight||0,p=(n[e+s+1].sort_weight||0)-c;if(p===0)return i?bt(n):wt(n);let m=c+p/2,h=p*.01*(P()-.5);return m+h}r(ei,"moveSortWeight");function fn(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}r(fn,"sortedItems");function ti(e={}){let{getter:t=r(u=>u.sort,"getter")}=e;function n(u){return u.sort((p,m)=>(t(p)||0)-(t(m)||0)),u}r(n,"items");function o(u){return u.reduce((p,m)=>Math.min(p,t(m)||0),0)-1-P()}r(o,"start");function i(u){return u.reduce((p,m)=>Math.max(p,t(m)||0),0)+1+P()}r(i,"end");function s(u,p){u==null&&(u=(p??0)-1),p==null&&(p=(u??0)+1);let m=p-u,h=u+m/2,x=m*.01*(P()-.5);return h+x}r(s,"between");function c(u,p,m){let h=m.length,x=u<p;if(h<=0||u>=h-1)return i(m);if(u<=0)return o(m);m=n([...m]);let b=x?-1:0,L=t(m[u+b])||0,T=(t(m[u+b+1])||0)-L;if(T===0)return x?o(m):i(m);let C=L+T/2,y=T*.01*(P()-.5);return C+y}return r(c,"move"),{start:o,end:i,between:s,move:c,items:n}}r(ti,"useSorted");var ni=/((?:(?:(?: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 ri(e){return e.split(ni).map((t,n)=>{let o=yt(t);return n%2?`<a target="_blank" href="${o}">${dn(o)}</a>`:o}).join("")}r(ri,"linkifyPlainText");function dn(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}r(dn,"toHumanReadableUrl");function Tt(e){let t=[];for(let[n,o]of Object.entries(e))if(o!=null){Array.isArray(o)||(o=[o]);for(let i of o)i!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`)}return t.join("&")}r(Tt,"encodeQuery");function oi(e){let t={},n=(e[0]==="?"?e.substr(1):e).split("&");for(let o=0;o<n.length;o++){let i=n[o].split("="),s=decodeURIComponent(i[0]),c=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(c)):t[s]=c}return t}r(oi,"parseQuery");function ii(e,t,n){let o=e[t];return o===void 0&&(o=n(t,e),e[t]=o),o}r(ii,"ensureKey");async function si(e,t,n){let o=e[t];return o===void 0&&(o=await n(t,e),e[t]=o),o}r(si,"ensureKeyAsync");function ai(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}r(ai,"size");function ui(e){return e!=null&&e.length>0?e[e.length-1]:void 0}r(ui,"last");function ci(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}r(ci,"empty");function Me(e){return Object(e)!==e?e:JSON.parse(S(e))}r(Me,"cloneObject");function li(e){return Object(e)!==e?e:JSON.parse(S(e))}r(li,"cloneJsonObject");function fi(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let o=e(n);return t.set(n,o),o}}r(fi,"memoize");function di(e){let t=new Map;return async(...n)=>{let o=S(n);if(t.has(o))return t.get(o);let i=await e(...n);return t.set(o,i),i}}r(di,"memoizeAsync");function pi(e,t){let n=[];for(let o=0;o<e;o++)n.push(t(o,e));return n}r(pi,"forTimes");var gi=/\\\s|\s+|#[^\n]*\n?/gm,mi=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,pn=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm,yi=v("zeed:xrx","error");function gn(e){return typeof e=="string"?e:e.source||""}r(gn,"regExpString");function hi(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}r(hi,"regExpEscape");var Re=class{constructor(t,n){this.namedGroups={};this.names=[];let o=n??"",i;if(t instanceof RegExp?(n==null&&(o=t.flags),i=t.source):i=t,o&&o.includes("x")&&(o=o.replace("x",""),i=i.replace(gi,u=>u[0]==="\\"?u:"")),!(t instanceof RegExp)){let u=0;i=i.replace(mi,(p,m)=>(u+=1,m?(m!=="index"&&m!=="length"&&!this.namedGroups[m]?this.namedGroups[m]=u:yi.error(`Unallowed or duplicate group name: ${m}`),"("):p)),this.names=Object.keys(this.namedGroups)}i=gn(i),pn.lastIndex=0;let c=pn.exec(i);c&&(this.lookBehind={rx:new RegExp(`${c[3]}$(?!\\s)`),expect:c?c[2]==="=":!c},i=i.substr(c[0].length)),this.rx=new RegExp(i,o)}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=[],o;for(this.rx.lastIndex=0;o=this.exec(t);)n.push(o);return this.rx.lastIndex=0,n}replace(t,n){let o=typeof n=="function"?n:()=>n;return t.replace(this.rx,i=>o(i))}};r(Re,"XRX");var xi=",";function bi(e,t={}){let{separator:n=xi}=t,o="";for(let i=0;i<e.length;i++)o+=`${e[i].map(s=>{if(s==null||s==="")return"";if(mt(s))return s?1:0;let c=String(s);return(ce(s)||_(s))&&(c=S(s)),c.includes('"')||c.includes(`
|
|
5
|
+
${i.stack}`:`${i.name||"Error"}: ${i.message}`;try{return o?JSON.stringify(i,null,2):JSON.stringify(i)}catch{}}return String(i)})}r(tn,"formatMessages");function eo(e,t={}){return tn(e,t).join(" ")}r(eo,"renderMessages");function to(e){try{return decodeURIComponent(escape(e))}catch{}return e}r(to,"fixBrokenUth8String");var Pe=864e5;function Ue(e){return Math.floor(e/1e4)}r(Ue,"dayYear");function at(e){return Math.floor(e/100%100)}r(at,"dayMonth");function nn(e){return Math.floor(e%100)}r(nn,"dayDay");function no(e){return[Ue(e),at(e),nn(e)]}r(no,"dayToParts");function ut(e,t=!1){return t?new Date(`${on(e)}T00:00:00.000Z`):new Date(e/1e4,e/100%100-1,e%100)}r(ut,"dayToDate");function ct(){return ue(new Date)}r(ct,"dayFromToday");function ro(e,t=!1){if(typeof e=="number")return e<100?void 0:e;if(typeof e=="string")return lt(e);if(Array.isArray(e)&&e.length===3){let[n,o,i]=e;return Se(n,o,i)}else if(e instanceof Date)return ue(e,t)}r(ro,"dayFromAny");function oo(e){return ut(e,!0)}r(oo,"dayToDateGMT");function ue(e,t=!1){return t?lt(e.toISOString()):e.getFullYear()*1e4+(e.getMonth()+1)*100+e.getDate()}r(ue,"dayFromDate");function io(e){return ue(e,!0)}r(io,"dayFromDateGMT");function De(e,t=!0){return ut(e,t).getTime()}r(De,"dayToTimestamp");function rn(e,t=!0){return ue(new Date(e),t)}r(rn,"dayFromTimestamp");function on(e,t="-"){let n=String(e);return n.slice(0,4)+t+n.slice(4,6)+t+n.slice(6,8)}r(on,"dayToString");function Se(e,t=1,n=1){if(!(t<1||t>12||n<1||n>31))return e*1e4+t*100+n}r(Se,"dayFromParts");function lt(e){let t=String(e).replace(/[^0-9]/g,"").slice(0,8);if(t.length===8)return+t}r(lt,"dayFromString");function so(e,t=0){let n=Ue(e),o=at(e);return t!==0&&(o+=t,n+=Math.floor((o-1)/12),o=Math.floor((o-1)%12)+1,o===0&&(o=12)),Se(n,o,1)}r(so,"dayMonthStart");function ao(e,t=0){let n=Ue(e);return Se(n+t,1,1)}r(ao,"dayYearStart");function ae(e,t){return rn(De(e)+t*864e5)}r(ae,"dayOffset");function uo(e,t){return Math.round((De(t)-De(e))/864e5)}r(uo,"dayDiff");function co(e,t){let n=[];for(t==null&&(t=ct()),e<0&&(e=ae(t,e+1));e<=t;)n.push(e),e=ae(e,1);return n}r(co,"dayRange");function*lo(e,t){let n=[];for(t==null&&(t=ct()),e<0&&(e=ae(t,e+1));e<=t;)yield e,e=ae(e,1);return n}r(lo,"dayIterator");var sn=v("zeed:promise","error");function ft(){let e,t;return[new Promise((o,i)=>{e=o,t=i}),e,t]}r(ft,"createPromise");async function fo(e){return new Promise(t=>setTimeout(t,e))}r(fo,"sleep");async function po(){return new Promise(e=>setTimeout(e,0))}r(po,"immediate");var dt=Symbol("timeout");async function go(e,t,n=dt){return new Promise(async(o,i)=>{let s=!1,c=setTimeout(()=>{s=!0,o(n)},t);try{let u=await e;clearTimeout(c),s||o(u)}catch(u){clearTimeout(c),s||i(u)}})}r(go,"timeout");var pt=new Error("Timeout reached");function mo(e){return e===dt||e===pt}r(mo,"isTimeout");async function gt(e,t){return t<=0?await e:new Promise(async(n,o)=>{let i=!1,s=setTimeout(()=>{i=!0,o(pt)},t);try{let c=await e;clearTimeout(s),i||n(c)}catch(c){clearTimeout(s),i||o(c)}})}r(gt,"tryTimeout");function yo(e,t,n=1e3){return new Promise((o,i)=>{let s=r(p=>{u&&(clearTimeout(u),c(),o(p))},"fn"),c=r(()=>{u=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):sn.warn("No remove listener method found for",e,t)},"done"),u=setTimeout(()=>{c(),i(new Error("Did not response in time"))},n);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):sn.warn("No listener method found for",e)})}r(yo,"waitOn");function M(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}r(M,"isPromise");function $(e){return Promise.resolve(e)}r($,"promisify");var D=class{get value(){return this.days}constructor(t){if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=D.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 D(t)}static fromString(t){return D.from(+t.replace(/[^0-9]/g,"").slice(0,8))}static fromDate(t,n=!1){return n?D.fromString(t.toISOString().substr(0,10)):D.from(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return D.fromDate(t,!0)}static from(t,n=!1){if(typeof t=="number")return t<100?void 0:new D(t);if(typeof t=="string")return D.fromString(t);if(Array.isArray(t)&&t.length===3){let[o,i=1,s=1]=t;return i<1||i>12||s<1||s>31?void 0:new D(o*1e4+i*100+s)}else{if(t instanceof Date)return D.fromDate(t,n);if(t instanceof D)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 D.fromDateGMT(new Date(this.toDateGMT().getTime()+t*864e5))}monthStart(){return D.from([this.year,this.month,1])}yearStart(){return D.from([this.year,1,1])}monthOffset(t){let n=this.month+t,o=Math.floor((n-1)%12)+1;o===0&&(o=12);let i=Math.floor((n-1)/12);return D.from([this.year+i,o,this.day])}daysUntil(t){return Math.round((new D(t)?.toDateGMT().getTime()-this.toDateGMT().getTime())/864e5)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};r(D,"Day");async function ho(e,t,n){let o=D.from(e),i=D.from(t);for(;o&&i&&o?.days<=i?.days;){let s=n(o);M(s)&&await s,o=o.dayOffset(1)}}r(ho,"forEachDay");function xo(){return new D}r(xo,"today");function bo(e){return new D(e)}r(bo,"day");function wo(e){return D.fromDate(new Date(e)).days}r(wo,"dateStringToDays");function an(e,t=2){return+(+e).toFixed(t)}r(an,"decimal");function To(e,t=2){return+(+e/10**t).toFixed(t)}r(To,"decimalFromCents");function Lo(e,t=2){return Math.round(+e*10**t)}r(Lo,"decimalToCents");function vo(e,t=2){return t*(an(e,t)%1)}r(vo,"decimalCentsPart");function O(e){return e!=null&&typeof e=="object"}r(O,"isObject");function Ee(e){return Object(e)!==e}r(Ee,"isPrimitive");function _(e){return Array.isArray(e)}r(_,"isArray");function ce(e){return O(e)&&!_(e)}r(ce,"isRecord");function Co(e){return e?.constructor===Object}r(Co,"isRecordPlain");function Ao(e){return typeof e=="string"}r(Ao,"isString");function mt(e){return typeof e=="number"&&!isNaN(e)}r(mt,"isNumber");function Fo(e){return mt(e)&&Number.isInteger(e)}r(Fo,"isInteger");function Do(e){return mt(e)&&Number.isSafeInteger(e)}r(Do,"isSafeInteger");function yt(e){return typeof e=="boolean"}r(yt,"isBoolean");function Po(e){return e==null}r(Po,"isNullOrUndefined");function Uo(e){return e==null}r(Uo,"isNull");function So(e){return O(e)&&e.constructor.name==="Uint8Array"}r(So,"isUint8Array");function Eo(e){return e!=null}r(Eo,"isNotNull");function Mo(e){return e!=null&&e!==!1&&e!==!0}r(Mo,"isValue");function un(e,t,n=new WeakSet){if(e===t)return!0;if(n.has(t)||(Ee(t)||n.add(t),!(e instanceof Object)||!(t instanceof Object))||e.constructor!==t.constructor||e.length!==t.length)return!1;for(let o in e){if(!e.hasOwnProperty(o))continue;if(!t.hasOwnProperty(o))return!1;let i=e[o],s=t[o];if(!un(i,s,n))return!1}for(let o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}r(un,"deepEqual");function cn(e,t=new WeakSet){if(t.has(e))return"[Circular ~]";if(Ee(e)||t.add(e),ce(e)){for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===void 0){delete e[n];continue}cn(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}r(cn,"deepStripUndefinedInPlace");function le(e,...t){for(let n of t)O(e)||(e={}),!(n==null||!O(n))&&Object.keys(n).forEach(o=>{let i=e[o],s=n[o];Array.isArray(i)&&Array.isArray(s)?e[o]=i.concat(s):O(i)&&O(s)?e[o]=le(Object.assign({},i),s):e[o]=s});return e}r(le,"deepMerge");var ht=r(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),"escapeHTML"),Ro=r(e=>e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),"unescapeHTML");function ko(e,t,n=[]){return e.filter(o=>!t.some(i=>!i(o))).map(o=>{for(let i of n)o=i(o);return o}).filter(o=>o!=null)}r(ko,"listQuery");function Io(e,t){return e.reduce((n,o)=>{let i=String(o[t]);return(n[i]=n[i]||[]).push(o),n},{})}r(Io,"listGroupBy");function $o(e,t){return Array.from(e.reduce((n,o)=>n.add(o[t]),new Set))}r($o,"listDistinctUnion");function Oo(e,t){return e.map(n=>n[t])}r(Oo,"listOfKey");function _o(e,t){return O(e)?Object.fromEntries(Object.entries(e).map(([n,o])=>{let i=t(n,o);return _(i)&&i.length===2?i:[n,i]}).filter(n=>n!=null)):{}}r(_o,"objectMap");function Bo(e,t){return t.dispose&&e.dispose&&t.dispose.add(e.dispose),Object.assign(e,t)}r(Bo,"objectMergeDisposable");function jo(e){return Object.keys(e).length<=0}r(jo,"objectIsEmpty");var ln=/[\u0000-\u001F\u0080-\u009F]/g,Ho=/^\.+/,zo=/\.+$/;function fn(){return/[<>:"/\\|?*\u0000-\u001F]/g}r(fn,"filenameReservedRegex");function No(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}r(No,"windowsReservedNameRegex");function Go(e,t="_"){if(typeof e!="string")throw new TypeError("Expected a string");if(fn().test(t)&&ln.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(fn(),t).replace(ln,t).replace(Ho,t).replace(zo,""),e=No().test(e)?e+t:e,e.slice(0,100)}r(Go,"toValidFilename");var Vo=/[\\\-\[\]\/{}()*+?.^$|]/g;function xt(e){return e?e instanceof RegExp?e.source:e.replace(Vo,"\\$&"):""}r(xt,"escapeRegExp");var X=r(e=>Math.abs(e)%1===.5,"isHalf"),bt=r(e=>e%2===0,"isEven"),qo=r(e=>Math.ceil(e),"roundUp"),Jo=r(e=>Math.floor(e),"roundDown"),Wo=r(e=>Math.round(e),"roundHalfUp"),Zo=r(e=>{let t=Math.round(e);return X(e)&&bt(t)?t-1:t},"roundHalfOdd"),Ko=r(e=>X(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),Yo=r(e=>X(e)?Math.floor(e):Math.round(e),"roundHalfDown"),Qo=r(e=>{let t=Math.round(e);return X(e)?bt(t)?t:t-1:t},"roundHalfEven"),Xo=r(e=>X(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");function wt(e){return e.reduce((t,n)=>Math.min(t,n.sort_weight||0),0)-1-P()}r(wt,"startSortWeight");function Tt(e){return e.reduce((t,n)=>Math.max(t,n.sort_weight||0),0)+1+P()}r(Tt,"endSortWeight");function ei(e,t,n){let o=n.length,i=e<t;if(o<=0||e>=o-1)return Tt(n);if(e<=0)return wt(n);n=dn([...n]);let s=i?-1:0,c=n[e+s].sort_weight||0,p=(n[e+s+1].sort_weight||0)-c;if(p===0)return i?wt(n):Tt(n);let m=c+p/2,h=p*.01*(P()-.5);return m+h}r(ei,"moveSortWeight");function dn(e){return e.sort((t,n)=>(t.sort_weight||0)-(n.sort_weight||0)),e}r(dn,"sortedItems");function ti(e={}){let{getter:t=r(u=>u.sort,"getter")}=e;function n(u){return u.sort((p,m)=>(t(p)||0)-(t(m)||0)),u}r(n,"items");function o(u){return u.reduce((p,m)=>Math.min(p,t(m)||0),0)-1-P()}r(o,"start");function i(u){return u.reduce((p,m)=>Math.max(p,t(m)||0),0)+1+P()}r(i,"end");function s(u,p){u==null&&(u=(p??0)-1),p==null&&(p=(u??0)+1);let m=p-u,h=u+m/2,x=m*.01*(P()-.5);return h+x}r(s,"between");function c(u,p,m){let h=m.length,x=u<p;if(h<=0||u>=h-1)return i(m);if(u<=0)return o(m);m=n([...m]);let b=x?-1:0,L=t(m[u+b])||0,T=(t(m[u+b+1])||0)-L;if(T===0)return x?o(m):i(m);let C=L+T/2,y=T*.01*(P()-.5);return C+y}return r(c,"move"),{start:o,end:i,between:s,move:c,items:n}}r(ti,"useSorted");var ni=/((?:(?:(?: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 ri(e){return e.split(ni).map((t,n)=>{let o=ht(t);return n%2?`<a target="_blank" href="${o}">${pn(o)}</a>`:o}).join("")}r(ri,"linkifyPlainText");function pn(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}r(pn,"toHumanReadableUrl");function Lt(e){let t=[];for(let[n,o]of Object.entries(e))if(o!=null){Array.isArray(o)||(o=[o]);for(let i of o)i!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`)}return t.join("&")}r(Lt,"encodeQuery");function oi(e){let t={},n=(e[0]==="?"?e.substr(1):e).split("&");for(let o=0;o<n.length;o++){let i=n[o].split("="),s=decodeURIComponent(i[0]),c=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(c)):t[s]=c}return t}r(oi,"parseQuery");function ii(e,t,n){let o=e[t];return o===void 0&&(o=n(t,e),e[t]=o),o}r(ii,"ensureKey");async function si(e,t,n){let o=e[t];return o===void 0&&(o=await n(t,e),e[t]=o),o}r(si,"ensureKeyAsync");function ai(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}r(ai,"size");function ui(e){return e!=null&&e.length>0?e[e.length-1]:void 0}r(ui,"last");function ci(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}r(ci,"empty");function Me(e){return Object(e)!==e?e:JSON.parse(S(e))}r(Me,"cloneObject");function li(e){return Object(e)!==e?e:JSON.parse(S(e))}r(li,"cloneJsonObject");function fi(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let o=e(n);return t.set(n,o),o}}r(fi,"memoize");function di(e){let t=new Map;return async(...n)=>{let o=S(n);if(t.has(o))return t.get(o);let i=await e(...n);return t.set(o,i),i}}r(di,"memoizeAsync");function pi(e,t){let n=[];for(let o=0;o<e;o++)n.push(t(o,e));return n}r(pi,"forTimes");var gi=/\\\s|\s+|#[^\n]*\n?/gm,mi=/\(\?P?<(\w[\w\d_]+)>|\((?!\?(:|\!|=|<=|<\!))/gm,gn=/^((?:\(\?[\w$]+\))?)\(\?<([=!])([\s\S]*?)\)/gm,yi=v("zeed:xrx","error");function mn(e){return typeof e=="string"?e:e.source||""}r(mn,"regExpString");function hi(e){return e.replace(/[-\[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}r(hi,"regExpEscape");var Re=class{constructor(t,n){this.namedGroups={};this.names=[];let o=n??"",i;if(t instanceof RegExp?(n==null&&(o=t.flags),i=t.source):i=t,o&&o.includes("x")&&(o=o.replace("x",""),i=i.replace(gi,u=>u[0]==="\\"?u:"")),!(t instanceof RegExp)){let u=0;i=i.replace(mi,(p,m)=>(u+=1,m?(m!=="index"&&m!=="length"&&!this.namedGroups[m]?this.namedGroups[m]=u:yi.error(`Unallowed or duplicate group name: ${m}`),"("):p)),this.names=Object.keys(this.namedGroups)}i=mn(i),gn.lastIndex=0;let c=gn.exec(i);c&&(this.lookBehind={rx:new RegExp(`${c[3]}$(?!\\s)`),expect:c?c[2]==="=":!c},i=i.substr(c[0].length)),this.rx=new RegExp(i,o)}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=[],o;for(this.rx.lastIndex=0;o=this.exec(t);)n.push(o);return this.rx.lastIndex=0,n}replace(t,n){let o=typeof n=="function"?n:()=>n;return t.replace(this.rx,i=>o(i))}};r(Re,"XRX");var xi=",";function bi(e,t={}){let{separator:n=xi}=t,o="";for(let i=0;i<e.length;i++)o+=`${e[i].map(s=>{if(s==null||s==="")return"";if(yt(s))return s?1:0;let c=String(s);return(ce(s)||_(s))&&(c=S(s)),c.includes('"')||c.includes(`
|
|
6
6
|
`)||c.includes(n)?`"${c.replace(/"/g,'""')}"`:c}).join(n)}
|
|
7
|
-
`;return o}r(bi,"csvStringify");function
|
|
7
|
+
`;return o}r(bi,"csvStringify");function yn(e,t={}){let n=/("((?:(?:[^"]*?)(?:"")?)*)"|([^,;\t\n]*))([,;\t]|\n|\r\n)/g;t.separator&&(n=new RegExp(n.source.replaceAll(",;\\t",xt(t.separator)),n.flags));let o=[],i=[],s,c=`${e.replaceAll(`\r
|
|
8
8
|
`,`
|
|
9
9
|
`).trim()}
|
|
10
10
|
`;for(;s=n.exec(c);){let u=s[2]??s[3]??"";u=u.replaceAll('""','"'),i.push(u),s[4]===`
|
|
11
|
-
`&&(o.push(i),i=[])}return o}r(mn,"csvParse");function wi(e,t={}){let n=mn(e,t),o=n[0];return n.slice(1).map(i=>Object.fromEntries(i.map((s,c)=>[o[c],s])))}r(wi,"csvParseToObjects");var Ti=v("zeed:dispose","error");async function Li(e){typeof e=="function"?await $(e()):M(e)?await e:typeof e.dispose=="function"?await $(e.dispose()):M(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await $(e.cleanup()):M(e.cleanup)&&await e.cleanup}r(Li,"callDisposer");function ke(e){let{name:t}=typeof e=="string"?{name:e}:e??{},n=[],o=r(async c=>{c!=null&&n.includes(c)&&(Ae(n,u=>u!==c),await Li(c))},"untrack"),i=r(async()=>{for(t&&Ti.debug(`dispose ${t}: ${n.length} entries`);n.length>0;)await o(n[0])},"dispose"),s=r(c=>{if(c!=null)return n.unshift(c),()=>o(c)},"track");return Object.assign(i,{track:s,add:s,untrack:o,dispose:i,exec:i,getSize(){return n.length},isDisposed(){return n.length<=0}})}r(ke,"useDispose");var vi=ke;function Ci(e={}){let{mode:t="fifo"}=e,n=[],o=r(async(s=!1)=>{for(;n.length>0;){let c=n[0];if(Ae(n,u=>u!==c),typeof c=="function"){let u=c();if(M(u)){if(s)throw new Error(`Expected sync only function, but found async: ${c}`);await u}}else if(M(c)){if(s)throw new Error(`Expected sync only function, but found async: ${c}`);await c}else throw new Error(`Unhandled disposable: ${c}`)}},"exec");return Object.assign(o,{add:r(s=>{t==="lifo"?n.unshift(s):n.push(s)},"add"),exec:o,getSize(){return n.length}})}r(Ci,"useDefer");function Ai(e,t=0){let n=setTimeout(e,t);return()=>{n&&(clearTimeout(n),n=void 0)}}r(Ai,"useTimeout");function Fi(e,t){let n=setInterval(e,t);return()=>{n&&(clearInterval(n),n=void 0)}}r(Fi,"useInterval");function Di(e,t,n,...o){return e==null?()=>{}:(e.on?e.on(t,n,...o):e.addEventListener&&e.addEventListener(t,n,...o),()=>{e.off?e.off(t,n,...o):e.removeEventListener&&e.removeEventListener(t,n,...o)})}r(Di,"useEventListener");function Pi(){let e=!0;return(t,n)=>{let o=!1;if(e){e=!1;try{t(),o=!0}finally{e=!0}}else n!==void 0&&n();return o}}r(Pi,"useMutex");function Ui(){let e=!0;return async(t,n)=>{let o=!1;if(e){e=!1;try{let i=t();M(i)&&await i,o=!0}finally{e=!0}}else if(n!==void 0){let i=n();M(i)&&await i}return o}}r(Ui,"useAsyncMutex");var ee=v("zeed:emitter","error"),U=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.dispose=ke();this.call=new Proxy({},{get:(t,n)=>async(...o)=>await this.emit(n,...o)})}async emit(t,...n){let o=!1;try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...n)),i.length>0){let s=i.map(c=>{try{return $(c(...n))}catch(u){ee.warn("emit warning:",u)}return null}).filter(c=>c!=null);o=!0,await Promise.all(s)}}catch(i){ee.error("emit exception",i)}return o}onAny(t){this.subscribersOnAny.push(t)}on(t,n){let o=this.subscribers[t]||[];return o.push(n),this.subscribers[t]=o,()=>{this.off(t,n)}}onCall(t){for(let[n,o]of Object.entries(t))this.on(n,o)}once(t,n){let o=r(async(...i)=>(this.off(t,o),await $(n(...i))),"onceListener");return this.on(t,o),()=>{this.off(t,n)}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(o=>n&&o!==n),this}removeAllListeners(){return this.subscribers={},this}};r(U,"Emitter");function Si(){let e=Y().emitter;return e||(e=new U,Y().emitter=e),e}r(Si,"getGlobalEmitter");var Ei=new U;function Mi(e,t){let n=Math.round(P()*100),o=[],i,s=r((u,p)=>{let m={key:u,obj:p};o.push(m),i&&i()},"incoming");return t?e.on?e.on(t,u=>{s(t,u)}):e.addEventListener?e.addEventListener(t,u=>{s(t,u)}):ee.error(n,"Cannot listen to key"):e.onAny?e.onAny((u,p)=>{s(u,p)}):ee.error(n,"cannot listen to all for",e),r((u,p=!0)=>new Promise((m,h)=>{u||(u=t,u||o.length&&(u=o[0].key)),i=r(()=>{for(;o.length>0;){let x=o.shift();if(x.key===u)i=void 0,m(x.obj);else{if(p){ee.warn(n,`Unhandled event ${u} with value: ${x.obj}`);continue}h(new Error(`Expected ${u}, but found ${x.key} with value=${x.obj}`)),ee.error(n,`Unhandled event ${u} with value: ${x.obj}`)}break}},"lazyResolve"),i()}),"on")}r(Mi,"lazyListener");var te=r(()=>Date.now(),"getTimestamp");function Lt(e){return e>999?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}r(Lt,"formatMilliseconds");function Ri(...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 o=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);o&&(n=new Date(+o[1],+o[2]-1,+o[3],12,0))}if(n instanceof Date)return n}}}r(Ri,"parseDate");var{encode:yn,decode:ki}=z(62),{encode:hn,decode:Ii}=z(32),Ie=16;function $e(){return W(Ie)}r($e,"uuidBytes");function xn(e=$e()){return yn(e,22)}r(xn,"uuidB62");function bn(e){return yn(e,22)}r(bn,"uuidEncodeB62");function wn(e){return ki(e,Ie)}r(wn,"uuidDecodeB62");function Tn(e=$e()){return hn(e,26)}r(Tn,"uuidB32");function Ln(e){return hn(e,26)}r(Ln,"uuidEncodeB32");function vn(e){return Ii(e,Ie)}r(vn,"uuidDecodeB32");var $i="10000000-1000-4000-8000-100000000000",Cn=typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>$i.replace(/[018]/g,e=>(e^W(1)[0]&15>>e/4).toString(16));function An(e){let t=Ze(e);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}r(An,"uuidEncodeV4");function Fn(e){return Ke(e.replaceAll("-",""))}r(Fn,"uuidDecodeV4");var Dn=16e11;function Oi(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let o=0;o<t.length;o++){let i=e&255;t[n-o]=i,e=(e-i)/256}return t}r(Oi,"longToByteArray");function Ct(){let e=te()-Dn;return new Uint8Array([...Oi(e),...W(10)])}r(Ct,"suidBytes");function _i(){return Sn(Ct())}r(_i,"suid");function Bi(e){return Pn(Ft(e))}r(Bi,"suidDate");function Pn(e){return new Date(Dn+e.slice(0,6).reduce((t,n)=>t*256+n,0))}r(Pn,"suidBytesDate");var ji=r(()=>new Uint32Array(W(4))[0],"uuid32bit"),At={base62:{uuid:xn,uuidDecode:wn,uuidEncode:bn},base32:{uuid:Tn,uuidDecode:vn,uuidEncode:Ln},uuidv4:{uuid:Cn,uuidDecode:Fn,uuidEncode:An}},Oe="base62",Un=!1;function Hi(e,t=!1){Oe=e,Un=t}r(Hi,"setUuidDefaultEncoding");function N(){return At[Oe].uuid(Un?Ct():$e())}r(N,"uuid");function Ft(e){return At[Oe].uuidDecode(e)}r(Ft,"uuidDecode");function Sn(e){return At[Oe].uuidEncode(e)}r(Sn,"uuidEncode");function zi(e){try{return Ft(e).length===Ie}catch{}return!1}r(zi,"uuidIsValid");var vt={};function R(e="id"){return vt[e]==null&&(vt[e]=0),`${e}-${vt[e]++}`}r(R,"uname");var Ni=0;function Gi(){return`id-${Ni++}`}r(Gi,"qid");var fe=class extends U{constructor(){super(...arguments);this.id=N()}close(){this.dispose()}};r(fe,"Channel");var ne=class extends fe{constructor(){super(...arguments);this.isConnected=!0}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:N()})}};r(ne,"LocalChannel");function Vi(){let e=new ne,t=new ne;return e.other=t,t.other=e,[e,t]}r(Vi,"createLocalChannelPair");var _e=class{async encode(t){return t}async decode(t){return t}};r(_e,"NoopEncoder");var G=class{async encode(t){return be(t)}async decode(t){return we(t)}};r(G,"JsonEncoder");var Be=class{constructor(t){this.key=t}async encode(t){let n=be(t);return await nt(n,this.key)}async decode(t){let n=await rt(t,this.key);return we(n)}};r(Be,"CryptoEncoder");var Dt=r((e,t,n={})=>new Proxy(n,{get:(o,i)=>i in o?o[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function qi(e={}){let{name:t=R("hub"),encoder:n=new G,retryAfter:o=1e3,ignoreUnhandled:i=!0,logLevel:s=!1}=e,c=v(t,s),u={},p,m=[],h,x={},b=r(()=>{clearTimeout(h)},"dispose"),L=r(async()=>{if(clearTimeout(h),p){if(p.isConnected)for(;m.length;){let y=m[0];try{p.postMessage(await n.encode(y)),m.shift()}catch(f){c.warn("postMessage",f);break}}m.length>0&&o>0&&(h=setTimeout(L,o))}},"postNext"),w=r(async y=>{c("enqueue postMessage",y),m.push(y),await L()},"postMessage"),T=r(async y=>{p=y,p.on("connect",L),p.on("message",async f=>{c("onmessage",typeof f);let{name:a,args:l,id:d,result:g,error:A}=await n.decode(f.data);if(a){c(`name ${a} id ${d}`);try{if(u[a]==null)throw new Error(`handler for ${a} was not found`);let F=u[a](...l);M(F)&&(F=await F),c(`result ${F}`),d&&await w({id:d,result:F})}catch(F){let B=F instanceof Error?F:new Error(Fe(F));c.warn("execution error",B.name),await w({id:d,error:{message:B.message,stack:B.stack,name:B.name}})}}else if(d)if(c(`response for id=${d}: result=${g}, error=${A}`),x[d]==null)g===void 0?c(`skip response for ${d}`):c.warn(`no response hook for ${d}`);else{let[F,B]=x[d];if(F&&B)if(delete x[d],A){let me=new Error(A.message);me.stack=A.stack,me.name=A.name,c.warn("reject",me.name),B(me)}else c("resolve",g),F(g)}else i||c.warn("Unhandled message",f)}),await L()},"connect"),C=r(async(y,f,a={})=>{let{timeout:l=5e3}=a,d=N();return await w({name:y,args:f,id:d}),gt(new Promise((g,A)=>x[d]=[g,A]),l)},"fetchMessage");return e.channel&&T(e.channel),{dispose:b,connect:T,listen(y){Object.assign(u,y)},send(){return Dt(C,{},{options(y){return Dt(C,{...y})}})}}}r(qi,"useMessageHub");var de=class extends U{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:o,encoder:i=new G,channel:s,debug:c=!1}=n;this.channel=s,this.encoder=i,this.debug=c,this.name=o??this.channel.id??R("pubsub"),this.log=v(`${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 p=await this.encoder.decode(u);if(this.debug?this.log(`channel message, event=${p?.event}, info=`,p):this.log(`channel message, event=${p?.event}`),p){let{event:m,args:h}=p;await this.emitSuper(m,...h)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...o){return await super.emit(n,...o)}async emit(n,...o){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,o.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let i=await this.encoder.encode({event:n,args:o});return this.channel.postMessage(i),!0}catch(i){this.log.warn(`emit(${String(n)})`,i)}return!1}};r(de,"PubSub");function Ji(e){return new de(e)}r(Ji,"usePubSub");var Wi=1;var En=r(e=>e,"defaultSerialize"),Zi=En;function Ki(e,t){let{post:n,on:o,eventNames:i=[],serialize:s=En,deserialize:c=Zi}=t,u=new Map;return o(async p=>{let m=c(p),[h,x,b,L]=m;if(h===1||h===2){let w,T;if(L!=null)try{let C=e[L];w=await C(...x)}catch(C){T=String(C)}else T="Method implementation missing";h===1&&b&&n(s(T?[4,T,b]:[3,w,b]))}else if(b){let w=u.get(b);w!=null&&(h===4?w.reject(x):w.resolve(x)),u.delete(b)}}),new Proxy({},{get(p,m){let h=r((...b)=>{n(s([2,b,null,m]))},"sendEvent");if(t.onlyEvents||i.includes(m))return h.asEvent=h,h;let x=r((...b)=>new Promise((L,w)=>{let T=Wi++;u.set(T,{resolve:L,reject:w}),n(s([1,b,T,m]))}),"sendCall");return x.asEvent=h,x}})}r(Ki,"useRPC");var j=class extends U{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 o of this._children)await o.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 o=new j(n);return this.addChild(o),o}removeChild(n){it(this._children,n),this.update()}getTotalUnits(){if(this.isIndeterminate())return 0;let n=this._totalUnits;for(let o of this._children)n+=o.getTotalUnits();return n}getCompletedUnits(){if(this.isIndeterminate())return 0;let n=this._completedUnits;for(let o of this._children)n+=o.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 isNaN(n)&&(n=0),Math.min(1,Math.max(0,n))}getChildrenCount(){return this._children.length}setTotalUnits(n,o){this._totalUnits=n,o!=null&&(this._completedUnits=o),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 o=`${" ".repeat(n)}${this.name}: ${this._completedUnits} of ${this._totalUnits} units, ${Math.floor(this.getFraction()*100)} %, cancel=${this._isCancelled}
|
|
12
|
-
`;for(let i of this._children)o+=i.toString(n+1);return n===0?o.trim():o}};r(j,"Progress");var Mn=(o=>(o[o.waiting=0]="waiting",o[o.running=1]="running",o[o.finished=2]="finished",o))(Mn||{}),Rn=(o=>(o[o.replace=0]="replace",o[o.memoize=1]="memoize",o[o.error=2]="error",o))(Rn||{});function Yi(e={}){let{maxParallel:t=3,name:n=R("pool")}=e,o=new U,i=new j({name:n});i.on("progressCancelled",C);let s=0,c=0,u=0,p=0,m={};async function h(){if(s>0){let[f,a]=ft();return o.once("didFinish",a),f}}r(h,"waitFinishAll");async function x(){for(let f of Object.keys(m))m[f].state===2&&(await m[f].progress.dispose(),delete m[f])}r(x,"cleanupFinished");function b(){o.emit("didFinish"),s=0,c=0,x(),i.reset()}r(b,"didFinish");function L(){let f=0,a=0;for(let{max:l,resolved:d,state:g}of Object.values(m))f+=l,a+=g===2?l:Math.min(l,d);o.emit("didUpdate",s,c,f,a)}r(L,"didUpdate");function w(){if(L(),s>0&&s===c&&b(),u>=t)return;let f=Object.values(m).filter(a=>a.state===0);if(f.length>0){let a;for(let l of f)l.group!=null&&Object.values(m).some(d=>d.state===1&&d.id!==l.id&&d.group===l.group)||(a==null||l.priority<a.priority)&&(a=l);if(a!=null){let l=a.id,d=a.done;a.state=1,++u,o.emit("didStart",l);let g=r(A=>{a&&(a.result=A,a.state=2,a.resolved=a.max),--u,++c,w()},"taskFinished");a.task(a).then(A=>{d(A),o.emit("didResolve",l,A),g(A)}).catch(A=>{d(),o.emit("didReject",l,A),g()})}}}r(w,"performNext");function T(f){let a=m[f];a&&a.state===0&&(m[f].state=2,++c,o.emit("didCancel",f),m[f].progress.dispose(),L())}r(T,"cancel");function C(){Object.keys(m).forEach(T)}r(C,"cancelAll");function y(f,a={}){let l,d=new Promise(F=>l=F),g=a.id??N();if(m[g]!=null){let F=a.idConflictResolution??1;if(F===0)T(g);else if(F===1){let B=m[g];return{id:g,promise:(async()=>{if(B.state===2)return m[g].result})(),dispose:()=>T(g),cancel:()=>T(g)}}else throw new Error(`Pool task with id=${g} already exists!`)}let A=new j({name:g,totalUnits:a.max??1,completeUnits:a.resolved??0});return i.addChild(A),m[g]={id:g,task:f,priority:++p,group:a.group,state:0,max:a.max??1,resolved:a.resolved??0,done:l,payload:a.payload,progress:A,setMax(F){A.setTotalUnits(F),m[g].max=F,L()},setResolved(F){A.setCompletetedUnits(F),m[g].resolved=F,L()},incResolved(F=1){A.incCompletedUnits(F),m[g].resolved+=F,L()}},++s,w(),{id:g,promise:d,dispose:()=>T(g),cancel:()=>T(g)}}return r(y,"enqueue"),{events:o,cancel:T,cancelAll:C,progress:i,enqueue:y,dispose:C,waitFinishAll:h}}r(Yi,"usePool");var je=class extends U{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:o=R("queue"),logLevel:i}=n;this.name=o,this.log=v(`zeed:queue:${o}`,i??1/0)}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:o,task:i,resolve:s}=n;this.currentTask=i();let c;try{this.log.info(`start task ${o}`),c=await this.currentTask,this.log(`finished task ${o} with result =`,c)}catch(u){this.log.warn("Error performing task",u)}s(c),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,o={}){let{immediate:i=!1,name:s=R(this.name)}=o;return i?(this.log.info(`immediate execution ${s}`),await n()):(this.log(`enqueue ${s}`),new Promise(c=>{this.queue.push({name:s,task:n,resolve:c}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext()}))}async enqueueReentrant(n,o={}){return this.enqueue(n,{immediate:this.currentTask!=null,name:o.name})}async cancelAll(n=!0){this.log("cancelAll"),this.emit("didCancel");let o=this.queue.map(i=>i.resolve);this.queue=[],o.forEach(i=>i(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}};r(je,"SerialQueue");var re=!1,I=re?v("zeed:throttle","error"):()=>{};function Qi(e,t={}){let{delay:n=100,trailing:o=!0,leading:i=!0}=t,s=0,c=0,u=0,p,m=Date.now();function h(){return s?(clearTimeout(s),s=void 0,!0):!1}r(h,"clearExistingTimeout");function x(...b){let L=Date.now(),w=L-c;function T(){let y=Date.now();return`total ${(y-m).toFixed(1)}ms - elapsed ${(y-c).toFixed(1)}ms - visited ${u}x`}r(T,"debugElapsed");let C=r(()=>{u=0,c=Date.now(),e.apply(this,b)},"exec");if(p=C,w>n||!s){re&&I("elapsed",T()),i&&(w>n?(re&&I("\u{1F680} leading",T()),C()):++u);let y=w>n?n:n-w;I(`\u23F1 start timeout with ${y.toFixed(1)}ms`,T()),h(),c=L,s=setTimeout(()=>{re&&I("\u23F1 reached timeout",T()),s=0,o&&(!i||u>0)&&(re&&I("\u{1F680} trailing",T()),p?.())},y)}else++u,re&&I("visited",T())}return r(x,"wrapper"),x.cancel=h,x.stop=()=>{h()&&p&&p()},x.immediate=r(async function(...L){h(),c=Date.now(),e.apply(this,L)},"immediate"),x.dispose=()=>x.stop(),x}r(Qi,"throttle");function Xi(e,t={}){let{delay:n=100}=t,o=0,i=!1,s;function c(){o&&(I("clear"),clearTimeout(o),o=0)}r(c,"clearExistingTimeout");async function u(){try{if(c(),s!=null){I("exec");let h=[...s];s=void 0,i=!0,await $(e(...h)),i=!1,I("exec done"),s!=null&&(c(),I("exec trigger next"),o=setTimeout(u,n))}}catch{}}r(u,"exec");function p(...h){s=[...h],c(),I("trigger"),i===!1&&(o=setTimeout(u,n))}r(p,"wrapper");async function m(...h){c(),s=[...h],await u()}return r(m,"immediate"),p.cancel=c,p.dispose=c,p.immediate=m,p}r(Xi,"debounce");function es(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")}r(es,"isLocalHost");function ts(e){let{level:t=void 0,filter:n=void 0,messages:o=[]}=e,i=k(n),s=q(t);return c=>{s(c.level)&&i(c.name)&&o.push(c)}}r(ts,"LoggerMemoryHandler");var oe=v("zeed:network","error"),Pt={cache:"no-cache",redirect:"follow",headers:{}};function kn(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[n,o]=t[1].split(":",2);return{url:e.replace(`${t[1]}@`,""),username:n,password:o}}}r(kn,"parseBasicAuth");async function Ut(e,t={},n=fetch){try{_(t)&&(t=le({},...Z(t)));let o=kn(String(e));o&&(e=o.url,t=le({},t,In(o.username,o.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let i=await n(String(e),t);if(i.status<400)return i;try{oe.warn(`Fetch of ${String(e)} returned status=${i.status}. Options:`,t),oe.warn(`Response: ${await i.text()}`)}catch(s){oe.error("Exception:",s)}}catch(o){oe.error("fetchBasic",o)}}r(Ut,"fetchBasic");async function ns(e,t={},n=fetch){try{let o=await Ut(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(o)return await o.json()}catch(o){oe.error("fetchJSON error:",o)}}r(ns,"fetchJson");async function rs(e,t={},n=fetch){try{let o=await Ut(e,[Pt,{method:"GET"},t],n);if(o)return await o.text()}catch(o){oe.error("fetchHTML error:",o)}}r(rs,"fetchText");function os(e,t="POST"){return{method:t,...Pt,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:Tt(e)}}r(os,"fetchOptionsFormURLEncoded");function is(e,t="POST"){return{method:t,...Pt,headers:{"Content-Type":"application/json; charset=utf-8"},body:S(e)}}r(is,"fetchOptionsJson");function In(e,t){return{headers:{Authorization:`Basic ${Ye(`${e}:${t}`)}`}}}r(In,"fetchOptionsBasicAuth");function St(){if(typeof window<"u")return window}r(St,"getWindow");function $n(){if(typeof navigator<"u")return navigator}r($n,"getNavigator");function ss(){return St()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}r(ss,"getGlobal");var V=$n(),K=St();function On(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}){return e.ios=V?.platform?.match(/(iPhone|iPod|iPad)/i)!=null,e.macos=!!V?.platform?.startsWith("Mac"),e.windows=!!V?.platform?.startsWith("Win"),e.beaker=K?.beaker!=null,e.electron=(V?.userAgent?.toLowerCase()?.indexOf(" electron/")||-1)>-1&&!e.beaker,e.wkwebview=K?.webkit?.messageHandlers!=null,e.pwa=V?.serviceWorker!=null,e.pwaInstalled=V?.standalone||K?.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=K&&"ontouchstart"in K||(V?.maxTouchPoints||0)>1||V?.msPointerEnabled&&K?.MSGesture||K?.DocumentTouch&&document instanceof DocumentTouch,e}r(On,"detect");var He=r(()=>typeof window<"u"&&globalThis===window,"isBrowser"),as=On();function us(e){He()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e)}r(us,"useExitHandler");var ze=class{constructor(t={}){this.store={}}setItem(t,n){this.store[t]=Me(n)}getItem(t){return Me(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};r(ze,"MemStorage");var cs=r(()=>{},"noop");var ls=v("zeed:base64","error");function fs(e){try{let t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),o=window.atob(n),i=new Uint8Array(o.length);for(let s=0;s<o.length;++s)i[s]=o.charCodeAt(s);return i}catch(t){ls.error(t,e)}}r(fs,"urlBase64ToUint8Array");var ds=v("zeed:gravatar","error");function ps(e,t){let n="0123456789abcdef".split("");function o(y,f){let a=y[0],l=y[1],d=y[2],g=y[3];a=s(a,l,d,g,f[0],7,-680876936),g=s(g,a,l,d,f[1],12,-389564586),d=s(d,g,a,l,f[2],17,606105819),l=s(l,d,g,a,f[3],22,-1044525330),a=s(a,l,d,g,f[4],7,-176418897),g=s(g,a,l,d,f[5],12,1200080426),d=s(d,g,a,l,f[6],17,-1473231341),l=s(l,d,g,a,f[7],22,-45705983),a=s(a,l,d,g,f[8],7,1770035416),g=s(g,a,l,d,f[9],12,-1958414417),d=s(d,g,a,l,f[10],17,-42063),l=s(l,d,g,a,f[11],22,-1990404162),a=s(a,l,d,g,f[12],7,1804603682),g=s(g,a,l,d,f[13],12,-40341101),d=s(d,g,a,l,f[14],17,-1502002290),l=s(l,d,g,a,f[15],22,1236535329),a=c(a,l,d,g,f[1],5,-165796510),g=c(g,a,l,d,f[6],9,-1069501632),d=c(d,g,a,l,f[11],14,643717713),l=c(l,d,g,a,f[0],20,-373897302),a=c(a,l,d,g,f[5],5,-701558691),g=c(g,a,l,d,f[10],9,38016083),d=c(d,g,a,l,f[15],14,-660478335),l=c(l,d,g,a,f[4],20,-405537848),a=c(a,l,d,g,f[9],5,568446438),g=c(g,a,l,d,f[14],9,-1019803690),d=c(d,g,a,l,f[3],14,-187363961),l=c(l,d,g,a,f[8],20,1163531501),a=c(a,l,d,g,f[13],5,-1444681467),g=c(g,a,l,d,f[2],9,-51403784),d=c(d,g,a,l,f[7],14,1735328473),l=c(l,d,g,a,f[12],20,-1926607734),a=u(a,l,d,g,f[5],4,-378558),g=u(g,a,l,d,f[8],11,-2022574463),d=u(d,g,a,l,f[11],16,1839030562),l=u(l,d,g,a,f[14],23,-35309556),a=u(a,l,d,g,f[1],4,-1530992060),g=u(g,a,l,d,f[4],11,1272893353),d=u(d,g,a,l,f[7],16,-155497632),l=u(l,d,g,a,f[10],23,-1094730640),a=u(a,l,d,g,f[13],4,681279174),g=u(g,a,l,d,f[0],11,-358537222),d=u(d,g,a,l,f[3],16,-722521979),l=u(l,d,g,a,f[6],23,76029189),a=u(a,l,d,g,f[9],4,-640364487),g=u(g,a,l,d,f[12],11,-421815835),d=u(d,g,a,l,f[15],16,530742520),l=u(l,d,g,a,f[2],23,-995338651),a=p(a,l,d,g,f[0],6,-198630844),g=p(g,a,l,d,f[7],10,1126891415),d=p(d,g,a,l,f[14],15,-1416354905),l=p(l,d,g,a,f[5],21,-57434055),a=p(a,l,d,g,f[12],6,1700485571),g=p(g,a,l,d,f[3],10,-1894986606),d=p(d,g,a,l,f[10],15,-1051523),l=p(l,d,g,a,f[1],21,-2054922799),a=p(a,l,d,g,f[8],6,1873313359),g=p(g,a,l,d,f[15],10,-30611744),d=p(d,g,a,l,f[6],15,-1560198380),l=p(l,d,g,a,f[13],21,1309151649),a=p(a,l,d,g,f[4],6,-145523070),g=p(g,a,l,d,f[11],10,-1120210379),d=p(d,g,a,l,f[2],15,718787259),l=p(l,d,g,a,f[9],21,-343485551),y[0]=w(a,y[0]),y[1]=w(l,y[1]),y[2]=w(d,y[2]),y[3]=w(g,y[3])}r(o,"md5cycle");function i(y,f,a,l,d,g){return f=w(w(f,y),w(l,g)),w(f<<d|f>>>32-d,a)}r(i,"cmn");function s(y,f,a,l,d,g,A){return i(f&a|~f&l,y,f,d,g,A)}r(s,"ff");function c(y,f,a,l,d,g,A){return i(f&l|a&~l,y,f,d,g,A)}r(c,"gg");function u(y,f,a,l,d,g,A){return i(f^a^l,y,f,d,g,A)}r(u,"hh");function p(y,f,a,l,d,g,A){return i(a^(f|~l),y,f,d,g,A)}r(p,"ii");function m(y){let f=y.length,a=[1732584193,-271733879,-1732584194,271733878],l;for(l=64;l<=y.length;l+=64)o(a,h(y.substring(l-64,l)));y=y.substring(l-64);let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<y.length;l++)d[l>>2]|=y.charCodeAt(l)<<(l%4<<3);if(d[l>>2]|=128<<(l%4<<3),l>55)for(o(a,d),l=0;l<16;l++)d[l]=0;return d[14]=f*8,o(a,d),a}r(m,"md51");function h(y){let f=[],a;for(a=0;a<64;a+=4)f[a>>2]=y.charCodeAt(a)+(y.charCodeAt(a+1)<<8)+(y.charCodeAt(a+2)<<16)+(y.charCodeAt(a+3)<<24);return f}r(h,"md5blk");function x(y){let f="",a=0;for(;a<4;a++)f+=n[y>>a*8+4&15]+n[y>>a*8&15];return f}r(x,"rhex");function b(y){for(let f=0;f<y.length;f++)y[f]=x(y[f]);return y.join("")}r(b,"hex");function L(y){return b(m(y))}r(L,"md5");function w(y,f){return y+f&4294967295}r(w,"add32"),t=t||{};let T=[];t={size:t.size||"50",rating:t.rating||"g",secure:t.secure||location.protocol==="https:",backup:t.backup||""},e=e.trim().toLowerCase();let C=t.secure?"https://secure.gravatar.com/avatar/":"http://www.gravatar.com/avatar/";return t.rating&&T.push(`r=${t.rating}`),t.backup&&T.push(`d=${encodeURIComponent(t.backup)}`),t.size&&T.push(`s=${t.size}`),`${C+L(e)}?${T.join("&")}`}r(ps,"gravatar");function gs(e,t=""){try{return ps(e,{size:256,backup:"monsterid",secure:!0})}catch{return ds(`Gravatar issue: Did not find an image for ${e}`),t}}r(gs,"gravatarURLByEmail");var _n=v("zeed:localstorage","error"),Ne=class{constructor(t){this.pretty=!1;_n.assert(t.name,"name required"),this.name=t.name,this.prefix=`${t.name}$`,this.objectToString=t.objectToString??(n=>this.pretty?S(n,null,2):S(n)),this.objectFromString=t.objectFromString??(n=>{try{return JSON.parse(n)}catch(o){_n.warn(`LocalStorage parse error '${o}' in`,n)}})}setItem(t,n){let o=this.objectToString(n);localStorage.setItem(`${this.prefix}${t}`,o)}getItem(t){let n=localStorage.getItem(`${this.prefix}${t}`);if(n!=null)return this.objectFromString(n)}removeItem(t){localStorage.removeItem(`${this.prefix}${t}`)}clear(){Object.keys(localStorage).filter(t=>t.startsWith(this.prefix)).forEach(t=>{localStorage.removeItem(t)})}allKeys(){let t=this.prefix.length;return Object.keys(localStorage).filter(n=>n.startsWith(this.prefix)).map(n=>n.substr(t))}};r(Ne,"LocalStorage");var Bn=["#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 pe(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}r(pe,"supportsColors");function ge(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Bn[Math.abs(t)%Bn.length]}r(ge,"selectColor");var Hn='font-family: "JetBrains Mono", Menlo; font-size: 11px;',ms=`${Hn}`,ys=`font-weight: 600; ${Hn}`,hs=pe(),jn={},xs=te();function Et(e={}){let{filter:t=void 0,level:n=void 0,colors:o=!0,padding:i=16,time:s=!0}=e,c=k(t),u=q(n);return p=>{if(!u(p.level)||!c(p.name))return;let m=s?`+${Lt(te()-xs)}`:"",h=p.name||"",x=jn[h||""];x==null&&(x={color:ge(h)},jn[h]=x);let b;switch(i>0&&(h=h.padEnd(16," ")),o&&hs?(b=[`%c${h}%c %s %c${m}`],b.push(`color:${x.color}; ${ys}`),b.push(ms),b.push(p.messages?.[0]??""),b.push(`color:${x.color};`),b.push(...p.messages.slice(1))):b=[h,...p.messages,`+${m}`],b=b.map(L=>L instanceof Uint8Array?`<Uint8Array size=${L.length}>`:L),p.level){case 1:e.levelHelper&&(b[0]=`I|* ${b[0]}`),console.info(...b);break;case 2:e.levelHelper&&(b[0]=`W|** ${b[0]}`),console.warn(...b);break;case 3:e.levelHelper&&(b[0]=`E|*** ${b[0]}`),console.error(...b);break;default:e.levelHelper&&(b[0]=`D| ${b[0]}`),console.debug(...b);break}}}r(Et,"LoggerBrowserHandler");var zn='font-family: "JetBrains Mono", Menlo; font-size: 11px;',bs=`${zn}`,ws=`font-weight: 600; ${zn}`,Ts=pe(),ie=r(()=>{},"noop");function Mt(e={}){let t=e.filter??localStorage.zeed??localStorage.debug;return r(function n(o="",i){let s,c=k(t),u=Q(i??-1);if(c(o)&&u!==1/0){let h=function(x,b){return u<=x?b:()=>{}};var p=h;r(h,"defineForLogLevel");let m=[];if(Ts){let x=ge(o);m.push(`%c${o.padEnd(16," ")}%c %s`),m.push(`color:${x}; ${ws}`),m.push(bs)}else m.push(`[${o}] %s`);s=h(0,console.debug.bind(console,...m)),s.debug=h(0,console.debug.bind(console,...m)),s.info=h(1,console.info.bind(console,...m)),s.warn=h(2,console.warn.bind(console,...m)),s.error=h(3,console.error.bind(console,...m)),s.fatal=h(4,(...x)=>{throw s.error(...x),new Error(`${x.map(String).join(" ")}`)}),s.assert=h(4,(x,...b)=>{(x==null||!x)&&s.fatal(...b)})}else s=r(()=>{},"log"),s.debug=ie,s.info=ie,s.warn=ie,s.error=ie,s.assert=ie,s.fatal=ie;return s.extend=m=>n(o?`${o}:${m}`:m),s.label=o,s},"LoggerBrowserDebugFactory")}r(Mt,"LoggerBrowserSetupDebugFactory");function Ls(e={}){console.info("activateConsoleDebug is activated by default in browsers")}r(Ls,"activateConsoleDebug");function Nn(){He()&&(v.setHandlers([Et()]),v.setFactory(Mt({})))}r(Nn,"setupBrowserLog");Nn();0&&(module.exports={CRYPTO_DEFAULT_ALG,CRYPTO_DEFAULT_DERIVE_ALG,CRYPTO_DEFAULT_DERIVE_ITERATIONS,CRYPTO_DEFAULT_HASH_ALG,Channel,CryptoEncoder,DAY_MS,Day,Emitter,JsonEncoder,LocalChannel,LocalStorage,LogLevel,LogLevelAlias,Logger,LoggerBrowserHandler,LoggerBrowserSetupDebugFactory,LoggerConsoleHandler,LoggerContext,LoggerMemoryHandler,MemStorage,NoopEncoder,PoolTaskIdConflictResolution,PoolTaskState,Progress,PubSub,SerialQueue,Uint8ArrayToHexDump,Uint8ArrayToJson,Uint8ArrayToString,XRX,_decodeUtf8Polyfill,_encodeUtf8Polyfill,activateConsoleDebug,arrayAvg,arrayBatches,arrayEmptyInPlace,arrayFilterInPlace,arrayFlatten,arrayIntersection,arrayIsEqual,arrayMax,arrayMin,arrayMinus,arrayRandomElement,arrayRemoveElement,arraySetElement,arrayShuffle,arrayShuffleForce,arrayShuffleInPlace,arraySorted,arraySortedNumbers,arraySum,arraySymmetricDifference,arrayToggleInPlace,arrayUnion,arrayUnique,avg,between,cloneJsonObject,cloneObject,cmp,composeOrderby,createArray,createLocalChannelPair,createPromise,createPromiseProxy,csvParse,csvParseToObjects,csvStringify,dateStringToDays,day,dayDay,dayDiff,dayFromAny,dayFromDate,dayFromDateGMT,dayFromParts,dayFromString,dayFromTimestamp,dayFromToday,dayIterator,dayMonth,dayMonthStart,dayOffset,dayRange,dayToDate,dayToDateGMT,dayToParts,dayToString,dayToTimestamp,dayYear,dayYearStart,debounce,decimal,decimalCentsPart,decimalFromCents,decimalToCents,decodeBase16,decodeBase32,decodeBase58,decodeBase62,decrypt,deepEqual,deepMerge,deepStripUndefinedInPlace,deriveKeyPbkdf2,detect,digest,empty,encodeBase16,encodeBase32,encodeBase58,encodeBase62,encodeQuery,encrypt,endSortWeight,ensureKey,ensureKeyAsync,equalBinary,escapeHTML,escapeRegExp,estimateSizeForBase,fetchBasic,fetchJson,fetchOptionsBasicAuth,fetchOptionsFormURLEncoded,fetchOptionsJson,fetchText,fixBrokenUth8String,forEachDay,forTimes,formatMessages,formatMilliseconds,fromBase64,fromBase64String,fromCamelCase,fromHex,getGlobal,getGlobalContext,getGlobalEmitter,getGlobalLogger,getNamespaceFilterString,getNavigator,getSecureRandom,getSecureRandomIfPossible,getTimestamp,getWindow,gravatarURLByEmail,immediate,isArray,isBoolean,isBrowser,isEven,isHalf,isInteger,isLocalHost,isNotNull,isNull,isNullOrUndefined,isNumber,isObject,isPrime,isPrimeRX,isPrimitive,isPromise,isRecord,isRecordPlain,isSafeInteger,isString,isTimeout,isUint8Array,isValue,joinToUint8Array,jsonStringify,jsonStringifySafe,jsonStringifySorted,jsonToUint8Array,last,lazyListener,linkifyPlainText,listDistinctUnion,listGroupBy,listOfKey,listQuery,memoize,memoizeAsync,messages,moveSortWeight,noop,objectIsEmpty,objectMap,objectMergeDisposable,parseBasicAuth,parseDate,parseLogLevel,parseOrderby,parseQuery,platform,promisify,qid,randomBoolean,randomFloat,randomInt,randomUint8Array,regExpEscape,regExpString,renderMessages,roundDown,roundHalfAwayFromZero,roundHalfDown,roundHalfEven,roundHalfOdd,roundHalfTowardsZero,roundHalfUp,roundUp,seededRandom,selectColor,setUuidDefaultEncoding,setupBrowserLog,size,sleep,sortedItems,sortedOrderby,startSortWeight,stringToBoolean,stringToFloat,stringToInteger,stringToUInt8Array,suid,suidBytes,suidBytesDate,suidDate,sum,supportsColors,throttle,timeout,timeoutReached,timoutError,toBase64,toBase64Url,toBool,toCamelCase,toCapitalize,toCapitalizeWords,toFloat,toHex,toHumanReadableUrl,toInt,toString,toUint8Array,toValidFilename,today,tryTimeout,uname,unescapeHTML,urlBase64ToUint8Array,useAsyncMutex,useBase,useDefer,useDispose,useDisposer,useEventListener,useExitHandler,useInterval,useLevelFilter,useMessageHub,useMutex,useNamespaceFilter,usePool,usePubSub,useRPC,useSorted,useTimeout,uuid,uuid32bit,uuidB32,uuidB62,uuidBytes,uuidDecode,uuidDecodeB32,uuidDecodeB62,uuidDecodeV4,uuidEncode,uuidEncodeB32,uuidEncodeB62,uuidEncodeV4,uuidIsValid,uuidv4,valueToBoolean,valueToFloat,valueToInteger,valueToString,waitOn});
|
|
11
|
+
`&&(o.push(i),i=[])}return o}r(yn,"csvParse");function wi(e,t={}){let n=yn(e,t),o=n[0];return n.slice(1).map(i=>Object.fromEntries(i.map((s,c)=>[o[c],s])))}r(wi,"csvParseToObjects");var Ti=v("zeed:dispose","error");async function Li(e){typeof e=="function"?await $(e()):M(e)?await e:typeof e.dispose=="function"?await $(e.dispose()):M(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await $(e.cleanup()):M(e.cleanup)&&await e.cleanup}r(Li,"callDisposer");function ke(e){let{name:t}=typeof e=="string"?{name:e}:e??{},n=[],o=r(async c=>{c!=null&&n.includes(c)&&(Ae(n,u=>u!==c),await Li(c))},"untrack"),i=r(async()=>{for(t&&Ti.debug(`dispose ${t}: ${n.length} entries`);n.length>0;)await o(n[0])},"dispose"),s=r(c=>{if(c!=null)return n.unshift(c),()=>o(c)},"track");return Object.assign(i,{track:s,add:s,untrack:o,dispose:i,exec:i,getSize(){return n.length},isDisposed(){return n.length<=0}})}r(ke,"useDispose");var vi=ke;function Ci(e={}){let{mode:t="fifo"}=e,n=[],o=r(async(s=!1)=>{for(;n.length>0;){let c=n[0];if(Ae(n,u=>u!==c),typeof c=="function"){let u=c();if(M(u)){if(s)throw new Error(`Expected sync only function, but found async: ${c}`);await u}}else if(M(c)){if(s)throw new Error(`Expected sync only function, but found async: ${c}`);await c}else throw new Error(`Unhandled disposable: ${c}`)}},"exec");return Object.assign(o,{add:r(s=>{t==="lifo"?n.unshift(s):n.push(s)},"add"),exec:o,getSize(){return n.length}})}r(Ci,"useDefer");function Ai(e,t=0){let n=setTimeout(e,t);return()=>{n&&(clearTimeout(n),n=void 0)}}r(Ai,"useTimeout");function Fi(e,t){let n=setInterval(e,t);return()=>{n&&(clearInterval(n),n=void 0)}}r(Fi,"useInterval");function Di(e,t,n,...o){return e==null?()=>{}:(e.on?e.on(t,n,...o):e.addEventListener&&e.addEventListener(t,n,...o),()=>{e.off?e.off(t,n,...o):e.removeEventListener&&e.removeEventListener(t,n,...o)})}r(Di,"useEventListener");function Pi(){let e=!0;return(t,n)=>{let o=!1;if(e){e=!1;try{t(),o=!0}finally{e=!0}}else n!==void 0&&n();return o}}r(Pi,"useMutex");function Ui(){let e=!0;return async(t,n)=>{let o=!1;if(e){e=!1;try{let i=t();M(i)&&await i,o=!0}finally{e=!0}}else if(n!==void 0){let i=n();M(i)&&await i}return o}}r(Ui,"useAsyncMutex");var ee=v("zeed:emitter","error"),U=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.dispose=ke();this.call=new Proxy({},{get:(t,n)=>async(...o)=>await this.emit(n,...o)})}async emit(t,...n){let o=!1;try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...n)),i.length>0){let s=i.map(c=>{try{return $(c(...n))}catch(u){ee.warn("emit warning:",u)}return null}).filter(c=>c!=null);o=!0,await Promise.all(s)}}catch(i){ee.error("emit exception",i)}return o}onAny(t){this.subscribersOnAny.push(t)}on(t,n){let o=this.subscribers[t]||[];return o.push(n),this.subscribers[t]=o,()=>{this.off(t,n)}}onCall(t){for(let[n,o]of Object.entries(t))this.on(n,o)}once(t,n){let o=r(async(...i)=>(this.off(t,o),await $(n(...i))),"onceListener");return this.on(t,o),()=>{this.off(t,n)}}off(t,n){return this.subscribers[t]=(this.subscribers[t]||[]).filter(o=>n&&o!==n),this}removeAllListeners(){return this.subscribers={},this}};r(U,"Emitter");function Si(){let e=Y().emitter;return e||(e=new U,Y().emitter=e),e}r(Si,"getGlobalEmitter");var Ei=new U;function Mi(e,t){let n=Math.round(P()*100),o=[],i,s=r((u,p)=>{let m={key:u,obj:p};o.push(m),i&&i()},"incoming");return t?e.on?e.on(t,u=>{s(t,u)}):e.addEventListener?e.addEventListener(t,u=>{s(t,u)}):ee.error(n,"Cannot listen to key"):e.onAny?e.onAny((u,p)=>{s(u,p)}):ee.error(n,"cannot listen to all for",e),r((u,p=!0)=>new Promise((m,h)=>{u||(u=t,u||o.length&&(u=o[0].key)),i=r(()=>{for(;o.length>0;){let x=o.shift();if(x.key===u)i=void 0,m(x.obj);else{if(p){ee.warn(n,`Unhandled event ${u} with value: ${x.obj}`);continue}h(new Error(`Expected ${u}, but found ${x.key} with value=${x.obj}`)),ee.error(n,`Unhandled event ${u} with value: ${x.obj}`)}break}},"lazyResolve"),i()}),"on")}r(Mi,"lazyListener");var te=r(()=>Date.now(),"getTimestamp");function vt(e){return e>999?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(2)}ms`}r(vt,"formatMilliseconds");function Ri(...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 o=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);o&&(n=new Date(+o[1],+o[2]-1,+o[3],12,0))}if(n instanceof Date)return n}}}r(Ri,"parseDate");var{encode:hn,decode:ki}=z(62),{encode:xn,decode:Ii}=z(32),Ie=16;function $e(){return W(Ie)}r($e,"uuidBytes");function bn(e=$e()){return hn(e,22)}r(bn,"uuidB62");function wn(e){return hn(e,22)}r(wn,"uuidEncodeB62");function Tn(e){return ki(e,Ie)}r(Tn,"uuidDecodeB62");function Ln(e=$e()){return xn(e,26)}r(Ln,"uuidB32");function vn(e){return xn(e,26)}r(vn,"uuidEncodeB32");function Cn(e){return Ii(e,Ie)}r(Cn,"uuidDecodeB32");var $i="10000000-1000-4000-8000-100000000000",An=typeof crypto<"u"&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>$i.replace(/[018]/g,e=>(e^W(1)[0]&15>>e/4).toString(16));function Fn(e){let t=Ze(e);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`}r(Fn,"uuidEncodeV4");function Dn(e){return Ke(e.replaceAll("-",""))}r(Dn,"uuidDecodeV4");var Pn=16e11;function Oi(e){let t=new Uint8Array([0,0,0,0,0,0]),n=t.length-1;for(let o=0;o<t.length;o++){let i=e&255;t[n-o]=i,e=(e-i)/256}return t}r(Oi,"longToByteArray");function At(){let e=te()-Pn;return new Uint8Array([...Oi(e),...W(10)])}r(At,"suidBytes");function _i(){return En(At())}r(_i,"suid");function Bi(e){return Un(Dt(e))}r(Bi,"suidDate");function Un(e){return new Date(Pn+e.slice(0,6).reduce((t,n)=>t*256+n,0))}r(Un,"suidBytesDate");var ji=r(()=>new Uint32Array(W(4))[0],"uuid32bit"),Ft={base62:{uuid:bn,uuidDecode:Tn,uuidEncode:wn},base32:{uuid:Ln,uuidDecode:Cn,uuidEncode:vn},uuidv4:{uuid:An,uuidDecode:Dn,uuidEncode:Fn}},Oe="base62",Sn=!1;function Hi(e,t=!1){Oe=e,Sn=t}r(Hi,"setUuidDefaultEncoding");function N(){return Ft[Oe].uuid(Sn?At():$e())}r(N,"uuid");function Dt(e){return Ft[Oe].uuidDecode(e)}r(Dt,"uuidDecode");function En(e){return Ft[Oe].uuidEncode(e)}r(En,"uuidEncode");function zi(e){try{return Dt(e).length===Ie}catch{}return!1}r(zi,"uuidIsValid");var Ct={};function R(e="id"){return Ct[e]==null&&(Ct[e]=0),`${e}-${Ct[e]++}`}r(R,"uname");var Ni=0;function Gi(){return`id-${Ni++}`}r(Gi,"qid");var fe=class extends U{constructor(){super(...arguments);this.id=N()}close(){this.dispose()}};r(fe,"Channel");var ne=class extends fe{constructor(){super(...arguments);this.isConnected=!0}postMessage(n){this.other?.emit("message",{data:n,origin:"local",lastEventId:N()})}};r(ne,"LocalChannel");function Vi(){let e=new ne,t=new ne;return e.other=t,t.other=e,[e,t]}r(Vi,"createLocalChannelPair");var _e=class{async encode(t){return t}async decode(t){return t}};r(_e,"NoopEncoder");var G=class{async encode(t){return be(t)}async decode(t){return we(t)}};r(G,"JsonEncoder");var Be=class{constructor(t){this.key=t}async encode(t){let n=be(t);return await nt(n,this.key)}async decode(t){let n=await rt(t,this.key);return we(n)}};r(Be,"CryptoEncoder");var Pt=r((e,t,n={})=>new Proxy(n,{get:(o,i)=>i in o?o[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function qi(e={}){let{name:t=R("hub"),encoder:n=new G,retryAfter:o=1e3,ignoreUnhandled:i=!0,logLevel:s=!1}=e,c=v(t,s),u={},p,m=[],h,x={},b=r(()=>{clearTimeout(h)},"dispose"),L=r(async()=>{if(clearTimeout(h),p){if(p.isConnected)for(;m.length;){let y=m[0];try{p.postMessage(await n.encode(y)),m.shift()}catch(f){c.warn("postMessage",f);break}}m.length>0&&o>0&&(h=setTimeout(L,o))}},"postNext"),w=r(async y=>{c("enqueue postMessage",y),m.push(y),await L()},"postMessage"),T=r(async y=>{p=y,p.on("connect",L),p.on("message",async f=>{c("onmessage",typeof f);let{name:a,args:l,id:d,result:g,error:A}=await n.decode(f.data);if(a){c(`name ${a} id ${d}`);try{if(u[a]==null)throw new Error(`handler for ${a} was not found`);let F=u[a](...l);M(F)&&(F=await F),c(`result ${F}`),d&&await w({id:d,result:F})}catch(F){let B=F instanceof Error?F:new Error(Fe(F));c.warn("execution error",B.name),await w({id:d,error:{message:B.message,stack:B.stack,name:B.name}})}}else if(d)if(c(`response for id=${d}: result=${g}, error=${A}`),x[d]==null)g===void 0?c(`skip response for ${d}`):c.warn(`no response hook for ${d}`);else{let[F,B]=x[d];if(F&&B)if(delete x[d],A){let me=new Error(A.message);me.stack=A.stack,me.name=A.name,c.warn("reject",me.name),B(me)}else c("resolve",g),F(g)}else i||c.warn("Unhandled message",f)}),await L()},"connect"),C=r(async(y,f,a={})=>{let{timeout:l=5e3}=a,d=N();return await w({name:y,args:f,id:d}),gt(new Promise((g,A)=>x[d]=[g,A]),l)},"fetchMessage");return e.channel&&T(e.channel),{dispose:b,connect:T,listen(y){Object.assign(u,y)},send(){return Pt(C,{},{options(y){return Pt(C,{...y})}})}}}r(qi,"useMessageHub");var de=class extends U{constructor(n){super();this.publish=this.emit.bind(this);this.subscribe=this.on.bind(this);let{name:o,encoder:i=new G,channel:s,debug:c=!1}=n;this.channel=s,this.encoder=i,this.debug=c,this.name=o??this.channel.id??R("pubsub"),this.log=v(`${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 p=await this.encoder.decode(u);if(this.debug?this.log(`channel message, event=${p?.event}, info=`,p):this.log(`channel message, event=${p?.event}`),p){let{event:m,args:h}=p;await this.emitSuper(m,...h)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(n,...o){return await super.emit(n,...o)}async emit(n,...o){try{if(this.debug?this.log(`emit(${String(n)})`,n):this.log(`emit(${String(n)})`,o.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let i=await this.encoder.encode({event:n,args:o});return this.channel.postMessage(i),!0}catch(i){this.log.warn(`emit(${String(n)})`,i)}return!1}};r(de,"PubSub");function Ji(e){return new de(e)}r(Ji,"usePubSub");var Wi=1;var Mn=r(e=>e,"defaultSerialize"),Zi=Mn;function Ki(e,t){let{post:n,on:o,eventNames:i=[],serialize:s=Mn,deserialize:c=Zi}=t,u=new Map;return o(async p=>{let m=c(p),[h,x,b,L]=m;if(h===1||h===2){let w,T;if(L!=null)try{let C=e[L];w=await C(...x)}catch(C){T=String(C)}else T="Method implementation missing";h===1&&b&&n(s(T?[4,T,b]:[3,w,b]))}else if(b){let w=u.get(b);w!=null&&(h===4?w.reject(x):w.resolve(x)),u.delete(b)}}),new Proxy({},{get(p,m){let h=r((...b)=>{n(s([2,b,null,m]))},"sendEvent");if(t.onlyEvents||i.includes(m))return h.asEvent=h,h;let x=r((...b)=>new Promise((L,w)=>{let T=Wi++;u.set(T,{resolve:L,reject:w}),n(s([1,b,T,m]))}),"sendCall");return x.asEvent=h,x}})}r(Ki,"useRPC");var j=class extends U{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 o of this._children)await o.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 o=new j(n);return this.addChild(o),o}removeChild(n){it(this._children,n),this.update()}getTotalUnits(){if(this.isIndeterminate())return 0;let n=this._totalUnits;for(let o of this._children)n+=o.getTotalUnits();return n}getCompletedUnits(){if(this.isIndeterminate())return 0;let n=this._completedUnits;for(let o of this._children)n+=o.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 isNaN(n)&&(n=0),Math.min(1,Math.max(0,n))}getChildrenCount(){return this._children.length}setTotalUnits(n,o){this._totalUnits=n,o!=null&&(this._completedUnits=o),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 o=`${" ".repeat(n)}${this.name}: ${this._completedUnits} of ${this._totalUnits} units, ${Math.floor(this.getFraction()*100)} %, cancel=${this._isCancelled}
|
|
12
|
+
`;for(let i of this._children)o+=i.toString(n+1);return n===0?o.trim():o}};r(j,"Progress");var Rn=(o=>(o[o.waiting=0]="waiting",o[o.running=1]="running",o[o.finished=2]="finished",o))(Rn||{}),kn=(o=>(o[o.replace=0]="replace",o[o.memoize=1]="memoize",o[o.error=2]="error",o))(kn||{});function Yi(e={}){let{maxParallel:t=3,name:n=R("pool")}=e,o=new U,i=new j({name:n});i.on("progressCancelled",C);let s=0,c=0,u=0,p=0,m={};async function h(){if(s>0){let[f,a]=ft();return o.once("didFinish",a),f}}r(h,"waitFinishAll");async function x(){for(let f of Object.keys(m))m[f].state===2&&(await m[f].progress.dispose(),delete m[f])}r(x,"cleanupFinished");function b(){o.emit("didFinish"),s=0,c=0,x(),i.reset()}r(b,"didFinish");function L(){let f=0,a=0;for(let{max:l,resolved:d,state:g}of Object.values(m))f+=l,a+=g===2?l:Math.min(l,d);o.emit("didUpdate",s,c,f,a)}r(L,"didUpdate");function w(){if(L(),s>0&&s===c&&b(),u>=t)return;let f=Object.values(m).filter(a=>a.state===0);if(f.length>0){let a;for(let l of f)l.group!=null&&Object.values(m).some(d=>d.state===1&&d.id!==l.id&&d.group===l.group)||(a==null||l.priority<a.priority)&&(a=l);if(a!=null){let l=a.id,d=a.done;a.state=1,++u,o.emit("didStart",l);let g=r(A=>{a&&(a.result=A,a.state=2,a.resolved=a.max),--u,++c,w()},"taskFinished");a.task(a).then(A=>{d(A),o.emit("didResolve",l,A),g(A)}).catch(A=>{d(),o.emit("didReject",l,A),g()})}}}r(w,"performNext");function T(f){let a=m[f];a&&a.state===0&&(m[f].state=2,++c,o.emit("didCancel",f),m[f].progress.dispose(),L())}r(T,"cancel");function C(){Object.keys(m).forEach(T)}r(C,"cancelAll");function y(f,a={}){let l,d=new Promise(F=>l=F),g=a.id??N();if(m[g]!=null){let F=a.idConflictResolution??1;if(F===0)T(g);else if(F===1){let B=m[g];return{id:g,promise:(async()=>{if(B.state===2)return m[g].result})(),dispose:()=>T(g),cancel:()=>T(g)}}else throw new Error(`Pool task with id=${g} already exists!`)}let A=new j({name:g,totalUnits:a.max??1,completeUnits:a.resolved??0});return i.addChild(A),m[g]={id:g,task:f,priority:++p,group:a.group,state:0,max:a.max??1,resolved:a.resolved??0,done:l,payload:a.payload,progress:A,setMax(F){A.setTotalUnits(F),m[g].max=F,L()},setResolved(F){A.setCompletetedUnits(F),m[g].resolved=F,L()},incResolved(F=1){A.incCompletedUnits(F),m[g].resolved+=F,L()}},++s,w(),{id:g,promise:d,dispose:()=>T(g),cancel:()=>T(g)}}return r(y,"enqueue"),{events:o,cancel:T,cancelAll:C,progress:i,enqueue:y,dispose:C,waitFinishAll:h}}r(Yi,"usePool");var je=class extends U{constructor(n={}){super();this.queue=[];this.waitToFinish=[];this.countMax=0;this.countResolved=0;this.paused=!1;let{name:o=R("queue"),logLevel:i}=n;this.name=o,this.log=v(`zeed:queue:${o}`,i??1/0)}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:o,task:i,resolve:s}=n;this.currentTask=i();let c;try{this.log.info(`start task ${o}`),c=await this.currentTask,this.log(`finished task ${o} with result =`,c)}catch(u){this.log.warn("Error performing task",u)}s(c),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,o={}){let{immediate:i=!1,name:s=R(this.name)}=o;return i?(this.log.info(`immediate execution ${s}`),await n()):(this.log(`enqueue ${s}`),new Promise(c=>{this.queue.push({name:s,task:n,resolve:c}),this.countMax+=1,this.emit("didUpdate",this.countMax,this.countResolved),this.performNext()}))}async enqueueReentrant(n,o={}){return this.enqueue(n,{immediate:this.currentTask!=null,name:o.name})}async cancelAll(n=!0){this.log("cancelAll"),this.emit("didCancel");let o=this.queue.map(i=>i.resolve);this.queue=[],o.forEach(i=>i(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}};r(je,"SerialQueue");var re=!1,I=re?v("zeed:throttle","error"):()=>{};function Qi(e,t={}){let{delay:n=100,trailing:o=!0,leading:i=!0}=t,s=0,c=0,u=0,p,m=Date.now();function h(){return s?(clearTimeout(s),s=void 0,!0):!1}r(h,"clearExistingTimeout");function x(...b){let L=Date.now(),w=L-c;function T(){let y=Date.now();return`total ${(y-m).toFixed(1)}ms - elapsed ${(y-c).toFixed(1)}ms - visited ${u}x`}r(T,"debugElapsed");let C=r(()=>{u=0,c=Date.now(),e.apply(this,b)},"exec");if(p=C,w>n||!s){re&&I("elapsed",T()),i&&(w>n?(re&&I("\u{1F680} leading",T()),C()):++u);let y=w>n?n:n-w;I(`\u23F1 start timeout with ${y.toFixed(1)}ms`,T()),h(),c=L,s=setTimeout(()=>{re&&I("\u23F1 reached timeout",T()),s=0,o&&(!i||u>0)&&(re&&I("\u{1F680} trailing",T()),p?.())},y)}else++u,re&&I("visited",T())}return r(x,"wrapper"),x.cancel=h,x.stop=()=>{h()&&p&&p()},x.immediate=r(async function(...L){h(),c=Date.now(),e.apply(this,L)},"immediate"),x.dispose=()=>x.stop(),x}r(Qi,"throttle");function Xi(e,t={}){let{delay:n=100}=t,o=0,i=!1,s;function c(){o&&(I("clear"),clearTimeout(o),o=0)}r(c,"clearExistingTimeout");async function u(){try{if(c(),s!=null){I("exec");let h=[...s];s=void 0,i=!0,await $(e(...h)),i=!1,I("exec done"),s!=null&&(c(),I("exec trigger next"),o=setTimeout(u,n))}}catch{}}r(u,"exec");function p(...h){s=[...h],c(),I("trigger"),i===!1&&(o=setTimeout(u,n))}r(p,"wrapper");async function m(...h){c(),s=[...h],await u()}return r(m,"immediate"),p.cancel=c,p.dispose=c,p.immediate=m,p}r(Xi,"debounce");function es(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")}r(es,"isLocalHost");function ts(e){let{level:t=void 0,filter:n=void 0,messages:o=[]}=e,i=k(n),s=q(t);return c=>{s(c.level)&&i(c.name)&&o.push(c)}}r(ts,"LoggerMemoryHandler");var oe=v("zeed:network","error"),Ut={cache:"no-cache",redirect:"follow",headers:{}};function In(e){let t=/:\/\/([^@]*)@/gi.exec(e);if(t&&t[1]){let[n,o]=t[1].split(":",2);return{url:e.replace(`${t[1]}@`,""),username:n,password:o}}}r(In,"parseBasicAuth");async function St(e,t={},n=fetch){try{_(t)&&(t=le({},...Z(t)));let o=In(String(e));o&&(e=o.url,t=le({},t,$n(o.username,o.password))),t.headers!=null&&!(t.headers instanceof Headers)&&(t.headers=new Headers(t.headers));let i=await n(String(e),t);if(i.status<400)return i;try{oe.warn(`Fetch of ${String(e)} returned status=${i.status}. Options:`,t),oe.warn(`Response: ${await i.text()}`)}catch(s){oe.error("Exception:",s)}}catch(o){oe.error("fetchBasic",o)}}r(St,"fetchBasic");async function ns(e,t={},n=fetch){try{let o=await St(e,[{method:"GET",headers:{Accept:"application/json"}},t],n);if(o)return await o.json()}catch(o){oe.error("fetchJSON error:",o)}}r(ns,"fetchJson");async function rs(e,t={},n=fetch){try{let o=await St(e,[Ut,{method:"GET"},t],n);if(o)return await o.text()}catch(o){oe.error("fetchHTML error:",o)}}r(rs,"fetchText");function os(e,t="POST"){return{method:t,...Ut,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:Lt(e)}}r(os,"fetchOptionsFormURLEncoded");function is(e,t="POST"){return{method:t,...Ut,headers:{"Content-Type":"application/json; charset=utf-8"},body:S(e)}}r(is,"fetchOptionsJson");function $n(e,t){return{headers:{Authorization:`Basic ${Ye(`${e}:${t}`)}`}}}r($n,"fetchOptionsBasicAuth");function Et(){if(typeof window<"u")return window}r(Et,"getWindow");function On(){if(typeof navigator<"u")return navigator}r(On,"getNavigator");function ss(){return Et()??typeof WorkerGlobalScope<"u"?self:typeof global<"u"?global:Function("return this;")()}r(ss,"getGlobal");var V=On(),K=Et();function _n(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}){return e.ios=V?.platform?.match(/(iPhone|iPod|iPad)/i)!=null,e.macos=!!V?.platform?.startsWith("Mac"),e.windows=!!V?.platform?.startsWith("Win"),e.beaker=K?.beaker!=null,e.electron=(V?.userAgent?.toLowerCase()?.indexOf(" electron/")||-1)>-1&&!e.beaker,e.wkwebview=K?.webkit?.messageHandlers!=null,e.pwa=V?.serviceWorker!=null,e.pwaInstalled=V?.standalone||K?.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=K&&"ontouchstart"in K||(V?.maxTouchPoints||0)>1||V?.msPointerEnabled&&K?.MSGesture||K?.DocumentTouch&&document instanceof DocumentTouch,e}r(_n,"detect");var He=r(()=>typeof window<"u"&&globalThis===window,"isBrowser"),as=_n();function us(e){He()?window.addEventListener("beforeunload",e):typeof process<"u"&&process.on("exit",()=>e)}r(us,"useExitHandler");var ze=class{constructor(t={}){this.store={}}setItem(t,n){this.store[t]=Me(n)}getItem(t){return Me(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};r(ze,"MemStorage");var cs=r(()=>{},"noop");var ls=v("zeed:base64","error");function fs(e){try{let t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),o=window.atob(n),i=new Uint8Array(o.length);for(let s=0;s<o.length;++s)i[s]=o.charCodeAt(s);return i}catch(t){ls.error(t,e)}}r(fs,"urlBase64ToUint8Array");var ds=v("zeed:gravatar","error");function ps(e,t){let n="0123456789abcdef".split("");function o(y,f){let a=y[0],l=y[1],d=y[2],g=y[3];a=s(a,l,d,g,f[0],7,-680876936),g=s(g,a,l,d,f[1],12,-389564586),d=s(d,g,a,l,f[2],17,606105819),l=s(l,d,g,a,f[3],22,-1044525330),a=s(a,l,d,g,f[4],7,-176418897),g=s(g,a,l,d,f[5],12,1200080426),d=s(d,g,a,l,f[6],17,-1473231341),l=s(l,d,g,a,f[7],22,-45705983),a=s(a,l,d,g,f[8],7,1770035416),g=s(g,a,l,d,f[9],12,-1958414417),d=s(d,g,a,l,f[10],17,-42063),l=s(l,d,g,a,f[11],22,-1990404162),a=s(a,l,d,g,f[12],7,1804603682),g=s(g,a,l,d,f[13],12,-40341101),d=s(d,g,a,l,f[14],17,-1502002290),l=s(l,d,g,a,f[15],22,1236535329),a=c(a,l,d,g,f[1],5,-165796510),g=c(g,a,l,d,f[6],9,-1069501632),d=c(d,g,a,l,f[11],14,643717713),l=c(l,d,g,a,f[0],20,-373897302),a=c(a,l,d,g,f[5],5,-701558691),g=c(g,a,l,d,f[10],9,38016083),d=c(d,g,a,l,f[15],14,-660478335),l=c(l,d,g,a,f[4],20,-405537848),a=c(a,l,d,g,f[9],5,568446438),g=c(g,a,l,d,f[14],9,-1019803690),d=c(d,g,a,l,f[3],14,-187363961),l=c(l,d,g,a,f[8],20,1163531501),a=c(a,l,d,g,f[13],5,-1444681467),g=c(g,a,l,d,f[2],9,-51403784),d=c(d,g,a,l,f[7],14,1735328473),l=c(l,d,g,a,f[12],20,-1926607734),a=u(a,l,d,g,f[5],4,-378558),g=u(g,a,l,d,f[8],11,-2022574463),d=u(d,g,a,l,f[11],16,1839030562),l=u(l,d,g,a,f[14],23,-35309556),a=u(a,l,d,g,f[1],4,-1530992060),g=u(g,a,l,d,f[4],11,1272893353),d=u(d,g,a,l,f[7],16,-155497632),l=u(l,d,g,a,f[10],23,-1094730640),a=u(a,l,d,g,f[13],4,681279174),g=u(g,a,l,d,f[0],11,-358537222),d=u(d,g,a,l,f[3],16,-722521979),l=u(l,d,g,a,f[6],23,76029189),a=u(a,l,d,g,f[9],4,-640364487),g=u(g,a,l,d,f[12],11,-421815835),d=u(d,g,a,l,f[15],16,530742520),l=u(l,d,g,a,f[2],23,-995338651),a=p(a,l,d,g,f[0],6,-198630844),g=p(g,a,l,d,f[7],10,1126891415),d=p(d,g,a,l,f[14],15,-1416354905),l=p(l,d,g,a,f[5],21,-57434055),a=p(a,l,d,g,f[12],6,1700485571),g=p(g,a,l,d,f[3],10,-1894986606),d=p(d,g,a,l,f[10],15,-1051523),l=p(l,d,g,a,f[1],21,-2054922799),a=p(a,l,d,g,f[8],6,1873313359),g=p(g,a,l,d,f[15],10,-30611744),d=p(d,g,a,l,f[6],15,-1560198380),l=p(l,d,g,a,f[13],21,1309151649),a=p(a,l,d,g,f[4],6,-145523070),g=p(g,a,l,d,f[11],10,-1120210379),d=p(d,g,a,l,f[2],15,718787259),l=p(l,d,g,a,f[9],21,-343485551),y[0]=w(a,y[0]),y[1]=w(l,y[1]),y[2]=w(d,y[2]),y[3]=w(g,y[3])}r(o,"md5cycle");function i(y,f,a,l,d,g){return f=w(w(f,y),w(l,g)),w(f<<d|f>>>32-d,a)}r(i,"cmn");function s(y,f,a,l,d,g,A){return i(f&a|~f&l,y,f,d,g,A)}r(s,"ff");function c(y,f,a,l,d,g,A){return i(f&l|a&~l,y,f,d,g,A)}r(c,"gg");function u(y,f,a,l,d,g,A){return i(f^a^l,y,f,d,g,A)}r(u,"hh");function p(y,f,a,l,d,g,A){return i(a^(f|~l),y,f,d,g,A)}r(p,"ii");function m(y){let f=y.length,a=[1732584193,-271733879,-1732584194,271733878],l;for(l=64;l<=y.length;l+=64)o(a,h(y.substring(l-64,l)));y=y.substring(l-64);let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<y.length;l++)d[l>>2]|=y.charCodeAt(l)<<(l%4<<3);if(d[l>>2]|=128<<(l%4<<3),l>55)for(o(a,d),l=0;l<16;l++)d[l]=0;return d[14]=f*8,o(a,d),a}r(m,"md51");function h(y){let f=[],a;for(a=0;a<64;a+=4)f[a>>2]=y.charCodeAt(a)+(y.charCodeAt(a+1)<<8)+(y.charCodeAt(a+2)<<16)+(y.charCodeAt(a+3)<<24);return f}r(h,"md5blk");function x(y){let f="",a=0;for(;a<4;a++)f+=n[y>>a*8+4&15]+n[y>>a*8&15];return f}r(x,"rhex");function b(y){for(let f=0;f<y.length;f++)y[f]=x(y[f]);return y.join("")}r(b,"hex");function L(y){return b(m(y))}r(L,"md5");function w(y,f){return y+f&4294967295}r(w,"add32"),t=t||{};let T=[];t={size:t.size||"50",rating:t.rating||"g",secure:t.secure||location.protocol==="https:",backup:t.backup||""},e=e.trim().toLowerCase();let C=t.secure?"https://secure.gravatar.com/avatar/":"http://www.gravatar.com/avatar/";return t.rating&&T.push(`r=${t.rating}`),t.backup&&T.push(`d=${encodeURIComponent(t.backup)}`),t.size&&T.push(`s=${t.size}`),`${C+L(e)}?${T.join("&")}`}r(ps,"gravatar");function gs(e,t=""){try{return ps(e,{size:256,backup:"monsterid",secure:!0})}catch{return ds(`Gravatar issue: Did not find an image for ${e}`),t}}r(gs,"gravatarURLByEmail");var Bn=v("zeed:localstorage","error"),Ne=class{constructor(t){this.pretty=!1;Bn.assert(t.name,"name required"),this.name=t.name,this.prefix=`${t.name}$`,this.objectToString=t.objectToString??(n=>this.pretty?S(n,null,2):S(n)),this.objectFromString=t.objectFromString??(n=>{try{return JSON.parse(n)}catch(o){Bn.warn(`LocalStorage parse error '${o}' in`,n)}})}setItem(t,n){let o=this.objectToString(n);localStorage.setItem(`${this.prefix}${t}`,o)}getItem(t){let n=localStorage.getItem(`${this.prefix}${t}`);if(n!=null)return this.objectFromString(n)}removeItem(t){localStorage.removeItem(`${this.prefix}${t}`)}clear(){Object.keys(localStorage).filter(t=>t.startsWith(this.prefix)).forEach(t=>{localStorage.removeItem(t)})}allKeys(){let t=this.prefix.length;return Object.keys(localStorage).filter(n=>n.startsWith(this.prefix)).map(n=>n.substr(t))}};r(Ne,"LocalStorage");var jn=["#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 pe(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}r(pe,"supportsColors");function ge(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return jn[Math.abs(t)%jn.length]}r(ge,"selectColor");var zn='font-family: "JetBrains Mono", Menlo; font-size: 11px;',ms=`${zn}`,ys=`font-weight: 600; ${zn}`,hs=pe(),Hn={},xs=te();function Mt(e={}){let{filter:t=void 0,level:n=void 0,colors:o=!0,padding:i=16,time:s=!0}=e,c=k(t),u=q(n);return p=>{if(!u(p.level)||!c(p.name))return;let m=s?`+${vt(te()-xs)}`:"",h=p.name||"",x=Hn[h||""];x==null&&(x={color:ge(h)},Hn[h]=x);let b;switch(i>0&&(h=h.padEnd(16," ")),o&&hs?(b=[`%c${h}%c %s %c${m}`],b.push(`color:${x.color}; ${ys}`),b.push(ms),b.push(p.messages?.[0]??""),b.push(`color:${x.color};`),b.push(...p.messages.slice(1))):b=[h,...p.messages,`+${m}`],b=b.map(L=>L instanceof Uint8Array?`<Uint8Array size=${L.length}>`:L),p.level){case 1:e.levelHelper&&(b[0]=`I|* ${b[0]}`),console.info(...b);break;case 2:e.levelHelper&&(b[0]=`W|** ${b[0]}`),console.warn(...b);break;case 3:e.levelHelper&&(b[0]=`E|*** ${b[0]}`),console.error(...b);break;default:e.levelHelper&&(b[0]=`D| ${b[0]}`),console.debug(...b);break}}}r(Mt,"LoggerBrowserHandler");var Nn='font-family: "JetBrains Mono", Menlo; font-size: 11px;',bs=`${Nn}`,ws=`font-weight: 600; ${Nn}`,Ts=pe(),ie=r(()=>{},"noop");function Rt(e={}){let t=e.filter??localStorage.zeed??localStorage.debug;return r(function n(o="",i){let s,c=k(t),u=Q(i??-1);if(c(o)&&u!==1/0){let h=function(x,b){return u<=x?b:()=>{}};var p=h;r(h,"defineForLogLevel");let m=[];if(Ts){let x=ge(o);m.push(`%c${o.padEnd(16," ")}%c %s`),m.push(`color:${x}; ${ws}`),m.push(bs)}else m.push(`[${o}] %s`);s=h(0,console.debug.bind(console,...m)),s.debug=h(0,console.debug.bind(console,...m)),s.info=h(1,console.info.bind(console,...m)),s.warn=h(2,console.warn.bind(console,...m)),s.error=h(3,console.error.bind(console,...m)),s.fatal=h(4,(...x)=>{throw s.error(...x),new Error(`${x.map(String).join(" ")}`)}),s.assert=h(4,(x,...b)=>{(x==null||!x)&&s.fatal(...b)})}else s=r(()=>{},"log"),s.debug=ie,s.info=ie,s.warn=ie,s.error=ie,s.assert=ie,s.fatal=ie;return s.extend=m=>n(o?`${o}:${m}`:m),s.label=o,s},"LoggerBrowserDebugFactory")}r(Rt,"LoggerBrowserSetupDebugFactory");function Ls(e={}){console.info("activateConsoleDebug is activated by default in browsers")}r(Ls,"activateConsoleDebug");function Gn(){He()&&(v.setHandlers([Mt()]),v.setFactory(Rt({})))}r(Gn,"setupBrowserLog");Gn();0&&(module.exports={CRYPTO_DEFAULT_ALG,CRYPTO_DEFAULT_DERIVE_ALG,CRYPTO_DEFAULT_DERIVE_ITERATIONS,CRYPTO_DEFAULT_HASH_ALG,Channel,CryptoEncoder,DAY_MS,Day,Emitter,JsonEncoder,LocalChannel,LocalStorage,LogLevel,LogLevelAlias,Logger,LoggerBrowserHandler,LoggerBrowserSetupDebugFactory,LoggerConsoleHandler,LoggerContext,LoggerMemoryHandler,MemStorage,NoopEncoder,PoolTaskIdConflictResolution,PoolTaskState,Progress,PubSub,SerialQueue,Uint8ArrayToHexDump,Uint8ArrayToJson,Uint8ArrayToString,XRX,_decodeUtf8Polyfill,_encodeUtf8Polyfill,activateConsoleDebug,arrayAvg,arrayBatches,arrayEmptyInPlace,arrayFilterInPlace,arrayFlatten,arrayIntersection,arrayIsEqual,arrayMax,arrayMin,arrayMinus,arrayRandomElement,arrayRemoveElement,arraySetElement,arrayShuffle,arrayShuffleForce,arrayShuffleInPlace,arraySorted,arraySortedNumbers,arraySum,arraySymmetricDifference,arrayToggleInPlace,arrayUnion,arrayUnique,avg,between,cloneJsonObject,cloneObject,cmp,composeOrderby,createArray,createLocalChannelPair,createPromise,createPromiseProxy,csvParse,csvParseToObjects,csvStringify,dateStringToDays,day,dayDay,dayDiff,dayFromAny,dayFromDate,dayFromDateGMT,dayFromParts,dayFromString,dayFromTimestamp,dayFromToday,dayIterator,dayMonth,dayMonthStart,dayOffset,dayRange,dayToDate,dayToDateGMT,dayToParts,dayToString,dayToTimestamp,dayYear,dayYearStart,debounce,decimal,decimalCentsPart,decimalFromCents,decimalToCents,decodeBase16,decodeBase32,decodeBase58,decodeBase62,decrypt,deepEqual,deepMerge,deepStripUndefinedInPlace,deriveKeyPbkdf2,detect,digest,empty,encodeBase16,encodeBase32,encodeBase58,encodeBase62,encodeQuery,encrypt,endSortWeight,ensureKey,ensureKeyAsync,equalBinary,escapeHTML,escapeRegExp,estimateSizeForBase,fetchBasic,fetchJson,fetchOptionsBasicAuth,fetchOptionsFormURLEncoded,fetchOptionsJson,fetchText,fixBrokenUth8String,forEachDay,forTimes,formatMessages,formatMilliseconds,fromBase64,fromBase64String,fromCamelCase,fromHex,getGlobal,getGlobalContext,getGlobalEmitter,getGlobalLogger,getNamespaceFilterString,getNavigator,getSecureRandom,getSecureRandomIfPossible,getTimestamp,getWindow,gravatarURLByEmail,immediate,isArray,isBoolean,isBrowser,isEven,isHalf,isInteger,isLocalHost,isNotNull,isNull,isNullOrUndefined,isNumber,isObject,isPrime,isPrimeRX,isPrimitive,isPromise,isRecord,isRecordPlain,isSafeInteger,isString,isTimeout,isUint8Array,isValue,joinToUint8Array,jsonStringify,jsonStringifySafe,jsonStringifySorted,jsonToUint8Array,last,lazyListener,linkifyPlainText,listDistinctUnion,listGroupBy,listOfKey,listQuery,memoize,memoizeAsync,messages,moveSortWeight,noop,objectIsEmpty,objectMap,objectMergeDisposable,parseBasicAuth,parseDate,parseLogLevel,parseOrderby,parseQuery,platform,promisify,qid,randomBoolean,randomFloat,randomInt,randomUint8Array,regExpEscape,regExpString,renderMessages,roundDown,roundHalfAwayFromZero,roundHalfDown,roundHalfEven,roundHalfOdd,roundHalfTowardsZero,roundHalfUp,roundUp,seededRandom,selectColor,setUuidDefaultEncoding,setupBrowserLog,size,sleep,sortedItems,sortedOrderby,startSortWeight,stringToBoolean,stringToFloat,stringToInteger,stringToUInt8Array,suid,suidBytes,suidBytesDate,suidDate,sum,supportsColors,throttle,timeout,timeoutReached,timoutError,toBase64,toBase64Url,toBool,toCamelCase,toCapitalize,toCapitalizeWords,toFloat,toHex,toHumanReadableUrl,toInt,toString,toUint8Array,toValidFilename,today,tryTimeout,uname,unescapeHTML,urlBase64ToUint8Array,useAsyncMutex,useBase,useDefer,useDispose,useDisposer,useEventListener,useExitHandler,useInterval,useLevelFilter,useMessageHub,useMutex,useNamespaceFilter,usePool,usePubSub,useRPC,useSorted,useTimeout,uuid,uuid32bit,uuidB32,uuidB62,uuidBytes,uuidDecode,uuidDecodeB32,uuidDecodeB62,uuidDecodeV4,uuidEncode,uuidEncodeB32,uuidEncodeB62,uuidEncodeV4,uuidIsValid,uuidv4,valueToBoolean,valueToFloat,valueToInteger,valueToString,waitOn});
|
|
13
13
|
//# sourceMappingURL=index.browser.cjs.map
|