zeed 0.7.96 → 0.7.97
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-ADCVWBB3.js → chunk-7YV5VFZP.js} +2 -2
- package/dist/{chunk-ADCVWBB3.js.map → chunk-7YV5VFZP.js.map} +0 -0
- package/dist/chunk-BHQJ5YK3.js +5 -0
- package/dist/{chunk-LUHXAZ6G.js.map → chunk-BHQJ5YK3.js.map} +1 -1
- package/dist/{chunk-V4FSO3ZW.js → chunk-H5ICAAIH.js} +2 -2
- package/dist/{chunk-V4FSO3ZW.js.map → chunk-H5ICAAIH.js.map} +0 -0
- package/dist/index.all.cjs +9 -9
- package/dist/index.all.cjs.map +1 -1
- package/dist/index.all.js +1 -1
- package/dist/index.browser.cjs +4 -4
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.node.cjs +9 -9
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-LUHXAZ6G.js +0 -5
package/dist/index.browser.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Fe,b as Ge,c as He,d as Ne}from"./chunk-
|
|
1
|
+
import{a as Fe,b as Ge,c as He,d as Ne}from"./chunk-H5ICAAIH.js";import{a as Ie,b as Je,c as Ke,d as Le,e as Me}from"./chunk-JL5GA55T.js";import{$ as uo,$a as ur,$b as ye,A as V,Aa as Wo,Ab as Zr,B as W,Ba as Xo,Bb as _r,C as X,Ca as Yo,Cb as $r,D as Y,Da as Zo,Db as oe,E as Z,Ea as _o,Eb as re,F as _,Fa as $o,Fb as ee,G as $,Ga as or,Gb as fe,H as oo,Ha as rr,Hb as me,I as ro,Ia as er,Ib as pe,J as eo,Ja as fr,Jb as te,K as fo,Ka as mr,Kb as xe,L as mo,La as pr,Lb as ae,M as po,Ma as tr,Mb as be,N as to,Na as xr,Nb as ce,O as xo,Oa as ar,Ob as de,P as ao,Pa as br,Pb as ge,Q as bo,Qa as cr,Qb as he,R as co,Ra as dr,Rb as ie,S as go,Sa as gr,Sb as je,T as ho,Ta as hr,Tb as ke,U as io,Ua as ir,Ub as le,V as jo,Va as jr,Vb as ne,W as ko,Wa as kr,Wb as qe,X as lo,Xa as lr,Xb as se,Y as no,Ya as nr,Yb as ue,Z as qo,Za as qr,Zb as ve,_ as so,_a as sr,_b as we,a as u,aa as vo,ab as vr,ac as ze,b as v,ba as wo,bb as wr,bc as Ae,c as w,ca as yo,cb as yr,cc as Be,d as y,da as zo,db as zr,dc as Ce,e as z,ea as Ao,eb as Ar,ec as De,f as A,fa as Bo,fb as Br,fc as Ee,g as B,ga as Co,gb as Cr,h as C,ha as Do,hb as Dr,i as D,ia as Eo,ib as Er,j as E,ja as Fo,jb as Fr,k as F,ka as Go,kb as Gr,l as G,la as Ho,lb as Hr,m as H,ma as Io,mb as Ir,n as I,na as Jo,nb as Jr,o as J,oa as Ko,ob as Kr,p as K,pa as Lo,pb as Lr,q as L,qa as Mo,qb as Mr,r as M,ra as No,rb as Qr,s as N,sa as Oo,sb as Rr,t as O,ta as Po,tb as Sr,u as P,ua as Qo,ub as Tr,v as Q,va as Ro,vb as Ur,w as R,wa as So,wb as Vr,x as S,xa as To,xb as Wr,y as T,ya as Uo,yb as Xr,z as U,za as Vo,zb as Yr}from"./chunk-BHQJ5YK3.js";import{A as Pr,d as o,e as r,f as e,g as f,h as m,i as p,j as t,k as x,l as a,m as b,n as c,o as d,p as g,q as h,r as i,s as j,t as k,u as l,v as n,w as q,x as s,y as Nr,z as Or}from"./chunk-LNZLD7Y3.js";export{fe as Channel,xe as CryptoEncoder,No as Currency,tr as DAY_MS,xr as Day,$r as Emitter,te as JsonEncoder,me as LocalChannel,He as LocalStorage,j as LogLevel,k as LogLevelAlias,s as Logger,Ne as LoggerBrowserClassicHandler,Ke as LoggerBrowserHandler,Le as LoggerBrowserSetupDebugFactory,n as LoggerConsoleHandler,l as LoggerContext,Ce as MemStorage,ce as PubSub,Be as SerialQueue,D as Uint8ArrayToJson,v as Uint8ArrayToString,Me as activateConsoleDebug,Y as arrayEmptyInPlace,W as arrayFilterInPlace,R as arrayFlatten,S as arrayIntersection,$ as arrayIsEqual,mo as arrayMax,po as arrayMin,P as arrayMinus,fo as arrayRandomElement,U as arrayRemoveElement,V as arraySetElement,ro as arrayShuffle,eo as arrayShuffleForce,oo as arrayShuffleInPlace,Z as arraySorted,_ as arraySortedNumbers,T as arraySymmetricDifference,X as arrayToggleInPlace,Q as arrayUnion,O as arrayUnique,kr as between,Fr as cloneJsonObject,Er as cloneObject,M as cmp,L as composeOrderby,to as createArray,ae as createPromiseProxy,J as csv,Mo as currency,cr as day,Ee as debounce,bo as decodeBase16,go as decodeBase32,io as decodeBase58,ko as decodeBase62,no as decodeBase64,I as decrypt,c as deepEqual,d as deepMerge,G as deriveKeyPbkdf2,ve as detect,F as digest,Dr as empty,ao as encodeBase16,co as encodeBase32,ho as encodeBase58,jo as encodeBase62,lo as encodeBase64,zr as encodeQuery,H as encrypt,sr as endSortWeight,B as equalBinary,dr as escapeHTML,nr as escapeRegExp,pe as fakeWorkerPair,ie as fetchBasic,je as fetchJson,ke as fetchOptionsFormURLEncoded,le as fetchOptionsJson,ne as fetchText,Lo as fixBrokenUth8String,ar as forEachDay,Jo as formatMessages,Or as formatMilliseconds,vo as fromCamelCase,ue as getGlobal,q as getGlobalContext,oe as getGlobalEmitter,g as getNamespaceFilterString,se as getNavigator,Nr as getTimestamp,qe as getWindow,Ge as gravatarURLByEmail,Zo as immediate,e as isArray,a as isBoolean,we as isBrowser,Po as isEven,Oo as isHalf,t as isInteger,Mr as isLocalHost,b as isNullOrUndefined,p as isNumber,o as isObject,r as isPrimitive,mr as isPromise,f as isRecord,x as isSafeInteger,m as isString,rr as isTimeout,wo as jsonStringify,C as jsonToUint8Array,Cr as last,ee as lazyListener,wr as linkifyPlainText,re as messages,ur as moveSortWeight,Pr as parseDate,K as parseOrderby,Ar as parseQuery,ye as platform,pr as promisify,Vr as qid,hr as randomBoolean,jr as randomFloat,ir as randomInt,E as randomUint8Array,Ko as renderMessages,Ro as roundDown,Uo as roundHalfAwayFromZero,Vo as roundHalfDown,Wo as roundHalfEven,To as roundHalfOdd,Xo as roundHalfTowardsZero,So as roundHalfUp,Qo as roundUp,Je as selectColor,Br as size,Yo as sleep,vr as sortedItems,N as sortedOrderby,qr as startSortWeight,yo as stringToBoolean,Ao as stringToFloat,zo as stringToInteger,u as stringToUInt8Array,Yr as suid,Xr as suidBytes,_r as suidBytesDate,Zr as suidDate,Ie as supportsColors,De as throttle,$o as timeout,_o as timeoutReached,or as timoutError,z as toBase64,A as toBase64Url,Io as toBool,qo as toCamelCase,so as toCapitalize,uo as toCapitalizeWords,Fo as toFloat,y as toHex,yr as toHumanReadableUrl,Go as toInt,Ho as toString,w as toUint8Array,lr as toValidFilename,br as today,er as tryTimeout,Ur as uname,gr as unescapeHTML,Fe as urlBase64ToUint8Array,he as useAsyncMutex,xo as useBase,Ir as useDefer,Gr as useDispose,Hr as useDisposer,Lr as useEventListener,ze as useExitHandler,Kr as useInterval,i as useLevelFilter,be as useMessageHub,ge as useMutex,h as useNamespaceFilter,Ae as usePool,de as usePubSub,Jr as useTimeout,Sr as uuid,Rr as uuid32bit,Tr as uuidB32,Qr as uuidBytes,Wr as uuidv4,Bo as valueToBoolean,Do as valueToFloat,Co as valueToInteger,Eo as valueToString,fr as waitOn};
|
|
2
2
|
//# sourceMappingURL=index.browser.js.map
|
package/dist/index.node.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var Ir=Object.create;var Z=Object.defineProperty,Ur=Object.defineProperties,Or=Object.getOwnPropertyDescriptor,Fr=Object.getOwnPropertyDescriptors,$r=Object.getOwnPropertyNames,Pt=Object.getOwnPropertySymbols,Rr=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable;var kt=(e,t,r)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,O=(e,t)=>{for(var r in t||(t={}))Mt.call(t,r)&&kt(e,r,t[r]);if(Pt)for(var r of Pt(t))Nr.call(t,r)&&kt(e,r,t[r]);return e},ae=(e,t)=>Ur(e,Fr(t)),Ct=e=>Z(e,"__esModule",{value:!0}),o=(e,t)=>Z(e,"name",{value:t,configurable:!0});var Br=(e,t)=>{for(var r in t)Z(e,r,{get:t[r],enumerable:!0})},Dt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $r(t))!Mt.call(e,i)&&(r||i!=="default")&&Z(e,i,{get:()=>t[i],enumerable:!(n=Or(t,i))||n.enumerable});return e},U=(e,t)=>Dt(Ct(Z(e!=null?Ir(Rr(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Hr=(e=>(t,r)=>e&&e.get(t)||(r=Dt(Ct({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Si={};Br(Si,{Channel:()=>ke,CryptoEncoder:()=>ut,Currency:()=>R,DAY_MS:()=>Xe,Day:()=>A,Emitter:()=>N,FileStorage:()=>yt,JsonEncoder:()=>_,LocalChannel:()=>fe,LogLevel:()=>L,LogLevelAlias:()=>Be,Logger:()=>b,LoggerConsoleHandler:()=>le,LoggerContext:()=>He,LoggerFileHandler:()=>ht,LoggerNodeHandler:()=>St,MemStorage:()=>gt,PubSub:()=>Ce,SerialQueue:()=>dt,Uint8ArrayToJson:()=>we,Uint8ArrayToString:()=>Gt,arrayEmptyInPlace:()=>gn,arrayFilterInPlace:()=>ve,arrayFlatten:()=>Y,arrayIntersection:()=>Vt,arrayIsEqual:()=>Qt,arrayMax:()=>bn,arrayMin:()=>wn,arrayMinus:()=>_t,arrayRandomElement:()=>xn,arrayRemoveElement:()=>fn,arraySetElement:()=>pn,arrayShuffle:()=>yn,arrayShuffleForce:()=>hn,arrayShuffleInPlace:()=>_e,arraySorted:()=>Kt,arraySortedNumbers:()=>mn,arraySymmetricDifference:()=>cn,arrayToggleInPlace:()=>dn,arrayUnion:()=>Zt,arrayUnique:()=>Ee,between:()=>xo,cloneJsonObject:()=>Io,cloneObject:()=>W,cmp:()=>Le,colorString:()=>se,colorStringList:()=>At,composeOrderby:()=>un,createArray:()=>Tn,createPromiseProxy:()=>lt,csv:()=>an,currency:()=>B,day:()=>po,debounce:()=>yi,decodeBase16:()=>An,decodeBase32:()=>Pn,decodeBase58:()=>kn,decodeBase62:()=>Dn,decodeBase64:()=>Un,decrypt:()=>We,deepEqual:()=>ue,deepMerge:()=>Ut,deriveKeyPbkdf2:()=>tn,detect:()=>yr,digest:()=>en,empty:()=>Do,encodeBase16:()=>vn,encodeBase32:()=>Sn,encodeBase58:()=>Mn,encodeBase62:()=>Cn,encodeBase64:()=>In,encodeQuery:()=>ot,encrypt:()=>Je,endSortWeight:()=>nt,equalBinary:()=>ze,escapeHTML:()=>et,escapeRegExp:()=>vo,fakeWorkerPair:()=>ti,fetchBasic:()=>ft,fetchJson:()=>si,fetchOptionsFormURLEncoded:()=>ai,fetchOptionsJson:()=>ui,fetchText:()=>li,fixBrokenUth8String:()=>Jn,forEachDay:()=>co,formatMessages:()=>nr,formatMilliseconds:()=>it,fromCamelCase:()=>$n,getGlobal:()=>ci,getGlobalContext:()=>K,getGlobalEmitter:()=>Yo,getNamespaceFilterString:()=>Ot,getNavigator:()=>mr,getSourceLocation:()=>$e,getSourceLocationByPrecedingPattern:()=>Lt,getStack:()=>Tt,getStackLlocationList:()=>Er,getTimestamp:()=>ee,getWindow:()=>pt,immediate:()=>so,isArray:()=>It,isBoolean:()=>Wr,isBrowser:()=>hr,isEven:()=>Ve,isHalf:()=>X,isInteger:()=>qr,isLocalHost:()=>Bo,isNullOrUndefined:()=>_r,isNumber:()=>zr,isObject:()=>V,isPrimitive:()=>Ne,isPromise:()=>I,isRecord:()=>jr,isSafeInteger:()=>Jr,isString:()=>Gr,isTTY:()=>Pr,isTimeout:()=>uo,jsonStringify:()=>Ae,jsonToUint8Array:()=>be,last:()=>Co,lazyListener:()=>ei,linkifyPlainText:()=>Po,loggerStackTraceDebug:()=>Dr,messages:()=>Xo,moveSortWeight:()=>Ao,parseDate:()=>Ho,parseOrderby:()=>Wt,parseQuery:()=>Mo,platform:()=>fi,promisify:()=>H,qid:()=>Wo,randomBoolean:()=>mo,randomFloat:()=>ho,randomInt:()=>yo,randomUint8Array:()=>J,renderMessages:()=>ce,roundDown:()=>Yn,roundHalfAwayFromZero:()=>to,roundHalfDown:()=>ro,roundHalfEven:()=>no,roundHalfOdd:()=>eo,roundHalfTowardsZero:()=>oo,roundHalfUp:()=>Xn,roundUp:()=>Qn,setupEnv:()=>Ti,size:()=>ko,sleep:()=>io,sortedItems:()=>ur,sortedOrderby:()=>ln,startSortWeight:()=>rt,stringToBoolean:()=>Nn,stringToFloat:()=>Hn,stringToInteger:()=>Bn,stringToPath:()=>wr,stringToUInt8Array:()=>Ge,suid:()=>Ko,suidBytes:()=>dr,suidBytesDate:()=>gr,suidDate:()=>Qo,throttle:()=>mi,timeout:()=>ao,timeoutReached:()=>Ke,timoutError:()=>Qe,toBase64:()=>Yr,toBase64Url:()=>Xr,toBool:()=>qn,toCamelCase:()=>On,toCapitalize:()=>Yt,toCapitalizeWords:()=>Fn,toFloat:()=>jn,toHex:()=>Qr,toHumanReadableUrl:()=>lr,toInt:()=>Gn,toPath:()=>Ue,toString:()=>zn,toUint8Array:()=>M,toValidFilename:()=>tt,today:()=>fo,tryTimeout:()=>Ye,uname:()=>j,unescapeHTML:()=>go,useAsyncMutex:()=>ii,useBase:()=>$,useDefer:()=>Fo,useDispose:()=>cr,useDisposer:()=>Oo,useEventListener:()=>No,useExitHandler:()=>pi,useInterval:()=>Ro,useLevelFilter:()=>q,useMessageHub:()=>ri,useMutex:()=>oi,useNamespaceFilter:()=>F,usePool:()=>di,usePubSub:()=>ni,useTimeout:()=>$o,uuid:()=>te,uuid32bit:()=>zo,uuidB32:()=>qo,uuidBytes:()=>st,uuidv4:()=>Zo,valueToBoolean:()=>er,valueToFloat:()=>rr,valueToInteger:()=>tr,valueToPath:()=>Tr,valueToString:()=>Se,waitOn:()=>lo});function V(e){return e!=null&&typeof e=="object"}o(V,"isObject");function Ne(e){return Object(e)!==e}o(Ne,"isPrimitive");function It(e){return Array.isArray(e)}o(It,"isArray");function jr(e){return V(e)&&!It(e)}o(jr,"isRecord");function Gr(e){return typeof e=="string"}o(Gr,"isString");function zr(e){return typeof e=="number"}o(zr,"isNumber");function qr(e){return typeof e=="number"&&Number.isInteger(e)}o(qr,"isInteger");function Jr(e){return typeof e=="number"&&Number.isSafeInteger(e)}o(Jr,"isSafeInteger");function Wr(e){return typeof e=="boolean"}o(Wr,"isBoolean");function _r(e){return e==null}o(_r,"isNullOrUndefined");function ue(e,t,r=new WeakSet){if(e===t||r.has(t))return!0;if(Ne(t)||r.add(t),!(e instanceof Object)||!(t instanceof Object)||e.constructor!==t.constructor||e.length!==t.length)return!1;for(let n in e){if(!e.hasOwnProperty(n))continue;if(!t.hasOwnProperty(n))return!1;let i=e[n],s=t[n];if(!ue(i,s,r))return!1}for(let n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}o(ue,"deepEqual");function Ut(e,...t){for(let r of t)V(e)||(e={}),r!=null&&Object.keys(r).forEach(n=>{let i=e[n],s=r[n];Array.isArray(i)&&Array.isArray(s)?e[n]=i.concat(s):V(i)&&V(s)?e[n]=Ut(Object.assign({},i),s):e[n]=s});return e}o(Ut,"deepMerge");function Ot(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}o(Ot,"getNamespaceFilterString");var Ft,$t,Zr=Ot(typeof process!="undefined"?(Ft=process.env.ZEED)!=null?Ft:process.env.DEBUG:typeof localStorage!="undefined"?($t=localStorage.zeed)!=null?$t:localStorage.debug:"*");function F(e=Zr){let t,r=[],n=[];if(!e)t=o(function(i){return!1},"fn");else if(e==="*")t=o(function(i){return!0},"fn");else{let i,s=e.split(/[\s,]+/),l=s.length;for(i=0;i<l;i++){if(!s[i])continue;let a=s[i].replace(/\*/g,".*?");a[0]==="-"?r.push(new RegExp("^"+a.substr(1)+"$")):n.push(new RegExp("^"+a+"$"))}t=o(function(a){if(r.length===0&&n.length===0)return!0;let u,c;for(u=0,c=r.length;u<c;u++)if(r[u].test(a))return!1;for(u=0,c=n.length;u<c;u++)if(n[u].test(a))return!0;return!1},"fn")}return t.accept=n,t.reject=r,t.filter=e,t}o(F,"useNamespaceFilter");var Rt,Nt,Bt,Ht,Vr=typeof process!="undefined"?(Nt=(Rt=process.env.ZEED_LEVEL)!=null?Rt:process.env.LEVEL)!=null?Nt:process.env.DEBUG_LEVEL:typeof localStorage!="undefined"?(Ht=(Bt=localStorage.zeed_level)!=null?Bt:localStorage.level)!=null?Ht:localStorage.debug_level:void 0;function q(e=Vr){let t=L.all;if(typeof e=="string"){let r=Be[e.toLocaleLowerCase().trim()];r!=null&&(t=r)}else typeof e=="number"&&(t=e);return r=>r>=t}o(q,"useLevelFilter");var L=(a=>(a[a.all=-1]="all",a[a.debug=0]="debug",a[a.info=1]="info",a[a.warn=2]="warn",a[a.error=3]="error",a[a.fatal=4]="fatal",a[a.off=1/0]="off",a))(L||{}),Be={"*":-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 He(e=""){let t=[le()],r=2,n=o(u=>!0,"logCheckNamespace"),i=!1,s=l;function l(u=""){p.extend=function(f){return s(u?`${u}:${f}`:f)};let c=o(f=>{if(p.active===!0&&f.level>=a.level&&f.level>=p.level&&n(u))for(let m of t)m&&m(f)},"emit");function p(...f){c({name:u,messages:f,level:0})}return o(p,"log"),p.active=!0,p.level=-1,p.debug=function(...f){c({name:u,messages:f,level:0})},p.info=function(...f){c({name:u,messages:f,level:1})},p.warn=function(...f){c({name:u,messages:f,level:2})},p.error=function(...f){c({name:u,messages:f,level:3})},p.assert=function(f,...m){f||(typeof console!==void 0&&(console.assert?console.assert(f,...m):console.error(`Assert did fail with: ${f}`,...m)),c({name:u,messages:m||[`Assert did fail with: ${f}`],level:r}))},p.assertEqual=function(f,m,...y){let x=ue(f,m);x||p.assert(x,`Assert did fail. Expected ${m} got ${f}`,m,f,...y)},p.assertNotEqual=function(f,m,...y){let x=ue(f,m);x&&p.assert(x,`Assert did fail. Expected ${m} not to be equal with ${f}`,m,f,...y)},p}o(l,"LoggerBaseFactory");function a(u=""){return s(u)}return o(a,"Logger"),a.registerHandler=function(u){t.push(u)},a.setFilter=function(u){n=F(u)},a.setLock=(u=!0)=>i=u,a.setHandlers=function(u=[]){s!==l&&(s=l),!i&&(t=[...u].filter(c=>typeof c=="function"))},a.level=-1,a.setLogLevel=function(u=-1){i||(a.level=u)},a.setFactory=function(u){i||(s=u)},a}o(He,"LoggerContext");function le(e={}){let{level:t=void 0,filter:r=void 0,colors:n=!0,levelHelper:i=!1,nameBrackets:s=!0,padding:l=16}=e,a=F(r),u=q(t);return c=>{if(!u(c.level)||!a(c.name))return;let p=c.name?`[${c.name}]`:"";switch(c.level){case L.info:console.info(`I|* ${p}`,...c.messages);break;case L.warn:console.warn(`W|** ${p}`,...c.messages);break;case L.error:console.error(`E|*** ${p}`,...c.messages);break;default:console.debug(`D| ${p}`,...c.messages);break}}}o(le,"LoggerConsoleHandler");function Kr(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;if(typeof globalThis!="undefined")return globalThis;throw new Error("unable to locate global object")}o(Kr,"_global");function K(){let e=Kr();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}o(K,"getGlobalContext");var Q;function je(){let e=He();return e.setHandlers([le()]),e}o(je,"getLoggerContext");try{let e=K();e!=null?(e==null?void 0:e.logger)==null?(Q=je(),e.logger=Q):Q=e.logger:Q=je()}catch{Q=je()}var b=Q;var jt=b("bin"),he;function Ge(e){return typeof TextEncoder=="undefined"?new Uint8Array:(he!=null?he:he=new TextEncoder).encode(e.normalize("NFC"))}o(Ge,"stringToUInt8Array");var xe;function Gt(e){return typeof TextDecoder=="undefined"?"":(xe!=null?xe:xe=new TextDecoder("utf-8",{ignoreBOM:!0})).decode(e).normalize("NFC")}o(Gt,"Uint8ArrayToString");function M(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Ge(e):e.length?new Uint8Array(e):e}o(M,"toUint8Array");function Qr(e){if(typeof Buffer!="undefined")return Buffer.from(M(e)).toString("hex");let t="0123456789abcdef",r="";for(let n of[...M(e)])r+=t[n>>4]+t[n&15];return r}o(Qr,"toHex");function Yr(e){let t=M(e);if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64");let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return btoa(r)}o(Yr,"toBase64");function Xr(e){let t=M(e);if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64url");let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_")}o(Xr,"toBase64Url");function ze(e,t){if(e.byteLength!==t.byteLength)return!1;let r=M(e),n=M(t);for(let i=0;i<r.length;i++)if(r[i]!==n[i])return!1;return!0}o(ze,"equalBinary");function be(e){try{return Ge(JSON.stringify(e))}catch(t){throw jt.warn("jsonToUint8Array",e),t}}o(be,"jsonToUint8Array");function we(e){try{return JSON.parse(Gt(e))}catch(t){throw jt.warn("Uint8ArrayToJson",e),t}}o(we,"Uint8ArrayToJson");function J(e=16){let t=new Uint8Array(e);if(typeof crypto!="undefined"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let r=0;r<e;r++)t[r]=Math.floor(Math.random()*256);return t}o(J,"randomUint8Array");var zt="SHA-256",qe="AES-GCM",qt="PBKDF2";async function en(e,t=zt){return await crypto.subtle.digest(t,M(e))}o(en,"digest");async function tn(e,t={}){var i;let r=M(e),n=await crypto.subtle.importKey("raw",r,qt,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:qt,salt:t.salt?M(t.salt):new Uint8Array(0),iterations:(i=t.iterations)!=null?i:1e5,hash:zt},n,{name:qe,length:256},!0,["encrypt","decrypt"])}o(tn,"deriveKeyPbkdf2");var Te=new Uint8Array([1,1]);async function Je(e,t){let r=J(12),n=await crypto.subtle.encrypt({name:qe,iv:r},t,e),i=new Uint8Array(n),s=Te.length+r.length+i.length,l=new Uint8Array(s),a=0;return l.set(Te,a),a+=Te.length,l.set(r,a),a+=r.length,l.set(i,a),l}o(Je,"encrypt");async function We(e,t){let r=e.subarray(0,2);if(!ze(r,Te))return Promise.reject(`Unknown magic ${r}`);let n=e.subarray(2,2+12),i=e.subarray(2+12,e.length),s=await crypto.subtle.decrypt({name:qe,iv:n},t,i);return new Uint8Array(s)}o(We,"decrypt");var Jt=",",rn=!1,nn=!0;function on(e){return/^([-+])?([0-9]+(\.[0-9]+)?|Infinity)$/.test(e)?Number(e):NaN}o(on,"filterFloat");function sn(e){return nn&&e==null?"":rn?'="'+String(e).replace(/"/g,'""')+'"':!isNaN(on(e))&&isFinite(e)?parseFloat(e):'"'+String(e).replace(/"/g,'""')+'"'}o(sn,"escape");function an(e,t){let r="";t&&(r=t.join(Jt)+`\r
|
|
2
|
-
`);for(let n=0;n<e.length;n++)r+=e[n].map(
|
|
3
|
-
`;return r}o(
|
|
4
|
-
${i.stack}`:`${i.name||"Error"}: ${i.message}`:n?Ae(i,null,2):Ae(i):String(i))}o(nr,"formatMessages");function ce(e,t={}){return nr(e,t).join(" ")}o(ce,"renderMessages");function Jn(e){try{return decodeURIComponent(escape(e))}catch{}return e}o(Jn,"fixBrokenUth8String");var Wn={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:Kn,fromCents:!1},or=o(e=>Math.round(e),"round"),Ze=o(e=>Math.pow(10,e),"pow"),_n=o((e,t)=>or(e/t)*t,"rounding"),Zn=/(\d)(?=(\d{3})+\b)/g,Vn=/(\d)(?=(\d\d)+\d\b)/g;function B(e,t={}){return new R(e,t)}o(B,"currency");var Me=class{constructor(t,r={}){var l;let n=Object.assign({},Wn,r),i=Ze((l=n.precision)!=null?l:2),s=Pe(t,n);this.intValue=s,this.value=s/i,n.increment=n.increment||1/i,n.useVedic?n.groups=Vn:n.groups=Zn,this._settings=n,this._precision=i}add(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r+=Pe(t,n))/(n.fromCents?1:i),n)}subtract(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r-=Pe(t,n))/(n.fromCents?1:i),n)}multiply(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r*=t)/(n.fromCents?1:Ze(i)),n)}divide(t){let{intValue:r,_settings:n}=this;return B(r/=Pe(t,n,!1),n)}distribute(t){let{intValue:r,_precision:n,_settings:i}=this,s=[],l=Math[r>=0?"floor":"ceil"](r/t),a=Math.abs(r-l*t),u=i.fromCents?1:n;for(;t!==0;t--){let c=B(l/u,i);a-- >0&&(c=c[r>=0?"add":"subtract"](1/u)),s.push(c)}return s}dollars(){return~~this.value}cents(){let{intValue:t,_precision:r}=this;return~~(t%r)}format(t){let{_settings:r}=this;return typeof t=="function"?t(this,r):r.format(this,Object.assign({},r,t))}toString(){let{intValue:t,_precision:r,_settings:n}=this;return _n(t/r,n.increment).toFixed(n.precision)}toJSON(){return this.value}static sum(...t){return Y(t).reduce((r,n)=>B(r).add(n),this.zero)}static avg(...t){let r=Y(t);return r.reduce((n,i)=>B(n).add(i),this.zero).divide(r.length)}},R=Me;o(R,"Currency"),R.zero=new Me(0),R.one=new Me(1);function Pe(e,t,r=!0){let n=0,{decimal:i,errorOnInvalid:s,precision:l,fromCents:a}=t,u=Ze(l),c=typeof e=="number";if(e instanceof R&&a)return e.intValue;if(c||e instanceof R)n=e instanceof R?e.value:e;else if(typeof e=="string"){let p=new RegExp("[^-\\d"+i+"]","g"),f=new RegExp("\\"+i,"g");n=e.replace(/\((.*)\)/,"-$1").replace(p,"").replace(f,"."),n=n||0}else{if(s)throw Error("Invalid Input");n=0}return a||(n*=u,n=n.toFixed(4)),r?or(n):n}o(Pe,"parse");function Kn(e,t){let{pattern:r,negativePattern:n,symbol:i,separator:s,decimal:l,groups:a}=t,u=(""+e).replace(/^-/,"").split("."),c=u[0],p=u[1];return(e.value>=0?r:n).replace("!",i).replace("#",c.replace(a,"$1"+s)+(p?l+p:""))}o(Kn,"format");var X=o(e=>Math.abs(e)%1===.5,"isHalf"),Ve=o(e=>e%2===0,"isEven"),Qn=o(e=>Math.ceil(e),"roundUp"),Yn=o(e=>Math.floor(e),"roundDown"),Xn=o(e=>Math.round(e),"roundHalfUp"),eo=o(e=>{let t=Math.round(e);return X(e)&&Ve(t)?t-1:t},"roundHalfOdd"),to=o(e=>X(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),ro=o(e=>X(e)?Math.floor(e):Math.round(e),"roundHalfDown"),no=o(e=>{let t=Math.round(e);return X(e)?Ve(t)?t:t-1:t},"roundHalfEven"),oo=o(e=>X(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");var{warn:ir}=b("zeed:promise");async function io(e){return new Promise(t=>setTimeout(t,e))}o(io,"sleep");async function so(){return new Promise(e=>setTimeout(e,0))}o(so,"immediate");var Ke=Symbol("timeout");async function ao(e,t,r=Ke){return new Promise(async(n,i)=>{let s=!1,l=setTimeout(()=>{s=!0,n(r)},t);try{let a=await e;clearTimeout(l),s||n(a)}catch(a){clearTimeout(l),s||i(a)}})}o(ao,"timeout");var Qe=new Error("Timeout reached");function uo(e){return e===Ke||e===Qe}o(uo,"isTimeout");async function Ye(e,t){return t<=0?await e:new Promise(async(r,n)=>{let i=!1,s=setTimeout(()=>{i=!0,n(Qe)},t);try{let l=await e;clearTimeout(s),i||r(l)}catch(l){clearTimeout(s),i||n(l)}})}o(Ye,"tryTimeout");function lo(e,t,r=1e3){return new Promise((n,i)=>{let s=o(u=>{a&&(clearTimeout(a),l(),n(u))},"fn"),l=o(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):ir("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{l(),i(new Error("Did not response in time"))},r);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):ir("No listener method found for",e)})}o(lo,"waitOn");function I(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}o(I,"isPromise");function H(e){return Promise.resolve(e)}o(H,"promisify");var Xe=1e3*60*60*24,A=class{constructor(t){var r;if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=(r=A.from(t))==null?void 0:r.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 A(t)}static fromString(t){return new A(+t.replace(/[^0-9]/g,""))}static fromDate(t,r=!1){return r?A.fromString(t.toISOString().substr(0,10)):new A(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return A.fromDate(t,!0)}static from(t,r=!1){if(typeof t=="number")return new A(t);if(typeof t=="string")return A.fromString(t);if(t instanceof Date)return A.fromDate(t,r);if(t instanceof A)return t}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let r=String(this.days);return r.slice(0,4)+t+r.slice(4,6)+t+r.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)}dayOffset(t){return A.fromDateGMT(new Date(this.toDateGMT().getTime()+t*Xe))}daysUntil(t){var r;return Math.round((((r=new A(t))==null?void 0:r.toDateGMT().getTime())-this.toDateGMT().getTime())/Xe)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};o(A,"Day");async function co(e,t,r){let n=A.from(e),i=A.from(t);for(;n&&i&&(n==null?void 0:n.days)<=(i==null?void 0:i.days);){let s=r(n);I(s)&&await s,n=n.dayOffset(1)}}o(co,"forEachDay");function fo(){return new A}o(fo,"today");function po(e){return new A(e)}o(po,"day");var et=o(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),"escapeHTML"),go=o(e=>e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),"unescapeHTML");function mo(e=.25){return Math.random()<e}o(mo,"randomBoolean");function yo(e=100,t=0){return t+Math.floor(Math.random()*(e-t))}o(yo,"randomInt");function ho(e=100,t=0){return t+Math.random()*(e-t)}o(ho,"randomFloat");function xo(e,t,r){return Math.max(e,Math.min(r,t))}o(xo,"between");var bo=100,sr=/[\u0000-\u001F\u0080-\u009F]/g,wo=/^\.+/,To=/\.+$/;function ar(){return/[<>:"/\\|?*\u0000-\u001F]/g}o(ar,"filenameReservedRegex");function Lo(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}o(Lo,"windowsReservedNameRegex");function tt(e){if(typeof e!="string")throw new TypeError("Expected a string");let t="_";if(ar().test(t)&&sr.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(ar(),t).replace(sr,t).replace(wo,t).replace(To,""),e=Lo().test(e)?e+t:e,e.slice(0,bo)}o(tt,"toValidFilename");var Eo=/[\\\-\[\]\/{}()*+?.^$|]/g;function vo(e){return e?e instanceof RegExp?e.source:e.replace(Eo,"\\$&"):""}o(vo,"escapeRegExp");function rt(e){return e.reduce((t,r)=>Math.min(t,r.sort_weight||0),0)-1-Math.random()}o(rt,"startSortWeight");function nt(e){return e.reduce((t,r)=>Math.max(t,r.sort_weight||0),0)+1+Math.random()}o(nt,"endSortWeight");function Ao(e,t,r){let n=r.length,i=e<t;if(n<=0||e>=n-1)return nt(r);if(e<=0)return rt(r);r=ur([...r]);let s=i?-1:0,l=r[e+s].sort_weight||0,u=(r[e+s+1].sort_weight||0)-l;if(u===0)return i?rt(r):nt(r);let c=l+u/2,p=u*.01*(Math.random()-.5);return c+p}o(Ao,"moveSortWeight");function ur(e){return e.sort((t,r)=>(t.sort_weight||0)-(r.sort_weight||0)),e}o(ur,"sortedItems");var So=/((?:(?:(?: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 Po(e){return e.split(So).map((t,r)=>{let n=et(t);return r%2?`<a target="_blank" href="${n}">${lr(n)}</a>`:n}).join("")}o(Po,"linkifyPlainText");function lr(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}o(lr,"toHumanReadableUrl");function ot(e){let t=[];for(let[r,n]of Object.entries(e))if(n!=null){Array.isArray(n)||(n=[n]);for(let i of n)i!=null&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(i.toString()||""))}return t.join("&")}o(ot,"encodeQuery");function Mo(e){let t={},r=(e[0]==="?"?e.substr(1):e).split("&");for(let n=0;n<r.length;n++){let i=r[n].split("="),s=decodeURIComponent(i[0]),l=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(l)):t[s]=l}return t}o(Mo,"parseQuery");function ko(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}o(ko,"size");function Co(e){return e!=null&&e.length>0?e[e.length-1]:void 0}o(Co,"last");function Do(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:(e==null?void 0:e.size)!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.error("Failed to check if empty for",e,t)}return!0}o(Do,"empty");function W(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(W,"cloneObject");function Io(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(Io,"cloneJsonObject");async function Uo(e){typeof e=="function"?await H(e()):I(e)?await e:typeof e.dispose=="function"?await H(e.dispose()):I(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await H(e.cleanup()):I(e.cleanup)&&await e.cleanup}o(Uo,"callDisposer");function cr(){let e=[],t=o(async i=>{e.includes(i)&&(ve(e,s=>s!==i),await Uo(i))},"untrack"),r=o(async()=>{for(;e.length>0;)await t(e[0])},"dispose"),n=o(i=>(e.unshift(i),()=>t(i)),"track");return Object.assign(r,{track:n,add:n,untrack:t,dispose:r,exec:r,getSize(){return e.length}})}o(cr,"useDispose");var Oo=cr;function Fo(e={}){let{mode:t="fifo"}=e,r=[],n=o(async(s=!1)=>{for(;r.length>0;){let l=r[0];if(ve(r,a=>a!==l),typeof l=="function"){let a=l();if(I(a)){if(s)throw new Error(`Expected sync only function, but found async: ${l}`);await a}}else if(I(l)){if(s)throw new Error(`Expected sync only function, but found async: ${l}`);await l}else throw new Error(`Unhandled disposable: ${l}`)}},"exec");return Object.assign(n,{add:o(s=>{t==="lifo"?r.unshift(s):r.push(s)},"add"),exec:n,getSize(){return r.length}})}o(Fo,"useDefer");function $o(e,t=0){let r=setTimeout(e,t);return()=>{r&&(clearTimeout(r),r=void 0)}}o($o,"useTimeout");function Ro(e,t){let r=setInterval(e,t);return()=>{r&&(clearInterval(r),r=void 0)}}o(Ro,"useInterval");function No(e,t,r,...n){return e==null?()=>{}:(e.on?e.on(t,r,...n):e.addEventListener&&e.addEventListener(t,r,...n),()=>{e.off?e.off(t,r,...n):e.removeEventListener&&e.removeEventListener(t,r,...n)})}o(No,"useEventListener");function Bo(e=window.location.hostname){return["localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}o(Bo,"isLocalHost");var ee=o(()=>typeof performance!="undefined"?performance.now():new Date().getTime(),"getTimestamp");function it(e){return e>999?(e/1e3).toFixed(1)+"s":e.toFixed(2)+"ms"}o(it,"formatMilliseconds");function Ho(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let r=null;if(t.includes(":"))try{r=new Date(t)}catch{}if(!(r instanceof Date)){let n=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);n&&(r=new Date(+n[1],+n[2]-1,+n[3],12,0))}if(r instanceof Date)return r}}}o(Ho,"parseDate");var{encode:fr,decode:jo}=$(62),{encode:Go}=$(32);function st(){return J(16)}o(st,"uuidBytes");var zo=o(()=>new Uint32Array(J(4))[0],"uuid32bit");function te(){return fr(st(),22)}o(te,"uuid");function qo(){return Go(st(),26)}o(qo,"uuidB32");var at={};function j(e="id"){return at[e]==null&&(at[e]=0),`${e}-${at[e]++}`}o(j,"uname");var Jo=0;function Wo(){return`id-${Jo++}`}o(Wo,"qid");var _o="10000000-1000-4000-8000-100000000000",Zo=o(()=>_o.replace(/[018]/g,e=>(e^J(1)[0]&15>>e/4).toString(16)),"uuidv4"),pr=16e11;function Vo(e){var t=new Uint8Array([0,0,0,0,0,0]);let r=t.length-1;for(var n=0;n<t.length;n++){var i=e&255;t[r-n]=i,e=(e-i)/256}return t}o(Vo,"longToByteArray");function dr(){let e=ee()-pr;return new Uint8Array([...Vo(e),...J(10)])}o(dr,"suidBytes");function Ko(){return fr(dr(),22)}o(Ko,"suid");function Qo(e){return gr(jo(e,16))}o(Qo,"suidDate");function gr(e){return new Date(pr+e.slice(0,6).reduce((t,r)=>t*256+r,0))}o(gr,"suidBytesDate");var re=b("zeed:emitter"),N=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.call=new Proxy({},{get:(t,r)=>(...n)=>this.emit(r,...n)})}async emit(t,...r){let n=!1;try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...r)),i.length>0){let s=i.map(l=>{try{return H(l(...r))}catch(a){re.warn("emit warning:",a)}});n=!0,await Promise.all(s)}}catch(i){re.error("emit exception",i)}return n}onAny(t){this.subscribersOnAny.push(t)}on(t,r){let n=this.subscribers[t]||[];return n.push(r),this.subscribers[t]=n,()=>{this.off(t,r)}}onCall(t){for(let[r,n]of Object.entries(t))this.on(r,n)}once(t,r){let n=o(async(...i)=>(this.off(t,n),await H(r(...i))),"onceListener");return this.on(t,n),()=>{this.off(t,r)}}off(t,r){return this.subscribers[t]=(this.subscribers[t]||[]).filter(n=>r&&n!==r),this}removeAllListeners(t){return this.subscribers={},this}dispose(){this.subscribers={},this.subscribersOnAny=[]}};o(N,"Emitter");function Yo(){let e=K().emitter;return e||(e=new N,K().emitter=e),e}o(Yo,"getGlobalEmitter");var Xo=new N;function ei(e,t){let r=Math.round(Math.random()*100);var n=[],i;let s=o((a,u)=>{let c={key:a,obj:u};n.push(c),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):re.error(r,"Cannot listen to key"):e.onAny?e.onAny((a,u)=>{s(a,u)}):re.error(r,"cannot listen to all for",e),o((a,u=!0)=>new Promise((c,p)=>{a||(a=t,a||n.length&&(a=n[0].key)),i=o(()=>{for(;n.length>0;){let f=n.shift();if(f.key===a)i=void 0,c(f.obj);else{if(u){re.warn(r,`Unhandled event ${a} with value: ${f.obj}`);continue}p(`Expected ${a}, but found ${f.key} with value=${f.obj}`),re.error(r,`Unhandled event ${a} with value: ${f.obj}`)}break}},"lazyResolve"),i()}),"on")}o(ei,"lazyListener");var ke=class extends N{constructor(){super(...arguments);this.id=te()}close(){}};o(ke,"Channel");var fe=class extends ke{constructor(){super(...arguments);this.isConnected=!0}postMessage(t){var r;(r=this.other)==null||r.emit("message",{data:t,origin:"local",lastEventId:te()})}};o(fe,"LocalChannel");function ti(){let e=new fe,t=new fe;return e.other=t,t.other=e,[e,t]}o(ti,"fakeWorkerPair");var _=class{async encode(t){return be(t)}async decode(t){return we(t)}};o(_,"JsonEncoder");var ut=class{constructor(t){this.key=t}async encode(t){let r=be(t);return await Je(r,this.key)}async decode(t){let r=await We(t,this.key);return we(r)}};o(ut,"CryptoEncoder");var lt=o((e,t,r={})=>new Proxy(r,{get:(n,i)=>i in n?n[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function ri(e={}){let{name:t=j("hub"),encoder:r=new _,retryAfter:n=1e3,ignoreUnhandled:i=!0}=e,s=b(t),l={},a,u=[],c,p={},f=o(()=>{clearTimeout(c)},"dispose"),m=o(async()=>{if(clearTimeout(c),a){if(a.isConnected)for(;u.length;){let g=u[0];try{a.postMessage(await r.encode(g)),u.shift()}catch(h){s.warn("postMessage",h);break}}u.length>0&&n>0&&(c=setTimeout(m,n))}},"postNext"),y=o(async g=>{s("enqueue postMessage",g),u.push(g),await m()},"postMessage"),x=o(async g=>{a=g,a.on("connect",m),a.on("message",async h=>{s("onmessage",typeof h);let{name:S,args:E,id:v,result:D,error:G}=await r.decode(h.data);if(S){s(`name ${S} id ${v}`);try{if(l[S]==null)throw new Error(`handler for ${S} was not found`);let C=l[S](...E);I(C)&&(C=await C),s(`result ${C}`),v&&y({id:v,result:C})}catch(C){let z=C instanceof Error?C:new Error(Se(C));s.warn("execution error",z.name),y({id:v,error:{message:z.message,stack:z.stack,name:z.name}})}}else if(v)if(s(`response for id=${v}: result=${D}, error=${G}`),p[v]==null)D===void 0?s(`skip response for ${v}`):s.warn(`no response hook for ${v}`);else{let[C,z]=p[v];if(C&&z)if(delete p[v],G){let ye=new Error(G.message);ye.stack=G.stack,ye.name=G.name,s.warn("reject",ye.name),z(ye)}else s("resolve",D),C(D)}else i||s.warn("Unhandled message",h)}),m()},"connect"),w=o(async(g,h,S={})=>{let{timeout:E=5e3}=S,v=te();return y({name:g,args:h,id:v}),Ye(new Promise((D,G)=>p[v]=[D,G]),E)},"fetchMessage");return e.channel&&x(e.channel),{dispose:f,connect:x,listen(g){Object.assign(l,g)},send(){return lt(w,{},{options(g){return lt(w,O({},g))}})}}}o(ri,"useMessageHub");var Ce=class extends N{constructor(t){super();this.publish=this.emit;this.subscribe=this.on;var l;let{name:r,encoder:n=new _,channel:i,debug:s=!1}=t;this.channel=i,this.encoder=n,this.debug=s,this.name=(l=r!=null?r:this.channel.id)!=null?l:j("pubsub"),this.log=b(`${this.shortId}`),this.debug&&(this.channel.on("connect",()=>{this.log("channel connected")}),this.channel.on("disconnect",()=>{this.log("channel disconnected")})),this.channel.on("message",async({data:a})=>{let u=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${u==null?void 0:u.event}, info=`,u):this.log(`channel message, event=${u==null?void 0:u.event}`),u){let{event:c,args:p}=u;await this.emitSuper(c,...p)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(t,...r){return await super.emit(t,...r)}async emit(t,...r){try{if(this.debug?this.log(`emit(${t})`,t):this.log(`emit(${t})`,r.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let n=await this.encoder.encode({event:t,args:r});return this.channel.postMessage(n),!0}catch(n){this.log.warn(`emit(${t})`,n)}return!1}};o(Ce,"PubSub");function ni(e){return new Ce(e)}o(ni,"usePubSub");var ct=U(require("util/types"),1);function oi(){let e=!0;return(t,r)=>{let n=!1;if(e){e=!1;try{t(),n=!0}finally{e=!0}}else r!==void 0&&r();return n}}o(oi,"useMutex");function ii(){let e=!0;return async(t,r)=>{let n=!1;if(e){e=!1;try{let i=t();(0,ct.isPromise)(i)&&await i,n=!0}finally{e=!0}}else if(r!==void 0){let i=r();(0,ct.isPromise)(i)&&await i}return n}}o(ii,"useAsyncMutex");var ne=b("network"),De={cache:"no-cache",redirect:"follow"};async function ft(e,t={},r=fetch){try{let n=await r(e,t);if(n.status<400)return n;try{ne.warn(`Fetch of ${e} with ${t} returned status=${n.status}`),ne.warn(`Response: ${await n.text()}`)}catch(i){ne.error("Exception:",i)}}catch(n){ne.error("fetchBasic",n)}}o(ft,"fetchBasic");async function si(e,t={},r=fetch){try{let n=await ft(e,O(ae(O({method:"GET"},De),{headers:{}}),t),r);if(n)return await n.json()}catch(n){ne.error("fetchJSON error:",n)}}o(si,"fetchJson");function ai(e,t="POST"){return ae(O({method:t},De),{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:ot(e)})}o(ai,"fetchOptionsFormURLEncoded");function ui(e,t="POST"){return ae(O({method:t},De),{headers:{"Content-Type":"application/json; charset=utf-8",Accept:"application/json"},body:JSON.stringify(e)})}o(ui,"fetchOptionsJson");async function li(e,t={},r=fetch){try{let n=await ft(e,O(ae(O({method:"GET"},De),{headers:{}}),t),r);if(n)return await n.text()}catch(n){ne.error("fetchHTML error:",n)}}o(li,"fetchText");function pt(){if(typeof window!="undefined")return window}o(pt,"getWindow");function mr(){if(typeof navigator!="undefined")return navigator}o(mr,"getNavigator");function ci(){var e;return((e=pt())!=null?e:typeof WorkerGlobalScope!="undefined")?self:typeof global!="undefined"?global:Function("return this;")()}o(ci,"getGlobal");var T=mr(),P=pt();function yr(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){var t,r,n,i,s,l,a,u,c;return e.ios=((t=T==null?void 0:T.platform)==null?void 0:t.match(/(iPhone|iPod|iPad)/i))!=null,e.macos=!!((r=T==null?void 0:T.platform)==null?void 0:r.startsWith("Mac")),e.windows=!!((n=T==null?void 0:T.platform)==null?void 0:n.startsWith("Win")),e.beaker=(P==null?void 0:P.beaker)!=null,e.electron=(((s=(i=T==null?void 0:T.userAgent)==null?void 0:i.toLowerCase())==null?void 0:s.indexOf(" electron/"))||-1)>-1&&!e.beaker,e.wkwebview=((l=P==null?void 0:P.webkit)==null?void 0:l.messageHandlers)!=null,e.pwa=(T==null?void 0:T.serviceWorker)!=null,e.pwaInstalled=(T==null?void 0:T.standalone)||((u=(a=P==null?void 0:P.matchMedia)==null?void 0:a.call(P,"(display-mode: standalone)"))==null?void 0:u.matches),e.node=typeof process!="undefined"&&((c=process==null?void 0:process.release)==null?void 0:c.name)==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope,e.jest=typeof jest!="undefined",e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=P&&"ontouchstart"in P||((T==null?void 0:T.maxTouchPoints)||0)>1||(T==null?void 0:T.msPointerEnabled)&&(P==null?void 0:P.MSGesture)||(P==null?void 0:P.DocumentTouch)&&document instanceof DocumentTouch,e}o(yr,"detect");var hr=o(()=>typeof window!="undefined"&&globalThis===window,"isBrowser"),fi=yr();function pi(e){hr()?window.addEventListener("beforeunload",e):typeof process!="undefined"&&process.on("exit",()=>e)}o(pi,"useExitHandler");function di(e={}){let{maxParallel:t=3}=e,r=0,n=0,i={};function s(){if(r>=t)return;let a=Object.values(i).filter(u=>!u.running);if(a.length>0){let u;for(let c of a)(u==null||c.priority<u.priority)&&(u=c);u&&(u.running=!0,++r,u.task().then(c=>{(u==null?void 0:u.id)&&delete i[u.id],--r,s()}).catch(c=>{(u==null?void 0:u.id)&&delete i[u.id],--r,s()}))}}o(s,"performNext");function l(a){let u=i[a];u&&u.running!==!0&&delete i[a]}return o(l,"cancel"),{cancel:l,enqueue(a,u){return i[a]==null&&(i[a]={id:a,task:u,priority:++n,running:!1},s()),()=>l(a)}}}o(di,"usePool");var gi=b("zeed:queue"),dt=class{constructor(t={}){this.queue=[];this.isPaused=!1;this.waitToFinish=[];let{name:r=j("queue"),logLevel:n}=t;this.name=r,this.log=b(`zeed:queue:${r}`),this.log.level=n!=null?n:L.off}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.isPaused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.isPaused;){let t=this.queue.shift();if(this.log(`performNext => ${t==null?void 0:t.name}`),t==null)break;let{name:r,task:n,resolve:i}=t;this.currentTask=n();let s;try{this.log.info(`start task ${r}`),s=await this.currentTask,this.log(`finished task ${r} with result =`,s)}catch(l){gi.warn("Error performing task",l)}i(s),this.currentTask=void 0}for(;this.waitToFinish.length>0;)this.waitToFinish.shift()()}async enqueue(t,r={}){let{immediate:n=!1,name:i=j(this.name)}=r;return n?(this.log.info(`immediate execution ${i}`),await t()):(this.log(`enqueue ${i}`),new Promise(s=>{this.queue.push({name:i,task:t,resolve:s}),this.performNext()}))}async enqueueReentrant(t,r={}){return this.enqueue(t,{immediate:this.currentTask!=null,name:r.name})}async cancelAll(t=!0){this.log("cancelAll");let r=this.queue.map(n=>n.resolve);this.queue=[],r.forEach(n=>n(void 0)),await this.wait()}async pause(){this.log("pause"),this.isPaused=!0,await this.wait()}resume(){this.log("resume"),this.isPaused=!1,this.performNext()}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.isPaused)))return new Promise(t=>{this.waitToFinish.push(t)})}};o(dt,"SerialQueue");var qa=b("zeed:memstorage"),gt=class{constructor(t={}){this.store={}}setItem(t,r){this.store[t]=W(r)}getItem(t){if(this.store.hasOwnProperty(t))return W(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};o(gt,"MemStorage");var oe=!1,ie=oe?b("zeed:throttle"):()=>{};function mi(e,t={}){let{delay:r=100,trailing:n=!0,leading:i=!0}=t,s=0,l=0,a=0,u=Date.now();function c(){s&&(clearTimeout(s),s=void 0)}o(c,"clearExistingTimeout");function p(...f){let m=Date.now(),y=this,x=m-l;function w(){let h=Date.now();return`total ${(h-u).toFixed(1)}ms - elapsed ${(h-l).toFixed(1)}ms - visited ${a}x`}o(w,"debugElapsed");function g(){a=0,l=Date.now(),e.apply(y,f)}if(o(g,"exec"),x>r||!s){oe&&ie("elapsed",w()),i&&(x>r?(oe&&ie("\u{1F680} leading",w()),g()):++a);let h=x>r?r:r-x;ie(`\u23F1 start timeout with ${h.toFixed(1)}ms}`,w()),c(),l=m,s=setTimeout(()=>{oe&&ie("\u23F1 reached timeout",w()),s=0,n&&(!i||a>0)&&(oe&&ie("\u{1F680} trailing",w()),g())},h)}else++a,oe&&ie("visited",w())}return o(p,"wrapper"),p.cancel=c,p.dispose=c,p}o(mi,"throttle");function yi(e,t={}){let{delay:r=100}=t,n=0;function i(){n&&(clearTimeout(n),n=0)}o(i,"clearExistingTimeout");function s(...l){let a=this;i(),n=setTimeout(()=>{n=0,e.apply(a,l)},r)}return o(s,"wrapper"),s.cancel=i,s.dispose=i,s}o(yi,"debounce");var Ie=U(require("crypto"),1);try{Ie.default&&Ie.default.webcrypto&&typeof globalThis!="undefined"&&typeof globalThis.crypto=="undefined"&&(globalThis.crypto=Ie.default.webcrypto)}catch(e){console.warn("Failed to polyfill webcrypto",e)}var pe=U(require("fs"),1),xr=U(require("path"),1),de=b("zeed:env"),hi=`
|
|
5
|
-
`,
|
|
6
|
-
`)}switch(o(m,"write"),a.level){case L.info:m(u,"I|* ",...f);break;case L.warn:m(u,"W|** ",...f);break;case L.error:m(u,"E|***",...f);break;default:m(u,"D| ",...f);break}}}o(
|
|
7
|
-
`))==null?void 0:t.map(n=>{let i=n.match(/^\s+at.*(\((.*)\)|file:\/\/(.*)$)/);if(i){let s=i[3]||i[2];return s.endsWith(")")&&(s=s.slice(0,-1)),s}}))==null?void 0:r.filter(n=>n!=null))||[]}o(
|
|
8
|
-
`).map(l=>l.trim()),s=i.findIndex(l=>e.some(a=>l.startsWith(a)));r=i[s+1],r&&(r=
|
|
9
|
-
`)}o(Re,"log");var me={BOLD:"[1m",UNBOLD:"[2m",RED:"[31m",GREEN:"[32m",BLUE:"[34m",PURPLE:"[35m",GRAY:"[37m",ORANGE:"[38;5;208m",UNCOLOR:"[0m"};var
|
|
1
|
+
var Dr=Object.create;var Z=Object.defineProperty,Ir=Object.defineProperties,Ur=Object.getOwnPropertyDescriptor,Or=Object.getOwnPropertyDescriptors,Fr=Object.getOwnPropertyNames,St=Object.getOwnPropertySymbols,$r=Object.getPrototypeOf,Pt=Object.prototype.hasOwnProperty,Rr=Object.prototype.propertyIsEnumerable;var Mt=(e,t,r)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,U=(e,t)=>{for(var r in t||(t={}))Pt.call(t,r)&&Mt(e,r,t[r]);if(St)for(var r of St(t))Rr.call(t,r)&&Mt(e,r,t[r]);return e},ae=(e,t)=>Ir(e,Or(t)),kt=e=>Z(e,"__esModule",{value:!0}),o=(e,t)=>Z(e,"name",{value:t,configurable:!0});var Nr=(e,t)=>{for(var r in t)Z(e,r,{get:t[r],enumerable:!0})},Ct=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fr(t))!Pt.call(e,i)&&(r||i!=="default")&&Z(e,i,{get:()=>t[i],enumerable:!(n=Ur(t,i))||n.enumerable});return e},O=(e,t)=>Ct(kt(Z(e!=null?Dr($r(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Br=(e=>(t,r)=>e&&e.get(t)||(r=Ct(kt({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Ai={};Nr(Ai,{Channel:()=>ke,CryptoEncoder:()=>ut,Currency:()=>R,DAY_MS:()=>Xe,Day:()=>A,Emitter:()=>N,FileStorage:()=>mt,JsonEncoder:()=>_,LocalChannel:()=>fe,LogLevel:()=>L,LogLevelAlias:()=>Be,Logger:()=>b,LoggerConsoleHandler:()=>le,LoggerContext:()=>He,LoggerFileHandler:()=>yt,LoggerNodeHandler:()=>At,MemStorage:()=>dt,PubSub:()=>Ce,SerialQueue:()=>pt,Uint8ArrayToJson:()=>we,Uint8ArrayToString:()=>jt,arrayEmptyInPlace:()=>dn,arrayFilterInPlace:()=>ve,arrayFlatten:()=>Y,arrayIntersection:()=>Zt,arrayIsEqual:()=>Kt,arrayMax:()=>xn,arrayMin:()=>bn,arrayMinus:()=>Wt,arrayRandomElement:()=>hn,arrayRemoveElement:()=>cn,arraySetElement:()=>fn,arrayShuffle:()=>mn,arrayShuffleForce:()=>yn,arrayShuffleInPlace:()=>_e,arraySorted:()=>Vt,arraySortedNumbers:()=>gn,arraySymmetricDifference:()=>ln,arrayToggleInPlace:()=>pn,arrayUnion:()=>_t,arrayUnique:()=>Ee,between:()=>ho,cloneJsonObject:()=>Do,cloneObject:()=>W,cmp:()=>Le,colorString:()=>se,colorStringList:()=>vt,composeOrderby:()=>an,createArray:()=>wn,createPromiseProxy:()=>lt,csv:()=>sn,currency:()=>B,day:()=>fo,debounce:()=>mi,decodeBase16:()=>vn,decodeBase32:()=>Sn,decodeBase58:()=>Mn,decodeBase62:()=>Cn,decodeBase64:()=>In,decrypt:()=>We,deepEqual:()=>ue,deepMerge:()=>It,deriveKeyPbkdf2:()=>en,detect:()=>mr,digest:()=>Xr,empty:()=>Co,encodeBase16:()=>En,encodeBase32:()=>An,encodeBase58:()=>Pn,encodeBase62:()=>kn,encodeBase64:()=>Dn,encodeQuery:()=>ot,encrypt:()=>Je,endSortWeight:()=>nt,equalBinary:()=>ze,escapeHTML:()=>et,escapeRegExp:()=>Eo,fakeWorkerPair:()=>ei,fetchBasic:()=>ct,fetchJson:()=>ii,fetchOptionsFormURLEncoded:()=>si,fetchOptionsJson:()=>ai,fetchText:()=>ui,fixBrokenUth8String:()=>qn,forEachDay:()=>lo,formatMessages:()=>rr,formatMilliseconds:()=>it,fromCamelCase:()=>Fn,getGlobal:()=>li,getGlobalContext:()=>K,getGlobalEmitter:()=>Qo,getNamespaceFilterString:()=>Ut,getNavigator:()=>gr,getSourceLocation:()=>$e,getSourceLocationByPrecedingPattern:()=>Tt,getStack:()=>wt,getStackLlocationList:()=>Lr,getTimestamp:()=>ee,getWindow:()=>ft,immediate:()=>io,isArray:()=>Dt,isBoolean:()=>Jr,isBrowser:()=>yr,isEven:()=>Ve,isHalf:()=>X,isInteger:()=>zr,isLocalHost:()=>No,isNullOrUndefined:()=>Wr,isNumber:()=>Gr,isObject:()=>V,isPrimitive:()=>Ne,isPromise:()=>M,isRecord:()=>Hr,isSafeInteger:()=>qr,isString:()=>jr,isTTY:()=>Sr,isTimeout:()=>ao,jsonStringify:()=>Ae,jsonToUint8Array:()=>be,last:()=>ko,lazyListener:()=>Xo,linkifyPlainText:()=>So,loggerStackTraceDebug:()=>Cr,messages:()=>Yo,moveSortWeight:()=>vo,parseDate:()=>Bo,parseOrderby:()=>Jt,parseQuery:()=>Po,platform:()=>ci,promisify:()=>H,qid:()=>Jo,randomBoolean:()=>go,randomFloat:()=>yo,randomInt:()=>mo,randomUint8Array:()=>J,renderMessages:()=>ce,roundDown:()=>Qn,roundHalfAwayFromZero:()=>eo,roundHalfDown:()=>to,roundHalfEven:()=>ro,roundHalfOdd:()=>Xn,roundHalfTowardsZero:()=>no,roundHalfUp:()=>Yn,roundUp:()=>Kn,setupEnv:()=>wi,size:()=>Mo,sleep:()=>oo,sortedItems:()=>ar,sortedOrderby:()=>un,startSortWeight:()=>rt,stringToBoolean:()=>Rn,stringToFloat:()=>Bn,stringToInteger:()=>Nn,stringToPath:()=>br,stringToUInt8Array:()=>Ge,suid:()=>Vo,suidBytes:()=>pr,suidBytesDate:()=>dr,suidDate:()=>Ko,throttle:()=>gi,timeout:()=>so,timeoutReached:()=>Ke,timoutError:()=>Qe,toBase64:()=>Qr,toBase64Url:()=>Yr,toBool:()=>zn,toCamelCase:()=>Un,toCapitalize:()=>Qt,toCapitalizeWords:()=>On,toFloat:()=>Hn,toHex:()=>Kr,toHumanReadableUrl:()=>ur,toInt:()=>jn,toPath:()=>Ue,toString:()=>Gn,toUint8Array:()=>k,toValidFilename:()=>tt,today:()=>co,tryTimeout:()=>Ye,uname:()=>j,unescapeHTML:()=>po,useAsyncMutex:()=>oi,useBase:()=>$,useDefer:()=>Oo,useDispose:()=>lr,useDisposer:()=>Uo,useEventListener:()=>Ro,useExitHandler:()=>fi,useInterval:()=>$o,useLevelFilter:()=>q,useMessageHub:()=>ti,useMutex:()=>ni,useNamespaceFilter:()=>F,usePool:()=>pi,usePubSub:()=>ri,useTimeout:()=>Fo,uuid:()=>te,uuid32bit:()=>Go,uuidB32:()=>zo,uuidBytes:()=>st,uuidv4:()=>_o,valueToBoolean:()=>Xt,valueToFloat:()=>tr,valueToInteger:()=>er,valueToPath:()=>wr,valueToString:()=>Se,waitOn:()=>uo});function V(e){return e!=null&&typeof e=="object"}o(V,"isObject");function Ne(e){return Object(e)!==e}o(Ne,"isPrimitive");function Dt(e){return Array.isArray(e)}o(Dt,"isArray");function Hr(e){return V(e)&&!Dt(e)}o(Hr,"isRecord");function jr(e){return typeof e=="string"}o(jr,"isString");function Gr(e){return typeof e=="number"}o(Gr,"isNumber");function zr(e){return typeof e=="number"&&Number.isInteger(e)}o(zr,"isInteger");function qr(e){return typeof e=="number"&&Number.isSafeInteger(e)}o(qr,"isSafeInteger");function Jr(e){return typeof e=="boolean"}o(Jr,"isBoolean");function Wr(e){return e==null}o(Wr,"isNullOrUndefined");function ue(e,t,r=new WeakSet){if(e===t||r.has(t))return!0;if(Ne(t)||r.add(t),!(e instanceof Object)||!(t instanceof Object)||e.constructor!==t.constructor||e.length!==t.length)return!1;for(let n in e){if(!e.hasOwnProperty(n))continue;if(!t.hasOwnProperty(n))return!1;let i=e[n],s=t[n];if(!ue(i,s,r))return!1}for(let n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}o(ue,"deepEqual");function It(e,...t){for(let r of t)V(e)||(e={}),r!=null&&Object.keys(r).forEach(n=>{let i=e[n],s=r[n];Array.isArray(i)&&Array.isArray(s)?e[n]=i.concat(s):V(i)&&V(s)?e[n]=It(Object.assign({},i),s):e[n]=s});return e}o(It,"deepMerge");function Ut(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}o(Ut,"getNamespaceFilterString");var Ot,Ft,_r=Ut(typeof process!="undefined"?(Ot=process.env.ZEED)!=null?Ot:process.env.DEBUG:typeof localStorage!="undefined"?(Ft=localStorage.zeed)!=null?Ft:localStorage.debug:"*");function F(e=_r){let t,r=[],n=[];if(!e)t=o(function(i){return!1},"fn");else if(e==="*")t=o(function(i){return!0},"fn");else{let i,s=e.split(/[\s,]+/),l=s.length;for(i=0;i<l;i++){if(!s[i])continue;let a=s[i].replace(/\*/g,".*?");a[0]==="-"?r.push(new RegExp("^"+a.substr(1)+"$")):n.push(new RegExp("^"+a+"$"))}t=o(function(a){if(r.length===0&&n.length===0)return!0;let u,c;for(u=0,c=r.length;u<c;u++)if(r[u].test(a))return!1;for(u=0,c=n.length;u<c;u++)if(n[u].test(a))return!0;return!1},"fn")}return t.accept=n,t.reject=r,t.filter=e,t}o(F,"useNamespaceFilter");var $t,Rt,Nt,Bt,Zr=typeof process!="undefined"?(Rt=($t=process.env.ZEED_LEVEL)!=null?$t:process.env.LEVEL)!=null?Rt:process.env.DEBUG_LEVEL:typeof localStorage!="undefined"?(Bt=(Nt=localStorage.zeed_level)!=null?Nt:localStorage.level)!=null?Bt:localStorage.debug_level:void 0;function q(e=Zr){let t=L.all;if(typeof e=="string"){let r=Be[e.toLocaleLowerCase().trim()];r!=null&&(t=r)}else typeof e=="number"&&(t=e);return r=>r>=t}o(q,"useLevelFilter");var L=(a=>(a[a.all=-1]="all",a[a.debug=0]="debug",a[a.info=1]="info",a[a.warn=2]="warn",a[a.error=3]="error",a[a.fatal=4]="fatal",a[a.off=1/0]="off",a))(L||{}),Be={"*":-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 He(e=""){let t=[le()],r=2,n=o(u=>!0,"logCheckNamespace"),i=!1,s=l;function l(u=""){p.extend=function(f){return s(u?`${u}:${f}`:f)};let c=o(f=>{if(p.active===!0&&f.level>=a.level&&f.level>=p.level&&n(u))for(let m of t)m&&m(f)},"emit");function p(...f){c({name:u,messages:f,level:0})}return o(p,"log"),p.active=!0,p.level=-1,p.debug=function(...f){c({name:u,messages:f,level:0})},p.info=function(...f){c({name:u,messages:f,level:1})},p.warn=function(...f){c({name:u,messages:f,level:2})},p.error=function(...f){c({name:u,messages:f,level:3})},p.assert=function(f,...m){f||(typeof console!==void 0&&(console.assert?console.assert(f,...m):console.error(`Assert did fail with: ${f}`,...m)),c({name:u,messages:m||[`Assert did fail with: ${f}`],level:r}))},p.assertEqual=function(f,m,...y){let x=ue(f,m);x||p.assert(x,`Assert did fail. Expected ${m} got ${f}`,m,f,...y)},p.assertNotEqual=function(f,m,...y){let x=ue(f,m);x&&p.assert(x,`Assert did fail. Expected ${m} not to be equal with ${f}`,m,f,...y)},p}o(l,"LoggerBaseFactory");function a(u=""){return s(u)}return o(a,"Logger"),a.registerHandler=function(u){t.push(u)},a.setFilter=function(u){n=F(u)},a.setLock=(u=!0)=>i=u,a.setHandlers=function(u=[]){s!==l&&(s=l),!i&&(t=[...u].filter(c=>typeof c=="function"))},a.level=-1,a.setLogLevel=function(u=-1){i||(a.level=u)},a.setFactory=function(u){i||(s=u)},a}o(He,"LoggerContext");function le(e={}){let{level:t=void 0,filter:r=void 0,colors:n=!0,levelHelper:i=!1,nameBrackets:s=!0,padding:l=16}=e,a=F(r),u=q(t);return c=>{if(!u(c.level)||!a(c.name))return;let p=c.name?`[${c.name}]`:"";switch(c.level){case L.info:console.info(`I|* ${p}`,...c.messages);break;case L.warn:console.warn(`W|** ${p}`,...c.messages);break;case L.error:console.error(`E|*** ${p}`,...c.messages);break;default:console.debug(`D| ${p}`,...c.messages);break}}}o(le,"LoggerConsoleHandler");function Vr(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;if(typeof globalThis!="undefined")return globalThis;throw new Error("unable to locate global object")}o(Vr,"_global");function K(){let e=Vr();return e._zeedGlobal==null&&(e._zeedGlobal={}),e._zeedGlobal}o(K,"getGlobalContext");var Q;function je(){let e=He();return e.setHandlers([le()]),e}o(je,"getLoggerContext");try{let e=K();e!=null?(e==null?void 0:e.logger)==null?(Q=je(),e.logger=Q):Q=e.logger:Q=je()}catch{Q=je()}var b=Q;var Ht=b("bin"),he;function Ge(e){return typeof TextEncoder=="undefined"?new Uint8Array:(he!=null?he:he=new TextEncoder).encode(e.normalize("NFC"))}o(Ge,"stringToUInt8Array");var xe;function jt(e){return typeof TextDecoder=="undefined"?"":(xe!=null?xe:xe=new TextDecoder("utf-8",{ignoreBOM:!0})).decode(e).normalize("NFC")}o(jt,"Uint8ArrayToString");function k(e){return e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Ge(e):e.length?new Uint8Array(e):e}o(k,"toUint8Array");function Kr(e){if(typeof Buffer!="undefined")return Buffer.from(k(e)).toString("hex");let t="0123456789abcdef",r="";for(let n of[...k(e)])r+=t[n>>4]+t[n&15];return r}o(Kr,"toHex");function Qr(e){let t=k(e);if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64");let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return btoa(r)}o(Qr,"toBase64");function Yr(e){let t=k(e);if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64url");let r="";for(let n=0;n<t.byteLength;n++)r+=String.fromCharCode(t[n]);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_")}o(Yr,"toBase64Url");function ze(e,t){if(e.byteLength!==t.byteLength)return!1;let r=k(e),n=k(t);for(let i=0;i<r.length;i++)if(r[i]!==n[i])return!1;return!0}o(ze,"equalBinary");function be(e){try{return Ge(JSON.stringify(e))}catch(t){throw Ht.warn("jsonToUint8Array",e),t}}o(be,"jsonToUint8Array");function we(e){try{return JSON.parse(jt(e))}catch(t){throw Ht.warn("Uint8ArrayToJson",e),t}}o(we,"Uint8ArrayToJson");function J(e=16){let t=new Uint8Array(e);if(typeof crypto!="undefined"&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let r=0;r<e;r++)t[r]=Math.floor(Math.random()*256);return t}o(J,"randomUint8Array");var Gt="SHA-256",qe="AES-GCM",zt="PBKDF2";async function Xr(e,t=Gt){return await crypto.subtle.digest(t,k(e))}o(Xr,"digest");async function en(e,t={}){var i;let r=k(e),n=await crypto.subtle.importKey("raw",r,zt,!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:zt,salt:t.salt?k(t.salt):new Uint8Array(0),iterations:(i=t.iterations)!=null?i:1e5,hash:Gt},n,{name:qe,length:256},!0,["encrypt","decrypt"])}o(en,"deriveKeyPbkdf2");var Te=new Uint8Array([1,1]);async function Je(e,t){let r=J(12),n=await crypto.subtle.encrypt({name:qe,iv:r},t,e),i=new Uint8Array(n),s=Te.length+r.length+i.length,l=new Uint8Array(s),a=0;return l.set(Te,a),a+=Te.length,l.set(r,a),a+=r.length,l.set(i,a),l}o(Je,"encrypt");async function We(e,t){let r=e.subarray(0,2);if(!ze(r,Te))return Promise.reject(`Unknown magic ${r}`);let n=e.subarray(2,2+12),i=e.subarray(2+12,e.length),s=await crypto.subtle.decrypt({name:qe,iv:n},t,i);return new Uint8Array(s)}o(We,"decrypt");var qt=",",tn=!1,rn=!0;function nn(e){return/^([-+])?([0-9]+(\.[0-9]+)?|Infinity)$/.test(e)?Number(e):NaN}o(nn,"filterFloat");function on(e){return rn&&e==null?"":tn?'="'+String(e).replace(/"/g,'""')+'"':!isNaN(nn(e))&&isFinite(e)?parseFloat(e):'"'+String(e).replace(/"/g,'""')+'"'}o(on,"escape");function sn(e,t){let r="";t&&(r=t.join(qt)+`\r
|
|
2
|
+
`);for(let n=0;n<e.length;n++)r+=e[n].map(on).join(qt)+`\r
|
|
3
|
+
`;return r}o(sn,"csv");function Jt(e=""){let[t="",r="asc"]=e.split(" ");return r=r.toLowerCase(),{field:t,orderby:r,asc:r!=="desc",desc:r==="desc"}}o(Jt,"parseOrderby");function an(e,t=!0){return`${e} ${t?"asc":"desc"}`}o(an,"composeOrderby");function Le(e,t,r=!0){let n=e||0,i=t||0;return n>i?r?1:-1:n<i?r?-1:1:0}o(Le,"cmp");function un(e,...t){if(t.length>0){let r=t.map(Jt),n=Array.from(e);return n.sort((i,s)=>{for(let{field:l,asc:a}of r){let u=Le(i[l],s[l],a);if(u!==0)return u}return 0}),n}return e}o(un,"sortedOrderby");function Ee(e){return e.filter((t,r)=>e.indexOf(t)===r)}o(Ee,"arrayUnique");function Wt(e,t){return Ee(e.filter(r=>!t.includes(r)))}o(Wt,"arrayMinus");function _t(...e){return Ee(e.reduce((t=[],r)=>t.concat(r),[]))}o(_t,"arrayUnion");function Y(...e){return e.flat(1/0)}o(Y,"arrayFlatten");function Zt(e,t){return Ee(e).filter(r=>t.includes(r))}o(Zt,"arrayIntersection");function ln(e,t){return Wt(_t(e,t),Zt(e,t))}o(ln,"arraySymmetricDifference");function cn(e,t){if(e&&Array.isArray(e)){let r;for(;(r=e.indexOf(t))!==-1;)e.splice(r,1);return e}return[]}o(cn,"arrayRemoveElement");function fn(e,t){return e.includes(t)||e.push(t),e}o(fn,"arraySetElement");function ve(e,t){return e.splice(0,e.length,...e.filter(t)),e}o(ve,"arrayFilterInPlace");function pn(e,t){let r=e.findIndex(n=>n===t);return r>=0?e.splice(r,1):e.push(t),e}o(pn,"arrayToggleInPlace");function dn(e){return e.splice(0,e.length),e}o(dn,"arrayEmptyInPlace");function Vt(e,t=Le){return Array.from(e).sort(t)}o(Vt,"arraySorted");function gn(e){return Vt(e,(t,r)=>t-r)}o(gn,"arraySortedNumbers");function Kt(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}o(Kt,"arrayIsEqual");function _e(e){return e.sort(()=>Math.random()>.5?1:-1),e}o(_e,"arrayShuffleInPlace");function mn(e){return _e(Array.from(e))}o(mn,"arrayShuffle");function yn(e){for(;e.length>1;){let t=Array.from(e);if(_e(t),!Kt(e,t))return t}return e}o(yn,"arrayShuffleForce");function hn(e){return e[Math.floor(Math.random()*e.length)]}o(hn,"arrayRandomElement");function xn(...e){return Y(e).reduce((t,r)=>t!=null?r>t?r:t:r,void 0)}o(xn,"arrayMax");function bn(...e){return Y(e).reduce((t,r)=>t!=null?r<t?r:t:r,void 0)}o(bn,"arrayMin");function wn(e=0,t){if(e<=0)return[];let r=new Array(e);for(let n=0;n<e;n++)r[n]=t instanceof Function?t(n):t;return r}o(wn,"createArray");var Tn=b("zeed:basex"),Ln={"2":"01","8":"01234567","11":"0123456789a","16":"0123456789abcdef","32":"0123456789ABCDEFGHJKMNPQRSTVWXYZ","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 $(e){let t;if(typeof e=="string")t=e;else if(t=Ln[e.toString()],t==null)throw new Error(`Unknown base ${e}`);if(t.length>=255)throw new TypeError("Alphabet too long");let r=new Uint8Array(256);for(let c=0;c<r.length;c++)r[c]=255;for(let c=0;c<t.length;c++){let p=t.charAt(c),f=p.charCodeAt(0);if(r[f]!==255)throw new TypeError(p+" is ambiguous");r[f]=c}let n=t.length,i=t.charAt(0),s=Math.log(n)/Math.log(256),l=Math.log(256)/Math.log(n);function a(c,p=-1){let f=k(c);if(f.byteLength===0)return"";let m=0,y=0,x=f.byteLength;for(;y!==x&&f[y]===0;)y++;let w=(x-y)*l+1>>>0,g=new Uint8Array(w);for(;y!==x;){let E=f[y],v=0;for(let I=w-1;(E!==0||v<m)&&I!==-1;I--,v++)E+=256*g[I]>>>0,g[I]=E%n>>>0,E=E/n>>>0;if(E!==0)throw Tn.warn("Non-zero carry",f,p,v,w),new Error("Non-zero carry");m=v,y++}let h=w-m;for(;h!==w&&g[h]===0;)h++;let S="";for(;h<w;++h)S+=t.charAt(g[h]);return p>0?S.padStart(p,i):S}o(a,"encode");function u(c,p=-1){if(typeof c!="string")throw new TypeError("Expected String");if(c.length===0)return new Uint8Array;c=c.replace(/\s+/gi,"");let f=0,m=0;for(;c[f]===i;)f++;let y=(c.length-f)*s+1>>>0,x=new Uint8Array(y);for(;c[f];){let g=r[c.charCodeAt(f)];if(g===255)throw new Error(`Unsupported character "${c[f]}"`);let h=0;for(let S=y-1;(g!==0||h<m)&&S!==-1;S--,h++)g+=n*x[S]>>>0,x[S]=g%256>>>0,g=g/256>>>0;if(g!==0)throw new Error("Non-zero carry");m=h,f++}let w=y-m;for(;w!==y&&x[w]===0;)w++;return p>0?new Uint8Array([...new Uint8Array(p-x.length+w),...x.slice(w)]):x.slice(w)}return o(u,"decode"),{encode:a,decode:u}}o($,"useBase");var{encode:En,decode:vn}=$(16),{encode:An,decode:Sn}=$(32),{encode:Pn,decode:Mn}=$(58),{encode:kn,decode:Cn}=$(62),{encode:Dn,decode:In}=$(62);var Un=o(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,r)=>r.toUpperCase()),e=e[0].toLowerCase()+e.substring(1)),e),"toCamelCase");function Qt(e){return e.charAt(0).toUpperCase()+e.toLowerCase().slice(1)}o(Qt,"toCapitalize");function On(e){return e.replace(/\w\S*/g,Qt)}o(On,"toCapitalizeWords");function Fn(e,t="-"){return t=typeof t=="undefined"?"_":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()}o(Fn,"fromCamelCase");function $n(e,t){var r=[],n=[];return t==null&&(t=o(function(i,s){return r[0]===s?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(s)).join(".")+"]"},"cycleReplacer")),function(i,s){if(r.length>0){var l=r.indexOf(this);~l?r.splice(l+1):r.push(this),~l?n.splice(l,1/0,i):n.push(i),~r.indexOf(s)&&(s=t==null?void 0:t.call(this,i,s))}else r.push(s);return e==null?s:e.call(this,i,s)}}o($n,"serializer");function Ae(e,t,r,n){return JSON.stringify(e,$n(t,n),r)}o(Ae,"jsonStringify");var Yt=["1","true","yes","y","on"];function Rn(e,t=!1){return e==null||typeof e!="string"?t:Yt.includes(String(e).trim().toLowerCase())}o(Rn,"stringToBoolean");function Nn(e,t=0){var r;return e==null||typeof e!="string"?t:(r=parseInt(e.trim(),10))!=null?r:t}o(Nn,"stringToInteger");function Bn(e,t=0){var r;return e==null||typeof e!="string"?t:(r=parseFloat(e.trim()))!=null?r:t}o(Bn,"stringToFloat");function Xt(e,t=!1){return e==null?t:typeof e=="boolean"?e:typeof e=="number"?e!==0:Yt.includes(String(e).trim().toLowerCase())}o(Xt,"valueToBoolean");function er(e,t=0){var r;return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):(r=parseInt(String(e).trim(),10))!=null?r:t}o(er,"valueToInteger");function tr(e,t=0){var r;return e==null?t:typeof e=="boolean"?e?1:0:typeof e=="number"?Math.floor(e):(r=parseFloat(String(e).trim()))!=null?r:t}o(tr,"valueToFloat");function Se(e,t=""){var r;return e==null?t:(r=String(e))!=null?r:t}o(Se,"valueToString");var Hn=tr,jn=er,Gn=Se,zn=Xt;function rr(e,t={}){let{trace:r=!0,pretty:n=!0}=t;return e.map(i=>i&&typeof i=="object"?i instanceof Error?r?`${i.name||"Error"}: ${i.message}
|
|
4
|
+
${i.stack}`:`${i.name||"Error"}: ${i.message}`:n?Ae(i,null,2):Ae(i):String(i))}o(rr,"formatMessages");function ce(e,t={}){return rr(e,t).join(" ")}o(ce,"renderMessages");function qn(e){try{return decodeURIComponent(escape(e))}catch{}return e}o(qn,"fixBrokenUth8String");var Jn={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:Vn,fromCents:!1},nr=o(e=>Math.round(e),"round"),Ze=o(e=>Math.pow(10,e),"pow"),Wn=o((e,t)=>nr(e/t)*t,"rounding"),_n=/(\d)(?=(\d{3})+\b)/g,Zn=/(\d)(?=(\d\d)+\d\b)/g;function B(e,t={}){return new R(e,t)}o(B,"currency");var Me=class{constructor(t,r={}){var l;let n=Object.assign({},Jn,r),i=Ze((l=n.precision)!=null?l:2),s=Pe(t,n);this.intValue=s,this.value=s/i,n.increment=n.increment||1/i,n.useVedic?n.groups=Zn:n.groups=_n,this._settings=n,this._precision=i}add(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r+=Pe(t,n))/(n.fromCents?1:i),n)}subtract(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r-=Pe(t,n))/(n.fromCents?1:i),n)}multiply(t){let{intValue:r,_settings:n,_precision:i}=this;return B((r*=t)/(n.fromCents?1:Ze(i)),n)}divide(t){let{intValue:r,_settings:n}=this;return B(r/=Pe(t,n,!1),n)}distribute(t){let{intValue:r,_precision:n,_settings:i}=this,s=[],l=Math[r>=0?"floor":"ceil"](r/t),a=Math.abs(r-l*t),u=i.fromCents?1:n;for(;t!==0;t--){let c=B(l/u,i);a-- >0&&(c=c[r>=0?"add":"subtract"](1/u)),s.push(c)}return s}dollars(){return~~this.value}cents(){let{intValue:t,_precision:r}=this;return~~(t%r)}format(t){let{_settings:r}=this;return typeof t=="function"?t(this,r):r.format(this,Object.assign({},r,t))}toString(){let{intValue:t,_precision:r,_settings:n}=this;return Wn(t/r,n.increment).toFixed(n.precision)}toJSON(){return this.value}static sum(...t){return Y(t).reduce((r,n)=>B(r).add(n),this.zero)}static avg(...t){let r=Y(t);return r.reduce((n,i)=>B(n).add(i),this.zero).divide(r.length)}},R=Me;o(R,"Currency"),R.zero=new Me(0),R.one=new Me(1);function Pe(e,t,r=!0){let n=0,{decimal:i,errorOnInvalid:s,precision:l,fromCents:a}=t,u=Ze(l),c=typeof e=="number";if(e instanceof R&&a)return e.intValue;if(c||e instanceof R)n=e instanceof R?e.value:e;else if(typeof e=="string"){let p=new RegExp("[^-\\d"+i+"]","g"),f=new RegExp("\\"+i,"g");n=e.replace(/\((.*)\)/,"-$1").replace(p,"").replace(f,"."),n=n||0}else{if(s)throw Error("Invalid Input");n=0}return a||(n*=u,n=n.toFixed(4)),r?nr(n):n}o(Pe,"parse");function Vn(e,t){let{pattern:r,negativePattern:n,symbol:i,separator:s,decimal:l,groups:a}=t,u=(""+e).replace(/^-/,"").split("."),c=u[0],p=u[1];return(e.value>=0?r:n).replace("!",i).replace("#",c.replace(a,"$1"+s)+(p?l+p:""))}o(Vn,"format");var X=o(e=>Math.abs(e)%1===.5,"isHalf"),Ve=o(e=>e%2===0,"isEven"),Kn=o(e=>Math.ceil(e),"roundUp"),Qn=o(e=>Math.floor(e),"roundDown"),Yn=o(e=>Math.round(e),"roundHalfUp"),Xn=o(e=>{let t=Math.round(e);return X(e)&&Ve(t)?t-1:t},"roundHalfOdd"),eo=o(e=>X(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e),"roundHalfAwayFromZero"),to=o(e=>X(e)?Math.floor(e):Math.round(e),"roundHalfDown"),ro=o(e=>{let t=Math.round(e);return X(e)?Ve(t)?t:t-1:t},"roundHalfEven"),no=o(e=>X(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e),"roundHalfTowardsZero");var{warn:or}=b("zeed:promise");async function oo(e){return new Promise(t=>setTimeout(t,e))}o(oo,"sleep");async function io(){return new Promise(e=>setTimeout(e,0))}o(io,"immediate");var Ke=Symbol("timeout");async function so(e,t,r=Ke){return new Promise(async(n,i)=>{let s=!1,l=setTimeout(()=>{s=!0,n(r)},t);try{let a=await e;clearTimeout(l),s||n(a)}catch(a){clearTimeout(l),s||i(a)}})}o(so,"timeout");var Qe=new Error("Timeout reached");function ao(e){return e===Ke||e===Qe}o(ao,"isTimeout");async function Ye(e,t){return t<=0?await e:new Promise(async(r,n)=>{let i=!1,s=setTimeout(()=>{i=!0,n(Qe)},t);try{let l=await e;clearTimeout(s),i||r(l)}catch(l){clearTimeout(s),i||n(l)}})}o(Ye,"tryTimeout");function uo(e,t,r=1e3){return new Promise((n,i)=>{let s=o(u=>{a&&(clearTimeout(a),l(),n(u))},"fn"),l=o(()=>{a=null,e.off?e.off(t,s):e.removeEventListener?e.removeEventListener(t,s):or("No remove listener method found for",e,t)},"done"),a=setTimeout(()=>{l(),i(new Error("Did not response in time"))},r);e.on?e.on(t,s):e.addEventListener?e.addEventListener(t,s):or("No listener method found for",e)})}o(uo,"waitOn");function M(e){return Boolean(e&&(e instanceof Promise||typeof e.then=="function"))}o(M,"isPromise");function H(e){return Promise.resolve(e)}o(H,"promisify");var Xe=1e3*60*60*24,A=class{constructor(t){var r;if(typeof t=="number"){this.days=t;return}if(t!=null&&(t=(r=A.from(t))==null?void 0:r.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 A(t)}static fromString(t){return new A(+t.replace(/[^0-9]/g,""))}static fromDate(t,r=!1){return r?A.fromString(t.toISOString().substr(0,10)):new A(t.getFullYear()*1e4+(t.getMonth()+1)*100+t.getDate())}static fromDateGMT(t){return A.fromDate(t,!0)}static from(t,r=!1){if(typeof t=="number")return new A(t);if(typeof t=="string")return A.fromString(t);if(t instanceof Date)return A.fromDate(t,r);if(t instanceof A)return t}toNumber(){return this.days}toJson(){return this.days}toString(t="-"){let r=String(this.days);return r.slice(0,4)+t+r.slice(4,6)+t+r.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)}dayOffset(t){return A.fromDateGMT(new Date(this.toDateGMT().getTime()+t*Xe))}daysUntil(t){var r;return Math.round((((r=new A(t))==null?void 0:r.toDateGMT().getTime())-this.toDateGMT().getTime())/Xe)}yesterday(){return this.dayOffset(-1)}tomorrow(){return this.dayOffset(1)}};o(A,"Day");async function lo(e,t,r){let n=A.from(e),i=A.from(t);for(;n&&i&&(n==null?void 0:n.days)<=(i==null?void 0:i.days);){let s=r(n);M(s)&&await s,n=n.dayOffset(1)}}o(lo,"forEachDay");function co(){return new A}o(co,"today");function fo(e){return new A(e)}o(fo,"day");var et=o(e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),"escapeHTML"),po=o(e=>e.replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),"unescapeHTML");function go(e=.25){return Math.random()<e}o(go,"randomBoolean");function mo(e=100,t=0){return t+Math.floor(Math.random()*(e-t))}o(mo,"randomInt");function yo(e=100,t=0){return t+Math.random()*(e-t)}o(yo,"randomFloat");function ho(e,t,r){return Math.max(e,Math.min(r,t))}o(ho,"between");var xo=100,ir=/[\u0000-\u001F\u0080-\u009F]/g,bo=/^\.+/,wo=/\.+$/;function sr(){return/[<>:"/\\|?*\u0000-\u001F]/g}o(sr,"filenameReservedRegex");function To(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}o(To,"windowsReservedNameRegex");function tt(e){if(typeof e!="string")throw new TypeError("Expected a string");let t="_";if(sr().test(t)&&ir.test(t))throw new Error("Replacement string cannot contain reserved filename characters");return e=e.replace(sr(),t).replace(ir,t).replace(bo,t).replace(wo,""),e=To().test(e)?e+t:e,e.slice(0,xo)}o(tt,"toValidFilename");var Lo=/[\\\-\[\]\/{}()*+?.^$|]/g;function Eo(e){return e?e instanceof RegExp?e.source:e.replace(Lo,"\\$&"):""}o(Eo,"escapeRegExp");function rt(e){return e.reduce((t,r)=>Math.min(t,r.sort_weight||0),0)-1-Math.random()}o(rt,"startSortWeight");function nt(e){return e.reduce((t,r)=>Math.max(t,r.sort_weight||0),0)+1+Math.random()}o(nt,"endSortWeight");function vo(e,t,r){let n=r.length,i=e<t;if(n<=0||e>=n-1)return nt(r);if(e<=0)return rt(r);r=ar([...r]);let s=i?-1:0,l=r[e+s].sort_weight||0,u=(r[e+s+1].sort_weight||0)-l;if(u===0)return i?rt(r):nt(r);let c=l+u/2,p=u*.01*(Math.random()-.5);return c+p}o(vo,"moveSortWeight");function ar(e){return e.sort((t,r)=>(t.sort_weight||0)-(r.sort_weight||0)),e}o(ar,"sortedItems");var Ao=/((?:(?:(?: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 So(e){return e.split(Ao).map((t,r)=>{let n=et(t);return r%2?`<a target="_blank" href="${n}">${ur(n)}</a>`:n}).join("")}o(So,"linkifyPlainText");function ur(e){return e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")}o(ur,"toHumanReadableUrl");function ot(e){let t=[];for(let[r,n]of Object.entries(e))if(n!=null){Array.isArray(n)||(n=[n]);for(let i of n)i!=null&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(i.toString()||""))}return t.join("&")}o(ot,"encodeQuery");function Po(e){let t={},r=(e[0]==="?"?e.substr(1):e).split("&");for(let n=0;n<r.length;n++){let i=r[n].split("="),s=decodeURIComponent(i[0]),l=decodeURIComponent(i[1]||"");t[s]!=null?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(l)):t[s]=l}return t}o(Po,"parseQuery");function Mo(e){return e!=null?e.size!=null?e.size:e.length!=null?e.length:Object.keys(e).length:0}o(Mo,"size");function ko(e){return e!=null&&e.length>0?e[e.length-1]:void 0}o(ko,"last");function Co(e){try{if(e!=null)return Array.isArray(e)||typeof e=="string"?e.length<=0:(e==null?void 0:e.size)!=null?e.size<=0:Object.keys(e).length<=0}catch(t){console.error("Failed to check if empty for",e,t)}return!0}o(Co,"empty");function W(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(W,"cloneObject");function Do(e){return Object(e)!==e?e:JSON.parse(JSON.stringify(e))}o(Do,"cloneJsonObject");async function Io(e){typeof e=="function"?await H(e()):M(e)?await e:typeof e.dispose=="function"?await H(e.dispose()):M(e.dispose)?await e.dispose:typeof e.cleanup=="function"?await H(e.cleanup()):M(e.cleanup)&&await e.cleanup}o(Io,"callDisposer");function lr(){let e=[],t=o(async i=>{e.includes(i)&&(ve(e,s=>s!==i),await Io(i))},"untrack"),r=o(async()=>{for(;e.length>0;)await t(e[0])},"dispose"),n=o(i=>(e.unshift(i),()=>t(i)),"track");return Object.assign(r,{track:n,add:n,untrack:t,dispose:r,exec:r,getSize(){return e.length}})}o(lr,"useDispose");var Uo=lr;function Oo(e={}){let{mode:t="fifo"}=e,r=[],n=o(async(s=!1)=>{for(;r.length>0;){let l=r[0];if(ve(r,a=>a!==l),typeof l=="function"){let a=l();if(M(a)){if(s)throw new Error(`Expected sync only function, but found async: ${l}`);await a}}else if(M(l)){if(s)throw new Error(`Expected sync only function, but found async: ${l}`);await l}else throw new Error(`Unhandled disposable: ${l}`)}},"exec");return Object.assign(n,{add:o(s=>{t==="lifo"?r.unshift(s):r.push(s)},"add"),exec:n,getSize(){return r.length}})}o(Oo,"useDefer");function Fo(e,t=0){let r=setTimeout(e,t);return()=>{r&&(clearTimeout(r),r=void 0)}}o(Fo,"useTimeout");function $o(e,t){let r=setInterval(e,t);return()=>{r&&(clearInterval(r),r=void 0)}}o($o,"useInterval");function Ro(e,t,r,...n){return e==null?()=>{}:(e.on?e.on(t,r,...n):e.addEventListener&&e.addEventListener(t,r,...n),()=>{e.off?e.off(t,r,...n):e.removeEventListener&&e.removeEventListener(t,r,...n)})}o(Ro,"useEventListener");function No(e=window.location.hostname){return["localhost","127.0.0.1","","::1","::"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")}o(No,"isLocalHost");var ee=o(()=>typeof performance!="undefined"?performance.now():new Date().getTime(),"getTimestamp");function it(e){return e>999?(e/1e3).toFixed(1)+"s":e.toFixed(2)+"ms"}o(it,"formatMilliseconds");function Bo(...e){for(let t of e){if(t instanceof Date)return t;if(typeof t=="string"){let r=null;if(t.includes(":"))try{r=new Date(t)}catch{}if(!(r instanceof Date)){let n=/(\d\d\d\d)-(\d\d)-(\d\d)/.exec(t);n&&(r=new Date(+n[1],+n[2]-1,+n[3],12,0))}if(r instanceof Date)return r}}}o(Bo,"parseDate");var{encode:cr,decode:Ho}=$(62),{encode:jo}=$(32);function st(){return J(16)}o(st,"uuidBytes");var Go=o(()=>new Uint32Array(J(4))[0],"uuid32bit");function te(){return cr(st(),22)}o(te,"uuid");function zo(){return jo(st(),26)}o(zo,"uuidB32");var at={};function j(e="id"){return at[e]==null&&(at[e]=0),`${e}-${at[e]++}`}o(j,"uname");var qo=0;function Jo(){return`id-${qo++}`}o(Jo,"qid");var Wo="10000000-1000-4000-8000-100000000000",_o=o(()=>Wo.replace(/[018]/g,e=>(e^J(1)[0]&15>>e/4).toString(16)),"uuidv4"),fr=16e11;function Zo(e){var t=new Uint8Array([0,0,0,0,0,0]);let r=t.length-1;for(var n=0;n<t.length;n++){var i=e&255;t[r-n]=i,e=(e-i)/256}return t}o(Zo,"longToByteArray");function pr(){let e=ee()-fr;return new Uint8Array([...Zo(e),...J(10)])}o(pr,"suidBytes");function Vo(){return cr(pr(),22)}o(Vo,"suid");function Ko(e){return dr(Ho(e,16))}o(Ko,"suidDate");function dr(e){return new Date(fr+e.slice(0,6).reduce((t,r)=>t*256+r,0))}o(dr,"suidBytesDate");var re=b("zeed:emitter"),N=class{constructor(){this.subscribers={};this.subscribersOnAny=[];this.call=new Proxy({},{get:(t,r)=>(...n)=>this.emit(r,...n)})}async emit(t,...r){let n=!1;try{let i=this.subscribers[t]||[];if(this.subscribersOnAny.forEach(s=>s(t,...r)),i.length>0){let s=i.map(l=>{try{return H(l(...r))}catch(a){re.warn("emit warning:",a)}});n=!0,await Promise.all(s)}}catch(i){re.error("emit exception",i)}return n}onAny(t){this.subscribersOnAny.push(t)}on(t,r){let n=this.subscribers[t]||[];return n.push(r),this.subscribers[t]=n,()=>{this.off(t,r)}}onCall(t){for(let[r,n]of Object.entries(t))this.on(r,n)}once(t,r){let n=o(async(...i)=>(this.off(t,n),await H(r(...i))),"onceListener");return this.on(t,n),()=>{this.off(t,r)}}off(t,r){return this.subscribers[t]=(this.subscribers[t]||[]).filter(n=>r&&n!==r),this}removeAllListeners(t){return this.subscribers={},this}dispose(){this.subscribers={},this.subscribersOnAny=[]}};o(N,"Emitter");function Qo(){let e=K().emitter;return e||(e=new N,K().emitter=e),e}o(Qo,"getGlobalEmitter");var Yo=new N;function Xo(e,t){let r=Math.round(Math.random()*100);var n=[],i;let s=o((a,u)=>{let c={key:a,obj:u};n.push(c),i&&i()},"incoming");return t?e.on?e.on(t,a=>{s(t,a)}):e.addEventListener?e.addEventListener(t,a=>{s(t,a)}):re.error(r,"Cannot listen to key"):e.onAny?e.onAny((a,u)=>{s(a,u)}):re.error(r,"cannot listen to all for",e),o((a,u=!0)=>new Promise((c,p)=>{a||(a=t,a||n.length&&(a=n[0].key)),i=o(()=>{for(;n.length>0;){let f=n.shift();if(f.key===a)i=void 0,c(f.obj);else{if(u){re.warn(r,`Unhandled event ${a} with value: ${f.obj}`);continue}p(`Expected ${a}, but found ${f.key} with value=${f.obj}`),re.error(r,`Unhandled event ${a} with value: ${f.obj}`)}break}},"lazyResolve"),i()}),"on")}o(Xo,"lazyListener");var ke=class extends N{constructor(){super(...arguments);this.id=te()}close(){}};o(ke,"Channel");var fe=class extends ke{constructor(){super(...arguments);this.isConnected=!0}postMessage(t){var r;(r=this.other)==null||r.emit("message",{data:t,origin:"local",lastEventId:te()})}};o(fe,"LocalChannel");function ei(){let e=new fe,t=new fe;return e.other=t,t.other=e,[e,t]}o(ei,"fakeWorkerPair");var _=class{async encode(t){return be(t)}async decode(t){return we(t)}};o(_,"JsonEncoder");var ut=class{constructor(t){this.key=t}async encode(t){let r=be(t);return await Je(r,this.key)}async decode(t){let r=await We(t,this.key);return we(r)}};o(ut,"CryptoEncoder");var lt=o((e,t,r={})=>new Proxy(r,{get:(n,i)=>i in n?n[i]:(...s)=>e(i,s,t)}),"createPromiseProxy");function ti(e={}){let{name:t=j("hub"),encoder:r=new _,retryAfter:n=1e3,ignoreUnhandled:i=!0}=e,s=b(t),l={},a,u=[],c,p={},f=o(()=>{clearTimeout(c)},"dispose"),m=o(async()=>{if(clearTimeout(c),a){if(a.isConnected)for(;u.length;){let g=u[0];try{a.postMessage(await r.encode(g)),u.shift()}catch(h){s.warn("postMessage",h);break}}u.length>0&&n>0&&(c=setTimeout(m,n))}},"postNext"),y=o(async g=>{s("enqueue postMessage",g),u.push(g),await m()},"postMessage"),x=o(async g=>{a=g,a.on("connect",m),a.on("message",async h=>{s("onmessage",typeof h);let{name:S,args:E,id:v,result:I,error:G}=await r.decode(h.data);if(S){s(`name ${S} id ${v}`);try{if(l[S]==null)throw new Error(`handler for ${S} was not found`);let D=l[S](...E);M(D)&&(D=await D),s(`result ${D}`),v&&y({id:v,result:D})}catch(D){let z=D instanceof Error?D:new Error(Se(D));s.warn("execution error",z.name),y({id:v,error:{message:z.message,stack:z.stack,name:z.name}})}}else if(v)if(s(`response for id=${v}: result=${I}, error=${G}`),p[v]==null)I===void 0?s(`skip response for ${v}`):s.warn(`no response hook for ${v}`);else{let[D,z]=p[v];if(D&&z)if(delete p[v],G){let ye=new Error(G.message);ye.stack=G.stack,ye.name=G.name,s.warn("reject",ye.name),z(ye)}else s("resolve",I),D(I)}else i||s.warn("Unhandled message",h)}),m()},"connect"),w=o(async(g,h,S={})=>{let{timeout:E=5e3}=S,v=te();return y({name:g,args:h,id:v}),Ye(new Promise((I,G)=>p[v]=[I,G]),E)},"fetchMessage");return e.channel&&x(e.channel),{dispose:f,connect:x,listen(g){Object.assign(l,g)},send(){return lt(w,{},{options(g){return lt(w,U({},g))}})}}}o(ti,"useMessageHub");var Ce=class extends N{constructor(t){super();this.publish=this.emit;this.subscribe=this.on;var l;let{name:r,encoder:n=new _,channel:i,debug:s=!1}=t;this.channel=i,this.encoder=n,this.debug=s,this.name=(l=r!=null?r:this.channel.id)!=null?l:j("pubsub"),this.log=b(`${this.shortId}`),this.debug&&(this.channel.on("connect",()=>{this.log("channel connected")}),this.channel.on("disconnect",()=>{this.log("channel disconnected")})),this.channel.on("message",async({data:a})=>{let u=await this.encoder.decode(a);if(this.debug?this.log(`channel message, event=${u==null?void 0:u.event}, info=`,u):this.log(`channel message, event=${u==null?void 0:u.event}`),u){let{event:c,args:p}=u;await this.emitSuper(c,...p)}})}get shortId(){return this.name.substr(0,6)}async emitSuper(t,...r){return await super.emit(t,...r)}async emit(t,...r){try{if(this.debug?this.log(`emit(${t})`,t):this.log(`emit(${t})`,r.length),!this.channel.isConnected)return this.log.warn("channel not connected"),!1;let n=await this.encoder.encode({event:t,args:r});return this.channel.postMessage(n),!0}catch(n){this.log.warn(`emit(${t})`,n)}return!1}};o(Ce,"PubSub");function ri(e){return new Ce(e)}o(ri,"usePubSub");function ni(){let e=!0;return(t,r)=>{let n=!1;if(e){e=!1;try{t(),n=!0}finally{e=!0}}else r!==void 0&&r();return n}}o(ni,"useMutex");function oi(){let e=!0;return async(t,r)=>{let n=!1;if(e){e=!1;try{let i=t();M(i)&&await i,n=!0}finally{e=!0}}else if(r!==void 0){let i=r();M(i)&&await i}return n}}o(oi,"useAsyncMutex");var ne=b("network"),De={cache:"no-cache",redirect:"follow"};async function ct(e,t={},r=fetch){try{let n=await r(e,t);if(n.status<400)return n;try{ne.warn(`Fetch of ${e} with ${t} returned status=${n.status}`),ne.warn(`Response: ${await n.text()}`)}catch(i){ne.error("Exception:",i)}}catch(n){ne.error("fetchBasic",n)}}o(ct,"fetchBasic");async function ii(e,t={},r=fetch){try{let n=await ct(e,U(ae(U({method:"GET"},De),{headers:{}}),t),r);if(n)return await n.json()}catch(n){ne.error("fetchJSON error:",n)}}o(ii,"fetchJson");function si(e,t="POST"){return ae(U({method:t},De),{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:ot(e)})}o(si,"fetchOptionsFormURLEncoded");function ai(e,t="POST"){return ae(U({method:t},De),{headers:{"Content-Type":"application/json; charset=utf-8",Accept:"application/json"},body:JSON.stringify(e)})}o(ai,"fetchOptionsJson");async function ui(e,t={},r=fetch){try{let n=await ct(e,U(ae(U({method:"GET"},De),{headers:{}}),t),r);if(n)return await n.text()}catch(n){ne.error("fetchHTML error:",n)}}o(ui,"fetchText");function ft(){if(typeof window!="undefined")return window}o(ft,"getWindow");function gr(){if(typeof navigator!="undefined")return navigator}o(gr,"getNavigator");function li(){var e;return((e=ft())!=null?e:typeof WorkerGlobalScope!="undefined")?self:typeof global!="undefined"?global:Function("return this;")()}o(li,"getGlobal");var T=gr(),P=ft();function mr(e={ios:!1,macos:!1,windows:!1,beaker:!1,electron:!1,wkwebview:!1,pwa:!1,pwaInstalled:!1,browser:!1,node:!1,worker:!1,jest:!1,macosNative:!1,iosNative:!1,appleNative:!1,touch:!1}){var t,r,n,i,s,l,a,u,c;return e.ios=((t=T==null?void 0:T.platform)==null?void 0:t.match(/(iPhone|iPod|iPad)/i))!=null,e.macos=!!((r=T==null?void 0:T.platform)==null?void 0:r.startsWith("Mac")),e.windows=!!((n=T==null?void 0:T.platform)==null?void 0:n.startsWith("Win")),e.beaker=(P==null?void 0:P.beaker)!=null,e.electron=(((s=(i=T==null?void 0:T.userAgent)==null?void 0:i.toLowerCase())==null?void 0:s.indexOf(" electron/"))||-1)>-1&&!e.beaker,e.wkwebview=((l=P==null?void 0:P.webkit)==null?void 0:l.messageHandlers)!=null,e.pwa=(T==null?void 0:T.serviceWorker)!=null,e.pwaInstalled=(T==null?void 0:T.standalone)||((u=(a=P==null?void 0:P.matchMedia)==null?void 0:a.call(P,"(display-mode: standalone)"))==null?void 0:u.matches),e.node=typeof process!="undefined"&&((c=process==null?void 0:process.release)==null?void 0:c.name)==="node",e.browser=!e.electron&&!e.wkwebview&&!e.node,e.worker=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope,e.jest=typeof jest!="undefined",e.macosNative=e.wkwebview&&e.macos,e.iosNative=e.wkwebview&&e.ios,e.appleNative=e.wkwebview,e.touch=P&&"ontouchstart"in P||((T==null?void 0:T.maxTouchPoints)||0)>1||(T==null?void 0:T.msPointerEnabled)&&(P==null?void 0:P.MSGesture)||(P==null?void 0:P.DocumentTouch)&&document instanceof DocumentTouch,e}o(mr,"detect");var yr=o(()=>typeof window!="undefined"&&globalThis===window,"isBrowser"),ci=mr();function fi(e){yr()?window.addEventListener("beforeunload",e):typeof process!="undefined"&&process.on("exit",()=>e)}o(fi,"useExitHandler");function pi(e={}){let{maxParallel:t=3}=e,r=0,n=0,i={};function s(){if(r>=t)return;let a=Object.values(i).filter(u=>!u.running);if(a.length>0){let u;for(let c of a)(u==null||c.priority<u.priority)&&(u=c);u&&(u.running=!0,++r,u.task().then(c=>{(u==null?void 0:u.id)&&delete i[u.id],--r,s()}).catch(c=>{(u==null?void 0:u.id)&&delete i[u.id],--r,s()}))}}o(s,"performNext");function l(a){let u=i[a];u&&u.running!==!0&&delete i[a]}return o(l,"cancel"),{cancel:l,enqueue(a,u){return i[a]==null&&(i[a]={id:a,task:u,priority:++n,running:!1},s()),()=>l(a)}}}o(pi,"usePool");var di=b("zeed:queue"),pt=class{constructor(t={}){this.queue=[];this.isPaused=!1;this.waitToFinish=[];let{name:r=j("queue"),logLevel:n}=t;this.name=r,this.log=b(`zeed:queue:${r}`),this.log.level=n!=null?n:L.off}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.isPaused){this.log("performNext => skip while is paused");return}for(;this.currentTask==null&&!this.isPaused;){let t=this.queue.shift();if(this.log(`performNext => ${t==null?void 0:t.name}`),t==null)break;let{name:r,task:n,resolve:i}=t;this.currentTask=n();let s;try{this.log.info(`start task ${r}`),s=await this.currentTask,this.log(`finished task ${r} with result =`,s)}catch(l){di.warn("Error performing task",l)}i(s),this.currentTask=void 0}for(;this.waitToFinish.length>0;)this.waitToFinish.shift()()}async enqueue(t,r={}){let{immediate:n=!1,name:i=j(this.name)}=r;return n?(this.log.info(`immediate execution ${i}`),await t()):(this.log(`enqueue ${i}`),new Promise(s=>{this.queue.push({name:i,task:t,resolve:s}),this.performNext()}))}async enqueueReentrant(t,r={}){return this.enqueue(t,{immediate:this.currentTask!=null,name:r.name})}async cancelAll(t=!0){this.log("cancelAll");let r=this.queue.map(n=>n.resolve);this.queue=[],r.forEach(n=>n(void 0)),await this.wait()}async pause(){this.log("pause"),this.isPaused=!0,await this.wait()}resume(){this.log("resume"),this.isPaused=!1,this.performNext()}async wait(){if(this.log("wait"),!(this.currentTask==null&&(this.queue.length===0||this.isPaused)))return new Promise(t=>{this.waitToFinish.push(t)})}};o(pt,"SerialQueue");var qa=b("zeed:memstorage"),dt=class{constructor(t={}){this.store={}}setItem(t,r){this.store[t]=W(r)}getItem(t){if(this.store.hasOwnProperty(t))return W(this.store[t])}removeItem(t){delete this.store[t]}clear(){this.store={}}allKeys(){return Object.keys(this.store)}};o(dt,"MemStorage");var oe=!1,ie=oe?b("zeed:throttle"):()=>{};function gi(e,t={}){let{delay:r=100,trailing:n=!0,leading:i=!0}=t,s=0,l=0,a=0,u=Date.now();function c(){s&&(clearTimeout(s),s=void 0)}o(c,"clearExistingTimeout");function p(...f){let m=Date.now(),y=this,x=m-l;function w(){let h=Date.now();return`total ${(h-u).toFixed(1)}ms - elapsed ${(h-l).toFixed(1)}ms - visited ${a}x`}o(w,"debugElapsed");function g(){a=0,l=Date.now(),e.apply(y,f)}if(o(g,"exec"),x>r||!s){oe&&ie("elapsed",w()),i&&(x>r?(oe&&ie("\u{1F680} leading",w()),g()):++a);let h=x>r?r:r-x;ie(`\u23F1 start timeout with ${h.toFixed(1)}ms}`,w()),c(),l=m,s=setTimeout(()=>{oe&&ie("\u23F1 reached timeout",w()),s=0,n&&(!i||a>0)&&(oe&&ie("\u{1F680} trailing",w()),g())},h)}else++a,oe&&ie("visited",w())}return o(p,"wrapper"),p.cancel=c,p.dispose=c,p}o(gi,"throttle");function mi(e,t={}){let{delay:r=100}=t,n=0;function i(){n&&(clearTimeout(n),n=0)}o(i,"clearExistingTimeout");function s(...l){let a=this;i(),n=setTimeout(()=>{n=0,e.apply(a,l)},r)}return o(s,"wrapper"),s.cancel=i,s.dispose=i,s}o(mi,"debounce");var Ie=O(require("crypto"),1);try{Ie.default&&Ie.default.webcrypto&&typeof globalThis!="undefined"&&typeof globalThis.crypto=="undefined"&&(globalThis.crypto=Ie.default.webcrypto)}catch(e){console.warn("Failed to polyfill webcrypto",e)}var pe=O(require("fs"),1),hr=O(require("path"),1),de=b("zeed:env"),yi=`
|
|
5
|
+
`,hi=/^\s*([\w_.-]+)\s*=\s*(.*)?\s*$/,xi=/\\n/g,bi=/\n|\r|\r\n/;function xr(e,t={}){let r={};return e.toString().split(bi).forEach(function(n,i){let s=n.match(hi);if(s!=null){let l=s[1],a=s[2]||"",u=a.length-1,c=a[0]==='"'&&a[u]==='"';a[0]==="'"&&a[u]==="'"||c?(a=a.substring(1,u),c&&(a=a.replace(xi,yi))):a=a.trim(),r[l]=a}else de.debug(`did not match key and value when parsing line ${i+1}: ${n}`)}),r}o(xr,"parse");function br(e,t="."){return(0,hr.resolve)(process.cwd(),e!=null?e:t)}o(br,"stringToPath");function wr(e,t=""){return e==null&&(e=t),br(String(e).trim(),t)}o(wr,"valueToPath");var Ue=wr;function wi(e={}){var i,s,l,a;let t=(s=e==null?void 0:e.path)!=null?s:Ue((i=e==null?void 0:e.filename)!=null?i:".env"),r=(l=e==null?void 0:e.encoding)!=null?l:"utf8",n=(e==null?void 0:e.debug)||!1;n!==!0&&(de.level=L.off);try{let u=pe.default.existsSync(t)?xr(pe.default.readFileSync(t,{encoding:r}),{debug:n}):{},c=pe.default.existsSync(t+".local")?xr(pe.default.readFileSync(t+".local",{encoding:r}),{debug:n}):{},p=Object.assign({},u,c),f=(a=e==null?void 0:e.env)!=null?a:process.env;return Object.entries(p).forEach(([m,y])=>{typeof(e==null?void 0:e.prefix)=="string"&&(m=(e==null?void 0:e.prefix)+m),Object.prototype.hasOwnProperty.call(f,m)?de.debug(`"${m}" is already defined and will not be overwritten`):y!=null&&(de.info(`set env.${m} = ${y}`),f[m]=y)}),{parsed:p}}catch(u){return de.error(u),{error:u}}}o(wi,"setupEnv");var C=O(require("fs"),1),ge=O(require("path"),1);var gt=b("zeed:filestorage"),mt=class{constructor(t={}){this.store={};this.fileKeys=void 0;this.pretty=!1;var r,n,i,s;this.dirname=(0,ge.resolve)(process.cwd(),t.path||".fileStorage"),this.pretty=!!t.pretty,this.extension=(r=t.extension)!=null?r:".json",t.extension&&!this.extension.startsWith(".")&&(this.extension="."+this.extension),this.extensionLength=this.extension.length,this.objectToString=(n=t.objectToString)!=null?n:l=>this.pretty?JSON.stringify(l,null,2):JSON.stringify(l),this.objectFromString=(i=t.objectFromString)!=null?i:l=>{try{return JSON.parse(l)}catch(a){gt.warn(`fileStorage parse error '${a}' in`,l)}},this.keyToFilename=(s=t.keyToFilename)!=null?s:tt}setItem(t,r){this.store[t]=W(r);try{let n=this.objectToString(r),i=this.getPath(t);(0,C.mkdirSync)((0,ge.dirname)(i),{recursive:!0}),(0,C.writeFileSync)(i,n,"utf8")}catch(n){gt.error("setItem error",n)}}getPath(t){return(0,ge.resolve)(this.dirname,this.keyToFilename(t)+this.extension)}getBuffer(t){let r=this.getPath(t);return Buffer.from((0,C.readFileSync)(r))}getItem(t){let r=this.store[t];if(r!==null){if(r!=null)return W(r);try{let n=this.getPath(t),i=(0,C.readFileSync)(n,"utf8");if(i!=null){let s=this.objectFromString(i);return this.store[t]=s,s}}catch(n){gt.warn("getItem error",n),this.store[t]=null}}}removeItem(t){if(delete this.store[t],this.fileKeys!=null){let r=this.fileKeys.indexOf(t);r!==-1&&this.fileKeys.splice(r,1)}try{let r=this.getPath(t);(0,C.unlinkSync)(r)}catch{}}clear(){this.fileKeys=[],this.store={},(0,C.rmSync)(this.dirname,{recursive:!0,force:!0})}allKeys(){if(this.fileKeys==null)try{this.fileKeys=(0,C.readdirSync)(this.dirname,{withFileTypes:!0}).filter(r=>!r.isDirectory()&&r.name.endsWith(this.extension)).map(r=>r.name.slice(0,-this.extensionLength))||[]}catch{}let t=[...this.fileKeys||[]];for(let r of Object.keys(this.store))t.includes(r)||t.push(r);return t.sort(),t}};o(mt,"FileStorage");var Oe=O(require("fs"),1),Fe=O(require("path"),1);var Tr={};function yt(e,t={}){let{level:r=L.all,filter:n="*"}=t;e=(0,Fe.resolve)(process.cwd(),e),(0,Oe.mkdirSync)((0,Fe.dirname)(e),{recursive:!0});var i=(0,Oe.createWriteStream)(e,{flags:"a"});let s=F(n),l=q(r);return a=>{if(!l(a.level)||!s(a.name))return;let u=new Date().toISOString(),c=a.name||"",p=Tr[c||""];p==null&&(Tr[c]=p);let f=[`[${c||"*"}]`,ce(a.messages,{pretty:!1})];function m(...y){i.write(y.join(" ")+`
|
|
6
|
+
`)}switch(o(m,"write"),a.level){case L.info:m(u,"I|* ",...f);break;case L.warn:m(u,"W|** ",...f);break;case L.error:m(u,"E|***",...f);break;default:m(u,"D| ",...f);break}}}o(yt,"LoggerFileHandler");var Lt=O(require("tty"),1);var ht=O(require("path"),1);function Lr(e){var t,r;return typeof e!="string"?[]:((r=(t=e==null?void 0:e.split(`
|
|
7
|
+
`))==null?void 0:t.map(n=>{let i=n.match(/^\s+at.*(\((.*)\)|file:\/\/(.*)$)/);if(i){let s=i[3]||i[2];return s.endsWith(")")&&(s=s.slice(0,-1)),s}}))==null?void 0:r.filter(n=>n!=null))||[]}o(Lr,"getStackLlocationList");var xt=(0,ht.resolve)(process.cwd()),vr,Ar,bt=((vr=process.env)==null?void 0:vr.HOME)?(0,ht.resolve)((Ar=process.env)==null?void 0:Ar.HOME):"";function Er(e){if(e.includes("/node_modules/"))return"";let t="file://";return e.startsWith(t)?e.substr(t.length):xt&&e.startsWith(xt)?e.substr(xt.length+1):(bt&&e.startsWith(bt)&&(e="~/"+e.substr(bt.length+1)),e)}o(Er,"pathStripCwd");function Ti(e){let t=e.match(/^\s*at.*(\((.*)\)|file:\/\/(.*)$)/);if(t){let r=t[3]||t[2];return r.endsWith(")")&&(r=r.slice(0,-1)),r}return""}o(Ti,"extractFileInfo");function $e(e=2,t=!0){var i;let r=new Error().stack||"",n=(i=Lr(r))==null?void 0:i[e];return n&&t&&(n=Er(n)),n||""}o($e,"getSourceLocation");function wt(){return new Error().stack||""}o(wt,"getStack");function Tt(e,t=!0){let r="",n=new Error().stack||"";if(typeof n=="string"){let i=n.split(`
|
|
8
|
+
`).map(l=>l.trim()),s=i.findIndex(l=>e.some(a=>l.startsWith(a)));r=i[s+1],r&&(r=Ti(r)),r&&t&&(r=Er(r))}return r}o(Tt,"getSourceLocationByPrecedingPattern");function Sr(){try{return Lt.default.isatty(process.stdout.fd)}catch{}return!1}o(Sr,"isTTY");var Pr=[6,2,3,4,5,1];function Li(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Pr[Math.abs(t)%Pr.length]}o(Li,"selectColor");var Mr={},Ei=ee(),Et=Lt.default.isatty(process.stderr.fd);function Re(...e){return process.stderr.write(ce(e)+`
|
|
9
|
+
`)}o(Re,"log");var me={BOLD:"[1m",UNBOLD:"[2m",RED:"[31m",GREEN:"[32m",BLUE:"[34m",PURPLE:"[35m",GRAY:"[37m",ORANGE:"[38;5;208m",UNCOLOR:"[0m"};var kr="[0m";function se(e,t){return`${t===8?me.ORANGE:"[3"+(t<8?t:"8;5;"+t)+"m"}${e}${kr}`}o(se,"colorString");function vt(e,t,r=!0){return e.map(n=>{if(typeof n!="string")return n;let i=t,s=kr;return r&&(i=`${me.BOLD}${i}`,s=`${s}${me.BOLD}`),`${i}${n}${s}`})}o(vt,"colorStringList");var Cr="loggerStackTraceDebug-7d38e5a9214b58d29734374cdb9521fd964d7485";function At(e={}){let{level:t=void 0,filter:r=void 0,colors:n=Sr(),levelHelper:i=!0,nameBrackets:s=!0,padding:l=0,fill:a=0,stack:u=!0}=e,c=F(r),p=q(t);return f=>{var S;if(!p(f.level)||!c(f.name))return;let m=ee(),y=f.name||"",x=Mr[y||""];x==null&&(x={color:Li(y)},Mr[y]=x);let w=it(m-Ei),g,h=s?`[${y}]`:y;if(l>0&&(h=h.padStart(l," ")),a>0&&(h=h.padEnd(a," ")),n&&Et){let E=x.color;g=[se(h,E)+" | "],f.level===L.warn?g.push(...vt(f.messages,me.ORANGE)):f.level===L.error?g.push(...vt(f.messages,me.RED)):g.push(...f.messages),g.push(se(`+${w}`,E))}else g=[h,...f.messages],g.push(`+${w}`);if(((S=f.messages)==null?void 0:S[0])===Cr&&console.log(wt()),u){let E="";typeof u=="boolean"?(E=Tt(["at Function.","at null.log (","at log ("],!0),E||(E=$e(0,!0))):E=$e(typeof u=="number"?u:3,!0),E&&g.push(se(`(${E})`,7))}switch(f.level){case L.info:i&&(g[0]="I|* "+g[0]),Re(...g);break;case L.warn:i&&(g[0]=(n&&Et?se("W|** ",8):"W|** ")+g[0]),Re(...g);break;case L.error:i&&(g[0]=(n&&Et?se("E|*** ",1):"E|*** ")+g[0]),Re(...g);break;default:i&&(g[0]="D| "+g[0]),Re(...g);break}}}o(At,"LoggerNodeHandler");function vi(){var r;let e=[At({padding:32,nameBrackets:!1})],t=(r=process.env.ZEED_LOG)!=null?r:process.env.LOG;t&&e.unshift(yt(Ue(t))),b.setHandlers(e)}o(vi,"setupLogContextNode");vi();module.exports=Br(Ai);0&&(module.exports={Channel,CryptoEncoder,Currency,DAY_MS,Day,Emitter,FileStorage,JsonEncoder,LocalChannel,LogLevel,LogLevelAlias,Logger,LoggerConsoleHandler,LoggerContext,LoggerFileHandler,LoggerNodeHandler,MemStorage,PubSub,SerialQueue,Uint8ArrayToJson,Uint8ArrayToString,arrayEmptyInPlace,arrayFilterInPlace,arrayFlatten,arrayIntersection,arrayIsEqual,arrayMax,arrayMin,arrayMinus,arrayRandomElement,arrayRemoveElement,arraySetElement,arrayShuffle,arrayShuffleForce,arrayShuffleInPlace,arraySorted,arraySortedNumbers,arraySymmetricDifference,arrayToggleInPlace,arrayUnion,arrayUnique,between,cloneJsonObject,cloneObject,cmp,colorString,colorStringList,composeOrderby,createArray,createPromiseProxy,csv,currency,day,debounce,decodeBase16,decodeBase32,decodeBase58,decodeBase62,decodeBase64,decrypt,deepEqual,deepMerge,deriveKeyPbkdf2,detect,digest,empty,encodeBase16,encodeBase32,encodeBase58,encodeBase62,encodeBase64,encodeQuery,encrypt,endSortWeight,equalBinary,escapeHTML,escapeRegExp,fakeWorkerPair,fetchBasic,fetchJson,fetchOptionsFormURLEncoded,fetchOptionsJson,fetchText,fixBrokenUth8String,forEachDay,formatMessages,formatMilliseconds,fromCamelCase,getGlobal,getGlobalContext,getGlobalEmitter,getNamespaceFilterString,getNavigator,getSourceLocation,getSourceLocationByPrecedingPattern,getStack,getStackLlocationList,getTimestamp,getWindow,immediate,isArray,isBoolean,isBrowser,isEven,isHalf,isInteger,isLocalHost,isNullOrUndefined,isNumber,isObject,isPrimitive,isPromise,isRecord,isSafeInteger,isString,isTTY,isTimeout,jsonStringify,jsonToUint8Array,last,lazyListener,linkifyPlainText,loggerStackTraceDebug,messages,moveSortWeight,parseDate,parseOrderby,parseQuery,platform,promisify,qid,randomBoolean,randomFloat,randomInt,randomUint8Array,renderMessages,roundDown,roundHalfAwayFromZero,roundHalfDown,roundHalfEven,roundHalfOdd,roundHalfTowardsZero,roundHalfUp,roundUp,setupEnv,size,sleep,sortedItems,sortedOrderby,startSortWeight,stringToBoolean,stringToFloat,stringToInteger,stringToPath,stringToUInt8Array,suid,suidBytes,suidBytesDate,suidDate,throttle,timeout,timeoutReached,timoutError,toBase64,toBase64Url,toBool,toCamelCase,toCapitalize,toCapitalizeWords,toFloat,toHex,toHumanReadableUrl,toInt,toPath,toString,toUint8Array,toValidFilename,today,tryTimeout,uname,unescapeHTML,useAsyncMutex,useBase,useDefer,useDispose,useDisposer,useEventListener,useExitHandler,useInterval,useLevelFilter,useMessageHub,useMutex,useNamespaceFilter,usePool,usePubSub,useTimeout,uuid,uuid32bit,uuidB32,uuidBytes,uuidv4,valueToBoolean,valueToFloat,valueToInteger,valueToPath,valueToString,waitOn});
|
|
10
10
|
//# sourceMappingURL=index.node.cjs.map
|