sliccy 6.42.0 → 6.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/{account-store-muoaQHRR.js → account-store-DKltGDns.js} +1 -1
- package/dist/ui/assets/{account-store-DfHGKvpm.js → account-store-y8PSSbM1.js} +1 -1
- package/dist/ui/assets/{adobe-DsRxVVmA.js → adobe-ClU-HOxw.js} +1 -1
- package/dist/ui/assets/{adobe-D6wtEfG-.js → adobe-DGzv5o9Q.js} +1 -1
- package/dist/ui/assets/{apply-layout-DipK5Qeq.js → apply-layout-DN4RycQp.js} +1 -1
- package/dist/ui/assets/{apps-DzMbomuM.js → apps-CSF_V-bE.js} +1 -1
- package/dist/ui/assets/{azure-openai-DpLjTiJq.js → azure-openai-BbfA67oz.js} +1 -1
- package/dist/ui/assets/{azure-openai-B3sYg59d.js → azure-openai-QWHytLUo.js} +1 -1
- package/dist/ui/assets/{cerebras-p9fkbT2I.js → cerebras-9fccqwcN.js} +1 -1
- package/dist/ui/assets/{cerebras-CPZB2rFN.js → cerebras-CzhRPokK.js} +1 -1
- package/dist/ui/assets/{connect-surface-BE-F5bCR.js → connect-surface-DPt-zcyr.js} +1 -1
- package/dist/ui/assets/{fs-CtMkdtkS.js → fs-D33dJneG.js} +2 -2
- package/dist/ui/assets/{fs-D_DThjGJ.js → fs-assVIc63.js} +1 -1
- package/dist/ui/assets/{github-Ci6SeQDv.js → github-Cg60jjcf.js} +1 -1
- package/dist/ui/assets/{github-copilot-C9iFVtGH.js → github-copilot-CO2lq3Hz.js} +1 -1
- package/dist/ui/assets/{github-copilot-Nn6jpUe5.js → github-copilot-NgNaiPbG.js} +1 -1
- package/dist/ui/assets/{github-install-DldiWCrs.js → github-install-Bhrcqtrr.js} +1 -1
- package/dist/ui/assets/{github-D-pvlqo8.js → github-rcdpKKRj.js} +2 -2
- package/dist/ui/assets/{github-zip-D5K7GFlB.js → github-zip-U-e0YcJc.js} +1 -1
- package/dist/ui/assets/{kernel-worker-BrCk0rlZ.js → kernel-worker-5FjRSqTZ.js} +25 -25
- package/dist/ui/assets/{local-llm-COgGivYH.js → local-llm-4P8VyegN.js} +1 -1
- package/dist/ui/assets/{local-llm-BfvhxZDa.js → local-llm-BRZfRqQe.js} +1 -1
- package/dist/ui/assets/{main-BB8sLwAS.js → main-CB6zF5Nu.js} +3 -3
- package/dist/ui/assets/{mount-HXPKnAGS.js → mount-D8FwGaHk.js} +2 -2
- package/dist/ui/assets/{mount-BscvFH92.js → mount-DiIbXHXM.js} +1 -1
- package/dist/ui/assets/{mount-recovery-7Nu3CUao.js → mount-recovery-Ze3PAzOp.js} +1 -1
- package/dist/ui/assets/{new-session-CK5MOUg4.js → new-session-PcDB5byI.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-2eI0exEP.js → oauth-bootstrap-T8vjOAVa.js} +2 -2
- package/dist/ui/assets/{openai-codex-D2zmW-1p.js → openai-codex-B18aQw4z.js} +1 -1
- package/dist/ui/assets/{openai-codex-DmOzD1WF.js → openai-codex-CKowAUIv.js} +1 -1
- package/dist/ui/assets/{openrouter-DaXvheIe.js → openrouter-CVBFGeBJ.js} +1 -1
- package/dist/ui/assets/{openrouter-D3Yj30C1.js → openrouter-KB6Gx6o9.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DFKH-cQH.js → openrouter-oauth-CJkaDLFj.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DQj1Swyk.js → openrouter-oauth-CdKWLphl.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-BLv_Bs5d.js → panel-rpc-handlers-NH6ZxXBF.js} +2 -2
- package/dist/ui/assets/{panelize-shell-DMbSe6Cp.js → panelize-shell-Ckrw42GR.js} +1 -1
- package/dist/ui/assets/{provider-CCavUk7R.js → provider-BVvLDAIL.js} +1 -1
- package/dist/ui/assets/{provider-DizKFYmK.js → provider-sXDP0t7n.js} +2 -2
- package/dist/ui/assets/{provider-settings-Cc8RedfG.js → provider-settings-DE5Ke3Lf.js} +1 -1
- package/dist/ui/assets/{provider-settings-B64JctJ5.js → provider-settings-DZ1fT3xk.js} +1 -1
- package/dist/ui/assets/{provider-store-access-CMkFd9C7.js → provider-store-access-BDJ5HxGf.js} +2 -2
- package/dist/ui/assets/provider-store-access-KHacrhuH.js +1 -0
- package/dist/ui/assets/{providers-CbIpEatx.js → providers-B_UqM-GR.js} +1 -1
- package/dist/ui/assets/{providers-N90z5TsX.js → providers-EEH69G4K.js} +2 -2
- package/dist/ui/assets/{quick-llm-DsljHqNf.js → quick-llm-DOkWNjz3.js} +1 -1
- package/dist/ui/assets/{recovery-screen-DiVJBKiL.js → recovery-screen-JmywSaId.js} +1 -1
- package/dist/ui/assets/{redirect-uri-BQLcC3XT.js → redirect-uri-C0SF0Hdn.js} +1 -1
- package/dist/ui/assets/{session-freezer-YOwz-Aeg.js → session-freezer-DGKuD3CO.js} +2 -2
- package/dist/ui/assets/{setup-feature-flags-remote-BaadpxUB.js → setup-feature-flags-remote-CC5jMUxz.js} +1 -1
- package/dist/ui/assets/{setup-standalone-prelude-CezEockJ.js → setup-standalone-prelude-BN_ALX3m.js} +1 -1
- package/dist/ui/assets/{setup-sudo-VfHlHaat.js → setup-sudo-BWCD0xI1.js} +2 -2
- package/dist/ui/assets/{skills-DsZ2E7Zl.js → skills-CICL6Qs5.js} +1 -1
- package/dist/ui/assets/{src-iJcLCxRd.js → src-BV6OQva_.js} +111 -28
- package/dist/ui/assets/{store-Cil7nqQL.js → store-DVdTVbQP.js} +1 -1
- package/dist/ui/assets/{store-DNujsteR.js → store-DqIZXn11.js} +1 -1
- package/dist/ui/assets/{sudo-ApelKYhJ.js → sudo-BKOF8V2Q.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-D4imhaHj.js → upgrade-detection-BVkXdET9.js} +1 -1
- package/dist/ui/assets/{wc-attach-ZYwsizqf.js → wc-attach-lEHw7D9A.js} +2 -2
- package/dist/ui/assets/{wc-extension-Dq1sPeFt.js → wc-extension-BadT9JWY.js} +2 -2
- package/dist/ui/assets/{wc-follower-DqotC0rv.js → wc-follower-CXKBW_nh.js} +3 -3
- package/dist/ui/assets/{wc-live-DubkwPlH.js → wc-live-DqKkGNvf.js} +3 -3
- package/dist/ui/assets/{wc-nav-BrtjFxg7.js → wc-nav-eGebanhs.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-CegO9LbR.js → wc-onboarding-DMcJQvQc.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-BZrra9gU.js → wc-placeholder-Br9BhcY9.js} +2 -2
- package/dist/ui/assets/{wc-settings-Bg4s1KU5.js → wc-settings-DNhg5fN6.js} +2 -2
- package/dist/ui/assets/{wc-shell-DaSmtLNJ.js → wc-shell-sWgyQAqa.js} +3 -3
- package/dist/ui/assets/{wc-sprinkles-lxproIqt.js → wc-sprinkles-BOQXDY6E.js} +2 -2
- package/dist/ui/assets/{wc-tray-B3RR2zoi.js → wc-tray-DkSMch94.js} +2 -2
- package/dist/ui/assets/{xai-grok-Dg0RQISd.js → xai-grok-U9jyH4f4.js} +1 -1
- package/dist/ui/assets/{xai-grok-CY9RSnPD.js → xai-grok-gMIhc8ri.js} +1 -1
- package/dist/ui/index.html +6 -6
- package/dist/ui/packages/webapp/index.html +6 -6
- package/package.json +2 -2
- package/dist/ui/assets/provider-store-access-DLnZEMs8.js +0 -1
|
@@ -1365,6 +1365,37 @@ slicc-composer {
|
|
|
1365
1365
|
slicc-composer[hidden] {
|
|
1366
1366
|
display: none;
|
|
1367
1367
|
}
|
|
1368
|
+
/* Full-bleed band inside the dock-tree shell: the VISUAL band extends past
|
|
1369
|
+
the chat column's right edge — under the floating tool pane, up to the
|
|
1370
|
+
frame clip — while the composer's content column is untouched (an open
|
|
1371
|
+
pane still pushes the textarea/labels left). The paint moves host →
|
|
1372
|
+
::before so the extension is one continuous tint/blur with no seam at the
|
|
1373
|
+
column edge; the pseudo's z-index:-1 keeps it under the composer's own
|
|
1374
|
+
content inside the host's stacking context. The chrome tool tile
|
|
1375
|
+
(z-index 3, slicc-dock-tree.ts) and the dock rail (z-index 3,
|
|
1376
|
+
slicc-shell.ts) float ABOVE the band, which outranks them at the
|
|
1377
|
+
composer's z-index 2 otherwise. Extends RIGHT only: leftward it would
|
|
1378
|
+
paint over the freezer rail, which sits below the app column. */
|
|
1379
|
+
.slicc-shell slicc-composer {
|
|
1380
|
+
border-top: none;
|
|
1381
|
+
background: none;
|
|
1382
|
+
backdrop-filter: none;
|
|
1383
|
+
-webkit-backdrop-filter: none;
|
|
1384
|
+
}
|
|
1385
|
+
.slicc-shell slicc-composer::before {
|
|
1386
|
+
content: "";
|
|
1387
|
+
position: absolute;
|
|
1388
|
+
top: 0;
|
|
1389
|
+
bottom: 0;
|
|
1390
|
+
left: 0;
|
|
1391
|
+
right: -100vw;
|
|
1392
|
+
z-index: -1;
|
|
1393
|
+
pointer-events: none;
|
|
1394
|
+
border-top: 1px solid var(--line);
|
|
1395
|
+
background: color-mix(in srgb, var(--ctx) 12%, color-mix(in srgb, var(--bg) 68%, transparent));
|
|
1396
|
+
backdrop-filter: blur(18px) saturate(1.4);
|
|
1397
|
+
-webkit-backdrop-filter: blur(18px) saturate(1.4);
|
|
1398
|
+
}
|
|
1368
1399
|
slicc-composer > .slicc-composer__inner {
|
|
1369
1400
|
box-sizing: border-box;
|
|
1370
1401
|
max-width: 680px;
|
|
@@ -1639,7 +1670,7 @@ slicc-composer .slicc-composer__ptt.is-picking {
|
|
|
1639
1670
|
animation-name: none;
|
|
1640
1671
|
}
|
|
1641
1672
|
}
|
|
1642
|
-
`,cn=`slicc-composer-style`;function ln(e){if(e.getElementById(cn))return;let t=e.createElement(`style`);t.id=cn,t.textContent=sn,(e.head??e.documentElement).appendChild(t)}var un=1e3,dn=60,fn=1e4,pn=45e3,mn=1500;function hn(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>i(n),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e instanceof Error?e:Error(String(e)))})})}var gn=`slicc-composer:mic-device`;function _n(){try{return typeof localStorage>`u`?null:localStorage.getItem(gn)}catch{return null}}function vn(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(gn,e):localStorage.removeItem(gn)}catch{}}function yn(e){return e==null||!Number.isFinite(e)?``:e<60?`~${Math.max(1,Math.round(e))}s`:`~${Math.floor(e/60)}m ${Math.round(e%60)}s`}S(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=null;#l=null;#u=null;#d=`unknown`;#f=_n();#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=null;#w=[];connectedCallback(){ln(this.ownerDocument),this.#T(),this.addEventListener(`pointerdown`,this.#E)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#E),this.#c?.cancel(),this.#c=null,this.#j(),this.#i=!1,this.#o=null,this.#a++,this.#z(),this.#L(),this.#m&&clearTimeout(this.#m),this.#m=null,this.#R(),this.#G(),this.#ee()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#u??=s(),this.#u}set speech(e){this.#u=e,this.#d=`unknown`}get device(){return this.#f}set device(e){this.#f=e,vn(e)}get inner(){return this.#T(),this.#e}append(...e){this.#T(),this.#e.append(...e)}#T(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-composer__inner`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-composer__inner`,this.#e.setAttribute(`part`,`inner`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}#E=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t)||t.value!==``)return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}let n=this.ownerDocument;n.addEventListener(`pointerup`,this.#M),this.addEventListener(`pointercancel`,this.#N),n.addEventListener(`selectionchange`,this.#D);let r=this.#a;this.#h=setTimeout(()=>{this.#L(),this.#O(this.speech,r)},400)};#D=()=>{if(!this.#h)return;let e=this.ownerDocument.getSelection();!e||e.isCollapsed||e.toString()===``||(this.#i=!1,this.#a++,this.#o=null,this.#L(),this.#z(),this.#R())};async#O(e,t){let n=await Promise.race([e.permission().then(e=>(this.#d=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),dn))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#A(e,t);return}if(n===`denied`){this.#q(`denied`);return}this.#q(`enable`),this.#m=setTimeout(()=>{this.#m=null,this.#k(e,t)},un),n===`pending`&&e.permission().then(n=>{this.#d=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#I(),this.#A(e,t)):n===`denied`&&(this.#I(),this.#q(`denied`)))})}}#k(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#v=null,this.#q(`prompting`),hn(e.requestPermission(),fn,Error(`Microphone didn't respond. Check your mic, then hold again.`)).then(n=>{this.#d=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#A(e,t):n?this.#ee():this.#i?this.#q(`denied`):this.#ee())}).catch(e=>{this.#d=`denied`,t===this.#a&&(this.#i?(this.#v=e instanceof Error?e.message:String(e),this.#q(`denied`)):this.#ee())}))}#A(e,t){this.#r=`recording`,this.#q(`recording`),e.warmup(),this.#g?.(),this.#g=e.onStatus(e=>{this.#_=e,this.#Q()});let n=e.microphones();n.then(e=>{t===this.#a&&(this.#f??(this.#p=o(e)),i(e)&&this.#$(e))}).catch(()=>{});let r=(this.#f==null?hn(n,mn,Error(`microphone enumeration timed out`)).then(e=>o(e)).catch(()=>null):Promise.resolve(this.#f)).then(n=>e.start({deviceId:n??void 0,onPartial:e=>{t===this.#a&&this.#Z(e)},onError:e=>{t===this.#a&&this.#Z(e,!0)}}));this.#l=r,r.then(e=>{if(this.#l===r){if(this.#l=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#c=e}}).catch(e=>{this.#l===r&&(this.#l=null,t===this.#a&&this.#Z(e instanceof Error?e.message:String(e),!0))})}#j(){let e=this.#l;this.#l=null,e&&e.then(e=>e.cancel(),()=>{})}#M=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#S,n=!1;if(this.#r===`recording`&&t&&!t.hidden)if(e.composedPath().includes(t))n=!0;else{let r=this.ownerDocument.elementFromPoint(e.clientX,e.clientY);n=r!=null&&t.contains(r)}if(n){this.#i=!1,this.#z(),this.#R(),this.#c?.cancel(),this.#c=null,this.#j(),this.#o=null,this.#B();return}this.#P(!0)};#N=e=>{(this.#s==null||e.pointerId===this.#s)&&this.#P(!1)};#P(e){if(!this.#i)return;switch(this.#i=!1,this.#L(),this.#z(),this.#R(),this.#r){case`enable`:this.#I(),this.#o=null,this.#ee();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#ee();return;case`recording`:break;default:this.#o=null,this.#ee();return}let t=this.#c;this.#c=null;let n=this.#l;if(this.#l=null,!e){t?.cancel(),n&&n.then(e=>e.cancel(),()=>{}),this.#o=null,this.#ee();return}if(!t&&!n){this.#o=null,this.#ee();return}this.#r=`finalizing`,this.#Z(`Transcribing…`);let r=this.#a;hn((t?Promise.resolve(t):n).then(e=>e.stop()),pn,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#ee(),this.#F(e))}).catch(()=>{r===this.#a&&(this.#ee(),this.#o=null)})}#F(e){let t=this.#o;if(this.#o=null,!t)return;let n=e.trim();if(!n){t.focus();return}t.value=t.value?/\s$/.test(t.value)?t.value+n:`${t.value} ${n}`:n,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.focus();let r=t.closest(`slicc-input-card`);r&&typeof r.submit==`function`?r.submit(`dictation`):t.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t.value,source:`dictation`}}))}#I(){this.#m&&clearTimeout(this.#m),this.#m=null}#L(){this.#h&&clearTimeout(this.#h),this.#h=null,this.ownerDocument.removeEventListener(`selectionchange`,this.#D)}#R(){this.ownerDocument.removeEventListener(`pointerup`,this.#M),this.removeEventListener(`pointercancel`,this.#N)}#z(){let e=this.#s;if(this.#s=null,e!=null)try{this.releasePointerCapture(e)}catch{}}#B(){this.#r=`picking`,this.#X(`picking`),this.#y&&(this.#y.textContent=`Choose a microphone`),this.#b&&(this.#b.hidden=!0),this.#V();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#U,!0),e.addEventListener(`keydown`,this.#W,!0)}#V(){let e=this.#S;if(!e||this.#C)return;let t=w(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),r=null,i=this.#f??this.#p;for(let e of this.#w){let a=e.deviceId===i,o=w(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":a?`true`:`false`,"data-device-id":e.deviceId},e.label,w(`span`,{class:`tick`},n(`check`,{size:14})));o.addEventListener(`click`,()=>{this.device=e.deviceId,this.#K()}),(a||!r)&&(r=o),t.appendChild(o)}this.#C=t,e.appendChild(t),this.#H(t,e),r?.focus()}#H(e,t){let n=t.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)-n.bottom-6-8,i=n.top-6-8,a=e.offsetHeight>r&&i>r;e.classList.toggle(`slicc-composer__ptt-device-menu--up`,a);let o=Math.max(a?i:r,0);e.style.maxHeight=`${Math.min(320,o)}px`}#U=e=>{this.#S&&e.composedPath().includes(this.#S)||this.#K()};#W=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#K())};#G(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#U,!0),e.removeEventListener(`keydown`,this.#W,!0)}#K(){this.#G(),this.#ee()}#q(e){switch(this.#r=e,this.#n||(this.#n=w(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#X(e),e){case`enable`:this.#J(n(`mic`,{size:28}),`Hold to enable push to talk`,this.#Y(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#J(n(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#Y(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#v?`Microphone unavailable`:`Microphone access is blocked`,t=this.#v??`Enable the microphone for this site in your browser settings, then hold again.`;this.#J(n(`mic-off`,{size:28}),e,w(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#S=w(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#b=w(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#x=w(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=w(`div`,{class:`slicc-composer__ptt-microw`},w(`div`,{class:`slicc-composer__ptt-mic`},n(`mic`,{size:28})),this.#S);this.#y=w(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#y,this.#b,this.#x),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#Q();break}}}#J(e,t,n){this.#n&&(this.#y=w(`div`,{class:`slicc-composer__ptt-label`},t),this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#n.replaceChildren(w(`div`,{class:`slicc-composer__ptt-mic`},e),this.#y,n))}#Y(e){return w(`div`,{class:`slicc-composer__ptt-load`},w(`span`,{class:`slicc-composer__ptt-load-text`},e),w(`div`,{class:`slicc-composer__ptt-bar`},w(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#X(e){this.#n&&(this.#n.classList.remove(`is-enable`,`is-prompting`,`is-denied`,`is-recording`,`is-finalizing`,`is-picking`),e!==`idle`&&this.#n.classList.add(`is-${e}`))}#Z(e,t=!1){let n=this.#b;if(!n)return;let r=e.trim().split(/\s+/).filter(Boolean);if(r.length===0){n.hidden=!0;return}n.textContent=r.slice(-8).join(` `),n.classList.toggle(`is-error`,t),n.hidden=!1}#Q(){let e=this.#x;if(!e)return;let t=this.#_;if(t?.state===`downloading`){if(t.download){let n=yn(t.download.etaSeconds??null);e.textContent=n?`Better speech recognition downloading · ready in ${n}`:`Better speech recognition downloading…`}else e.textContent=`Preparing enhanced speech…`;e.classList.remove(`is-error`),e.hidden=!1}else t?.state===`ready`&&t.engine===`enhanced`?(e.textContent=`Enhanced speech recognition`,e.classList.remove(`is-error`),e.hidden=!1):t?.state===`unavailable`&&t.message?(e.textContent=t.message,e.classList.add(`is-error`),e.hidden=!1):(e.classList.remove(`is-error`),e.hidden=!0)}#$(e){let t=this.#S;if(!t)return;this.#w=e;let r=w(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},n(`chevron-down`,{size:12}));r.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(r),t.hidden=!1}#ee(){this.#g?.(),this.#g=null,this.#n?.remove(),this.#n=null,this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#p=null,this.#v=null,this.#r=`idle`}});var bn=`
|
|
1673
|
+
`,cn=`slicc-composer-style`;function ln(e){if(e.getElementById(cn))return;let t=e.createElement(`style`);t.id=cn,t.textContent=sn,(e.head??e.documentElement).appendChild(t)}var un=1e3,dn=60,fn=1e4,pn=45e3,mn=1500;function hn(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>i(n),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e instanceof Error?e:Error(String(e)))})})}var gn=`slicc-composer:mic-device`;function _n(){try{return typeof localStorage>`u`?null:localStorage.getItem(gn)}catch{return null}}function vn(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(gn,e):localStorage.removeItem(gn)}catch{}}function yn(e){return e==null||!Number.isFinite(e)?``:e<60?`~${Math.max(1,Math.round(e))}s`:`~${Math.floor(e/60)}m ${Math.round(e%60)}s`}S(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=null;#l=null;#u=null;#d=`unknown`;#f=_n();#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=null;#w=[];connectedCallback(){ln(this.ownerDocument),this.#T(),this.addEventListener(`pointerdown`,this.#E)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#E),this.#c?.cancel(),this.#c=null,this.#j(),this.#i=!1,this.#o=null,this.#a++,this.#z(),this.#L(),this.#m&&clearTimeout(this.#m),this.#m=null,this.#R(),this.#G(),this.#ee()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#u??=s(),this.#u}set speech(e){this.#u=e,this.#d=`unknown`}get device(){return this.#f}set device(e){this.#f=e,vn(e)}get inner(){return this.#T(),this.#e}append(...e){this.#T(),this.#e.append(...e)}#T(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-composer__inner`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-composer__inner`,this.#e.setAttribute(`part`,`inner`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}#E=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t)||t.value!==``)return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}let n=this.ownerDocument;n.addEventListener(`pointerup`,this.#M),this.addEventListener(`pointercancel`,this.#N),n.addEventListener(`selectionchange`,this.#D);let r=this.#a;this.#h=setTimeout(()=>{this.#L(),this.#O(this.speech,r)},400)};#D=()=>{if(!this.#h)return;let e=this.ownerDocument.getSelection();!e||e.isCollapsed||e.toString()===``||(this.#i=!1,this.#a++,this.#o=null,this.#L(),this.#z(),this.#R())};async#O(e,t){let n=await Promise.race([e.permission().then(e=>(this.#d=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),dn))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#A(e,t);return}if(n===`denied`){this.#q(`denied`);return}this.#q(`enable`),this.#m=setTimeout(()=>{this.#m=null,this.#k(e,t)},un),n===`pending`&&e.permission().then(n=>{this.#d=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#I(),this.#A(e,t)):n===`denied`&&(this.#I(),this.#q(`denied`)))})}}#k(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#v=null,this.#q(`prompting`),hn(e.requestPermission(),fn,Error(`Microphone didn't respond. Check your mic, then hold again.`)).then(n=>{this.#d=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#A(e,t):n?this.#ee():this.#i?this.#q(`denied`):this.#ee())}).catch(e=>{this.#d=`denied`,t===this.#a&&(this.#i?(this.#v=e instanceof Error?e.message:String(e),this.#q(`denied`)):this.#ee())}))}#A(e,t){this.#r=`recording`,this.#q(`recording`),e.warmup(),this.#g?.(),this.#g=e.onStatus(e=>{this.#_=e,this.#Q()});let n=e.microphones();n.then(e=>{t===this.#a&&(this.#f??(this.#p=o(e)),i(e)&&this.#$(e))}).catch(()=>{});let r=(this.#f==null?hn(n,mn,Error(`microphone enumeration timed out`)).then(e=>o(e)).catch(()=>null):Promise.resolve(this.#f)).then(n=>e.start({deviceId:n??void 0,onPartial:e=>{t===this.#a&&this.#Z(e)},onError:e=>{t===this.#a&&this.#Z(e,!0)}}));this.#l=r,r.then(e=>{if(this.#l===r){if(this.#l=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#c=e}}).catch(e=>{this.#l===r&&(this.#l=null,t===this.#a&&this.#Z(e instanceof Error?e.message:String(e),!0))})}#j(){let e=this.#l;this.#l=null,e!==null&&e.then(e=>e.cancel(),()=>{})}#M=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#S,n=!1;if(this.#r===`recording`&&t&&!t.hidden)if(e.composedPath().includes(t))n=!0;else{let r=this.ownerDocument.elementFromPoint(e.clientX,e.clientY);n=r!=null&&t.contains(r)}if(n){this.#i=!1,this.#z(),this.#R(),this.#c?.cancel(),this.#c=null,this.#j(),this.#o=null,this.#B();return}this.#P(!0)};#N=e=>{(this.#s==null||e.pointerId===this.#s)&&this.#P(!1)};#P(e){if(!this.#i)return;switch(this.#i=!1,this.#L(),this.#z(),this.#R(),this.#r){case`enable`:this.#I(),this.#o=null,this.#ee();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#ee();return;case`recording`:break;default:this.#o=null,this.#ee();return}let t=this.#c;this.#c=null;let n=this.#l;if(this.#l=null,!e){t?.cancel(),n!==null&&n.then(e=>e.cancel(),()=>{}),this.#o=null,this.#ee();return}if(!t&&n===null){this.#o=null,this.#ee();return}this.#r=`finalizing`,this.#Z(`Transcribing…`);let r=this.#a;hn((t?Promise.resolve(t):n).then(e=>e.stop()),pn,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#ee(),this.#F(e))}).catch(()=>{r===this.#a&&(this.#ee(),this.#o=null)})}#F(e){let t=this.#o;if(this.#o=null,!t)return;let n=e.trim();if(!n){t.focus();return}t.value=t.value?/\s$/.test(t.value)?t.value+n:`${t.value} ${n}`:n,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.focus();let r=t.closest(`slicc-input-card`);r&&typeof r.submit==`function`?r.submit(`dictation`):t.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t.value,source:`dictation`}}))}#I(){this.#m&&clearTimeout(this.#m),this.#m=null}#L(){this.#h&&clearTimeout(this.#h),this.#h=null,this.ownerDocument.removeEventListener(`selectionchange`,this.#D)}#R(){this.ownerDocument.removeEventListener(`pointerup`,this.#M),this.removeEventListener(`pointercancel`,this.#N)}#z(){let e=this.#s;if(this.#s=null,e!=null)try{this.releasePointerCapture(e)}catch{}}#B(){this.#r=`picking`,this.#X(`picking`),this.#y&&(this.#y.textContent=`Choose a microphone`),this.#b&&(this.#b.hidden=!0),this.#V();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#U,!0),e.addEventListener(`keydown`,this.#W,!0)}#V(){let e=this.#S;if(!e||this.#C)return;let t=w(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),r=null,i=this.#f??this.#p;for(let e of this.#w){let a=e.deviceId===i,o=w(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":a?`true`:`false`,"data-device-id":e.deviceId},e.label,w(`span`,{class:`tick`},n(`check`,{size:14})));o.addEventListener(`click`,()=>{this.device=e.deviceId,this.#K()}),(a||!r)&&(r=o),t.appendChild(o)}this.#C=t,e.appendChild(t),this.#H(t,e),r?.focus()}#H(e,t){let n=t.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)-n.bottom-6-8,i=n.top-6-8,a=e.offsetHeight>r&&i>r;e.classList.toggle(`slicc-composer__ptt-device-menu--up`,a);let o=Math.max(a?i:r,0);e.style.maxHeight=`${Math.min(320,o)}px`}#U=e=>{this.#S&&e.composedPath().includes(this.#S)||this.#K()};#W=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#K())};#G(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#U,!0),e.removeEventListener(`keydown`,this.#W,!0)}#K(){this.#G(),this.#ee()}#q(e){switch(this.#r=e,this.#n||(this.#n=w(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#X(e),e){case`enable`:this.#J(n(`mic`,{size:28}),`Hold to enable push to talk`,this.#Y(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#J(n(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#Y(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#v?`Microphone unavailable`:`Microphone access is blocked`,t=this.#v??`Enable the microphone for this site in your browser settings, then hold again.`;this.#J(n(`mic-off`,{size:28}),e,w(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#S=w(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#b=w(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#x=w(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=w(`div`,{class:`slicc-composer__ptt-microw`},w(`div`,{class:`slicc-composer__ptt-mic`},n(`mic`,{size:28})),this.#S);this.#y=w(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#y,this.#b,this.#x),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#Q();break}}}#J(e,t,n){this.#n&&(this.#y=w(`div`,{class:`slicc-composer__ptt-label`},t),this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#n.replaceChildren(w(`div`,{class:`slicc-composer__ptt-mic`},e),this.#y,n))}#Y(e){return w(`div`,{class:`slicc-composer__ptt-load`},w(`span`,{class:`slicc-composer__ptt-load-text`},e),w(`div`,{class:`slicc-composer__ptt-bar`},w(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#X(e){this.#n&&(this.#n.classList.remove(`is-enable`,`is-prompting`,`is-denied`,`is-recording`,`is-finalizing`,`is-picking`),e!==`idle`&&this.#n.classList.add(`is-${e}`))}#Z(e,t=!1){let n=this.#b;if(!n)return;let r=e.trim().split(/\s+/).filter(Boolean);if(r.length===0){n.hidden=!0;return}n.textContent=r.slice(-8).join(` `),n.classList.toggle(`is-error`,t),n.hidden=!1}#Q(){let e=this.#x;if(!e)return;let t=this.#_;if(t?.state===`downloading`){if(t.download){let n=yn(t.download.etaSeconds??null);e.textContent=n?`Better speech recognition downloading · ready in ${n}`:`Better speech recognition downloading…`}else e.textContent=`Preparing enhanced speech…`;e.classList.remove(`is-error`),e.hidden=!1}else t?.state===`ready`&&t.engine===`enhanced`?(e.textContent=`Enhanced speech recognition`,e.classList.remove(`is-error`),e.hidden=!1):t?.state===`unavailable`&&t.message?(e.textContent=t.message,e.classList.add(`is-error`),e.hidden=!1):(e.classList.remove(`is-error`),e.hidden=!0)}#$(e){let t=this.#S;if(!t)return;this.#w=e;let r=w(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},n(`chevron-down`,{size:12}));r.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(r),t.hidden=!1}#ee(){this.#g?.(),this.#g=null,this.#n?.remove(),this.#n=null,this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#p=null,this.#v=null,this.#r=`idle`}});var bn=`
|
|
1643
1674
|
slicc-composer-capture {
|
|
1644
1675
|
position: relative;
|
|
1645
1676
|
display: block;
|
|
@@ -4448,24 +4479,20 @@ video {
|
|
|
4448
4479
|
}
|
|
4449
4480
|
`),V=null,H=null,oo=class e extends HTMLElement{#e;#t=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ao]}disconnectedCallback(){for(let e of this.#t)URL.revokeObjectURL(e);this.#t.length=0,V===this&&(V=null)}static open(t){e.close();let r=document.createElement(`slicc-quick-look`),i=t.path.split(`/`).pop()||t.path,a=w(`div`,{class:`backdrop`}),o=w(`button`,{class:`x`});o.appendChild(n(`x`,{size:14}));let s=w(`div`,{class:`header`},i,o),c=w(`div`,{class:`content`});c.appendChild(r.#r(t));let l=w(`div`,{class:`panel`},s,c);l.tabIndex=-1,r.#e.append(a,l),document.body.appendChild(r),V=r,l.focus(),a.addEventListener(`click`,()=>r.#n(`backdrop`)),o.addEventListener(`click`,()=>r.#n(`close-button`)),H&&document.removeEventListener(`keydown`,H),H=e=>{e.key===`Escape`&&r.#n(`escape`)},document.addEventListener(`keydown`,H)}static close(){if(V){for(let e of V.#t)URL.revokeObjectURL(e);V.remove(),V=null}H&&=(document.removeEventListener(`keydown`,H),null)}#n(t){this.dispatchEvent(new CustomEvent(`quick-look-close`,{bubbles:!0,composed:!0,detail:{reason:t}})),e.close()}#r(e){let t=e.mimeType;if(t.startsWith(`text/`)||t===`application/json`)return w(`pre`,null,typeof e.content==`string`?e.content:new TextDecoder().decode(e.content));if(t.startsWith(`image/`)){let n=new Blob([typeof e.content==`string`?new TextEncoder().encode(e.content):e.content],{type:t}),r=document.createElement(`img`),i=URL.createObjectURL(n);return this.#t.push(i),r.src=i,r.alt=e.path.split(`/`).pop()||``,r}if(t.startsWith(`audio/`)){let n=new Blob([typeof e.content==`string`?new TextEncoder().encode(e.content):e.content],{type:t}),r=document.createElement(`audio`);r.controls=!0;let i=URL.createObjectURL(n);return this.#t.push(i),r.src=i,r}if(t.startsWith(`video/`)){let n=new Blob([typeof e.content==`string`?new TextEncoder().encode(e.content):e.content],{type:t}),r=document.createElement(`video`);r.controls=!0;let i=URL.createObjectURL(n);return this.#t.push(i),r.src=i,r}return w(`div`,{class:`fallback`},`Preview not available for this file type (${so(typeof e.content==`string`?e.content.length:e.content.byteLength)})`)}};function so(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}S(`slicc-quick-look`,oo);var co=`
|
|
4450
4481
|
.slicc-chatpane {
|
|
4451
|
-
flex:
|
|
4452
|
-
width:
|
|
4482
|
+
flex: 1 1 0;
|
|
4483
|
+
width: 100%;
|
|
4453
4484
|
box-sizing: border-box;
|
|
4454
4485
|
display: flex;
|
|
4455
4486
|
flex-direction: column;
|
|
4487
|
+
min-width: 0;
|
|
4456
4488
|
min-height: 0;
|
|
4457
4489
|
font-family: var(--ui);
|
|
4458
4490
|
color: var(--ink);
|
|
4459
4491
|
background: var(--bg);
|
|
4460
|
-
transition: width .38s cubic-bezier(.4, 0, .2, 1);
|
|
4461
4492
|
}
|
|
4462
4493
|
.slicc-chatpane[hidden] {
|
|
4463
4494
|
display: none;
|
|
4464
4495
|
}
|
|
4465
|
-
/* narrow-chat (.shell.open .chatpane): the column shrinks to 34% and slides. */
|
|
4466
|
-
.slicc-chatpane[narrow] {
|
|
4467
|
-
width: 34%;
|
|
4468
|
-
}
|
|
4469
4496
|
/* The reading column is background-free in every layout (the frosted card was
|
|
4470
4497
|
dropped — the shader renders low-contrast instead). In the narrow column the
|
|
4471
4498
|
inner keeps the SAME centered, capped reading width as the wide layout: the
|
|
@@ -4501,10 +4528,13 @@ video {
|
|
|
4501
4528
|
}
|
|
4502
4529
|
/* Pin the dock to its full 48px basis. This selector outranks the dock's own
|
|
4503
4530
|
"flex: 0 0 48px" rule, so an "auto" basis here would collapse the rail to its
|
|
4504
|
-
~35px icon-content width and leave a bare-shader strip down the right edge.
|
|
4531
|
+
~35px icon-content width and leave a bare-shader strip down the right edge.
|
|
4532
|
+
z-index 3 lifts the rail above the composer's full-bleed band (z-index 2,
|
|
4533
|
+
extending -100vw rightward — slicc-composer.ts), which would otherwise tint
|
|
4534
|
+
and blur the rail's own opaque strip. */
|
|
4505
4535
|
.slicc-shell > slicc-dock,
|
|
4506
|
-
.slicc-shell > .dock { flex: 0 0 48px; }
|
|
4507
|
-
`,mo=`slicc-shell-style`;function ho(e){if(e.getElementById(mo))return;let t=e.createElement(`style`);t.id=mo,t.textContent=po,(e.head??e.documentElement).appendChild(t)}S(`slicc-shell`,class extends HTMLElement{connectedCallback(){ho(this.ownerDocument),this.classList.add(`slicc-shell`),this.setAttribute(`part`,`shell`)}get dockTree(){return this.querySelector(`:scope > slicc-dock-tree, :scope > .dock-tree`)}get dock(){return this.querySelector(`:scope > slicc-dock, :scope > .dock`)}});var
|
|
4536
|
+
.slicc-shell > .dock { flex: 0 0 48px; position: relative; z-index: 3; }
|
|
4537
|
+
`,mo=`slicc-shell-style`;function ho(e){if(e.getElementById(mo))return;let t=e.createElement(`style`);t.id=mo,t.textContent=po,(e.head??e.documentElement).appendChild(t)}var go=`chat`;S(`slicc-shell`,class extends HTMLElement{#e=e=>{let t=e.detail?.placed;if(!Array.isArray(t))return;let n=t.some(e=>e!==go);this.querySelector(`slicc-chatpane`)?.toggleAttribute(`narrow`,n)};connectedCallback(){ho(this.ownerDocument),this.classList.add(`slicc-shell`),this.setAttribute(`part`,`shell`),this.addEventListener(`dock-tree-render`,this.#e)}disconnectedCallback(){this.removeEventListener(`dock-tree-render`,this.#e)}get dockTree(){return this.querySelector(`:scope > slicc-dock-tree, :scope > .dock-tree`)}get dock(){return this.querySelector(`:scope > slicc-dock, :scope > .dock`)}});var _o=`http://www.w3.org/2000/svg`,vo=18,yo=16,U={cx:55,cy:50,r:38},W={cx:145,cy:50,r:38},bo=1,xo=12,So=.72,Co=[.08,.36,.68,.94],wo=1372365086,To=2654435769,Eo=2246822507,Do=Date.UTC(2001,0,1),Oo={cone:{vb:`70 330 440 570`,eyes:{top:-18.5,left:17,width:70,height:44},zoom:3,glyph:96},scoop:{vb:`0 0 580 470`,eyes:{top:30,left:15,width:70,height:45},zoom:2.65,glyph:96}},ko={cone:`#D2691E`,scoop:`#FFB6C1`},Ao=T(`
|
|
4508
4538
|
:host{display:block;width:26px;height:26px;pointer-events:none;}
|
|
4509
4539
|
.avatar{position:relative;display:block;width:100%;height:100%;overflow:hidden;border-radius:7px;background:color-mix(in srgb,var(--slicc-agent-tabs-hue) 18%,transparent);}
|
|
4510
4540
|
.icon-inner{position:absolute;inset:0;transform-origin:0 0;transform:translate(var(--tx),var(--ty)) scale(var(--zoom));}
|
|
@@ -4515,7 +4545,7 @@ video {
|
|
|
4515
4545
|
:host([blink]) .eye-blink{transform-box:fill-box;transform-origin:center;animation:slicc-agent-avatar-blink 3.4s ease-in-out infinite;}
|
|
4516
4546
|
:host([blink]) .eye-r{animation-duration:4.6s;}
|
|
4517
4547
|
@media (prefers-reduced-motion:reduce){:host([blink]) .eye-blink{animation:none;}}
|
|
4518
|
-
`);function G(e,t,...n){let r=document.createElementNS(
|
|
4548
|
+
`);function G(e,t,...n){let r=document.createElementNS(_o,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function jo(e,t){let n=e.replace(`#`,``),r=n.length===3?[...n].map(e=>`${e}${e}`).join(``):n,i=Number.parseInt(r,16);if(!Number.isFinite(i))return e;let a=t<0?0:255,o=e=>Math.round(e+(a-e)*Math.abs(t)).toString(16).padStart(2,`0`);return`#${o(i>>16&255)}${o(i>>8&255)}${o(i&255)}`}function Mo(e,t,n){let r=[[`path`,{d:`M108.22,414.88l189.84,460.03c1.36,3.3,6.09,3.16,7.25-.22l159.34-463.34c.87-2.53-1.03-5.16-3.7-5.13l-349.18,3.32c-2.74.03-4.59,2.82-3.55,5.35Z`,fill:e,stroke:t,"stroke-linejoin":`round`,"stroke-width":20}],[`path`,{d:`M261.93,482.48h0c15.03-15.03,4.46-40.72-16.79-40.83h0c-21.37-.11-32.14,25.72-17.03,40.83h0c9.34,9.34,24.48,9.34,33.82,0Z`,fill:n}],[`path`,{d:`M384.85,527.49l-51.82,51.82c-2.24,2.24-2.24,5.86,0,8.1l55.71,55.71c2.24,2.24,5.86,2.24,8.1,0h0c.62-.62,1.08-1.36,1.37-2.19l26.52-77.11c.71-2.07.18-4.36-1.37-5.91l-30.41-30.41c-2.24-2.24-5.86-2.24-8.1,0Z`,fill:n}],[`path`,{d:`M371.7,684.58l-25.94,25.94c-2.24,2.24-2.24,5.86,0,8.1l12.67,12.67c2.99,2.99,8.09,1.82,9.46-2.19l13.28-38.61c1.97-5.74-5.17-10.2-9.46-5.91Z`,fill:n}],[`path`,{d:`M159.42,564.14l2.73,6.83c1.52,3.82,6.46,4.83,9.37,1.93l2.05-2.05c2.24-2.24,2.24-5.86,0-8.1l-4.78-4.78c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}],[`path`,{d:`M243.92,633.11l-48.65-48.65c-5.24-5.24-13.74-5.24-18.99,0h0c-3.8,3.8-4.97,9.49-2.98,14.47l27.77,69.54c3.58,8.95,15.14,11.33,21.96,4.51l20.89-20.89c5.24-5.24,5.24-13.74,0-18.99Z`,fill:n}],[`path`,{d:`M211.32,533.1h0c14.11-14.11,14.11-36.98,0-51.08l-34.94-34.94c-.72-.72-.72-1.89,0-2.62h0c1.16-1.16.34-3.15-1.3-3.16l-11.23-.06c-25.62-.13-43.23,25.72-33.73,49.51l5.37,13.45c1.82,4.55,4.54,8.68,8,12.15l16.74,16.74c14.11,14.11,36.98,14.11,51.08,0Z`,fill:n}],[`path`,{d:`M263.74,792.53h0c-5.69,5.69-7.45,14.23-4.46,21.71l22.5,56.36c6.92,17.34,31.68,16.74,37.75-.92l8.66-25.2c2.5-7.28.64-15.35-4.8-20.79l-31.17-31.17c-7.87-7.87-20.62-7.87-28.48,0Z`,fill:n}],[`path`,{d:`M392.94,503.07l40.81-40.81c2.24-2.24,5.86-2.24,8.1,0l.06.06c2.24,2.24,2.24,5.86,0,8.1l-40.81,40.81c-2.24,2.24-2.24,5.86,0,8.1l22.48,22.48c2.99,2.99,8.09,1.82,9.46-2.19l30.71-89.32c1.27-3.71-1.47-7.57-5.39-7.59l-120.63-.6c-5.11-.03-7.69,6.16-4.08,9.77l51.18,51.18c2.24,2.24,5.86,2.24,8.1,0Z`,fill:n}]],i=[[274.59,463.59,84.73,95.66,42.36,`translate(-268.79 373.91) rotate(-45)`],[291.06,603.84,72.24,90.24,36.12,`translate(-363.06 421.43) rotate(-45)`],[217.18,527.25,72.24,95.66,36.12,`translate(-332.45 347.55) rotate(-45)`],[236.26,661.25,67.04,90.24,33.52,`translate(-420.46 397.65) rotate(-45)`]],a=r.map(([e,t])=>G(e,t));return a.push(...i.map(([e,t,r,i,a,o])=>G(`rect`,{x:e,y:t,width:r,height:i,rx:a,ry:a,transform:o,fill:n})),G(`ellipse`,{cx:288.37,cy:404.38,rx:182.34,ry:67.01,fill:e,stroke:t,"stroke-miterlimit":10,"stroke-width":20})),a}function No(e,t){return[G(`path`,{d:`M566.75,340.67c0-29.85-12.97-56.87-33.96-76.47,4.8-9.98,7.44-20.71,7.44-31.9,0-38.29-30.62-71.33-74.92-86.77.33-3.07.51-6.17.51-9.3,0-69.72-84.29-126.24-188.26-126.24s-188.26,56.52-188.26,126.24c0,4,.29,7.95.83,11.86-34.94,15.4-58.48,44.25-58.48,77.34,0,18.21,7.15,34.25,19.39,49.26-25.1,19.88-41.05,49.47-41.05,82.54,0,59.85,52.15,108.37,116.49,108.37,10.83,0,21.3-1.4,31.26-3.98,31.42,41.91,83.55,69.34,142.55,69.34,64.73,0,121.2-33,151.11-81.94,63.8-.57,115.34-48.85,115.34-108.34Z`,fill:e,stroke:t,"stroke-width":20})]}function Po(e){return e<=50?1:e>=85?2.2:1+(e-50)/35*1.2}function Fo(e,t,n){return G(`g`,{class:`pupil pupil-${t}`},G(`circle`,{cx:e,cy:50,r:n,fill:`#000`}),G(`circle`,{cx:e-n*.3,cy:50-n*.35,r:n*.4,fill:`#fff`}))}function Io(e,t,n){return G(`g`,{class:`eye-blink eye-${t}`},G(`circle`,{cx:e,cy:50,r:38,fill:`#fff`,stroke:`#000`,"stroke-width":4}),Fo(e,t,n))}function Lo(e,t){let n=`slicc-agent-avatar-noise-${t}`;return G(`g`,{class:`eye-static eye-${t}`},G(`defs`,{},G(`clipPath`,{id:n},G(`circle`,{cx:e,cy:50,r:38}))),G(`circle`,{cx:e,cy:50,r:38,fill:`#fff`}),G(`g`,{class:`noise noise-${t}`,"clip-path":`url(#${n})`,"data-cell-size":bo}),G(`circle`,{class:`eye-outline`,cx:e,cy:50,r:38,fill:`none`,stroke:`#000`,"stroke-width":4}))}function Ro(e){return e^=e<<13,e^=e>>>17,e^=e<<5,e>>>0}function zo(e){return(wo^Math.imul(e,Eo))>>>0}function Bo(e,t){return(zo(e)^Math.imul(t,To))>>>0}function Vo(){return Math.floor((Date.now()-Do)/1e3*xo)>>>0}function Ho(e){return[G(`circle`,{cx:e,cy:50,r:38,fill:`#fff`,stroke:`#000`,"stroke-width":4}),G(`line`,{x1:e-15,y1:35,x2:e+15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`}),G(`line`,{x1:e+15,y1:35,x2:e-15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`})]}function Uo(e,t,n,r,i){let a=n-t,o=r-50,s=Math.hypot(a,o),c=Math.min(s,i),l=s>0?a/s*c:0,u=s>0?o/s*c:0;e.setAttribute(`transform`,`translate(${l},${u})`)}S(`slicc-agent-avatar`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`fill`,`connection`];#e;#t=e=>this.#b(e);#n=()=>{this.#f(),this.#m()===`static`&&this.#h()};#r=null;#i=null;#a=null;#o=null;#s=[];#c=null;#l=yo;#u=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ao]}connectedCallback(){this.#r=window.matchMedia(`(prefers-reduced-motion: reduce)`),this.#r.addEventListener(`change`,this.#n),this.#d(),this.#f()}disconnectedCallback(){this.#p(),this.#v(),this.#r?.removeEventListener(`change`,this.#n),this.#r=null}attributeChangedCallback(){this.isConnected&&(this.#d(),this.#f())}#d(){this.#v(),this.#s=[];let e=this.getAttribute(`type`)===`cone`?`cone`:`scoop`,t=Oo[e],n=this.getAttribute(`color`)??ko[e],r=this.#m(),i=vo*Po(Math.max(0,Math.min(100,Number.parseFloat(this.getAttribute(`fill`)??`0`)||0)));this.#l=Math.max(2,Math.min(yo,U.r-i-4));let a=(t.eyes.left+t.eyes.width/2)/100,o=(t.eyes.top+t.eyes.height/2)/100,s=e===`cone`?Mo(n,jo(n,-.38),jo(n,.3)):No(n,jo(n,-.32)),c=G(`svg`,{class:`glyph`,viewBox:t.vb,preserveAspectRatio:`xMidYMid meet`,style:`--g:${t.glyph}%`},...s),l=r===`dead`?[...Ho(U.cx),...Ho(W.cx)]:r===`none`?[]:r===`static`?[Lo(U.cx,`l`),Lo(W.cx,`r`)]:[Io(U.cx,`l`,i),Io(W.cx,`r`,i)];this.#o=G(`svg`,{class:`eyes-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...l);let u=w(`span`,{class:`eyes`,style:`top:${t.eyes.top}%;left:${t.eyes.left}%;width:${t.eyes.width}%;height:${t.eyes.height}%`});u.append(this.#o);let d=w(`span`,{class:`icon-inner`,style:`--tx:${((.5-t.zoom*a)*100).toFixed(2)}%;--ty:${((.5-t.zoom*o)*100).toFixed(2)}%;--zoom:${t.zoom}`},c,u);this.#e.replaceChildren(w(`span`,{class:`avatar`,"aria-hidden":`true`},d)),this.#i=this.#e.querySelector(`.pupil-l`),this.#a=this.#e.querySelector(`.pupil-r`),r===`static`&&this.#h()}#f(){let e=this.#m()===`open`&&!this.#r?.matches;e&&!this.#u?(this.ownerDocument.addEventListener(`pointermove`,this.#t),this.#u=!0):e||(this.#p(),this.#y())}#p(){this.#u&&=(this.ownerDocument.removeEventListener(`pointermove`,this.#t),!1)}#m(){let e=this.getAttribute(`connection`);if(e!==null&&e!==`connected`)return`static`;let t=this.getAttribute(`eyes`);return t===`dead`||t===`none`||t===`static`?t:`open`}#h(){if(this.#v(),this.#s.length===0&&this.#g(),this.#r?.matches){this.#_(null);return}this.#_(Vo()),this.#c=window.setInterval(()=>{this.#_(Vo())},1e3/xo)}#g(){let e=this.#o?.getBoundingClientRect(),t=e?Math.min(e.width/200,e.height/100):0,n=bo/(t>0?t:.25);this.#s=[...this.#e.querySelectorAll(`.noise`)].map((e,t)=>{let r=t===0?U.cx:W.cx,i=[],a=r-U.r,o=r+U.r,s=50-U.r,c=50+U.r;for(let e=s;e<c;e+=n)for(let t=a;t<o;t+=n){let r=G(`rect`,{x:t,y:e,width:Math.min(n,o-t),height:Math.min(n,c-e),opacity:So});i.push(r)}return e.replaceChildren(...i),i})}#_(e){this.#s.forEach((t,n)=>{let r=e===null?zo(n):Bo(n,e),i=r===0?wo:r;(t[0]?.parentElement)?.setAttribute(`data-seed`,String(i));for(let e of t){i=Ro(i);let t=`${Co[i%Co.length]*100}%`;e.setAttribute(`fill`,`rgb(${t} ${t} ${t})`)}})}#v(){this.#c!==null&&(window.clearInterval(this.#c),this.#c=null)}#y(){this.#i?.setAttribute(`transform`,`translate(0,0)`),this.#a?.setAttribute(`transform`,`translate(0,0)`)}#b(e){if(!this.#o||!this.#i||!this.#a)return;let t=this.#o.getBoundingClientRect();if(!t.width||!t.height)return;let n=(e.clientX-t.left)*(200/t.width),r=(e.clientY-t.top)*(100/t.height);Uo(this.#i,U.cx,n,r,this.#l),Uo(this.#a,W.cx,n,r,this.#l)}});var Wo=T(`
|
|
4519
4549
|
:host{display:inline-block;}
|
|
4520
4550
|
.switcher-more{position:relative;}
|
|
4521
4551
|
.morebtn{display:none;font:inherit;font-size:13px;font-weight:600;color:var(--txt-2);background:transparent;border:1px solid var(--line);border-radius:9999px;height:var(--ctl-h,30px);padding:0 11px;cursor:pointer;line-height:1;align-items:center;}
|
|
@@ -4547,14 +4577,14 @@ video {
|
|
|
4547
4577
|
@keyframes scoopReveal{from{opacity:0;transform:translateY(-4px);}to{opacity:1;transform:none;}}
|
|
4548
4578
|
@keyframes scoopArc{from{transform:rotate(-90deg);}to{transform:rotate(270deg);}}
|
|
4549
4579
|
@media (prefers-reduced-motion:reduce){.popup-row{animation:none;}.popup-row[data-state="working"] .glyph-arc{animation:none;transform:rotate(-90deg);}}
|
|
4550
|
-
`),
|
|
4551
|
-
.slicc-agent-tabs{display:flex;align-items:center;gap:${
|
|
4580
|
+
`),Go=[4,5,3,7,1,6,2,0,8],Ko=`http://www.w3.org/2000/svg`,qo=5,Jo=2*Math.PI*qo;function K(e,t,...n){let r=document.createElementNS(Ko,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Yo(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function Xo(e){return e.state??`idle`}function Zo(e){return(90+Yo(e)*2.7)/360*Jo}function Qo(e,t){let n=[];return e===`initializing`?n.push(K(`circle`,{class:`initializing-ring`,cx:7,cy:7,r:qo,"stroke-width":1.7})):n.push(K(`circle`,{class:`glyph-base`,cx:7,cy:7,r:qo,"stroke-width":1.5})),(e===`working`||e===`idle`)&&n.push(K(`circle`,{class:`glyph-arc`,cx:7,cy:7,r:qo,"stroke-width":2,"stroke-dasharray":`${Zo(t).toFixed(3)} ${Jo.toFixed(3)}`,"stroke-dashoffset":0})),e===`working`&&n.push(K(`circle`,{class:`glyph-pin`,cx:7,cy:7,r:1.25})),e===`broken`&&n.push(K(`line`,{class:`broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),K(`line`,{class:`broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8})),K(`svg`,{class:`status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...n)}function $o(e){return e.state===`broken`?`broken`:(e.fill??0)>=75?`near-limit`:e.state===`working`?`working`:`idle`}function es(e){return e===`broken`?3:e===`near-limit`?2:+(e===`working`)}function ts(e){let t=e.reduce((e,t)=>{let n=$o(t);return es(n)>es(e)?n:e},`idle`),n=t===`near-limit`?`near context limit`:t;return`${e.length} hidden scoop${e.length===1?``:`s`}; worst state ${n}`}function ns(e,t=!1){if(t)return w(`span`,{class:`overflow-grid-cell overflow-grid-cell--plus`,"aria-hidden":`true`},w(`span`,{class:`overflow-plus-bar overflow-plus-bar--horizontal`}),w(`span`,{class:`overflow-plus-bar overflow-plus-bar--vertical`}));let n={class:`overflow-grid-cell`,"aria-hidden":`true`};return e&&(n[`data-dot-state`]=e),w(`span`,n)}function rs(e){let t=e.map((e,t)=>({order:t,state:$o(e)})).sort((e,t)=>es(t.state)-es(e.state)||e.order-t.order).slice(0,e.length>9?8:9),n=Array.from({length:Go.length},()=>ns());return t.forEach((e,t)=>{n[Go[t]]=ns(e.state)}),e.length>9&&(n[Go.at(-1)]=ns(void 0,!0)),w(`span`,{class:`overflow-grid`,role:`img`,"aria-label":ts(e),"data-hidden-count":String(e.length)},...n)}S(`slicc-scoop-overflow`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n;#r;#i;#a;#o=e=>{this.open&&!this.contains(e.target)&&this.close()};#s=e=>{!this.open||e.key!==`Escape`||(e.preventDefault(),this.close(),this.#r.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Wo]}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s)}attributeChangedCallback(e){e===`open`&&this.#n&&this.#u()}get items(){return this.#t}set items(e){this.#t=Array.isArray(e)?e:[],this.isConnected&&this.#l()}get count(){return this.#t.length}get hasOverflow(){return this.#t.length>0}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}show(){this.open||=!0}close(){this.open&&=!1}toggle(){this.open=!this.open}#c(){this.#i=w(`slot`,{name:`more`},rs(this.#t)),this.#r=w(`button`,{class:`morebtn`,part:`more`,type:`button`,title:`More scoops`,"aria-haspopup":`true`,"aria-expanded":`false`},this.#i),this.#a=w(`div`,{class:`pop`,part:`pop`,role:`menu`}),this.#n=w(`div`,{class:`switcher-more`,part:`wrap`},this.#r,this.#a),this.#r.addEventListener(`click`,e=>{e.stopPropagation(),this.toggle()}),this.#e.replaceChildren(this.#n),this.#l(),this.#u()}#l(){let e=this.#t.length;e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`),this.#n.classList.toggle(`has-overflow`,e>0),this.#r.setAttribute(`aria-haspopup`,`true`);let t=ts(this.#t);if(this.#r.setAttribute(`aria-label`,`${t}. Show hidden scoops`),this.#i.replaceChildren(rs(this.#t)),e===0){this.#a.replaceChildren(w(`slot`,{name:`empty`})),this.open&&this.close();return}let n=[];this.#t.forEach((e,t)=>{let r=e.id,i=e.label??e.id,a=Xo(e),o=Yo(e.fill),s=w(`button`,{class:`popup-row`,part:`row`,type:`button`,role:`menuitem`,"aria-label":`${i}: ${a}, ${o}% context fill`,"data-state":a,"data-k":r,style:`--hue:${e.color??`var(--rose)`};--i:${t}`},Qo(a,o),w(`span`,{class:`popup-label`},i),w(`span`,{class:`popup-state`},`${a} · ${o}%`));s.addEventListener(`click`,()=>{let e=s.dataset.k??``,t=this.#t.find(t=>t.id===e);this.#d(e,t?.label??e)}),n.push(s)}),this.#a.replaceChildren(...n)}#u(){let e=this.open;this.#n.classList.toggle(`open`,e),this.#r.setAttribute(`aria-expanded`,e?`true`:`false`),document.removeEventListener(`click`,this.#o),document.removeEventListener(`keydown`,this.#s),e&&(document.addEventListener(`click`,this.#o),document.addEventListener(`keydown`,this.#s))}#d(e,t){this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0})),this.close()}});var q=`slicc-agent-tabs`,is=`${q}-style`,as=`http://www.w3.org/2000/svg`,J=5,os=2*Math.PI*J,ss=26,cs=8,ls=6,us=39,ds=`sliccy`,fs=14,ps=5,ms=16,hs=4,gs=65,_s={cone:`var(--waffle)`,researcher:`var(--cyan)`,designer:`var(--violet)`,tester:`var(--amber)`,triage:`var(--green)`},vs=`
|
|
4581
|
+
.slicc-agent-tabs{display:flex;align-items:center;gap:${cs}px;min-width:0;overflow:visible;color:var(--ink);font-family:var(--ui);}
|
|
4552
4582
|
.slicc-agent-tabs *{box-sizing:border-box;}
|
|
4553
|
-
.slicc-agent-tabs__focus-avatar{display:block;flex:0 0 ${
|
|
4583
|
+
.slicc-agent-tabs__focus-avatar{display:block;flex:0 0 ${ss}px;width:${ss}px;height:${ss}px;pointer-events:none;}
|
|
4554
4584
|
.slicc-agent-tabs__track-frame{position:relative;flex:0 1 auto;min-width:0;height:var(--ctl-h,30px);overflow:visible;border:1px solid var(--line);border-radius:9px;background:var(--ghost);}
|
|
4555
4585
|
.slicc-agent-tabs__track{display:flex;align-items:center;min-width:0;height:100%;padding:2px;overflow:hidden;}
|
|
4556
4586
|
.slicc-agent-tabs.has-overflow .slicc-agent-tabs__track{padding-right:41px;}
|
|
4557
|
-
.slicc-agent-tabs__segment{position:relative;display:inline-flex;flex:0 1 auto;align-items:center;justify-content:center;gap:${
|
|
4587
|
+
.slicc-agent-tabs__segment{position:relative;display:inline-flex;flex:0 1 auto;align-items:center;justify-content:center;gap:${ps}px;width:max-content;min-width:var(--slicc-agent-tabs-segment-floor,${gs}px);max-width:160px;height:24px;padding:0 8px;overflow:hidden;color:var(--txt-2);font:500 11px/1 var(--ui);white-space:nowrap;border:0;border-radius:6px;background:transparent;cursor:pointer;}
|
|
4558
4588
|
.slicc-agent-tabs__segment:hover{color:var(--ink);}
|
|
4559
4589
|
.slicc-agent-tabs__segment[aria-selected='true']{color:var(--ink);background:var(--canvas);box-shadow:0 1px 3px color-mix(in srgb,var(--ink) 12%,transparent);}
|
|
4560
4590
|
.slicc-agent-tabs__segment.hide{display:none;}
|
|
@@ -4582,7 +4612,7 @@ video {
|
|
|
4582
4612
|
.slicc-agent-tabs slicc-scoop-overflow::part(pop){right:0;left:auto;}
|
|
4583
4613
|
@keyframes slicc-agent-tabs-arc{from{transform:rotate(-90deg);}to{transform:rotate(270deg);}}
|
|
4584
4614
|
@media (prefers-reduced-motion:reduce){.slicc-agent-tabs__glyph-arc{animation:none;transform:rotate(-90deg);}.slicc-agent-tabs__glyph-glow{transition:none;}}
|
|
4585
|
-
`;function
|
|
4615
|
+
`;function ys(e){if(e.getElementById(is))return;let t=e.createElement(`style`);t.id=is,t.textContent=vs,(e.head??e.documentElement).append(t)}function Y(e,t,...n){let r=document.createElementNS(as,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function X(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function bs(e){let t=e.ownerDocument.createElement(`canvas`).getContext(`2d`),n=e.ownerDocument.defaultView?.getComputedStyle(e);return!t||!n?gs:(t.font=n.font,Math.ceil(t.measureText(ds).width+fs+ps+ms)+hs)}function xs(e){return(90+X(e)*2.7)/360*os}function Ss(e,t){return e.state?e.state:e.eyes===`dead`?`broken`:t===e.key?`working`:`idle`}function Cs(e){return e.type===`cone`||e.key===`cone`?`cone`:`scoop`}function ws(e){return e.eyes??`open`}function Ts(e){return _s[e.key]??e.color??`var(--rose)`}function Es(e){let t=[Y(`circle`,{class:`${q}__glyph-glow`,cx:7,cy:7,r:J,"stroke-width":1.5}),Y(`circle`,{class:`${q}__glyph-base`,cx:7,cy:7,r:J,"stroke-width":1.5}),Y(`circle`,{class:`${q}__glyph-arc`,cx:7,cy:7,r:J,"stroke-width":2,"stroke-dasharray":`${xs(X(e.fill)).toFixed(3)} ${os.toFixed(3)}`,"stroke-dashoffset":0}),Y(`circle`,{class:`${q}__glyph-pin`,cx:7,cy:7,r:1.25}),Y(`line`,{class:`${q}__broken-x`,x1:4.8,y1:4.8,x2:9.2,y2:9.2,"stroke-width":1.8}),Y(`line`,{class:`${q}__broken-x`,x1:9.2,y1:4.8,x2:4.8,y2:9.2,"stroke-width":1.8}),Y(`circle`,{class:`${q}__initializing-ring`,cx:7,cy:7,r:J,"stroke-width":1.7})];return Y(`svg`,{class:`${q}__status-glyph`,viewBox:`0 0 14 14`,width:14,height:14,"aria-hidden":`true`},...t)}S(`slicc-agent-tabs`,class extends HTMLElement{static observedAttributes=[`active`,`attention`,`connection`];#e=[];#t=null;#n=null;#r=null;#i=null;#a=null;#o=!1;#s=null;#c=!1;#l=null;#u=e=>this.#C(e);#d=e=>this.#w(e);connectedCallback(){ys(this.ownerDocument),this.classList.add(q),this.setAttribute(`part`,`row`),this.#c||=!0,this.addEventListener(`click`,this.#u),this.addEventListener(`keydown`,this.#d),this.#p(),this.#D(),requestAnimationFrame(()=>this.reflow())}disconnectedCallback(){this.#a?.disconnect(),this.#a=null,this.#s!==null&&cancelAnimationFrame(this.#s),this.#s=null,this.removeEventListener(`click`,this.#u),this.removeEventListener(`keydown`,this.#d)}attributeChangedCallback(){!this.#c||!this.isConnected||(this.#p(),this.reflow())}get scoops(){return this.#e.map(e=>({...e}))}set scoops(e){let t=new Map;if(Array.isArray(e))for(let n of e)t.has(n.key)||t.set(n.key,{...n});this.#e=[...t.values()],this.#c&&this.isConnected&&(this.#p(),this.reflow())}get attention(){return this.getAttribute(`attention`)}set attention(e){e==null?this.removeAttribute(`attention`):this.setAttribute(`attention`,e)}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get connection(){return this.getAttribute(`connection`)===`disconnected`?`disconnected`:`connected`}set connection(e){this.setAttribute(`connection`,e)}select(e){this.active=e;let t=this.#e.find(t=>t.key===e)?.label??e;this.dispatchEvent(new CustomEvent(`slicc-scoop-select`,{detail:{id:e,key:e,label:t},bubbles:!0,composed:!0}))}reflow(){if(!(!this.isConnected||this.#o)){this.#o=!0;try{this.#f()}finally{this.#o=!1}}}#f(){let e=[...this.querySelectorAll(`.${q}__segment`)];for(let t of e)t.classList.remove(`hide`);if(this.classList.remove(`has-overflow`),e.length===0){this.#S([]);return}this.#l===null&&(this.#l=bs(e[0]),this.style.setProperty(`--slicc-agent-tabs-segment-floor`,`${this.#l}px`));let t=this.clientWidth;if(t<=0){this.#S([]),requestAnimationFrame(()=>{this.isConnected&&this.clientWidth>0&&this.reflow()});return}let n=Math.max(0,t-ss-cs-ls),r=e.map(e=>e.offsetWidth),i=r.reduce((e,t)=>e+t,0),a=e.length>1&&i>n+1;this.classList.toggle(`has-overflow`,a);let o=a?e.map(e=>e.offsetWidth):r,s=Math.max(0,n-(a?us:0));if(!a){this.#S([]);return}let c=[],l=0;e.forEach((e,t)=>{t===0||c.length===0&&l+o[t]<=s?l+=o[t]:(e.classList.add(`hide`),c.push(e))}),this.#S(c)}#p(){let e=this.#T(),t=this.#e.find(e=>e.key===this.active)??this.#e.at(0)??null;this.#m(),this.#_(t),this.#b(t?.key??null),e!=null&&!this.#e.some(t=>t.key===e)&&this.#E(t?.key??null)?.focus()}#m(){if(this.#n&&this.#r&&this.#i&&this.contains(this.#r))return;this.#n=w(`div`,{class:`${q}__track`,part:`track`,role:`tablist`,"aria-label":`Agents`});let e=this.ownerDocument.createElement(`slicc-scoop-overflow`);e.setAttribute(`part`,`overflow`),e.addEventListener(`slicc-scoop-select`,e=>{let t=e.detail?.id;typeof t==`string`&&(e.stopPropagation(),this.select(t))}),this.#i=e,this.#r=w(`div`,{class:`${q}__track-frame`,part:`track-frame`},this.#n,e),this.replaceChildren(this.#r)}#h(e){let t=w(`slicc-agent-avatar`,{class:`${q}__focus-avatar`,part:`avatar`,role:`img`});return this.#g(t,e),t}#g(e,t){let n=Ss(t,this.attention);this.#x(e,`type`,Cs(t)),this.#x(e,`color`,t.color??null),this.#x(e,`eyes`,ws(t)),this.#x(e,`connection`,this.getAttribute(`connection`)),this.#x(e,`fill`,String(Math.round(X(t.fill)))),this.#x(e,`blink`,n===`working`),this.#x(e,`aria-label`,`${t.label??t.key} focused agent`),e.style.setProperty(`--slicc-agent-tabs-hue`,Ts(t))}#_(e){if(!e){this.#t?.remove(),this.#t=null;return}let t=this.#t??this.#h(e);this.#t=t,this.#g(t,e),(t.parentElement!==this||t.nextElementSibling!==this.#r)&&this.insertBefore(t,this.#r)}#v(e,t){let n=w(`button`,{part:`segment`,type:`button`,role:`tab`},Es(e),w(`span`,{class:`${q}__label`},e.label??e.key));return this.#y(n,e,t),n}#y(e,t,n){let r=Ss(t,this.attention),i=X(t.fill),a=this.attention===t.key;e.className=`${q}__segment${t.ephemeral?` ephemeral`:``}`,e.setAttribute(`aria-selected`,String(t.key===n)),e.tabIndex=t.key===n?0:-1,e.setAttribute(`aria-label`,`${t.label??t.key}: ${r}, ${Math.round(i)}% context fill${a?`, spoke most recently`:``}`),e.dataset.k=t.key,e.dataset.state=r,this.#x(e,`data-attention`,a?`true`:null),e.style.setProperty(`--slicc-agent-tabs-hue`,Ts(t));let o=e.querySelector(`.${q}__label`);o&&(o.textContent=t.label??t.key),e.querySelector(`.${q}__glyph-arc`)?.setAttribute(`stroke-dasharray`,`${xs(i).toFixed(3)} ${os.toFixed(3)}`)}#b(e){if(!this.#n)return;let t=new Map;for(let e of this.#n.querySelectorAll(`:scope > .${q}__segment`)){let n=e.dataset.k??``;t.has(n)?e.remove():t.set(n,e)}let n=this.#e.map(n=>{let r=t.get(n.key)??this.#v(n,e);return t.delete(n.key),this.#y(r,n,e),r});for(let e of t.values())e.remove();n.forEach((e,t)=>{let n=this.#n?.children.item(t)??null;n!==e&&this.#n?.insertBefore(e,n)})}#x(e,t,n){n===null||n===!1?e.hasAttribute(t)&&e.removeAttribute(t):n===!0?e.hasAttribute(t)||e.setAttribute(t,``):e.getAttribute(t)!==n&&e.setAttribute(t,n)}#S(e){if(!this.#i)return;let t=e.map(e=>{let t=e.dataset.k??``,n=this.#e.find(e=>e.key===t)??{key:t};return{id:t,label:n.label??t,type:Cs(n),color:n.color,eyes:ws(n),state:Ss(n,this.attention),fill:X(n.fill)}});this.#i.items=t}#C(e){let t=e.target?.closest(`.${q}__segment`);t&&this.contains(t)&&t.dataset.k&&this.select(t.dataset.k)}#w(e){let t=e.target?.closest(`.${q}__segment`);if(!t||!this.contains(t))return;if(e.key===`Enter`||e.key===` `){if(!t.dataset.k)return;e.preventDefault(),this.select(t.dataset.k);return}let n=[...this.querySelectorAll(`.${q}__segment:not(.hide)`)].filter(e=>!e.disabled),r=n.indexOf(t);if(r<0||n.length===0)return;let i;if(e.key===`ArrowLeft`)i=n[(r-1+n.length)%n.length];else if(e.key===`ArrowRight`)i=n[(r+1)%n.length];else if(e.key===`Home`)i=n[0];else if(e.key===`End`)i=n.at(-1);else return;e.preventDefault(),i?.focus()}#T(){let e=this.ownerDocument.activeElement;return!(e instanceof Element)||!this.contains(e)?null:e.closest(`.${q}__segment`)?.dataset.k??null}#E(e){return e==null?null:[...this.querySelectorAll(`.${q}__segment`)].find(t=>t.dataset.k===e)??null}#D(){this.#a||typeof ResizeObserver>`u`||(this.#a=new ResizeObserver(()=>{this.#s===null&&(this.#s=requestAnimationFrame(()=>{this.#s=null,this.reflow()}))}),this.#a.observe(this),this.parentElement&&this.#a.observe(this.parentElement))}});var Ds=`/**
|
|
4586
4616
|
* SLICC design tokens — lifted verbatim from the prototype
|
|
4587
4617
|
* (proto/StellarRubySwift.html :root + body.dark). Light is the default; dark is
|
|
4588
4618
|
* opt-in. Per project decision the prototype's token vocabulary and light-default
|
|
@@ -4646,7 +4676,7 @@ video {
|
|
|
4646
4676
|
--shaderbg: #171410;
|
|
4647
4677
|
--shadow-pane: rgba(0, 0, 0, 0.35) 0 8px 26px -10px;
|
|
4648
4678
|
}
|
|
4649
|
-
`,
|
|
4679
|
+
`,Os=`slicc-tokens`;function ks(e=document){if(e.getElementById(Os))return;let t=e.createElement(`style`);t.id=Os,t.textContent=Ds,(e.head??e.documentElement).appendChild(t)}function As(e,t=document.body){t.classList.toggle(`dark`,e===`dark`),t.setAttribute(`data-theme`,e)}function js(e=document.body){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>As(t.matches?`dark`:`light`,e);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}var Ms=T(`
|
|
4650
4680
|
:host { display: inline-flex; flex: 0 0 auto; }
|
|
4651
4681
|
.themetgl {
|
|
4652
4682
|
font: inherit; font-family: var(--ui); font-size: 14px; line-height: 1;
|
|
@@ -4658,7 +4688,7 @@ video {
|
|
|
4658
4688
|
}
|
|
4659
4689
|
.themetgl:hover { background: color-mix(in srgb, var(--ink) 8%, var(--ghost)); }
|
|
4660
4690
|
.themetgl svg { display: block; }
|
|
4661
|
-
`),
|
|
4691
|
+
`),Ns=16,Ps={light:`moon`,dark:`sun`},Fs={light:`Switch to dark mode`,dark:`Switch to light mode`};S(`slicc-theme-toggle`,class extends HTMLElement{static observedAttributes=[`theme`];#e;#t=null;#n=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ms];let e=w(`button`,{class:`themetgl`,part:`button`,type:`button`,"aria-pressed":`false`},w(`slot`,{name:`glyph-light`},n(Ps.light,{size:Ns})),w(`slot`,{name:`glyph-dark`,hidden:!0},n(Ps.dark,{size:Ns})));this.#e.replaceChildren(e),this.#t=e}connectedCallback(){this.#t?.addEventListener(`click`,this.#i),this.#a(this.theme??`light`,{silent:!0})}disconnectedCallback(){this.#t?.removeEventListener(`click`,this.#i)}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&(this.#n||this.isConnected&&this.#a(this.#r(n)??`light`,{silent:!0}))}get theme(){return this.#r(this.getAttribute(`theme`))}set theme(e){this.#a(e===`dark`?`dark`:`light`,{silent:!0})}get pressed(){return this.theme===`dark`}#r(e){return e===`dark`?`dark`:e===`light`?`light`:null}#i=()=>{this.#a(this.theme===`dark`?`light`:`dark`)};#a(e,t={}){this.#n=!0;try{if(As(e),this.getAttribute(`theme`)!==e&&this.setAttribute(`theme`,e),this.#t){this.#t.setAttribute(`aria-pressed`,e===`dark`?`true`:`false`),this.#t.title=Fs[e];let t=this.#e.querySelector(`slot[name="glyph-light"]`),n=this.#e.querySelector(`slot[name="glyph-dark"]`);t?.toggleAttribute(`hidden`,e===`dark`),n?.toggleAttribute(`hidden`,e===`light`)}for(let t of document.querySelectorAll(`slicc-add-menu`))t.setAttribute(`theme`,e)}finally{this.#n=!1}t.silent||this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}}),S(`slicc-theme`,class extends HTMLElement{static observedAttributes=[`theme`];connectedCallback(){ks(this.ownerDocument),this.classList.add(`slicc-theme`),this.#e()}attributeChangedCallback(e,t,n){e===`theme`&&t!==n&&this.isConnected&&this.#e()}get theme(){return this.getAttribute(`theme`)===`dark`?`dark`:`light`}set theme(e){this.setAttribute(`theme`,e===`dark`?`dark`:`light`)}#e(){let e=this.theme;As(e,this),this.dispatchEvent(new CustomEvent(`slicc-theme-change`,{detail:{theme:e},bubbles:!0,composed:!0}))}});var Is=`
|
|
4662
4692
|
slicc-dock-tree {
|
|
4663
4693
|
display: block;
|
|
4664
4694
|
/* Fill the parent shell's flex column. Without this the host collapses to
|
|
@@ -4763,6 +4793,59 @@ slicc-dock-tree .dock-tree__tile {
|
|
|
4763
4793
|
min-height: 0;
|
|
4764
4794
|
box-sizing: border-box;
|
|
4765
4795
|
}
|
|
4796
|
+
/* Tool tiles (every leaf except the reserved chat column) carry the
|
|
4797
|
+
prototype's floating rounded workbench-pane chrome — the .pane card that
|
|
4798
|
+
\`<slicc-workbench-pane>\` used to compose via \`<slicc-pane elevated>\`:
|
|
4799
|
+
--canvas surface, 1px --line border, 14px radius, the elevated two-layer
|
|
4800
|
+
shadow, 12px float margin. \`overflow: hidden\` clips full-bleed content
|
|
4801
|
+
(xterm's dark surface, iframes) to the rounded corners. The chat tile stays
|
|
4802
|
+
FLAT (full-bleed over the shader), exactly like the prototype's .chatpane. */
|
|
4803
|
+
slicc-dock-tree .dock-tree__tile--chrome {
|
|
4804
|
+
margin: 12px;
|
|
4805
|
+
background: var(--canvas, #fff);
|
|
4806
|
+
border: 1px solid var(--line, #b7c6cf);
|
|
4807
|
+
border-radius: 14px;
|
|
4808
|
+
box-shadow:
|
|
4809
|
+
rgba(10, 10, 10, 0.1) 0 14px 36px -12px,
|
|
4810
|
+
rgba(10, 10, 10, 0.05) 0 4px 10px -4px;
|
|
4811
|
+
overflow: hidden;
|
|
4812
|
+
/* Float above the composer's full-bleed band (z-index 2 + a ::before that
|
|
4813
|
+
extends under the pane — slicc-composer.ts): the pane is chrome ON TOP
|
|
4814
|
+
of the band, not content beneath it. */
|
|
4815
|
+
z-index: 3;
|
|
4816
|
+
}
|
|
4817
|
+
.dark slicc-dock-tree .dock-tree__tile--chrome,
|
|
4818
|
+
[data-theme="dark"] slicc-dock-tree .dock-tree__tile--chrome {
|
|
4819
|
+
box-shadow:
|
|
4820
|
+
rgba(0, 0, 0, 0.45) 0 14px 36px -12px,
|
|
4821
|
+
rgba(0, 0, 0, 0.3) 0 4px 10px -4px;
|
|
4822
|
+
}
|
|
4823
|
+
/* Slide-in for a NEWLY PLACED tool tile — the prototype workbench's .38s
|
|
4824
|
+
cubic-bezier(.4,0,.2,1) open, re-homed as an entrance animation because the
|
|
4825
|
+
dock-tree rebuilds its DOM on every render (a width transition has no
|
|
4826
|
+
persistent element to ride). Applied only when the render actually ADDED
|
|
4827
|
+
the surface to the placed set — divider-drag re-renders (one per
|
|
4828
|
+
pointermove) keep the set unchanged and never replay it. Closing is
|
|
4829
|
+
instant: an exit animation would mean keeping dead tiles in the tree past
|
|
4830
|
+
their render. */
|
|
4831
|
+
slicc-dock-tree .dock-tree__tile--enter {
|
|
4832
|
+
animation: slicc-dock-tile-in 0.38s cubic-bezier(0.4, 0, 0.2, 1);
|
|
4833
|
+
}
|
|
4834
|
+
@keyframes slicc-dock-tile-in {
|
|
4835
|
+
from {
|
|
4836
|
+
transform: translateX(32px);
|
|
4837
|
+
opacity: 0;
|
|
4838
|
+
}
|
|
4839
|
+
to {
|
|
4840
|
+
transform: none;
|
|
4841
|
+
opacity: 1;
|
|
4842
|
+
}
|
|
4843
|
+
}
|
|
4844
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4845
|
+
slicc-dock-tree .dock-tree__tile--enter {
|
|
4846
|
+
animation: none;
|
|
4847
|
+
}
|
|
4848
|
+
}
|
|
4766
4849
|
slicc-dock-tree .dock-tree__tile-move {
|
|
4767
4850
|
position: absolute;
|
|
4768
4851
|
top: 4px;
|
|
@@ -4828,7 +4911,7 @@ slicc-dock-tree .dock-tree__preview {
|
|
|
4828
4911
|
slicc-dock-tree .dock-tree__preview--active {
|
|
4829
4912
|
display: block;
|
|
4830
4913
|
}
|
|
4831
|
-
`,Is=`slicc-dock-tree-style`;function Ls(e){if(e.getElementById(Is))return;let t=e.createElement(`style`);t.id=Is,t.textContent=Fs,(e.head??e.documentElement).appendChild(t)}var Rs=`slicc-surface`,zs=`chat`,Bs=`sprinkle:`;function Vs(e){return typeof e==`string`&&e.trim().toLowerCase()===`false`}function Hs(e){return e===`chat`?`Chat`:e.startsWith(Bs)?e.slice(9):e}var Us=[`top`,`left`,`middle`,`right`,`bottom`],Z=[`left`,`middle`,`right`],Ws=[`top`,`center`,`bottom`],Gs=.02;function Ks(){return{zones:{top:null,left:null,middle:null,right:null,bottom:null},rowFr:{top:1,center:1,bottom:1},colFr:{left:1,middle:1,right:1}}}function qs(e){return JSON.parse(JSON.stringify(e))}function Js(e,t){if(e.type===`leaf`){t.push(e.surfaceId);return}for(let n of e.children)Js(n,t)}function Ys(e,t){if(e.type===`leaf`)return e.surfaceId===t?e:null;for(let n of e.children){let e=Ys(n,t);if(e)return e}return null}function Xs(e,t,n){if(n)return!0;function r(e,n){let i=n||e.locked===!0;if(e===t)return i;if(e.type!==`split`)return null;for(let t of e.children){let e=r(t,i);if(e!=null)return e}return null}return r(e,!1)??!1}function Zs(e){return e.locked===!0||e.type===`split`&&e.children.some(Zs)}function Qs(e){return e.getAttribute(`surface-id`)||e.getAttribute(`data-s`)||e.id||null}function $s(e){e.style.position=`relative`,e.style.inset=`auto`,e.style.display=`flex`,e.style.flex=`1 1 auto`,e.style.minWidth=`0`,e.style.minHeight=`0`}function ec(e){e.style.removeProperty(`position`),e.style.removeProperty(`inset`),e.style.removeProperty(`flex`),e.style.removeProperty(`min-width`),e.style.removeProperty(`min-height`),e.style.display=`none`}function tc(e,t){return{type:`split`,dir:e,children:t,sizes:t.map(()=>1)}}function nc(e,t,n){e.type===`split`&&e.children.forEach((r,i)=>{r===t?n(e,i):nc(r,t,n)})}function rc(e,t){if(e.type!==`split`)return null;for(let n=0;n<e.children.length;n++){let r=e.children[n];if(r===t)return{parent:e,index:n};let i=rc(r,t);if(i)return i}return null}function ic(e){if(!e)return null;if(e.type!==`split`)return e;e.children=e.children.map(ic).filter(e=>e!=null);let t=[],n=[];return e.children.forEach((r,i)=>{r.type===`split`&&r.dir===e.dir?r.children.forEach((a,o)=>{t.push(a),n.push((e.sizes[i]||1)*(r.sizes[o]||1))}):(t.push(r),n.push(e.sizes[i]||1))}),e.children=t,e.sizes=n,e.children.length===0?null:e.children.length===1?e.children[0]:e}function ac(e,t,n){let r=e[t];if(r){if(r===n){e[t]=null;return}nc(r,n,(e,t)=>{e.children.splice(t,1),e.sizes.splice(t,1)}),e[t]=ic(r)}}function oc(e,t,n,r){if(e[t]===n){e[t]=r;return}let i=e[t];i&&nc(i,n,(e,t)=>{e.children[t]=r})}function sc(e,t,n){let r=t.reduce((e,t)=>e+t,0)-e;if(r<=0)return null;let i=Math.min(.98,Math.max(Gs,n));return i*r/(1-i)}function cc(e,t,n){let r=(t-e.left)/e.width,i=(n-e.top)/e.height;if(r>.34&&r<.66&&i>.34&&i<.66)return`center`;let a={n:i,s:1-i,w:r,e:1-r},o=Object.entries(a);return o.sort((e,t)=>e[1]-t[1]),o[0][0]}function lc(e){let t=document.createElement(`div`);return t.className=`dock-tree__divider dock-tree__divider--${e}`,t}function uc(){let e=document.createElement(`div`);return e.className=`dock-tree__root`,e}function dc(){let e=document.createElement(`div`);return e.className=`dock-tree__parking`,e.hidden=!0,e}function fc(){let e=document.createElement(`div`);return e.className=`dock-tree__ghost`,e}function pc(){let e=document.createElement(`div`);return e.className=`dock-tree__preview`,e}S(`slicc-dock-tree`,class extends HTMLElement{static observedAttributes=[`tiles-movable`];#e=Ks();#t=!1;#n=!1;#r=new Set;#i=null;#a=null;#o=new WeakMap;#s=uc();#c=dc();#l=fc();#u=pc();#d=new MutationObserver(()=>this.#b());connectedCallback(){Ls(this.ownerDocument),this.#n=!0,this.#s.parentElement!==this&&this.append(this.#s),this.#c.parentElement!==this&&this.append(this.#c),this.#l.parentElement!==this&&this.append(this.#l),this.#u.parentElement!==this&&this.append(this.#u),this.#b(),this.#d.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#d.disconnect(),this.#I()}attributeChangedCallback(e,t,n){e!==`tiles-movable`||t===n||!this.#n||(this.tilesMovable||this.#I(),this.#b())}get tilesMovable(){let e=this.getAttribute(`tiles-movable`);return e!==null&&!Vs(e)}set tilesMovable(e){this.toggleAttribute(`tiles-movable`,!!e&&!Vs(e))}setTree(e){this.#e=e?qs(e):Ks(),this.#n&&this.#b()}getTree(){return qs(this.#e)}setPinned(e){this.#r=new Set(e)}getSurfaceIds(){let e=[];for(let t of Us){let n=this.#e.zones[t];n&&Js(n,e)}return e}#f(e){return this.#e.zones[e]!=null||this.#t}#p(e,t){let n=this.#e.zones[t];return n?Xs(n,e,this.#e.locked===!0):!1}#m(e){if(this.#e.locked===!0)return!0;let t=this.#e.zones[e];return t!=null&&Zs(t)}#h(e){return this.#e.locked===!0?!0:e===`center`?Z.some(e=>this.#m(e)):this.#m(e)}placeSurface(e,t){if(this.getSurfaceIds().includes(e))return;let n={type:`leaf`,surfaceId:e},r=this.#e.zones[t];this.#e.zones[t]=r==null?n:ic(tc(`col`,[r,n])),this.#n&&this.#b(),this.#L()}removeSurface(e){if(!this.#r.has(e))for(let t of Us){let n=this.#e.zones[t];if(!n)continue;let r=Ys(n,e);if(r){if(this.#p(r,t))return;ac(this.#e.zones,t,r),this.#n&&this.#b(),this.#L();return}}}moveSurfaceToZone(e,t){let n=!1;for(let r of Us){let i=this.#e.zones[r];if(!i)continue;let a=Ys(i,e);if(a){if(n=!0,this.#p(a,r)||r===t&&i===a)return;ac(this.#e.zones,r,a);break}}if(!n){this.placeSurface(e,t);return}let r={type:`leaf`,surfaceId:e};this.#e.zones[t]=r,this.#n&&this.#b(),this.#L()}setSurfaceSize(e,t){let n=this.#g(e);if(!n)return!1;let r=(this.#R().get(e)??null)?.getBoundingClientRect()??null,i=!1;return n.width&&(t.widthPx!=null||t.widthPercent!=null)&&(i=this.#y(n.width,t.widthPx,t.widthPercent,r?.width)||i),n.height&&(t.heightPx!=null||t.heightPercent!=null)&&(i=this.#y(n.height,t.heightPx,t.heightPercent,r?.height)||i),i&&(this.#b(),this.#O()),i}#g(e){for(let t of Us){let n=this.#e.zones[t];if(!n)continue;let r=Ys(n,e);if(!r)continue;if(this.#p(r,t))return{width:null,height:null};let i=rc(n,r);if(i){let{parent:e,index:t}=i,n={currentFr:e.sizes[t]??1,groupFr:e.sizes,apply:n=>{e.sizes[t]=n}};return{width:e.dir===`row`?n:null,height:e.dir===`col`?n:null}}let a=t===`left`||t===`middle`||t===`right`,o=null;if(a){let e=t,n=this.#v();o={currentFr:this.#e.colFr[e],groupFr:n.map(e=>this.#e.colFr[e]),apply:t=>{this.#e.colFr[e]=t}}}let s=a?`center`:t,c=this.#_(),l={currentFr:this.#e.rowFr[s],groupFr:c.map(e=>this.#e.rowFr[e]),apply:e=>{this.#e.rowFr[s]=e}};return{width:o,height:l}}return null}#_(){let e=[];return this.#f(`top`)&&e.push(`top`),Z.some(e=>this.#f(e))&&e.push(`center`),this.#f(`bottom`)&&e.push(`bottom`),e}#v(){return Z.filter(e=>this.#f(e))}#y(e,t,n,r){let i=null;if(n!=null)i=n/100;else if(t!=null&&r!=null&&r>0&&e.currentFr>0){let n=r*e.groupFr.reduce((e,t)=>e+t,0)/e.currentFr;n>0&&(i=t/n)}if(i==null)return!1;let a=sc(e.currentFr,e.groupFr,i);return a!=null&&(e.apply(a),!0)}#b(){let e=this.#e,t=this.#R(),n=new Set(this.getSurfaceIds()),r=this.#x(e,t),i=[];if(this.#f(`top`)){let n=this.#S(`top`,t);n.style.flex=`${e.rowFr.top} 1 0`,i.push({key:`top`,el:n})}if(r&&i.push({key:`center`,el:r}),this.#f(`bottom`)){let n=this.#S(`bottom`,t);n.style.flex=`${e.rowFr.bottom} 1 0`,i.push({key:`bottom`,el:n})}let a=[];i.forEach((t,n)=>{a.push(t.el),n<i.length-1&&!this.#h(t.key)&&!this.#h(i[n+1].key)&&a.push(this.#T(`v`,t.key,i[n+1].key,this.#s,e.rowFr,Ws))}),this.#s.replaceChildren(...a);for(let[e,r]of t)n.has(e)||(ec(r),r.parentElement!==this.#c&&this.#c.appendChild(r))}#x(e,t){let n=Z.filter(e=>this.#f(e));if(n.length===0)return null;let r=document.createElement(`div`);return r.className=`dock-tree__row`,r.style.flex=`${e.rowFr.center} 1 0`,n.forEach((i,a)=>{let o=this.#S(i,t);o.style.flex=`${e.colFr[i]} 1 0`,r.appendChild(o),a<n.length-1&&!this.#m(i)&&!this.#m(n[a+1])&&r.appendChild(this.#T(`h`,i,n[a+1],r,e.colFr,Z))}),r}#S(e,t){let n=document.createElement(`div`);n.className=`dock-tree__zone`,this.#t&&n.classList.add(`dock-tree__zone--droppable`),n.dataset.zone=e;let r=this.#e.zones[e];if(r==null){let t=document.createElement(`div`);return t.className=`dock-tree__empty`,t.textContent=`${e} (drop here)`,n.appendChild(t),n}let i=this.#C(r,t,e);return i.style.flex=`1 1 0`,n.appendChild(i),n}#C(e,t,n){if(e.type===`leaf`){let r=document.createElement(`div`);r.className=`dock-tree__leaf`;let i=t.get(e.surfaceId);return i&&r.appendChild(this.#w(e,n,e.surfaceId,i)),r}let r=document.createElement(`div`);r.className=`dock-tree__split dock-tree__split--${e.dir}`;let i=this.#e.locked===!0||e.locked===!0;return e.children.forEach((a,o)=>{let s=this.#C(a,t,n);s.style.flex=`${e.sizes[o]??1} 1 0`,r.appendChild(s),o<e.children.length-1&&!i&&r.appendChild(this.#E(e,o,r))}),r}#w(e,t,r,i){let a=document.createElement(`div`);if(a.className=`dock-tree__tile`,this.tilesMovable&&!this.#p(e,t)){let i=Hs(r),o=document.createElement(`button`);o.type=`button`,o.className=`dock-tree__tile-move`,o.setAttribute(`aria-label`,`Move ${i}`),o.title=i,o.appendChild(n(`grip-vertical`,{size:13})),o.addEventListener(`pointerdown`,n=>this.#k(n,e,t)),a.appendChild(o)}let o=document.createElement(`div`);return o.className=`dock-tree__tile-body`,$s(i),o.appendChild(i),a.appendChild(o),this.#o.set(a,e),a}#T(e,t,n,r,i,a){let o=lc(e);return this.#D(o,e===`h`,r,()=>i[t]??1,()=>i[n]??1,(e,r)=>{i[t]=e,i[n]=r},()=>a.reduce((e,t)=>e+(i[t]??1),0)),o}#E(e,t,n){let r=e.dir===`row`,i=lc(r?`h`:`v`);return this.#D(i,r,n,()=>e.sizes[t]??1,()=>e.sizes[t+1]??1,(n,r)=>{e.sizes[t]=n,e.sizes[t+1]=r},()=>e.sizes.reduce((e,t)=>e+(t??1),0)),i}#D(e,t,n,r,i,a,o){e.addEventListener(`pointerdown`,e=>{e.preventDefault(),this.setPointerCapture(e.pointerId);let s=n.getBoundingClientRect(),c=r()+i(),l=c*Gs,u=o(),d=t?s.width:s.height,f=t?e.clientX:e.clientY,p=r(),m=e=>{let n=t?e.clientX:e.clientY,r=d>0?(n-f)/d*u:0,i=Math.max(l,Math.min(c-l,p+r));a(i,c-i),this.#b()},h=()=>{window.removeEventListener(`pointermove`,m),window.removeEventListener(`pointerup`,h),window.removeEventListener(`pointercancel`,h),this.hasPointerCapture(e.pointerId)&&this.releasePointerCapture(e.pointerId),this.#O()};window.addEventListener(`pointermove`,m),window.addEventListener(`pointerup`,h),window.addEventListener(`pointercancel`,h)})}#O(){this.dispatchEvent(new CustomEvent(`dock-tree-resize`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#k(e,t,n){!this.tilesMovable||this.#p(t,n)||(e.preventDefault(),this.#A({kind:`internal`,node:t,fromZone:n},t.type===`leaf`?t.surfaceId:`panel`),this.#j(e))}beginExternalDrag(e,t){this.tilesMovable&&this.#A({kind:`external`,surfaceId:e},e)}#A(e,t){this.#i=e,this.#a=null,this.#t=!0,this.#b(),this.#l.textContent=t,this.#l.classList.add(`dock-tree__ghost--active`),window.addEventListener(`pointermove`,this.#M),window.addEventListener(`pointerup`,this.#F)}#j(e){this.#l.style.left=`${e.clientX}px`,this.#l.style.top=`${e.clientY}px`}#M=e=>{this.#j(e),this.#a=null,this.#u.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let t=this.#i;if(!t)return;let n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return;let r=n.closest(`.dock-tree__zone`);if(!(r instanceof HTMLElement))return;let i=r.dataset.zone;if(!i)return;r.classList.add(`dock-tree__zone--hot`);let a=n.closest(`.dock-tree__tile`),o=a instanceof HTMLElement?this.#o.get(a):void 0,s=t.kind===`internal`&&o===t.node,c=!!o&&this.#p(o,i);if(a instanceof HTMLElement&&o&&!s&&!c){let t=a.getBoundingClientRect(),n=cc(t,e.clientX,e.clientY);this.#a={zone:i,leaf:o,region:n},this.#N(t,n)}else a||(this.#a={zone:i,empty:!0},this.#P(r.getBoundingClientRect()))};#N(e,t){let{left:n,top:r,width:i,height:a}=e;t===`n`?a=e.height/2:t===`s`?(r=e.top+e.height/2,a=e.height/2):t===`w`?i=e.width/2:t===`e`&&(n=e.left+e.width/2,i=e.width/2),this.#P(new DOMRect(n,r,i,a))}#P(e){this.#u.style.left=`${e.left}px`,this.#u.style.top=`${e.top}px`,this.#u.style.width=`${e.width}px`,this.#u.style.height=`${e.height}px`,this.#u.classList.add(`dock-tree__preview--active`)}#F=()=>{window.removeEventListener(`pointermove`,this.#M),window.removeEventListener(`pointerup`,this.#F),this.#l.classList.remove(`dock-tree__ghost--active`),this.#u.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let e=this.#a,t=this.#i;this.#a=null,this.#i=null,this.#t=!1;let n=!!t&&t.kind===`internal`&&!!e&&!e.empty&&e.leaf===t.node,r=!!t&&t.kind===`external`&&this.getSurfaceIds().includes(t.surfaceId);if(!t||!e||n||r){this.#b();return}let i;if(t.kind===`internal`?(ac(this.#e.zones,t.fromZone,t.node),i=t.node):i={type:`leaf`,surfaceId:t.surfaceId},e.empty||this.#e.zones[e.zone]==null)this.#e.zones[e.zone]=i;else{let{region:t,leaf:n}=e,r=tc(t===`e`||t===`w`?`row`:`col`,t===`n`||t===`w`?[i,n]:[n,i]);oc(this.#e.zones,e.zone,n,r),this.#e.zones[e.zone]=ic(this.#e.zones[e.zone])}this.#b(),this.#L()};#I(){this.#i&&(window.removeEventListener(`pointermove`,this.#M),window.removeEventListener(`pointerup`,this.#F),this.#i=null,this.#a=null,this.#t=!1,this.#l.classList.remove(`dock-tree__ghost--active`),this.#u.classList.remove(`dock-tree__preview--active`))}#L(){this.dispatchEvent(new CustomEvent(`dock-tree-change`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#R(){let e=new Map;for(let t of Array.from(this.querySelectorAll(Rs))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(Rs))continue;let n=Qs(t);n&&e.set(n,t)}return e}});function mc(e){switch(e.slice(e.lastIndexOf(`.`)).toLowerCase()){case`.png`:case`.jpg`:case`.jpeg`:case`.gif`:case`.webp`:case`.svg`:return`image`;case`.mp3`:case`.wav`:case`.ogg`:case`.m4a`:case`.flac`:return`music`;case`.mp4`:case`.webm`:case`.mov`:case`.avi`:return`film`;case`.json`:return`braces`;case`.md`:return`file-text`;case`.html`:case`.htm`:return`globe`;case`.css`:return`palette`;case`.ts`:case`.js`:case`.tsx`:case`.jsx`:case`.mjs`:case`.cjs`:return`file-code`;case`.zip`:case`.tar`:case`.gz`:case`.bz2`:return`file-archive`;case`.pdf`:return`file-text`;default:return`file`}}function hc(e){return e<1024?e+` B`:e<1048576?(e/1024).toFixed(1)+`K`:e<1073741824?(e/1048576).toFixed(1)+`M`:(e/1073741824).toFixed(1)+`G`}var gc=`
|
|
4914
|
+
`,Ls=`slicc-dock-tree-style`;function Rs(e){if(e.getElementById(Ls))return;let t=e.createElement(`style`);t.id=Ls,t.textContent=Is,(e.head??e.documentElement).appendChild(t)}var zs=`slicc-surface`,Bs=`chat`,Vs=`sprinkle:`;function Hs(e){return typeof e==`string`&&e.trim().toLowerCase()===`false`}function Us(e){return e===`chat`?`Chat`:e.startsWith(Vs)?e.slice(9):e}var Ws=[`top`,`left`,`middle`,`right`,`bottom`],Z=[`left`,`middle`,`right`],Gs=[`top`,`center`,`bottom`],Ks=.02;function qs(){return{zones:{top:null,left:null,middle:null,right:null,bottom:null},rowFr:{top:1,center:1,bottom:1},colFr:{left:1,middle:1,right:1}}}function Js(e){return JSON.parse(JSON.stringify(e))}function Ys(e,t){if(e.type===`leaf`){t.push(e.surfaceId);return}for(let n of e.children)Ys(n,t)}function Xs(e,t){if(e.type===`leaf`)return e.surfaceId===t?e:null;for(let n of e.children){let e=Xs(n,t);if(e)return e}return null}function Zs(e,t,n){if(n)return!0;function r(e,n){let i=n||e.locked===!0;if(e===t)return i;if(e.type!==`split`)return null;for(let t of e.children){let e=r(t,i);if(e!=null)return e}return null}return r(e,!1)??!1}function Qs(e){return e.locked===!0||e.type===`split`&&e.children.some(Qs)}function $s(e){return e.getAttribute(`surface-id`)||e.getAttribute(`data-s`)||e.id||null}function ec(e){e.style.position=`relative`,e.style.inset=`auto`,e.style.display=`flex`,e.style.flex=`1 1 auto`,e.style.minWidth=`0`,e.style.minHeight=`0`}function tc(e){e.style.removeProperty(`position`),e.style.removeProperty(`inset`),e.style.removeProperty(`flex`),e.style.removeProperty(`min-width`),e.style.removeProperty(`min-height`),e.style.display=`none`}function nc(e,t){return{type:`split`,dir:e,children:t,sizes:t.map(()=>1)}}function rc(e,t,n){e.type===`split`&&e.children.forEach((r,i)=>{r===t?n(e,i):rc(r,t,n)})}function ic(e,t){if(e.type!==`split`)return null;for(let n=0;n<e.children.length;n++){let r=e.children[n];if(r===t)return{parent:e,index:n};let i=ic(r,t);if(i)return i}return null}function ac(e){if(!e)return null;if(e.type!==`split`)return e;e.children=e.children.map(ac).filter(e=>e!=null);let t=[],n=[];return e.children.forEach((r,i)=>{r.type===`split`&&r.dir===e.dir?r.children.forEach((a,o)=>{t.push(a),n.push((e.sizes[i]||1)*(r.sizes[o]||1))}):(t.push(r),n.push(e.sizes[i]||1))}),e.children=t,e.sizes=n,e.children.length===0?null:e.children.length===1?e.children[0]:e}function oc(e,t,n){let r=e[t];if(r){if(r===n){e[t]=null;return}rc(r,n,(e,t)=>{e.children.splice(t,1),e.sizes.splice(t,1)}),e[t]=ac(r)}}function sc(e,t,n,r){if(e[t]===n){e[t]=r;return}let i=e[t];i&&rc(i,n,(e,t)=>{e.children[t]=r})}function cc(e,t,n){let r=t.reduce((e,t)=>e+t,0)-e;if(r<=0)return null;let i=Math.min(.98,Math.max(Ks,n));return i*r/(1-i)}function lc(e,t,n){let r=(t-e.left)/e.width,i=(n-e.top)/e.height;if(r>.34&&r<.66&&i>.34&&i<.66)return`center`;let a={n:i,s:1-i,w:r,e:1-r},o=Object.entries(a);return o.sort((e,t)=>e[1]-t[1]),o[0][0]}function uc(e){let t=document.createElement(`div`);return t.className=`dock-tree__divider dock-tree__divider--${e}`,t}function dc(){let e=document.createElement(`div`);return e.className=`dock-tree__root`,e}function fc(){let e=document.createElement(`div`);return e.className=`dock-tree__parking`,e.hidden=!0,e}function pc(){let e=document.createElement(`div`);return e.className=`dock-tree__ghost`,e}function mc(){let e=document.createElement(`div`);return e.className=`dock-tree__preview`,e}S(`slicc-dock-tree`,class extends HTMLElement{static observedAttributes=[`tiles-movable`];#e=qs();#t=!1;#n=!1;#r=new Set;#i=null;#a=null;#o=new WeakMap;#s=new Set;#c=dc();#l=fc();#u=pc();#d=mc();#f=new MutationObserver(()=>this.#x());connectedCallback(){Rs(this.ownerDocument),this.#n=!0,this.#c.parentElement!==this&&this.append(this.#c),this.#l.parentElement!==this&&this.append(this.#l),this.#u.parentElement!==this&&this.append(this.#u),this.#d.parentElement!==this&&this.append(this.#d),this.#x(),this.#f.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#f.disconnect(),this.#L()}attributeChangedCallback(e,t,n){e!==`tiles-movable`||t===n||!this.#n||(this.tilesMovable||this.#L(),this.#x())}get tilesMovable(){let e=this.getAttribute(`tiles-movable`);return e!==null&&!Hs(e)}set tilesMovable(e){this.toggleAttribute(`tiles-movable`,!!e&&!Hs(e))}setTree(e){this.#e=e?Js(e):qs(),this.#n&&this.#x()}getTree(){return Js(this.#e)}setPinned(e){this.#r=new Set(e)}getSurfaceIds(){let e=[];for(let t of Ws){let n=this.#e.zones[t];n&&Ys(n,e)}return e}#p(e){return this.#e.zones[e]!=null||this.#t}#m(e,t){let n=this.#e.zones[t];return n?Zs(n,e,this.#e.locked===!0):!1}#h(e){if(this.#e.locked===!0)return!0;let t=this.#e.zones[e];return t!=null&&Qs(t)}#g(e){return this.#e.locked===!0?!0:e===`center`?Z.some(e=>this.#h(e)):this.#h(e)}placeSurface(e,t){if(this.getSurfaceIds().includes(e))return;let n={type:`leaf`,surfaceId:e},r=this.#e.zones[t];this.#e.zones[t]=r==null?n:ac(nc(`col`,[r,n])),this.#n&&this.#x(),this.#R()}removeSurface(e){if(!this.#r.has(e))for(let t of Ws){let n=this.#e.zones[t];if(!n)continue;let r=Xs(n,e);if(r){if(this.#m(r,t))return;oc(this.#e.zones,t,r),this.#n&&this.#x(),this.#R();return}}}moveSurfaceToZone(e,t){let n=!1;for(let r of Ws){let i=this.#e.zones[r];if(!i)continue;let a=Xs(i,e);if(a){if(n=!0,this.#m(a,r)||r===t&&i===a)return;oc(this.#e.zones,r,a);break}}if(!n){this.placeSurface(e,t);return}let r={type:`leaf`,surfaceId:e};this.#e.zones[t]=r,this.#n&&this.#x(),this.#R()}setSurfaceSize(e,t){let n=this.#_(e);if(!n)return!1;let r=this.#z().get(e)??null,i=r?.getBoundingClientRect()??null,a=r?.closest(`.dock-tree__leaf`)?.getBoundingClientRect()??i,o=!1;if(n.width&&(t.widthPx!=null||t.widthPercent!=null)){let e=a&&i?Math.max(0,a.width-i.width):0;o=this.#b(n.width,t.widthPx==null?void 0:t.widthPx+e,t.widthPercent,a?.width)||o}if(n.height&&(t.heightPx!=null||t.heightPercent!=null)){let e=a&&i?Math.max(0,a.height-i.height):0;o=this.#b(n.height,t.heightPx==null?void 0:t.heightPx+e,t.heightPercent,a?.height)||o}return o&&(this.#x(),this.#k()),o}#_(e){for(let t of Ws){let n=this.#e.zones[t];if(!n)continue;let r=Xs(n,e);if(!r)continue;if(this.#m(r,t))return{width:null,height:null};let i=ic(n,r);if(i){let{parent:e,index:t}=i,n={currentFr:e.sizes[t]??1,groupFr:e.sizes,apply:n=>{e.sizes[t]=n}};return{width:e.dir===`row`?n:null,height:e.dir===`col`?n:null}}let a=t===`left`||t===`middle`||t===`right`,o=null;if(a){let e=t,n=this.#y();o={currentFr:this.#e.colFr[e],groupFr:n.map(e=>this.#e.colFr[e]),apply:t=>{this.#e.colFr[e]=t}}}let s=a?`center`:t,c=this.#v(),l={currentFr:this.#e.rowFr[s],groupFr:c.map(e=>this.#e.rowFr[e]),apply:e=>{this.#e.rowFr[s]=e}};return{width:o,height:l}}return null}#v(){let e=[];return this.#p(`top`)&&e.push(`top`),Z.some(e=>this.#p(e))&&e.push(`center`),this.#p(`bottom`)&&e.push(`bottom`),e}#y(){return Z.filter(e=>this.#p(e))}#b(e,t,n,r){let i=null;if(n!=null)i=n/100;else if(t!=null&&r!=null&&r>0&&e.currentFr>0){let n=r*e.groupFr.reduce((e,t)=>e+t,0)/e.currentFr;n>0&&(i=t/n)}if(i==null)return!1;let a=cc(e.currentFr,e.groupFr,i);return a!=null&&(e.apply(a),!0)}#x(){let e=this.#e,t=this.#z(),n=new Set(this.getSurfaceIds()),r=this.#S(e,t),i=[];if(this.#p(`top`)){let n=this.#C(`top`,t);n.style.flex=`${e.rowFr.top} 1 0`,i.push({key:`top`,el:n})}if(r&&i.push({key:`center`,el:r}),this.#p(`bottom`)){let n=this.#C(`bottom`,t);n.style.flex=`${e.rowFr.bottom} 1 0`,i.push({key:`bottom`,el:n})}let a=[];i.forEach((t,n)=>{a.push(t.el),n<i.length-1&&!this.#g(t.key)&&!this.#g(i[n+1].key)&&a.push(this.#E(`v`,t.key,i[n+1].key,this.#c,e.rowFr,Gs))}),this.#c.replaceChildren(...a);for(let[e,r]of t)n.has(e)||(tc(r),r.parentElement!==this.#l&&this.#l.appendChild(r));this.#s=n,this.dispatchEvent(new CustomEvent(`dock-tree-render`,{detail:{placed:[...n]},bubbles:!0,composed:!0}))}#S(e,t){let n=Z.filter(e=>this.#p(e));if(n.length===0)return null;let r=document.createElement(`div`);return r.className=`dock-tree__row`,r.style.flex=`${e.rowFr.center} 1 0`,n.forEach((i,a)=>{let o=this.#C(i,t);o.style.flex=`${e.colFr[i]} 1 0`,r.appendChild(o),a<n.length-1&&!this.#h(i)&&!this.#h(n[a+1])&&r.appendChild(this.#E(`h`,i,n[a+1],r,e.colFr,Z))}),r}#C(e,t){let n=document.createElement(`div`);n.className=`dock-tree__zone`,this.#t&&n.classList.add(`dock-tree__zone--droppable`),n.dataset.zone=e;let r=this.#e.zones[e];if(r==null){let t=document.createElement(`div`);return t.className=`dock-tree__empty`,t.textContent=`${e} (drop here)`,n.appendChild(t),n}let i=this.#w(r,t,e);return i.style.flex=`1 1 0`,n.appendChild(i),n}#w(e,t,n){if(e.type===`leaf`){let r=document.createElement(`div`);r.className=`dock-tree__leaf`;let i=t.get(e.surfaceId);return i&&r.appendChild(this.#T(e,n,e.surfaceId,i)),r}let r=document.createElement(`div`);r.className=`dock-tree__split dock-tree__split--${e.dir}`;let i=this.#e.locked===!0||e.locked===!0;return e.children.forEach((a,o)=>{let s=this.#w(a,t,n);s.style.flex=`${e.sizes[o]??1} 1 0`,r.appendChild(s),o<e.children.length-1&&!i&&r.appendChild(this.#D(e,o,r))}),r}#T(e,t,r,i){let a=document.createElement(`div`);if(a.className=`dock-tree__tile`,r!==`chat`&&(a.classList.add(`dock-tree__tile--chrome`),this.#s.has(r)||a.classList.add(`dock-tree__tile--enter`)),this.tilesMovable&&!this.#m(e,t)){let i=Us(r),o=document.createElement(`button`);o.type=`button`,o.className=`dock-tree__tile-move`,o.setAttribute(`aria-label`,`Move ${i}`),o.title=i,o.appendChild(n(`grip-vertical`,{size:13})),o.addEventListener(`pointerdown`,n=>this.#A(n,e,t)),a.appendChild(o)}let o=document.createElement(`div`);return o.className=`dock-tree__tile-body`,ec(i),o.appendChild(i),a.appendChild(o),this.#o.set(a,e),a}#E(e,t,n,r,i,a){let o=uc(e);return this.#O(o,e===`h`,r,()=>i[t]??1,()=>i[n]??1,(e,r)=>{i[t]=e,i[n]=r},()=>a.reduce((e,t)=>e+(i[t]??1),0)),o}#D(e,t,n){let r=e.dir===`row`,i=uc(r?`h`:`v`);return this.#O(i,r,n,()=>e.sizes[t]??1,()=>e.sizes[t+1]??1,(n,r)=>{e.sizes[t]=n,e.sizes[t+1]=r},()=>e.sizes.reduce((e,t)=>e+(t??1),0)),i}#O(e,t,n,r,i,a,o){e.addEventListener(`pointerdown`,e=>{e.preventDefault(),this.setPointerCapture(e.pointerId);let s=n.getBoundingClientRect(),c=r()+i(),l=c*Ks,u=o(),d=t?s.width:s.height,f=t?e.clientX:e.clientY,p=r(),m=e=>{let n=t?e.clientX:e.clientY,r=d>0?(n-f)/d*u:0,i=Math.max(l,Math.min(c-l,p+r));a(i,c-i),this.#x()},h=()=>{window.removeEventListener(`pointermove`,m),window.removeEventListener(`pointerup`,h),window.removeEventListener(`pointercancel`,h),this.hasPointerCapture(e.pointerId)&&this.releasePointerCapture(e.pointerId),this.#k()};window.addEventListener(`pointermove`,m),window.addEventListener(`pointerup`,h),window.addEventListener(`pointercancel`,h)})}#k(){this.dispatchEvent(new CustomEvent(`dock-tree-resize`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#A(e,t,n){!this.tilesMovable||this.#m(t,n)||(e.preventDefault(),this.#j({kind:`internal`,node:t,fromZone:n},t.type===`leaf`?t.surfaceId:`panel`),this.#M(e))}beginExternalDrag(e,t){this.tilesMovable&&this.#j({kind:`external`,surfaceId:e},e)}#j(e,t){this.#i=e,this.#a=null,this.#t=!0,this.#x(),this.#u.textContent=t,this.#u.classList.add(`dock-tree__ghost--active`),window.addEventListener(`pointermove`,this.#N),window.addEventListener(`pointerup`,this.#I)}#M(e){this.#u.style.left=`${e.clientX}px`,this.#u.style.top=`${e.clientY}px`}#N=e=>{this.#M(e),this.#a=null,this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let t=this.#i;if(!t)return;let n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return;let r=n.closest(`.dock-tree__zone`);if(!(r instanceof HTMLElement))return;let i=r.dataset.zone;if(!i)return;r.classList.add(`dock-tree__zone--hot`);let a=n.closest(`.dock-tree__tile`),o=a instanceof HTMLElement?this.#o.get(a):void 0,s=t.kind===`internal`&&o===t.node,c=!!o&&this.#m(o,i);if(a instanceof HTMLElement&&o&&!s&&!c){let t=a.getBoundingClientRect(),n=lc(t,e.clientX,e.clientY);this.#a={zone:i,leaf:o,region:n},this.#P(t,n)}else a||(this.#a={zone:i,empty:!0},this.#F(r.getBoundingClientRect()))};#P(e,t){let{left:n,top:r,width:i,height:a}=e;t===`n`?a=e.height/2:t===`s`?(r=e.top+e.height/2,a=e.height/2):t===`w`?i=e.width/2:t===`e`&&(n=e.left+e.width/2,i=e.width/2),this.#F(new DOMRect(n,r,i,a))}#F(e){this.#d.style.left=`${e.left}px`,this.#d.style.top=`${e.top}px`,this.#d.style.width=`${e.width}px`,this.#d.style.height=`${e.height}px`,this.#d.classList.add(`dock-tree__preview--active`)}#I=()=>{window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`);for(let e of Array.from(this.querySelectorAll(`.dock-tree__zone--hot`)))e.classList.remove(`dock-tree__zone--hot`);let e=this.#a,t=this.#i;this.#a=null,this.#i=null,this.#t=!1;let n=!!t&&t.kind===`internal`&&!!e&&!e.empty&&e.leaf===t.node,r=!!t&&t.kind===`external`&&this.getSurfaceIds().includes(t.surfaceId);if(!t||!e||n||r){this.#x();return}let i;if(t.kind===`internal`?(oc(this.#e.zones,t.fromZone,t.node),i=t.node):i={type:`leaf`,surfaceId:t.surfaceId},e.empty||this.#e.zones[e.zone]==null)this.#e.zones[e.zone]=i;else{let{region:t,leaf:n}=e,r=nc(t===`e`||t===`w`?`row`:`col`,t===`n`||t===`w`?[i,n]:[n,i]);sc(this.#e.zones,e.zone,n,r),this.#e.zones[e.zone]=ac(this.#e.zones[e.zone])}this.#x(),this.#R()};#L(){this.#i&&(window.removeEventListener(`pointermove`,this.#N),window.removeEventListener(`pointerup`,this.#I),this.#i=null,this.#a=null,this.#t=!1,this.#u.classList.remove(`dock-tree__ghost--active`),this.#d.classList.remove(`dock-tree__preview--active`))}#R(){this.dispatchEvent(new CustomEvent(`dock-tree-change`,{detail:{tree:this.getTree()},bubbles:!0,composed:!0}))}#z(){let e=new Map;for(let t of Array.from(this.querySelectorAll(zs))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(zs))continue;let n=$s(t);n&&e.set(n,t)}return e}});function hc(e){switch(e.slice(e.lastIndexOf(`.`)).toLowerCase()){case`.png`:case`.jpg`:case`.jpeg`:case`.gif`:case`.webp`:case`.svg`:return`image`;case`.mp3`:case`.wav`:case`.ogg`:case`.m4a`:case`.flac`:return`music`;case`.mp4`:case`.webm`:case`.mov`:case`.avi`:return`film`;case`.json`:return`braces`;case`.md`:return`file-text`;case`.html`:case`.htm`:return`globe`;case`.css`:return`palette`;case`.ts`:case`.js`:case`.tsx`:case`.jsx`:case`.mjs`:case`.cjs`:return`file-code`;case`.zip`:case`.tar`:case`.gz`:case`.bz2`:return`file-archive`;case`.pdf`:return`file-text`;default:return`file`}}function gc(e){return e<1024?e+` B`:e<1048576?(e/1024).toFixed(1)+`K`:e<1073741824?(e/1048576).toFixed(1)+`M`:(e/1073741824).toFixed(1)+`G`}var _c=`
|
|
4832
4915
|
slicc-file-tree {
|
|
4833
4916
|
width: 190px;
|
|
4834
4917
|
flex: 0 0 auto;
|
|
@@ -4976,7 +5059,7 @@ slicc-file-tree .actions button:active {
|
|
|
4976
5059
|
[data-theme="dark"] slicc-file-tree .dir.on {
|
|
4977
5060
|
background: color-mix(in srgb, var(--violet) 22%, var(--canvas));
|
|
4978
5061
|
}
|
|
4979
|
-
`,
|
|
5062
|
+
`,vc=`slicc-file-tree-style`;function yc(e){if(e.getElementById(vc))return;let t=e.createElement(`style`);t.id=vc,t.textContent=_c,(e.head??e.documentElement).appendChild(t)}function bc(e,t){let r=[];for(let i of e)if(i.kind===`group`)r.push(w(`div`,{class:`grp`},i.label));else if(i.kind===`dir`){let e=t.has(i.id);r.push(w(`div`,{class:e?`dir open`:`dir`,"data-dir-id":i.id,"aria-expanded":e?`true`:`false`,tabindex:`0`},n(`chevron-right`,{size:14,class:`chev`}),i.label));let a=w(`div`,{class:`children`,hidden:!e||void 0});C(a,bc(i.children??[],t)),r.push(a)}else{let e=w(`div`,{class:`actions`},w(`button`,{"data-action":`preview`,type:`button`},n(`eye`,{size:14})),w(`button`,{"data-action":`reference`,type:`button`},n(`at-sign`,{size:14})),w(`button`,{"data-action":`download`,type:`button`},n(`arrow-down-to-line`,{size:14})),w(`button`,{"data-action":`overflow`,type:`button`},n(`ellipsis`,{size:14}))),t=w(`div`,{class:`f`,"data-id":i.id,tabindex:`0`},n(hc(i.label),{size:12,class:`ficon`}),i.label,e);i.size!=null&&t.appendChild(w(`span`,{class:`sz`},gc(i.size))),r.push(t)}return r}var xc=class extends HTMLElement{static get observedAttributes(){return[`selected`]}#e=null;#t=new Map;#n=new Set;#r=!1;#i=null;#a=null;#o=null;connectedCallback(){yc(this.ownerDocument),this.#r||=(this.#e??(this.#e=this.#l(),this.#f()),!0),this.#u(),this.#h(),this.#g()}disconnectedCallback(){this.#i&&=(this.removeEventListener(`click`,this.#i),null),this.#a&&=(this.removeEventListener(`keydown`,this.#a),null),this.#o!=null&&(clearTimeout(this.#o),this.#o=null)}attributeChangedCallback(e){e===`selected`&&this.#r&&this.isConnected&&this.#c()}get items(){return this.#e?this.#e.slice():[]}set items(e){let t=!this.#r;this.#e=Array.isArray(e)?e.slice():[],this.#r=!0,t&&this.#f(),this.isConnected&&(this.#u(),this.#h())}toggleDir(e){if(!this.#p(e,this.#e??[]))return;let t=!this.#n.has(e);t?this.#n.add(e):this.#n.delete(e),this.#u(),this.dispatchEvent(new CustomEvent(`dir-toggle`,{bubbles:!0,composed:!0,detail:{id:e,open:t}}))}isDirOpen(e){return this.#n.has(e)}get selected(){return this.getAttribute(`selected`)}set selected(e){e==null?this.removeAttribute(`selected`):this.setAttribute(`selected`,e)}selectFile(e){let t=this.querySelector(`.f[data-id="${Q(e)}"]`);if(!t)return;this.#s(e,t);let n=this.#t.get(e)??e;this.dispatchEvent(new CustomEvent(`file-select`,{bubbles:!0,composed:!0,detail:{id:e,path:n}}))}#s(e,t){this.getAttribute(`selected`)!==e&&this.setAttribute(`selected`,e),this.#c(),t.focus()}#c(){let e=this.getAttribute(`selected`);for(let t of this.querySelectorAll(`.f, .dir`))t.classList.toggle(`on`,(t.dataset.id??t.dataset.dirId)===e)}#l(){let e=[];for(let t of Array.from(this.children)){if(!(t instanceof HTMLElement))continue;let n=(t.textContent??``).trim();if(n)if(t.classList.contains(`grp`)||t.hasAttribute(`data-group`)||t.dataset.group!=null)e.push({kind:`group`,label:n});else{let r=t.dataset.id??t.id??n;e.push({kind:`file`,id:r,label:n})}}return e}#u(){let e=this.contains(document.activeElement),t=this.#e??[];this.#t.clear(),this.#d(t),this.replaceChildren(...bc(t,this.#n)),this.#c();let n=this.getAttribute(`selected`);e&&n!=null&&this.querySelector(`.f[data-id="${Q(n)}"], .dir[data-dir-id="${Q(n)}"]`)?.focus()}#d(e){for(let t of e)t.kind===`file`?this.#t.set(t.id,t.path??t.label):t.kind===`dir`&&(this.#t.set(t.id,t.path??t.id),this.#d(t.children??[]))}#f(){this.#n.clear();let e=t=>{for(let n of t)n.kind===`dir`&&(n.open&&this.#n.add(n.id),e(n.children??[]))};e(this.#e??[])}#p(e,t){for(let n of t)if(n.kind===`dir`&&(n.id===e||this.#p(e,n.children??[])))return!0;return!1}#m(e){let t=e.dataset.action,n=e.closest(`.f`);if(!n)return!1;let r=n.dataset.id;if(r==null)return!1;let i=this.#t.get(r)??r;return t===`preview`?this.dispatchEvent(new CustomEvent(`file-preview`,{bubbles:!0,composed:!0,detail:{id:r,path:i}})):t===`reference`?this.dispatchEvent(new CustomEvent(`file-reference`,{bubbles:!0,composed:!0,detail:{id:r,path:i}})):t===`download`?this.dispatchEvent(new CustomEvent(`file-download`,{bubbles:!0,composed:!0,detail:{id:r,path:i}})):t===`overflow`&&this.dispatchEvent(new CustomEvent(`file-overflow`,{bubbles:!0,composed:!0,detail:{id:r,path:i,anchor:e}})),!0}#h(){this.#i||(this.#i=e=>{let t=e.target,n=t?.closest(`[data-action]`);if(n&&this.contains(n)&&this.#m(n))return;let r=t?.closest(`.dir`);if(r&&this.contains(r)){let e=r.dataset.dirId;e!=null&&(this.#s(e,r),this.toggleDir(e));return}let i=t?.closest(`.f`);if(!i||!this.contains(i))return;let a=i.dataset.id;a!=null&&this.selectFile(a)},this.addEventListener(`click`,this.#i))}#g(){this.#a||(this.#a=e=>{if(e.key!==`c`||!(e.ctrlKey||e.metaKey))return;let t=this.getAttribute(`selected`);if(t==null)return;let n=this.querySelector(`.f[data-id="${Q(t)}"], .dir[data-dir-id="${Q(t)}"]`);if(!n)return;e.preventDefault();let r=this.#t.get(t)??t;navigator.clipboard?.writeText(r).then(()=>{this.#o!=null&&clearTimeout(this.#o),n.classList.add(`ft-copy-flash`),this.#o=setTimeout(()=>{n.classList.remove(`ft-copy-flash`),this.#o=null},300)}).catch(()=>void 0)},this.addEventListener(`keydown`,this.#a))}};function Q(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}S(`slicc-file-tree`,xc);var Sc=`
|
|
4980
5063
|
slicc-surface {
|
|
4981
5064
|
position: absolute;
|
|
4982
5065
|
inset: 0;
|
|
@@ -5008,7 +5091,7 @@ slicc-surface:fullscreen {
|
|
|
5008
5091
|
background: var(--canvas, #fff);
|
|
5009
5092
|
position: fixed;
|
|
5010
5093
|
}
|
|
5011
|
-
`,
|
|
5094
|
+
`,Cc=`slicc-surface-style`;function wc(e){if(e.getElementById(Cc))return;let t=e.createElement(`style`);t.id=Cc,t.textContent=Sc,(e.head??e.documentElement).appendChild(t)}function Tc(e){return e===`block`||e===`column`?e:`flex`}S(`slicc-surface`,class extends HTMLElement{static observedAttributes=[`surface-id`,`active`,`layout`];connectedCallback(){wc(this.ownerDocument),this.#e()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`surface-id`?this.#e():e===`active`&&t!==n&&this.dispatchEvent(new CustomEvent(`surface-toggle`,{bubbles:!0,composed:!0,detail:{surfaceId:this.surfaceId,active:this.active,layout:this.layout}})))}get surfaceId(){return this.getAttribute(`surface-id`)}set surfaceId(e){e==null?this.removeAttribute(`surface-id`):this.setAttribute(`surface-id`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get layout(){return Tc(this.getAttribute(`layout`))}set layout(e){this.setAttribute(`layout`,Tc(e))}#e(){let e=this.surfaceId;e==null?delete this.dataset.s:this.dataset.s=e}});var Ec=T(`
|
|
5012
5095
|
:host{display:inline-flex;white-space:nowrap;}
|
|
5013
5096
|
.tab{display:inline-flex;align-items:center;gap:7px;font-family:var(--ui);font-size:12px;color:var(--txt-2);background:transparent;border:1px solid transparent;border-radius:8px;padding:6px 10px;cursor:pointer;white-space:nowrap;}
|
|
5014
5097
|
.tab:hover{background:var(--ghost);color:var(--ink);}
|
|
@@ -5024,7 +5107,7 @@ slicc-surface:fullscreen {
|
|
|
5024
5107
|
.x{margin-left:3px;width:15px;height:15px;border-radius:4px;display:grid;place-items:center;color:var(--txt-3);}
|
|
5025
5108
|
.x:hover{background:var(--line);color:var(--ink);}
|
|
5026
5109
|
.sg svg,.x svg{display:block;}
|
|
5027
|
-
`),
|
|
5110
|
+
`),Dc=13;S(`slicc-tab`,class extends HTMLElement{static observedAttributes=[`tab-id`,`kind`,`active`,`closable`,`badge`,`glyph`,`label`,`theme`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ec]}connectedCallback(){this.#n(),this.#r()}disconnectedCallback(){this.#i()}attributeChangedCallback(){this.isConnected&&this.#n()}get tabId(){return this.getAttribute(`tab-id`)}set tabId(e){e==null?this.removeAttribute(`tab-id`):this.setAttribute(`tab-id`,e)}get kind(){return this.getAttribute(`kind`)===`sprinkle`?`sprinkle`:`tool`}set kind(e){this.setAttribute(`kind`,e===`sprinkle`?`sprinkle`:`tool`)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get closable(){return this.hasAttribute(`closable`)}set closable(e){this.toggleAttribute(`closable`,e)}get badge(){return this.getAttribute(`badge`)}set badge(e){e==null?this.removeAttribute(`badge`):this.setAttribute(`badge`,e)}get glyph(){return this.getAttribute(`glyph`)}set glyph(e){e==null?this.removeAttribute(`glyph`):this.setAttribute(`glyph`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#n(){let e=this.kind===`sprinkle`,t=w(`button`,{class:`tab${e?` sp`:``}${this.active?` on`:``}`,part:`tab`,type:`button`});if(this.tabId!=null&&t.setAttribute(`data-t`,this.tabId),e){let e=this.badge??`sparkles`;t.append(w(`span`,{class:`sg`,part:`badge`,"aria-hidden":`true`},n(e,{size:Dc})))}else this.glyph!=null&&t.append(w(`span`,{class:`gl`,part:`glyph`,"aria-hidden":`true`},this.glyph));let r=this.label;t.append(r==null?w(`slot`):document.createTextNode(r)),this.closable&&t.append(w(`span`,{class:`x`,part:`close`,"data-close":``,role:`button`,"aria-label":`Close tab`},n(`x`,{size:Dc}))),this.#e.replaceChildren(t)}#r(){this.#t||(this.#t=e=>this.#a(e),this.#e.addEventListener(`click`,this.#t))}#i(){this.#t&&=(this.#e.removeEventListener(`click`,this.#t),null)}#a(e){let t=e.target,n={tabId:this.tabId};if(t?.closest(`[data-close]`)){e.stopPropagation(),this.dispatchEvent(new CustomEvent(`close`,{detail:n,bubbles:!0,composed:!0}));return}this.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}});var Oc=`
|
|
5028
5111
|
slicc-tab-bar {
|
|
5029
5112
|
display: flex;
|
|
5030
5113
|
align-items: center;
|
|
@@ -5036,7 +5119,7 @@ slicc-tab-bar {
|
|
|
5036
5119
|
slicc-tab-bar[hidden] {
|
|
5037
5120
|
display: none;
|
|
5038
5121
|
}
|
|
5039
|
-
`,
|
|
5122
|
+
`,kc=`slicc-tab-bar-style`;function Ac(e){if(e.getElementById(kc))return;let t=e.createElement(`style`);t.id=kc,t.textContent=Oc,(e.head??e.documentElement).appendChild(t)}function jc(e){return e===`sprinkle`?`sprinkle`:`tool`}S(`slicc-tab-bar`,class extends HTMLElement{static observedAttributes=[`active`];#e=[];#t=!1;#n=null;#r=null;#i=null;connectedCallback(){Ac(this.ownerDocument),this.#c(),this.#p()}disconnectedCallback(){this.#l(),this.#t=!1}attributeChangedCallback(e){e===`active`&&this.isConnected&&this.#o()}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get tabs(){return this.#e.map(e=>({...e}))}set tabs(e){this.#e=(e??[]).map(e=>({...e})),this.active!=null&&!this.#e.some(e=>e.id===this.active)&&this.#a(this.#e[0]?.id??null),this.#t=!1,this.isConnected&&this.#p()}addTab(e){let t={...e,kind:jc(e.kind)},n=this.#e.findIndex(e=>e.id===t.id);return n>=0?this.#e[n]=t:this.#e.push(t),this.#t=!1,this.isConnected&&this.#p(),this.selectTab(t.id),t}removeTab(e){let t=this.#e.findIndex(t=>t.id===e);if(t<0)return;let n=this.active===e;if(this.#e.splice(t,1),this.#t=!1,this.isConnected&&this.#p(),this.dispatchEvent(new CustomEvent(`tab-close`,{detail:{id:e},bubbles:!0,composed:!0})),n){let e=this.#e[0]?.id??null;e==null?this.#a(null):this.selectTab(e)}}selectTab(e){this.#e.some(t=>t.id===e)&&this.active!==e&&(this.#a(e),this.dispatchEvent(new CustomEvent(`tab-select`,{detail:{id:e},bubbles:!0,composed:!0})))}#a(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e),this.#o()}#o(){let e=this.active;for(let t of this.querySelectorAll(`:scope > slicc-tab`)){let n=t.getAttribute(`tab-id`);t.toggleAttribute(`active`,n!=null&&n===e)}}#s(e){if(!(e instanceof Element))return null;let t=e.closest(`slicc-tab`);return!t||t.parentElement!==this?null:t.getAttribute(`tab-id`)}#c(){this.#r||(this.#r=e=>this.#u(e),this.#i=e=>this.#d(e),this.addEventListener(`select`,this.#r),this.addEventListener(`close`,this.#i),this.#n=e=>this.#f(e),this.addEventListener(`click`,this.#n))}#l(){this.#r&&this.removeEventListener(`select`,this.#r),this.#i&&this.removeEventListener(`close`,this.#i),this.#n&&this.removeEventListener(`click`,this.#n),this.#r=null,this.#i=null,this.#n=null}#u(e){if(e.target===this)return;let t=this.#s(e.target);t!=null&&(e.stopPropagation(),this.selectTab(t))}#d(e){if(e.target===this)return;let t=this.#s(e.target);t!=null&&(e.stopPropagation(),this.removeTab(t))}#f(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`slicc-tab`);if(!n||n.parentElement!==this)return;let r=n.getAttribute(`tab-id`);if(r==null)return;let i=t.closest(`.x, [data-close]`);if(i&&n.contains(i)){e.stopPropagation(),this.removeTab(r);return}this.selectTab(r)}#p(){if(this.#t)return;this.#t=!0;let e=this.active,t=[];for(let n of this.#e){let r=jc(n.kind);r!==`tool`&&t.push(w(`slicc-tab`,{"tab-id":n.id,kind:r,label:n.label,part:`tab`,closable:n.closable?!0:void 0,badge:n.badge||void 0,glyph:n.glyph||void 0,active:e!=null&&e===n.id||void 0}))}this.replaceChildren(...t)}});var Mc=`/**
|
|
5040
5123
|
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
5041
5124
|
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
5042
5125
|
* https://github.com/chjj/term.js
|
|
@@ -5321,7 +5404,7 @@ slicc-tab-bar[hidden] {
|
|
|
5321
5404
|
.xterm .xterm-scrollable-element > .shadow.top.left {
|
|
5322
5405
|
box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
|
|
5323
5406
|
}
|
|
5324
|
-
`,
|
|
5407
|
+
`,Nc={background:`#0c0c0e`,foreground:`#e7e7ea`,cursor:`#e7e7ea`,cursorAccent:`#0c0c0e`,selectionBackground:`#8b5cf64d`,selectionForeground:`#ffffff`,black:`#0c0c0e`,red:`#f43f5e`,green:`#5bd17b`,yellow:`#f59e0b`,blue:`#3b82f6`,magenta:`#8b5cf6`,cyan:`#06b6d4`,white:`#e7e7ea`,brightBlack:`#8a8a93`,brightRed:`#fb7185`,brightGreen:`#86efac`,brightYellow:`#fbbf24`,brightBlue:`#60a5fa`,brightMagenta:`#a78bfa`,brightCyan:`#22d3ee`,brightWhite:`#ffffff`},Pc=`
|
|
5325
5408
|
:host {
|
|
5326
5409
|
display: flex;
|
|
5327
5410
|
flex-direction: column;
|
|
@@ -5362,7 +5445,7 @@ slicc-tab-bar[hidden] {
|
|
|
5362
5445
|
/* xterm.js wants its container to size the canvas; let it fill. */
|
|
5363
5446
|
.host .xterm { height: 100%; }
|
|
5364
5447
|
.host .xterm-viewport { overflow-y: auto; }
|
|
5365
|
-
`,
|
|
5448
|
+
`,Fc=null;function Ic(){return Fc||=[T(Mc),T(Pc)],Fc}var Lc=class extends HTMLElement{static observedAttributes=[`label`,`hide-header`];#e;#t=null;#n=null;#r=null;#i=null;#a=[];#o=!1;constructor(){super(),this.#e=this.attachShadow({mode:`open`})}connectedCallback(){this.#o=!1,this.#s(),this.#c()}disconnectedCallback(){this.#l()}attributeChangedCallback(e){if(this.isConnected&&e===`label`){let e=this.#e.querySelector(`.title`);e&&(e.textContent=this.label)}}get label(){return this.getAttribute(`label`)??`Terminal`}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get hideHeader(){return this.hasAttribute(`hide-header`)}set hideHeader(e){this.toggleAttribute(`hide-header`,e)}get terminal(){return this.#n}write(e){this.#n?this.#n.write(e):this.#a.push(e)}writeln(e){this.#n?this.#n.writeln(e):this.#a.push(`${e}\r\n`)}clear(){this.#n?this.#n.clear():this.#a.length=0}focus(){this.#n?.focus()}fit(){this.#r?.fit()}#s(){if(this.#t)return;this.#e.adoptedStyleSheets=Ic();let e=w(`div`,{class:`hd`,part:`header`},n(`terminal`,{size:14}),w(`span`,{class:`title`},this.label),w(`span`,{class:`spacer`})),t=w(`div`,{class:`host`,part:`host`});this.#e.replaceChildren(e,t),this.#t=t}async#c(){if(this.#n||this.#o)return;let[{Terminal:e},{FitAddon:n}]=await Promise.all([t(()=>import(`./xterm-BSL5rRqA.js`),[]),t(()=>import(`./addon-fit-DIOBYJe3.js`),[])]);if(this.#o||!this.#t)return;let r=new e({cursorBlink:!Rc(),fontSize:12,lineHeight:1.25,fontFamily:`'IBM Plex Mono', 'Source Code Pro', 'JetBrains Mono', ui-monospace, monospace`,theme:Nc,convertEol:!0,scrollback:2e3}),i=new n;if(r.loadAddon(i),r.open(this.#t),r.onData(e=>{this.dispatchEvent(new CustomEvent(`terminal-data`,{detail:e,bubbles:!0,composed:!0}))}),this.#n=r,this.#r=i,i.fit(),this.#a.length){for(let e of this.#a)r.write(e);this.#a.length=0}typeof ResizeObserver==`function`&&(this.#i=new ResizeObserver(()=>this.#r?.fit()),this.#i.observe(this.#t))}#l(){this.#o=!0,this.#i?.disconnect(),this.#i=null,this.#n?.dispose(),this.#n=null,this.#r=null,this.#a.length=0}};function Rc(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}S(`slicc-terminal`,Lc);var zc=`
|
|
5366
5449
|
slicc-workbench-header {
|
|
5367
5450
|
flex: 0 0 auto;
|
|
5368
5451
|
display: flex;
|
|
@@ -5389,7 +5472,7 @@ slicc-workbench-header > slicc-collapse-btn {
|
|
|
5389
5472
|
slicc-workbench-header > slicc-tab-bar {
|
|
5390
5473
|
min-width: 0;
|
|
5391
5474
|
}
|
|
5392
|
-
`,
|
|
5475
|
+
`,Bc=`slicc-workbench-header-style`;function Vc(e){if(e.getElementById(Bc))return;let t=e.createElement(`style`);t.id=Bc,t.textContent=zc,(e.head??e.documentElement).appendChild(t)}S(`slicc-workbench-header`,class extends HTMLElement{static observedAttributes=[`kind`];#e;#t=!1;connectedCallback(){Vc(this.ownerDocument),this.#n(),this.#r(),this.addEventListener(`collapse`,this.#i)}disconnectedCallback(){this.removeEventListener(`collapse`,this.#i)}attributeChangedCallback(e){e===`kind`&&this.isConnected&&this.#r()}get kind(){let e=this.getAttribute(`kind`);return e===`tool`||e===`sprinkle`?e:null}set kind(e){e==null?this.removeAttribute(`kind`):this.setAttribute(`kind`,e)}get spacer(){return this.#n(),this.#e}#n(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-wbhead__spacer`);if(e instanceof HTMLElement){this.#e=e;return}this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-wbhead__spacer`,this.#e.setAttribute(`part`,`spacer`);let t=this.querySelector(`:scope > slicc-pane-tag`),n=this.querySelector(`:scope > slicc-collapse-btn`);this.appendChild(this.#e),t&&this.appendChild(t),n&&this.appendChild(n)}#r(){let e=this.querySelector(`:scope > slicc-pane-tag`);if(!e)return;let t=this.kind;t==null?e.removeAttribute(`kind`):e.setAttribute(`kind`,t)}#i=e=>{e.target!==this&&(e.stopPropagation(),this.dispatchEvent(new CustomEvent(`collapse`,{bubbles:!0,composed:!0})))}});var Hc=`slicc_monitor_collapsed`;function Uc(){try{let e=localStorage.getItem(Hc);return new Set(e?JSON.parse(e):[])}catch{return new Set}}function Wc(e){try{localStorage.setItem(Hc,JSON.stringify([...e]))}catch{}}var Gc=`
|
|
5393
5476
|
slicc-monitor {
|
|
5394
5477
|
display: block;
|
|
5395
5478
|
box-sizing: border-box;
|
|
@@ -5805,4 +5888,4 @@ slicc-monitor {
|
|
|
5805
5888
|
transition-duration: 0.01ms;
|
|
5806
5889
|
}
|
|
5807
5890
|
}
|
|
5808
|
-
`,
|
|
5891
|
+
`,Kc=`slicc-monitor-style`;function qc(e){if(e.getElementById(Kc))return;let t=e.createElement(`style`);t.id=Kc,t.textContent=Gc,(e.head??e.documentElement).appendChild(t)}function Jc(e){return e.status?e.status:e.error?`error`:e.active?`active`:`idle`}function Yc(e){return e===`active`?`Active`:e===`error`?`Error`:e===`warn`?`Warning`:`Idle`}function Xc(e){let t=Jc(e),r=w(`span`,{class:`monitor-row__badges`});for(let t of e.badges??[])r.appendChild(w(`span`,{class:`monitor-row__badge`},t));let i=w(`span`,{class:`monitor-row__headline`},w(`span`,{class:`monitor-row__name`},e.name));r.childElementCount>0&&i.appendChild(r);let a=w(`span`,{class:`monitor-row__content`},i);return e.sublabel&&a.appendChild(w(`span`,{class:`monitor-row__sublabel`},e.sublabel)),w(`li`,{class:`monitor-row`,"data-status":t},w(`span`,{class:`monitor-row__icon`},n(e.icon??`box`,{size:16})),a,w(`span`,{class:`monitor-row__aside`},w(`span`,{class:`monitor-row__meta`},e.meta),w(`span`,{class:`monitor-row__state monitor-row__state--${t}`},w(`span`,{class:`monitor-row__dot`,"aria-hidden":`true`}),Yc(t))))}function Zc(e){return w(`div`,{class:`monitor-empty`,role:`status`},w(`span`,{class:`monitor-empty__icon`},n(`inbox`,{size:18})),w(`span`,{class:`monitor-empty__title`},`No ${e.label.toLocaleLowerCase()} yet`),w(`span`,{class:`monitor-empty__text`},e.emptyText??`${e.label} will appear here when available.`))}function Qc(e,t,r,i){let a=t.has(e.id),o=e.count===0?`monitor-section monitor-section--empty`:`monitor-section`,s=[w(`span`,{class:`monitor-section__toggle`,"aria-hidden":`true`},n(a?`chevron-right`:`chevron-down`,{size:15})),w(`span`,{class:`monitor-section__heading`},w(`span`,{class:`monitor-section__title`},e.label),e.meta?w(`span`,{class:`monitor-section__meta`},e.meta):null)];s.push(w(`span`,{class:`monitor-section__count`},String(e.count)));let c=w(`button`,{class:`monitor-section__header`,type:`button`},...s);c.setAttribute(`aria-expanded`,String(!a)),c.setAttribute(`aria-controls`,i),c.addEventListener(`click`,()=>r(e.id));let l=w(`div`,{class:`monitor-section__body`,id:i});if(a&&l.setAttribute(`hidden`,``),e.rows.length===0)l.appendChild(Zc(e));else{let t=w(`ul`,{class:`monitor-section__list`});for(let n of e.rows)t.appendChild(Xc(n));l.appendChild(t)}return w(`section`,{class:o,"data-section":e.id,"data-accent":e.accent??`neutral`},c,l)}function $(e,t){return w(`div`,{class:`monitor-summary__metric`},w(`dt`,null,e),w(`dd`,null,t))}function $c(e,t){let r=e.flatMap(e=>e.rows),i=r.filter(e=>Jc(e)===`active`).length,a=r.filter(e=>[`warn`,`error`].includes(Jc(e))).length,o=e.reduce((e,t)=>e+(t.id===`cost`?0:t.count),0),s=e.find(e=>e.id===`cost`)?.meta??`—`,c=w(`button`,{class:`monitor-summary__refresh`,type:`button`,"aria-label":`Refresh monitor data`},n(`refresh-cw`,{size:15}),w(`span`,null,`Refresh`));return c.addEventListener(`click`,t),w(`header`,{class:`monitor-summary`},w(`div`,{class:`monitor-summary__topline`},w(`span`,{class:`monitor-summary__mark`},n(`activity`,{size:19})),w(`div`,{class:`monitor-summary__copy`},w(`h2`,{class:`monitor-summary__title`},`Live monitor`),w(`p`,{class:`monitor-summary__subtitle`},`System activity and connections at a glance`)),c),w(`dl`,{class:`monitor-summary__metrics`},$(`Tracked`,String(o)),$(`Active`,String(i)),$(`Attention`,String(a)),$(`Session cost`,s)))}function el(e){return{...e,rows:e.rows.map(e=>({...e,badges:e.badges?.slice()}))}}var tl=0;S(`slicc-monitor`,class extends HTMLElement{#e=[];#t=new Set;#n=!1;#r=++tl;connectedCallback(){qc(this.ownerDocument),this.#n||=(this.#t=Uc(),!0),this.#e.length>0&&this.#i()}get sections(){return this.#e.map(el)}set sections(e){this.#e=Array.isArray(e)?e.map(el):[],this.isConnected&&this.#i()}#i(){let e=$c(this.#e,()=>{this.dispatchEvent(new CustomEvent(`slicc-monitor-refresh`,{bubbles:!0,composed:!0}))}),t=w(`div`,{class:`monitor-sections`});for(let e of this.#e){let n=e.id.replace(/[^a-z0-9_-]/gi,`-`);t.appendChild(Qc(e,this.#t,e=>{this.#t.has(e)?this.#t.delete(e):this.#t.add(e),Wc(this.#t),this.#i()},`monitor-${this.#r}-${n}`))}this.replaceChildren(),C(this,[e,t])}});var nl=e({CHAT_SURFACE_ID:()=>Bs,DEFAULT_LAUNCHER_CORNER:()=>ie,DEFAULT_LAUNCHER_FOLLOWER_STATUS:()=>se,HOLD_TO_ENABLE_MS:()=>un,LAUNCHER_FOLLOWER_STATUS_ATTR:()=>b,LAYOUT_SCHEMA_VERSION:()=>1,MACHINE_WRITTEN_MEMORY_PATH:()=>MACHINE_WRITTEN_MEMORY_PATH,PANEL_MARKER_ATTR:()=>ha,REDACTED_REAL_WORLD_MEMORY_PATH:()=>REDACTED_REAL_WORLD_MEMORY_PATH,SYNTHETIC_MEMORY_PATH:()=>SYNTHETIC_MEMORY_PATH,SliccImagePreview:()=>nn,TOKENS_CSS:()=>Ds,ensureGlobalTokens:()=>ks,followSystemTheme:()=>js,setTheme:()=>As});export{I as a,oo as i,ks as n,Hi as o,js as r,nl as t};
|