jetstream v2 in zig stream.waow.tech
Something went wrong. Try again.
12var g=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),$=e=>({get value(){let t=e();return g(this,"value",t)}}),v=Array.isArray,S=e=>typeof e=="object"&&e!==null&&!v(e),w=$(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});var x=(e,t)=>e?{ok:!1,code:"join",left:e,right:t}:t,m=(e,t)=>({ok:!1,code:"prepend",key:e,tree:t}),E=e=>({ok:!0,value:e}),B=0,y=1,G=2,M=(e,t)=>{let{ok:n,msg:c,...r}=e;return{...r,path:t}},C=(e,t=[],n=[])=>{for(;;)switch(e.code){case"join":{C(e.left,t.slice(),n),e=e.right;continue}case"prepend":{t.push(e.key),e=e.tree;continue}default:return n.push(M(e,t)),n}},O=e=>{let t=0;for(;;)switch(e.code){case"join":{t+=O(e.left),e=e.right;continue}case"prepend":{e=e.tree;continue}default:return t+1}};var Y=e=>{let t="",n=0;for(;;){switch(e.code){case"join":{n+=O(e.right),e=e.left;continue}case"prepend":{t+=`.${e.key}`,e=e.tree;continue}}break}let c=e.msg(),r=`${e.code} at ${t||"."} (${c})`;return n>0&&(r+=` (+${n} other issue(s))`),r},I=class extends Error{name="ValidationError";#e;constructor(t){super(),this.#e=t}get message(){return Y(this.#e)}get issues(){return C(this.#e)}};var P=(e,t,n)=>{let c=B;n?.strict&&(c|=G);let r=e["~run"](t,c);if(r===void 0)return t;if(r.ok)return r.value;throw new I(r)},L=(e,t=[],n=[])=>{for(;;)switch(e.code){case"join":{L(e.left,t.slice(),n),e=e.right;continue}case"prepend":{t.push(e.key),e=e.tree;continue}default:return n.push({message:e.msg(),path:t.length>0?t:void 0}),n}},_=e=>({version:1,vendor:"@atcute/lexicons",validate(t){let n=e["~run"](t,B);return n===void 0?{value:t}:n.ok?{value:n.value}:{issues:L(n)}}});var A={ok:!1,code:"invalid_type",expected:"integer",msg(){return"expected integer"}},F={kind:"schema",type:"integer","~run"(e,t){if(typeof e!="number"||!Number.isSafeInteger(e))return A},get"~standard"(){return g(this,"~standard",_(this))}},d=()=>F;var D={ok:!1,code:"invalid_type",expected:"string",msg(){return"expected string"}},H={kind:"schema",type:"string",format:null,"~run"(e,t){if(typeof e!="string")return D},get"~standard"(){return g(this,"~standard",_(this))}},U=()=>H;var K=e=>e.type==="optional",W={ok:!1,code:"invalid_type",expected:"array",msg(){return"expected array"}},R=e=>{let t=$(()=>typeof e=="function"?e():e);return{kind:"schema",type:"array",get item(){return g(this,"item",t.value)},get"~run"(){let n=t.value;return g(this,"~run",(r,k)=>{if(!v(r))return W;let o,s;for(let i=0,a=r.length;i<a;i++){let l=r[i],u=n["~run"](l,k);if(u!==void 0)if(u.ok)s===void 0&&(s=r.slice()),s[i]=u.value;else{if(k&y)return m(i,u);o=x(o,m(i,u))}}if(o!==void 0)return o;if(s!==void 0)return E(s)})},get"~standard"(){return g(this,"~standard",_(this))}}};var N={ok:!1,code:"invalid_type",expected:"object",msg(){return"expected object"}},J={ok:!1,code:"missing_value",msg(){return"missing value"}},X=(e,t,n)=>{t==="__proto__"?Object.defineProperty(e,t,{value:n}):e[t]=n},j=e=>{let t=$(()=>{let n=[];for(let c in e){let r=e[c];n.push({key:c,schema:r,optional:K(r),missing:m(c,J)})}return n});return{kind:"schema",type:"object",get shape(){let n=t.value,c={};for(let r of n)c[r.key]=r.schema;return g(this,"shape",c)},get"~run"(){let n=t.value,c=n.length,r=()=>{let o=[["$ok",E],["$joinIssues",x],["$prependPath",m]],s="let $iss,$out;";for(let a=0;a<c;a++){let l=n[a],u=l.key,f=JSON.stringify(u),p=`_${a}`;if(s+=`{const $val=$in[${f}];`,l.optional?s+="if($val!==undefined){":s+=`if($val!==undefined||${f} in $in){`,s+=`const $res=${p}$schema["~run"]($val,$flags);if($res!==undefined)if($res.ok)${u!=="__proto__"?`($out??={...$in})[${f}]=$res.value`:`Object.defineProperty($out??={...$in},${f},{value:$res.value})`};else if((($iss=$joinIssues($iss,$prependPath(${f},$res))),$flags&${y}))return $iss;}`,l.optional){let h=l.schema,z=h.wrapped,b=h.default;if(o.push([`${p}$schema`,z]),b!==void 0){let T=typeof b=="function"?`${p}$default()`:`${p}$default`;o.push([`${p}$default`,b]),s+=u!=="__proto__"?`else($out??={...$in})[${f}]=${T};`:`else Object.defineProperty($out??={...$in},${f},{value:${T}});`}}else o.push([`${p}$schema`,l.schema]),o.push([`${p}$missing`,l.missing]),s+=`else if((($iss=$joinIssues($iss,${p}$missing)),$flags&${y}))return $iss;`;s+="}"}return s+="if($iss!==undefined)return $iss;if($out!==undefined)return $ok($out);",new Function(`[${o.map(([a])=>a).join(",")}]`,`return function matcher($in,$flags){${s}}`)(o.map(([,a])=>a))};if(w.value){let o=r();return g(this,"~run",(i,a)=>S(i)?o(i,a):N)}return g(this,"~run",(o,s)=>{if(!S(o))return N;let i,a;for(let l=0;l<c;l++){let u=n[l],f=u.key,p=o[f];if(!u.optional&&p===void 0&&!(f in o)){if(i=x(i,u.missing),s&y)return i;continue}let h=u.schema["~run"](p,s);if(h!==void 0){if(h.ok)a===void 0&&(a={...o}),X(a,f,h.value);else if(i=x(i,m(f,h)),s&y)return i}}if(i!==void 0)return i;if(a!==void 0)return E(a)})},get"~standard"(){return g(this,"~standard",_(this))}}};var Q=j({name:U(),index:d(),fileBytes:d(),compressedFrameBytes:d(),uncompressedBlockBytes:d(),framingBytes:d(),headerBytes:d(),footerBytes:d(),blocks:d(),collections:d(),mixedNamespaceFrameBytes:d()}),Z=j({measuredAt:d(),segmentCount:d(),sealedFileBytes:d(),probes:R(Q)}),te=e=>P(Z,e);export{te as parseStorageReport};