diff --git a/src/dashboard-bundle.ts b/src/dashboard-bundle.ts index e877e01..27b0c12 100644 --- a/src/dashboard-bundle.ts +++ b/src/dashboard-bundle.ts @@ -1,71 +1,71 @@ // AUTO-GENERATED by scripts/build-dashboard-ui.mjs — do not edit by hand. // Source: src/dashboard/ (Svelte). Run `pnpm run build:dashboard-ui` to regenerate. -// Size: 96777 chars (94.5 KB). +// Size: 104017 chars (101.6 KB). -export const DASHBOARD_JS = `"use strict";(()=>{var gs=globalThis.process?.env?.NODE_ENV,v=gs&&!gs.toLowerCase().startsWith("prod");var Vt=Array.isArray,$s=Array.prototype.indexOf,bt=Array.prototype.includes,Nr=Array.from,go=Object.keys,$e=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,Nn=Object.getOwnPropertyDescriptors,$o=Object.prototype,bs=Array.prototype,fr=Object.getPrototypeOf,bo=Object.isExtensible;var ze=()=>{};function xs(e){return e()}function Rr(e){for(var t=0;t{e=n,t=s});return{promise:r,resolve:e,reject:t}}var Ce=Symbol("$state"),Cn=Symbol("legacy props"),ys=Symbol(""),On=Symbol("proxy path"),In=Symbol("attributes"),Jr=Symbol("class"),Qr=Symbol("style"),en=Symbol("text");var xo=Symbol("hmr anchor"),Qt=new class extends Error{name="StaleReactionError";message="The reaction that called \`getAbortSignal()\` was re-run or destroyed"},yo=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var ur=3,rt=8;function ws(e){if(v){let t=new Error(\`invariant_violation +export const DASHBOARD_JS = `"use strict";(()=>{var xs=globalThis.process?.env?.NODE_ENV,h=xs&&!xs.toLowerCase().startsWith("prod");var or=Array.isArray,ys=Array.prototype.indexOf,It=Array.prototype.includes,Hr=Array.from,xo=Object.keys,Re=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,qn=Object.getOwnPropertyDescriptors,yo=Object.prototype,ws=Array.prototype,Sr=Object.getPrototypeOf,wo=Object.isExtensible;var Ge=()=>{};function Es(e){return e()}function Vr(e){for(var t=0;t{e=o,t=i});return{promise:r,resolve:e,reject:t}}function fn(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let r=[];for(let o of e)if(r.push(o),r.length===t)break;return r}var Pe=Symbol("$state"),Ln=Symbol("legacy props"),ks=Symbol(""),Pn=Symbol("proxy path"),zn=Symbol("attributes"),un=Symbol("class"),dn=Symbol("style"),pn=Symbol("text");var Eo=Symbol("hmr anchor"),hr=new class extends Error{name="StaleReactionError";message="The reaction that called \`getAbortSignal()\` was re-run or destroyed"},ko=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var Ar=3,ut=8;function Ts(e){if(h){let t=new Error(\`invariant_violation An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \\u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "\${e}" -https://svelte.dev/e/invariant_violation\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/invariant_violation")}function Ts(){if(v){let e=new Error("async_derived_orphan\\nCannot create a \`$derived(...)\` with an \`await\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function ks(){if(v){let e=new Error(\`derived_references_self +https://svelte.dev/e/invariant_violation\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/invariant_violation")}function As(){if(h){let e=new Error("async_derived_orphan\\nCannot create a \`$derived(...)\` with an \`await\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function Rs(){if(h){let e=new Error(\`derived_references_self A derived value cannot reference itself recursively -https://svelte.dev/e/derived_references_self\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function wo(e,t,r){if(v){let n=new Error(\`each_key_duplicate +https://svelte.dev/e/derived_references_self\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function To(e,t,r){if(h){let o=new Error(\`each_key_duplicate \${r?\`Keyed each block has duplicate key \\\`\${r}\\\` at indexes \${e} and \${t}\`:\`Keyed each block has duplicate key at indexes \${e} and \${t}\`} -https://svelte.dev/e/each_key_duplicate\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function Ss(e,t,r){if(v){let n=new Error(\`each_key_volatile +https://svelte.dev/e/each_key_duplicate\`);throw o.name="Svelte error",o}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function Ns(e,t,r){if(h){let o=new Error(\`each_key_volatile Keyed each block has key that is not idempotent \\u2014 the key for item at index \${e} was \\\`\${t}\\\` but is now \\\`\${r}\\\`. Keys must be the same each time for a given item -https://svelte.dev/e/each_key_volatile\`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_volatile")}function As(e){if(v){let t=new Error(\`effect_in_teardown +https://svelte.dev/e/each_key_volatile\`);throw o.name="Svelte error",o}else throw new Error("https://svelte.dev/e/each_key_volatile")}function Cs(e){if(h){let t=new Error(\`effect_in_teardown \\\`\${e}\\\` cannot be used inside an effect cleanup function -https://svelte.dev/e/effect_in_teardown\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ns(){if(v){let e=new Error("effect_in_unowned_derived\\nEffect cannot be created inside a \`$derived\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Rs(e){if(v){let t=new Error(\`effect_orphan +https://svelte.dev/e/effect_in_teardown\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function Os(){if(h){let e=new Error("effect_in_unowned_derived\\nEffect cannot be created inside a \`$derived\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Is(e){if(h){let t=new Error(\`effect_orphan \\\`\${e}\\\` can only be used inside an effect (e.g. during component initialisation) -https://svelte.dev/e/effect_orphan\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function Cs(){if(v){let e=new Error(\`effect_update_depth_exceeded +https://svelte.dev/e/effect_orphan\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function Ms(){if(h){let e=new Error(\`effect_update_depth_exceeded Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state -https://svelte.dev/e/effect_update_depth_exceeded\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Os(){if(v){let e=new Error(\`hydration_failed +https://svelte.dev/e/effect_update_depth_exceeded\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ds(){if(h){let e=new Error(\`hydration_failed Failed to hydrate the application -https://svelte.dev/e/hydration_failed\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function Is(e){if(v){let t=new Error(\`rune_outside_svelte +https://svelte.dev/e/hydration_failed\`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function qs(e){if(h){let t=new Error(\`rune_outside_svelte The \\\`\${e}\\\` rune is only available inside \\\`.svelte\\\` and \\\`.svelte.js/ts\\\` files -https://svelte.dev/e/rune_outside_svelte\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function Ds(){if(v){let e=new Error("state_descriptors_fixed\\nProperty descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.\\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ms(){if(v){let e=new Error("state_prototype_fixed\\nCannot set prototype of \`$state\` object\\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function qs(){if(v){let e=new Error("state_unsafe_mutation\\nUpdating state inside \`$derived(...)\`, \`$inspect(...)\` or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\`\\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Fs(){if(v){let e=new Error("svelte_boundary_reset_onerror\\nA \`\` \`reset\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Rt={};var re=Symbol(),Ze=Symbol("filename");var Dn="http://www.w3.org/1999/xhtml",tn="http://www.w3.org/2000/svg",Eo="http://www.w3.org/1998/Math/MathML";var Ct="font-weight: bold",Ot="font-weight: normal";function Ls(e){v?console.warn(\`%c[svelte] await_reactivity_loss +https://svelte.dev/e/rune_outside_svelte\`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function Fs(){if(h){let e=new Error("state_descriptors_fixed\\nProperty descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.\\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ls(){if(h){let e=new Error("state_prototype_fixed\\nCannot set prototype of \`$state\` object\\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ps(){if(h){let e=new Error("state_unsafe_mutation\\nUpdating state inside \`$derived(...)\`, \`$inspect(...)\` or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\`\\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function zs(){if(h){let e=new Error("svelte_boundary_reset_onerror\\nA \`\` \`reset\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Ut={};var oe=Symbol(),st=Symbol("filename");var Bn="http://www.w3.org/1999/xhtml",_n="http://www.w3.org/2000/svg",So="http://www.w3.org/1998/Math/MathML";var jt="font-weight: bold",Gt="font-weight: normal";function Bs(e){h?console.warn(\`%c[svelte] await_reactivity_loss %cDetected reactivity loss when reading \\\`\${e}\\\`. This happens when state is read in an async function after an earlier \\\`await\\\` -https://svelte.dev/e/await_reactivity_loss\`,Ct,Ot):console.warn("https://svelte.dev/e/await_reactivity_loss")}function Ps(e,t){v?console.warn(\`%c[svelte] await_waterfall +https://svelte.dev/e/await_reactivity_loss\`,jt,Gt):console.warn("https://svelte.dev/e/await_reactivity_loss")}function Ys(e,t){h?console.warn(\`%c[svelte] await_waterfall %cAn async derived, \\\`\${e}\\\` (\${t}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app -https://svelte.dev/e/await_waterfall\`,Ct,Ot):console.warn("https://svelte.dev/e/await_waterfall")}function zs(){v?console.warn(\`%c[svelte] derived_inert +https://svelte.dev/e/await_waterfall\`,jt,Gt):console.warn("https://svelte.dev/e/await_waterfall")}function Hs(){h?console.warn(\`%c[svelte] derived_inert %cReading a derived belonging to a now-destroyed effect may result in stale values -https://svelte.dev/e/derived_inert\`,Ct,Ot):console.warn("https://svelte.dev/e/derived_inert")}function Bs(e,t,r){v?console.warn(\`%c[svelte] hydration_attribute_changed +https://svelte.dev/e/derived_inert\`,jt,Gt):console.warn("https://svelte.dev/e/derived_inert")}function Vs(e,t,r){h?console.warn(\`%c[svelte] hydration_attribute_changed %cThe \\\`\${e}\\\` attribute on \\\`\${t}\\\` changed its value between server and client renders. The client value, \\\`\${r}\\\`, will be ignored in favour of the server value -https://svelte.dev/e/hydration_attribute_changed\`,Ct,Ot):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Ys(e){v?console.warn(\`%c[svelte] hydration_html_changed +https://svelte.dev/e/hydration_attribute_changed\`,jt,Gt):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Us(e){h?console.warn(\`%c[svelte] hydration_html_changed %c\${e?\`The value of an \\\`{@html ...}\\\` block \${e} changed between server and client renders. The client value will be ignored in favour of the server value\`:"The value of an \`{@html ...}\` block changed between server and client renders. The client value will be ignored in favour of the server value"} -https://svelte.dev/e/hydration_html_changed\`,Ct,Ot):console.warn("https://svelte.dev/e/hydration_html_changed")}function er(e){v?console.warn(\`%c[svelte] hydration_mismatch +https://svelte.dev/e/hydration_html_changed\`,jt,Gt):console.warn("https://svelte.dev/e/hydration_html_changed")}function gr(e){h?console.warn(\`%c[svelte] hydration_mismatch %c\${e?\`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near \${e}\`:"Hydration failed because the initial UI does not match what was rendered on the server"} -https://svelte.dev/e/hydration_mismatch\`,Ct,Ot):console.warn("https://svelte.dev/e/hydration_mismatch")}function Hs(){v?console.warn(\`%c[svelte] lifecycle_double_unmount +https://svelte.dev/e/hydration_mismatch\`,jt,Gt):console.warn("https://svelte.dev/e/hydration_mismatch")}function js(){h?console.warn(\`%c[svelte] lifecycle_double_unmount %cTried to unmount a component that was not mounted -https://svelte.dev/e/lifecycle_double_unmount\`,Ct,Ot):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Mn(e){v?console.warn(\`%c[svelte] state_proxy_equality_mismatch +https://svelte.dev/e/lifecycle_double_unmount\`,jt,Gt):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Yn(e){h?console.warn(\`%c[svelte] state_proxy_equality_mismatch %cReactive \\\`$state(...)\\\` proxies and the values they proxy have different identities. Because of this, comparisons with \\\`\${e}\\\` will produce unexpected results -https://svelte.dev/e/state_proxy_equality_mismatch\`,Ct,Ot):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Vs(){v?console.warn(\`%c[svelte] state_proxy_unmount +https://svelte.dev/e/state_proxy_equality_mismatch\`,jt,Gt):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Gs(){h?console.warn(\`%c[svelte] state_proxy_unmount %cTried to unmount a state proxy, rather than a component -https://svelte.dev/e/state_proxy_unmount\`,Ct,Ot):console.warn("https://svelte.dev/e/state_proxy_unmount")}function Us(){v?console.warn("%c[svelte] svelte_boundary_reset_noop\\n%cA \`\` \`reset\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Ct,Ot):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var T=!1;function de(e){T=e}var D;function j(e){if(e===null)throw er(),Rt;return D=e}function be(){return j(xe(D))}function m(e){if(T){if(xe(D)!==null)throw er(),Rt;D=e}}function nn(e=1){if(T){for(var t=e,r=D;t--;)r=xe(r);D=r}}function It(e=!0){for(var t=0,r=D;;){if(r.nodeType===rt){var n=r.data;if(n==="]"){if(t===0)return r;t-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}var s=xe(r);e&&r.remove(),r=s}}function on(e){if(!e||e.nodeType!==rt)throw er(),Rt;return e.data}function qn(e){return e===this.v}function Fn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Ln(e){return!Fn(e,this.v)}var ye=!1,tr=!1,xt=!1;function js(){tr=!0}var sn=null;function Be(e,t){return e.label=t,zn(e.v,t),e}function zn(e,t){return e?.[On]?.(t),e}function yt(e){let t=new Error,r=$a();return r.length===0?null:(r.unshift(\` -\`),$e(t,"stack",{value:r.join(\` -\`)}),$e(t,"name",{value:e}),t)}function $a(){let e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let t=new Error().stack;if(Error.stackTraceLimit=e,!t)return[];let r=t.split(\` -\`),n=[];for(let s=0;s{t===dr&&Xs()})}dr.push(e)}function Zs(){for(;dr.length>0;)Xs()}var ko=new WeakMap;function Yn(e){var t=E;if(t===null)return C.f|=8388608,e;if(v&&e instanceof Error&&!ko.has(e)&&ko.set(e,ba(e,t)),(t.f&32768)===0&&(t.f&4)===0)throw v&&!t.parent&&e instanceof Error&&Js(e),e;pt(e,t)}function pt(e,t){for(;t!==null;){if((t.f&128)!==0){if((t.f&32768)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw v&&e instanceof Error&&Js(e),e}function ba(e,t){let r=tt(e,"message");if(!(r&&!r.configurable)){for(var n=ln?" ":" ",s=\` -\${n}in \${t.fn?.name||""}\`,o=t.ctx;o!==null;)s+=\` -\${n}in \${o.function?.[Ze].split("/").pop()}\`,o=o.p;return{message:e.message+\` -\${s} +https://svelte.dev/e/state_proxy_unmount\`,jt,Gt):console.warn("https://svelte.dev/e/state_proxy_unmount")}function Ws(){h?console.warn("%c[svelte] svelte_boundary_reset_noop\\n%cA \`\` \`reset\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop",jt,Gt):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var S=!1;function $e(e){S=e}var L;function J(e){if(e===null)throw gr(),Ut;return L=e}function Ne(){return J(Ce(L))}function v(e){if(S){if(Ce(L)!==null)throw gr(),Ut;L=e}}function mn(e=1){if(S){for(var t=e,r=L;t--;)r=Ce(r);L=r}}function Wt(e=!0){for(var t=0,r=L;;){if(r.nodeType===ut){var o=r.data;if(o==="]"){if(t===0)return r;t-=1}else(o==="["||o==="[!"||o[0]==="["&&!isNaN(Number(o.slice(1))))&&(t+=1)}var i=Ce(r);e&&r.remove(),r=i}}function hn(e){if(!e||e.nodeType!==ut)throw gr(),Ut;return e.data}function Hn(e){return e===this.v}function Vn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Un(e){return!Vn(e,this.v)}var Oe=!1,$r=!1,Mt=!1;function Ks(){$r=!0}var gn=null;function We(e,t){return e.label=t,Gn(e.v,t),e}function Gn(e,t){return e?.[Pn]?.(t),e}function Dt(e){let t=new Error,r=wa();return r.length===0?null:(r.unshift(\` +\`),Re(t,"stack",{value:r.join(\` +\`)}),Re(t,"name",{value:e}),t)}function wa(){let e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let t=new Error().stack;if(Error.stackTraceLimit=e,!t)return[];let r=t.split(\` +\`),o=[];for(let i=0;i{t===Rr&&Qs()})}Rr.push(e)}function ei(){for(;Rr.length>0;)Qs()}var Ro=new WeakMap;function Kn(e){var t=T;if(t===null)return M.f|=8388608,e;if(h&&e instanceof Error&&!Ro.has(e)&&Ro.set(e,Ea(e,t)),(t.f&32768)===0&&(t.f&4)===0)throw h&&!t.parent&&e instanceof Error&&ti(e),e;Tt(e,t)}function Tt(e,t){for(;t!==null;){if((t.f&128)!==0){if((t.f&32768)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw h&&e instanceof Error&&ti(e),e}function Ea(e,t){let r=ft(e,"message");if(!(r&&!r.configurable)){for(var o=bn?" ":" ",i=\` +\${o}in \${t.fn?.name||""}\`,n=t.ctx;n!==null;)i+=\` +\${o}in \${n.function?.[st].split("/").pop()}\`,n=n.p;return{message:e.message+\` +\${i} \`,stack:e.stack?.split(\` \`).filter(a=>!a.includes("svelte/src/internal")).join(\` -\`)}}}function Js(e){let t=ko.get(e);t&&($e(e,"message",{value:t.message}),$e(e,"stack",{value:t.stack}))}var xa=-7169;function W(e,t){e.f=e.f&xa|t}function Dr(e){(e.f&512)!==0||e.deps===null?W(e,1024):W(e,4096)}function Qs(e){if(e!==null)for(let t of e)(t.f&2)===0||(t.f&65536)===0||(t.f^=65536,Qs(t.deps))}function Hn(e,t,r){(e.f&2048)!==0?t.add(e):(e.f&4096)!==0&&r.add(e),Qs(e.deps),W(e,1024)}function Vn(e,t,r){if(e==null)return t(void 0),r&&r(void 0),ze;let n=b(()=>e.subscribe(t,r));return n.unsubscribe?()=>n.unsubscribe():n}var Mr=[];function So(e,t){return{subscribe:qr(e,t).subscribe}}function qr(e,t=ze){let r=null,n=new Set;function s(l){if(Fn(e,l)&&(e=l,r)){let c=!Mr.length;for(let f of n)f[1](),Mr.push(f,e);if(c){for(let f=0;f{n.delete(f),n.size===0&&r&&(r(),r=null)}}return{set:s,update:o,subscribe:a}}function Un(e){let t;return Vn(e,r=>t=r)(),t}var ei=!1;var Ao=Symbol();function Ee(e,t,r){let n=r[t]??={store:null,source:q(void 0),unsubscribe:ze};if(v&&(n.source.label=t),n.store!==e&&!(Ao in r))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=ze;else{var s=!0;n.unsubscribe=Vn(e,o=>{s?n.source.v=o:R(n.source,o)}),s=!1}return e&&Ao in r?Un(e):i(n.source)}function Me(){let e={};function t(){Te(()=>{for(var r in e)e[r].unsubscribe();$e(e,Ao,{enumerable:!1,value:!0})})}return[e,t]}var jn=null,Lr=null,I=null,Pr=null,ke=null,Co=null,pr=!1,No=!1,_r=null,cn=null,ti=0,Ro=new Set,wa=1,st=class e{id=wa++;#e=!1;linked=!0;#t=null;#r=null;async_deriveds=new Map;current=new Map;previous=new Map;unblocked=new Set;#l=new Set;#n=new Set;#s=new Set;#o=0;#i=new Map;#d=null;#a=[];#_=[];#p=new Set;#f=new Set;#u=new Map;#c=new Set;is_fork=!1;#h=!1;#x(){if(this.is_fork)return!0;for(let n of this.#i.keys()){for(var t=n,r=!1;t.parent!==null;){if(this.#u.has(t)){r=!0;break}t=t.parent}if(!r)return!0}return!1}skip_effect(t){this.#u.has(t)||this.#u.set(t,{d:[],m:[]}),this.#c.delete(t)}unskip_effect(t,r=n=>this.schedule(n)){var n=this.#u.get(t);if(n){this.#u.delete(t);for(var s of n.d)W(s,2048),r(s);for(s of n.m)W(s,4096),r(s)}this.#c.add(t)}#m(){if(this.#e=!0,ti++>1e3&&(this.#b(),Ea()),v)for(let c of this.current.keys())Ro.add(c);if(!this.#x()){for(let c of this.#p)this.#f.delete(c),W(c,2048),this.schedule(c);for(let c of this.#f)W(c,4096),this.schedule(c)}let t=this.#a;this.#a=[],this.apply();var r=_r=[],n=[],s=cn=[];for(let c of t)try{this.#y(c,r,n)}catch(f){throw si(c),f}if(I=null,s.length>0){var o=e.ensure();for(let c of s)o.schedule(c)}if(_r=null,cn=null,this.#x()){this.#v(n),this.#v(r);for(let[c,f]of this.#u)oi(c,f);s.length>0&&I.#m();return}let a=this.#w();if(a){a.#g(this);return}this.#p.clear(),this.#f.clear();for(let c of this.#l)c(this);this.#l.clear(),Pr=this,ri(n),ri(r),Pr=null,this.#d?.resolve();var l=I;if(this.linked&&this.#o===0&&this.#b(),ye&&!this.linked&&(this.#E(),I=l),this.#a.length>0){l===null&&(l=this,this.#$());let c=l;c.#a.push(...this.#a.filter(f=>!c.#a.includes(f)))}l!==null&&l.#m()}#y(t,r,n){t.f^=1024;for(var s=t.first;s!==null;){var o=s.f,a=(o&96)!==0,l=a&&(o&1024)!==0,c=l||(o&8192)!==0||this.#u.has(s);if(!c&&s.fn!==null){a?s.f^=1024:(o&4)!==0?r.push(s):ye&&(o&16777224)!==0?n.push(s):Kt(s)&&((o&16)!==0&&this.#f.add(s),Et(s));var f=s.first;if(f!==null){s=f;continue}}for(;s!==null;){var _=s.next;if(_!==null){s=_;break}s=s.parent}}}#w(){for(var t=this.#t;t!==null;){if(!t.is_fork){for(let[r,[,n]]of this.current)if(t.current.has(r)&&!n)return t}t=t.#t}return null}#g(t){for(let[n,s]of t.current)!this.previous.has(n)&&t.previous.has(n)&&this.previous.set(n,t.previous.get(n)),this.current.set(n,s);for(let[n,s]of t.async_deriveds){let o=this.async_deriveds.get(n);o&&s.promise.then(o.resolve)}let r=n=>{var s=n.reactions;if(s!==null)for(let l of s){var o=l.f;if((o&2)!==0)r(l);else{var a=l;o&4194320&&!this.async_deriveds.has(a)&&(this.#f.delete(a),W(a,2048),this.schedule(a))}}};for(let n of this.current.keys())r(n);this.oncommit(()=>t.discard()),t.#b(),I=this,this.#m()}#v(t){for(var r=0;r!this.current.has(u));if(s.length===0)t&&_.discard();else if(r.length>0){if(v&&Ws(_.#a.length===0,"Batch has scheduled roots"),t)for(let u of this.#c)_.unskip_effect(u,d=>{(d.f&4194320)!==0?_.schedule(d):_.#v([d])});_.activate();var o=new Set,a=new Map;for(var l of r)ni(l,s,o,a);a=new Map;var c=[..._.current.keys()].filter(u=>this.current.has(u)?this.current.get(u)[0]!==u.v:!0);if(c.length>0)for(let u of this.#_)(u.f&155648)===0&&Oo(u,c,a)&&((u.f&4194320)!==0?(W(u,2048),_.schedule(u)):_.#p.add(u));if(_.#a.length>0){_.apply();for(var f of _.#a)_.#y(f,[],[]);_.#a=[]}_.deactivate()}}}}increment(t,r){if(this.#o+=1,t){let n=this.#i.get(r)??0;this.#i.set(r,n+1)}}decrement(t,r){if(this.#o-=1,t){let n=this.#i.get(r)??0;n===1?this.#i.delete(r):this.#i.set(r,n-1)}this.#h||(this.#h=!0,we(()=>{this.#h=!1,this.linked&&this.flush()}))}transfer_effects(t,r){for(let n of t)this.#p.add(n);for(let n of r)this.#f.add(n);t.clear(),r.clear()}oncommit(t){this.#l.add(t)}ondiscard(t){this.#n.add(t)}on_fork_commit(t){this.#s.add(t)}run_fork_commit_callbacks(){for(let t of this.#s)t(this);this.#s.clear()}settled(){return(this.#d??=Rn()).promise}static ensure(){if(I===null){let t=I=new e;t.#$(),!No&&!pr&&we(()=>{t.#e||t.flush()})}return I}apply(){if(!ye||!this.is_fork&&this.#t===null&&this.#r===null){ke=null;return}ke=new Map;for(let[r,[n]]of this.current)ke.set(r,n);for(let r=jn;r!==null;r=r.#r)if(!(r===this||r.is_fork)){var t=!1;if(r.id0)){Wt.clear();for(let s of vt){if((s.f&24576)!==0)continue;let o=[s],a=s.parent;for(;a!==null;)vt.has(a)&&(vt.delete(a),o.push(a)),a=a.parent;for(let l=o.length-1;l>=0;l--){let c=o[l];(c.f&24576)===0&&Et(c)}}vt.clear()}}vt=null}}function ni(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(let s of e.reactions){let o=s.f;(o&2)!==0?ni(s,t,r,n):(o&4194320)!==0&&(o&2048)===0&&Oo(s,t,n)&&(W(s,2048),fn(s))}}function Oo(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(let s of e.deps){if(bt.call(t,s))return!0;if((s.f&2)!==0&&Oo(s,t,r))return r.set(s,!0),!0}return r.set(e,!1),!1}function fn(e){I.schedule(e)}function oi(e,t){if(!((e.f&32)!==0&&(e.f&1024)!==0)){(e.f&2048)!==0?t.d.push(e):(e.f&4096)!==0&&t.m.push(e),W(e,1024);for(var r=e.first;r!==null;)oi(r,t),r=r.next}}function si(e){W(e,1024);for(var t=e.first;t!==null;)si(t),t=t.next}function Do(e){let t=0,r=Ue(0),n;return v&&Be(r,"createSubscriber version"),()=>{Ut()&&(i(r),Se(()=>(t===0&&(n=b(()=>e(()=>mr(r)))),t+=1,()=>{we(()=>{t-=1,t===0&&(n?.(),n=void 0,mr(r))})})))}}var ka=589824;function qo(e,t,r,n){new Mo(e,t,r,n)}var Mo=class{parent;is_pending=!1;transform_error;#e;#t=T?D:null;#r;#l;#n;#s=null;#o=null;#i=null;#d=null;#a=0;#_=0;#p=!1;#f=new Set;#u=new Set;#c=null;#h=Do(()=>(this.#c=Ue(this.#a),v&&Be(this.#c,"$effect.pending()"),()=>{this.#c=null}));constructor(t,r,n,s){this.#e=t,this.#r=r,this.#l=o=>{var a=E;a.b=this,a.f|=128,n(o)},this.parent=E.b,this.transform_error=s??this.parent?.transform_error??(o=>o),this.#n=at(()=>{if(T){let o=this.#t;be();let a=o.data==="[!";if(o.data.startsWith("[?")){let c=JSON.parse(o.data.slice("[?".length));this.#m(c)}else a?this.#y():this.#x()}else this.#w()},ka),T&&(this.#e=D)}#x(){try{this.#s=ge(()=>this.#l(this.#e))}catch(t){this.error(t)}}#m(t){let r=this.#r.failed;r&&(this.#i=ge(()=>{r(this.#e,()=>t,()=>()=>{})}))}#y(){let t=this.#r.pending;t&&(this.is_pending=!0,this.#o=ge(()=>t(this.#e)),we(()=>{var r=this.#d=document.createDocumentFragment(),n=ue();r.append(n),this.#s=this.#v(()=>ge(()=>this.#l(n))),this.#_===0&&(this.#e.before(r),this.#d=null,qt(this.#o,()=>{this.#o=null}),this.#g(I))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#_=0,this.#a=0,this.#s=ge(()=>{this.#l(this.#e)}),this.#_>0){var t=this.#d=document.createDocumentFragment();Yr(this.#s,t);let r=this.#r.pending;this.#o=ge(()=>r(this.#e))}else this.#g(I)}catch(r){this.error(r)}}#g(t){this.is_pending=!1,t.transfer_effects(this.#f,this.#u)}defer_effect(t){Hn(t,this.#f,this.#u)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#v(t){var r=E,n=C,s=P;ae(this.#n),fe(this.#n),jt(this.#n.ctx);try{return st.ensure(),t()}catch(o){return Yn(o),null}finally{ae(r),fe(n),jt(s)}}#E(t,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#E(t,r);return}this.#_+=t,this.#_===0&&(this.#g(r),this.#o&&qt(this.#o,()=>{this.#o=null}),this.#d&&(this.#e.before(this.#d),this.#d=null))}update_pending_count(t,r){this.#E(t,r),this.#a+=t,!(!this.#c||this.#p)&&(this.#p=!0,we(()=>{this.#p=!1,this.#c&&Tt(this.#c,this.#a)}))}get_effect_pending(){return this.#h(),i(this.#c)}error(t){if(!this.#r.onerror&&!this.#r.failed)throw t;I?.is_fork?(this.#s&&I.skip_effect(this.#s),this.#o&&I.skip_effect(this.#o),this.#i&&I.skip_effect(this.#i),I.on_fork_commit(()=>{this.#$(t)})):this.#$(t)}#$(t){this.#s&&(ie(this.#s),this.#s=null),this.#o&&(ie(this.#o),this.#o=null),this.#i&&(ie(this.#i),this.#i=null),T&&(j(this.#t),nn(),j(It()));var r=this.#r.onerror;let n=this.#r.failed;var s=!1,o=!1;let a=()=>{if(s){Us();return}s=!0,o&&Fs(),this.#i!==null&&qt(this.#i,()=>{this.#i=null}),this.#v(()=>{this.#w()})},l=c=>{try{o=!0,r?.(c,a),o=!1}catch(f){pt(f,this.#n&&this.#n.parent)}n&&(this.#i=this.#v(()=>{try{return ge(()=>{var f=E;f.b=this,f.f|=128,n(this.#e,()=>c,()=>a)})}catch(f){return pt(f,this.#n.parent),null}}))};we(()=>{var c;try{c=this.transform_error(t)}catch(f){pt(f,this.#n&&this.#n.parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(l,f=>pt(f,this.#n&&this.#n.parent)):l(c)})}};function Xn(e,t,r,n){let s=Mt()?hr:Vr;var o=e.filter(d=>!d.settled);if(r.length===0&&o.length===0){n(t.map(s));return}var a=E,l=li(),c=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(d=>d.promise)):null;function f(d){if((a.f&16384)===0){l();try{n(d)}catch(p){pt(p,a)}Hr()}}var _=Fo();if(r.length===0){c.then(()=>f(t.map(s))).finally(_);return}function u(){Promise.all(r.map(d=>Po(d))).then(d=>f([...t.map(s),...d])).catch(d=>pt(d,a)).finally(_)}c?c.then(()=>{l(),u(),Hr()}):u()}function li(){var e=E,t=C,r=P,n=I;if(v)var s=Dt;return function(a=!0){ae(e),fe(t),jt(r),a&&(e.f&16384)===0&&(n?.activate(),n?.apply()),v&&(Lo(null),Ir(s))}}function Hr(e=!0){ae(null),fe(null),jt(null),e&&I?.deactivate(),v&&(Lo(null),Ir(null))}function Fo(){var e=E,t=e.b,r=I,n=t.is_rendered();return t.update_pending_count(1,r),r.increment(n,e),()=>{t.update_pending_count(-1,r),r.decrement(n,e)}}var Je=null;function Lo(e){Je=e}var un=new Set;function hr(e){var t=2050;E!==null&&(E.f|=524288);let r={ctx:P,deps:null,effects:null,equals:qn,f:t,fn:e,reactions:null,rv:0,v:re,wv:0,parent:E,ac:null};return v&&xt&&(r.created=yt("created at")),r}var Zn=Symbol("obsolete");function Po(e,t,r){let n=E;n===null&&Ts();var s=void 0,o=Ue(re);v&&(o.label=t??e.toString());var a=!C,l=new Set;return ui(()=>{var c=E;v&&(Je={effect:c,effect_deps:new Set,warned:!1});var f=Rn();s=f.promise;try{Promise.resolve(e()).then(f.resolve,p=>{p!==Qt&&f.reject(p)}).finally(Hr)}catch(p){f.reject(p),Hr()}if(v){if(Je){if(c.deps!==null)for(let p=0;p{v&&(Je=null),u?.(),l.delete(f),g!==Zn&&(_.activate(),g?(o.f|=8388608,Tt(o,g)):((o.f&8388608)!==0&&(o.f^=8388608),Tt(o,p),v&&r!==void 0&&(un.add(o),setTimeout(()=>{un.has(o)&&(c.f&16384)===0&&(Ps(o.label,r),un.delete(o))}))),_.deactivate())};f.promise.then(d,p=>d(null,p||"unknown"))}),Te(()=>{for(let c of l)c.reject(Zn)}),v&&(o.f|=4194304),new Promise(c=>{function f(_){function u(){_===s?c(o):f(s)}_.then(u,u)}f(s)})}function Bo(e){let t=hr(e);return ye||Qn(t),t}function Vr(e){let t=hr(e);return t.equals=Ln,t}function ci(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r5){let o=yt("updated at");if(o!==null){let a=e.updated.get(o.stack);a||(a={error:o,count:0},e.updated.set(o.stack,a)),a.count++}}}E!==null&&(e.set_during_effect=!0)}if((e.f&2)!==0){let s=e;(e.f&2048)!==0&&dn(s),ke===null&&Dr(s)}e.wv=Br(),pi(e,2048,r),Mt()&&E!==null&&(E.f&1024)!==0&&(E.f&96)===0&&(ct===null?_i([e]):ct.push(e)),!n.is_fork&&gr.size>0&&!Vo&&Kn()}return t}function Kn(){Vo=!1;for(let e of gr){(e.f&1024)!==0&&W(e,4096);let t;try{t=Kt(e)}catch{t=!0}t&&Et(e)}gr.clear()}function mr(e){R(e,e.v+1)}function pi(e,t,r){var n=e.reactions;if(n!==null)for(var s=Mt(),o=n.length,a=0;a{if(or===a)return u();var d=C,p=or;fe(null),Uo(a);var g=u();return fe(d),Uo(p),g};n&&(r.set("length",Ft(e.length,o)),v&&(e=Ra(e)));var c="";let f=!1;function _(u){if(!f){f=!0,c=u,Be(s,\`\${c} version\`);for(let[d,p]of r)Be(p,br(c,d));f=!1}}return new Proxy(e,{defineProperty(u,d,p){(!("value"in p)||p.configurable===!1||p.enumerable===!1||p.writable===!1)&&Ds();var g=r.get(d);return g===void 0?l(()=>{var y=Ft(p.value,o);return r.set(d,y),v&&typeof d=="string"&&Be(y,br(c,d)),y}):R(g,p.value,!0),!0},deleteProperty(u,d){var p=r.get(d);if(p===void 0){if(d in u){let g=l(()=>Ft(re,o));r.set(d,g),mr(s),v&&Be(g,br(c,d))}}else R(p,re),mr(s);return!0},get(u,d,p){if(d===Ce)return e;if(v&&d===On)return _;var g=r.get(d),y=d in u;if(g===void 0&&(!y||tt(u,d)?.writable)&&(g=l(()=>{var N=nr(y?u[d]:re),B=Ft(N,o);return v&&Be(B,br(c,d)),B}),r.set(d,g)),g!==void 0){var x=i(g);return x===re?void 0:x}return Reflect.get(u,d,p)},getOwnPropertyDescriptor(u,d){var p=Reflect.getOwnPropertyDescriptor(u,d);if(p&&"value"in p){var g=r.get(d);g&&(p.value=i(g))}else if(p===void 0){var y=r.get(d),x=y?.v;if(y!==void 0&&x!==re)return{enumerable:!0,configurable:!0,value:x,writable:!0}}return p},has(u,d){if(d===Ce)return!0;var p=r.get(d),g=p!==void 0&&p.v!==re||Reflect.has(u,d);if(p!==void 0||E!==null&&(!g||tt(u,d)?.writable)){p===void 0&&(p=l(()=>{var x=g?nr(u[d]):re,N=Ft(x,o);return v&&Be(N,br(c,d)),N}),r.set(d,p));var y=i(p);if(y===re)return!1}return g},set(u,d,p,g){var y=r.get(d),x=d in u;if(n&&d==="length")for(var N=p;NFt(re,o)),r.set(N+"",B),v&&Be(B,br(c,N)))}if(y===void 0)(!x||tt(u,d)?.writable)&&(y=l(()=>Ft(void 0,o)),v&&Be(y,br(c,d)),R(y,nr(p)),r.set(d,y));else{x=y.v!==re;var F=l(()=>nr(p));R(y,F)}var K=Reflect.getOwnPropertyDescriptor(u,d);if(K?.set&&K.set.call(g,p),!x){if(n&&typeof d=="string"){var S=r.get("length"),w=Number(d);Number.isInteger(w)&&w>=S.v&&R(S,w+1)}mr(s)}return!0},ownKeys(u){i(s);var d=Reflect.ownKeys(u).filter(y=>{var x=r.get(y);return x===void 0||x.v!==re});for(var[p,g]of r)g.v!==re&&!(p in u)&&d.push(p);return d},setPrototypeOf(){Ms()}})}function br(e,t){return typeof t=="symbol"?\`\${e}[Symbol(\${t.description??""})]\`:Aa.test(t)?\`\${e}.\${t}\`:/^\\d+$/.test(t)?\`\${e}[\${t}]\`:\`\${e}['\${t}']\`}function eo(e){try{if(e!==null&&typeof e=="object"&&Ce in e)return e[Ce]}catch{}return e}var Na=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function Ra(e){return new Proxy(e,{get(t,r,n){var s=Reflect.get(t,r,n);return Na.has(r)?function(...o){di();var a=s.apply(this,o);return Kn(),a}:s}})}function vi(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:r,lastIndexOf:n,includes:s}=e;e.indexOf=function(o,a){let l=r.call(this,o,a);if(l===-1){for(let c=a??0;c{e.indexOf=r,e.lastIndexOf=n,e.includes=s}}var jo,mi,ln,hi,gi;function to(){if(jo===void 0){jo=window,mi=document,ln=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;hi=tt(t,"firstChild").get,gi=tt(t,"nextSibling").get,bo(e)&&(e[Jr]=void 0,e[In]=null,e[Qr]=void 0,e.__e=void 0),bo(r)&&(r[en]=void 0),v&&(e.__svelte_meta=null,vi())}}function ue(e=""){return document.createTextNode(e)}function ce(e){return hi.call(e)}function xe(e){return gi.call(e)}function h(e,t){if(!T)return ce(e);var r=ce(D);if(r===null)r=D.appendChild(ue());else if(t&&r.nodeType!==ur){var n=ue();return r?.before(n),j(n),n}return t&&vn(r),j(r),r}function Ne(e,t=!1){if(!T){var r=ce(e);return r instanceof Comment&&r.data===""?xe(r):r}if(t){if(D?.nodeType!==ur){var n=ue();return D?.before(n),j(n),n}vn(D)}return D}function $(e,t=1,r=!1){let n=T?D:e;for(var s;t--;)s=n,n=xe(n);if(!T)return n;if(r){if(n?.nodeType!==ur){var o=ue();return n===null?s?.after(o):n.before(o),j(o),o}vn(n)}return j(n),n}function _n(e){e.textContent=""}function ro(){if(!ye||vt!==null)return!1;var e=E.f;return(e&32768)!==0}function kt(e,t,r){let n=r?{is:r}:void 0;return document.createElementNS(t??Dn,e,n)}function vn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===ur;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function sr(e){var t=C,r=E;fe(null),ae(null);try{return e()}finally{fe(t),ae(r)}}function Wo(e){E===null&&(C===null&&Rs(e),Ns()),mt&&As(e)}function Oa(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function St(e,t){var r=E;if(v)for(;r!==null&&(r.f&131072)!==0;)r=r.parent;r!==null&&(r.f&8192)!==0&&(e|=8192);var n={ctx:P,deps:null,nodes:null,f:e|2048|512,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};v&&(n.component_function=nt),I?.register_created_effect(n);var s=n;if((e&4)!==0)_r!==null?_r.push(n):st.ensure().schedule(n);else if(t!==null){try{Et(n)}catch(a){throw ie(n),a}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&524288)===0&&(s=s.first,(e&16)!==0&&(e&65536)!==0&&s!==null&&(s.f|=65536))}if(s!==null&&(s.parent=r,r!==null&&Oa(s,r),C!==null&&(C.f&2)!==0&&(e&64)===0)){var o=C;(o.effects??=[]).push(s)}return n}function Ut(){return C!==null&&!Ge}function Te(e){let t=St(8,null);return W(t,1024),t.teardown=e,t}function mn(e){Wo("$effect"),v&&$e(e,"name",{value:"$effect"});var t=E.f,r=!C&&(t&32)!==0&&(t&32768)===0;if(r){var n=P;(n.e??=[]).push(e)}else return To(e)}function To(e){return St(1048580,e)}function hn(e){return Wo("$effect.pre"),v&&$e(e,"name",{value:"$effect.pre"}),St(1048584,e)}function no(e){st.ensure();let t=St(524352,e);return()=>{ie(t)}}function yi(e){st.ensure();let t=St(524352,e);return(r={})=>new Promise(n=>{r.outro?qt(t,()=>{ie(t),n(void 0)}):(ie(t),n(void 0))})}function ht(e){return St(4,e)}function Y(e,t){var r=P,n={effect:null,ran:!1,deps:e};r.l.$.push(n),n.effect=Se(()=>{if(e(),!n.ran){n.ran=!0;var s=E;try{ae(s.parent),b(t)}finally{ae(s)}}})}function We(){var e=P;Se(()=>{for(var t of e.l.$){t.deps();var r=t.effect;(r.f&1024)!==0&&r.deps!==null&&W(r,4096),Kt(r)&&Et(r),t.ran=!1}})}function ui(e){return St(4718592,e)}function Se(e,t=0){return St(8|t,e)}function G(e,t=[],r=[],n=[]){Xn(n,t,r,s=>{St(8,()=>e(...s.map(i)))})}function at(e,t=0){var r=St(16|t,e);return v&&(r.dev_stack=Dt),r}function ge(e){return St(524320,e)}function Ko(e){var t=e.teardown;if(t!==null){let r=mt,n=C;Go(!0),fe(null);try{t.call(null)}finally{Go(r),fe(n)}}}function pn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){let s=r.ac;s!==null&&sr(()=>{s.abort(Qt)});var n=r.next;(r.f&64)!==0?r.parent=null:ie(r,t),r=n}}function wi(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&32)===0&&ie(t),t=r}}function ie(e,t=!0){var r=!1;(t||(e.f&262144)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Xo(e.nodes.start,e.nodes.end),r=!0),W(e,33554432),pn(e,t&&!r),$r(e,0);var n=e.nodes&&e.nodes.t;if(n!==null)for(let o of n)o.stop();Ko(e),e.f^=33554432,e.f|=16384;var s=e.parent;s!==null&&s.first!==null&&Io(e),v&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Xo(e,t){for(;e!==null;){var r=e===t?null:xe(e);e.remove(),e=r}}function Io(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function qt(e,t,r=!0){var n=[];Ei(e,n,!0);var s=()=>{r&&ie(e),t&&t()},o=n.length;if(o>0){var a=()=>--o||s();for(var l of n)l.out(a)}else s()}function Ei(e,t,r){if((e.f&8192)===0){e.f^=8192;var n=e.nodes&&e.nodes.t;if(n!==null)for(let l of n)(l.is_global||r)&&t.push(l);for(var s=e.first;s!==null;){var o=s.next;if((s.f&64)===0){var a=(s.f&65536)!==0||(s.f&32)!==0&&(e.f&16)!==0;Ei(s,t,a?r:!1)}s=o}}}function gn(e){Ti(e,!0)}function Ti(e,t){if((e.f&8192)!==0){e.f^=8192,(e.f&1024)===0&&(W(e,2048),st.ensure().schedule(e));for(var r=e.first;r!==null;){var n=r.next,s=(r.f&65536)!==0||(r.f&32)!==0;Ti(r,s?t:!1),r=n}var o=e.nodes&&e.nodes.t;if(o!==null)for(let a of o)(a.is_global||t)&&a.in()}}function Yr(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var s=r===n?null:xe(r);t.append(r),r=s}}var ki=null;var oo=!1,mt=!1;function Go(e){mt=e}var C=null,Ge=!1;function fe(e){C=e}var E=null;function ae(e){E=e}var lt=null;function Qn(e){C!==null&&(!ye||(C.f&2)!==0)&&(lt===null?lt=[e]:lt.push(e))}var Ae=null,je=0,ct=null;function _i(e){ct=e}var Si=1,xr=0,or=xr;function Uo(e){or=e}function Br(){return++Si}function Kt(e){var t=e.f;if((t&2048)!==0)return!0;if(t&2&&(e.f&=-65537),(t&4096)!==0){for(var r=e.deps,n=r.length,s=0;se.wv)return!0}(t&512)!==0&&ke===null&&W(e,1024)}return!1}function Ai(e,t,r=!0){var n=e.reactions;if(n!==null&&!(!ye&<!==null&&bt.call(lt,e)))for(var s=0;s{e.ac.abort(Qt)}),e.ac=null);try{e.f|=2097152;var _=e.fn,u=_();e.f|=32768;var d=e.deps,p=I?.is_fork;if(Ae!==null){var g;if(p||$r(e,je),d!==null&&je>0)for(d.length=je+Ae.length,g=0;g>>0).toString(36)}var qa=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var Pp=[...qa,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var Fa=["touchstart","touchmove"];function Oi(e){return Fa.includes(e)}var La=["$state","$state.raw","$derived","$derived.by"],zp=[...La,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function io(e){return e?.replace(/\\//g,"/\\u200B")}var Ii=new Map;function Di(e,t){var r=Ii.get(e);r||(r=new Set,Ii.set(e,r)),r.add(t)}var ao=Symbol("events"),Fi=new Set,Zo=new Set;function Li(e,t,r,n={}){function s(o){if(n.capture||lo.call(t,o),!o.cancelBubble)return sr(()=>r?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?we(()=>{t.addEventListener(e,s,n)}):t.addEventListener(e,s,n),s}function Zt(e,t,r,n,s){var o={capture:n,passive:s},a=Li(e,t,r,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Te(()=>{t.removeEventListener(e,a,o)})}var qi=null;function lo(e){var t=this,r=t.ownerDocument,n=e.type,s=e.composedPath?.()||[],o=s[0]||e.target;qi=e;var a=0,l=qi===e&&e[ao];if(l){var c=s.indexOf(l);if(c!==-1&&(t===document||t===window)){e[ao]=t;return}var f=s.indexOf(t);if(f===-1)return;c<=f&&(a=c)}if(o=s[a]||e.target,o!==t){$e(e,"currentTarget",{configurable:!0,get(){return o||r}});var _=C,u=E;fe(null),ae(null);try{for(var d,p=[];o!==null;){var g=o.assignedSlot||o.parentNode||o.host||null;try{var y=o[ao]?.[n];y!=null&&(!o.disabled||e.target===o)&&y.call(o,e)}catch(x){d?p.push(x):d=x}if(e.cancelBubble||g===t||g===null)break;o=g}if(d){for(let x of p)queueMicrotask(()=>{throw x});throw d}}finally{e[ao]=t,delete e.currentTarget,fe(_),ae(u)}}}var za=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Pi(e){return za?.createHTML(e)??e}function Jo(e){var t=kt("template");return t.innerHTML=Pi(e.replaceAll("","")),t.content}function ft(e,t){var r=E;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function L(e,t){var r=(t&1)!==0,n=(t&2)!==0,s,o=!e.startsWith("");return()=>{if(T)return ft(D,null),D;s===void 0&&(s=Jo(o?e:""+e),r||(s=ce(s)));var a=n||ln?document.importNode(s,!0):s.cloneNode(!0);if(r){var l=ce(a),c=a.lastChild;ft(l,c)}else ft(a,a);return a}}function Lt(e=""){if(!T){var t=ue(e+"");return ft(t,t),t}var r=D;return r.nodeType!==ur?(r.before(r=ue()),j(r)):vn(r),ft(r,r),r}function O(e,t){if(T){var r=E;((r.f&32768)===0||r.nodes.end===null)&&(r.nodes.end=D),be();return}e!==null&&e.before(t)}var Qo=!0;function A(e,t){var r=t==null?"":typeof t=="object"?\`\${t}\`:t;r!==(e[en]??=e.nodeValue)&&(e[en]=r,e.nodeValue=\`\${r}\`)}function jr(e,t){return zi(e,t)}function ts(e,t){to(),t.intro=t.intro??!1;let r=t.target,n=T,s=D;try{for(var o=ce(r);o&&(o.nodeType!==rt||o.data!=="[");)o=xe(o);if(!o)throw Rt;de(!0),j(o);let a=zi(e,{...t,anchor:o});return de(!1),a}catch(a){if(a instanceof Error&&a.message.split(\` -\`).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==Rt&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Os(),to(),_n(r),de(!1),jr(e,t)}finally{de(n),j(s)}}var co=new Map;function zi(e,{target:t,anchor:r,props:n={},events:s,context:o,intro:a=!0,transformError:l}){to();var c=void 0,f=yi(()=>{var _=r??t.appendChild(ue());qo(_,{pending:()=>{}},p=>{pe({});var g=P;if(o&&(g.c=o),s&&(n.$$events=s),T&&ft(p,null),Qo=a,c=e(p,n)||{},Qo=!0,T&&(E.nodes.end=D,D===null||D.nodeType!==rt||D.data!=="]"))throw er(),Rt;_e()},l);var u=new Set,d=p=>{for(var g=0;g{for(var p of u)for(let x of[t,document]){var g=co.get(x),y=g.get(p);--y==0?(x.removeEventListener(p,lo),g.delete(p),g.size===0&&co.delete(x)):g.set(p,y)}Zo.delete(d),_!==r&&_.parentNode?.removeChild(_)}});return es.set(c,f),c}var es=new WeakMap;function rs(e,t){let r=es.get(e);return r?(es.delete(e),r(t)):(v&&(Ce in e?Vs():Hs()),Promise.resolve())}var Jt=class{anchor;#e=new Map;#t=new Map;#r=new Map;#l=new Set;#n=!0;constructor(t,r=!0){this.anchor=t,this.#n=r}#s=t=>{if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)gn(n),this.#l.delete(r);else{var s=this.#r.get(r);s&&(this.#t.set(r,s.effect),this.#r.delete(r),v&&(s.fragment.lastChild[xo]=this.anchor),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),n=s.effect)}for(let[o,a]of this.#e){if(this.#e.delete(o),o===t)break;let l=this.#r.get(a);l&&(ie(l.effect),this.#r.delete(a))}for(let[o,a]of this.#t){if(o===r||this.#l.has(o))continue;let l=()=>{if(Array.from(this.#e.values()).includes(o)){var f=document.createDocumentFragment();Yr(a,f),f.append(ue()),this.#r.set(o,{effect:a,fragment:f})}else ie(a);this.#l.delete(o),this.#t.delete(o)};this.#n||!n?(this.#l.add(o),qt(a,l,!1)):l()}}};#o=t=>{this.#e.delete(t);let r=Array.from(this.#e.values());for(let[n,s]of this.#r)r.includes(n)||(ie(s.effect),this.#r.delete(n))};ensure(t,r){var n=I,s=ro();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(s){var o=document.createDocumentFragment(),a=ue();o.append(a),this.#r.set(t,{effect:ge(()=>r(a)),fragment:o})}else this.#t.set(t,ge(()=>r(this.anchor)));if(this.#e.set(n,t),s){for(let[l,c]of this.#t)l===t?n.unskip_effect(c):n.skip_effect(c);for(let[l,c]of this.#r)l===t?n.unskip_effect(c.effect):n.skip_effect(c.effect);n.oncommit(this.#s),n.ondiscard(this.#o)}else T&&(this.anchor=D),this.#s(n)}};function le(e,t,r=!1){var n;T&&(n=D,be());var s=new Jt(e),o=r?65536:0;function a(l,c){if(T){var f=on(n);if(l!==parseInt(f.substring(1))){var _=It();j(_),s.anchor=_,de(!1),s.ensure(l,c),de(!0);return}}s.ensure(l,c)}at(()=>{var l=!1;t((c,f=0)=>{l=!0,a(f,c)}),l||a(-1,null)},o)}function Xa(e,t,r){for(var n=[],s=t.length,o,a=t.length,l=0;l{if(o){if(o.pending.delete(u),o.done.add(u),o.pending.size===0){var d=e.outrogroups;ns(e,Nr(o.done)),d.delete(o),d.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=n.length===0&&r!==null;if(c){var f=r,_=f.parentNode;_n(_),_.append(f),e.items.clear()}ns(e,t,!c)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function ns(e,t,r=!0){var n;if(e.pending.size>0){n=new Set;for(let a of e.pending.values())for(let l of a)n.add(e.items.get(l).e)}for(var s=0;s{var F=r();return Vt(F)?F:F==null?[]:Nr(F)});v&&Be(u,"{#each ...}");var d,p=new Map,g=!0;function y(F){(B.effect.f&16384)===0&&(B.pending.delete(F),B.fallback=_,Za(B,d,a,t,n),_!==null&&(d.length===0?(_.f&33554432)===0?gn(_):(_.f^=33554432,bn(_,null,a)):qt(_,()=>{_=null})))}function x(F){B.pending.delete(F)}var N=at(()=>{d=i(u);var F=d.length;let K=!1;if(T){var S=on(a)==="[!";S!==(F===0)&&(a=It(),j(a),de(!1),K=!0)}for(var w=new Set,M=I,te=ro(),oe=0;oeo(a)):(_=ge(()=>o(Bi??=ue())),_.f|=33554432)),F>w.size&&(v?Qa(d,n):wo("","","")),T&&F>0&&j(It()),!g)if(p.set(M,w),te){for(let[Re,Ke]of l)w.has(Re)||M.skip_effect(Ke.e);M.oncommit(y),M.ondiscard(x)}else y(M);K&&de(!0),i(u)}),B={effect:N,flags:t,items:l,pending:p,outrogroups:null,fallback:_};g=!1,T&&(a=D)}function $n(e){for(;e!==null&&(e.f&32)===0;)e=e.next;return e}function Za(e,t,r,n,s){var o=(n&8)!==0,a=t.length,l=e.items,c=$n(e.effect.first),f,_=null,u,d=[],p=[],g,y,x,N;if(o)for(N=0;N0){var oe=(n&4)!==0&&a===0?r:null;if(o){for(N=0;N{if(u!==void 0)for(x of u)x.nodes?.a?.apply()})}function Ja(e,t,r,n,s,o,a,l){var c=(a&1)!==0?(a&16)===0?q(r,!1,!1):Ue(r):null,f=(a&2)!==0?Ue(s):null;return v&&c&&(c.trace=()=>{l()[f?.v??s]}),{v:c,i:f,e:ge(()=>(o(t,c??r,f??s,l),()=>{e.delete(n)}))}}function bn(e,t,r){if(e.nodes)for(var n=e.nodes.start,s=e.nodes.end,o=t&&(t.f&33554432)===0?t.nodes.start:r;n!==null;){var a=xe(n);if(o.before(n),n===s)return;n=a}}function ir(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Qa(e,t){let r=new Map,n=e.length;for(let s=0;s{var f=E;if(l===(l=t()??"")){T&&be();return}if(r&&!T){f.nodes=null,c.innerHTML=l,l!==""&&ft(ce(c),c.lastChild);return}if(f.nodes!==null&&(Xo(f.nodes.start,f.nodes.end),f.nodes=null),l!==""){if(T){for(var _=D.data,u=be(),d=u;u!==null&&(u.nodeType!==rt||u.data!=="");)d=u,u=xe(u);if(u===null)throw er(),Rt;v&&!o&&el(u.parentNode,_,l),ft(D,d),a=j(u);return}var p=n?tn:s?Eo:void 0,g=kt(n?"svg":s?"math":"template",p);g.innerHTML=l;var y=n||s?g:g.content;if(ft(ce(y),y.lastChild),n||s)for(;ce(y);)a.before(ce(y));else a.before(y)}})}function qe(e,t){ht(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){let s=kt("style");s.id=t.hash,s.textContent=t.code,n.appendChild(s),v&&Di(t.hash,s)}})}var Hi=[...\` -\\r\\f\\xA0\\v\\uFEFF\`];function Ui(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var s of Object.keys(r))if(r[s])n=n?n+" "+s:s;else if(n.length)for(var o=s.length,a=0;(a=n.indexOf(s,a))>=0;){var l=a+o;(a===0||Hi.includes(n[a-1]))&&(l===n.length||Hi.includes(n[l]))?n=(a===0?"":n.substring(0,a))+n.substring(l+1):a=l}}return n===""?null:n}function Vi(e,t=!1){var r=t?" !important;":";",n="";for(var s of Object.keys(e)){var o=e[s];o!=null&&o!==""&&(n+=" "+s+": "+o+r)}return n}function os(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function ji(e,t){if(t){var r="",n,s;if(Array.isArray(t)?(n=t[0],s=t[1]):n=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,"").trim();var o=!1,a=0,l=!1,c=[];n&&c.push(...Object.keys(n).map(os)),s&&c.push(...Object.keys(s).map(os));var f=0,_=-1;let y=e.length;for(var u=0;ut.trim().split(" ").filter(Boolean))}function bl(e,t){var r=Wi(e.srcset),n=Wi(t);return n.length===r.length&&n.every(([s,o],a)=>o===r[a][1]&&(is(r[a][0],s)||is(s,r[a][0])))}function Fe(e=!1){let t=P,r=t.l.u;if(!r)return;let n=()=>z(t.s);if(e){let s=0,o={},a=hr(()=>{let l=!1,c=t.s;for(let f in c)c[f]!==o[f]&&(o[f]=c[f],l=!0);return l&&s++,s});n=()=>i(a)}r.b.length&&hn(()=>{Zi(t,n),Rr(r.b)}),mn(()=>{let s=b(()=>r.m.map(xs));return()=>{for(let o of s)typeof o=="function"&&o()}}),r.a.length&&mn(()=>{Zi(t,n),Rr(r.a)})}function Zi(e,t){if(e.l.s)for(let r of e.l.s)i(r);t()}function Ji(e){return new as(e)}var as=class{#e;#t;constructor(t){var r=new Map,n=(o,a)=>{var l=q(a,!1,!1);return r.set(o,l),l};let s=new Proxy({...t.props||{},$$events:{}},{get(o,a){return i(r.get(a)??n(a,Reflect.get(o,a)))},has(o,a){return a===Cn?!0:(i(r.get(a)??n(a,Reflect.get(o,a))),Reflect.has(o,a))},set(o,a,l){return R(r.get(a)??n(a,l),l),Reflect.set(o,a,l)}});this.#t=(t.hydrate?ts:jr)(t.component,{target:t.target,anchor:t.anchor,props:s,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),!ye&&(!t?.props?.$$host||t.sync===!1)&&zr(),this.#e=s.$$events;for(let o of Object.keys(this.#t))o==="$set"||o==="$destroy"||o==="$on"||$e(this,o,{get(){return this.#t[o]},set(a){this.#t[o]=a},enumerable:!0});this.#t.$set=o=>{Object.assign(s,o)},this.#t.$destroy=()=>{rs(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];let n=(...s)=>r.call(this,...s);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(s=>s!==n)}}$destroy(){this.#t.$destroy()}};var Nl;typeof HTMLElement=="function"&&(Nl=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){let n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return s=>{let o=kt("slot");n!=="default"&&(o.name=n),O(s,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},r=Rl(this);for(let n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(let n of this.attributes){let s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=ls(s,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Ji({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=no(()=>{Se(()=>{this.$$r=!0;for(let n of go(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let s=ls(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1})});for(let n in this.$$l)for(let s of this.$$l[n]){let o=this.$$c.$on(n,s);this.$$l_u.set(s,o)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=ls(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return go(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function ls(e,t,r,n){let s=r[e]?.type;if(t=s==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(s){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(s){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Rl(e){let t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}if(v){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;Is(t)},set:n=>{r=n}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");js();var Ol={stats:"/proxy-stats",recent:"/proxy-recent",latestPng:"/proxy-latest-png",sessions:"/api/sessions.json",fullStats:"/api/stats.json",compressionToggle:"/api/compression"};async function cs(e,t){let r=await fetch(e,t);if(!r.ok){let n="";try{n=await r.text()}catch{}throw new Error(\`\${e}: \${r.status} \${r.statusText}\${n?\` \\u2014 \${n.slice(0,200)}\`:""}\`)}return r.json()}async function Il(e,t){return cs(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function Qi(e){return Il(Ol.compressionToggle,{enabled:e})}function xn(e,t){let r=()=>{};return{subscribe:So({data:null,error:null,loading:!0},s=>{let o=!1,a=null,l=null,c=async()=>{try{let f=await cs(e);if(o)return;l=f,s({data:f,error:null,loading:!1})}catch(f){if(o)return;s({data:l,error:f.message,loading:!1})}};return r=()=>{c()},c(),a=setInterval(c,t),()=>{o=!0,r=()=>{},a&&clearInterval(a)}}).subscribe,run:()=>r()}}var Gr=xn("/proxy-stats",2e3),Tr=xn("/proxy-recent",2e3),ea=xn("/api/sessions.json",5e3),m0=xn("/api/stats.json",5e3),yn=qr(null);function Dl(){let{subscribe:e,update:t}=qr([]),r=1;return{subscribe:e,push(n,s){let o=r++;t(a=>[...a,{id:o,level:n,text:s}]),setTimeout(()=>t(a=>a.filter(l=>l.id!==o)),5e3)},dismiss(n){t(s=>s.filter(o=>o.id!==n))}}}var wn=Dl();function k(e){return Math.round(Number(e)||0).toLocaleString()}function ta(e){if(!e)return"-";let t=String(e).split("/");return t[t.length-1]||e}function po(e){return e==null?"":String(e).replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}var Ml=L('
show calculation
'),ql=L('
show calculation
'),Fl=L('
',1),Ll=L('
small sample
',1),Pl=L('
show calculation
'),zl=L('
show calculation
'),Bl=L('
diagnostic: counterfactual "share of spend saved"
share of spend saved (counterfactual):
'),Yl=L('
requests
input tokens saved
cache-aware, input-side only
$ saved
at $5/M input tokens (Opus 4.7)
compressed $/req
passthrough $/req
compressed \\u2212 passthrough $/req
token-equivalent total
input + 5\\xD7output billed at 5\\xD7 input rate
',1),Hl={hash:"svelte-rhs7qr",code:\`.grid.svelte-rhs7qr {display:grid;grid-template-columns:repeat(6, 1fr);gap:14px;margin-bottom:22px;} +\`)}}}function ti(e){let t=Ro.get(e);t&&(Re(e,"message",{value:t.message}),Re(e,"stack",{value:t.stack}))}var ka=-7169;function Q(e,t){e.f=e.f&ka|t}function Wr(e){(e.f&512)!==0||e.deps===null?Q(e,1024):Q(e,4096)}function ri(e){if(e!==null)for(let t of e)(t.f&2)===0||(t.f&65536)===0||(t.f^=65536,ri(t.deps))}function Xn(e,t,r){(e.f&2048)!==0?t.add(e):(e.f&4096)!==0&&r.add(e),ri(e.deps),Q(e,1024)}function Zn(e,t,r){if(e==null)return t(void 0),r&&r(void 0),Ge;let o=g(()=>e.subscribe(t,r));return o.unsubscribe?()=>o.unsubscribe():o}var Kr=[];function No(e,t){return{subscribe:Xr(e,t).subscribe}}function Xr(e,t=Ge){let r=null,o=new Set;function i(l){if(Vn(e,l)&&(e=l,r)){let c=!Kr.length;for(let f of o)f[1](),Kr.push(f,e);if(c){for(let f=0;f{o.delete(f),o.size===0&&r&&(r(),r=null)}}return{set:i,update:n,subscribe:a}}function Jn(e){let t;return Zn(e,r=>t=r)(),t}var ni=!1;var Co=Symbol();function me(e,t,r){let o=r[t]??={store:null,source:q(void 0),unsubscribe:Ge};if(h&&(o.source.label=t),o.store!==e&&!(Co in r))if(o.unsubscribe(),o.store=e??null,e==null)o.source.v=void 0,o.unsubscribe=Ge;else{var i=!0;o.unsubscribe=Zn(e,n=>{i?o.source.v=n:C(o.source,n)}),i=!1}return e&&Co in r?Jn(e):s(o.source)}function xe(){let e={};function t(){Me(()=>{for(var r in e)e[r].unsubscribe();Re(e,Co,{enumerable:!1,value:!0})})}return[e,t]}var Qn=null,Jr=null,F=null,Qr=null,De=null,Mo=null,Nr=!1,Oo=!1,Cr=null,xn=null,oi=0,Io=new Set,Sa=1,_t=class e{id=Sa++;#e=!1;linked=!0;#t=null;#r=null;async_deriveds=new Map;current=new Map;previous=new Map;unblocked=new Set;#l=new Set;#n=new Set;#s=new Set;#o=0;#i=new Map;#d=null;#a=[];#_=[];#p=new Set;#f=new Set;#u=new Map;#c=new Set;is_fork=!1;#h=!1;#x(){if(this.is_fork)return!0;for(let o of this.#i.keys()){for(var t=o,r=!1;t.parent!==null;){if(this.#u.has(t)){r=!0;break}t=t.parent}if(!r)return!0}return!1}skip_effect(t){this.#u.has(t)||this.#u.set(t,{d:[],m:[]}),this.#c.delete(t)}unskip_effect(t,r=o=>this.schedule(o)){var o=this.#u.get(t);if(o){this.#u.delete(t);for(var i of o.d)Q(i,2048),r(i);for(i of o.m)Q(i,4096),r(i)}this.#c.add(t)}#m(){if(this.#e=!0,oi++>1e3&&(this.#b(),Aa()),h)for(let c of this.current.keys())Io.add(c);if(!this.#x()){for(let c of this.#p)this.#f.delete(c),Q(c,2048),this.schedule(c);for(let c of this.#f)Q(c,4096),this.schedule(c)}let t=this.#a;this.#a=[],this.apply();var r=Cr=[],o=[],i=xn=[];for(let c of t)try{this.#y(c,r,o)}catch(f){throw li(c),f}if(F=null,i.length>0){var n=e.ensure();for(let c of i)n.schedule(c)}if(Cr=null,xn=null,this.#x()){this.#v(o),this.#v(r);for(let[c,f]of this.#u)ai(c,f);i.length>0&&F.#m();return}let a=this.#w();if(a){a.#g(this);return}this.#p.clear(),this.#f.clear();for(let c of this.#l)c(this);this.#l.clear(),Qr=this,si(o),si(r),Qr=null,this.#d?.resolve();var l=F;if(this.linked&&this.#o===0&&this.#b(),Oe&&!this.linked&&(this.#E(),F=l),this.#a.length>0){l===null&&(l=this,this.#$());let c=l;c.#a.push(...this.#a.filter(f=>!c.#a.includes(f)))}l!==null&&l.#m()}#y(t,r,o){t.f^=1024;for(var i=t.first;i!==null;){var n=i.f,a=(n&96)!==0,l=a&&(n&1024)!==0,c=l||(n&8192)!==0||this.#u.has(i);if(!c&&i.fn!==null){a?i.f^=1024:(n&4)!==0?r.push(i):Oe&&(n&16777224)!==0?o.push(i):cr(i)&&((n&16)!==0&&this.#f.add(i),Ft(i));var f=i.first;if(f!==null){i=f;continue}}for(;i!==null;){var _=i.next;if(_!==null){i=_;break}i=i.parent}}}#w(){for(var t=this.#t;t!==null;){if(!t.is_fork){for(let[r,[,o]]of this.current)if(t.current.has(r)&&!o)return t}t=t.#t}return null}#g(t){for(let[o,i]of t.current)!this.previous.has(o)&&t.previous.has(o)&&this.previous.set(o,t.previous.get(o)),this.current.set(o,i);for(let[o,i]of t.async_deriveds){let n=this.async_deriveds.get(o);n&&i.promise.then(n.resolve)}let r=o=>{var i=o.reactions;if(i!==null)for(let l of i){var n=l.f;if((n&2)!==0)r(l);else{var a=l;n&4194320&&!this.async_deriveds.has(a)&&(this.#f.delete(a),Q(a,2048),this.schedule(a))}}};for(let o of this.current.keys())r(o);this.oncommit(()=>t.discard()),t.#b(),F=this,this.#m()}#v(t){for(var r=0;r!this.current.has(u));if(i.length===0)t&&_.discard();else if(r.length>0){if(h&&Zs(_.#a.length===0,"Batch has scheduled roots"),t)for(let u of this.#c)_.unskip_effect(u,d=>{(d.f&4194320)!==0?_.schedule(d):_.#v([d])});_.activate();var n=new Set,a=new Map;for(var l of r)ii(l,i,n,a);a=new Map;var c=[..._.current.keys()].filter(u=>this.current.has(u)?this.current.get(u)[0]!==u.v:!0);if(c.length>0)for(let u of this.#_)(u.f&155648)===0&&Do(u,c,a)&&((u.f&4194320)!==0?(Q(u,2048),_.schedule(u)):_.#p.add(u));if(_.#a.length>0){_.apply();for(var f of _.#a)_.#y(f,[],[]);_.#a=[]}_.deactivate()}}}}increment(t,r){if(this.#o+=1,t){let o=this.#i.get(r)??0;this.#i.set(r,o+1)}}decrement(t,r){if(this.#o-=1,t){let o=this.#i.get(r)??0;o===1?this.#i.delete(r):this.#i.set(r,o-1)}this.#h||(this.#h=!0,Ie(()=>{this.#h=!1,this.linked&&this.flush()}))}transfer_effects(t,r){for(let o of t)this.#p.add(o);for(let o of r)this.#f.add(o);t.clear(),r.clear()}oncommit(t){this.#l.add(t)}ondiscard(t){this.#n.add(t)}on_fork_commit(t){this.#s.add(t)}run_fork_commit_callbacks(){for(let t of this.#s)t(this);this.#s.clear()}settled(){return(this.#d??=Fn()).promise}static ensure(){if(F===null){let t=F=new e;t.#$(),!Oo&&!Nr&&Ie(()=>{t.#e||t.flush()})}return F}apply(){if(!Oe||!this.is_fork&&this.#t===null&&this.#r===null){De=null;return}De=new Map;for(let[r,[o]]of this.current)De.set(r,o);for(let r=Qn;r!==null;r=r.#r)if(!(r===this||r.is_fork)){var t=!1;if(r.id0)){lr.clear();for(let i of At){if((i.f&24576)!==0)continue;let n=[i],a=i.parent;for(;a!==null;)At.has(a)&&(At.delete(a),n.push(a)),a=a.parent;for(let l=n.length-1;l>=0;l--){let c=n[l];(c.f&24576)===0&&Ft(c)}}At.clear()}}At=null}}function ii(e,t,r,o){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(let i of e.reactions){let n=i.f;(n&2)!==0?ii(i,t,r,o):(n&4194320)!==0&&(n&2048)===0&&Do(i,t,o)&&(Q(i,2048),yn(i))}}function Do(e,t,r){let o=r.get(e);if(o!==void 0)return o;if(e.deps!==null)for(let i of e.deps){if(It.call(t,i))return!0;if((i.f&2)!==0&&Do(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function yn(e){F.schedule(e)}function ai(e,t){if(!((e.f&32)!==0&&(e.f&1024)!==0)){(e.f&2048)!==0?t.d.push(e):(e.f&4096)!==0&&t.m.push(e),Q(e,1024);for(var r=e.first;r!==null;)ai(r,t),r=r.next}}function li(e){Q(e,1024);for(var t=e.first;t!==null;)li(t),t=t.next}function Fo(e){let t=0,r=Je(0),o;return h&&We(r,"createSubscriber version"),()=>{sr()&&(s(r),qe(()=>(t===0&&(o=g(()=>e(()=>Ir(r)))),t+=1,()=>{Ie(()=>{t-=1,t===0&&(o?.(),o=void 0,Ir(r))})})))}}var Na=589824;function Po(e,t,r,o){new Lo(e,t,r,o)}var Lo=class{parent;is_pending=!1;transform_error;#e;#t=S?L:null;#r;#l;#n;#s=null;#o=null;#i=null;#d=null;#a=0;#_=0;#p=!1;#f=new Set;#u=new Set;#c=null;#h=Fo(()=>(this.#c=Je(this.#a),h&&We(this.#c,"$effect.pending()"),()=>{this.#c=null}));constructor(t,r,o,i){this.#e=t,this.#r=r,this.#l=n=>{var a=T;a.b=this,a.f|=128,o(n)},this.parent=T.b,this.transform_error=i??this.parent?.transform_error??(n=>n),this.#n=mt(()=>{if(S){let n=this.#t;Ne();let a=n.data==="[!";if(n.data.startsWith("[?")){let c=JSON.parse(n.data.slice("[?".length));this.#m(c)}else a?this.#y():this.#x()}else this.#w()},Na),S&&(this.#e=L)}#x(){try{this.#s=Ee(()=>this.#l(this.#e))}catch(t){this.error(t)}}#m(t){let r=this.#r.failed;r&&(this.#i=Ee(()=>{r(this.#e,()=>t,()=>()=>{})}))}#y(){let t=this.#r.pending;t&&(this.is_pending=!0,this.#o=Ee(()=>t(this.#e)),Ie(()=>{var r=this.#d=document.createDocumentFragment(),o=ge();r.append(o),this.#s=this.#v(()=>Ee(()=>this.#l(o))),this.#_===0&&(this.#e.before(r),this.#d=null,Zt(this.#o,()=>{this.#o=null}),this.#g(F))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#_=0,this.#a=0,this.#s=Ee(()=>{this.#l(this.#e)}),this.#_>0){var t=this.#d=document.createDocumentFragment();rn(this.#s,t);let r=this.#r.pending;this.#o=Ee(()=>r(this.#e))}else this.#g(F)}catch(r){this.error(r)}}#g(t){this.is_pending=!1,t.transfer_effects(this.#f,this.#u)}defer_effect(t){Xn(t,this.#f,this.#u)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#v(t){var r=T,o=M,i=j;ce(this.#n),he(this.#n),ir(this.#n.ctx);try{return _t.ensure(),t()}catch(n){return Kn(n),null}finally{ce(r),he(o),ir(i)}}#E(t,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#E(t,r);return}this.#_+=t,this.#_===0&&(this.#g(r),this.#o&&Zt(this.#o,()=>{this.#o=null}),this.#d&&(this.#e.before(this.#d),this.#d=null))}update_pending_count(t,r){this.#E(t,r),this.#a+=t,!(!this.#c||this.#p)&&(this.#p=!0,Ie(()=>{this.#p=!1,this.#c&&Lt(this.#c,this.#a)}))}get_effect_pending(){return this.#h(),s(this.#c)}error(t){if(!this.#r.onerror&&!this.#r.failed)throw t;F?.is_fork?(this.#s&&F.skip_effect(this.#s),this.#o&&F.skip_effect(this.#o),this.#i&&F.skip_effect(this.#i),F.on_fork_commit(()=>{this.#$(t)})):this.#$(t)}#$(t){this.#s&&(le(this.#s),this.#s=null),this.#o&&(le(this.#o),this.#o=null),this.#i&&(le(this.#i),this.#i=null),S&&(J(this.#t),mn(),J(Wt()));var r=this.#r.onerror;let o=this.#r.failed;var i=!1,n=!1;let a=()=>{if(i){Ws();return}i=!0,n&&zs(),this.#i!==null&&Zt(this.#i,()=>{this.#i=null}),this.#v(()=>{this.#w()})},l=c=>{try{n=!0,r?.(c,a),n=!1}catch(f){Tt(f,this.#n&&this.#n.parent)}o&&(this.#i=this.#v(()=>{try{return Ee(()=>{var f=T;f.b=this,f.f|=128,o(this.#e,()=>c,()=>a)})}catch(f){return Tt(f,this.#n.parent),null}}))};Ie(()=>{var c;try{c=this.transform_error(t)}catch(f){Tt(f,this.#n&&this.#n.parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(l,f=>Tt(f,this.#n&&this.#n.parent)):l(c)})}};function no(e,t,r,o){let i=Xt()?Mr:ur;var n=e.filter(d=>!d.settled);if(r.length===0&&n.length===0){o(t.map(i));return}var a=T,l=ui(),c=n.length===1?n[0].promise:n.length>1?Promise.all(n.map(d=>d.promise)):null;function f(d){if((a.f&16384)===0){l();try{o(d)}catch(p){Tt(p,a)}nn()}}var _=zo();if(r.length===0){c.then(()=>f(t.map(i))).finally(_);return}function u(){Promise.all(r.map(d=>Yo(d))).then(d=>f([...t.map(i),...d])).catch(d=>Tt(d,a)).finally(_)}c?c.then(()=>{l(),u(),nn()}):u()}function ui(){var e=T,t=M,r=j,o=F;if(h)var i=Kt;return function(a=!0){ce(e),he(t),ir(r),a&&(e.f&16384)===0&&(o?.activate(),o?.apply()),h&&(Bo(null),Gr(i))}}function nn(e=!0){ce(null),he(null),ir(null),e&&F?.deactivate(),h&&(Bo(null),Gr(null))}function zo(){var e=T,t=e.b,r=F,o=t.is_rendered();return t.update_pending_count(1,r),r.increment(o,e),()=>{t.update_pending_count(-1,r),r.decrement(o,e)}}var it=null;function Bo(e){it=e}var wn=new Set;function Mr(e){var t=2050;T!==null&&(T.f|=524288);let r={ctx:j,deps:null,effects:null,equals:Hn,f:t,fn:e,reactions:null,rv:0,v:oe,wv:0,parent:T,ac:null};return h&&Mt&&(r.created=Dt("created at")),r}var oo=Symbol("obsolete");function Yo(e,t,r){let o=T;o===null&&As();var i=void 0,n=Je(oe);h&&(n.label=t??e.toString());var a=!M,l=new Set;return _i(()=>{var c=T;h&&(it={effect:c,effect_deps:new Set,warned:!1});var f=Fn();i=f.promise;try{Promise.resolve(e()).then(f.resolve,p=>{p!==hr&&f.reject(p)}).finally(nn)}catch(p){f.reject(p),nn()}if(h){if(it){if(c.deps!==null)for(let p=0;p{h&&(it=null),u?.(),l.delete(f),b!==oo&&(_.activate(),b?(n.f|=8388608,Lt(n,b)):((n.f&8388608)!==0&&(n.f^=8388608),Lt(n,p),h&&r!==void 0&&(wn.add(n),setTimeout(()=>{wn.has(n)&&(c.f&16384)===0&&(Ys(n.label,r),wn.delete(n))}))),_.deactivate())};f.promise.then(d,p=>d(null,p||"unknown"))}),Me(()=>{for(let c of l)c.reject(oo)}),h&&(n.f|=4194304),new Promise(c=>{function f(_){function u(){_===i?c(n):f(i)}_.then(u,u)}f(i)})}function Dr(e){let t=Mr(e);return Oe||io(t),t}function ur(e){let t=Mr(e);return t.equals=Un,t}function di(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r5){let n=Dt("updated at");if(n!==null){let a=e.updated.get(n.stack);a||(a={error:n,count:0},e.updated.set(n.stack,a)),a.count++}}}T!==null&&(e.set_during_effect=!0)}if((e.f&2)!==0){let i=e;(e.f&2048)!==0&&En(i),De===null&&Wr(i)}e.wv=tn(),mi(e,2048,r),Xt()&&T!==null&&(T.f&1024)!==0&&(T.f&96)===0&&(gt===null?hi([e]):gt.push(e)),!o.is_fork&&qr.size>0&&!jo&&ro()}return t}function ro(){jo=!1;for(let e of qr){(e.f&1024)!==0&&Q(e,4096);let t;try{t=cr(e)}catch{t=!0}t&&Ft(e)}qr.clear()}function Ir(e){C(e,e.v+1)}function mi(e,t,r){var o=e.reactions;if(o!==null)for(var i=Xt(),n=o.length,a=0;a{if(yr===a)return u();var d=M,p=yr;he(null),Go(a);var b=u();return he(d),Go(p),b};o&&(r.set("length",Jt(e.length,n)),h&&(e=Ma(e)));var c="";let f=!1;function _(u){if(!f){f=!0,c=u,We(i,\`\${c} version\`);for(let[d,p]of r)We(p,Lr(c,d));f=!1}}return new Proxy(e,{defineProperty(u,d,p){(!("value"in p)||p.configurable===!1||p.enumerable===!1||p.writable===!1)&&Fs();var b=r.get(d);return b===void 0?l(()=>{var y=Jt(p.value,n);return r.set(d,y),h&&typeof d=="string"&&We(y,Lr(c,d)),y}):C(b,p.value,!0),!0},deleteProperty(u,d){var p=r.get(d);if(p===void 0){if(d in u){let b=l(()=>Jt(oe,n));r.set(d,b),Ir(i),h&&We(b,Lr(c,d))}}else C(p,oe),Ir(i);return!0},get(u,d,p){if(d===Pe)return e;if(h&&d===Pn)return _;var b=r.get(d),y=d in u;if(b===void 0&&(!y||ft(u,d)?.writable)&&(b=l(()=>{var O=xr(y?u[d]:oe),B=Jt(O,n);return h&&We(B,Lr(c,d)),B}),r.set(d,b)),b!==void 0){var x=s(b);return x===oe?void 0:x}return Reflect.get(u,d,p)},getOwnPropertyDescriptor(u,d){var p=Reflect.getOwnPropertyDescriptor(u,d);if(p&&"value"in p){var b=r.get(d);b&&(p.value=s(b))}else if(p===void 0){var y=r.get(d),x=y?.v;if(y!==void 0&&x!==oe)return{enumerable:!0,configurable:!0,value:x,writable:!0}}return p},has(u,d){if(d===Pe)return!0;var p=r.get(d),b=p!==void 0&&p.v!==oe||Reflect.has(u,d);if(p!==void 0||T!==null&&(!b||ft(u,d)?.writable)){p===void 0&&(p=l(()=>{var x=b?xr(u[d]):oe,O=Jt(x,n);return h&&We(O,Lr(c,d)),O}),r.set(d,p));var y=s(p);if(y===oe)return!1}return b},set(u,d,p,b){var y=r.get(d),x=d in u;if(o&&d==="length")for(var O=p;OJt(oe,n)),r.set(O+"",B),h&&We(B,Lr(c,O)))}if(y===void 0)(!x||ft(u,d)?.writable)&&(y=l(()=>Jt(void 0,n)),h&&We(y,Lr(c,d)),C(y,xr(p)),r.set(d,y));else{x=y.v!==oe;var P=l(()=>xr(p));C(y,P)}var X=Reflect.getOwnPropertyDescriptor(u,d);if(X?.set&&X.set.call(b,p),!x){if(o&&typeof d=="string"){var N=r.get("length"),E=Number(d);Number.isInteger(E)&&E>=N.v&&C(N,E+1)}Ir(i)}return!0},ownKeys(u){s(i);var d=Reflect.ownKeys(u).filter(y=>{var x=r.get(y);return x===void 0||x.v!==oe});for(var[p,b]of r)b.v!==oe&&!(p in u)&&d.push(p);return d},setPrototypeOf(){Ls()}})}function Lr(e,t){return typeof t=="symbol"?\`\${e}[Symbol(\${t.description??""})]\`:Oa.test(t)?\`\${e}.\${t}\`:/^\\d+$/.test(t)?\`\${e}[\${t}]\`:\`\${e}['\${t}']\`}function ao(e){try{if(e!==null&&typeof e=="object"&&Pe in e)return e[Pe]}catch{}return e}var Ia=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function Ma(e){return new Proxy(e,{get(t,r,o){var i=Reflect.get(t,r,o);return Ia.has(r)?function(...n){vi();var a=i.apply(this,n);return ro(),a}:i}})}function gi(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:r,lastIndexOf:o,includes:i}=e;e.indexOf=function(n,a){let l=r.call(this,n,a);if(l===-1){for(let c=a??0;c{e.indexOf=r,e.lastIndexOf=o,e.includes=i}}var Wo,$i,bn,bi,xi;function lo(){if(Wo===void 0){Wo=window,$i=document,bn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;bi=ft(t,"firstChild").get,xi=ft(t,"nextSibling").get,wo(e)&&(e[un]=void 0,e[zn]=null,e[dn]=void 0,e.__e=void 0),wo(r)&&(r[pn]=void 0),h&&(e.__svelte_meta=null,gi())}}function ge(e=""){return document.createTextNode(e)}function de(e){return bi.call(e)}function Ce(e){return xi.call(e)}function m(e,t){if(!S)return de(e);var r=de(L);if(r===null)r=L.appendChild(ge());else if(t&&r.nodeType!==Ar){var o=ge();return r?.before(o),J(o),o}return t&&Sn(r),J(r),r}function pe(e,t=!1){if(!S){var r=de(e);return r instanceof Comment&&r.data===""?Ce(r):r}if(t){if(L?.nodeType!==Ar){var o=ge();return L?.before(o),J(o),o}Sn(L)}return L}function $(e,t=1,r=!1){let o=S?L:e;for(var i;t--;)i=o,o=Ce(o);if(!S)return o;if(r){if(o?.nodeType!==Ar){var n=ge();return o===null?i?.after(n):o.before(n),J(n),n}Sn(o)}return J(o),o}function Tn(e){e.textContent=""}function co(){if(!Oe||At!==null)return!1;var e=T.f;return(e&32768)!==0}function Pt(e,t,r){let o=r?{is:r}:void 0;return document.createElementNS(t??Bn,e,o)}function Sn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ar;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function wr(e){var t=M,r=T;he(null),ce(null);try{return e()}finally{he(t),ce(r)}}function Xo(e){T===null&&(M===null&&Is(e),Os()),Rt&&Cs(e)}function qa(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function zt(e,t){var r=T;if(h)for(;r!==null&&(r.f&131072)!==0;)r=r.parent;r!==null&&(r.f&8192)!==0&&(e|=8192);var o={ctx:j,deps:null,nodes:null,f:e|2048|512,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};h&&(o.component_function=dt),F?.register_created_effect(o);var i=o;if((e&4)!==0)Cr!==null?Cr.push(o):_t.ensure().schedule(o);else if(t!==null){try{Ft(o)}catch(a){throw le(o),a}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&524288)===0&&(i=i.first,(e&16)!==0&&(e&65536)!==0&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=r,r!==null&&qa(i,r),M!==null&&(M.f&2)!==0&&(e&64)===0)){var n=M;(n.effects??=[]).push(i)}return o}function sr(){return M!==null&&!rt}function Me(e){let t=zt(8,null);return Q(t,1024),t.teardown=e,t}function An(e){Xo("$effect"),h&&Re(e,"name",{value:"$effect"});var t=T.f,r=!M&&(t&32)!==0&&(t&32768)===0;if(r){var o=j;(o.e??=[]).push(e)}else return Ao(e)}function Ao(e){return zt(1048580,e)}function Rn(e){return Xo("$effect.pre"),h&&Re(e,"name",{value:"$effect.pre"}),zt(1048584,e)}function fo(e){_t.ensure();let t=zt(524352,e);return()=>{le(t)}}function ki(e){_t.ensure();let t=zt(524352,e);return(r={})=>new Promise(o=>{r.outro?Zt(t,()=>{le(t),o(void 0)}):(le(t),o(void 0))})}function Nt(e){return zt(4,e)}function z(e,t){var r=j,o={effect:null,ran:!1,deps:e};r.l.$.push(o),o.effect=qe(()=>{if(e(),!o.ran){o.ran=!0;var i=T;try{ce(i.parent),g(t)}finally{ce(i)}}})}function He(){var e=j;qe(()=>{for(var t of e.l.$){t.deps();var r=t.effect;(r.f&1024)!==0&&r.deps!==null&&Q(r,4096),cr(r)&&Ft(r),t.ran=!1}})}function _i(e){return zt(4718592,e)}function qe(e,t=0){return zt(8|t,e)}function H(e,t=[],r=[],o=[]){no(o,t,r,i=>{zt(8,()=>e(...i.map(s)))})}function mt(e,t=0){var r=zt(16|t,e);return h&&(r.dev_stack=Kt),r}function Ee(e){return zt(524320,e)}function Zo(e){var t=e.teardown;if(t!==null){let r=Rt,o=M;Ko(!0),he(null);try{t.call(null)}finally{Ko(r),he(o)}}}function kn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){let i=r.ac;i!==null&&wr(()=>{i.abort(hr)});var o=r.next;(r.f&64)!==0?r.parent=null:le(r,t),r=o}}function Ti(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&32)===0&&le(t),t=r}}function le(e,t=!0){var r=!1;(t||(e.f&262144)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Jo(e.nodes.start,e.nodes.end),r=!0),Q(e,33554432),kn(e,t&&!r),Fr(e,0);var o=e.nodes&&e.nodes.t;if(o!==null)for(let n of o)n.stop();Zo(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&qo(e),h&&(e.component_function=null),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Jo(e,t){for(;e!==null;){var r=e===t?null:Ce(e);e.remove(),e=r}}function qo(e){var t=e.parent,r=e.prev,o=e.next;r!==null&&(r.next=o),o!==null&&(o.prev=r),t!==null&&(t.first===e&&(t.first=o),t.last===e&&(t.last=r))}function Zt(e,t,r=!0){var o=[];Si(e,o,!0);var i=()=>{r&&le(e),t&&t()},n=o.length;if(n>0){var a=()=>--n||i();for(var l of o)l.out(a)}else i()}function Si(e,t,r){if((e.f&8192)===0){e.f^=8192;var o=e.nodes&&e.nodes.t;if(o!==null)for(let l of o)(l.is_global||r)&&t.push(l);for(var i=e.first;i!==null;){var n=i.next;if((i.f&64)===0){var a=(i.f&65536)!==0||(i.f&32)!==0&&(e.f&16)!==0;Si(i,t,a?r:!1)}i=n}}}function Nn(e){Ai(e,!0)}function Ai(e,t){if((e.f&8192)!==0){e.f^=8192,(e.f&1024)===0&&(Q(e,2048),_t.ensure().schedule(e));for(var r=e.first;r!==null;){var o=r.next,i=(r.f&65536)!==0||(r.f&32)!==0;Ai(r,i?t:!1),r=o}var n=e.nodes&&e.nodes.t;if(n!==null)for(let a of n)(a.is_global||t)&&a.in()}}function rn(e,t){if(e.nodes)for(var r=e.nodes.start,o=e.nodes.end;r!==null;){var i=r===o?null:Ce(r);t.append(r),r=i}}var Ri=null;var uo=!1,Rt=!1;function Ko(e){Rt=e}var M=null,rt=!1;function he(e){M=e}var T=null;function ce(e){T=e}var ht=null;function io(e){M!==null&&(!Oe||(M.f&2)!==0)&&(ht===null?ht=[e]:ht.push(e))}var Fe=null,tt=0,gt=null;function hi(e){gt=e}var Ni=1,Pr=0,yr=Pr;function Go(e){yr=e}function tn(){return++Ni}function cr(e){var t=e.f;if((t&2048)!==0)return!0;if(t&2&&(e.f&=-65537),(t&4096)!==0){for(var r=e.deps,o=r.length,i=0;ie.wv)return!0}(t&512)!==0&&De===null&&Q(e,1024)}return!1}function Ci(e,t,r=!0){var o=e.reactions;if(o!==null&&!(!Oe&&ht!==null&&It.call(ht,e)))for(var i=0;i{e.ac.abort(hr)}),e.ac=null);try{e.f|=2097152;var _=e.fn,u=_();e.f|=32768;var d=e.deps,p=F?.is_fork;if(Fe!==null){var b;if(p||Fr(e,tt),d!==null&&tt>0)for(d.length=tt+Fe.length,b=0;b>>0).toString(36)}var za=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var t_=[...za,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var Ba=["touchstart","touchmove"];function Di(e){return Ba.includes(e)}var Ya=["$state","$state.raw","$derived","$derived.by"],r_=[...Ya,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function _o(e){return e?.replace(/\\//g,"/\\u200B")}var qi=new Map;function Fi(e,t){var r=qi.get(e);r||(r=new Set,qi.set(e,r)),r.add(t)}var vo=Symbol("events"),zi=new Set,Qo=new Set;function Bi(e,t,r,o={}){function i(n){if(o.capture||mo.call(t,n),!n.cancelBubble)return wr(()=>r?.call(this,n))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ie(()=>{t.addEventListener(e,i,o)}):t.addEventListener(e,i,o),i}function dr(e,t,r,o,i){var n={capture:o,passive:i},a=Bi(e,t,r,n);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Me(()=>{t.removeEventListener(e,a,n)})}var Pi=null;function mo(e){var t=this,r=t.ownerDocument,o=e.type,i=e.composedPath?.()||[],n=i[0]||e.target;Pi=e;var a=0,l=Pi===e&&e[vo];if(l){var c=i.indexOf(l);if(c!==-1&&(t===document||t===window)){e[vo]=t;return}var f=i.indexOf(t);if(f===-1)return;c<=f&&(a=c)}if(n=i[a]||e.target,n!==t){Re(e,"currentTarget",{configurable:!0,get(){return n||r}});var _=M,u=T;he(null),ce(null);try{for(var d,p=[];n!==null;){var b=n.assignedSlot||n.parentNode||n.host||null;try{var y=n[vo]?.[o];y!=null&&(!n.disabled||e.target===n)&&y.call(n,e)}catch(x){d?p.push(x):d=x}if(e.cancelBubble||b===t||b===null)break;n=b}if(d){for(let x of p)queueMicrotask(()=>{throw x});throw d}}finally{e[vo]=t,delete e.currentTarget,he(_),ce(u)}}}var Va=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Yi(e){return Va?.createHTML(e)??e}function es(e){var t=Pt("template");return t.innerHTML=Yi(e.replaceAll("","")),t.content}function $t(e,t){var r=T;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function I(e,t){var r=(t&1)!==0,o=(t&2)!==0,i,n=!e.startsWith("");return()=>{if(S)return $t(L,null),L;i===void 0&&(i=es(n?e:""+e),r||(i=de(i)));var a=o||bn?document.importNode(i,!0):i.cloneNode(!0);if(r){var l=de(a),c=a.lastChild;$t(l,c)}else $t(a,a);return a}}function Qt(e=""){if(!S){var t=ge(e+"");return $t(t,t),t}var r=L;return r.nodeType!==Ar?(r.before(r=ge()),J(r)):Sn(r),$t(r,r),r}function R(e,t){if(S){var r=T;((r.f&32768)===0||r.nodes.end===null)&&(r.nodes.end=L),Ne();return}e!==null&&e.before(t)}var ts=!0;function k(e,t){var r=t==null?"":typeof t=="object"?\`\${t}\`:t;r!==(e[pn]??=e.nodeValue)&&(e[pn]=r,e.nodeValue=\`\${r}\`)}function sn(e,t){return Hi(e,t)}function ns(e,t){lo(),t.intro=t.intro??!1;let r=t.target,o=S,i=L;try{for(var n=de(r);n&&(n.nodeType!==ut||n.data!=="[");)n=Ce(n);if(!n)throw Ut;$e(!0),J(n);let a=Hi(e,{...t,anchor:n});return $e(!1),a}catch(a){if(a instanceof Error&&a.message.split(\` +\`).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==Ut&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Ds(),lo(),Tn(r),$e(!1),sn(e,t)}finally{$e(o),J(i)}}var ho=new Map;function Hi(e,{target:t,anchor:r,props:o={},events:i,context:n,intro:a=!0,transformError:l}){lo();var c=void 0,f=ki(()=>{var _=r??t.appendChild(ge());Po(_,{pending:()=>{}},p=>{fe({});var b=j;if(n&&(b.c=n),i&&(o.$$events=i),S&&$t(p,null),ts=a,c=e(p,o)||{},ts=!0,S&&(T.nodes.end=L,L===null||L.nodeType!==ut||L.data!=="]"))throw gr(),Ut;ue()},l);var u=new Set,d=p=>{for(var b=0;b{for(var p of u)for(let x of[t,document]){var b=ho.get(x),y=b.get(p);--y==0?(x.removeEventListener(p,mo),b.delete(p),b.size===0&&ho.delete(x)):b.set(p,y)}Qo.delete(d),_!==r&&_.parentNode?.removeChild(_)}});return rs.set(c,f),c}var rs=new WeakMap;function os(e,t){let r=rs.get(e);return r?(rs.delete(e),r(t)):(h&&(Pe in e?Gs():js()),Promise.resolve())}var pr=class{anchor;#e=new Map;#t=new Map;#r=new Map;#l=new Set;#n=!0;constructor(t,r=!0){this.anchor=t,this.#n=r}#s=t=>{if(this.#e.has(t)){var r=this.#e.get(t),o=this.#t.get(r);if(o)Nn(o),this.#l.delete(r);else{var i=this.#r.get(r);i&&(this.#t.set(r,i.effect),this.#r.delete(r),h&&(i.fragment.lastChild[Eo]=this.anchor),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),o=i.effect)}for(let[n,a]of this.#e){if(this.#e.delete(n),n===t)break;let l=this.#r.get(a);l&&(le(l.effect),this.#r.delete(a))}for(let[n,a]of this.#t){if(n===r||this.#l.has(n))continue;let l=()=>{if(Array.from(this.#e.values()).includes(n)){var f=document.createDocumentFragment();rn(a,f),f.append(ge()),this.#r.set(n,{effect:a,fragment:f})}else le(a);this.#l.delete(n),this.#t.delete(n)};this.#n||!o?(this.#l.add(n),Zt(a,l,!1)):l()}}};#o=t=>{this.#e.delete(t);let r=Array.from(this.#e.values());for(let[o,i]of this.#r)r.includes(o)||(le(i.effect),this.#r.delete(o))};ensure(t,r){var o=F,i=co();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(i){var n=document.createDocumentFragment(),a=ge();n.append(a),this.#r.set(t,{effect:Ee(()=>r(a)),fragment:n})}else this.#t.set(t,Ee(()=>r(this.anchor)));if(this.#e.set(o,t),i){for(let[l,c]of this.#t)l===t?o.unskip_effect(c):o.skip_effect(c);for(let[l,c]of this.#r)l===t?o.unskip_effect(c.effect):o.skip_effect(c.effect);o.oncommit(this.#s),o.ondiscard(this.#o)}else S&&(this.anchor=L),this.#s(o)}};function se(e,t,r=!1){var o;S&&(o=L,Ne());var i=new pr(e),n=r?65536:0;function a(l,c){if(S){var f=hn(o);if(l!==parseInt(f.substring(1))){var _=Wt();J(_),i.anchor=_,$e(!1),i.ensure(l,c),$e(!0);return}}i.ensure(l,c)}mt(()=>{var l=!1;t((c,f=0)=>{l=!0,a(f,c)}),l||a(-1,null)},n)}function In(e,t){return t}function el(e,t,r){for(var o=[],i=t.length,n,a=t.length,l=0;l{if(n){if(n.pending.delete(u),n.done.add(u),n.pending.size===0){var d=e.outrogroups;ss(e,Hr(n.done)),d.delete(n),d.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=o.length===0&&r!==null;if(c){var f=r,_=f.parentNode;Tn(_),_.append(f),e.items.clear()}ss(e,t,!c)}else n={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(n)}function ss(e,t,r=!0){var o;if(e.pending.size>0){o=new Set;for(let a of e.pending.values())for(let l of a)o.add(e.items.get(l).e)}for(var i=0;i{var P=r();return or(P)?P:P==null?[]:Hr(P)});h&&We(u,"{#each ...}");var d,p=new Map,b=!0;function y(P){(B.effect.f&16384)===0&&(B.pending.delete(P),B.fallback=_,tl(B,d,a,t,o),_!==null&&(d.length===0?(_.f&33554432)===0?Nn(_):(_.f^=33554432,On(_,null,a)):Zt(_,()=>{_=null})))}function x(P){B.pending.delete(P)}var O=mt(()=>{d=s(u);var P=d.length;let X=!1;if(S){var N=hn(a)==="[!";N!==(P===0)&&(a=Wt(),J(a),$e(!1),X=!0)}for(var E=new Set,w=F,D=co(),G=0;Gn(a)):(_=Ee(()=>n(Vi??=ge())),_.f|=33554432)),P>E.size&&(h?nl(d,o):To("","","")),S&&P>0&&J(Wt()),!b)if(p.set(w,E),D){for(let[_e,Ve]of l)E.has(_e)||w.skip_effect(Ve.e);w.oncommit(y),w.ondiscard(x)}else y(w);X&&$e(!0),s(u)}),B={effect:O,flags:t,items:l,pending:p,outrogroups:null,fallback:_};b=!1,S&&(a=L)}function Cn(e){for(;e!==null&&(e.f&32)===0;)e=e.next;return e}function tl(e,t,r,o,i){var n=(o&8)!==0,a=t.length,l=e.items,c=Cn(e.effect.first),f,_=null,u,d=[],p=[],b,y,x,O;if(n)for(O=0;O0){var G=(o&4)!==0&&a===0?r:null;if(n){for(O=0;O{if(u!==void 0)for(x of u)x.nodes?.a?.apply()})}function rl(e,t,r,o,i,n,a,l){var c=(a&1)!==0?(a&16)===0?q(r,!1,!1):Je(r):null,f=(a&2)!==0?Je(i):null;return h&&c&&(c.trace=()=>{l()[f?.v??i]}),{v:c,i:f,e:Ee(()=>(n(t,c??r,f??i,l),()=>{e.delete(o)}))}}function On(e,t,r){if(e.nodes)for(var o=e.nodes.start,i=e.nodes.end,n=t&&(t.f&33554432)===0?t.nodes.start:r;o!==null;){var a=Ce(o);if(n.before(o),o===i)return;o=a}}function Er(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function nl(e,t){let r=new Map,o=e.length;for(let i=0;i{var f=T;if(l===(l=t()??"")){S&&Ne();return}if(r&&!S){f.nodes=null,c.innerHTML=l,l!==""&&$t(de(c),c.lastChild);return}if(f.nodes!==null&&(Jo(f.nodes.start,f.nodes.end),f.nodes=null),l!==""){if(S){for(var _=L.data,u=Ne(),d=u;u!==null&&(u.nodeType!==ut||u.data!=="");)d=u,u=Ce(u);if(u===null)throw gr(),Ut;h&&!n&&ol(u.parentNode,_,l),$t(L,d),a=J(u);return}var p=o?_n:i?So:void 0,b=Pt(o?"svg":i?"math":"template",p);b.innerHTML=l;var y=o||i?b:b.content;if($t(de(y),y.lastChild),o||i)for(;de(y);)a.before(de(y));else a.before(y)}})}function ke(e,t){Nt(()=>{var r=e.getRootNode(),o=r.host?r:r.head??r.ownerDocument.head;if(!o.querySelector("#"+t.hash)){let i=Pt("style");i.id=t.hash,i.textContent=t.code,o.appendChild(i),h&&Fi(t.hash,i)}})}var ji=[...\` +\\r\\f\\xA0\\v\\uFEFF\`];function Wi(e,t,r){var o=e==null?"":""+e;if(t&&(o=o?o+" "+t:t),r){for(var i of Object.keys(r))if(r[i])o=o?o+" "+i:i;else if(o.length)for(var n=i.length,a=0;(a=o.indexOf(i,a))>=0;){var l=a+n;(a===0||ji.includes(o[a-1]))&&(l===o.length||ji.includes(o[l]))?o=(a===0?"":o.substring(0,a))+o.substring(l+1):a=l}}return o===""?null:o}function Gi(e,t=!1){var r=t?" !important;":";",o="";for(var i of Object.keys(e)){var n=e[i];n!=null&&n!==""&&(o+=" "+i+": "+n+r)}return o}function is(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Ki(e,t){if(t){var r="",o,i;if(Array.isArray(t)?(o=t[0],i=t[1]):o=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,"").trim();var n=!1,a=0,l=!1,c=[];o&&c.push(...Object.keys(o).map(is)),i&&c.push(...Object.keys(i).map(is));var f=0,_=-1;let y=e.length;for(var u=0;ut.trim().split(" ").filter(Boolean))}function El(e,t){var r=Zi(e.srcset),o=Zi(t);return o.length===r.length&&o.every(([i,n],a)=>n===r[a][1]&&(ls(r[a][0],i)||ls(i,r[a][0])))}function Te(e=!1){let t=j,r=t.l.u;if(!r)return;let o=()=>V(t.s);if(e){let i=0,n={},a=Mr(()=>{let l=!1,c=t.s;for(let f in c)c[f]!==n[f]&&(n[f]=c[f],l=!0);return l&&i++,i});o=()=>s(a)}r.b.length&&Rn(()=>{ea(t,o),Vr(r.b)}),An(()=>{let i=g(()=>r.m.map(Es));return()=>{for(let n of i)typeof n=="function"&&n()}}),r.a.length&&An(()=>{ea(t,o),Vr(r.a)})}function ea(e,t){if(e.l.s)for(let r of e.l.s)s(r);t()}function ta(e){return new cs(e)}var cs=class{#e;#t;constructor(t){var r=new Map,o=(n,a)=>{var l=q(a,!1,!1);return r.set(n,l),l};let i=new Proxy({...t.props||{},$$events:{}},{get(n,a){return s(r.get(a)??o(a,Reflect.get(n,a)))},has(n,a){return a===Ln?!0:(s(r.get(a)??o(a,Reflect.get(n,a))),Reflect.has(n,a))},set(n,a,l){return C(r.get(a)??o(a,l),l),Reflect.set(n,a,l)}});this.#t=(t.hydrate?ns:sn)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),!Oe&&(!t?.props?.$$host||t.sync===!1)&&en(),this.#e=i.$$events;for(let n of Object.keys(this.#t))n==="$set"||n==="$destroy"||n==="$on"||Re(this,n,{get(){return this.#t[n]},set(a){this.#t[n]=a},enumerable:!0});this.#t.$set=n=>{Object.assign(i,n)},this.#t.$destroy=()=>{os(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];let o=(...i)=>r.call(this,...i);return this.#e[t].push(o),()=>{this.#e[t]=this.#e[t].filter(i=>i!==o)}}$destroy(){this.#t.$destroy()}};var Il;typeof HTMLElement=="function"&&(Il=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let o=this.$$c.$on(e,t);this.$$l_u.set(t,o)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){let o=this.$$l_u.get(t);o&&(o(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(o){return i=>{let n=Pt("slot");o!=="default"&&(n.name=o),R(i,n)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},r=Ml(this);for(let o of this.$$s)o in r&&(o==="default"&&!this.$$d.children?(this.$$d.children=e(o),t.default=!0):t[o]=e(o));for(let o of this.attributes){let i=this.$$g_p(o.name);i in this.$$d||(this.$$d[i]=fs(i,o.value,this.$$p_d,"toProp"))}for(let o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=ta({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=fo(()=>{qe(()=>{this.$$r=!0;for(let o of xo(this.$$c)){if(!this.$$p_d[o]?.reflect)continue;this.$$d[o]=this.$$c[o];let i=fs(o,this.$$d[o],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,i)}this.$$r=!1})});for(let o in this.$$l)for(let i of this.$$l[o]){let n=this.$$c.$on(o,i);this.$$l_u.set(i,n)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=fs(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return xo(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function fs(e,t,r,o){let i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!o||!r[e])return t;if(o==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Ml(e){let t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}if(h){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;qs(t)},set:o=>{r=o}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");Ks();var ql={stats:"/proxy-stats",recent:"/proxy-recent",latestPng:"/proxy-latest-png",sessions:"/api/sessions.json",fullStats:"/api/stats.json",currentSession:"/api/current-session.json",compressionToggle:"/api/compression"};async function us(e,t){let r=await fetch(e,t);if(!r.ok){let o="";try{o=await r.text()}catch{}throw new Error(\`\${e}: \${r.status} \${r.statusText}\${o?\` \\u2014 \${o.slice(0,200)}\`:""}\`)}return r.json()}async function Fl(e,t){return us(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function ra(e){return Fl(ql.compressionToggle,{enabled:e})}function an(e,t){let r=()=>{};return{subscribe:No({data:null,error:null,loading:!0},i=>{let n=!1,a=null,l=null,c=async()=>{try{let f=await us(e);if(n)return;l=f,i({data:f,error:null,loading:!1})}catch(f){if(n)return;i({data:l,error:f.message,loading:!1})}};return r=()=>{c()},c(),a=setInterval(c,t),()=>{n=!0,r=()=>{},a&&clearInterval(a)}}).subscribe,run:()=>r()}}var ln=an("/proxy-stats",2e3),Br=an("/proxy-recent",2e3),na=an("/api/sessions.json",5e3),N0=an("/api/stats.json",5e3),oa=an("/api/current-session.json",2e3),Mn=Xr(null);function Ll(){let{subscribe:e,update:t}=Xr([]),r=1;return{subscribe:e,push(o,i){let n=r++;t(a=>[...a,{id:n,level:o,text:i}]),setTimeout(()=>t(a=>a.filter(l=>l.id!==n)),5e3)},dismiss(o){t(i=>i.filter(n=>n.id!==o))}}}var Dn=Ll();function A(e){return Math.round(Number(e)||0).toLocaleString()}function sa(e){if(!e)return"-";let t=String(e).split("/");return t[t.length-1]||e}function $o(e){return e==null?"":String(e).replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}var Pl=I('
show calculation
'),zl=I('
show calculation
'),Bl=I('
',1),Yl=I('
small sample
',1),Hl=I('
show calculation
'),Vl=I('
show calculation
'),Ul=I('
diagnostic: counterfactual "share of spend saved"
share of spend saved (counterfactual):
'),jl=I('
requests
input tokens saved
cache-aware, input-side only
$ saved
at $5/M input tokens (Opus 4.7)
compressed $/req
passthrough $/req
compressed \\u2212 passthrough $/req
token-equivalent total
input + 5\\xD7output billed at 5\\xD7 input rate
',1),Gl={hash:"svelte-rhs7qr",code:\`.grid.svelte-rhs7qr {display:grid;grid-template-columns:repeat(6, 1fr);gap:14px;margin-bottom:22px;} @media (max-width: 1400px) {.grid.svelte-rhs7qr {grid-template-columns:repeat(3, 1fr);} } @media (max-width: 900px) {.grid.svelte-rhs7qr {grid-template-columns:repeat(2, 1fr);} }.card.svelte-rhs7qr {background:#161b22;border:1px solid #30363d;border-radius:10px;padding:14px 16px;}.label.svelte-rhs7qr {font-size:11px;text-transform:uppercase;letter-spacing:0.08em;color:#8b949e;margin-bottom:10px;}.value.svelte-rhs7qr {font-size:24px;font-weight:600;color:#e6edf3;font-variant-numeric:tabular-nums;}.value.pos.svelte-rhs7qr {color:#3fb950;}.value.neg.svelte-rhs7qr {color:#f85149;}.value.small-sample.svelte-rhs7qr {color:#8b949e;font-size:18px;font-weight:500;}.diagnostic.svelte-rhs7qr {margin:0 0 22px;font-size:12px;color:#8b949e;}.diagnostic.svelte-rhs7qr summary {cursor:pointer;user-select:none;color:#58a6ff;padding:6px 0;}.diagnostic.svelte-rhs7qr summary::-webkit-details-marker {display:none;}.diagnostic.svelte-rhs7qr summary::before {content:'\\u25B8 ';color:#6e7681;font-size:9px;}.diagnostic.svelte-rhs7qr [open] summary::before {content:'\\u25BE ';}.diagnostic-body.svelte-rhs7qr {background:#161b22;border:1px solid #30363d;border-radius:6px;padding:12px 14px;margin-top:6px;}.diag-headline.svelte-rhs7qr {color:#c9d1d9;margin-bottom:8px;}.diag-headline.svelte-rhs7qr .pos:where(.svelte-rhs7qr) {color:#3fb950;font-weight:600;}.diag-headline.svelte-rhs7qr .neg:where(.svelte-rhs7qr) {color:#f85149;font-weight:600;}.small.svelte-rhs7qr {font-size:11px;color:#6e7681;margin-top:4px;}.math.svelte-rhs7qr {margin-top:10px;font-size:11px;}.math.svelte-rhs7qr summary {cursor:pointer;user-select:none;color:#58a6ff;}.math.svelte-rhs7qr summary::-webkit-details-marker {display:none;}.math.svelte-rhs7qr summary::before {content:'\\u25B8 ';color:#6e7681;font-size:9px;}.math.svelte-rhs7qr [open] summary::before {content:'\\u25BE ';}.math.svelte-rhs7qr summary:hover {color:#79c0ff;}.formula.svelte-rhs7qr {background:#0d1117;border:1px solid #21262d;border-radius:6px;padding:8px 10px;margin-top:6px;font:11px/1.5 'SF Mono', Menlo, - monospace;color:#c9d1d9;white-space:pre-wrap;word-break:break-word;}.formula.svelte-rhs7qr .k {color:#8b949e;}.formula.svelte-rhs7qr .v {color:#e6edf3;}.formula.svelte-rhs7qr .op {color:#f0883e;}.formula.svelte-rhs7qr .src {color:#6e7681;font-size:10px;display:block;margin-top:6px;border-top:1px solid #21262d;padding-top:6px;}\`};function fs(e,t){pe(t,!1),qe(e,Hl);let r=()=>Ee(Gr,"$stats",n),[n,s]=Me(),o=q(),a=q(),l=q(),c=q(),f=q(),_=q(),u=q(),d=q();function p(H,V,Z){let Pe=typeof V=="number"?k(V):String(V??"-");return'
'+H+': '+po(Pe)+' '+(Z||"")+"
"}Y(()=>r(),()=>{R(o,r().data)}),Y(()=>i(o),()=>{R(a,i(o)?.pricing_assumptions??null)}),Y(()=>(i(o),i(a)),()=>{R(l,i(o)&&i(a)?'
formula: saved = baseline - actual
weights: input\\xD71.0, cache_create\\xD71.25, cache_read\\xD70.10
'+p("baseline",i(o).baseline_input_weighted,"(cache-aware: cacheable\\xD7weight + cold_tail)")+p("actual",i(o).actual_input_weighted,"(input + cc\\xD71.25 + cr\\xD70.10 from usage)")+p("saved",i(o).saved_input_tokens,'= baseline - actual')+'output excluded - identical with/without compression':"")}),Y(()=>i(a),()=>{R(c,i(a)?i(a).input_per_mtok:0)}),Y(()=>(i(o),i(a),i(c),po),()=>{R(f,i(o)&&i(a)?'
formula: $ saved = $ \\xD7 '+i(c)+'/Mtok
'+p("saved_tokens",i(o).saved_input_tokens,"(cache-aware, input-side)")+p("saved_usd",\`$\${(i(o).saved_usd||0).toFixed(4)}\\xA0\`,'= saved_tokens \\xD7 input_rate / 1e6')+\`source: \${po(i(a).source||"docs.anthropic.com pricing")}\`:"")}),Y(()=>(i(o),i(a)),()=>{R(_,i(o)&&i(a)?'
formula: share_of_spend = saved / (all_baseline_equivalent + all_output \\xD7 '+(i(a).output_multiplier??5)+\`)
why this is diagnostic, not the headline: this is a counterfactual ("what the user WOULD have paid"). It depends on the count_tokens probe, the cache-aware baseline split, and an Opus 4.7 input-rate assumption. Useful as a sanity check, but the operator's real question is "did the compressed path cost less per request than the passthrough path on real traffic" \\u2014 that's the headline split above, no counterfactuals.
\`+p("saved",i(o).saved_input_tokens,"(measured-rows numerator; cache-aware)")+p("all_baseline_equivalent",i(o).all_baseline_equivalent_weighted,"(every paid request, weighted; baseline on measured + actual on the rest)")+p("all_output \\xD7 "+(i(a).output_multiplier??5),i(o).all_output_weighted,"(every paid request, output \\xD7 "+(i(a).output_multiplier??5)+")")+p("all_counterfactual_total",i(o).all_baseline_equivalent_weighted+i(o).all_output_weighted,'= all_baseline_equivalent + all_output')+p("share_of_spend",(i(o).saved_pct_of_all_spend||0).toFixed(1)+"%",'= saved / all_counterfactual_total \\xD7 100')+p("all_usage_requests",i(o).all_usage_requests,"(denominator request count - compressed + passthrough + probe-failed)")+'measured numerator, all-rows counterfactual denominator - bounded at 100%':"")}),Y(()=>(i(o),i(a)),()=>{R(u,i(o)&&i(a)?'
formula: bucket_$ = (\\u03A3 actual_input + \\u03A3 output \\xD7 '+(i(a).output_multiplier??5)+") \\xD7 $"+(i(a).input_per_mtok??5)+'/Mtok
why: partition the paid-rows set by which path actually ran this turn (\`info.compressed = true\` for slab/history compression; false for passthrough or bypassed). Same $/Mtok rate on both sides so the rate-assumption bias cancels in the delta. Selection bias (the gate routes each turn) does NOT cancel \\u2014 interpret with sample counts.
'+p("compressed (n="+i(o).compressed_paid_requests+")","$"+(i(o).compressed_actual_usd||0).toFixed(4),"total \\xB7 avg $"+(i(o).compressed_avg_usd_per_request||0).toFixed(4)+"/req")+p("passthrough (n="+i(o).passthrough_paid_requests+")","$"+(i(o).passthrough_actual_usd||0).toFixed(4),"total \\xB7 avg $"+(i(o).passthrough_avg_usd_per_request||0).toFixed(4)+"/req")+p("compressed \\u2212 passthrough","$"+(i(o).compressed_minus_passthrough_avg_usd||0).toFixed(4)+"/req",i(o).split_sufficient_sample?"(both buckets \\u2265 "+i(o).split_min_sample_per_bucket+" \\u2014 delta is meaningful)":"(small sample: need \\u2265 "+i(o).split_min_sample_per_bucket+" per bucket; treat delta as noisy)")+'no counterfactual, no probe gate \\u2014 pure observed $/req on each path':"")}),Y(()=>(i(o),i(a)),()=>{R(d,i(o)&&i(a)?'
formula: token_equivalent = input + output \\xD7 '+(i(a).output_multiplier??5)+\`
why: matches Anthropic's per-Mtok price ratio ($\`+(i(a).input_per_mtok??5)+" input vs $"+(i(a).input_per_mtok??5)*(i(a).output_multiplier??5)+' output)
'+p("actual_input",i(o).actual_input_weighted,"(weighted upstream usage)")+'
+ = raw output_tokens (already weighted)
'+p("actual_token_equivalent",i(o).actual_token_equivalent)+p("baseline_token_equivalent",i(o).baseline_token_equivalent,"(unproxied counterfactual, same \\xD7 "+(i(a).output_multiplier??5)+" on output)")+'
measured vs billed: we now SSE-tee response bodies + count text_delta / thinking_delta / tool_use chars so you can compare what we actually saw on the wire against output_tokens. The redacted_thinking block count is included because Anthropic ships those as opaque server-encrypted bytes with no char count \\u2014 output_tokens invisibly. This is what surfaced the May-2026 weekly-meter gap.
'+p("events_with_measurement",i(o).events_with_measurement,"(events where SSE/JSON scanner produced char counts)")+p("measured_text_chars",i(o).measured_text_chars,"(content_block_delta \\xB7 text_delta + response content[].text)")+p("measured_thinking_chars",i(o).measured_thinking_chars,"(content_block_delta \\xB7 thinking_delta + response reasoning text)")+p("measured_tool_use_chars",i(o).measured_tool_use_chars,"(content_block_delta \\xB7 input_json_delta + tool_use blocks)")+p("measured_redacted_blocks",i(o).measured_redacted_block_count,"(opaque encrypted blocks - chars unavailable, billed but unmeasurable)")+'measured - no estimation':"")}),We(),Fe();var g=Yl(),y=Ne(g),x=h(y),N=$(h(x),2),B=h(N,!0);m(N);var F=$(N,2),K=h(F);m(F),m(x);var S=$(x,2),w=$(h(S),2),M=h(w,!0);m(w);var te=$(w,4);{var oe=H=>{var V=Ml(),Z=$(h(V),2);wr(Z,()=>i(l),!0),m(Z),m(V),O(H,V)};le(te,H=>{i(o)&&i(a)&&H(oe)})}m(S);var Q=$(S,2),U=$(h(Q),2),se=h(U);m(U);var X=$(U,4);{var Re=H=>{var V=ql(),Z=$(h(V),2);wr(Z,()=>i(f),!0),m(Z),m(V),O(H,V)};le(X,H=>{i(o)&&i(a)&&H(Re)})}m(Q);var Ke=$(Q,2),zt=$(h(Ke),2),Bt=h(zt);m(zt);var Le=$(zt,2),Xe=h(Le);m(Le),m(Ke);var ut=$(Ke,2),Nt=$(h(ut),2),gt=h(Nt);m(Nt);var Qe=$(Nt,2),kr=h(Qe);m(Qe),m(ut);var Wr=$(ut,2),Sr=$(h(Wr),2);{var En=H=>{var V=Fl(),Z=Ne(V);let Pe;var et=h(Z);m(Z);var $t=$(Z,2),Yt=h($t);m($t),G(Ht=>{Pe=At(Z,1,"value svelte-rhs7qr",null,Pe,{pos:(i(o)?.compressed_minus_passthrough_avg_usd??0)<=0,neg:(i(o)?.compressed_minus_passthrough_avg_usd??0)>0}),A(et,\`\${i(o),b(()=>(i(o)?.compressed_minus_passthrough_avg_usd??0)>=0?"+$ ":"-$ ")??""}\${Ht??""}\`),A(Yt,\`negative = compressed path cheaper \\xB7 both buckets \\u2265 \${i(o),b(()=>i(o)?.split_min_sample_per_bucket)??""}\`)},[()=>(i(o),b(()=>Math.abs(i(o)?.compressed_minus_passthrough_avg_usd??0).toFixed(4)))]),O(H,V)},_o=H=>{var V=Ll(),Z=$(Ne(V),2),Pe=h(Z);m(Z),G((et,$t)=>A(Pe,\`need \\u2265 \${i(o),b(()=>i(o)?.split_min_sample_per_bucket)??""} requests per bucket \\xB7 have - \${et??""} / \${$t??""}\`),[()=>(z(k),i(o),b(()=>k(i(o)?.compressed_paid_requests))),()=>(z(k),i(o),b(()=>k(i(o)?.passthrough_paid_requests)))]),O(H,V)};le(Sr,H=>{i(o),b(()=>i(o)?.split_sufficient_sample)?H(En):H(_o,-1)})}var Kr=$(Sr,2);{var Tn=H=>{var V=Pl(),Z=$(h(V),2);wr(Z,()=>i(u),!0),m(Z),m(V),O(H,V)};le(Kr,H=>{i(o)&&i(a)&&H(Tn)})}m(Wr);var kn=$(Wr,2),lr=$(h(kn),2),Sn=h(lr,!0);m(lr);var vo=$(lr,4);{var Xr=H=>{var V=zl(),Z=$(h(V),2);wr(Z,()=>i(d),!0),m(Z),m(V),O(H,V)};le(vo,H=>{i(o)&&i(a)&&H(Xr)})}m(kn),m(y);var An=$(y,2);{var mo=H=>{var V=Bl(),Z=$(h(V),2),Pe=h(Z),et=$(h(Pe));let $t;var Yt=h(et);m(et);var Ht=$(et,2),Zr=h(Ht);m(Ht),m(Pe);var cr=$(Pe,2);wr(cr,()=>i(_),!0),m(cr),m(Z),m(V),G((Ar,ho)=>{$t=At(et,1,"svelte-rhs7qr",null,$t,{pos:(i(o)?.saved_pct_of_all_spend??0)>=0,neg:(i(o)?.saved_pct_of_all_spend??0)<0}),A(Yt,\`\${Ar??""}%\`),A(Zr,\`(\${ho??""} paid req \\xB7 compressed + passthrough + probe-failed)\`)},[()=>(i(o),b(()=>(i(o)?.saved_pct_of_all_spend??0).toFixed(1))),()=>(z(k),i(o),b(()=>k(i(o)?.all_usage_requests)))]),O(H,V)};le(An,H=>{i(o)&&i(a)&&H(mo)})}G((H,V,Z,Pe,et,$t,Yt,Ht,Zr,cr,Ar)=>{A(B,H),A(K,\`\\u2014 \${V??""} compressed\`),A(M,Z),A(se,\`$ \${Pe??""}\`),A(Bt,\`$ \${et??""}\`),A(Xe,\`n=\${$t??""} \\xB7 total $ \${Yt??""}\`),A(gt,\`$ \${Ht??""}\`),A(kr,\`n=\${Zr??""} \\xB7 total $ \${cr??""}\`),A(Sn,Ar)},[()=>(z(k),i(o),b(()=>k(i(o)?.requests))),()=>(z(k),i(o),b(()=>k(i(o)?.compressed_requests))),()=>(z(k),i(o),b(()=>k(i(o)?.saved_input_tokens))),()=>(i(o),b(()=>(i(o)?.saved_usd??0).toFixed(2))),()=>(i(o),b(()=>(i(o)?.compressed_avg_usd_per_request??0).toFixed(4))),()=>(z(k),i(o),b(()=>k(i(o)?.compressed_paid_requests))),()=>(i(o),b(()=>(i(o)?.compressed_actual_usd??0).toFixed(4))),()=>(i(o),b(()=>(i(o)?.passthrough_avg_usd_per_request??0).toFixed(4))),()=>(z(k),i(o),b(()=>k(i(o)?.passthrough_paid_requests))),()=>(i(o),b(()=>(i(o)?.passthrough_actual_usd??0).toFixed(4))),()=>(z(k),i(o),b(()=>k(i(o)?.actual_token_equivalent)))]),O(e,g),_e(),s()}var Vl=L(''),Ul=L('-'),jl=L(' '),Gl=L('no requests yet'),Wl=L('
#statuspathcccrbaselineactualsavedimg
'),Kl={hash:"svelte-hn7ohq",code:\`table.svelte-hn7ohq {width:100%;border-collapse:collapse;font-size:12px;}th.svelte-hn7ohq {text-align:left;color:#6e7681;font-weight:500;padding:6px 8px;border-bottom:1px solid #30363d;}td.svelte-hn7ohq {padding:6px 8px;border-bottom:1px solid #21262d;font-variant-numeric:tabular-nums;}tr.svelte-hn7ohq:last-child td:where(.svelte-hn7ohq) {border-bottom:none;}th.num.svelte-hn7ohq, - td.num.svelte-hn7ohq {text-align:right;}.small.svelte-hn7ohq {font-size:11px;color:#6e7681;}td.good.svelte-hn7ohq {color:#3fb950;}td.warn.svelte-hn7ohq {color:#d29922;}td.bad.svelte-hn7ohq {color:#f85149;}td.pos.svelte-hn7ohq {color:#3fb950;}.muted.svelte-hn7ohq {color:#6e7681;}.view-btn.svelte-hn7ohq {font-size:11px;background:#21262d;color:#58a6ff;border:1px solid #30363d;border-radius:4px;padding:1px 6px;cursor:pointer;}.view-btn.svelte-hn7ohq:hover {background:#30363d;}\`};function us(e,t){pe(t,!1),qe(e,Kl);let r=()=>Ee(Tr,"$recent",n),[n,s]=Me(),o=q();function a(_){return _>=500?"bad":_>=400?"warn":"good"}function l(_){if(!_)return"-";let u=_.split("/");return u[u.length-1]||_}Y(()=>r(),()=>{R(o,r().data?.recent??[])}),We(),Fe();var c=Wl(),f=$(h(c));yr(f,7,()=>(i(o),b(()=>i(o).slice().reverse())),(_,u)=>_.ts+":"+u,(_,u,d)=>{var p=jl(),g=h(p),y=h(g,!0);m(g);var x=$(g),N=h(x,!0);m(x);var B=$(x),F=h(B,!0);m(B);var K=$(B),S=h(K,!0);m(K);var w=$(K),M=h(w,!0);m(w);var te=$(w),oe=h(te,!0);m(te);var Q=$(te),U=h(Q,!0);m(Q);var se=$(Q),X=h(se,!0);m(se);var Re=$(se),Ke=h(Re);{var zt=Le=>{var Xe=Vl();Zt("click",Xe,()=>yn.set(i(u).img_id??null)),O(Le,Xe)},Bt=Le=>{var Xe=Ul();O(Le,Xe)};le(Ke,Le=>{i(u),b(()=>i(u).img_id!=null)?Le(zt):Le(Bt,-1)})}m(Re),m(p),G((Le,Xe,ut,Nt,gt,Qe)=>{A(y,i(d)+1),At(x,1,\`num \${Le??""}\`,"svelte-hn7ohq"),A(N,(i(u),b(()=>i(u).status))),A(F,Xe),A(S,(i(u),b(()=>i(u).cc_added?"\\u2713":"-"))),A(M,ut),A(oe,Nt),A(U,gt),A(X,Qe)},[()=>(i(u),b(()=>a(i(u).status))),()=>(i(u),b(()=>l(i(u).path))),()=>(i(u),z(k),b(()=>i(u).cache_read!=null?k(i(u).cache_read):"-")),()=>(i(u),z(k),b(()=>i(u).baseline_input!=null?k(i(u).baseline_input):"-")),()=>(i(u),z(k),b(()=>i(u).actual_input!=null?k(i(u).actual_input):"-")),()=>(i(u),z(k),b(()=>(i(u).session_saved_so_far_delta??0)>0?"+"+k(i(u).session_saved_so_far_delta??0):"-"))]),O(_,p)},_=>{var u=Gl();O(_,u)}),m(f),m(c),O(e,c),_e(),s()}var Xl=L('
'),Zl=L('
'),Jl=L('
',1),Ql=L('
latest rendered
'),ec=L('
(none yet)
'),tc=L('
',1),rc={hash:"svelte-3whs73",code:\`.wrap.svelte-3whs73 {margin-top:0;} + monospace;color:#c9d1d9;white-space:pre-wrap;word-break:break-word;}.formula.svelte-rhs7qr .k {color:#8b949e;}.formula.svelte-rhs7qr .v {color:#e6edf3;}.formula.svelte-rhs7qr .op {color:#f0883e;}.formula.svelte-rhs7qr .src {color:#6e7681;font-size:10px;display:block;margin-top:6px;border-top:1px solid #21262d;padding-top:6px;}\`};function ds(e,t){fe(t,!1),ke(e,Gl);let r=()=>me(ln,"$stats",o),[o,i]=xe(),n=q(),a=q(),l=q(),c=q(),f=q(),_=q(),u=q(),d=q();function p(Y,U,ee){let je=typeof U=="number"?A(U):String(U??"-");return'
'+Y+': '+$o(je)+' '+(ee||"")+"
"}z(()=>r(),()=>{C(n,r().data)}),z(()=>s(n),()=>{C(a,s(n)?.pricing_assumptions??null)}),z(()=>(s(n),s(a)),()=>{C(l,s(n)&&s(a)?'
formula: saved = baseline - actual
weights: input\\xD71.0, cache_create\\xD71.25, cache_read\\xD70.10
'+p("baseline",s(n).baseline_input_weighted,"(cache-aware: cacheable\\xD7weight + cold_tail)")+p("actual",s(n).actual_input_weighted,"(input + cc\\xD71.25 + cr\\xD70.10 from usage)")+p("saved",s(n).saved_input_tokens,'= baseline - actual')+'output excluded - identical with/without compression':"")}),z(()=>s(a),()=>{C(c,s(a)?s(a).input_per_mtok:0)}),z(()=>(s(n),s(a),s(c),$o),()=>{C(f,s(n)&&s(a)?'
formula: $ saved = $ \\xD7 '+s(c)+'/Mtok
'+p("saved_tokens",s(n).saved_input_tokens,"(cache-aware, input-side)")+p("saved_usd",\`$\${(s(n).saved_usd||0).toFixed(4)}\\xA0\`,'= saved_tokens \\xD7 input_rate / 1e6')+\`source: \${$o(s(a).source||"docs.anthropic.com pricing")}\`:"")}),z(()=>(s(n),s(a)),()=>{C(_,s(n)&&s(a)?'
formula: share_of_spend = saved / (all_baseline_equivalent + all_output \\xD7 '+(s(a).output_multiplier??5)+\`)
why this is diagnostic, not the headline: this is a counterfactual ("what the user WOULD have paid"). It depends on the count_tokens probe, the cache-aware baseline split, and an Opus 4.7 input-rate assumption. Useful as a sanity check, but the operator's real question is "did the compressed path cost less per request than the passthrough path on real traffic" \\u2014 that's the headline split above, no counterfactuals.
\`+p("saved",s(n).saved_input_tokens,"(measured-rows numerator; cache-aware)")+p("all_baseline_equivalent",s(n).all_baseline_equivalent_weighted,"(every paid request, weighted; baseline on measured + actual on the rest)")+p("all_output \\xD7 "+(s(a).output_multiplier??5),s(n).all_output_weighted,"(every paid request, output \\xD7 "+(s(a).output_multiplier??5)+")")+p("all_counterfactual_total",s(n).all_baseline_equivalent_weighted+s(n).all_output_weighted,'= all_baseline_equivalent + all_output')+p("share_of_spend",(s(n).saved_pct_of_all_spend||0).toFixed(1)+"%",'= saved / all_counterfactual_total \\xD7 100')+p("all_usage_requests",s(n).all_usage_requests,"(denominator request count - compressed + passthrough + probe-failed)")+'measured numerator, all-rows counterfactual denominator - bounded at 100%':"")}),z(()=>(s(n),s(a)),()=>{C(u,s(n)&&s(a)?'
formula: bucket_$ = (\\u03A3 actual_input + \\u03A3 output \\xD7 '+(s(a).output_multiplier??5)+") \\xD7 $"+(s(a).input_per_mtok??5)+'/Mtok
why: partition the paid-rows set by which path actually ran this turn (\`info.compressed = true\` for slab/history compression; false for passthrough or bypassed). Same $/Mtok rate on both sides so the rate-assumption bias cancels in the delta. Selection bias (the gate routes each turn) does NOT cancel \\u2014 interpret with sample counts.
'+p("compressed (n="+s(n).compressed_paid_requests+")","$"+(s(n).compressed_actual_usd||0).toFixed(4),"total \\xB7 avg $"+(s(n).compressed_avg_usd_per_request||0).toFixed(4)+"/req")+p("passthrough (n="+s(n).passthrough_paid_requests+")","$"+(s(n).passthrough_actual_usd||0).toFixed(4),"total \\xB7 avg $"+(s(n).passthrough_avg_usd_per_request||0).toFixed(4)+"/req")+p("compressed \\u2212 passthrough","$"+(s(n).compressed_minus_passthrough_avg_usd||0).toFixed(4)+"/req",s(n).split_sufficient_sample?"(both buckets \\u2265 "+s(n).split_min_sample_per_bucket+" \\u2014 delta is meaningful)":"(small sample: need \\u2265 "+s(n).split_min_sample_per_bucket+" per bucket; treat delta as noisy)")+'no counterfactual, no probe gate \\u2014 pure observed $/req on each path':"")}),z(()=>(s(n),s(a)),()=>{C(d,s(n)&&s(a)?'
formula: token_equivalent = input + output \\xD7 '+(s(a).output_multiplier??5)+\`
why: matches Anthropic's per-Mtok price ratio ($\`+(s(a).input_per_mtok??5)+" input vs $"+(s(a).input_per_mtok??5)*(s(a).output_multiplier??5)+' output)
'+p("actual_input",s(n).actual_input_weighted,"(weighted upstream usage)")+'
+ = raw output_tokens (already weighted)
'+p("actual_token_equivalent",s(n).actual_token_equivalent)+p("baseline_token_equivalent",s(n).baseline_token_equivalent,"(unproxied counterfactual, same \\xD7 "+(s(a).output_multiplier??5)+" on output)")+'
measured vs billed: we now SSE-tee response bodies + count text_delta / thinking_delta / tool_use chars so you can compare what we actually saw on the wire against output_tokens. The redacted_thinking block count is included because Anthropic ships those as opaque server-encrypted bytes with no char count \\u2014 output_tokens invisibly. This is what surfaced the May-2026 weekly-meter gap.
'+p("events_with_measurement",s(n).events_with_measurement,"(events where SSE/JSON scanner produced char counts)")+p("measured_text_chars",s(n).measured_text_chars,"(content_block_delta \\xB7 text_delta + response content[].text)")+p("measured_thinking_chars",s(n).measured_thinking_chars,"(content_block_delta \\xB7 thinking_delta + response reasoning text)")+p("measured_tool_use_chars",s(n).measured_tool_use_chars,"(content_block_delta \\xB7 input_json_delta + tool_use blocks)")+p("measured_redacted_blocks",s(n).measured_redacted_block_count,"(opaque encrypted blocks - chars unavailable, billed but unmeasurable)")+'measured - no estimation':"")}),He(),Te();var b=jl(),y=pe(b),x=m(y),O=$(m(x),2),B=m(O,!0);v(O);var P=$(O,2),X=m(P);v(P),v(x);var N=$(x,2),E=$(m(N),2),w=m(E,!0);v(E);var D=$(E,4);{var G=Y=>{var U=Pl(),ee=$(m(U),2);zr(ee,()=>s(l),!0),v(ee),v(U),R(Y,U)};se(D,Y=>{s(n)&&s(a)&&Y(G)})}v(N);var W=$(N,2),K=$(m(W),2),ne=m(K);v(K);var Z=$(K,4);{var _e=Y=>{var U=zl(),ee=$(m(U),2);zr(ee,()=>s(f),!0),v(ee),v(U),R(Y,U)};se(Z,Y=>{s(n)&&s(a)&&Y(_e)})}v(W);var Ve=$(W,2),bt=$(m(Ve),2),Ct=m(bt);v(bt);var ve=$(bt,2),Ue=m(ve);v(ve),v(Ve);var Qe=$(Ve,2),xt=$(m(Qe),2),at=m(xt);v(xt);var et=$(xt,2),mr=m(et);v(et),v(Qe);var Se=$(Qe,2),Ae=$(m(Se),2);{var nt=Y=>{var U=Bl(),ee=pe(U);let je;var ct=m(ee);v(ee);var Ot=$(ee,2),rr=m(Ot);v(Ot),H(nr=>{je=Yt(ee,1,"value svelte-rhs7qr",null,je,{pos:(s(n)?.compressed_minus_passthrough_avg_usd??0)<=0,neg:(s(n)?.compressed_minus_passthrough_avg_usd??0)>0}),k(ct,\`\${s(n),g(()=>(s(n)?.compressed_minus_passthrough_avg_usd??0)>=0?"+$ ":"-$ ")??""}\${nr??""}\`),k(rr,\`negative = compressed path cheaper \\xB7 both buckets \\u2265 \${s(n),g(()=>s(n)?.split_min_sample_per_bucket)??""}\`)},[()=>(s(n),g(()=>Math.abs(s(n)?.compressed_minus_passthrough_avg_usd??0).toFixed(4)))]),R(Y,U)},Ht=Y=>{var U=Yl(),ee=$(pe(U),2),je=m(ee);v(ee),H((ct,Ot)=>k(je,\`need \\u2265 \${s(n),g(()=>s(n)?.split_min_sample_per_bucket)??""} requests per bucket \\xB7 have + \${ct??""} / \${Ot??""}\`),[()=>(V(A),s(n),g(()=>A(s(n)?.compressed_paid_requests))),()=>(V(A),s(n),g(()=>A(s(n)?.passthrough_paid_requests)))]),R(Y,U)};se(Ae,Y=>{s(n),g(()=>s(n)?.split_sufficient_sample)?Y(nt):Y(Ht,-1)})}var ot=$(Ae,2);{var Vt=Y=>{var U=Hl(),ee=$(m(U),2);zr(ee,()=>s(u),!0),v(ee),v(U),R(Y,U)};se(ot,Y=>{s(n)&&s(a)&&Y(Vt)})}v(Se);var yt=$(Se,2),ae=$(m(yt),2),wt=m(ae,!0);v(ae);var Et=$(ae,4);{var Le=Y=>{var U=Vl(),ee=$(m(U),2);zr(ee,()=>s(d),!0),v(ee),v(U),R(Y,U)};se(Et,Y=>{s(n)&&s(a)&&Y(Le)})}v(yt),v(y);var lt=$(y,2);{var tr=Y=>{var U=Ul(),ee=$(m(U),2),je=m(ee),ct=$(m(je));let Ot;var rr=m(ct);v(ct);var nr=$(ct,2),cn=m(nr);v(nr),v(je);var Tr=$(je,2);zr(Tr,()=>s(_),!0),v(Tr),v(ee),v(U),H((Yr,bo)=>{Ot=Yt(ct,1,"svelte-rhs7qr",null,Ot,{pos:(s(n)?.saved_pct_of_all_spend??0)>=0,neg:(s(n)?.saved_pct_of_all_spend??0)<0}),k(rr,\`\${Yr??""}%\`),k(cn,\`(\${bo??""} paid req \\xB7 compressed + passthrough + probe-failed)\`)},[()=>(s(n),g(()=>(s(n)?.saved_pct_of_all_spend??0).toFixed(1))),()=>(V(A),s(n),g(()=>A(s(n)?.all_usage_requests)))]),R(Y,U)};se(lt,Y=>{s(n)&&s(a)&&Y(tr)})}H((Y,U,ee,je,ct,Ot,rr,nr,cn,Tr,Yr)=>{k(B,Y),k(X,\`\\u2014 \${U??""} compressed\`),k(w,ee),k(ne,\`$ \${je??""}\`),k(Ct,\`$ \${ct??""}\`),k(Ue,\`n=\${Ot??""} \\xB7 total $ \${rr??""}\`),k(at,\`$ \${nr??""}\`),k(mr,\`n=\${cn??""} \\xB7 total $ \${Tr??""}\`),k(wt,Yr)},[()=>(V(A),s(n),g(()=>A(s(n)?.requests))),()=>(V(A),s(n),g(()=>A(s(n)?.compressed_requests))),()=>(V(A),s(n),g(()=>A(s(n)?.saved_input_tokens))),()=>(s(n),g(()=>(s(n)?.saved_usd??0).toFixed(2))),()=>(s(n),g(()=>(s(n)?.compressed_avg_usd_per_request??0).toFixed(4))),()=>(V(A),s(n),g(()=>A(s(n)?.compressed_paid_requests))),()=>(s(n),g(()=>(s(n)?.compressed_actual_usd??0).toFixed(4))),()=>(s(n),g(()=>(s(n)?.passthrough_avg_usd_per_request??0).toFixed(4))),()=>(V(A),s(n),g(()=>A(s(n)?.passthrough_paid_requests))),()=>(s(n),g(()=>(s(n)?.passthrough_actual_usd??0).toFixed(4))),()=>(V(A),s(n),g(()=>A(s(n)?.actual_token_equivalent)))]),R(e,b),ue(),i()}var Wl=I(''),Kl=I('-'),Xl=I(' '),Zl=I('no requests yet'),Jl=I('
#statuspathcccrbaselineactualsavedimg
'),Ql={hash:"svelte-hn7ohq",code:\`table.svelte-hn7ohq {width:100%;border-collapse:collapse;font-size:12px;}th.svelte-hn7ohq {text-align:left;color:#6e7681;font-weight:500;padding:6px 8px;border-bottom:1px solid #30363d;}td.svelte-hn7ohq {padding:6px 8px;border-bottom:1px solid #21262d;font-variant-numeric:tabular-nums;}tr.svelte-hn7ohq:last-child td:where(.svelte-hn7ohq) {border-bottom:none;}th.num.svelte-hn7ohq, + td.num.svelte-hn7ohq {text-align:right;}.small.svelte-hn7ohq {font-size:11px;color:#6e7681;}td.good.svelte-hn7ohq {color:#3fb950;}td.warn.svelte-hn7ohq {color:#d29922;}td.bad.svelte-hn7ohq {color:#f85149;}td.pos.svelte-hn7ohq {color:#3fb950;}.muted.svelte-hn7ohq {color:#6e7681;}.view-btn.svelte-hn7ohq {font-size:11px;background:#21262d;color:#58a6ff;border:1px solid #30363d;border-radius:4px;padding:1px 6px;cursor:pointer;}.view-btn.svelte-hn7ohq:hover {background:#30363d;}\`};function ps(e,t){fe(t,!1),ke(e,Ql);let r=()=>me(Br,"$recent",o),[o,i]=xe(),n=q();function a(_){return _>=500?"bad":_>=400?"warn":"good"}function l(_){if(!_)return"-";let u=_.split("/");return u[u.length-1]||_}z(()=>r(),()=>{C(n,r().data?.recent??[])}),He(),Te();var c=Jl(),f=$(m(c));Bt(f,7,()=>(s(n),g(()=>s(n).slice().reverse())),(_,u)=>_.ts+":"+u,(_,u,d)=>{var p=Xl(),b=m(p),y=m(b,!0);v(b);var x=$(b),O=m(x,!0);v(x);var B=$(x),P=m(B,!0);v(B);var X=$(B),N=m(X,!0);v(X);var E=$(X),w=m(E,!0);v(E);var D=$(E),G=m(D,!0);v(D);var W=$(D),K=m(W,!0);v(W);var ne=$(W),Z=m(ne,!0);v(ne);var _e=$(ne),Ve=m(_e);{var bt=ve=>{var Ue=Wl();dr("click",Ue,()=>Mn.set(s(u).img_id??null)),R(ve,Ue)},Ct=ve=>{var Ue=Kl();R(ve,Ue)};se(Ve,ve=>{s(u),g(()=>s(u).img_id!=null)?ve(bt):ve(Ct,-1)})}v(_e),v(p),H((ve,Ue,Qe,xt,at,et)=>{k(y,s(d)+1),Yt(x,1,\`num \${ve??""}\`,"svelte-hn7ohq"),k(O,(s(u),g(()=>s(u).status))),k(P,Ue),k(N,(s(u),g(()=>s(u).cc_added?"\\u2713":"-"))),k(w,Qe),k(G,xt),k(K,at),k(Z,et)},[()=>(s(u),g(()=>a(s(u).status))),()=>(s(u),g(()=>l(s(u).path))),()=>(s(u),V(A),g(()=>s(u).cache_read!=null?A(s(u).cache_read):"-")),()=>(s(u),V(A),g(()=>s(u).baseline_input!=null?A(s(u).baseline_input):"-")),()=>(s(u),V(A),g(()=>s(u).actual_input!=null?A(s(u).actual_input):"-")),()=>(s(u),V(A),g(()=>(s(u).session_saved_so_far_delta??0)>0?"+"+A(s(u).session_saved_so_far_delta??0):"-"))]),R(_,p)},_=>{var u=Zl();R(_,u)}),v(f),v(c),R(e,c),ue(),i()}var ec=I('
'),tc=I('
'),rc=I('
',1),nc=I('
latest rendered
'),oc=I('
(none yet)
'),sc=I('
',1),ic={hash:"svelte-3whs73",code:\`.wrap.svelte-3whs73 {margin-top:0;} /* Crop is done client-side via CSS (object-position + overflow:hidden). The legacy dashboard pulled a separately-cropped PNG which doubled image traffic. The full 1466\\xD71568 image lives on disk; we just show - the top-left corner at native res. */.preview-crop.svelte-3whs73 {width:100%;height:400px;overflow:hidden;background:#fff;border:1px solid #30363d;border-radius:4px;padding:4px;box-sizing:border-box;}.preview-crop.svelte-3whs73 img:where(.svelte-3whs73) {display:block;width:auto;height:auto;max-width:none;image-rendering:pixelated;}.sub.svelte-3whs73 {color:#6e7681;font-size:12px;}.small.svelte-3whs73 {font-size:11px;color:#6e7681;margin-top:8px;}.pin-bar.svelte-3whs73 {margin-bottom:8px;}.back-btn.svelte-3whs73 {font-size:11px;background:#21262d;color:#58a6ff;border:1px solid #30363d;border-radius:4px;padding:2px 8px;cursor:pointer;}.back-btn.svelte-3whs73:hover {background:#30363d;}.evicted.svelte-3whs73 {font-size:11px;color:#6e7681;padding:12px 0;}\`};function ds(e,t){pe(t,!1),qe(e,rc);let r=()=>Ee(Tr,"$recent",s),n=()=>Ee(yn,"$selectedImageId",s),[s,o]=Me(),a=q(),l=q(),c=q(),f=q(),_=q(),u=q(),d=q();Y(()=>r(),()=>{R(a,r().data?.has_preview===!0)}),Y(()=>r(),()=>{R(l,r().data?.preview_meta??"")}),Y(()=>r(),()=>{R(c,r().data?.image_ids??[])}),Y(()=>n(),()=>{R(f,n())}),Y(()=>(i(f),i(c)),()=>{R(_,i(f)!=null&&!i(c).includes(i(f)))}),Y(()=>(i(f),i(a),i(l)),()=>{R(u,i(f)!=null?\`/proxy-latest-png?id=\${i(f)}\`:i(a)?"/proxy-latest-png?t="+encodeURIComponent(i(l)):"")}),Y(()=>(i(f),i(l)),()=>{R(d,i(f)!=null?\`image #\${i(f)}\`:i(l)?i(l)+" - showing top-left at native resolution":"")}),We(),Fe();var p=tc(),g=Ne(p),y=h(g);{var x=S=>{var w=Jl(),M=Ne(w),te=h(M);m(M);var oe=$(M,2);{var Q=se=>{var X=Xl(),Re=h(X);m(X),G(()=>A(Re,\`(image #\${i(f)??""} no longer in buffer)\`)),O(se,X)},U=se=>{var X=Zl(),Re=h(X);m(X),G(()=>{Er(Re,"src",i(u)),Er(Re,"alt",\`image #\${i(f)??""}\`)}),O(se,X)};le(oe,se=>{i(_)?se(Q):se(U,-1)})}Zt("click",te,()=>yn.set(null)),O(S,w)},N=S=>{var w=Ql(),M=h(w);m(w),G(()=>Er(M,"src",i(u))),O(S,w)},B=S=>{var w=ec();O(S,w)};le(y,S=>{i(f)!=null?S(x):i(a)?S(N,1):S(B,-1)})}m(g);var F=$(g,2),K=h(F,!0);m(F),G(()=>A(K,i(d))),O(e,p),_e(),o()}var nc=L('
'),oc=L('
'),sc=L('
',1),ic=L('
no sessions yet
'),ac=L('
',1),lc={hash:"svelte-c2rstm",code:".status.svelte-c2rstm {margin-bottom:12px;color:#6e7681;font-size:12px;}.chart.svelte-c2rstm {display:flex;flex-direction:column;gap:8px;}.bar-row.svelte-c2rstm {display:flex;align-items:center;gap:10px;font-size:12px;}.label.svelte-c2rstm {width:132px;flex:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#c9d1d9;}.track.svelte-c2rstm {flex:1;min-width:0;height:14px;background:#21262d;border-radius:3px;overflow:hidden;}.fill.svelte-c2rstm {height:100%;background:#3fb950;border-radius:3px;}.value.svelte-c2rstm {width:72px;flex:none;text-align:right;font-variant-numeric:tabular-nums;color:#3fb950;}.value.neg.svelte-c2rstm {color:#f85149;}.axis.svelte-c2rstm {margin-top:12px;color:#6e7681;font-size:11px;}.empty.svelte-c2rstm {text-align:center;color:#6e7681;padding:24px;font-size:12px;}"};function ps(e,t){pe(t,!1),qe(e,lc);let r=()=>Ee(ea,"$sessions",n),[n,s]=Me(),o=q(),a=q(),l=q(),c=8;function f(S){let w=S.claudeCode?.projectPath||S.project;return w?ta(w):S.id.slice(0,8)}function _(S){return Math.round(S).toLocaleString("en-US")}function u(S){return i(l)<=0||S<=0?0:S/i(l)*100}Y(()=>r(),()=>{R(o,r().data?.sessions??[])}),Y(()=>i(o),()=>{R(a,[...i(o)].sort((S,w)=>(w.tokensSavedEst??0)-(S.tokensSavedEst??0)).slice(0,c))}),Y(()=>i(a),()=>{R(l,i(a).reduce((S,w)=>Math.max(S,w.tokensSavedEst??0),0))}),We(),Fe();var d=ac(),p=Ne(d),g=h(p);{var y=S=>{var w=Lt("loading\\u2026");O(S,w)},x=S=>{var w=Lt();G(()=>A(w,(r(),b(()=>r().error)))),O(S,w)},N=S=>{var w=Lt();G(()=>A(w,\`\${i(o),b(()=>i(o).length)??""} session\${i(o),b(()=>i(o).length===1?"":"s")??""}\`)),O(S,w)};le(g,S=>{r(),i(o),b(()=>r().loading&&i(o).length===0)?S(y):(r(),b(()=>r().error)?S(x,1):S(N,-1))})}m(p);var B=$(p,2);{var F=S=>{var w=sc(),M=Ne(w);yr(M,5,()=>i(a),Q=>Q.id,(Q,U)=>{var se=oc(),X=h(se),Re=h(X,!0);m(X);var Ke=$(X,2),zt=h(Ke);{var Bt=gt=>{var Qe=nc();G(kr=>fo(Qe,\`width:max(3px,\${kr??""}%)\`),[()=>(i(U),b(()=>u(i(U).tokensSavedEst??0)))]),O(gt,Qe)},Le=Bo(()=>(i(U),b(()=>u(i(U).tokensSavedEst??0)>0)));le(zt,gt=>{i(Le)&>(Bt)})}m(Ke);var Xe=$(Ke,2);let ut;var Nt=h(Xe,!0);m(Xe),m(se),G((gt,Qe)=>{Er(X,"title",(i(U),b(()=>i(U).claudeCode?.projectPath||i(U).project||i(U).id))),A(Re,gt),ut=At(Xe,1,"value svelte-c2rstm",null,ut,{neg:(i(U).tokensSavedEst??0)<0}),A(Nt,Qe)},[()=>(i(U),b(()=>f(i(U)))),()=>(i(U),b(()=>_(i(U).tokensSavedEst??0)))]),O(Q,se)}),m(M);var te=$(M,2),oe=h(te);m(te),G(()=>A(oe,\`input tokens saved (cache-aware) \\xB7 top \${i(a),b(()=>i(a).length)??""} of \${i(o),b(()=>i(o).length)??""}\`)),O(S,w)},K=S=>{var w=ic();O(S,w)};le(B,S=>{i(a),b(()=>i(a).length>0)?S(F):(r(),b(()=>!r().loading&&!r().error)&&S(K,1))})}O(e,d),_e(),s()}var cc=L('requests 2xx / 4xx / 5xx compressed passthrough input tokens cache create cache read cache hit (tok) cache hit (ev) orig chars image bytes bytes/char latency p50/p95 first-byte p50/p95 ',1),fc=L('
',1),uc={hash:"svelte-1bksro2",code:".status.svelte-1bksro2 {margin-bottom:12px;color:#6e7681;font-size:12px;}table.svelte-1bksro2 {width:100%;border-collapse:collapse;font-size:12px;}td.svelte-1bksro2 {padding:6px 8px;border-bottom:1px solid #21262d;vertical-align:top;font-variant-numeric:tabular-nums;}td.svelte-1bksro2:last-child {border-bottom:none;}.num.svelte-1bksro2 {text-align:right;}"};function _s(e,t){pe(t,!1),qe(e,uc);let r=()=>Ee(Gr,"$stats",n),[n,s]=Me(),o=q(),a=q(),l=q(),c=q(),f=q(),_=q();Y(()=>r(),()=>{R(o,r().data)}),Y(()=>i(o),()=>{R(a,i(o)?.error)}),Y(()=>i(o),()=>{R(l,i(o)?.summary)}),Y(()=>i(l),()=>{R(c,(()=>{if(!i(l))return"-";let w=(i(l).inputTokensTotal||0)+(i(l).cacheCreateTokensTotal||0)+(i(l).cacheReadTokensTotal||0);return w>0?(i(l).cacheReadTokensTotal/w*100).toFixed(1)+"%":"-"})())}),Y(()=>i(l),()=>{R(f,i(l)&&i(l).eventsWithBaseline>0?(i(l).cacheHitEvents/i(l).eventsWithBaseline*100).toFixed(1)+"%":"-")}),Y(()=>i(l),()=>{R(_,i(l)&&i(l).origCharsTotal>0?(i(l).imageBytesTotal/i(l).origCharsTotal*100).toFixed(3)+"x":"-")}),We(),Fe();var u=fc(),d=Ne(u),p=h(d);{var g=w=>{var M=Lt("loading\\u2026");O(w,M)},y=w=>{var M=Lt();G(()=>A(M,i(a))),O(w,M)},x=w=>{var M=Lt();G(te=>A(M,\`\${te??""} events parsed\`),[()=>(z(k),i(o),b(()=>k(i(o).parsed)))]),O(w,M)},N=w=>{var M=Lt("-");O(w,M)};le(p,w=>{r(),i(o),b(()=>r().loading&&!i(o))?w(g):i(a)?w(y,1):i(o)?w(x,2):w(N,-1)})}m(d);var B=$(d,2),F=h(B),K=h(F);{var S=w=>{var M=cc(),te=Ne(M),oe=$(h(te)),Q=h(oe,!0);m(oe),m(te);var U=$(te,2),se=$(h(U)),X=h(se);m(se),m(U);var Re=$(U,2),Ke=$(h(Re)),zt=h(Ke,!0);m(Ke),m(Re);var Bt=$(Re,2),Le=$(h(Bt)),Xe=h(Le,!0);m(Le),m(Bt);var ut=$(Bt,2),Nt=$(h(ut)),gt=h(Nt,!0);m(Nt),m(ut);var Qe=$(ut,2),kr=$(h(Qe)),Wr=h(kr,!0);m(kr),m(Qe);var Sr=$(Qe,2),En=$(h(Sr)),_o=h(En,!0);m(En),m(Sr);var Kr=$(Sr,2),Tn=$(h(Kr)),kn=h(Tn,!0);m(Tn),m(Kr);var lr=$(Kr,2),Sn=$(h(lr)),vo=h(Sn,!0);m(Sn),m(lr);var Xr=$(lr,2),An=$(h(Xr)),mo=h(An,!0);m(An),m(Xr);var H=$(Xr,2),V=$(h(H)),Z=h(V,!0);m(V),m(H);var Pe=$(H,2),et=$(h(Pe)),$t=h(et,!0);m(et),m(Pe);var Yt=$(Pe,2),Ht=$(h(Yt)),Zr=h(Ht);m(Ht),m(Yt);var cr=$(Yt,2),Ar=$(h(cr)),ho=h(Ar);m(Ar),m(cr),G((na,oa,sa,ia,aa,la,ca,fa,ua,da,pa,_a,va,ma,ha)=>{A(Q,na),A(X,\`\${oa??""} / \${sa??""} / \${ia??""}\`),A(zt,aa),A(Xe,la),A(gt,ca),A(Wr,fa),A(_o,ua),A(kn,i(c)),A(vo,i(f)),A(mo,da),A(Z,pa),A($t,i(_)),A(Zr,\`\${_a??""} / \${va??""} ms\`),A(ho,\`\${ma??""} / \${ha??""} ms\`)},[()=>(z(k),i(l),b(()=>k(i(l).total))),()=>(z(k),i(l),b(()=>k(i(l).ok2xx))),()=>(z(k),i(l),b(()=>k(i(l).err4xx))),()=>(z(k),i(l),b(()=>k(i(l).err5xx))),()=>(z(k),i(l),b(()=>k(i(l).compressed))),()=>(z(k),i(l),b(()=>k(i(l).passthrough))),()=>(z(k),i(l),b(()=>k(i(l).inputTokensTotal))),()=>(z(k),i(l),b(()=>k(i(l).cacheCreateTokensTotal))),()=>(z(k),i(l),b(()=>k(i(l).cacheReadTokensTotal))),()=>(z(k),i(l),b(()=>k(i(l).origCharsTotal))),()=>(z(k),i(l),b(()=>k(i(l).imageBytesTotal))),()=>(z(k),i(l),b(()=>k(i(l).durationP50))),()=>(z(k),i(l),b(()=>k(i(l).durationP95))),()=>(z(k),i(l),b(()=>k(i(l).firstBytemsP50))),()=>(z(k),i(l),b(()=>k(i(l).firstBytemsP95)))]),O(w,M)};le(K,w=>{i(l)&&w(S)})}m(F),m(B),O(e,u),_e(),s()}var dc=L(\`\`),hc=I('
runtime kill switch \\xB7 not persisted across restart
',1),gc={hash:"svelte-1mocmsr",code:".banner.svelte-1mocmsr {display:inline-block;margin:8px 0;padding:10px 14px;background:#21262d;border:1px solid #f85149;border-radius:6px;color:#f85149;font-size:12px;}.toggle-wrap.svelte-1mocmsr {margin-bottom:14px;display:flex;align-items:center;gap:10px;}.toggle.svelte-1mocmsr {background:#21262d;color:#c9d1d9;border:1px solid #30363d;padding:6px 12px;cursor:pointer;border-radius:6px;font:inherit;font-size:12px;}.toggle.svelte-1mocmsr:disabled {opacity:0.5;cursor:wait;}.hint.svelte-1mocmsr {color:#6e7681;font-size:11px;}"};function hs(e,t){fe(t,!1),ke(e,gc);let r=()=>me(Br,"$recent",o),[o,i]=xe(),n=q(),a=q(!1);async function l(){if(s(a))return;let b=!s(n);if(!(!b&&!window.confirm(\`Disable compression? -/v1/messages will forward unchanged to upstream. Use this when upstream is unhealthy or to A/B test the proxy. Restart resets to enabled.\`))){R(a,!0);try{await Qi(g),Tr.run()}catch(y){wn.push({level:"error",text:"failed to toggle: "+y.message})}finally{R(a,!1)}}}Y(()=>r(),()=>{R(o,r().data?.compression_enabled!==!1)}),We(),Fe();var c=pc(),f=Ne(c);{var _=g=>{var y=dc();O(g,y)};le(f,g=>{i(o)||g(_)})}var u=$(f,2),d=h(u),p=h(d,!0);m(d),nn(2),m(u),G(()=>{d.disabled=i(a),A(p,i(a)?"loading\\u2026":i(o)?"Disable compression":"Enable compression")}),Zt("click",d,l),O(e,c),_e(),s()}var vc=L('
'),mc=L('
'),hc={hash:"svelte-1c4to2y",code:".tray.svelte-1c4to2y {position:fixed;bottom:16px;right:16px;display:flex;flex-direction:column;gap:8px;z-index:1000;pointer-events:none;}.toast.svelte-1c4to2y {background:#21262d;color:#c9d1d9;border:1px solid #30363d;border-radius:6px;padding:10px 14px;font-size:12px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.4);display:flex;align-items:center;gap:12px;pointer-events:auto;max-width:360px;}.toast.error.svelte-1c4to2y {border-color:#f85149;color:#f85149;}.toast.warn.svelte-1c4to2y {border-color:#d29922;color:#d29922;}.toast.info.svelte-1c4to2y {border-color:#58a6ff;}button.svelte-1c4to2y {background:transparent;color:inherit;border:0;cursor:pointer;font-size:16px;line-height:1;padding:0;}"};function ms(e,t){pe(t,!1),qe(e,hc);let r=()=>Ee(wn,"$toasts",n),[n,s]=Me();Fe();var o=mc();yr(o,5,r,a=>a.id,(a,l)=>{var c=vc(),f=h(c),_=h(f,!0);m(f);var u=$(f,2);m(c),G(()=>{At(c,1,\`toast \${i(l),b(()=>i(l).level)??""}\`,"svelte-1c4to2y"),A(_,(i(l),b(()=>i(l).text)))}),Zt("click",u,()=>wn.dismiss(i(l).id)),O(a,c)}),m(o),O(e,o),_e(),s()}var gc=L('

pixelpipe

recent requests

latest rendered image

sessions (top savers)

stats (full history)

',1),$c={hash:"svelte-1bzzuab",code:\` +/v1/messages will forward unchanged to upstream. Use this when upstream is unhealthy or to A/B test the proxy. Restart resets to enabled.\`))){C(a,!0);try{await ra(b),Br.run()}catch(y){Dn.push({level:"error",text:"failed to toggle: "+y.message})}finally{C(a,!1)}}}z(()=>r(),()=>{C(n,r().data?.compression_enabled!==!1)}),He(),Te();var c=hc(),f=pe(c);{var _=b=>{var y=mc();R(b,y)};se(f,b=>{s(n)||b(_)})}var u=$(f,2),d=m(u),p=m(d,!0);v(d),mn(2),v(u),H(()=>{d.disabled=s(a),k(p,s(a)?"loading\\u2026":s(n)?"Disable compression":"Enable compression")}),dr("click",d,l),R(e,c),ue(),i()}var $c=I('
'),bc=I('
loading\\u2026
'),xc=I('

This session

',1),yc=I('
'),wc=I(' '),Ec=I('
'),kc=I('
  • '),Tc=I('
      '),Sc=I('
      '),Ac=I('

      This session

      Saved
      ',1),Rc=I('
      '),Nc={hash:"svelte-1pvo6o9",code:".session-summary.svelte-1pvo6o9 {margin-bottom:22px;}.header.svelte-1pvo6o9 {display:flex;justify-content:space-between;align-items:baseline;margin-bottom:12px;}h2.svelte-1pvo6o9 {margin:0;font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#8e7681;}.sub.svelte-1pvo6o9 {font-size:12px;color:#8e7681;}.headline.svelte-1pvo6o9 {margin-bottom:10px;}.big.svelte-1pvo6o9 {font-size:18px;font-weight:600;color:#c9d1d9;}.pct.svelte-1pvo6o9 {color:#3fb950;font-variant-numeric:tabular-nums;}.usd.svelte-1pvo6o9 {font-size:12px;color:#8e7681;margin-top:2px;font-variant-numeric:tabular-nums;}.bar.svelte-1pvo6o9 {margin-top:8px;height:6px;background:#21262d;border-radius:3px;overflow:hidden;}.bar-fill.svelte-1pvo6o9 {height:100%;background:#3fb950;transition:width 1s ease;}.section.svelte-1pvo6o9 {margin-top:16px;}.section-label.svelte-1pvo6o9 {font-size:11px;color:#8e7681;text-transform:uppercase;letter-spacing:0.08em;margin-bottom:6px;}.section-label-good.svelte-1pvo6o9 {color:#3fb950;text-transform:none;letter-spacing:0;font-size:12px;}.bucket-bar.svelte-1pvo6o9 {display:flex;height:8px;border-radius:4px;overflow:hidden;background:#21262d;}.bucket-seg.svelte-1pvo6o9 {height:100%;transition:width 1s ease;}.bucket-legend.svelte-1pvo6o9 {margin-top:6px;display:flex;flex-wrap:wrap;gap:12px;font-size:11px;color:#c9d1d9;}.legend-item.svelte-1pvo6o9 {display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;}.swatch.svelte-1pvo6o9 {display:inline-block;width:8px;height:8px;border-radius:2px;}.passthrough-list.svelte-1pvo6o9 {margin:0;padding:0;list-style:none;font-size:12px;color:#c9d1d9;}.passthrough-list.svelte-1pvo6o9 li:where(.svelte-1pvo6o9) {display:flex;justify-content:space-between;padding:2px 0;font-variant-numeric:tabular-nums;}.reason.svelte-1pvo6o9 {color:#8e7681;}.count.svelte-1pvo6o9 {color:#8e7681;}.loading.svelte-1pvo6o9, .empty.svelte-1pvo6o9, .error.svelte-1pvo6o9 {color:#8e7681;font-size:12px;}.error.svelte-1pvo6o9 {color:#f85149;}"};function gs(e,t){fe(t,!1),ke(e,Nc);let r=()=>me(oa,"$currentSession",o),[o,i]=xe(),n=q(),a=q(),l=q(),c=q(),f=q(),_=q();function u(w){return"$"+w.toFixed(2)}function d(w){return w.toFixed(1)+"%"}function p(w){if(w<60)return Math.round(w)+"s";let D=Math.floor(w/60);return D<60?D+"m":Math.floor(D/60)+"h "+D%60+"m"}function b(w){return w<1e3?String(w):w<1e6?(w/1e3).toFixed(1)+"k":(w/1e6).toFixed(1)+"M"}let y={static_slab:"slab",reminder:"reminder",tool_result:"tool_result",history:"history",billing:"billing",dynamic:"dynamic"},x={static_slab:"#b9be0",reminder:"#85c5f6",tool_result:"#10b981",history:"#f59e0b",billing:"#8e7681",dynamic:"#ef4444"};z(()=>r(),()=>{C(n,r().data)}),z(()=>r(),()=>{C(a,r().error)}),z(()=>s(n),()=>{C(l,s(n)&&s(n).sessionId!=null)}),z(()=>s(n),()=>{C(c,s(n)?.bucketChars?Object.values(s(n).bucketChars).reduce((w,D)=>w+D,0):0)}),z(()=>s(n),()=>{C(f,s(n)?.bucketChars?Object.entries(s(n).bucketChars).filter(([,w])=>w>0).sort((w,D)=>D[1]-w[1]):[])}),z(()=>s(n),()=>{C(_,s(n)?.passthroughReasons?Object.entries(s(n).passthroughReasons).sort((w,D)=>D[1]-w[1]):[])}),He(),Te();var O=Rc(),B=m(O);{var P=w=>{var D=$c(),G=m(D);v(D),H(()=>k(G,\`error: \${s(a)??""}\`)),R(w,D)},X=w=>{var D=bc();R(w,D)},N=w=>{var D=xc(),G=$(pe(D),2),W=m(G,!0);v(G),H(()=>k(W,(s(n),g(()=>s(n).message??"no active session yet")))),R(w,D)},E=w=>{var D=Ac(),G=pe(D),W=$(m(G),2),K=m(W);v(W),v(G);var ne=$(G,2),Z=m(ne),_e=$(m(Z)),Ve=m(_e,!0);v(_e),v(Z);var bt=$(Z,2),Ct=m(bt);v(bt),v(ne);var ve=$(ne,2),Ue=m(ve);v(ve);var Qe=$(ve,2);{var xt=Se=>{var Ae=Ec(),nt=$(m(Ae),2);Bt(nt,5,()=>s(f),In,(ot,Vt)=>{var yt=Dr(()=>fn(s(Vt),2));let ae=()=>s(yt)[0],wt=()=>s(yt)[1],Et=ur(()=>s(c)>0?wt()/s(c)*100:0);var Le=yc();H((lt,tr)=>{kr(Le,\`width: \${s(Et)??""}%; background: \${ae(),g(()=>x[ae()]??"#8e7681")??""}\`),_r(Le,"title",\`\${ae(),g(()=>y[ae()]??ae())??""}: \${lt??""} chars (\${tr??""}%)\`)},[()=>(wt(),g(()=>b(wt()))),()=>(V(s(Et)),g(()=>s(Et).toFixed(1)))]),R(ot,Le)}),v(nt);var Ht=$(nt,2);Bt(Ht,5,()=>s(f),In,(ot,Vt)=>{var yt=Dr(()=>fn(s(Vt),2));let ae=()=>s(yt)[0],wt=()=>s(yt)[1],Et=ur(()=>s(c)>0?wt()/s(c)*100:0);var Le=wc(),lt=m(Le),tr=$(lt);v(Le),H(Y=>{kr(lt,\`background: \${ae(),g(()=>x[ae()]??"#8e7681")??""}\`),k(tr,\` \${ae(),g(()=>y[ae()]??ae())??""} \${Y??""}%\`)},[()=>(V(s(Et)),g(()=>s(Et).toFixed(0)))]),R(ot,Le)}),v(Ht),v(Ae),R(Se,Ae)};se(Qe,Se=>{s(f),g(()=>s(f).length>0)&&Se(xt)})}var at=$(Qe,2);{var et=Se=>{var Ae=Tc(),nt=m(Ae),Ht=m(nt);v(nt);var ot=$(nt,2);Bt(ot,5,()=>s(_),In,(Vt,yt)=>{var ae=Dr(()=>fn(s(yt),2));let wt=()=>s(ae)[0],Et=()=>s(ae)[1];var Le=kc(),lt=m(Le),tr=m(lt,!0);v(lt);var Y=$(lt,2),U=m(Y,!0);v(Y),v(Le),H(()=>{k(tr,wt()),k(U,Et())}),R(Vt,Le)}),v(ot),v(Ae),H(()=>k(Ht,\`Where it didn't \\xB7 \${s(n),g(()=>s(n).passthroughRequests??0)??""} of \${s(n),g(()=>s(n).requests)??""} requests passed through\`)),R(Se,Ae)},mr=Se=>{var Ae=Sc();R(Se,Ae)};se(at,Se=>{s(_),g(()=>s(_).length>0)?Se(et):(s(n),g(()=>(s(n).passthroughRequests??0)===0)&&Se(mr,1))})}H((Se,Ae,nt,Ht,ot)=>{k(K,\`started \${Se??""} ago \\xB7 \${s(n),g(()=>s(n).requests)??""} requests\`),k(Ve,Ae),k(Ct,\`\${nt??""} of \${Ht??""} baseline\`),kr(Ue,\`width: \${ot??""}%\`)},[()=>(s(n),g(()=>p(s(n).uptimeSec??0))),()=>(s(n),g(()=>d(s(n).savedPct??0))),()=>(s(n),g(()=>u(s(n).savedUsd??0))),()=>(s(n),g(()=>u(s(n).baselineUsd??0))),()=>(s(n),g(()=>Math.max(0,Math.min(100,s(n).savedPct??0))))]),R(w,D)};se(B,w=>{s(a)?w(P):s(n)?s(l)?w(E,-1):w(N,2):w(X,1)})}v(O),R(e,O),ue(),i()}var Cc=I('
      '),Oc=I('
      '),Ic={hash:"svelte-1c4to2y",code:".tray.svelte-1c4to2y {position:fixed;bottom:16px;right:16px;display:flex;flex-direction:column;gap:8px;z-index:1000;pointer-events:none;}.toast.svelte-1c4to2y {background:#21262d;color:#c9d1d9;border:1px solid #30363d;border-radius:6px;padding:10px 14px;font-size:12px;box-shadow:0 4px 12px rgba(0, 0, 0, 0.4);display:flex;align-items:center;gap:12px;pointer-events:auto;max-width:360px;}.toast.error.svelte-1c4to2y {border-color:#f85149;color:#f85149;}.toast.warn.svelte-1c4to2y {border-color:#d29922;color:#d29922;}.toast.info.svelte-1c4to2y {border-color:#58a6ff;}button.svelte-1c4to2y {background:transparent;color:inherit;border:0;cursor:pointer;font-size:16px;line-height:1;padding:0;}"};function $s(e,t){fe(t,!1),ke(e,Ic);let r=()=>me(Dn,"$toasts",o),[o,i]=xe();Te();var n=Oc();Bt(n,5,r,a=>a.id,(a,l)=>{var c=Cc(),f=m(c),_=m(f,!0);v(f);var u=$(f,2);v(c),H(()=>{Yt(c,1,\`toast \${s(l),g(()=>s(l).level)??""}\`,"svelte-1c4to2y"),k(_,(s(l),g(()=>s(l).text)))}),dr("click",u,()=>Dn.dismiss(s(l).id)),R(a,c)}),v(n),R(e,n),ue(),i()}var Mc=I('

      pixelpipe

      recent requests

      latest rendered image

      sessions (top savers)

      stats (full history)

      ',1),Dc={hash:"svelte-1bzzuab",code:\` /* Match the legacy dashboard 1:1 \\u2014 same fonts, colors, spacing. The page looks identical pre/post rewrite to keep visual regression cheap. */body {margin:0;padding:24px;background:#0d1117;color:#c9d1d9;font:14px/1.45 -apple-system, BlinkMacSystemFont, @@ -87,5 +87,5 @@ https://svelte.dev/e/state_proxy_unmount\`,Ct,Ot):console.warn("https://svelte.d 50% { opacity: 0.4; } - }\`};function hs(e,t){pe(t,!1),qe(e,$c);let r=()=>Ee(Gr,"$stats",n),[n,s]=Me(),o=q();function a(w){w=Math.floor(w);let M=Math.floor(w/3600),te=Math.floor(w%3600/60),oe=w%60;return(M?M+"h ":"")+(te||M?te+"m ":"")+oe+"s"}Y(()=>r(),()=>{R(o,r().data?\`port \${location.port||"80"} \\xB7 uptime \${a(r().data.uptime_sec)} \\xB7 live\`:r().error?"proxy unreachable":"connecting...")}),We(),Fe();var l=gc(),c=$(Ne(l),2),f=h(c,!0);m(c);var _=$(c,2);vs(_,{});var u=$(_,2);fs(u,{});var d=$(u,2),p=h(d),g=$(h(p),2);us(g,{}),m(p);var y=$(p,2),x=$(h(y),2);ds(x,{}),m(y),m(d);var N=$(d,2),B=$(h(N),2);ps(B,{}),m(N);var F=$(N,2),K=$(h(F),2);_s(K,{}),m(F);var S=$(F,2);ms(S,{}),G(()=>A(f,i(o))),O(e,l),_e(),s()}var ra=document.getElementById("app");ra?jr(hs,{target:ra}):document.body.textContent="pixelpipe dashboard: mount target #app missing";})(); + }\`};function bs(e,t){fe(t,!1),ke(e,Dc);let r=()=>me(ln,"$stats",o),[o,i]=xe(),n=q();function a(w){w=Math.floor(w);let D=Math.floor(w/3600),G=Math.floor(w%3600/60),W=w%60;return(D?D+"h ":"")+(G||D?G+"m ":"")+W+"s"}z(()=>r(),()=>{C(n,r().data?\`port \${location.port||"80"} \\xB7 uptime \${a(r().data.uptime_sec)} \\xB7 live\`:r().error?"proxy unreachable":"connecting...")}),He(),Te();var l=Mc(),c=$(pe(l),2),f=m(c,!0);v(c);var _=$(c,2);hs(_,{});var u=$(_,2);gs(u,{});var d=$(u,2);ds(d,{});var p=$(d,2),b=m(p),y=$(m(b),2);ps(y,{}),v(b);var x=$(b,2),O=$(m(x),2);_s(O,{}),v(x),v(p);var B=$(p,2),P=$(m(B),2);vs(P,{}),v(B);var X=$(B,2),N=$(m(X),2);ms(N,{}),v(X);var E=$(X,2);$s(E,{}),H(()=>k(f,s(n))),R(e,l),ue(),i()}var ia=document.getElementById("app");ia?sn(bs,{target:ia}):document.body.textContent="pixelpipe dashboard: mount target #app missing";})(); `; diff --git a/src/dashboard.ts b/src/dashboard.ts index dcad96b..a412298 100644 --- a/src/dashboard.ts +++ b/src/dashboard.ts @@ -142,6 +142,31 @@ export interface RecentRow { * output×5 in input-token-equivalents. The dashboard headline matches it * so a "20% saved" number means weekly-limit consumption dropped by 20%, * not "20% off the slice we touched while the other half stayed full." */ +/** + * Per-session aggregate. Same dollar-weighted savings math as the global + * `Totals` block, but partitioned by `info.firstUserSha8` so the dashboard + * can show "what's happening RIGHT NOW" instead of stale lifetime numbers. + * Field names mirror the JSON wire shape served by `serveCurrentSessionJson`. + */ +interface SessionTotals { + sessionId: string; + firstSeen: number; // unix seconds + lastSeen: number; // unix seconds + requests: number; + // Dollar-weighted accumulators. baseline/actual are the SAME math as the + // global `Totals.allBaselineEquivalentWeighted` / `allActualInputWeighted` + // + `allOutputWeighted`, but scoped to a single session. + baselineInputWeighted: number; + actualInputWeighted: number; + outputWeighted: number; + // Per-bucket char attribution from ev.info.bucketChars. + bucketChars: { [bucket: string]: number }; + // Passthrough reason histogram from ev.info.passthroughReasons. + passthroughReasons: Record; + passthroughRequests: number; // count of requests where !ev.info.compressed + compressedRequests: number; +} + interface Totals { requests: number; compressedRequests: number; @@ -258,10 +283,24 @@ const OUTPUT_TOKEN_RATE = 5.0; * actual target model; do not trust hardcoded chars-per-token or * tokens-per-image constants on 4.7 without verifying against the * upstream probe. */ -const ASSUMED_INPUT_USD_PER_MTOK = 5.0; +export const ASSUMED_INPUT_USD_PER_MTOK = 5.0; export class DashboardState { private recent: RecentRow[] = []; + /** Per-session dollar-weighted totals, keyed by `info.firstUserSha8`. The + * dashboard surfaces ONLY the most-recently-active session via the + * `serveCurrentSessionJson` endpoint — older sessions linger in the Map + * so a tab refresh during a brief lull still finds the previous session, + * but get evicted at `SESSION_CAP` to bound memory in long-running hosts. */ + private sessions: Map = new Map(); + /** sha8 of the most-recently-active session id. null when no events have + * ever carried a `firstUserSha8` (e.g. a cold start with only passthrough + * hits that the upstream probe never tagged). */ + private currentSessionId: string | null = null; + /** Hard cap on `sessions` Map entries. Keeps memory bounded in + * long-running deployments. 50 sessions × ~13 numeric fields each is + * comfortably under a MB even with fat bucket/passthrough histograms. */ + private static readonly SESSION_CAP = 50; private totals: Totals = { requests: 0, compressedRequests: 0, @@ -460,6 +499,75 @@ export class DashboardState { } } + // Per-session aggregation. Uses the SAME baseline/actual/output math as + // the global accumulators above, partitioned by `info.firstUserSha8` + // so the dashboard's "current session" panel can show what's happening + // RIGHT NOW instead of stale lifetime numbers. Untagged events (no + // firstUserSha8 — cold start, passthrough probe failures) are skipped + // rather than bucketed into a synthetic "unknown" session. + const sid = info?.firstUserSha8; + if (typeof sid === 'string' && sid.length > 0) { + this.currentSessionId = sid; + let s = this.sessions.get(sid); + if (!s) { + s = { + sessionId: sid, + firstSeen: Date.now() / 1000, + lastSeen: Date.now() / 1000, + requests: 0, + baselineInputWeighted: 0, + actualInputWeighted: 0, + outputWeighted: 0, + bucketChars: {}, + passthroughReasons: {}, + passthroughRequests: 0, + compressedRequests: 0, + }; + this.sessions.set(sid, s); + // Cap memory — drop the oldest session by lastSeen when over budget. + if (this.sessions.size > DashboardState.SESSION_CAP) { + const oldest = [...this.sessions.values()].sort( + (a, b) => a.lastSeen - b.lastSeen, + )[0]; + if (oldest) this.sessions.delete(oldest.sessionId); + } + } + s.lastSeen = Date.now() / 1000; + s.requests += 1; + // Reuse the same haveUsage / haveBaseline guards + the + // baselineInputEff / actualInputEff / outputEquiv locals computed + // earlier in update() so the lifetime totals block (above) and the + // per-session block (here) read the same values. Re-deriving them + // here would duplicate the cache-aware-baseline math and invite drift. + if (haveBaseline && haveUsage) { + s.baselineInputWeighted += baselineInputEff; + s.actualInputWeighted += actualInputEff; + s.outputWeighted += outputEquiv; + } + if (compressed) s.compressedRequests += 1; + else s.passthroughRequests += 1; + // Per-bucket char attribution from `info.bucketChars` (flat + // `Partial>` — see src/core/tracker.ts). + // Matches the shape the Svelte panel iterates over. + const bc = info?.bucketChars; + if (bc && typeof bc === 'object') { + for (const [key, val] of Object.entries(bc) as [string, unknown][]) { + if (typeof val === 'number' && Number.isFinite(val)) { + s.bucketChars[key] = (s.bucketChars[key] ?? 0) + val; + } + } + } + // Passthrough reason histogram from `info.passthroughReasons`. + const pr = info?.passthroughReasons; + if (pr && typeof pr === 'object') { + for (const [reason, count] of Object.entries(pr as Record)) { + if (typeof count === 'number' && Number.isFinite(count) && count > 0) { + s.passthroughReasons[reason] = (s.passthroughReasons[reason] ?? 0) + count; + } + } + } + } + // Measurement totals are independent of usage/baseline gating — they // accumulate whenever the scanner produced numbers. The scanner sets // measurement to undefined on 5xx (no body to scan) and on unknown @@ -561,6 +669,57 @@ export class DashboardState { // ---- HTTP handlers ------------------------------------------------------ + /** + * Per-session "what's happening right now" payload backing the + * `SessionSummary` panel. Scopes the dollar-weighted savings ratio + the + * per-bucket char attribution + the passthrough-reason histogram to the + * most-recently-active session (tracked via `info.firstUserSha8`) so the + * top-of-dashboard headline reflects the live session rather than stale + * lifetime aggregates from a previous run. + * + * Returns `{ sessionId: null, message: 'no active session yet' }` when no + * events have been received yet (or the first events were all untagged — + * cold start, probe failures) — `update()` only sets `currentSessionId` + * when a `firstUserSha8`-tagged event lands. The client renders a stale + * panel rather than zeroes when a session goes idle (NO `lastSeen > + * threshold` check here; see comment in `update()` for the rationale). + */ + serveCurrentSessionJson(): Response { + if (!this.currentSessionId) { + return jsonResponse({ + sessionId: null, + message: 'no active session yet', + }); + } + const s = this.sessions.get(this.currentSessionId); + if (!s) { + return jsonResponse({ sessionId: null, message: 'no active session yet' }); + } + // Dollar-weighted savings ratio. Same math as the global `saved_pct` + // (compressed AND passthrough requests — passthrough has baseline=actual, + // so it correctly drags the ratio down when we leak). Honest denominator: + // includes both compressed and uncompressed flows that the proxy saw. + const baselineUsd = (s.baselineInputWeighted * ASSUMED_INPUT_USD_PER_MTOK) / 1e6; + const actualUsd = (s.actualInputWeighted * ASSUMED_INPUT_USD_PER_MTOK) / 1e6; + const savedUsd = baselineUsd - actualUsd; + const savedPct = baselineUsd > 0 ? (savedUsd / baselineUsd) * 100 : 0; + return jsonResponse({ + sessionId: s.sessionId, + firstSeen: s.firstSeen, + lastSeen: s.lastSeen, + uptimeSec: Math.max(0, s.lastSeen - s.firstSeen), + requests: s.requests, + compressedRequests: s.compressedRequests, + passthroughRequests: s.passthroughRequests, + baselineUsd: round4(baselineUsd), + actualUsd: round4(actualUsd), + savedUsd: round4(savedUsd), + savedPct: round1(savedPct), + bucketChars: s.bucketChars, + passthroughReasons: s.passthroughReasons, + }); + } + serveStats(): Response { // Two headline numbers, derived from the same per-event accumulators: // @@ -836,6 +995,7 @@ export type DashboardRoute = | { kind: 'png' } // /proxy-latest-png | { kind: 'api-sessions' } // /api/sessions.json | { kind: 'api-stats' } // /api/stats.json + | { kind: 'current-session' } // /api/current-session.json | { kind: 'api-compression' }; // /api/compression (POST {enabled}) — runtime kill switch /** Match dashboard paths (handle query strings on /proxy-latest-png). */ @@ -846,6 +1006,7 @@ export function dashboardPath(pathname: string): DashboardRoute | null { if (pathname === '/proxy-latest-png') return { kind: 'png' }; if (pathname === '/api/sessions.json') return { kind: 'api-sessions' }; if (pathname === '/api/stats.json') return { kind: 'api-stats' }; + if (pathname === '/api/current-session.json') return { kind: 'current-session' }; if (pathname === '/api/compression') return { kind: 'api-compression' }; return null; } diff --git a/src/dashboard/App.svelte b/src/dashboard/App.svelte index 9369885..ba67f50 100644 --- a/src/dashboard/App.svelte +++ b/src/dashboard/App.svelte @@ -10,6 +10,7 @@ import Sessions from './components/Sessions.svelte'; import StatsTable from './components/StatsTable.svelte'; import CompressionToggle from './components/CompressionToggle.svelte'; + import SessionSummary from './components/SessionSummary.svelte'; import ToastTray from './components/ToastTray.svelte'; import { stats } from './stores/index.js'; @@ -34,6 +35,8 @@ + +
      diff --git a/src/dashboard/components/SessionSummary.svelte b/src/dashboard/components/SessionSummary.svelte new file mode 100644 index 0000000..25713c0 --- /dev/null +++ b/src/dashboard/components/SessionSummary.svelte @@ -0,0 +1,263 @@ + + +
      + {#if err} +
      error: {err}
      + {:else if !data} +
      loading…
      + {:else if !hasSession} +

      This session

      +
      {data.message ?? 'no active session yet'}
      + {:else} +
      +

      This session

      +
      + started {fmtDuration(data.uptimeSec ?? 0)} ago · {data.requests} requests +
      +
      + +
      +
      + Saved {fmtPct(data.savedPct ?? 0)} +
      +
      + {fmtUsd(data.savedUsd ?? 0)} of {fmtUsd(data.baselineUsd ?? 0)} baseline +
      +
      + +
      +
      +
      + + {#if bucketEntries.length > 0} +
      + +
      + {#each bucketEntries as [key, val]} + {@const w = bucketTotal > 0 ? (val / bucketTotal) * 100 : 0} +
      + {/each} +
      +
      + {#each bucketEntries as [key, val]} + {@const w = bucketTotal > 0 ? (val / bucketTotal) * 100 : 0} + + + {BUCKET_LABELS[key] ?? key} {w.toFixed(0)}% + + {/each} +
      +
      + {/if} + + {#if passthroughEntries.length > 0} +
      + +
        + {#each passthroughEntries as [reason, count]} +
      • {reason} {count}
      • + {/each} +
      +
      + {:else if (data.passthroughRequests ?? 0) === 0} +
      + +
      + {/if} + {/if} +
      + + diff --git a/src/dashboard/lib/api.ts b/src/dashboard/lib/api.ts index b2c5eca..43d3101 100644 --- a/src/dashboard/lib/api.ts +++ b/src/dashboard/lib/api.ts @@ -14,6 +14,7 @@ export const API = { latestPng: '/proxy-latest-png', sessions: '/api/sessions.json', fullStats: '/api/stats.json', + currentSession: '/api/current-session.json', compressionToggle: '/api/compression', } as const; diff --git a/src/dashboard/stores/index.ts b/src/dashboard/stores/index.ts index b827cfe..de44ad2 100644 --- a/src/dashboard/stores/index.ts +++ b/src/dashboard/stores/index.ts @@ -11,6 +11,7 @@ import type { RecentPayload, SessionsPayload, FullStatsPayload, + CurrentSessionPayload, } from '../types.js'; // Live counters + recent table (legacy poll cadence: 2s). @@ -20,6 +21,7 @@ export const recent = pollJson('/proxy-recent', 2000); // Slower endpoints (legacy: 5s). export const sessions = pollJson('/api/sessions.json', 5000); export const fullStats = pollJson('/api/stats.json', 5000); +export const currentSession = pollJson('/api/current-session.json', 2000); // when null the image viewer follows the latest render; when set it pins that image id. ui-only state. export const selectedImageId = writable(null); diff --git a/src/dashboard/types.ts b/src/dashboard/types.ts index ca5ec46..b520b1a 100644 --- a/src/dashboard/types.ts +++ b/src/dashboard/types.ts @@ -152,3 +152,28 @@ export interface FullStatsSummary { export interface CompressionToggleResponse { compression_enabled: boolean; } + +/** /api/current-session.json payload — per-session aggregates for the most-recently-active Claude Code session. */ +export interface CurrentSessionPayload { + sessionId: string | null; + message?: string; + firstSeen?: number; + lastSeen?: number; + uptimeSec?: number; + requests?: number; + compressedRequests?: number; + passthroughRequests?: number; + baselineUsd?: number; + actualUsd?: number; + savedUsd?: number; + savedPct?: number; + bucketChars?: { + static_slab: number; + reminder: number; + tool_result: number; + history: number; + billing: number; + dynamic: number; + }; + passthroughReasons?: Record; +} diff --git a/src/node.ts b/src/node.ts index 06062d1..019bff2 100644 --- a/src/node.ts +++ b/src/node.ts @@ -202,6 +202,9 @@ async function dispatchDashboard( case 'api-stats': if (method !== 'GET') return undefined; return dashboard.serveApiStats(); + case 'current-session': + if (method !== 'GET') return undefined; + return dashboard.serveCurrentSessionJson(); case 'api-compression': { if (method !== 'POST') { return new Response(