@huynle/hub 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +193 -0
- package/README.md +32 -1
- package/package.json +1 -1
- package/packages/claude-code/package.json +1 -1
- package/packages/cli/dist/hub-cli.js +116 -53
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/artifact-jobs-mcp.ts +10 -9
- package/packages/cli/src/artifacts-mcp.ts +8 -7
- package/packages/cli/src/mcp.ts +4 -3
- package/packages/cli/src/profiles-mcp.ts +3 -3
- package/packages/cli/src/team-intake-mcp.ts +8 -7
- package/packages/cli/src/teams-mcp.ts +2 -1
- package/packages/cli/src/tool-args.ts +6 -0
- package/packages/cli/src/watchlist.ts +5 -4
- package/packages/codex/package.json +1 -1
- package/packages/node/package.json +1 -1
- package/packages/preset/package.json +1 -1
- package/packages/protocol/package.json +1 -1
- package/packages/protocol/src/concierge.ts +4 -1
- package/packages/protocol/src/embedded-media.ts +59 -0
- package/packages/protocol/src/index.ts +92 -7
- package/packages/protocol/src/voice-recording.ts +107 -0
- package/packages/protocol/src/wire.ts +1 -0
- package/packages/runtime-openshell/package.json +1 -1
- package/packages/runtime-sdk/package.json +1 -1
- package/packages/sdk/package.json +1 -1
- package/packages/sdk/src/client.ts +3 -1
- package/packages/spoke-sdk/package.json +1 -1
- package/packages/spoke-sdk/src/connection.ts +13 -1
- package/src/central/agent/acting-routes.ts +3 -2
- package/src/central/agent/acting.ts +67 -12
- package/src/central/agent/delivery.ts +12 -3
- package/src/central/agent/escalation.ts +30 -9
- package/src/central/agent/launch-spec.ts +38 -19
- package/src/central/agent/routes.ts +14 -1
- package/src/central/artifacts/blob-store.ts +6 -1
- package/src/central/artifacts/blob-support.ts +3 -1
- package/src/central/concierge/board-render.ts +34 -11
- package/src/central/concierge/context.ts +3 -1
- package/src/central/concierge/index.ts +1 -1
- package/src/central/concierge/notifier.ts +2 -1
- package/src/central/concierge/prompt.ts +7 -4
- package/src/central/config.ts +4 -0
- package/src/central/csp.ts +55 -0
- package/src/central/http.ts +134 -29
- package/src/central/profiles/content.ts +16 -0
- package/src/central/recording/clock.ts +76 -0
- package/src/central/recording/concierge-taps.ts +104 -0
- package/src/central/recording/export.ts +215 -0
- package/src/central/recording/index.ts +658 -0
- package/src/central/recording/ingest.ts +209 -0
- package/src/central/recording/retention.ts +71 -0
- package/src/central/recording/routes.ts +281 -0
- package/src/central/recording/schema.ts +232 -0
- package/src/central/recording/settings.ts +35 -0
- package/src/central/recording/store.ts +316 -0
- package/src/central/recording/taps.ts +105 -0
- package/src/central/recording/zip.ts +138 -0
- package/src/central/registry.ts +91 -6
- package/src/central/revert-windows.ts +66 -0
- package/src/central/spoke-ws.ts +8 -3
- package/src/central/teams/staffing.ts +2 -2
- package/src/index.ts +26 -14
- package/src/spoke/deliver.ts +6 -0
- package/src/spoke/fork-revert.ts +94 -9
- package/src/spoke/hub-tool.ts +2 -2
- package/src/spoke/locations.ts +80 -0
- package/src/spoke/profile-apply.ts +24 -14
- package/src/spoke/session-context.ts +96 -6
- package/src/spoke/spoke.ts +119 -36
- package/src/spoke/timeline.ts +30 -3
- package/src/spoke/tracker.ts +23 -2
- package/src/status.ts +33 -6
- package/web/dist/assets/{ArtifactPage-mNzjlP_U.js → ArtifactPage-CSotAWob.js} +1 -1
- package/web/dist/assets/{ArtifactPane-CPQcuX7c.js → ArtifactPane-DPHjiWce.js} +1 -1
- package/web/dist/assets/{ArtifactWorkbench-NoFC5Sb2.js → ArtifactWorkbench-CkmWnP6L.js} +1 -1
- package/web/dist/assets/{Library-LXHsP5Fw.js → Library-DTLEyekn.js} +2 -2
- package/web/dist/assets/ProfilesDestination-GriuOpiZ.js +1 -0
- package/web/dist/assets/{TeamsPage-DBrO5hoL.js → TeamsPage-C-5lYeeM.js} +1 -1
- package/web/dist/assets/Watchtower-DOlPsiIy.js +2 -0
- package/web/dist/assets/index-6mdQ7eUY.js +34 -0
- package/web/dist/assets/index-C5OmwA1y.css +1 -0
- package/web/dist/assets/{live-BDq0AABg.js → live-CDWcyavI.js} +1 -1
- package/web/dist/assets/{pane-layout-DWXfDU-1.js → pane-layout-Csk-vPNe.js} +1 -1
- package/web/dist/assets/{renderer2d-DAr4IHM8.js → renderer2d-CNFdTDTr.js} +1 -1
- package/web/dist/assets/{renderer3d-DWZj595u.js → renderer3d-C45jPvYX.js} +4 -56
- package/web/dist/assets/renderer3d-Co5yCKMg.css +1 -0
- package/web/dist/assets/{safe-area-JUb6OeI3.js → safe-area-sA9a8vYJ.js} +1 -1
- package/web/dist/assets/{silero-worker-C8-8vLVS.js → silero-worker-DhlIHyD_.js} +1 -1
- package/web/dist/assets/{source-CDU04kYw.js → source-BFLJQ43_.js} +1 -1
- package/web/dist/assets/{ui-Dh1-78Cl.js → ui-Qo2Pd9-O.js} +1 -1
- package/web/dist/index.html +5 -16
- package/web/dist/theme-boot.js +12 -0
- package/web/dist/assets/ProfilesDestination-DhVVcAep.js +0 -1
- package/web/dist/assets/Watchtower-DxaJYQp_.js +0 -2
- package/web/dist/assets/index-BabrNDB3.css +0 -1
- package/web/dist/assets/index-lIOfSYck.js +0 -34
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.graph-info-msg{text-align:center;color:#e6e6fa;opacity:.7;width:100%;font-family:sans-serif;font-size:22px;position:absolute;top:50%}.scene-container .clickable{cursor:pointer}.scene-container .grabbable{cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.scene-container .grabbable:active{cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}.scene-nav-info{text-align:center;color:#708090;opacity:.7;pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;font-family:sans-serif;font-size:10px;position:absolute;bottom:5px}.scene-container canvas:focus{outline:none}.float-tooltip-kap{color:#eee;pointer-events:none;background:#0009;border-radius:3px;width:max-content;max-width:max(50%,150px);padding:3px 5px;font:12px sans-serif;position:absolute}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e}from"./live-
|
|
1
|
+
import{E as e}from"./live-CDWcyavI.js";var t=`watchtower.layout`,n=1e3,r=[`--accent`,`--blue`,`--violet`,`--orange`,`--ok`,`--warn`];function i(e,t=0){let n=110+26*Math.sqrt(Math.max(1,e))+7*Math.sqrt(Math.max(0,t)),r=Math.PI*(3-Math.sqrt(5));return Array.from({length:e},(t,i)=>{let a=e===1?0:1-i/(e-1)*2,o=Math.sqrt(1-a*a),s=i*r;return[l(Math.cos(s)*o*n),l(a*n*.55),l(Math.sin(s)*o*n)]})}function a(t){let n=new Set(t.nodes.map(e=>e.id)),a=i(t.groups.length,t.groups.reduce((e,t)=>e+t.sections.reduce((e,t)=>e+t.members.length,0),0));return t.groups.map((t,i)=>{let o=[];n.has(t.id)&&o.push(t.id);for(let e of t.sections)e.id!==void 0&&n.has(e.id)&&o.push(e.id),o.push(...e.members);let s=t.machine===void 0?r[i%r.length]:e[t.machine%e.length];return{id:t.id,label:t.label,color:s,center:a[i],members:o}})}function o(e){let t=new Map;for(let n of e.links)n.kind!==`structure`&&n.kind!==`policy`&&(t.set(n.source,(t.get(n.source)??0)+n.count),t.set(n.target,(t.get(n.target)??0)+n.count));return t}function s(e,t){let n=new Set,r=new Set(e.groups.map(e=>e.id));for(let t of e.nodes)(t.kind===`hub`||t.kind===`user`||t.kind===`app`||t.kind===`role`||r.has(t.id)||t.match)&&n.add(t.id);let i=o(e),a=e.nodes.filter(e=>!n.has(e.id)&&e.kind!==`role`);a.sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||(e.id<t.id?-1:+(e.id>t.id)));for(let e of a.slice(0,Math.max(0,t.max)))n.add(e.id);for(let e of t.extra??[])n.add(e);return n}var c=e=>e.kind===`role`&&e.vacant?`${e.label} · vacant`:e.label,l=e=>Math.round(e*10)/10,u=e=>typeof e==`number`&&Number.isFinite(e);function d(e){let t=new Map;if(!e)return t;let n;try{n=JSON.parse(e)}catch{return t}if(typeof n!=`object`||!n||Array.isArray(n))return t;let{v:r,p:i}=n;if(r!==1||typeof i!=`object`||!i||Array.isArray(i))return t;for(let[e,n]of Object.entries(i)){if(t.size>=1e3)break;if(!Array.isArray(n)||n.length!==3)continue;let[r,i,a]=n;u(r)&&u(i)&&u(a)&&t.set(e,[r,i,a])}return t}function f(e,t,r=n){let i={},a=0;for(let n of[e,t])for(let[e,t]of n){if(a>=r)break;e in i||!t.every(u)||(i[e]=[l(t[0]),l(t[1]),l(t[2])],a++)}return JSON.stringify({v:1,p:i})}function p(e,t){let n=2166136261;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);let r=(n>>>0)%1e3/1e3,i=(Math.imul(n,2654435761)>>>0)%1e3/1e3,a=r*Math.PI*2,o=i*2-1,s=Math.sqrt(1-o*o),c=t*(.6+.4*r);return[Math.cos(a)*s*c,o*c,Math.sin(a)*s*c]}function m(e,t){let n=new Map,r=new Set,i=new Map;for(let t of a(e))for(let e of t.members)i.set(e,t);let o=new Map,s=new Map;for(let t of e.links)t.kind===`structure`&&(o.get(t.target)??o.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.target)??s.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.source)??s.set(t.source,[]).get(t.source)).push(t.target);n.set(`hub`,[0,0,0]);for(let r of e.nodes){if(r.id===`hub`)continue;let e=t.get(r.id);e&&n.set(r.id,e)}let c=new Set(e.groups.map(e=>e.id)),u=[...e.nodes.filter(e=>c.has(e.id)),...e.nodes.filter(e=>!c.has(e.id))];for(let e of u){if(n.has(e.id))continue;r.add(e.id);let t=[...o.get(e.id)??[],...s.get(e.id)??[]].find(e=>e!==`hub`&&n.has(e)),a=i.get(e.id),c=t===void 0?a?.center:n.get(t),u=p(e.id,t===void 0?a?24:40:14),d=c??[0,0,0];n.set(e.id,[l(d[0]+u[0]),l(d[1]+u[1]),l(d[2]+u[2])])}return{positions:n,fresh:r}}function h(e,t){let n=new Map,r=[],i=e=>r.some(t=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h),a=[...e.filter(e=>e.pinned),...e.filter(e=>!e.pinned)];for(let e of a)for(let a of e.texts){let o=t(a,e),s={x:e.x-o/2,y:e.y,w:o,h:e.h};if(e.pinned||!i(s)){r.push(s),n.set(e.id,{text:a,box:s});break}}return n}var g=8,_=900;function v(e){let t={top:0,right:0,bottom:0,left:0},n=e.closest(`.wt-stage`);if(!n)return t;let r=e.getBoundingClientRect();if(!r.height)return t;let i=n.querySelector(`.wt-dock`)?.getBoundingClientRect(),a=n.querySelector(`.wt-chips`)?.getBoundingClientRect(),o=r.width>=_?n.querySelector(`.wt-pop-legend`)?.getBoundingClientRect():void 0,s=o&&o.width?Math.max(0,o.right-r.left+g):0,c=i&&i.height?Math.max(0,r.bottom-i.top+g):0,l=a&&a.height?Math.max(0,a.bottom-r.top+g):0;return{top:Math.min(l,r.height/3),right:0,bottom:Math.min(c,r.height/3),left:Math.min(s,r.width/3)}}export{c as a,a as c,s as i,m as l,t as n,d as o,o as r,h as s,v as t,f as u};
|
|
@@ -8,4 +8,4 @@ if(typeof n<`u`)return n.apply(this,arguments);throw Error(`Dynamic require of "
|
|
|
8
8
|
`);return e[0]==`Error`&&e.shift(),Et(e),q.Wa=Tt(),q.$a=e,q.Wa}function Dt(e,t,n){if(e>>>=0,t>>>=0,q.Wa==e)var r=q.$a;else(r=Error().stack.toString().split(`
|
|
9
9
|
`))[0]==`Error`&&r.shift(),Et(r);for(var i=3;r[i]&&Tt()!=e;)++i;for(e=0;e<n&&r[e+i];++e)E()[t+4*e>>>2>>>0]=Tt();return e}var Ot,kt={},At=()=>{if(!Ot){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in kt)kt[e]===void 0?delete t[e]:t[e]=kt[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);Ot=n}return Ot};function jt(e,t){if(s)return I(19,1,e,t);e>>>=0,t>>>=0;var n,r=0,i=0;for(n of At()){var a=t+r;D()[e+i>>>2>>>0]=a,r+=G(n,a,1/0)+1,i+=4}return 0}var Mt=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t};function Nt(e,t){if(s)return I(20,1,e,t);e>>>=0,t>>>=0;var n=At();for(var r of(D()[e>>>2>>>0]=n.length,e=0,n))e+=Mt(r)+1;return D()[t>>>2>>>0]=e,0}function Pt(e){return s?I(21,1,e):52}function Ft(e,t,n,r){return s?I(22,1,e,t,n,r):52}function It(e,t,n,r){return s?I(23,1,e,t,n,r):70}var Y=[null,[],[]];function X(e,t,n,r){if(s)return I(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var i=0,a=0;a<n;a++){var o=D()[t>>>2>>>0],c=D()[t+4>>>2>>>0];t+=8;for(var l=0;l<c;l++){var u=e,d=T()[o+l>>>0],f=Y[u];d===0||d===10?((u===1?ae:w)(Fe(f)),f.length=0):f.push(d)}i+=c}return D()[r>>>2>>>0]=i,0}s||function(){for(var e=r.numThreads-1;e--;)z();N.push(()=>{pe++,function(e){s?e():Promise.all(L.map(Te)).then(e)}(()=>me())})}(),s||(h=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),A()),r.wasmBinary&&(m=r.wasmBinary),r.stackSave=()=>Yt(),r.stackRestore=e=>qt(e),r.stackAlloc=e=>Jt(e),r.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:ce()[e>>>0]=t;break;case`i16`:le()[e>>>1>>>0]=t;break;case`i32`:E()[e>>>2>>>0]=t;break;case`i64`:S[e>>>3]=BigInt(t);break;case`float`:O()[e>>>2>>>0]=t;break;case`double`:k()[e>>>3>>>0]=t;break;case`*`:D()[e>>>2>>>0]=t;break;default:M(`invalid type for setValue: ${n}`)}},r.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return ce()[e>>>0];case`i16`:return le()[e>>>1>>>0];case`i32`:return E()[e>>>2>>>0];case`i64`:return S[e>>>3];case`float`:return O()[e>>>2>>>0];case`double`:return k()[e>>>3>>>0];case`*`:return D()[e>>>2>>>0];default:M(`invalid type for getValue: ${t}`)}},r.UTF8ToString=Ie,r.stringToUTF8=G,r.lengthBytesUTF8=Mt;var Lt=[ve,ye,Me,Le,Re,ze,B,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,ct,lt,ft,jt,Nt,Pt,Ft,It,X],Rt={853836:(e,t,n,i,a)=>{if(r===void 0||!r.Sa)return 1;if((e=Ie(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=r.Sa.get(e)))return 2;if(t=Number(t>>>0),n=Number(n>>>0),i=Number(i>>>0),t+n>e.byteLength)return 3;try{let o=e.subarray(t,t+n);switch(a){case 0:T().set(o,i>>>0);break;case 1:r.hb?r.hb(i,o):r.jb(i,o);break;default:return 4}return 0}catch{return 4}},854660:()=>typeof wasmOffsetConverter<`u`};function zt(){return typeof wasmOffsetConverter<`u`}var Z=await async function(){function e(e,t){return Z=e.exports,Z=function(){var e=Z,t=e=>()=>e()>>>0,n=e=>t=>e(t)>>>0;return(e=Object.assign({},e)).Aa=t(e.Aa),e.Ca=n(e.Ca),e.Oa=n(e.Oa),e.Pa=t(e.Pa),e.__cxa_get_exception_ptr=n(e.__cxa_get_exception_ptr),e}(),Se.push(Z.Da),Ee=Z.Ea,g=t,me(),Z}pe++;var t=he();if(r.instantiateWasm)return new Promise(n=>{r.instantiateWasm(t,(t,r)=>{n(e(t,r))})});if(s)return new Promise(t=>{ne=n=>{t(e(new WebAssembly.Instance(n,he()),n))}});fe??=r.locateFile?r.locateFile?r.locateFile(`ort-wasm-simd-threaded.wasm`,p):p+`ort-wasm-simd-threaded.wasm`:new URL(`/assets/ort-wasm-simd-threaded-CxTQ5xH-.wasm`,``+import.meta.url).href;try{var i=await async function(e){var t=fe;if(!m&&typeof WebAssembly.instantiateStreaming==`function`&&!se(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){w(`wasm streaming compile failed: ${e}`),w(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!m)try{var t=await c(e);return new Uint8Array(t)}catch{}if(e==fe&&m)e=new Uint8Array(m);else{if(!l)throw`both async and sync fetching of the wasm failed`;e=l(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){w(`failed to asynchronously prepare wasm: ${e}`),M(e)}}(t,e)}(t);return e(i.instance,i.module)}catch(e){return n(e),Promise.reject(e)}}();r._OrtInit=(e,t)=>(r._OrtInit=Z.aa)(e,t),r._OrtGetLastError=(e,t)=>(r._OrtGetLastError=Z.ba)(e,t),r._OrtCreateSessionOptions=(e,t,n,i,a,o,s,c,l,u)=>(r._OrtCreateSessionOptions=Z.ca)(e,t,n,i,a,o,s,c,l,u),r._OrtAppendExecutionProvider=(e,t,n,i,a)=>(r._OrtAppendExecutionProvider=Z.da)(e,t,n,i,a),r._OrtAddFreeDimensionOverride=(e,t,n)=>(r._OrtAddFreeDimensionOverride=Z.ea)(e,t,n),r._OrtAddSessionConfigEntry=(e,t,n)=>(r._OrtAddSessionConfigEntry=Z.fa)(e,t,n),r._OrtReleaseSessionOptions=e=>(r._OrtReleaseSessionOptions=Z.ga)(e),r._OrtCreateSession=(e,t,n)=>(r._OrtCreateSession=Z.ha)(e,t,n),r._OrtReleaseSession=e=>(r._OrtReleaseSession=Z.ia)(e),r._OrtGetInputOutputCount=(e,t,n)=>(r._OrtGetInputOutputCount=Z.ja)(e,t,n),r._OrtGetInputOutputMetadata=(e,t,n,i)=>(r._OrtGetInputOutputMetadata=Z.ka)(e,t,n,i),r._OrtFree=e=>(r._OrtFree=Z.la)(e),r._OrtCreateTensor=(e,t,n,i,a,o)=>(r._OrtCreateTensor=Z.ma)(e,t,n,i,a,o),r._OrtGetTensorData=(e,t,n,i,a)=>(r._OrtGetTensorData=Z.na)(e,t,n,i,a),r._OrtReleaseTensor=e=>(r._OrtReleaseTensor=Z.oa)(e),r._OrtCreateRunOptions=(e,t,n,i)=>(r._OrtCreateRunOptions=Z.pa)(e,t,n,i),r._OrtAddRunConfigEntry=(e,t,n)=>(r._OrtAddRunConfigEntry=Z.qa)(e,t,n),r._OrtReleaseRunOptions=e=>(r._OrtReleaseRunOptions=Z.ra)(e),r._OrtCreateBinding=e=>(r._OrtCreateBinding=Z.sa)(e),r._OrtBindInput=(e,t,n)=>(r._OrtBindInput=Z.ta)(e,t,n),r._OrtBindOutput=(e,t,n,i)=>(r._OrtBindOutput=Z.ua)(e,t,n,i),r._OrtClearBoundOutputs=e=>(r._OrtClearBoundOutputs=Z.va)(e),r._OrtReleaseBinding=e=>(r._OrtReleaseBinding=Z.wa)(e),r._OrtRunWithBinding=(e,t,n,i,a)=>(r._OrtRunWithBinding=Z.xa)(e,t,n,i,a),r._OrtRun=(e,t,n,i,a,o,s,c)=>(r._OrtRun=Z.ya)(e,t,n,i,a,o,s,c),r._OrtEndProfiling=e=>(r._OrtEndProfiling=Z.za)(e);var Bt=()=>(Bt=Z.Aa)();r._free=e=>(r._free=Z.Ba)(e),r._malloc=e=>(r._malloc=Z.Ca)(e);var Vt=(e,t,n,r,i,a)=>(Vt=Z.Fa)(e,t,n,r,i,a),Q=()=>(Q=Z.Ga)(),$=(e,t,n,r,i)=>($=Z.Ha)(e,t,n,r,i),Ht=e=>(Ht=Z.Ia)(e),Ut=e=>(Ut=Z.Ja)(e),Wt=(e,t)=>(Wt=Z.Ka)(e,t),Gt=()=>(Gt=Z.La)(),Kt=(e,t)=>(Kt=Z.Ma)(e,t),qt=e=>(qt=Z.Na)(e),Jt=e=>(Jt=Z.Oa)(e),Yt=()=>(Yt=Z.Pa)();return function e(){if(0<pe)j=e;else if(s)t(r),de();else{for(;0<N.length;)N.shift()(r);0<pe?j=e:(r.calledRun=!0,oe||(de(),t(r)))}}(),r.PTR_SIZE=4,i},Pe=Ne,Fe=globalThis.self?.name?.startsWith(`em-pthread`),Fe&&Ne()}),Le,Re,ze,B,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe=l(()=>{Ee(),Le=typeof location>`u`?void 0:location.origin,Re=import.meta.url>`file:`&&import.meta.url<`file;`,ze=()=>Re?new URL(new URL(`ort.wasm.bundle.min.mjs`,import.meta.url).href,Le).href:import.meta.url,B=ze(),Be=()=>{if(B&&!B.startsWith(`blob:`))return B.substring(0,B.lastIndexOf(`/`)+1)},Ve=(e,t)=>{try{let n=t??B;return(n?new URL(e,n):new URL(e)).origin===Le}catch{return!1}},He=(e,t)=>{let n=t??B;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},Ue=(e,t)=>`${t??`./`}${e}`,We=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},Ge=async e=>(await import(
|
|
10
10
|
/*webpackIgnore:true*/
|
|
11
|
-
e)).default,Ke=(je(),f(De)).default,qe=async()=>{if(!B)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(Ve(B))return[void 0,Ke()];let e=await We(B);return[e,Ke(e)]},Je=(Ie(),f(Me)).default,Ye=async(e,t,n,r)=>{let i=Je&&!(e||t);if(i){if(B)i=Ve(B);else if(r&&!n)i=!0;else throw Error(`cannot determine the script source URL.`)}if(i)return[void 0,Je];{let r=`ort-wasm-simd-threaded.mjs`,i=e??He(r,t),a=n&&i&&!Ve(i,t),o=a?await We(i):i??Ue(r,t);return[a?o:void 0,await Ge(o)]}}}),Ze,Qe,V,$e,et,tt,nt,rt,H,it=l(()=>{Xe(),Qe=!1,V=!1,$e=!1,et=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},tt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},nt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},rt=async e=>{if(Qe)return Promise.resolve();if(V)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if($e)throw Error(`previous call to 'initializeWebAssembly()' failed.`);V=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!nt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!tt())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=et();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Ye(s,a,n>1,!!u||!!l),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=Be();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{V=!1,Qe=!0,Ze=t,e(),d&&URL.revokeObjectURL(d)},e=>{V=!1,$e=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},H=()=>{if(Qe&&Ze)return Ze;throw Error(`WebAssembly is not initialized yet.`)}}),U,at,W,ot=l(()=>{it(),U=(e,t)=>{let n=H(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},at=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)at(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},W=e=>{let t=H(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),st,ct=l(()=>{it(),ot(),st=e=>{let t=H(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log severity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=U(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&W(`Can't create run options.`),e?.extra!==void 0&&at(e.extra,``,/* @__PURE__ */ new WeakSet,(e,i)=>{let a=U(e,r),o=U(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&W(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),lt,ut,dt,ft,G,pt,mt=l(()=>{it(),ot(),lt=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`layout`:return 3;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},ut=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},dt=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},ft=(e,t,n,r)=>{let i=U(t,r),a=U(n,r);H()._OrtAddSessionConfigEntry(e,i,a)!==0&&W(`Can't set a session config entry: ${t} - ${n}.`)},G=async(e,t,n)=>{for(let r of t){let t=typeof r==`string`?r:r.name,i=[];switch(t){case`webnn`:if(t=`WEBNN`,typeof r!=`string`){let t=r?.deviceType;t&&ft(e,`deviceType`,t,n)}break;case`webgpu`:if(t=`JS`,typeof r!=`string`){let t=r;if(t?.preferredLayout){if(t.preferredLayout!==`NCHW`&&t.preferredLayout!==`NHWC`)throw Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${t.preferredLayout}`);ft(e,`preferredLayout`,t.preferredLayout,n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${t}`)}let a=U(t,n),o=i.length,s=0,c=0;if(o>0){s=H()._malloc(o*H().PTR_SIZE),n.push(s),c=H()._malloc(o*H().PTR_SIZE),n.push(c);for(let e=0;e<o;e++)H().setValue(s+e*H().PTR_SIZE,i[e][0],`*`),H().setValue(c+e*H().PTR_SIZE,i[e][1],`*`)}await H()._OrtAppendExecutionProvider(e,a,s,c,o)!==0&&W(`Can't append execution provider: ${t}.`)}},pt=async e=>{let t=H(),n=0,r=[],i=e||{};dt(i);try{let e=lt(i.graphOptimizationLevel??`all`),a=ut(i.executionMode??`sequential`),o=typeof i.logId==`string`?U(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log severity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?U(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&W(`Can't create session options.`),i.executionProviders&&await G(n,i.executionProviders,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);ft(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=U(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&W(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&at(i.extra,``,/* @__PURE__ */ new WeakSet,(e,t)=>{ft(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&W(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),ht,gt,K,_t,vt,yt,bt,xt,St=l(()=>{ht=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},gt=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},K=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},_t=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},vt=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},yt=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,bt=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,xt=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),Ct,wt=l(()=>{Ee(),Ct=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),Tt,q,Et,J,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It=l(()=>{z(),ct(),mt(),St(),it(),ot(),wt(),Tt=(e,t)=>{H()._OrtInit(e,t)!==0&&W(`Can't initialize onnxruntime.`)},q=async e=>{Tt(e.wasm.numThreads,vt(e.logLevel))},Et=async(e,t)=>{H().asyncInit?.();let n=e.webgpu.adapter;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);if(n){if(typeof n.limits!=`object`||typeof n.features!=`object`||typeof n.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let t=e.webgpu.powerPreference;if(t!==void 0&&t!==`low-power`&&t!==`high-performance`)throw Error(`Invalid powerPreference setting: "${t}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(n=await navigator.gpu.requestAdapter({powerPreference:t,forceFallbackAdapter:r}),!n)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}}if(t===`webnn`&&(typeof navigator>`u`||!navigator.ml))throw Error(`WebNN is not supported in current environment`)},J=/* @__PURE__ */ new Map,Dt=e=>{let t=H(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&W(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},Ot=(e,t)=>{let n=H(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&W(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e<c;e++){let t=Number(n.getValue(i+8+e*r,`*`));l.push(t===0?Number(n.getValue(i+8+(e+c)*r,`*`)):n.UTF8ToString(t))}return[o,s,l]}finally{n.stackRestore(r),i!==0&&n._OrtFree(i)}},kt=e=>{let t=H(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},At=async(e,t)=>{let n,r,i=H();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=kt(e);let a=0,o=0,s=[],c=[],l=[];try{if([o,s]=await pt(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(Ct(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;i.currentContext=n||(r?await i.webnnCreateMLContext(r):await i.webnnCreateMLContext({deviceType:a,powerPreference:o}))}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&W(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,u]=Dt(a),d=!!t?.enableGraphCapture,f=[],p=[],m=[],h=[];for(let t=0;t<e;t++){let[e,n,r]=Ot(a,t);e===0&&W(`Can't get an input name.`),c.push(e);let o=i.UTF8ToString(e);f.push(o),m.push(n===0?{name:o,isTensor:!1}:{name:o,isTensor:!0,type:gt(n),shape:r})}for(let t=0;t<u;t++){let[n,r,o]=Ot(a,t+e);n===0&&W(`Can't get an output name.`),l.push(n);let s=i.UTF8ToString(n);p.push(s),h.push(r===0?{name:s,isTensor:!1}:{name:s,isTensor:!0,type:gt(r),shape:o})}return J.set(a,[a,c,l,null,d,!1]),[a,f,p,m,h]}catch(e){throw c.forEach(e=>i._OrtFree(e)),l.forEach(e=>i._OrtFree(e)),a!==0&&i._OrtReleaseSession(a)!==0&&W(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&W(`Can't release session options.`),s.forEach(e=>i._free(e)),i.unmountExternalData?.()}},jt=e=>{let t=H(),n=J.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&W(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&W(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&W(`Can't release session.`),J.delete(e)},Mt=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=H(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=K(ht(l),u);{let e=s.jsepRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(r,a,t,m)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=K(ht(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,ht(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;e<t.length;e++){if(typeof t[e]!=`string`)throw TypeError(`tensor data at index ${e} is not a string`);s.setValue(p+e*c,U(t[e],n),`*`)}}else{let e=s.webnnIsGraphInput,a=s.webnnIsGraphOutput;if(l!==`string`&&e&&a){let o=s.UTF8ToString(i);if(e(r,o)||a(r,o)){let e=ht(l);m=K(e,u),f=`ml-tensor`;let n=s.webnnCreateTemporaryTensor,i=s.webnnUploadTensor;if(!n||!i)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);let a=await n(r,e,u);i(a,new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),p=a}else m=t.byteLength,p=s._malloc(m),n.push(p),s.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,m),p)}else m=t.byteLength,p=s._malloc(m),n.push(p),s.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,m),p)}}let h=s.stackSave(),g=s.stackAlloc(4*u.length);try{u.forEach((e,t)=>s.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(ht(l),p,m,g,u.length,xt(f));e===0&&W(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},Nt=async(e,t,n,r,i,a)=>{let o=H(),s=o.PTR_SIZE,c=J.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4];c[5];let m=t.length,h=r.length,g=0,_=[],v=[],y=[],ee=[],b=o.stackSave(),te=o.stackAlloc(m*s),x=o.stackAlloc(m*s),S=o.stackAlloc(h*s),C=o.stackAlloc(h*s);try{[g,_]=st(a),F(`wasm prepareInputOutputTensor`);for(let r=0;r<m;r++)await Mt(n[r],v,ee,e,u[t[r]],t[r],p);for(let t=0;t<h;t++)await Mt(i[t],y,ee,e,d[r[t]],m+r[t],p);I(`wasm prepareInputOutputTensor`);for(let e=0;e<m;e++)o.setValue(te+e*s,v[e],`*`),o.setValue(x+e*s,u[t[e]],`*`);for(let e=0;e<h;e++)o.setValue(S+e*s,y[e],`*`),o.setValue(C+e*s,d[r[e]],`*`);o.jsepOnRunStart?.(l),o.webnnOnRunStart?.(l);let c;c=await o._OrtRun(l,x,te,m,C,h,S,g),c!==0&&W(`failed to call OrtRun().`);let b=[],ne=[];F(`wasm ProcessOutputTensor`);for(let t=0;t<h;t++){let n=Number(o.getValue(S+t*s,`*`));if(n===y[t]){b.push(i[t]);continue}let a=o.stackSave(),c=o.stackAlloc(4*s),l=!1,u,d=0;try{o._OrtGetTensorData(n,c,c+s,c+2*s,c+3*s)!==0&&W(`Can't access output tensor data on index ${t}.`);let i=s===4?`i32`:`i64`,a=Number(o.getValue(c,i));d=o.getValue(c+s,`*`);let p=o.getValue(c+s*2,`*`),m=Number(o.getValue(c+s*3,i)),h=[];for(let e=0;e<m;e++)h.push(Number(o.getValue(p+e*s,i)));o._OrtFree(p)!==0&&W(`Can't free memory for tensor dims.`);let g=h.reduce((e,t)=>e*t,1);u=gt(a);let _=f?.outputPreferredLocations[r[t]];if(u===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t<g;t++){let n=o.getValue(d+t*s,`*`),r=o.getValue(d+(t+1)*s,`*`),i=t===g-1?void 0:r-n;e.push(o.UTF8ToString(n,i))}b.push([u,h,e,`cpu`])}else if(_===`gpu-buffer`&&g>0){let e=o.jsepGetBuffer;if(!e)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let t=e(d),r=K(a,g);if(r===void 0||!yt(u))throw Error(`Unsupported data type: ${u}`);l=!0,b.push([u,h,{gpuBuffer:t,download:o.jsepCreateDownloader(t,r,u),dispose:()=>{o._OrtReleaseTensor(n)!==0&&W(`Can't release tensor.`)}},`gpu-buffer`])}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsGraphInputOutputTypeSupported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(K(a,g)===void 0||!bt(u))throw Error(`Unsupported data type: ${u}`);if(!r(e,u,!1))throw Error(`preferredLocation "ml-tensor" for ${u} output is not supported by current WebNN Context.`);let i=await t(e,d,a,h,!1);l=!0,b.push([u,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(d,u),dispose:()=>{o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n)}},`ml-tensor`])}else if(_===`ml-tensor-cpu-output`&&g>0){let e=o.webnnCreateMLTensorDownloader(d,u)(),t=b.length;l=!0,ne.push((async()=>{let r=[t,await e];return o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n),r})()),b.push([u,h,[],`cpu`])}else{let e=new(_t(u))(g);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(o.HEAPU8.subarray(d,d+e.byteLength)),b.push([u,h,e,`cpu`])}}finally{o.stackRestore(a),u===`string`&&d&&o._free(d),l||o._OrtReleaseTensor(n)}}f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&W(`Can't clear bound outputs.`),J.set(e,[l,u,d,f,p,!1]));for(let[e,t]of await Promise.all(ne))b[e][2]=t;return I(`wasm ProcessOutputTensor`),b}finally{o.webnnOnRunEnd?.(l),o.stackRestore(b),v.forEach(e=>o._OrtReleaseTensor(e)),y.forEach(e=>o._OrtReleaseTensor(e)),ee.forEach(e=>o._free(e)),g!==0&&o._OrtReleaseRunOptions(g),_.forEach(e=>o._free(e))}},Pt=e=>{let t=H(),n=J.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&W(`Can't get an profile file name.`),t._OrtFree(i)},Ft=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),Y,X,Lt,Rt,zt,Z,Bt,Vt,Q,$,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt=l(()=>{z(),It(),it(),Xe(),Y=()=>!!C.wasm.proxy&&typeof document<`u`,Lt=!1,Rt=!1,zt=!1,Vt=/* @__PURE__ */ new Map,Q=(e,t)=>{let n=Vt.get(e);n?n.push(t):Vt.set(e,[t])},$=()=>{if(Lt||!Rt||zt||!X)throw Error(`worker not ready`)},Ht=e=>{switch(e.data.type){case`init-wasm`:Lt=!1,e.data.err?(zt=!0,Bt[1](e.data.err)):(Rt=!0,Bt[0]()),Z&&=(URL.revokeObjectURL(Z),void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=Vt.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}}},Ut=async()=>{if(!Rt){if(Lt)throw Error(`multiple calls to 'initWasm()' detected.`);if(zt)throw Error(`previous call to 'initWasm()' failed.`);if(Lt=!0,Y())return new Promise((e,t)=>{X?.terminate(),qe().then(([n,r])=>{try{X=r,X.onerror=e=>t(e),X.onmessage=Ht,Bt=[e,t];let i={type:`init-wasm`,in:C};!i.in.wasm.wasmPaths&&(n||Re)&&(i.in.wasm.wasmPaths={wasm:new URL(`/assets/ort-wasm-simd-threaded-CxTQ5xH-.wasm`,``+import.meta.url).href}),X.postMessage(i),Z=n}catch(e){t(e)}},t)});try{await rt(C.wasm),await q(C),Rt=!0}catch(e){throw zt=!0,e}finally{Lt=!1}}},Wt=async e=>{if(Y())return $(),new Promise((t,n)=>{Q(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:C}};X.postMessage(r)});await Et(C,e)},Gt=async e=>Y()?($(),new Promise((t,n)=>{Q(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};X.postMessage(r,[e.buffer])})):kt(e),Kt=async(e,t)=>{if(Y()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return $(),new Promise((n,r)=>{Q(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),X.postMessage(i,a)})}return At(e,t)},qt=async e=>{if(Y())return $(),new Promise((t,n)=>{Q(`release`,[t,n]);let r={type:`release`,in:e};X.postMessage(r)});jt(e)},Jt=async(e,t,n,r,i,a)=>{if(Y()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return $(),new Promise((i,o)=>{Q(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};X.postMessage(c,Ft(s))})}return Nt(e,t,n,r,i,a)},Yt=async e=>{if(Y())return $(),new Promise((t,n)=>{Q(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};X.postMessage(r)});Pt(e)}}),Zt,Qt,$t,en=l(()=>{z(),Xt(),St(),Ee(),wt(),Zt=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},Qt=e=>{switch(e[3]){case`cpu`:return new M(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!yt(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return M.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!bt(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return M.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},$t=class{async fetchModelAndCopyToWasmMemory(e){return Gt(await Ct(e))}async loadModel(e,t){N();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Kt(n,t),P()}async dispose(){return qt(this.sessionId)}async run(e,t,n){N();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>Zt(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?Zt(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await Jt(this.sessionId,i,s,o,c,n),u={};for(let e=0;e<l.length;e++)u[this.outputNames[o[e]]]=a[e]??Qt(l[e]);return P(),u}startProfiling(){}endProfiling(){Yt(this.sessionId)}}}),tn={};u(tn,{OnnxruntimeWebAssemblyBackend:()=>rn,initializeFlags:()=>nn,wasmBackend:()=>an});var nn,rn,an,on=l(()=>{z(),Xt(),en(),nn=()=>{(typeof C.wasm.initTimeout!=`number`||C.wasm.initTimeout<0)&&(C.wasm.initTimeout=0);let e=C.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),C.wasm.simd=!1),typeof C.wasm.proxy!=`boolean`&&(C.wasm.proxy=!1),typeof C.wasm.trace!=`boolean`&&(C.wasm.trace=!1),typeof C.wasm.numThreads!=`number`||!Number.isInteger(C.wasm.numThreads)||C.wasm.numThreads<=0){if(typeof self<`u`&&!self.crossOriginIsolated)C.wasm.numThreads=1;else{let e=typeof navigator>`u`?c(`node:os`).cpus().length:navigator.hardwareConcurrency;C.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}}},rn=class{async init(e){nn(),await Ut(),await Wt(e)}async createInferenceSessionHandler(e,t){let n=new $t;return await n.loadModel(e,t),n}},an=new rn});z(),z(),z();var sn=`1.23.2`,cn=Te;{let e=(on(),f(tn)).wasmBackend;h(`cpu`,e,10),h(`wasm`,e,10)}Object.defineProperty(C.versions,"web",{value:sn,enumerable:!0});var ln=`/assets/silero_vad-Dt9-bTDn.onnx`;[.../* @__PURE__ */ new Set([`um`,`umm`,`uh`,`uhh`,`uhm`,`erm`,`er`,`eh`,`ah`,`hmm`,`hm`,`mm`,`mmm`,`mhm`,`mm-hmm`,`uh-huh`])];const un=Object.freeze({minSpeechMs:300,endSilenceMs:350,trailingKeepMs:200,preRollMs:300,holdMs:800});un.trailingKeepMs;const dn=Object.freeze({startProb:.6,endProb:.35,speakingStartProb:.85,minSpeechMs:250,endSilenceMs:un.endSilenceMs,maxSegmentMs:6e4,gateDb:3,energyMarginDb:10,energyMinSpeechMs:un.minSpeechMs});Object.freeze([`low`,`normal`,`high`]),Object.freeze({low:Object.freeze({...dn,startProb:.75,endProb:.45,speakingStartProb:.92,minSpeechMs:350,gateDb:6,energyMarginDb:13,energyMinSpeechMs:400}),normal:dn,high:Object.freeze({...dn,startProb:.45,endProb:.25,speakingStartProb:.75,minSpeechMs:180,gateDb:0,energyMarginDb:7,energyMinSpeechMs:250})});var fn=class e{ort;session;state=/* @__PURE__ */ new Float32Array(256);context=/* @__PURE__ */ new Float32Array(64);sr;constructor(e,t){this.ort=e,this.session=t,this.sr=new e.Tensor(`int64`,BigInt64Array.from([BigInt(16e3)]),[])}static async load(t,n){let r=await t.InferenceSession.create(n,{executionProviders:[`wasm`],graphOptimizationLevel:`all`});return new e(t,r)}reset(){this.state=/* @__PURE__ */ new Float32Array(256),this.context=/* @__PURE__ */ new Float32Array(64)}async probability(e){if(e.length!==512)throw Error(`Silero VAD needs 512-sample chunks, got ${e.length}`);let t=/* @__PURE__ */ new Float32Array(576);t.set(this.context),t.set(e,64),this.context=e.slice(448);let n=await this.session.run({input:new this.ort.Tensor(`float32`,t,[1,t.length]),state:new this.ort.Tensor(`float32`,this.state,[2,1,128]),sr:this.sr});return this.state=Float32Array.from(n.stateN.data),n.output.data[0]}};C.wasm.numThreads=1,C.wasm.proxy=!1,C.logLevel=`error`;const pn=self,mn=performance.now(),hn=(async()=>{let e=await fetch(ln);if(!e.ok)throw Error(`model download failed (${e.status})`);return fn.load(r,new Uint8Array(await e.arrayBuffer()))})();hn.then(()=>pn.postMessage({type:`ready`,ms:Math.round(performance.now()-mn)}),e=>pn.postMessage({type:`error`,message:e instanceof Error?e.message:String(e)}));let gn=Promise.resolve();pn.onmessage=e=>{let t=e.data;gn=gn.then(async()=>{let e;try{e=await hn}catch(e){t.type===`chunk`&&pn.postMessage({type:`fail`,id:t.id,message:String(e?.message??e)});return}if(t.type===`reset`)return e.reset();if(t.type===`chunk`)try{pn.postMessage({type:`prob`,id:t.id,p:await e.probability(t.samples)})}catch(e){pn.postMessage({type:`fail`,id:t.id,message:String(e?.message??e)})}})};
|
|
11
|
+
e)).default,Ke=(je(),f(De)).default,qe=async()=>{if(!B)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(Ve(B))return[void 0,Ke()];let e=await We(B);return[e,Ke(e)]},Je=(Ie(),f(Me)).default,Ye=async(e,t,n,r)=>{let i=Je&&!(e||t);if(i){if(B)i=Ve(B);else if(r&&!n)i=!0;else throw Error(`cannot determine the script source URL.`)}if(i)return[void 0,Je];{let r=`ort-wasm-simd-threaded.mjs`,i=e??He(r,t),a=n&&i&&!Ve(i,t),o=a?await We(i):i??Ue(r,t);return[a?o:void 0,await Ge(o)]}}}),Ze,Qe,V,$e,et,tt,nt,rt,H,it=l(()=>{Xe(),Qe=!1,V=!1,$e=!1,et=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},tt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},nt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},rt=async e=>{if(Qe)return Promise.resolve();if(V)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if($e)throw Error(`previous call to 'initializeWebAssembly()' failed.`);V=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!nt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!tt())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=et();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Ye(s,a,n>1,!!u||!!l),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=Be();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{V=!1,Qe=!0,Ze=t,e(),d&&URL.revokeObjectURL(d)},e=>{V=!1,$e=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},H=()=>{if(Qe&&Ze)return Ze;throw Error(`WebAssembly is not initialized yet.`)}}),U,at,W,ot=l(()=>{it(),U=(e,t)=>{let n=H(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},at=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)at(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},W=e=>{let t=H(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),st,ct=l(()=>{it(),ot(),st=e=>{let t=H(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log severity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=U(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&W(`Can't create run options.`),e?.extra!==void 0&&at(e.extra,``,/* @__PURE__ */ new WeakSet,(e,i)=>{let a=U(e,r),o=U(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&W(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),lt,ut,dt,ft,G,pt,mt=l(()=>{it(),ot(),lt=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`layout`:return 3;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},ut=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},dt=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},ft=(e,t,n,r)=>{let i=U(t,r),a=U(n,r);H()._OrtAddSessionConfigEntry(e,i,a)!==0&&W(`Can't set a session config entry: ${t} - ${n}.`)},G=async(e,t,n)=>{for(let r of t){let t=typeof r==`string`?r:r.name,i=[];switch(t){case`webnn`:if(t=`WEBNN`,typeof r!=`string`){let t=r?.deviceType;t&&ft(e,`deviceType`,t,n)}break;case`webgpu`:if(t=`JS`,typeof r!=`string`){let t=r;if(t?.preferredLayout){if(t.preferredLayout!==`NCHW`&&t.preferredLayout!==`NHWC`)throw Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${t.preferredLayout}`);ft(e,`preferredLayout`,t.preferredLayout,n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${t}`)}let a=U(t,n),o=i.length,s=0,c=0;if(o>0){s=H()._malloc(o*H().PTR_SIZE),n.push(s),c=H()._malloc(o*H().PTR_SIZE),n.push(c);for(let e=0;e<o;e++)H().setValue(s+e*H().PTR_SIZE,i[e][0],`*`),H().setValue(c+e*H().PTR_SIZE,i[e][1],`*`)}await H()._OrtAppendExecutionProvider(e,a,s,c,o)!==0&&W(`Can't append execution provider: ${t}.`)}},pt=async e=>{let t=H(),n=0,r=[],i=e||{};dt(i);try{let e=lt(i.graphOptimizationLevel??`all`),a=ut(i.executionMode??`sequential`),o=typeof i.logId==`string`?U(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log severity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?U(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&W(`Can't create session options.`),i.executionProviders&&await G(n,i.executionProviders,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);ft(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=U(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&W(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&at(i.extra,``,/* @__PURE__ */ new WeakSet,(e,t)=>{ft(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&W(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),ht,gt,K,_t,vt,yt,bt,xt,St=l(()=>{ht=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},gt=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},K=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},_t=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},vt=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},yt=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,bt=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,xt=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),Ct,wt=l(()=>{Ee(),Ct=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),Tt,q,Et,J,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It=l(()=>{z(),ct(),mt(),St(),it(),ot(),wt(),Tt=(e,t)=>{H()._OrtInit(e,t)!==0&&W(`Can't initialize onnxruntime.`)},q=async e=>{Tt(e.wasm.numThreads,vt(e.logLevel))},Et=async(e,t)=>{H().asyncInit?.();let n=e.webgpu.adapter;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);if(n){if(typeof n.limits!=`object`||typeof n.features!=`object`||typeof n.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let t=e.webgpu.powerPreference;if(t!==void 0&&t!==`low-power`&&t!==`high-performance`)throw Error(`Invalid powerPreference setting: "${t}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(n=await navigator.gpu.requestAdapter({powerPreference:t,forceFallbackAdapter:r}),!n)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}}if(t===`webnn`&&(typeof navigator>`u`||!navigator.ml))throw Error(`WebNN is not supported in current environment`)},J=/* @__PURE__ */ new Map,Dt=e=>{let t=H(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&W(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},Ot=(e,t)=>{let n=H(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&W(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e<c;e++){let t=Number(n.getValue(i+8+e*r,`*`));l.push(t===0?Number(n.getValue(i+8+(e+c)*r,`*`)):n.UTF8ToString(t))}return[o,s,l]}finally{n.stackRestore(r),i!==0&&n._OrtFree(i)}},kt=e=>{let t=H(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},At=async(e,t)=>{let n,r,i=H();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=kt(e);let a=0,o=0,s=[],c=[],l=[];try{if([o,s]=await pt(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(Ct(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;i.currentContext=n||(r?await i.webnnCreateMLContext(r):await i.webnnCreateMLContext({deviceType:a,powerPreference:o}))}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&W(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,u]=Dt(a),d=!!t?.enableGraphCapture,f=[],p=[],m=[],h=[];for(let t=0;t<e;t++){let[e,n,r]=Ot(a,t);e===0&&W(`Can't get an input name.`),c.push(e);let o=i.UTF8ToString(e);f.push(o),m.push(n===0?{name:o,isTensor:!1}:{name:o,isTensor:!0,type:gt(n),shape:r})}for(let t=0;t<u;t++){let[n,r,o]=Ot(a,t+e);n===0&&W(`Can't get an output name.`),l.push(n);let s=i.UTF8ToString(n);p.push(s),h.push(r===0?{name:s,isTensor:!1}:{name:s,isTensor:!0,type:gt(r),shape:o})}return J.set(a,[a,c,l,null,d,!1]),[a,f,p,m,h]}catch(e){throw c.forEach(e=>i._OrtFree(e)),l.forEach(e=>i._OrtFree(e)),a!==0&&i._OrtReleaseSession(a)!==0&&W(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&W(`Can't release session options.`),s.forEach(e=>i._free(e)),i.unmountExternalData?.()}},jt=e=>{let t=H(),n=J.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&W(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&W(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&W(`Can't release session.`),J.delete(e)},Mt=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=H(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=K(ht(l),u);{let e=s.jsepRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(r,a,t,m)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=K(ht(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,ht(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;e<t.length;e++){if(typeof t[e]!=`string`)throw TypeError(`tensor data at index ${e} is not a string`);s.setValue(p+e*c,U(t[e],n),`*`)}}else{let e=s.webnnIsGraphInput,a=s.webnnIsGraphOutput;if(l!==`string`&&e&&a){let o=s.UTF8ToString(i);if(e(r,o)||a(r,o)){let e=ht(l);m=K(e,u),f=`ml-tensor`;let n=s.webnnCreateTemporaryTensor,i=s.webnnUploadTensor;if(!n||!i)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);let a=await n(r,e,u);i(a,new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),p=a}else m=t.byteLength,p=s._malloc(m),n.push(p),s.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,m),p)}else m=t.byteLength,p=s._malloc(m),n.push(p),s.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,m),p)}}let h=s.stackSave(),g=s.stackAlloc(4*u.length);try{u.forEach((e,t)=>s.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(ht(l),p,m,g,u.length,xt(f));e===0&&W(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},Nt=async(e,t,n,r,i,a)=>{let o=H(),s=o.PTR_SIZE,c=J.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4];c[5];let m=t.length,h=r.length,g=0,_=[],v=[],y=[],ee=[],b=o.stackSave(),te=o.stackAlloc(m*s),x=o.stackAlloc(m*s),S=o.stackAlloc(h*s),C=o.stackAlloc(h*s);try{[g,_]=st(a),F(`wasm prepareInputOutputTensor`);for(let r=0;r<m;r++)await Mt(n[r],v,ee,e,u[t[r]],t[r],p);for(let t=0;t<h;t++)await Mt(i[t],y,ee,e,d[r[t]],m+r[t],p);I(`wasm prepareInputOutputTensor`);for(let e=0;e<m;e++)o.setValue(te+e*s,v[e],`*`),o.setValue(x+e*s,u[t[e]],`*`);for(let e=0;e<h;e++)o.setValue(S+e*s,y[e],`*`),o.setValue(C+e*s,d[r[e]],`*`);o.jsepOnRunStart?.(l),o.webnnOnRunStart?.(l);let c;c=await o._OrtRun(l,x,te,m,C,h,S,g),c!==0&&W(`failed to call OrtRun().`);let b=[],ne=[];F(`wasm ProcessOutputTensor`);for(let t=0;t<h;t++){let n=Number(o.getValue(S+t*s,`*`));if(n===y[t]){b.push(i[t]);continue}let a=o.stackSave(),c=o.stackAlloc(4*s),l=!1,u,d=0;try{o._OrtGetTensorData(n,c,c+s,c+2*s,c+3*s)!==0&&W(`Can't access output tensor data on index ${t}.`);let i=s===4?`i32`:`i64`,a=Number(o.getValue(c,i));d=o.getValue(c+s,`*`);let p=o.getValue(c+s*2,`*`),m=Number(o.getValue(c+s*3,i)),h=[];for(let e=0;e<m;e++)h.push(Number(o.getValue(p+e*s,i)));o._OrtFree(p)!==0&&W(`Can't free memory for tensor dims.`);let g=h.reduce((e,t)=>e*t,1);u=gt(a);let _=f?.outputPreferredLocations[r[t]];if(u===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t<g;t++){let n=o.getValue(d+t*s,`*`),r=o.getValue(d+(t+1)*s,`*`),i=t===g-1?void 0:r-n;e.push(o.UTF8ToString(n,i))}b.push([u,h,e,`cpu`])}else if(_===`gpu-buffer`&&g>0){let e=o.jsepGetBuffer;if(!e)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let t=e(d),r=K(a,g);if(r===void 0||!yt(u))throw Error(`Unsupported data type: ${u}`);l=!0,b.push([u,h,{gpuBuffer:t,download:o.jsepCreateDownloader(t,r,u),dispose:()=>{o._OrtReleaseTensor(n)!==0&&W(`Can't release tensor.`)}},`gpu-buffer`])}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsGraphInputOutputTypeSupported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(K(a,g)===void 0||!bt(u))throw Error(`Unsupported data type: ${u}`);if(!r(e,u,!1))throw Error(`preferredLocation "ml-tensor" for ${u} output is not supported by current WebNN Context.`);let i=await t(e,d,a,h,!1);l=!0,b.push([u,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(d,u),dispose:()=>{o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n)}},`ml-tensor`])}else if(_===`ml-tensor-cpu-output`&&g>0){let e=o.webnnCreateMLTensorDownloader(d,u)(),t=b.length;l=!0,ne.push((async()=>{let r=[t,await e];return o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n),r})()),b.push([u,h,[],`cpu`])}else{let e=new(_t(u))(g);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(o.HEAPU8.subarray(d,d+e.byteLength)),b.push([u,h,e,`cpu`])}}finally{o.stackRestore(a),u===`string`&&d&&o._free(d),l||o._OrtReleaseTensor(n)}}f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&W(`Can't clear bound outputs.`),J.set(e,[l,u,d,f,p,!1]));for(let[e,t]of await Promise.all(ne))b[e][2]=t;return I(`wasm ProcessOutputTensor`),b}finally{o.webnnOnRunEnd?.(l),o.stackRestore(b),v.forEach(e=>o._OrtReleaseTensor(e)),y.forEach(e=>o._OrtReleaseTensor(e)),ee.forEach(e=>o._free(e)),g!==0&&o._OrtReleaseRunOptions(g),_.forEach(e=>o._free(e))}},Pt=e=>{let t=H(),n=J.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&W(`Can't get an profile file name.`),t._OrtFree(i)},Ft=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),Y,X,Lt,Rt,zt,Z,Bt,Vt,Q,$,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt=l(()=>{z(),It(),it(),Xe(),Y=()=>!!C.wasm.proxy&&typeof document<`u`,Lt=!1,Rt=!1,zt=!1,Vt=/* @__PURE__ */ new Map,Q=(e,t)=>{let n=Vt.get(e);n?n.push(t):Vt.set(e,[t])},$=()=>{if(Lt||!Rt||zt||!X)throw Error(`worker not ready`)},Ht=e=>{switch(e.data.type){case`init-wasm`:Lt=!1,e.data.err?(zt=!0,Bt[1](e.data.err)):(Rt=!0,Bt[0]()),Z&&=(URL.revokeObjectURL(Z),void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=Vt.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}}},Ut=async()=>{if(!Rt){if(Lt)throw Error(`multiple calls to 'initWasm()' detected.`);if(zt)throw Error(`previous call to 'initWasm()' failed.`);if(Lt=!0,Y())return new Promise((e,t)=>{X?.terminate(),qe().then(([n,r])=>{try{X=r,X.onerror=e=>t(e),X.onmessage=Ht,Bt=[e,t];let i={type:`init-wasm`,in:C};!i.in.wasm.wasmPaths&&(n||Re)&&(i.in.wasm.wasmPaths={wasm:new URL(`/assets/ort-wasm-simd-threaded-CxTQ5xH-.wasm`,``+import.meta.url).href}),X.postMessage(i),Z=n}catch(e){t(e)}},t)});try{await rt(C.wasm),await q(C),Rt=!0}catch(e){throw zt=!0,e}finally{Lt=!1}}},Wt=async e=>{if(Y())return $(),new Promise((t,n)=>{Q(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:C}};X.postMessage(r)});await Et(C,e)},Gt=async e=>Y()?($(),new Promise((t,n)=>{Q(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};X.postMessage(r,[e.buffer])})):kt(e),Kt=async(e,t)=>{if(Y()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return $(),new Promise((n,r)=>{Q(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),X.postMessage(i,a)})}return At(e,t)},qt=async e=>{if(Y())return $(),new Promise((t,n)=>{Q(`release`,[t,n]);let r={type:`release`,in:e};X.postMessage(r)});jt(e)},Jt=async(e,t,n,r,i,a)=>{if(Y()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return $(),new Promise((i,o)=>{Q(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};X.postMessage(c,Ft(s))})}return Nt(e,t,n,r,i,a)},Yt=async e=>{if(Y())return $(),new Promise((t,n)=>{Q(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};X.postMessage(r)});Pt(e)}}),Zt,Qt,$t,en=l(()=>{z(),Xt(),St(),Ee(),wt(),Zt=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},Qt=e=>{switch(e[3]){case`cpu`:return new M(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!yt(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return M.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!bt(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return M.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},$t=class{async fetchModelAndCopyToWasmMemory(e){return Gt(await Ct(e))}async loadModel(e,t){N();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Kt(n,t),P()}async dispose(){return qt(this.sessionId)}async run(e,t,n){N();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>Zt(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?Zt(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await Jt(this.sessionId,i,s,o,c,n),u={};for(let e=0;e<l.length;e++)u[this.outputNames[o[e]]]=a[e]??Qt(l[e]);return P(),u}startProfiling(){}endProfiling(){Yt(this.sessionId)}}}),tn={};u(tn,{OnnxruntimeWebAssemblyBackend:()=>rn,initializeFlags:()=>nn,wasmBackend:()=>an});var nn,rn,an,on=l(()=>{z(),Xt(),en(),nn=()=>{(typeof C.wasm.initTimeout!=`number`||C.wasm.initTimeout<0)&&(C.wasm.initTimeout=0);let e=C.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),C.wasm.simd=!1),typeof C.wasm.proxy!=`boolean`&&(C.wasm.proxy=!1),typeof C.wasm.trace!=`boolean`&&(C.wasm.trace=!1),typeof C.wasm.numThreads!=`number`||!Number.isInteger(C.wasm.numThreads)||C.wasm.numThreads<=0){if(typeof self<`u`&&!self.crossOriginIsolated)C.wasm.numThreads=1;else{let e=typeof navigator>`u`?c(`node:os`).cpus().length:navigator.hardwareConcurrency;C.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}}},rn=class{async init(e){nn(),await Ut(),await Wt(e)}async createInferenceSessionHandler(e,t){let n=new $t;return await n.loadModel(e,t),n}},an=new rn});z(),z(),z();var sn=`1.23.2`,cn=Te;{let e=(on(),f(tn)).wasmBackend;h(`cpu`,e,10),h(`wasm`,e,10)}Object.defineProperty(C.versions,"web",{value:sn,enumerable:!0});var ln=`/assets/silero_vad-Dt9-bTDn.onnx`;[.../* @__PURE__ */ new Set([`um`,`umm`,`uh`,`uhh`,`uhm`,`erm`,`er`,`eh`,`ah`,`hmm`,`hm`,`mm`,`mmm`,`mhm`,`mm-hmm`,`uh-huh`])];const un=Object.freeze({minSpeechMs:300,endSilenceMs:350,trailingKeepMs:200,preRollMs:300,holdMs:1600,finishedHoldMs:1e3});un.trailingKeepMs;const dn=Object.freeze({startProb:.6,endProb:.35,speakingStartProb:.85,minSpeechMs:250,endSilenceMs:un.endSilenceMs,maxSegmentMs:6e4,gateDb:3,energyMarginDb:10,energyMinSpeechMs:un.minSpeechMs});Object.freeze([`low`,`normal`,`high`]),Object.freeze({low:Object.freeze({...dn,startProb:.75,endProb:.45,speakingStartProb:.92,minSpeechMs:350,gateDb:6,energyMarginDb:13,energyMinSpeechMs:400}),normal:dn,high:Object.freeze({...dn,startProb:.45,endProb:.25,speakingStartProb:.75,minSpeechMs:180,gateDb:0,energyMarginDb:7,energyMinSpeechMs:250})});var fn=class e{ort;session;state=/* @__PURE__ */ new Float32Array(256);context=/* @__PURE__ */ new Float32Array(64);sr;constructor(e,t){this.ort=e,this.session=t,this.sr=new e.Tensor(`int64`,BigInt64Array.from([BigInt(16e3)]),[])}static async load(t,n){let r=await t.InferenceSession.create(n,{executionProviders:[`wasm`],graphOptimizationLevel:`all`});return new e(t,r)}reset(){this.state=/* @__PURE__ */ new Float32Array(256),this.context=/* @__PURE__ */ new Float32Array(64)}async probability(e){if(e.length!==512)throw Error(`Silero VAD needs 512-sample chunks, got ${e.length}`);let t=/* @__PURE__ */ new Float32Array(576);t.set(this.context),t.set(e,64),this.context=e.slice(448);let n=await this.session.run({input:new this.ort.Tensor(`float32`,t,[1,t.length]),state:new this.ort.Tensor(`float32`,this.state,[2,1,128]),sr:this.sr});return this.state=Float32Array.from(n.stateN.data),n.output.data[0]}};C.wasm.numThreads=1,C.wasm.proxy=!1,C.logLevel=`error`;const pn=self,mn=performance.now(),hn=(async()=>{let e=await fetch(ln);if(!e.ok)throw Error(`model download failed (${e.status})`);return fn.load(r,new Uint8Array(await e.arrayBuffer()))})();hn.then(()=>pn.postMessage({type:`ready`,ms:Math.round(performance.now()-mn)}),e=>pn.postMessage({type:`error`,message:e instanceof Error?e.message:String(e)}));let gn=Promise.resolve();pn.onmessage=e=>{let t=e.data;gn=gn.then(async()=>{let e;try{e=await hn}catch(e){t.type===`chunk`&&pn.postMessage({type:`fail`,id:t.id,message:String(e?.message??e)});return}if(t.type===`reset`)return e.reset();if(t.type===`chunk`)try{pn.postMessage({type:`prob`,id:t.id,p:await e.probability(t.samples)})}catch(e){pn.postMessage({type:`fail`,id:t.id,message:String(e?.message??e)})}})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,Q as t,it as n}from"./ui-
|
|
1
|
+
import{G as e,Q as t,it as n}from"./ui-Qo2Pd9-O.js";var r={artifactsPerUser:5e3,revisionsPerArtifact:500,blobBytes:26214400,userBlobBytes:2147483648,bundleFiles:200,chunkBytes:1048576,aiJobsPerUser:8,aiJobsPerArtifact:2,aiInstructionChars:8e3},i=[`markdown`,`code`,`image`,`table`,`chart`,`dashboard`,`html`,`app`,`file`],a=[`html`,`app`],o=[`text/markdown`,`text/plain`,`text/csv`,`text/html`,`text/css`,`text/javascript`,`application/json`,`application/pdf`,`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`],s=e=>typeof e==`string`&&/^sha256:[0-9a-f]{64}$/.test(e);function c(e){if(!t(e))return`blob must be an object`;if(!s(e.hash))return`hash must be sha256:<64 hex>`;if(typeof e.bytes!=`number`||!Number.isSafeInteger(e.bytes)||e.bytes<0||e.bytes>r.blobBytes)return`bytes must be 0–${r.blobBytes}`;if(!o.includes(e.mediaType))return`mediaType is not allowed`;if(e.path!==void 0&&(typeof e.path!=`string`||!/^(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))[A-Za-z0-9._/-]{1,200}$/.test(e.path)))return`path must be a relative path without . or .. segments`}var l=`/api/agent/artifacts`,u={workspace:``,type:``},d=e=>typeof e==`string`&&i.includes(e);function f(t){let n=typeof t==`string`?new URLSearchParams(t):t,r=n.get(`workspace`)??``,i=n.get(`type`)??``;return{workspace:r===`none`||e(`workspace`,r)?r:``,type:d(i)?i:``}}function p(e){let t=new URLSearchParams;e.workspace&&t.set(`workspace`,e.workspace),e.type&&t.set(`type`,e.type);let n=t.toString();return n?`?${n}`:``}var m=e=>e.workspace&&e.workspace!==`none`?e.workspace:``;function h(e,t){let n=new URLSearchParams({state:`active`,limit:`50`}),r=m(e);return r&&n.set(`workspace`,r),t&&n.set(`cursor`,t),`${l}?${n}`}var g=e=>typeof e==`string`&&e.length>0;function _(e){if(!e||typeof e!=`object`)return;let t=e;if(g(t.id)&&typeof t.title==`string`&&d(t.kind)&&typeof t.updatedAt==`number`)return{id:t.id,title:t.title,kind:t.kind,visibility:t.visibility===`workspace`?`workspace`:`private`,...g(t.workspaceID)?{workspaceID:t.workspaceID}:{},...g(t.description)?{description:t.description}:{},updatedAt:t.updatedAt}}function v(e){let t=e&&typeof e==`object`?e:{};return{items:Array.isArray(t.items)?t.items.flatMap(e=>_(e)??[]):[],...g(t.cursor)?{cursor:t.cursor}:{}}}function y(e,t){return e.filter(e=>(t.type===``||e.kind===t.type)&&(t.workspace===``||(t.workspace===`none`?!e.workspaceID:e.workspaceID===t.workspace)))}function b(e){return e.status===422||e.code===`unsupported`?{kind:`unsupported`,text:`Artifacts aren't supported on this hub yet.`}:e.status===404?{kind:`unavailable`,text:`This hub doesn't have artifacts.`}:e.status===403||e.status===401?{kind:`forbidden`,text:`This device isn't allowed to read artifacts.`}:{kind:`error`,text:e.message?`Could not load artifacts: ${e.message}`:`Could not load artifacts (HTTP ${e.status}).`}}function x(e){let t=e&&typeof e==`object`?e:{};return{status:typeof t.status==`number`?t.status:0,...typeof t.code==`string`?{code:t.code}:{},message:typeof t.message==`string`?t.message:String(e)}}function S(e,t){return t?`None of the artifacts loaded so far match. Load more to keep looking.`:e.workspace===``&&e.type===``?`No artifacts yet. Artifacts that your sessions create show up here.`:`No artifacts match these filters.`}var C=(e,t)=>t.get(e)??`Workspace ${e.slice(0,12)}…`,w=e=>`/artifacts/${encodeURIComponent(e)}`;function T(e,t){let n=u,r,i=0,a=[],o,s={status:`loading`},c=()=>s.status===`ready`?{status:`ready`,items:y(a,n),total:a.length,more:o!==void 0,loadingMore:s.loadingMore,...s.moreError?{moreError:s.moreError}:{}}:s,l=e=>{s=e,t(c())};function d(u){n=u;let d=m(u);if(d===r&&s.status===`ready`){t(c());return}r=d;let f=++i;a=[],o=void 0,l({status:`loading`}),e.list(u).then(e=>{f===i&&(a=[...e.items],o=e.cursor,l({status:`ready`,loadingMore:!1}))},e=>f===i&&l({status:`error`,error:b(x(e))}))}function f(){if(s.status!==`ready`||s.loadingMore||o===void 0)return;let t=i;l({status:`ready`,loadingMore:!0}),e.list(n,o).then(e=>{if(t!==i)return;let n=new Set(a.map(e=>e.id));a=[...a,...e.items.filter(e=>!n.has(e.id))],o=e.cursor,l({status:`ready`,loadingMore:!1})},e=>t===i&&l({status:`ready`,loadingMore:!1,moreError:b(x(e)).text}))}function p(){r=void 0,d(n)}return{load:d,more:f,reload:p,view:c}}var E={list:async(e,t)=>v(await n(h(e,t)))};async function D(){try{return((await n(`/api/agent/workspaces?state=active&limit=200`)).items??[]).flatMap(e=>typeof e.id==`string`&&typeof e.title==`string`?[{id:e.id,title:e.title}]:[])}catch{return[]}}export{S as a,C as c,a as d,c as f,T as i,i as l,D as n,p as o,w as r,f as s,E as t,r as u};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-proxy`),a=typeof Proxy==`function`,o=Symbol(`solid-track`),s={equals:r},c=null,l=ge,u=1,d=2,f={owned:null,cleanups:null,context:null,owner:null},p={},m=null,h=null,g=null,_=null,v=null,y=0;function b(e,t){let n=g,r=m,i=e.length===0,a=t===void 0?r:t,o=i?f:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>T(()=>L(o)));m=o,g=null;try{return F(s,!0)}finally{g=n,m=r}}function x(e,t){t=t?Object.assign({},s,t):s;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[fe.bind(n),e=>(typeof e==`function`&&(e=h&&h.running&&h.sources.has(n)?e(n.tValue):e(n.value)),pe(n,e))]}function ee(e,t,n){M(N(e,t,!0,u))}function S(e,t,n){M(N(e,t,!1,u))}function C(e,t,n){l=_e;let r=N(e,t,!1,u),i=j&&le(j);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),v?v.push(r):M(r)}function w(e,t,n){n=n?Object.assign({},s,n):s;let r=N(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,M(r),fe.bind(r)}function te(e){return e&&typeof e==`object`&&`then`in e}function ne(t,n,r){let i,a,o;typeof n==`function`?(i=t,a=n,o=r||{}):(i=!0,a=t,o=n||{});let s=null,c=p,l=null,u=!1,d=!1,f=`initialValue`in o,_=typeof i==`function`&&w(i),v=new Set,[y,b]=(o.storage||x)(o.initialValue),[S,C]=x(void 0),[ne,re]=x(void 0,{equals:!1}),[ie,E]=x(f?`ready`:`unresolved`);m&&D(()=>{for(let e of v.keys())e.decrement();v.clear(),h&&s&&h.promises.delete(s),s=null}),e.context&&(l=e.getNextContextId(),o.ssrLoadFrom===`initial`?c=o.initialValue:e.load&&e.has(l)&&(c=e.load(l)));function O(e,t,n,r){return s===e&&(s=null,r!==void 0&&(f=!0),(e===c||t===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(r,{value:t})),c=p,h&&e&&u?(h.promises.delete(e),u=!1,F(()=>{h.running=!0,k(t,n)},!1)):k(t,n)),t}function k(e,t){F(()=>{t===void 0&&b(()=>e),E(t===void 0?f?`ready`:`unresolved`:`errored`),C(t);for(let e of v.keys())e.decrement();v.clear()},!1)}function oe(){let e=j&&le(j),t=y(),n=S();if(n!==void 0&&!s)throw n;return g&&!g.user&&e&&ee(()=>{ne(),s&&(e.resolved&&h&&u?h.promises.add(s):v.has(e)||(e.increment(),v.add(e)))}),t}function A(e=!0){if(e!==!1&&d)return;d=!1;let t=_?_():i;if(u=h&&h.running,t==null||t===!1){O(s,T(y));return}h&&s&&h.promises.delete(s);let n,r=c===p?T(()=>{try{return a(t,{value:y(),refetching:e})}catch(e){n=e}}):c;if(n!==void 0)O(s,void 0,R(n),t);else return te(r)?(s=r,`v`in r?(r.s===1?O(s,r.v,void 0,t):O(s,void 0,R(r.v),t),r):(d=!0,queueMicrotask(()=>d=!1),F(()=>{E(f?`refreshing`:`pending`),re()},!1),r.then(e=>O(r,e,void 0,t),e=>O(r,void 0,R(e),t)))):(O(s,r,void 0,t),r)}Object.defineProperties(oe,{state:{get:()=>ie()},error:{get:()=>S()},loading:{get(){let e=ie();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return oe();let e=S();if(e&&!s)throw e;return y()}}});let se=m;return _?ee(()=>(se=m,A(!1))):A(!1),[oe,{refetch:e=>ae(se,()=>A(e)),mutate:b}]}function re(e){return F(e,!1)}function T(e){if(g===null)return e();let t=g;g=null;try{return e()}finally{g=t}}function ie(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=T(()=>t(o,i,n));return i=o,s}}function E(e){C(()=>T(e))}function D(e){return m===null||(m.cleanups===null?m.cleanups=[e]:m.cleanups.push(e)),e}function O(){return g}function k(){return m}function ae(e,t){let n=m,r=g;m=e,g=null;try{return F(t,!0)}catch(e){z(e)}finally{m=n,g=r}}var[oe,A]=x(!1);function se(e){v.push.apply(v,e),e.length=0}function ce(e,t){let n=Symbol(`context`);return{id:n,Provider:Se(n),defaultValue:e}}function le(e){let t;return m&&m.context&&(t=m.context[e.id])!==void 0?t:e.defaultValue}function ue(e){let t=w(e),n=w(()=>xe(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var j;function de(){return j||=ce()}function fe(){let e=h&&h.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===u)M(this);else{let e=_;_=null,F(()=>I(this),!1),_=e}}if(g){let e=this.observers;if(!e||e[e.length-1]!==g){let t=e?e.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(t)):(g.sources=[this],g.sourceSlots=[t]),e?(e.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return e&&h.sources.has(this)?this.tValue:this.value}function pe(e,t,n){let r=h&&h.running&&h.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(h){let r=h.running;(r||!n&&h.sources.has(e))&&(h.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&F(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=h&&h.running;r&&h.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?_.push(n):v.push(n),n.observers&&ve(n)),r?n.tState=u:n.state=u)}if(_.length>1e6)throw _=[],Error()},!1)}return t}function M(e){if(!e.fn)return;L(e);let t=y;me(e,h&&h.running&&h.sources.has(e)?e.tValue:e.value,t),h&&!h.running&&h.sources.has(e)&&queueMicrotask(()=>{F(()=>{h&&(h.running=!0),g=m=e,me(e,e.tValue,t),g=m=null},!1)})}function me(e,t,n){let r,i=m,a=g;g=m=e;try{r=e.fn(t)}catch(t){return e.pure&&(h&&h.running?(e.tState=u,e.tOwned&&e.tOwned.forEach(L),e.tOwned=void 0):(e.state=u,e.owned&&e.owned.forEach(L),e.owned=null)),e.updatedAt=n+1,z(t)}finally{g=a,m=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?pe(e,r,!0):h&&h.running&&e.pure?(h.sources.has(e)||(e.value=r),h.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function N(e,t,n,r=u,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};return h&&h.running&&(a.state=0,a.tState=r),m===null||m!==f&&(h&&h.running&&m.pure?m.tOwned?m.tOwned.push(a):m.tOwned=[a]:m.owned?m.owned.push(a):m.owned=[a]),a}function P(e){let t=h&&h.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===d)return I(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<y);){if(t&&h.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(h.disposed.has(t))return}if((t?e.tState:e.state)===u)M(e);else if((t?e.tState:e.state)===d){let t=_;_=null,F(()=>I(e,n[0]),!1),_=t}}}function F(e,t){if(_)return e();let n=!1;t||(_=[]),v?n=!0:v=[],y++;try{let t=e();return he(n),t}catch(e){n||(v=null),_=null,z(e)}}function he(e){if(_&&=(ge(_),null),e)return;let t;if(h){if(!h.promises.size&&!h.queue.size){let e=h.sources,n=h.disposed;v.push.apply(v,h.effects),t=h.resolve;for(let e of v)`tState`in e&&(e.state=e.tState),delete e.tState;h=null,F(()=>{for(let e of n)L(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)L(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}A(!1)},!1)}else if(h.running){h.running=!1,h.effects.push.apply(h.effects,v),v=null,A(!0);return}}let n=v;v=null,n.length&&F(()=>l(n),!1),t&&t()}function ge(e){for(let t=0;t<e.length;t++)P(e[t])}function _e(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:P(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)P(t[r])}function I(e,t){let n=h&&h.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===u?i!==t&&(!i.updatedAt||i.updatedAt<y)&&P(i):e===d&&I(i,t)}}}function ve(e){let t=h&&h.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=d:r.state=d,r.pure?_.push(r):v.push(r),r.observers&&ve(r))}}function L(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)L(e.tOwned[t]);delete e.tOwned}if(h&&h.running&&e.pure)ye(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)L(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}h&&h.running?e.tState=0:e.state=0}function ye(e,t){if(t||(e.tState=0,h.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ye(e.owned[t])}function R(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function be(e,t,n){try{for(let n of t)n(e)}catch(e){z(e,n&&n.owner||null)}}function z(e,t=m){let n=c&&t&&t.context&&t.context[c],r=R(e);if(!n)throw r;v?v.push({fn(){be(r,n,t)},state:u}):be(r,n,t)}function xe(e){if(typeof e==`function`&&!e.length)return xe(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=xe(e[n]);if(Array.isArray(r)){if(r.length<32768)t.push.apply(t,r);else for(let e=0;e<r.length;e++)t.push(r[e])}else t.push(r)}return t}return e}function Se(e,t){return function(t){let n;return S(()=>n=T(()=>(m.context={...m.context,[e]:t.value},ue(()=>t.children))),void 0),n}}var Ce=Symbol(`fallback`);function B(e){for(let t=0;t<e.length;t++)e[t]()}function we(e,t,n={}){let r=[],i=[],a=[],s=0,c=t.length>1?[]:null;return D(()=>B(a)),()=>{let l=e()||[],u=l.length,d,f;return l[o],T(()=>{let e,t,o,m,h,g,_,v,y;if(u===0)s!==0&&(B(a),a=[],r=[],i=[],s=0,c&&=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),s=1);else if(s===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=b(p);s=u}else{for(o=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)o[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(o[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in o?(i[f]=o[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=b(p);i=i.slice(0,s=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=x(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function Te(e,t,n={}){let r=[],i=[],a=[],s=[],c=0,l;return D(()=>B(a)),()=>{let u=e()||[],d=u.length;return u[o],T(()=>{if(d===0)return c!==0&&(B(a),a=[],r=[],i=[],c=0,s=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),c=1),i;for(r[0]===Ce&&(a[0](),a=[],r=[],i=[],c=0),l=0;l<d;l++)l<r.length&&r[l]!==u[l]?s[l](()=>u[l]):l>=r.length&&(i[l]=b(f));for(;l<r.length;l++)a[l]();return c=s.length=a.length=d,r=u.slice(0),i=i.slice(0,c)});function f(e){a[l]=e;let[n,r]=x(u[l]);return s[l]=r,t(n,l)}}}function V(e,t){return T(()=>e(t||{}))}function H(){return!0}var Ee={get(e,t,n){return t===i?n:e.get(t)},has(e,t){return t===i||e.has(t)},set:H,deleteProperty:H,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:H,deleteProperty:H}},ownKeys(e){return e.keys()}};function De(e){return(e=typeof e==`function`?e():e)?e:{}}function Oe(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function ke(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&i in r,e[n]=typeof r==`function`?(t=!0,w(r)):r}if(a&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=De(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in De(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(De(e[n])));return[...new Set(t)]}},Ee);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Oe.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let o={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(o,t,n):o[t]=n?n.value:void 0}return o}function Ae(e,...t){let n=t.length;if(a&&i in e){let r=n>1?t.flat():t[0],i=new Set,a=t.map(t=>{let n=t.filter(e=>!i.has(e)&&(i.add(e),!0));return new Proxy({get(t){return n.includes(t)?e[t]:void 0},has(t){return n.includes(t)&&t in e},keys(){return n.filter(t=>t in e)}},Ee)});return a.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Ee)),a}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function je(t){let r,i,a=()=>{if(!i){let e=i=t();e.then(e=>{r=()=>e.default},()=>{i===e&&(i=void 0)})}return i},o=t=>{let i=e.context;if(i){let[t,o]=x();e.count||=0,e.count++,a().then(t=>{!e.done&&n(i),e.count--,o(()=>t.default),n()},t=>{!e.done&&n(i),e.count--,o(()=>()=>{throw t}),n()}),r=t}else if(!r){let[e]=ne(()=>a().then(e=>e.default));r=e,D(()=>r=void 0)}let o;return w(()=>(o=r?.())?T(()=>{if(!i||e.done)return o(t);let r=e.context;n(i);let a=o(t);return n(r),a}):``)};return o.preload=()=>a(),o}var Me=0;function Ne(){return e.context?e.getNextContextId():`cl-${Me++}`}var Pe=e=>`Stale read from <${e}>.`;function Fe(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(we(()=>e.each,e.children,t||void 0))}function Ie(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(Te(()=>e.each,e.children,t||void 0))}function U(e){let t=e.keyed,n=w(()=>e.when,void 0,void 0),r=t?n:w(n,void 0,{equals:(e,t)=>!e==!t});return w(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw Pe(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function Le(e){let t=ue(()=>e.children),n=w(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=w(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:w(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return w(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?T(()=>o(a.keyed?i():()=>{if(T(n)()?.[0]!==r)throw Pe(`Match`);return i()})):o},void 0,void 0)}function Re(e){return e}var ze=ce();function Be(t){let r=0,i,a,o,s,c,[l,u]=x(!1),d=de(),f={increment:()=>{++r===1&&u(!0)},decrement:()=>{--r===0&&u(!1)},inFallback:l,effects:[],resolved:!1},p=k();if(e.context&&e.load){let t=e.getContextId(),r=e.load(t);if(r&&(typeof r!=`object`||r.s!==1?o=r:e.gather(t)),o&&o!==`$$f`){let[r,i]=x(void 0,{equals:!1});s=r,o.then(()=>{if(e.done)return i();e.gather(t),n(a),i(),n()},e=>{c=e,i()})}}let m=le(ze);m&&(i=m.register(f.inFallback));let h;return D(()=>h&&h()),V(d.Provider,{value:f,get children(){return w(()=>{if(c)throw c;if(a=e.context,s){s(),s=void 0;return}a&&o===`$$f`&&n();let r=w(()=>t.children);return w(e=>{let s=f.inFallback(),{showContent:c=!0,showFallback:l=!0}=i?i():{};if((!s||o&&o!==`$$f`)&&c)return f.resolved=!0,h&&h(),h=a=o=void 0,se(f.effects),r();if(l)return h?e:b(e=>(h=e,a&&=(n({id:a.id+`F`,count:0}),void 0),t.fallback),p)})})}})}var Ve=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),He=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Ue=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),We=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Ge(e,t){let n=We[e];return typeof n==`object`?n[t]?n.$:void 0:n}var Ke=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),qe=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),Je={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},Ye=e=>w(()=>e());function Xe(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;)if(t[o]===n[s])o++,s++;else{for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var Ze=`_$DX_DELEGATE`;function Qe(e,t,n,r={}){let i;return b(r=>{i=r,t===document?e():Y(t,e(),!n&&t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function W(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>T(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function G(e,t=window.document){let n=t[Ze]||(t[Ze]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,dt))}}function K(e,t,n){X(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function $e(e,t,n,r){X(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function et(e,t,n){X(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function q(e,t){X(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function tt(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function nt(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(lt(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(lt(e,i,!0),n[i]=o)}return n}function rt(e,t,n){if(!t)return n?K(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function it(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function at(e,t={},n,r){let i={};return r||S(()=>i.children=Z(e,t.children,i.children)),S(()=>typeof t.ref==`function`&&J(t.ref,e)),S(()=>ot(e,t,n,!0,i,!0)),i}function J(e,t,n){return T(()=>e(t,n))}function Y(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Z(e,t,r,n);S(r=>Z(e,t(),r,n),r)}function ot(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=ut(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||Z(e,t.children);continue}let s=t[o];i[o]=ut(e,o,s,i[o],n,a,t)}}function st(t){let n,r;return!X()||!(n=e.registry.get(r=mt()))?t():(e.completed&&e.completed.add(n),e.registry.delete(r),n)}function X(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function ct(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function lt(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function ut(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return rt(e,n,r);if(t===`classList`)return nt(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Ke.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(tt(e,i,n,a),a&&G([i]))}else if(t.slice(0,5)===`attr:`)K(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)et(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=He.has(t))||!i&&((u=Ge(t,e.tagName))||(c=Ve.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(X(e))return n;t===`class`||t===`className`?q(e,n):s&&!c&&!l?e[ct(t)]=n:(t===`value`||t===`defaultValue`)&&(e.nodeName===`INPUT`||e.nodeName===`TEXTAREA`)?e[u||t]=n??``:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Je[t.split(`:`)[0]];r?$e(e,r,t,n):K(e,Ue[t]||t,n)}return n}function dt(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0);try{if(t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}finally{t=n=null}}function Z(e,t,n,r,i){let a=X(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Q(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Q(e,n,r)}else if(o===`function`)return S(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Z(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(ft(o,t,n,i))return S(()=>n=Z(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Q(e,n,r),s)return n}else c?n.length===0?pt(e,o,r):Xe(e,n,o):(n&&Q(e),pt(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Q(e,n,r,t);Q(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function ft(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=ft(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=ft(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function pt(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Q(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function mt(){return e.getNextContextId()}var ht=`http://www.w3.org/2000/svg`;function gt(e,t=!1,n=void 0){return t?document.createElementNS(ht,e):document.createElement(e,{is:n})}function _t(t){let{useShadow:n}=t,r=document.createTextNode(``),i=()=>t.mount||document.body,a=k(),o,s=!!e.context;return C(()=>{s&&(k().user=s=!1),o||=ae(a,()=>w(()=>t.children));let e=i();if(e instanceof HTMLHeadElement){let[t,n]=x(!1);b(n=>Y(e,()=>t()?n():o(),null)),D(()=>n(!0))}else{let i=gt(t.isSVG?`g`:`div`,t.isSVG),a=n&&i.attachShadow?i.attachShadow({mode:`open`}):i;Object.defineProperty(i,"_$host",{get(){return r.parentNode},configurable:!0}),Y(a,o),e.appendChild(i),t.ref&&t.ref(i),D(()=>e.contains(i)&&e.removeChild(i))}},void 0,{render:!s}),r}function vt(t,n){let r=w(t);return w(()=>{let t=r();switch(typeof t){case`function`:return T(()=>t(n));case`string`:let r=qe.has(t),i=e.context?st():gt(t,r,T(()=>n.is));return at(i,n,r),i}})}function yt(e){let[,t]=Ae(e,[`component`]);return vt(()=>e.component,t)}var bt=class extends Error{status;code;field;hint;details;constructor(e,t){super(t),this.status=e}},xt=class extends Error{cause;name=`NetworkError`;constructor(e){super(`Can't reach the hub: the connection dropped. Check your network and try again.`),this.cause=e}},St;function Ct(e){St=e}async function wt(e,{method:t=`GET`,json:n,body:r,headers:i={},signal:a,keepalive:o}={}){let s={method:t,credentials:`same-origin`,headers:{...i},signal:a,keepalive:o};n===void 0?r!==void 0&&(s.body=r):(s.headers[`content-type`]=`application/json`,s.body=JSON.stringify(n));let c;try{c=await fetch(e,s)}catch(e){throw e instanceof TypeError?new xt(e):e}if(!c.ok){let e=await c.json().catch(()=>({}));c.status===401&&St?.();let t=e.error&&typeof e.error==`object`?e.error:e,n=typeof e.error==`string`?e.error:typeof t.message==`string`?t.message:``,r=new bt(c.status,n||`HTTP ${c.status}`);throw typeof t.field==`string`&&(r.field=t.field),typeof t.code==`string`&&(r.code=t.code),typeof t.hint==`string`&&(r.hint=t.hint),e.error&&typeof e.error==`object`&&(r.details=t),r}return c}var Tt=async e=>(await wt(e)).json(),Et=encodeURIComponent,Dt=e=>`/api/sessions/${Et(e)}`,Ot=e=>e instanceof Error?e.message:String(e),kt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),At=/^[A-Za-z0-9_.:@/+~-]{1,300}$/,jt=/[\p{Cc}\p{Cf}\u2028\u2029]/u,Mt={workspace:`ws`,binding:`wsb`,member:`wsm`,assignment:`asg`,supervision:`sup`,checkpoint:`chk`,sideChat:`chat`,profile:`prof`,artifact:`art`,revision:`rev`,blob:`blob`,aiJob:`job`,team:`team`,staffing:`stf`,intake:`itk`},Nt=/^[A-Za-z0-9]{16,32}$/;function Pt(e,t){if(typeof t!=`string`)return!1;let n=`${Mt[e]}_`;return t.startsWith(n)&&Nt.test(t.slice(n.length))}var Ft=/^[a-z0-9-]{2,40}$/,It=e=>typeof e==`string`&&Ft.test(e),Lt=(e,t=120)=>typeof e==`string`&&e.trim().length>0&&e.length<=t&&!jt.test(e),Rt=4e3,zt=/[\u0000-\u0009\u000b-\u001f\u007f\u2028\u2029\u200b-\u200f\u202a-\u202e\u2066-\u2069]/,Bt=(e,t=Rt)=>typeof e==`string`&&e.length<=t&&!zt.test(e);function Vt(e){if(e!==void 0){if(!Array.isArray(e)||e.length>32)return`tags must be a list of at most 32`;if(!e.every(It))return`each tag must be 2–40 lowercase letters, digits or dashes`;if(new Set(e).size!==e.length)return`tags must be unique`}}function Ht(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))return`metadata must be an object`;let t=Object.entries(e);if(t.length>32)return`metadata has more than 32 keys`;for(let[e,n]of t){if(!It(e))return`metadata key ${JSON.stringify(String(e).slice(0,50))} must be a slug`;if(!Lt(n,200))return`metadata.${e} must be 1–200 characters of text`}}var $=e=>e.signedIn,Ut=[{id:`sessions`,label:`All sessions`,icon:`home`,route:`/`,order:10,available:e=>$(e)?!0:`hidden`},{id:`concierge`,label:`Concierge`,icon:`spark`,route:`/concierge`,order:15,available:e=>$(e)&&e.concierge!==void 0&&e.concierge!==`disabled`?!0:`hidden`},{id:`artifacts`,label:`Artifacts`,icon:`file`,route:`/artifacts`,order:20,available:e=>$(e)?!0:`hidden`},{id:`teams`,label:`Teams`,icon:`team`,route:`/teams`,order:25,available:e=>$(e)?!0:`hidden`},{id:`watchtower`,label:`Watchtower`,icon:`watchtower`,route:`/watchtower`,order:30,available:e=>$(e)?!0:`hidden`},{id:`profiles`,label:`Agent profiles`,icon:`settings`,route:`/profiles`,order:40,available:e=>$(e)?!0:`hidden`}],Wt={"/birds-eye":`/watchtower`};function Gt(e,t=``,n=``){for(let[r,i]of Object.entries(Wt))if(e===r||e.startsWith(`${r}/`))return`${i}${e.slice(r.length)}${t}${n}`}function Kt(e,t){try{return e.available(t)}catch{return`hidden`}}function qt(e,t=Ut){return[...t].sort((e,t)=>e.order-t.order).flatMap(t=>{let n=Kt(t,e);return n===`hidden`?[]:[{dest:t,enabled:n===!0}]})}var Jt=(e,t)=>Kt(e,t)===!0?`ok`:`unavailable`;function Yt(e,t=Ut){for(let n of t)if(n.route!==`/`&&(e===n.route||e.startsWith(`${n.route}/`)))try{return{dest:n,rest:e.slice(n.route.length).split(`/`).filter(Boolean).map(decodeURIComponent)}}catch{return}}function Xt(e,t=Ut){return e===`/`?t.find(e=>e.route===`/`)?.id:Yt(e,t)?.dest.id}function Zt(e){return e.supported?e.permission===`denied`?{state:`blocked`,message:`Notifications are blocked for this site. Allow them in the browser's site settings, then reload.`,action:`none`,warn:!0}:e.permission==="default"?{state:`off`,message:`Notifications are off on this device.`,action:`enable`,warn:!0}:!e.worker||!e.endpoint||!e.hubSubscribed?{state:`repair`,message:`Allowed, but this device is not subscribed on this hub, so nothing will arrive (this happens after the hub moves to a new address). Enable again to fix it.`,action:`enable`,warn:!0}:{state:`on`,message:`On for this device.`,action:`disable`,warn:!1}:{state:`unsupported`,message:`This browser can't get notifications here. On iPhone, add the app to the Home Screen first (iOS 16.4+); everywhere else the hub must be on https.`,action:`none`,warn:!0}}var Qt=e=>e.supported&&e.permission===`granted`&&(!e.endpoint||!e.hubSubscribed);function $t(e){if(e.subscriptions===0)return{ok:!1,text:`This device is not subscribed; enable notifications first`};if(e.sent>0)return{ok:!0,text:e.sent===1?`Test notification sent to this device`:`Test notification sent (${e.sent} subscriptions)`};let t=e.failed[0];return t?{ok:!1,text:`Test failed: ${t.host} ${t.status===void 0?`did not answer`:`answered ${t.status}`}`}:{ok:!1,text:`Test failed`}}var en=[1,2,5,10,15,30,60],tn=[{title:`Needs you`,kinds:[{key:`question`,label:`Question`,description:`A session or subagent asks you something.`},{key:`permission`,label:`Needs permission`,description:`A tool call waits for your OK (answer from the notification).`},{key:`decision`,label:`Decision`,description:`A session asks you to decide (hub ask @me), with options and a recommendation.`},{key:`message`,label:`Message`,description:`Agent messaging needs you: a message to you, an unanswered ask, or sessions looping.`},{key:`concierge`,label:`Concierge`,description:`Your Concierge needs you or has news: its questions, permissions, decisions, messages and spoken replies.`}]},{title:`Session`,kinds:[{key:`done`,label:`All done`,description:`The session and all its subagents and scripts finished; nothing waits on you. Once per run.`},{key:`failed`,label:`Failed`,description:`The session's run failed (provider or tool error), with the reason.`},{key:`providerError`,label:`Model provider error`,description:`Quota, budget, auth or model-routing errors of the session or a subagent; once per run.`},{key:`turn`,label:`Turn finished`,description:`Every reply of the main session, also the short ones between subagents. Noisy.`},{key:`stopped`,label:`Stopped`,description:`A run stopped without you asking (OpenCode shut down, inactivity).`},{key:`retry`,label:`Retrying`,description:`The provider failed and OpenCode is retrying the request.`}]},{title:`Subagents`,kinds:[{key:`subagentDone`,label:`Subagent finished`,description:`Each subagent that finishes, by name.`},{key:`subagentFailed`,label:`Subagent failed`,description:`Each subagent that fails, with the reason.`}]},{title:`Scripts and tools`,kinds:[{key:`jobDone`,label:`Script finished`,description:`A background shell or terminal exited 0.`},{key:`jobFailed`,label:`Script failed`,description:`A background shell or terminal exited non-zero, was killed or timed out.`},{key:`longTool`,label:`Long tool finished`,description:`A tool call that ran 30 seconds or more ended.`}]},{title:`Voice`,kinds:[{key:`say`,label:`Spoken reply`,description:`Voice mode replies while no device shows the session.`},{key:`handoff`,label:`Hand-off`,description:`A session sent to this device from the terminal (ignores quiet hours).`}]},{title:`Activity digest`,kinds:[{key:`activity`,label:`Activity`,description:`One quiet, self-replacing summary per session: subagents, long tools, scripts, idle.`}]}],nn=tn.flatMap(e=>e.kinds);function rn(e){let t=nn.filter(t=>e[t.key]).map(e=>e.label);return t.length?`You'll get: ${t.join(`, `)}.`:`You'll get no notifications on this device.`}function an(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}}var on=[{id:`general`,label:`General`,description:`Account, theme, text size and the Hub app`},{id:`notifications`,label:`Notifications`,description:`This device's notifications, what to notify about, quiet hours`},{id:`voice`,label:`Voice & speech`,description:`Voice mode, mic sensitivity, speech-to-text and text-to-speech`},{id:`machines`,label:`Machines & devices`,description:`Connected machines, approvals, signed-in browsers and apps`},{id:`agents`,label:`Agents & access`,description:`App tokens, acting switches, grants and agent activity`},{id:`concierge`,label:`Concierge`,description:`Your hub-managed assistant: machine, directory, model and its grant`},{id:`teams`,label:`Teams`,description:`Team isolation: what team members see`},{id:`admin`,label:`Admin`,description:`Users, all machines, approvals and the audit log`,admin:!0}],sn=e=>on.filter(t=>e||!t.admin);function cn(e){if(e!==`/settings`&&!e.startsWith(`/settings/`))return;let t=e.slice(10).split(`/`)[0]??``;if(!t)return{};try{return{section:decodeURIComponent(t)}}catch{return{section:t}}}function ln(e,t){return e===void 0?t.phone?`list`:`general`:sn(t.admin).find(t=>t.id===e)?.id}var un={account:`general`,appearance:`general`,notifications:`notifications`,voice:`voice`,speech:`voice`,machines:`machines`,devices:`machines`,agents:`agents`,admin:`admin`};function dn(e){let t=e.replace(/^#/,``);if(!t)return;let n=un[t];if(n)return`/settings/${n}#${t}`;if(on.some(e=>e.id===t))return`/settings/${t}`}var fn=[{id:`account`,section:`general`,label:`Account`,description:`Who you are signed in as; sign out of this device`,keywords:`sign out logout user email`},{id:`set-theme`,section:`general`,label:`Color theme`,description:`Light, dark or the system's theme`,keywords:`appearance light dark system mode`},{id:`set-text-size`,section:`general`,label:`Text size`,description:`How big text is on this device`,keywords:`appearance font scale zoom`},{id:`add-app`,section:`general`,label:`Add the Hub app`,description:`Link the Hub app on a phone or tablet with a QR code`,keywords:`mobile android ios install pair link`},{id:`notifications`,section:`notifications`,label:`Notifications on this device`,description:`Enable or turn off push notifications here; permission and subscription status`,keywords:`push enable subscribe permission service worker`},{id:`notify-test`,section:`notifications`,label:`Send test notification`,description:`Check that notifications reach this device`,keywords:`push try`},{id:`quiet-hours`,section:`notifications`,label:`Quiet hours`,description:`No notifications at night (hand-offs still come through)`,keywords:`do not disturb night sleep time`},{id:`set-voice-speed`,section:`voice`,label:`Voice speed`,description:`How fast replies are spoken`,keywords:`rate tts`},{id:`set-sensitivity`,section:`voice`,label:`Mic sensitivity`,description:`How sure Voice mode must be that you are speaking to it`,keywords:`microphone noise vad`},{id:`set-cues`,section:`voice`,label:`Progress cues`,description:`Tones and short acknowledgements while the agent works`,keywords:`sounds acknowledgement`},{id:`set-background`,section:`voice`,label:`Keep listening when the screen is off`,description:`Lock-screen controls and listening with the screen off`,keywords:`background lock screen`},{id:`speech`,section:`voice`,label:`Speech`,description:`Speech-to-text and text-to-speech provider, model, voice and API keys`,keywords:`stt tts transcription openrouter openai key`},{id:`machines`,section:`machines`,label:`Machines`,description:`Computers running OpenCode connected to this hub; approve or revoke them`,keywords:`computer approve enrollment revoke opencode`},{id:`devices`,section:`machines`,label:`Devices`,description:`Browsers and the Hub app signed in to your account; revoke them`,keywords:`browser phone sessions revoke sign out`},{id:`agents`,section:`agents`,label:`Acting switch`,description:`Whether sessions and apps may act for you at all`,keywords:`pause kill switch acting`},{id:`app-tokens`,section:`agents`,label:`App tokens`,description:`Tokens for MCP gateways, CLIs and other apps, with their scopes`,keywords:`api key token scopes mcp cli`},{id:`grants`,section:`agents`,label:`Grants`,description:`What sessions and apps may approve, deny, answer, prompt or stop for you`,keywords:`permissions delegate allow`},{id:`agent-activity`,section:`agents`,label:`Agent activity`,description:`What agents did for you (the agent audit)`,keywords:`audit log history`},{id:`concierge`,section:`concierge`,label:`Concierge`,description:`Turn the Concierge on or off, pick its machine and directory, restart it`,keywords:`assistant butler watch sessions`},{id:`concierge-grant`,section:`concierge`,label:`Concierge grant`,description:`What the Concierge may do for you without asking; renew or remove it`,keywords:`permissions approve deny preset`},{id:`team-isolation`,section:`teams`,label:`Team isolation`,description:`Team members see only their teams' sessions, not your other sessions`,keywords:`teams privacy hide members`}],pn=[{id:`admin`,section:`admin`,label:`Users`,description:`Everyone on this hub: roles, disable, remove`,keywords:`admin accounts people`},{id:`admin-machines`,section:`admin`,label:`All machines`,description:`Every machine connected to this hub, by owner`,keywords:`admin revoke`},{id:`admin-audit`,section:`admin`,label:`Audit log`,description:`Who changed what on this hub`,keywords:`admin history`}],mn=(e,t)=>({id:`pref-${e.key}`,section:`notifications`,label:e.label,description:e.description,keywords:`notify ${t}`});function hn(e){return[...fn,...tn.flatMap(e=>e.kinds.map(t=>mn(t,e.title))),...e?pn:[]]}var gn=e=>on.find(t=>t.id===e)?.label??e;function _n(e,t){let n=e.trim().toLowerCase();if(!n)return[];let r=n.split(/\s+/),i=e=>{let t=e.label.toLowerCase();return t.startsWith(n)?0:t.includes(n)?1:r.every(e=>t.includes(e))?2:3};return t.filter(e=>{let t=`${e.label} ${e.description} ${e.keywords??``} ${gn(e.section)}`.toLowerCase();return r.every(e=>t.includes(e))}).map((e,t)=>({e,i:t,r:i(e)})).sort((e,t)=>e.r-t.r||e.i-t.i).map(e=>e.e)}function vn(e,t){let n=e.filter(e=>e.key in t);if(!n.length)return``;let r=n.filter(e=>t[e.key]);return r.length===n.length?`All on`:r.length?`${r.length} of ${n.length} on: ${r.map(e=>e.label).join(`, `)}`:`All off`}var yn=e=>e&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)?e:`/`;function bn(e){let t=e.pathname,n=e.searchParams;if(t===`/pair`)return{name:`pair`,next:yn(n.get(`next`)),error:n.get(`error`)??``};if(t===`/approve`)return{name:`approve`,code:n.get(`code`)??``};if(t===`/new`)return{name:`new`,machine:n.get(`machine`)??void 0,dir:n.get(`dir`)??void 0,key:n.get(`key`)??void 0};if(t===`/panes`)return{name:`panes`};if(t===`/concierge`||t.startsWith(`/concierge/`))return{name:`concierge`};let r=cn(t);if(r)return{name:`settings`,...r};let i=Yt(t);if(i)return{name:`feature`,id:i.dest.id,rest:i.rest};let a=/^\/s\/([^/]+)$/.exec(t);if(a)try{return{name:`session`,id:decodeURIComponent(a[1])}}catch{return{name:`home`}}return{name:`home`}}function xn(){let e=(location.pathname===`/settings`?dn(location.hash):void 0)??Gt(location.pathname,location.search,location.hash);return e&&history.replaceState(history.state,``,e),new URL(location.href)}var[Sn,Cn]=x(xn()),wn=Sn,Tn=()=>bn(Sn()),En=0;function Dn(e,{replace:t=!1}={}){let n=new URL(e,location.origin);n.pathname+n.search+n.hash!==location.pathname+location.search+location.hash&&(history[t?`replaceState`:`pushState`]({},``,n.pathname+n.search+n.hash),t||En++),Cn(xn())}function On(e=`/`){En>0?history.back():Dn(e)}window.addEventListener(`popstate`,()=>{En=Math.max(0,En-1),Cn(xn())}),document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[href]`);if(!t||t.target||t.hasAttribute(`download`)||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n=t.getAttribute(`href`)??``;!n.startsWith(`/`)||n.startsWith(`//`)||n.startsWith(`/auth/`)||n.startsWith(`/api/`)||(e.preventDefault(),Dn(n))});var kn=()=>new Set;function An(e){kn=e}var jn=e=>kn().has(e),Mn=e=>kn().has(e)?`/concierge`:`/s/${encodeURIComponent(e)}`,[Nn,Pn]=x(),Fn=Nn,In=0,Ln;function Rn(e,t=``,n){let r=++In;Pn({id:r,text:e,kind:t,action:n}),clearTimeout(Ln),Ln=setTimeout(()=>Nn()?.id===r&&Pn(void 0),n||t?8e3:4e3)}var zn=()=>Pn(void 0);function Bn(e){let t=[];return{ask(n){return new Promise(r=>{t.push({request:n,resolve:r}),t.length===1&&e(n)})},current:()=>t[0]?.request,settle(n){let r=t.shift();r&&(r.resolve(n),e(t[0]?.request))}}}function Vn(e){let t=e.trim(),n=t.indexOf(`
|
|
1
|
+
var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-proxy`),a=typeof Proxy==`function`,o=Symbol(`solid-track`),s={equals:r},c=null,l=ge,u=1,d=2,f={owned:null,cleanups:null,context:null,owner:null},p={},m=null,h=null,g=null,_=null,v=null,y=0;function b(e,t){let n=g,r=m,i=e.length===0,a=t===void 0?r:t,o=i?f:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>T(()=>L(o)));m=o,g=null;try{return F(s,!0)}finally{g=n,m=r}}function x(e,t){t=t?Object.assign({},s,t):s;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[fe.bind(n),e=>(typeof e==`function`&&(e=h&&h.running&&h.sources.has(n)?e(n.tValue):e(n.value)),pe(n,e))]}function ee(e,t,n){M(N(e,t,!0,u))}function S(e,t,n){M(N(e,t,!1,u))}function C(e,t,n){l=_e;let r=N(e,t,!1,u),i=j&&le(j);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),v?v.push(r):M(r)}function w(e,t,n){n=n?Object.assign({},s,n):s;let r=N(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,M(r),fe.bind(r)}function te(e){return e&&typeof e==`object`&&`then`in e}function ne(t,n,r){let i,a,o;typeof n==`function`?(i=t,a=n,o=r||{}):(i=!0,a=t,o=n||{});let s=null,c=p,l=null,u=!1,d=!1,f=`initialValue`in o,_=typeof i==`function`&&w(i),v=new Set,[y,b]=(o.storage||x)(o.initialValue),[S,C]=x(void 0),[ne,re]=x(void 0,{equals:!1}),[ie,E]=x(f?`ready`:`unresolved`);m&&D(()=>{for(let e of v.keys())e.decrement();v.clear(),h&&s&&h.promises.delete(s),s=null}),e.context&&(l=e.getNextContextId(),o.ssrLoadFrom===`initial`?c=o.initialValue:e.load&&e.has(l)&&(c=e.load(l)));function O(e,t,n,r){return s===e&&(s=null,r!==void 0&&(f=!0),(e===c||t===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(r,{value:t})),c=p,h&&e&&u?(h.promises.delete(e),u=!1,F(()=>{h.running=!0,k(t,n)},!1)):k(t,n)),t}function k(e,t){F(()=>{t===void 0&&b(()=>e),E(t===void 0?f?`ready`:`unresolved`:`errored`),C(t);for(let e of v.keys())e.decrement();v.clear()},!1)}function oe(){let e=j&&le(j),t=y(),n=S();if(n!==void 0&&!s)throw n;return g&&!g.user&&e&&ee(()=>{ne(),s&&(e.resolved&&h&&u?h.promises.add(s):v.has(e)||(e.increment(),v.add(e)))}),t}function A(e=!0){if(e!==!1&&d)return;d=!1;let t=_?_():i;if(u=h&&h.running,t==null||t===!1){O(s,T(y));return}h&&s&&h.promises.delete(s);let n,r=c===p?T(()=>{try{return a(t,{value:y(),refetching:e})}catch(e){n=e}}):c;if(n!==void 0)O(s,void 0,R(n),t);else return te(r)?(s=r,`v`in r?(r.s===1?O(s,r.v,void 0,t):O(s,void 0,R(r.v),t),r):(d=!0,queueMicrotask(()=>d=!1),F(()=>{E(f?`refreshing`:`pending`),re()},!1),r.then(e=>O(r,e,void 0,t),e=>O(r,void 0,R(e),t)))):(O(s,r,void 0,t),r)}Object.defineProperties(oe,{state:{get:()=>ie()},error:{get:()=>S()},loading:{get(){let e=ie();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return oe();let e=S();if(e&&!s)throw e;return y()}}});let se=m;return _?ee(()=>(se=m,A(!1))):A(!1),[oe,{refetch:e=>ae(se,()=>A(e)),mutate:b}]}function re(e){return F(e,!1)}function T(e){if(g===null)return e();let t=g;g=null;try{return e()}finally{g=t}}function ie(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=T(()=>t(o,i,n));return i=o,s}}function E(e){C(()=>T(e))}function D(e){return m===null||(m.cleanups===null?m.cleanups=[e]:m.cleanups.push(e)),e}function O(){return g}function k(){return m}function ae(e,t){let n=m,r=g;m=e,g=null;try{return F(t,!0)}catch(e){z(e)}finally{m=n,g=r}}var[oe,A]=x(!1);function se(e){v.push.apply(v,e),e.length=0}function ce(e,t){let n=Symbol(`context`);return{id:n,Provider:Se(n),defaultValue:e}}function le(e){let t;return m&&m.context&&(t=m.context[e.id])!==void 0?t:e.defaultValue}function ue(e){let t=w(e),n=w(()=>xe(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var j;function de(){return j||=ce()}function fe(){let e=h&&h.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===u)M(this);else{let e=_;_=null,F(()=>I(this),!1),_=e}}if(g){let e=this.observers;if(!e||e[e.length-1]!==g){let t=e?e.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(t)):(g.sources=[this],g.sourceSlots=[t]),e?(e.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return e&&h.sources.has(this)?this.tValue:this.value}function pe(e,t,n){let r=h&&h.running&&h.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(h){let r=h.running;(r||!n&&h.sources.has(e))&&(h.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&F(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=h&&h.running;r&&h.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?_.push(n):v.push(n),n.observers&&ve(n)),r?n.tState=u:n.state=u)}if(_.length>1e6)throw _=[],Error()},!1)}return t}function M(e){if(!e.fn)return;L(e);let t=y;me(e,h&&h.running&&h.sources.has(e)?e.tValue:e.value,t),h&&!h.running&&h.sources.has(e)&&queueMicrotask(()=>{F(()=>{h&&(h.running=!0),g=m=e,me(e,e.tValue,t),g=m=null},!1)})}function me(e,t,n){let r,i=m,a=g;g=m=e;try{r=e.fn(t)}catch(t){return e.pure&&(h&&h.running?(e.tState=u,e.tOwned&&e.tOwned.forEach(L),e.tOwned=void 0):(e.state=u,e.owned&&e.owned.forEach(L),e.owned=null)),e.updatedAt=n+1,z(t)}finally{g=a,m=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?pe(e,r,!0):h&&h.running&&e.pure?(h.sources.has(e)||(e.value=r),h.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function N(e,t,n,r=u,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};return h&&h.running&&(a.state=0,a.tState=r),m===null||m!==f&&(h&&h.running&&m.pure?m.tOwned?m.tOwned.push(a):m.tOwned=[a]:m.owned?m.owned.push(a):m.owned=[a]),a}function P(e){let t=h&&h.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===d)return I(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<y);){if(t&&h.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(h.disposed.has(t))return}if((t?e.tState:e.state)===u)M(e);else if((t?e.tState:e.state)===d){let t=_;_=null,F(()=>I(e,n[0]),!1),_=t}}}function F(e,t){if(_)return e();let n=!1;t||(_=[]),v?n=!0:v=[],y++;try{let t=e();return he(n),t}catch(e){n||(v=null),_=null,z(e)}}function he(e){if(_&&=(ge(_),null),e)return;let t;if(h){if(!h.promises.size&&!h.queue.size){let e=h.sources,n=h.disposed;v.push.apply(v,h.effects),t=h.resolve;for(let e of v)`tState`in e&&(e.state=e.tState),delete e.tState;h=null,F(()=>{for(let e of n)L(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)L(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}A(!1)},!1)}else if(h.running){h.running=!1,h.effects.push.apply(h.effects,v),v=null,A(!0);return}}let n=v;v=null,n.length&&F(()=>l(n),!1),t&&t()}function ge(e){for(let t=0;t<e.length;t++)P(e[t])}function _e(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:P(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)P(t[r])}function I(e,t){let n=h&&h.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===u?i!==t&&(!i.updatedAt||i.updatedAt<y)&&P(i):e===d&&I(i,t)}}}function ve(e){let t=h&&h.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=d:r.state=d,r.pure?_.push(r):v.push(r),r.observers&&ve(r))}}function L(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)L(e.tOwned[t]);delete e.tOwned}if(h&&h.running&&e.pure)ye(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)L(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}h&&h.running?e.tState=0:e.state=0}function ye(e,t){if(t||(e.tState=0,h.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ye(e.owned[t])}function R(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function be(e,t,n){try{for(let n of t)n(e)}catch(e){z(e,n&&n.owner||null)}}function z(e,t=m){let n=c&&t&&t.context&&t.context[c],r=R(e);if(!n)throw r;v?v.push({fn(){be(r,n,t)},state:u}):be(r,n,t)}function xe(e){if(typeof e==`function`&&!e.length)return xe(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=xe(e[n]);if(Array.isArray(r)){if(r.length<32768)t.push.apply(t,r);else for(let e=0;e<r.length;e++)t.push(r[e])}else t.push(r)}return t}return e}function Se(e,t){return function(t){let n;return S(()=>n=T(()=>(m.context={...m.context,[e]:t.value},ue(()=>t.children))),void 0),n}}var Ce=Symbol(`fallback`);function B(e){for(let t=0;t<e.length;t++)e[t]()}function we(e,t,n={}){let r=[],i=[],a=[],s=0,c=t.length>1?[]:null;return D(()=>B(a)),()=>{let l=e()||[],u=l.length,d,f;return l[o],T(()=>{let e,t,o,m,h,g,_,v,y;if(u===0)s!==0&&(B(a),a=[],r=[],i=[],s=0,c&&=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),s=1);else if(s===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=b(p);s=u}else{for(o=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)o[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(o[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in o?(i[f]=o[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=b(p);i=i.slice(0,s=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=x(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function Te(e,t,n={}){let r=[],i=[],a=[],s=[],c=0,l;return D(()=>B(a)),()=>{let u=e()||[],d=u.length;return u[o],T(()=>{if(d===0)return c!==0&&(B(a),a=[],r=[],i=[],c=0,s=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),c=1),i;for(r[0]===Ce&&(a[0](),a=[],r=[],i=[],c=0),l=0;l<d;l++)l<r.length&&r[l]!==u[l]?s[l](()=>u[l]):l>=r.length&&(i[l]=b(f));for(;l<r.length;l++)a[l]();return c=s.length=a.length=d,r=u.slice(0),i=i.slice(0,c)});function f(e){a[l]=e;let[n,r]=x(u[l]);return s[l]=r,t(n,l)}}}function V(e,t){return T(()=>e(t||{}))}function H(){return!0}var Ee={get(e,t,n){return t===i?n:e.get(t)},has(e,t){return t===i||e.has(t)},set:H,deleteProperty:H,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:H,deleteProperty:H}},ownKeys(e){return e.keys()}};function De(e){return(e=typeof e==`function`?e():e)?e:{}}function Oe(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function ke(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&i in r,e[n]=typeof r==`function`?(t=!0,w(r)):r}if(a&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=De(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in De(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(De(e[n])));return[...new Set(t)]}},Ee);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Oe.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let o={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(o,t,n):o[t]=n?n.value:void 0}return o}function Ae(e,...t){let n=t.length;if(a&&i in e){let r=n>1?t.flat():t[0],i=new Set,a=t.map(t=>{let n=t.filter(e=>!i.has(e)&&(i.add(e),!0));return new Proxy({get(t){return n.includes(t)?e[t]:void 0},has(t){return n.includes(t)&&t in e},keys(){return n.filter(t=>t in e)}},Ee)});return a.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Ee)),a}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function je(t){let r,i,a=()=>{if(!i){let e=i=t();e.then(e=>{r=()=>e.default},()=>{i===e&&(i=void 0)})}return i},o=t=>{let i=e.context;if(i){let[t,o]=x();e.count||=0,e.count++,a().then(t=>{!e.done&&n(i),e.count--,o(()=>t.default),n()},t=>{!e.done&&n(i),e.count--,o(()=>()=>{throw t}),n()}),r=t}else if(!r){let[e]=ne(()=>a().then(e=>e.default));r=e,D(()=>r=void 0)}let o;return w(()=>(o=r?.())?T(()=>{if(!i||e.done)return o(t);let r=e.context;n(i);let a=o(t);return n(r),a}):``)};return o.preload=()=>a(),o}var Me=0;function Ne(){return e.context?e.getNextContextId():`cl-${Me++}`}var Pe=e=>`Stale read from <${e}>.`;function Fe(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(we(()=>e.each,e.children,t||void 0))}function Ie(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(Te(()=>e.each,e.children,t||void 0))}function U(e){let t=e.keyed,n=w(()=>e.when,void 0,void 0),r=t?n:w(n,void 0,{equals:(e,t)=>!e==!t});return w(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw Pe(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function Le(e){let t=ue(()=>e.children),n=w(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=w(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:w(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return w(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?T(()=>o(a.keyed?i():()=>{if(T(n)()?.[0]!==r)throw Pe(`Match`);return i()})):o},void 0,void 0)}function Re(e){return e}var ze=ce();function Be(t){let r=0,i,a,o,s,c,[l,u]=x(!1),d=de(),f={increment:()=>{++r===1&&u(!0)},decrement:()=>{--r===0&&u(!1)},inFallback:l,effects:[],resolved:!1},p=k();if(e.context&&e.load){let t=e.getContextId(),r=e.load(t);if(r&&(typeof r!=`object`||r.s!==1?o=r:e.gather(t)),o&&o!==`$$f`){let[r,i]=x(void 0,{equals:!1});s=r,o.then(()=>{if(e.done)return i();e.gather(t),n(a),i(),n()},e=>{c=e,i()})}}let m=le(ze);m&&(i=m.register(f.inFallback));let h;return D(()=>h&&h()),V(d.Provider,{value:f,get children(){return w(()=>{if(c)throw c;if(a=e.context,s){s(),s=void 0;return}a&&o===`$$f`&&n();let r=w(()=>t.children);return w(e=>{let s=f.inFallback(),{showContent:c=!0,showFallback:l=!0}=i?i():{};if((!s||o&&o!==`$$f`)&&c)return f.resolved=!0,h&&h(),h=a=o=void 0,se(f.effects),r();if(l)return h?e:b(e=>(h=e,a&&=(n({id:a.id+`F`,count:0}),void 0),t.fallback),p)})})}})}var Ve=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),He=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Ue=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),We=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Ge(e,t){let n=We[e];return typeof n==`object`?n[t]?n.$:void 0:n}var Ke=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),qe=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),Je={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},Ye=e=>w(()=>e());function Xe(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;)if(t[o]===n[s])o++,s++;else{for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var Ze=`_$DX_DELEGATE`;function Qe(e,t,n,r={}){let i;return b(r=>{i=r,t===document?e():Y(t,e(),!n&&t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function W(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>T(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function G(e,t=window.document){let n=t[Ze]||(t[Ze]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,dt))}}function K(e,t,n){X(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function $e(e,t,n,r){X(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function et(e,t,n){X(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function q(e,t){X(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function tt(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function nt(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(lt(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(lt(e,i,!0),n[i]=o)}return n}function rt(e,t,n){if(!t)return n?K(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function it(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function at(e,t={},n,r){let i={};return r||S(()=>i.children=Z(e,t.children,i.children)),S(()=>typeof t.ref==`function`&&J(t.ref,e)),S(()=>ot(e,t,n,!0,i,!0)),i}function J(e,t,n){return T(()=>e(t,n))}function Y(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Z(e,t,r,n);S(r=>Z(e,t(),r,n),r)}function ot(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=ut(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||Z(e,t.children);continue}let s=t[o];i[o]=ut(e,o,s,i[o],n,a,t)}}function st(t){let n,r;return!X()||!(n=e.registry.get(r=mt()))?t():(e.completed&&e.completed.add(n),e.registry.delete(r),n)}function X(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function ct(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function lt(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function ut(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return rt(e,n,r);if(t===`classList`)return nt(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Ke.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(tt(e,i,n,a),a&&G([i]))}else if(t.slice(0,5)===`attr:`)K(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)et(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=He.has(t))||!i&&((u=Ge(t,e.tagName))||(c=Ve.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(X(e))return n;t===`class`||t===`className`?q(e,n):s&&!c&&!l?e[ct(t)]=n:(t===`value`||t===`defaultValue`)&&(e.nodeName===`INPUT`||e.nodeName===`TEXTAREA`)?e[u||t]=n??``:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Je[t.split(`:`)[0]];r?$e(e,r,t,n):K(e,Ue[t]||t,n)}return n}function dt(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0);try{if(t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}finally{t=n=null}}function Z(e,t,n,r,i){let a=X(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Q(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Q(e,n,r)}else if(o===`function`)return S(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Z(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(ft(o,t,n,i))return S(()=>n=Z(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Q(e,n,r),s)return n}else c?n.length===0?pt(e,o,r):Xe(e,n,o):(n&&Q(e),pt(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Q(e,n,r,t);Q(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function ft(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=ft(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=ft(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function pt(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Q(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function mt(){return e.getNextContextId()}var ht=`http://www.w3.org/2000/svg`;function gt(e,t=!1,n=void 0){return t?document.createElementNS(ht,e):document.createElement(e,{is:n})}function _t(t){let{useShadow:n}=t,r=document.createTextNode(``),i=()=>t.mount||document.body,a=k(),o,s=!!e.context;return C(()=>{s&&(k().user=s=!1),o||=ae(a,()=>w(()=>t.children));let e=i();if(e instanceof HTMLHeadElement){let[t,n]=x(!1);b(n=>Y(e,()=>t()?n():o(),null)),D(()=>n(!0))}else{let i=gt(t.isSVG?`g`:`div`,t.isSVG),a=n&&i.attachShadow?i.attachShadow({mode:`open`}):i;Object.defineProperty(i,"_$host",{get(){return r.parentNode},configurable:!0}),Y(a,o),e.appendChild(i),t.ref&&t.ref(i),D(()=>e.contains(i)&&e.removeChild(i))}},void 0,{render:!s}),r}function vt(t,n){let r=w(t);return w(()=>{let t=r();switch(typeof t){case`function`:return T(()=>t(n));case`string`:let r=qe.has(t),i=e.context?st():gt(t,r,T(()=>n.is));return at(i,n,r),i}})}function yt(e){let[,t]=Ae(e,[`component`]);return vt(()=>e.component,t)}var bt=class extends Error{status;code;field;hint;details;constructor(e,t){super(t),this.status=e}},xt=class extends Error{cause;name=`NetworkError`;constructor(e){super(`Can't reach the hub: the connection dropped. Check your network and try again.`),this.cause=e}},St;function Ct(e){St=e}async function wt(e,{method:t=`GET`,json:n,body:r,headers:i={},signal:a,keepalive:o}={}){let s={method:t,credentials:`same-origin`,headers:{...i},signal:a,keepalive:o};n===void 0?r!==void 0&&(s.body=r):(s.headers[`content-type`]=`application/json`,s.body=JSON.stringify(n));let c;try{c=await fetch(e,s)}catch(e){throw e instanceof TypeError?new xt(e):e}if(!c.ok){let e=await c.json().catch(()=>({}));c.status===401&&St?.();let t=e.error&&typeof e.error==`object`?e.error:e,n=typeof e.error==`string`?e.error:typeof t.message==`string`?t.message:``,r=new bt(c.status,n||`HTTP ${c.status}`);throw typeof t.field==`string`&&(r.field=t.field),typeof t.code==`string`&&(r.code=t.code),typeof t.hint==`string`&&(r.hint=t.hint),e.error&&typeof e.error==`object`&&(r.details=t),r}return c}var Tt=async e=>(await wt(e)).json(),Et=encodeURIComponent,Dt=e=>`/api/sessions/${Et(e)}`,Ot=e=>e instanceof Error?e.message:String(e),kt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),At=/^[A-Za-z0-9_.:@/+~-]{1,300}$/,jt=/[\p{Cc}\p{Cf}\u2028\u2029]/u,Mt={workspace:`ws`,binding:`wsb`,member:`wsm`,assignment:`asg`,supervision:`sup`,checkpoint:`chk`,sideChat:`chat`,profile:`prof`,artifact:`art`,revision:`rev`,blob:`blob`,aiJob:`job`,team:`team`,staffing:`stf`,intake:`itk`},Nt=/^[A-Za-z0-9]{16,32}$/;function Pt(e,t){if(typeof t!=`string`)return!1;let n=`${Mt[e]}_`;return t.startsWith(n)&&Nt.test(t.slice(n.length))}var Ft=/^[a-z0-9-]{2,40}$/,It=e=>typeof e==`string`&&Ft.test(e),Lt=(e,t=120)=>typeof e==`string`&&e.trim().length>0&&e.length<=t&&!jt.test(e),Rt=4e3,zt=/[\u0000-\u0009\u000b-\u001f\u007f\u2028\u2029\u200b-\u200f\u202a-\u202e\u2066-\u2069]/,Bt=(e,t=Rt)=>typeof e==`string`&&e.length<=t&&!zt.test(e);function Vt(e){if(e!==void 0){if(!Array.isArray(e)||e.length>32)return`tags must be a list of at most 32`;if(!e.every(It))return`each tag must be 2–40 lowercase letters, digits or dashes`;if(new Set(e).size!==e.length)return`tags must be unique`}}function Ht(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))return`metadata must be an object`;let t=Object.entries(e);if(t.length>32)return`metadata has more than 32 keys`;for(let[e,n]of t){if(!It(e))return`metadata key ${JSON.stringify(String(e).slice(0,50))} must be a slug`;if(!Lt(n,200))return`metadata.${e} must be 1–200 characters of text`}}var $=e=>e.signedIn,Ut=[{id:`sessions`,label:`All sessions`,icon:`home`,route:`/`,order:10,available:e=>$(e)?!0:`hidden`},{id:`concierge`,label:`Concierge`,icon:`spark`,route:`/concierge`,order:15,available:e=>$(e)&&e.concierge!==void 0&&e.concierge!==`disabled`?!0:`hidden`},{id:`artifacts`,label:`Artifacts`,icon:`file`,route:`/artifacts`,order:20,available:e=>$(e)?!0:`hidden`},{id:`teams`,label:`Teams`,icon:`team`,route:`/teams`,order:25,available:e=>$(e)?!0:`hidden`},{id:`watchtower`,label:`Watchtower`,icon:`watchtower`,route:`/watchtower`,order:30,available:e=>$(e)?!0:`hidden`},{id:`profiles`,label:`Agent profiles`,icon:`settings`,route:`/profiles`,order:40,available:e=>$(e)?!0:`hidden`}],Wt={"/birds-eye":`/watchtower`};function Gt(e,t=``,n=``){for(let[r,i]of Object.entries(Wt))if(e===r||e.startsWith(`${r}/`))return`${i}${e.slice(r.length)}${t}${n}`}function Kt(e,t){try{return e.available(t)}catch{return`hidden`}}function qt(e,t=Ut){return[...t].sort((e,t)=>e.order-t.order).flatMap(t=>{let n=Kt(t,e);return n===`hidden`?[]:[{dest:t,enabled:n===!0}]})}var Jt=(e,t)=>Kt(e,t)===!0?`ok`:`unavailable`;function Yt(e,t=Ut){for(let n of t)if(n.route!==`/`&&(e===n.route||e.startsWith(`${n.route}/`)))try{return{dest:n,rest:e.slice(n.route.length).split(`/`).filter(Boolean).map(decodeURIComponent)}}catch{return}}function Xt(e,t=Ut){return e===`/`?t.find(e=>e.route===`/`)?.id:Yt(e,t)?.dest.id}function Zt(e){return e.supported?e.permission===`denied`?{state:`blocked`,message:`Notifications are blocked for this site. Allow them in the browser's site settings, then reload.`,action:`none`,warn:!0}:e.permission==="default"?{state:`off`,message:`Notifications are off on this device.`,action:`enable`,warn:!0}:!e.worker||!e.endpoint||!e.hubSubscribed?{state:`repair`,message:`Allowed, but this device is not subscribed on this hub, so nothing will arrive (this happens after the hub moves to a new address). Enable again to fix it.`,action:`enable`,warn:!0}:{state:`on`,message:`On for this device.`,action:`disable`,warn:!1}:{state:`unsupported`,message:`This browser can't get notifications here. On iPhone, add the app to the Home Screen first (iOS 16.4+); everywhere else the hub must be on https.`,action:`none`,warn:!0}}var Qt=e=>e.supported&&e.permission===`granted`&&(!e.endpoint||!e.hubSubscribed);function $t(e){if(e.subscriptions===0)return{ok:!1,text:`This device is not subscribed; enable notifications first`};if(e.sent>0)return{ok:!0,text:e.sent===1?`Test notification sent to this device`:`Test notification sent (${e.sent} subscriptions)`};let t=e.failed[0];return t?{ok:!1,text:`Test failed: ${t.host} ${t.status===void 0?`did not answer`:`answered ${t.status}`}`}:{ok:!1,text:`Test failed`}}var en=[1,2,5,10,15,30,60],tn=[{title:`Needs you`,kinds:[{key:`question`,label:`Question`,description:`A session or subagent asks you something.`},{key:`permission`,label:`Needs permission`,description:`A tool call waits for your OK (answer from the notification).`},{key:`decision`,label:`Decision`,description:`A session asks you to decide (hub ask @me), with options and a recommendation.`},{key:`message`,label:`Message`,description:`Agent messaging needs you: a message to you, an unanswered ask, or sessions looping.`},{key:`concierge`,label:`Concierge`,description:`Your Concierge needs you or has news: its questions, permissions, decisions, messages and spoken replies.`}]},{title:`Session`,kinds:[{key:`done`,label:`All done`,description:`The session and all its subagents and scripts finished; nothing waits on you. Once per run.`},{key:`failed`,label:`Failed`,description:`The session's run failed (provider or tool error), with the reason.`},{key:`providerError`,label:`Model provider error`,description:`Quota, budget, auth or model-routing errors of the session or a subagent; once per run.`},{key:`turn`,label:`Turn finished`,description:`Every reply of the main session, also the short ones between subagents. Noisy.`},{key:`stopped`,label:`Stopped`,description:`A run stopped without you asking (OpenCode shut down, inactivity).`},{key:`retry`,label:`Retrying`,description:`The provider failed and OpenCode is retrying the request.`}]},{title:`Subagents`,kinds:[{key:`subagentDone`,label:`Subagent finished`,description:`Each subagent that finishes, by name.`},{key:`subagentFailed`,label:`Subagent failed`,description:`Each subagent that fails, with the reason.`}]},{title:`Scripts and tools`,kinds:[{key:`jobDone`,label:`Script finished`,description:`A background shell or terminal exited 0.`},{key:`jobFailed`,label:`Script failed`,description:`A background shell or terminal exited non-zero, was killed or timed out.`},{key:`longTool`,label:`Long tool finished`,description:`A tool call that ran 30 seconds or more ended.`}]},{title:`Voice`,kinds:[{key:`say`,label:`Spoken reply`,description:`Voice mode replies while no device shows the session.`},{key:`handoff`,label:`Hand-off`,description:`A session sent to this device from the terminal (ignores quiet hours).`}]},{title:`Activity digest`,kinds:[{key:`activity`,label:`Activity`,description:`One quiet, self-replacing summary per session: subagents, long tools, scripts, idle.`}]}],nn=tn.flatMap(e=>e.kinds);function rn(e){let t=nn.filter(t=>e[t.key]).map(e=>e.label);return t.length?`You'll get: ${t.join(`, `)}.`:`You'll get no notifications on this device.`}function an(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}}var on=[{id:`general`,label:`General`,description:`Account, theme, text size and the Hub app`},{id:`notifications`,label:`Notifications`,description:`This device's notifications, what to notify about, quiet hours`},{id:`voice`,label:`Voice & speech`,description:`Voice mode, mic sensitivity, speech-to-text and text-to-speech`},{id:`machines`,label:`Machines & devices`,description:`Connected machines, approvals, signed-in browsers and apps`},{id:`agents`,label:`Agents & access`,description:`App tokens, acting switches, grants and agent activity`},{id:`concierge`,label:`Concierge`,description:`Your hub-managed assistant: machine, directory, model and its grant`},{id:`teams`,label:`Teams`,description:`Team isolation: what team members see`},{id:`admin`,label:`Admin`,description:`Users, all machines, approvals and the audit log`,admin:!0}],sn=e=>on.filter(t=>e||!t.admin);function cn(e){if(e!==`/settings`&&!e.startsWith(`/settings/`))return;let t=e.slice(10).split(`/`)[0]??``;if(!t)return{};try{return{section:decodeURIComponent(t)}}catch{return{section:t}}}function ln(e,t){return e===void 0?t.phone?`list`:`general`:sn(t.admin).find(t=>t.id===e)?.id}var un={account:`general`,appearance:`general`,notifications:`notifications`,voice:`voice`,speech:`voice`,machines:`machines`,devices:`machines`,agents:`agents`,admin:`admin`};function dn(e){let t=e.replace(/^#/,``);if(!t)return;let n=un[t];if(n)return`/settings/${n}#${t}`;if(on.some(e=>e.id===t))return`/settings/${t}`}var fn=[{id:`account`,section:`general`,label:`Account`,description:`Who you are signed in as; sign out of this device`,keywords:`sign out logout user email`},{id:`set-theme`,section:`general`,label:`Color theme`,description:`Light, dark or the system's theme`,keywords:`appearance light dark system mode`},{id:`set-text-size`,section:`general`,label:`Text size`,description:`How big text is on this device`,keywords:`appearance font scale zoom`},{id:`add-app`,section:`general`,label:`Add the Hub app`,description:`Link the Hub app on a phone or tablet with a QR code`,keywords:`mobile android ios install pair link`},{id:`notifications`,section:`notifications`,label:`Notifications on this device`,description:`Enable or turn off push notifications here; permission and subscription status`,keywords:`push enable subscribe permission service worker`},{id:`notify-test`,section:`notifications`,label:`Send test notification`,description:`Check that notifications reach this device`,keywords:`push try`},{id:`quiet-hours`,section:`notifications`,label:`Quiet hours`,description:`No notifications at night (hand-offs still come through)`,keywords:`do not disturb night sleep time`},{id:`set-voice-speed`,section:`voice`,label:`Voice speed`,description:`How fast replies are spoken`,keywords:`rate tts`},{id:`set-sensitivity`,section:`voice`,label:`Mic sensitivity`,description:`How sure Voice mode must be that you are speaking to it`,keywords:`microphone noise vad`},{id:`set-cues`,section:`voice`,label:`Progress cues`,description:`Tones and short acknowledgements while the agent works`,keywords:`sounds acknowledgement`},{id:`set-background`,section:`voice`,label:`Keep listening when the screen is off`,description:`Lock-screen controls and listening with the screen off`,keywords:`background lock screen`},{id:`recording`,section:`voice`,label:`Record voice conversations (developer)`,description:`Saves your voice segments, transcripts, replies, timing and Concierge actions on this hub, for 7 days; export or delete them`,keywords:`record debug developer training audio export delete`},{id:`speech`,section:`voice`,label:`Speech`,description:`Speech-to-text and text-to-speech provider, model, voice and API keys`,keywords:`stt tts transcription openrouter openai key`},{id:`machines`,section:`machines`,label:`Machines`,description:`Computers running OpenCode connected to this hub; approve or revoke them`,keywords:`computer approve enrollment revoke opencode`},{id:`devices`,section:`machines`,label:`Devices`,description:`Browsers and the Hub app signed in to your account; revoke them`,keywords:`browser phone sessions revoke sign out`},{id:`agents`,section:`agents`,label:`Acting switch`,description:`Whether sessions and apps may act for you at all`,keywords:`pause kill switch acting`},{id:`app-tokens`,section:`agents`,label:`App tokens`,description:`Tokens for MCP gateways, CLIs and other apps, with their scopes`,keywords:`api key token scopes mcp cli`},{id:`grants`,section:`agents`,label:`Grants`,description:`What sessions and apps may approve, deny, answer, prompt or stop for you`,keywords:`permissions delegate allow`},{id:`agent-activity`,section:`agents`,label:`Agent activity`,description:`What agents did for you (the agent audit)`,keywords:`audit log history`},{id:`concierge`,section:`concierge`,label:`Concierge`,description:`Turn the Concierge on or off, pick its machine and directory, restart it`,keywords:`assistant butler watch sessions`},{id:`concierge-grant`,section:`concierge`,label:`Concierge grant`,description:`What the Concierge may do for you without asking; renew or remove it`,keywords:`permissions approve deny preset`},{id:`team-isolation`,section:`teams`,label:`Team isolation`,description:`Team members see only their teams' sessions, not your other sessions`,keywords:`teams privacy hide members`}],pn=[{id:`admin`,section:`admin`,label:`Users`,description:`Everyone on this hub: roles, disable, remove`,keywords:`admin accounts people`},{id:`admin-machines`,section:`admin`,label:`All machines`,description:`Every machine connected to this hub, by owner`,keywords:`admin revoke`},{id:`admin-audit`,section:`admin`,label:`Audit log`,description:`Who changed what on this hub`,keywords:`admin history`}],mn=(e,t)=>({id:`pref-${e.key}`,section:`notifications`,label:e.label,description:e.description,keywords:`notify ${t}`});function hn(e){return[...fn,...tn.flatMap(e=>e.kinds.map(t=>mn(t,e.title))),...e?pn:[]]}var gn=e=>on.find(t=>t.id===e)?.label??e;function _n(e,t){let n=e.trim().toLowerCase();if(!n)return[];let r=n.split(/\s+/),i=e=>{let t=e.label.toLowerCase();return t.startsWith(n)?0:t.includes(n)?1:r.every(e=>t.includes(e))?2:3};return t.filter(e=>{let t=`${e.label} ${e.description} ${e.keywords??``} ${gn(e.section)}`.toLowerCase();return r.every(e=>t.includes(e))}).map((e,t)=>({e,i:t,r:i(e)})).sort((e,t)=>e.r-t.r||e.i-t.i).map(e=>e.e)}function vn(e,t){let n=e.filter(e=>e.key in t);if(!n.length)return``;let r=n.filter(e=>t[e.key]);return r.length===n.length?`All on`:r.length?`${r.length} of ${n.length} on: ${r.map(e=>e.label).join(`, `)}`:`All off`}var yn=e=>e&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)?e:`/`;function bn(e){let t=e.pathname,n=e.searchParams;if(t===`/pair`)return{name:`pair`,next:yn(n.get(`next`)),error:n.get(`error`)??``};if(t===`/approve`)return{name:`approve`,code:n.get(`code`)??``};if(t===`/new`)return{name:`new`,machine:n.get(`machine`)??void 0,dir:n.get(`dir`)??void 0,key:n.get(`key`)??void 0};if(t===`/panes`)return{name:`panes`};if(t===`/concierge`||t.startsWith(`/concierge/`))return{name:`concierge`};let r=cn(t);if(r)return{name:`settings`,...r};let i=Yt(t);if(i)return{name:`feature`,id:i.dest.id,rest:i.rest};let a=/^\/s\/([^/]+)$/.exec(t);if(a)try{return{name:`session`,id:decodeURIComponent(a[1])}}catch{return{name:`home`}}return{name:`home`}}function xn(){let e=(location.pathname===`/settings`?dn(location.hash):void 0)??Gt(location.pathname,location.search,location.hash);return e&&history.replaceState(history.state,``,e),new URL(location.href)}var[Sn,Cn]=x(xn()),wn=Sn,Tn=()=>bn(Sn()),En=0;function Dn(e,{replace:t=!1}={}){let n=new URL(e,location.origin);n.pathname+n.search+n.hash!==location.pathname+location.search+location.hash&&(history[t?`replaceState`:`pushState`]({},``,n.pathname+n.search+n.hash),t||En++),Cn(xn())}function On(e=`/`){En>0?history.back():Dn(e)}window.addEventListener(`popstate`,()=>{En=Math.max(0,En-1),Cn(xn())}),document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[href]`);if(!t||t.target||t.hasAttribute(`download`)||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n=t.getAttribute(`href`)??``;!n.startsWith(`/`)||n.startsWith(`//`)||n.startsWith(`/auth/`)||n.startsWith(`/api/`)||(e.preventDefault(),Dn(n))});var kn=()=>new Set;function An(e){kn=e}var jn=e=>kn().has(e),Mn=e=>kn().has(e)?`/concierge`:`/s/${encodeURIComponent(e)}`,[Nn,Pn]=x(),Fn=Nn,In=0,Ln;function Rn(e,t=``,n){let r=++In;Pn({id:r,text:e,kind:t,action:n}),clearTimeout(Ln),Ln=setTimeout(()=>Nn()?.id===r&&Pn(void 0),n||t?8e3:4e3)}var zn=()=>Pn(void 0);function Bn(e){let t=[];return{ask(n){return new Promise(r=>{t.push({request:n,resolve:r}),t.length===1&&e(n)})},current:()=>t[0]?.request,settle(n){let r=t.shift();r&&(r.resolve(n),e(t[0]?.request))}}}function Vn(e){let t=e.trim(),n=t.indexOf(`
|
|
2
2
|
|
|
3
3
|
`);if(n>=0)return{title:t.slice(0,n).trim(),message:t.slice(n+2).trim()};let r=/\?\s/.exec(t);return r?{title:t.slice(0,r.index+1),message:t.slice(r.index+1).trim()}:{title:t,message:``}}var Hn=e=>e.danger?`cancel`:`primary`,Un=e=>e.repeat&&(e.key===`Enter`||e.key===` `);function Wn(e,t){return Array.from(e.querySelectorAll(`dialog:modal`)).some(e=>!t||!e.contains(t))}var Gn=W(`<dialog class="dialog confirm-dialog"role=alertdialog aria-modal=true aria-labelledby=confirm-dialog-title data-confirm-dialog>`),Kn=W(`<p id=confirm-dialog-message class=confirm-message>`),qn=W(`<form method=dialog><div class=dialog-head><h2 id=confirm-dialog-title></h2></div><div class=dialog-body><div class=dialog-actions><button type=button class=btn data-confirm-cancel></button><button type=submit data-confirm-primary>`),[Jn,Yn]=x(),Xn=Bn(Yn);function Zn(e){return Xn.ask(e)}var Qn=e=>Wn(document,e??void 0);function $n(e,t,n={}){let{title:r,message:i}=Vn(e);return Zn({title:r,message:i,confirm:t,...n})}var er=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function tr(){let e,t,n,r=null;C(()=>{let i=Jn();e&&(i&&!e.open?(r=document.activeElement,e.showModal()):!i&&e.open&&(e.close(),r?.isConnected&&r.focus(),r=null),i&&queueMicrotask(()=>(Hn(i)===`cancel`?n:t)?.focus()))});let i=e=>Xn.settle(e);return(()=>{var r=Gn();r.$$keydown=t=>{if(Un(t)){t.preventDefault();return}if(t.key!==`Tab`||!e)return;let n=[...e.querySelectorAll(er)];if(!n.length)return;let r=n[0],i=n[n.length-1];t.shiftKey&&document.activeElement===r?(t.preventDefault(),i.focus()):!t.shiftKey&&document.activeElement===i&&(t.preventDefault(),r.focus())},r.$$click=t=>t.target===e&&i(!1),r.addEventListener(`cancel`,e=>{e.preventDefault(),i(!1)});var a=e;return typeof a==`function`?J(a,r):e=r,Y(r,V(U,{get when(){return Jn()},children:e=>(()=>{var r=qn(),a=r.firstChild,o=a.firstChild,s=a.nextSibling,c=s.firstChild,l=c.firstChild,u=l.nextSibling;r.addEventListener(`submit`,e=>{e.preventDefault(),i(!0)}),Y(o,()=>e().title),Y(s,V(U,{get when(){return e().message},get children(){var t=Kn();return Y(t,()=>e().message),t}}),c),l.$$click=()=>i(!1);var d=n;typeof d==`function`?J(d,l):n=l,Y(l,()=>e().cancel??`Cancel`);var f=t;return typeof f==`function`?J(f,u):t=u,Y(u,()=>e().confirm),S(()=>q(u,`btn primary${e().danger?` danger`:``}`)),r})()})),S(()=>K(r,`aria-describedby`,Jn()?.message?`confirm-dialog-message`:void 0)),r})()}G([`click`,`keydown`]);var nr=W(`<svg viewBox="0 0 24 24"aria-hidden=true>`),rr=W(`<svg><path></svg>`,!1,!0,!1),ir=W(`<span class=voice-dot role=img aria-label="Voice mode on"title="Voice mode on">`),ar=W(`<span class=spinner>`),or=W(`<span role=img>`),sr=W(`<span class=status-dot>`),cr=W(`<button type=button>`),lr=W(`<button type=button aria-haspopup=menu>`),ur=W(`<div class=menu role=menu>`),dr=W(`<div class=menu-sep role=separator>`),fr=W(`<div class=menu-section>`),pr=W(`<span class=menu-hint>`),mr=W(`<kbd class=menu-key>`),hr=W(`<button type=button><span class=menu-check></span><span class=menu-label>`),gr=W(`<div class=dialog-head><h2>`),_r=W(`<div class=dialog-body>`),vr=W(`<dialog>`),yr=W(`<span class=error-badge role=img>!`),br={menu:[`M4 6h16`,`M4 12h16`,`M4 18h16`],sidebar:[`M4 5h16v14H4z`,`M9 5v14`],rail:[`M4 5h16v14H4z`,`M15 5v14`],plus:[`M12 5v14`,`M5 12h14`],file:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`],more:[`M5 12h.01`,`M12 12h.01`,`M19 12h.01`],search:[`M11 4a7 7 0 1 0 0 14a7 7 0 0 0 0-14z`,`M20 20l-4-4`],mic:[`M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3z`,`M5 11a7 7 0 0 0 14 0`,`M12 18v3`],wave:[`M3 12h2`,`M7 8v8`,`M11 5v14`,`M15 8v8`,`M19 11v2`],stop:[`M7 7h10v10H7z`],send:[`M12 19V5`,`M5 12l7-7 7 7`],chevron:[`M9 6l6 6-6 6`],down:[`M6 9l6 6 6-6`],close:[`M6 6l12 12`,`M18 6L6 18`],back:[`M15 5l-7 7 7 7`],settings:[`M4 7h10M18 7h2M4 17h4M12 17h8`,`M16 5v4`,`M10 15v4`],branch:[`M6 3v12`,`M18 9a3 3 0 1 0 0-6a3 3 0 0 0 0 6z`,`M6 21a3 3 0 1 0 0-6a3 3 0 0 0 0 6z`,`M18 9a9 9 0 0 1-9 9`],server:[`M4 5h16v6H4z`,`M4 13h16v6H4z`,`M8 8h.01`,`M8 16h.01`],diff:[`M12 3v6`,`M9 6h6`,`M9 18h6`,`M5 3h14v18H5z`],pin:[`M12 17v5`,`M8 3h8l-1 6 3 3H6l3-3z`],muted:[`M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3z`,`M5 11a7 7 0 0 0 14 0`,`M4 4l16 16`],home:[`M4 11l8-7 8 7`,`M6 10v10h12V10`],cloud:[`M7 18h10a4 4 0 0 0 .5-7.97A6 6 0 0 0 6.1 9.1A4.5 4.5 0 0 0 7 18z`],folder:[`M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`],bell:[`M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9`,`M10.3 21a1.94 1.94 0 0 0 3.4 0`],watchtower:[`M6 7l6-4 6 4`,`M8 7h8v4H8z`,`M9 11l-2 10`,`M15 11l2 10`,`M8.2 15h7.6`],copy:[`M9 9h11v11H9z`,`M5 15H4V4h11v1`],fork:[`M6 3v5a6 6 0 0 0 6 6`,`M18 3v5a6 6 0 0 1-6 6v7`,`M4 5l2-2 2 2`,`M16 5l2-2 2 2`],undo:[`M9 14L4 9l5-5`,`M4 9h11a5 5 0 0 1 0 10h-3`],download:[`M12 4v11`,`M7 10l5 5 5-5`,`M5 20h14`],edit:[`M4 20h4L19 9l-4-4L4 16z`,`M13 7l4 4`],info:[`M12 3a9 9 0 1 0 0 18a9 9 0 0 0 0-18z`,`M12 11v5`,`M12 8h.01`],check:[`M5 12l5 5 9-10`],spark:[`M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z`,`M19 16l.7 1.8 1.8.7-1.8.7L19 21l-.7-1.8-1.8-.7 1.8-.7z`],split:[`M4 5h16v14H4z`,`M12 5v14`],expand:[`M14 4h6v6`,`M20 4l-7 7`,`M10 20H4v-6`,`M4 20l7-7`],archive:[`M4 5h16v4H4z`,`M6 9v10h12V9`,`M10 13h4`],wrap:[`M4 6h16`,`M4 12h13a3 3 0 0 1 0 6h-4`,`M15 16l-2 2 2 2`,`M4 18h5`],lock:[`M6 11h12v9H6z`,`M8 11V8a4 4 0 0 1 8 0v3`],code:[`M9 8l-4 4 4 4`,`M15 8l4 4-4 4`],image:[`M4 5h16v14H4z`,`M4 16l5-5 4 4 2-2 5 5`,`M15 9h.01`],table:[`M4 5h16v14H4z`,`M4 10h16`,`M4 15h16`,`M10 5v14`],chart:[`M4 20h16`,`M7 16v-5`,`M12 16V7`,`M17 16v-8`],grid:[`M4 4h7v7H4z`,`M13 4h7v7h-7z`,`M4 13h7v7H4z`,`M13 13h7v7h-7z`],stack:[`M4 5h16v14H4z`,`M4 12h16`],grip:[`M9 6h.01`,`M15 6h.01`,`M9 12h.01`,`M15 12h.01`,`M9 18h.01`,`M15 18h.01`],app:[`M4 5h16v14H4z`,`M4 9h16`,`M7 7h.01`,`M10 7h.01`],doc:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`,`M9 12h6`,`M9 16h6`],team:[`M9 11a3 3 0 1 0 0-6a3 3 0 0 0 0 6z`,`M3 20a6 6 0 0 1 12 0`,`M16 11a2.5 2.5 0 1 0 0-5`,`M17 14.2a5 5 0 0 1 4 4.8`]};function xr(e){return(()=>{var t=nr();return Y(t,V(Fe,{get each(){return[...br[e.name]]},children:e=>(()=>{var t=rr();return K(t,`d`,e),t})()})),S(()=>K(t,`class`,`icon ${e.class??``}`)),t})()}var Sr={idle:`Idle`,working:`Running`,blocked:`Needs you`,error:`Error`};function Cr(){return ir()}function wr(e){return(()=>{var t=or();return Y(t,V(U,{get when(){return e.state===`working`},get fallback(){return sr()},get children(){return ar()}})),S(n=>{var r=`status ${e.state} ${e.class??``}`,i=Sr[e.state],a=Sr[e.state];return r!==n.e&&q(t,n.e=r),i!==n.t&&K(t,`aria-label`,n.t=i),a!==n.a&&K(t,`title`,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()}function Tr(e){let[t,n]=Ae(e,[`icon`,`label`,`class`]);return(()=>{var e=cr();return at(e,ke({get class(){return`icon-btn ${t.class??``}`},get"aria-label"(){return t.label},get title(){return t.label}},n),!1,!0),Y(e,V(xr,{get name(){return t.icon}})),e})()}function Er(e){let[t,n]=x(!1),r,i,[a,o]=x({top:0,left:0,right:0,bottom:0}),s=()=>{let e=r.getBoundingClientRect();o({top:e.bottom+4,left:e.left,right:window.innerWidth-e.right,bottom:window.innerHeight-e.top+4})},c=()=>n(!1),l=e=>{if(!t())return;let n=e.target;!r.contains(n)&&!i?.contains(n)&&c()},u=n=>{if(t()){if(n.key===`Escape`){if(Qn(i??r))return;c(),r.focus()}else if(/^[1-9]$/.test(n.key)&&!(n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement)){let t=e.items().filter(e=>typeof e==`object`&&`run`in e&&!e.disabled)[Number(n.key)-1];t&&(n.preventDefault(),c(),t.run())}}};E(()=>{document.addEventListener(`mousedown`,l),document.addEventListener(`keydown`,u)}),D(()=>{document.removeEventListener(`mousedown`,l),document.removeEventListener(`keydown`,u)});let d=()=>{let t=0;return e.items().map(e=>({item:e,index:typeof e==`object`&&`run`in e&&!e.disabled?++t:0}))};return[(()=>{var i=lr();i.$$click=e=>{e.stopPropagation(),e.preventDefault(),s(),n(!t())};var a=r;return typeof a==`function`?J(a,i):r=i,Y(i,()=>e.text??V(xr,{get name(){return e.icon??`more`}})),S(n=>{var r=e.class??`icon-btn`,a=e.label,o=e.label,s=t();return r!==n.e&&q(i,n.e=r),a!==n.t&&K(i,`aria-label`,n.t=a),o!==n.a&&K(i,`title`,n.a=o),s!==n.o&&K(i,`aria-expanded`,n.o=s),n},{e:void 0,t:void 0,a:void 0,o:void 0}),i})(),V(U,{get when(){return t()},get children(){return V(_t,{get children(){var t=ur(),n=i;return typeof n==`function`?J(n,t):i=t,Y(t,V(Fe,{get each(){return d()},children:({item:e,index:t})=>e===`sep`?dr():`section`in e?(()=>{var t=fr();return Y(t,()=>e.section),t})():(()=>{var n=hr(),r=n.firstChild,i=r.nextSibling;return n.$$click=t=>{t.stopPropagation(),c(),e.run()},Y(r,()=>e.checked?`✓`:``),Y(i,()=>e.label),Y(n,V(U,{get when(){return e.hint},get children(){var t=pr();return Y(t,()=>e.hint),t}}),null),Y(n,V(U,{when:t>0&&t<10,get children(){var e=mr();return Y(e,t),e}}),null),S(t=>{var r=e.checked===void 0?`menuitem`:`menuitemradio`,i=e.checked,a=`menu-item${e.danger?` danger`:``}`,o=e.disabled;return r!==t.e&&K(n,`role`,t.e=r),i!==t.t&&K(n,`aria-checked`,t.t=i),a!==t.a&&q(n,t.a=a),o!==t.o&&(n.disabled=t.o=o),t},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})),S(n=>rt(t,{...e.up?{bottom:`${a().bottom}px`}:{top:`${a().top}px`},...e.align===`left`?{left:`${a().left}px`}:{right:`${a().right}px`}},n)),t}})}})]}function Dr(e){let t;return C(()=>{let n=e.open;t&&(n&&!t.open?t.showModal():!n&&t.open&&t.close())}),(()=>{var n=vr();n.$$click=n=>n.target===t&&e.onClose(),n.addEventListener(`close`,()=>e.onClose());var r=t;return typeof r==`function`?J(r,n):t=n,Y(n,V(U,{get when(){return e.open},get children(){return[(()=>{var t=gr(),n=t.firstChild;return Y(n,()=>e.title),Y(t,V(Tr,{icon:`close`,label:`Close`,onClick:()=>e.onClose()}),null),t})(),(()=>{var t=_r();return Y(t,()=>e.children),t})()]}})),S(t=>{var r=`dialog${e.wide?` wide`:``} ${e.class??``}`,i=e.title;return r!==t.e&&q(n,t.e=r),i!==t.t&&K(n,`aria-label`,t.t=i),t},{e:void 0,t:void 0}),n})()}var[Or,kr]=x(Date.now());setInterval(()=>kr(Date.now()),3e4);var Ar=Or,[jr,Mr]=x(Date.now());setInterval(()=>Mr(Date.now()),1e3);var Nr=jr;function Pr(e){return(()=>{var t=yr();return S(n=>{var r=`Error: ${e.text}`,i=e.text;return r!==n.e&&K(t,`aria-label`,n.e=r),i!==n.t&&K(t,`title`,n.t=i),n},{e:void 0,t:void 0}),t})()}function Fr(e,t=Or()){if(!e)return``;let n=Math.max(0,Math.round((t-e)/1e3));return n<45?`just now`:n<3600?`${Math.round(n/60)}m ago`:n<86400?`${Math.round(n/3600)}h ago`:`${Math.round(n/86400)}d ago`}var Ir=e=>String(e??``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e||``,Lr={herdr:`Herdr`,tui:`TUI`,background:`Background`};G([`click`]);export{bt as $,hn as A,V as At,Ut as B,je as Bt,Dn as C,Fe as Ct,vn as D,Be as Dt,An as E,U as Et,$t as F,ne as Ft,Pt as G,T as Gt,qt as H,ie as Ht,an as I,b as It,Bt as J,Lt as K,Zt as L,x as Lt,en as M,C as Mt,tn as N,w as Nt,ln as O,Le as Ot,nn as P,S as Pt,kt as Q,rn as R,Ne as Rt,wn as S,o as St,Mn as T,Re as Tt,Jt as U,D as Ut,Xt as V,ke as Vt,Rt as W,E as Wt,Vt as X,Ht as Y,At as Z,Fn as _,at as _t,Er as a,Dt as at,On as b,J as bt,wr as c,_t as ct,Ir as d,G as dt,xt as et,Ar as f,Y as ft,Qn as g,it as gt,$n as h,K as ht,Tr as i,Tt as it,sn as j,ee as jt,_n as k,re as kt,Cr as l,tt as lt,tr as m,Qe as mt,Pr as n,Et as nt,Lr as o,Ct as ot,Nr as p,Ye as pt,It as q,xr as r,Ot as rt,Sr as s,yt as st,Dr as t,wt as tt,Fr as u,q as ut,zn as v,rt as vt,Tn as w,Ie as wt,jn as x,i as xt,Rn as y,W as yt,Qt as z,O as zt};
|
package/web/dist/index.html
CHANGED
|
@@ -11,28 +11,17 @@
|
|
|
11
11
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
12
12
|
<meta name="apple-mobile-web-app-title" content="Hub" />
|
|
13
13
|
<title>Hub</title>
|
|
14
|
-
<script>
|
|
15
|
-
// Color theme before first paint. System is represented by no override.
|
|
16
|
-
try {
|
|
17
|
-
var t = localStorage.getItem("hub.theme")
|
|
18
|
-
if (t === "light" || t === "dark") document.documentElement.dataset.theme = t
|
|
19
|
-
} catch (e) {}
|
|
20
|
-
// Text size before the first paint (web/src/core/font-scale.ts, key "hub.fontScale", 0.8–1.8).
|
|
21
|
-
try {
|
|
22
|
-
var s = parseFloat(localStorage.getItem("hub.fontScale"))
|
|
23
|
-
if (s >= 0.8 && s <= 1.8) document.documentElement.style.setProperty("--font-scale", String(s))
|
|
24
|
-
} catch (e) {}
|
|
25
|
-
</script>
|
|
14
|
+
<script src="/theme-boot.js"></script>
|
|
26
15
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
27
16
|
<link rel="icon" href="/favicon.ico" sizes="16x16 32x32 48x48" />
|
|
28
17
|
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
|
|
29
18
|
<link rel="icon" href="/icon-192.png" type="image/png" sizes="192x192" />
|
|
30
19
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
31
|
-
<script type="module" crossorigin src="/assets/index-
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/ui-
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/pane-layout-
|
|
20
|
+
<script type="module" crossorigin src="/assets/index-6mdQ7eUY.js"></script>
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/ui-Qo2Pd9-O.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/pane-layout-Csk-vPNe.js">
|
|
34
23
|
<link rel="modulepreload" crossorigin href="/assets/plural-Bspvoqfq.js">
|
|
35
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
24
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C5OmwA1y.css">
|
|
36
25
|
</head>
|
|
37
26
|
<body>
|
|
38
27
|
<div id="root"></div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Runs before the first paint (a classic, blocking script in index.html's <head>): an external file, not inline,
|
|
2
|
+
// so the console's Content-Security-Policy (src/central/csp.ts) needs no 'unsafe-inline' or hash.
|
|
3
|
+
// Color theme. System is represented by no override.
|
|
4
|
+
try {
|
|
5
|
+
var t = localStorage.getItem("hub.theme")
|
|
6
|
+
if (t === "light" || t === "dark") document.documentElement.dataset.theme = t
|
|
7
|
+
} catch (e) {}
|
|
8
|
+
// Text size (web/src/core/font-scale.ts, key "hub.fontScale", 0.8–1.8).
|
|
9
|
+
try {
|
|
10
|
+
var s = parseFloat(localStorage.getItem("hub.fontScale"))
|
|
11
|
+
if (s >= 0.8 && s <= 1.8) document.documentElement.style.setProperty("--font-scale", String(s))
|
|
12
|
+
} catch (e) {}
|