sliccy 5.19.2 → 5.20.0
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/__vite-browser-external-BXIFVS_m.js +1 -0
- package/dist/ui/assets/{account-store-BmxI91dA.js → account-store-BcSycxbc.js} +2 -2
- package/dist/ui/assets/{account-store-C29Q2_1P.js → account-store-DW6iW9iB.js} +1 -1
- package/dist/ui/assets/{adobe-S_N8RmpS.js → adobe-Br0Ja7Gs.js} +1 -1
- package/dist/ui/assets/{adobe-3z76LuuB.js → adobe-Z8GfJZNM.js} +1 -1
- package/dist/ui/assets/{adobe-oauth-state-29kzXy6A.js → adobe-oauth-state-BDetyX7s.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-MTcmAlDv.js → agent-message-to-chat-BTNDVg0T.js} +1 -1
- package/dist/ui/assets/{apps-BTbhV_WH.js → apps-BG6_XrX1.js} +1 -1
- package/dist/ui/assets/{azure-openai-BYC93D7I.js → azure-openai-CcEaijCE.js} +1 -1
- package/dist/ui/assets/{azure-openai-DNZwRlzV.js → azure-openai-tF-mnQdH.js} +1 -1
- package/dist/ui/assets/{connect-surface-nOvU-mzS.js → connect-surface-CTYqOLeq.js} +1 -1
- package/dist/ui/assets/dip-Ctf6phXp.js +1 -0
- package/dist/ui/assets/{dist-BafxlePp.js → dist-C6Qm47PL.js} +1 -1
- package/dist/ui/assets/{dist-DEa2AyxC.js → dist-ilEkxLip.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-B9nEbwAU.js → ensure-speech-assets-BDz63X1e.js} +1 -1
- package/dist/ui/assets/esp8266-Dip6PaRZ.js +1 -0
- package/dist/ui/assets/{esptool-operations-DOLHZ3lh.js → esptool-operations-CPcOtBiB.js} +2 -2
- package/dist/ui/assets/{fs-GCp_miGo.js → fs-DbLSBgrZ.js} +1 -1
- package/dist/ui/assets/{fs-BXbkZdm4.js → fs-DcZIOhoO.js} +2 -2
- package/dist/ui/assets/{github-C_4arGR0.js → github-BzKzkG3E.js} +1 -1
- package/dist/ui/assets/{github-Bz1ni-OU.js → github-CXss2hVj.js} +2 -2
- package/dist/ui/assets/{github-copilot-Dfmfbira.js → github-copilot-BNt1sOpn.js} +1 -1
- package/dist/ui/assets/{github-copilot-CgjQ3oCm.js → github-copilot-B_VwFjgU.js} +1 -1
- package/dist/ui/assets/{hear-WZ7KsFPa.js → hear-qmyN_TI6.js} +1 -1
- package/dist/ui/assets/{kernel-worker-DfBOBrG4.js → kernel-worker-DRvGOqpl.js} +816 -790
- package/dist/ui/assets/{kokoro-engine-CZdBdTQm.js → kokoro-engine-D55VqYz2.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-DvKspKHX.js → lick-ws-bridge-OUe2lv5x.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-Cu7dpa8i.js → lick-ws-bridge-ch4l1RN0.js} +1 -1
- package/dist/ui/assets/{local-llm-BQ8OSWey.js → local-llm-Bu7XdX-8.js} +1 -1
- package/dist/ui/assets/{main-BwuI7fRl.js → main-Cmvs-4b3.js} +4 -4
- package/dist/ui/assets/{mount-DtlHau7q.js → mount-Dugwl_G8.js} +1 -1
- package/dist/ui/assets/{mount-B_Fai0cB.js → mount-awie1rkj.js} +2 -2
- package/dist/ui/assets/{new-session-xEsEQMaP.js → new-session-B8DDDliN.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-u1jC7Drj.js → oauth-bootstrap-Btw1wnpp.js} +2 -2
- package/dist/ui/assets/{openai-codex-B7hWdu3I.js → openai-codex-DpsqbdWi.js} +1 -1
- package/dist/ui/assets/{openai-codex-TQ8snEf1.js → openai-codex-Rh4T6H6N.js} +1 -1
- package/dist/ui/assets/{page-follower-tray-Dv2c9MjS.js → page-follower-tray-MKfvq2UU.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-sRKKwsAQ.js → panel-rpc-handlers-BbynP3ze.js} +2 -2
- package/dist/ui/assets/{provider-Cw7y1s3Y.js → provider-ByecteLA.js} +2 -2
- package/dist/ui/assets/{provider-toCTMFh6.js → provider-C5NbfXV8.js} +1 -1
- package/dist/ui/assets/provider-store-access-CIXaM1mT.js +1 -0
- package/dist/ui/assets/provider-store-access-DShcDXEP.js +1 -0
- package/dist/ui/assets/{providers-K4HcOMJ-.js → providers-C62sFch1.js} +1 -1
- package/dist/ui/assets/{providers-DDWD7k0v.js → providers-DdXvCdOY.js} +2 -2
- package/dist/ui/assets/py-realm-worker-M50pZEAO.js +244 -0
- package/dist/ui/assets/pyodide-CPgzyJWn.js +3 -0
- package/dist/ui/assets/pyodide-CY7aNvge.js +3 -0
- package/dist/ui/assets/{quick-llm-AORy1zgk.js → quick-llm-BpD0afu9.js} +1 -1
- package/dist/ui/assets/session-freezer-BWrnpCKi.js +1 -0
- package/dist/ui/assets/{speak-DzOzO6t_.js → speak-BKvofAdv.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-BHP5wWBw.js → sprinkle-manager-DTMfl-8d.js} +1 -1
- package/dist/ui/assets/{store-BU91i2F0.js → store-B1opGpoU.js} +1 -1
- package/dist/ui/assets/{sudo-D3Ls3Dkb.js → sudo-DUBeKEp5.js} +1 -1
- package/dist/ui/assets/{transformers-env-CcquuulE.js → transformers-env-CBrLOjgc.js} +1 -1
- package/dist/ui/assets/{tray-leader-Wknn0eO7.js → tray-leader-CxCeXLrs.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-D5R9x5pb.js → tray-leave-runtime-C9Xd-K2T.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-DPNjw--9.js → upgrade-detection-DXvKThLg.js} +1 -1
- package/dist/ui/assets/{voice-reply-BU4Ra94P.js → voice-reply-GoJBsykV.js} +1 -1
- package/dist/ui/assets/{wc-attach-DzZX7Bvl.js → wc-attach-BGBVAYe2.js} +2 -2
- package/dist/ui/assets/{wc-detached-BH_F26OY.js → wc-detached-ItX-R0IR.js} +1 -1
- package/dist/ui/assets/{wc-extension-BJpxZWmM.js → wc-extension-CQ58ZdmG.js} +2 -2
- package/dist/ui/assets/{wc-follower-Osw_cypJ.js → wc-follower-0S4vw_pW.js} +2 -2
- package/dist/ui/assets/{wc-live-C0Qhb3-a.js → wc-live-CXSudFHs.js} +5 -5
- package/dist/ui/assets/{wc-nav-CsdChxu5.js → wc-nav-C8BwJGKu.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-NGf5gmhr.js → wc-onboarding-DWTOlhtm.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-CHAA0tTq.js → wc-placeholder-Bmev8Pr0.js} +3 -3
- package/dist/ui/assets/{wc-settings-8GO2gzZ3.js → wc-settings-Dd9as02P.js} +2 -2
- package/dist/ui/assets/{wc-shell-CcQ2DALv.js → wc-shell-Cizp69uj.js} +78 -84
- package/dist/ui/assets/{wc-sprinkles-BJhExykW.js → wc-sprinkles-DuT_Z4Wm.js} +2 -2
- package/dist/ui/assets/{wc-tray-CLJNNdrx.js → wc-tray-DgcABRek.js} +2 -2
- package/dist/ui/assets/{whisper-engine-C-8IWV1j.js → whisper-engine-DU-d00q8.js} +1 -1
- package/dist/ui/assets/{xai-grok-DfeZ-LOu.js → xai-grok-Bo2MbOzF.js} +1 -1
- package/dist/ui/assets/{xai-grok-BPdOb0AZ.js → xai-grok-CT2UxaTl.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/ui/packages/webapp/index.html +3 -3
- package/package.json +2 -2
- package/dist/ui/assets/__vite-browser-external-ccPY92C6.js +0 -1
- package/dist/ui/assets/dip-BgeReDuU.js +0 -1
- package/dist/ui/assets/esp8266-BN31NBrB.js +0 -1
- package/dist/ui/assets/provider-store-access-BHi8qJ_0.js +0 -1
- package/dist/ui/assets/provider-store-access-BTHab7Ze.js +0 -1
- package/dist/ui/assets/py-realm-worker-hOFi8vjM.js +0 -242
- package/dist/ui/assets/pyodide-CqQhZelL.js +0 -3
- package/dist/ui/assets/pyodide-M7UA50Oh.js +0 -3
- package/dist/ui/assets/session-freezer-M1gjbtjP.js +0 -1
- package/dist/ui/assets/voice-input-BwyW3uqq.js +0 -1
- package/dist/ui/assets/wc-voice-erm0EtRv.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/quick-llm-
|
|
2
|
-
import{n as e}from"./chunk-aKtaBQYM.js";import{t}from"./preload-helper-zJ_50EbN.js";import{o as n}from"./main-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/quick-llm-BpD0afu9.js","assets/chunk-aKtaBQYM.js","assets/account-store-DW6iW9iB.js","assets/preload-helper-zJ_50EbN.js","assets/dist-BmWy99kl.js","assets/event-stream-BJI_nGaK.js","assets/json-parse-BUunmmNl.js","assets/__vite-browser-external-C7iut881.js","assets/context-compaction-CFWyOzX1.js","assets/logger-DDBAeTLF.js","assets/providers-DdXvCdOY.js","assets/src-x0cJ68Fe.js","assets/proxied-fetch-B5vr_AP8.js","assets/fetch-body-D2PwksUW.js","assets/secret-topology-Bp0wH2ni.js","assets/secrets-bridge-client-DXw32cXb.js","assets/panel-rpc-DqT2FG7c.js","assets/bedrock-camp-9-QEmC9Z.js","assets/transform-messages-DzB_lMo-.js","assets/tool-ui-DfXu6quJ.js","assets/icons-BU6llBsN.js","assets/llm-session-id-DVmZ9C2t.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e}from"./chunk-aKtaBQYM.js";import{t}from"./preload-helper-zJ_50EbN.js";import{o as n}from"./main-Cmvs-4b3.js";import{n as r,t as i}from"./icons-BU6llBsN.js";import{n as a,r as o,t as s}from"./speech-CqQdPtyQ.js";import{t as c}from"./soundscape-cues-5_sT5Un6.js";var l=e({applyDictationMarkers:()=>g,consumeDictationFirst:()=>v,parseReplyLang:()=>te,resetDictationPriming:()=>y,stripDictationMarkers:()=>ee,stripReplyLangMarker:()=>_}),u=`◁This message has been sent through text to speech, consider possible phonetic alternatives and transcription errors. Future dictated messages will have the 🎙️ emoji appended. Your responses to dictated messages will be read out loud, avoid urls, acronyms, numbers, formatting. Begin every reply with the language you are replying in as a hidden HTML comment, e.g. <!--lang:en--> for English or <!--lang:de--> for German; it stays hidden from the user and selects a matching voice▷`,d=/\uD83C\uDF99\uFE0F?/g,f=/\u25C1[\s\S]*?\u25B7/g,p=/<!--\s*lang:\s*([A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*)\s*-->/i,m=/<!--\s*lang:\s*[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*\s*-->/gi,h=!0;function g(e,t){let n=e.endsWith(` `)?e:`${e} `;return t?`${n}\uD83C\uDF99\uFE0F${u}`:`${n}\uD83C\uDF99\uFE0F`}function ee(e){return e.replace(f,``).replace(d,``).replace(/[ \t]+$/g,``).trimEnd()}function te(e){return p.exec(e)?.[1]}function _(e){return e.replace(m,``)}function v(){return h?(h=!1,!0):!1}function y(){h=!0}var ne=new Set([`webhook`,`cron`,`sprinkle`,`fswatch`,`session-reload`,`navigate`,`upgrade`,`workflow`,`scoop-notify`,`scoop-idle`,`scoop-wait`,`sudo-request`]);function re(e){return e!=null&&ne.has(e)}var ie=[`top-left`,`top-right`,`bottom-left`,`bottom-right`,`top`,`right`,`bottom`,`left`],ae=`top-right`,oe=`slicc-launcher-corner`,b=[`disconnected`,`connected`,`error`],se=`disconnected`,x=`follower-status`,ce=new Set(ie),le=new Set(b);function ue(e,t=ae){return e&&ce.has(e)?e:t}function de(e,t=se){return e&&le.has(e)?e:t}function fe(e,t){return e>=6||e>=12&&t>=.6}function pe({clientX:e,clientY:t,viewportWidth:n,viewportHeight:r,velocityXPxPerMs:i=0,velocityYPxPerMs:a=0,flickProjectionMs:o=180}){let s=me(e+i*o,0,n),c=me(t+a*o,0,r),l=s/n,u=c/r,d=l>1/3&&l<2/3,f=u>1/3&&u<2/3;if(d&&f){let e=u,t=1-u,n=l,r=1-l,i=Math.min(e,t,n,r);return i===e?`top`:i===t?`bottom`:i===n?`left`:`right`}return d?u<.5?`top`:`bottom`:f?l<.5?`left`:`right`:`${u<.5?`top`:`bottom`}-${l<.5?`left`:`right`}`}function me(e,t,n){return Math.min(Math.max(e,t),n)}var S=`<?xml version="1.0" encoding="UTF-8"?>
|
|
3
3
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="100%" height="100%"><g transform="translate(151.53125, -171.3125) scale(1.25)"><g transform="translate(0, 21)"><g id="Cone">
|
|
4
4
|
<path id="Cone_Bottom" data-name="Cone Bottom" 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" style="fill: rgb(34, 34, 34); stroke: rgb(255, 255, 255); stroke-linejoin: round; stroke-width: 20px;"></path>
|
|
5
5
|
<g id="Waffle_Cross-Hatch" data-name="Waffle Cross-Hatch">
|
|
@@ -1383,21 +1383,15 @@ slicc-composer .slicc-composer__ptt {
|
|
|
1383
1383
|
backdrop-filter: blur(10px) saturate(1.4);
|
|
1384
1384
|
-webkit-backdrop-filter: blur(10px) saturate(1.4);
|
|
1385
1385
|
}
|
|
1386
|
-
/* Touch-action is locked by the browser at the START of a pointer sequence,
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
selection. */
|
|
1393
|
-
slicc-composer[ptt] textarea {
|
|
1386
|
+
/* Touch-action is locked by the browser at the START of a pointer sequence, so
|
|
1387
|
+
suppress scroll-pan / iOS long-press callout on the mic button BEFORE any
|
|
1388
|
+
touch begins — a finger that drifts mid-hold can otherwise start a pan and
|
|
1389
|
+
fire pointercancel. Scoped to the push-to-talk trigger; the textarea is left
|
|
1390
|
+
entirely alone so normal text selection works. */
|
|
1391
|
+
slicc-composer [data-ptt-trigger] {
|
|
1394
1392
|
touch-action: none;
|
|
1395
1393
|
-webkit-touch-callout: none;
|
|
1396
1394
|
}
|
|
1397
|
-
slicc-composer[data-ptt-pressed] textarea {
|
|
1398
|
-
user-select: none;
|
|
1399
|
-
-webkit-user-select: none;
|
|
1400
|
-
}
|
|
1401
1395
|
slicc-composer .slicc-composer__ptt-microw {
|
|
1402
1396
|
display: flex;
|
|
1403
1397
|
align-items: center;
|
|
@@ -1602,7 +1596,7 @@ slicc-composer .slicc-composer__ptt.is-picking {
|
|
|
1602
1596
|
animation-name: none;
|
|
1603
1597
|
}
|
|
1604
1598
|
}
|
|
1605
|
-
`,$t=`slicc-composer-style`;function en(e){if(e.getElementById($t))return;let t=e.createElement(`style`);t.id=$t,t.textContent=Qt,(e.head??e.documentElement).appendChild(t)}var tn=3e3,nn=60,rn=1e4,an=45e3;function on(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 sn=`slicc-composer:mic-device`;function cn(){try{return typeof localStorage>`u`?null:localStorage.getItem(sn)}catch{return null}}function ln(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(sn,e):localStorage.removeItem(sn)}catch{}}function un(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`}E(`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=cn();#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=[];connectedCallback(){en(this.ownerDocument),this.#w(),this.addEventListener(`pointerdown`,this.#T)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#T),this.#c?.cancel(),this.#c=null,this.#k(),this.#i=!1,this.#o=null,this.#a++,this.#L(),this.#F(),this.#p&&clearTimeout(this.#p),this.#p=null,this.#I(),this.#U(),this.#Q()}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,ln(e)}get inner(){return this.#w(),this.#e}append(...e){this.#w(),this.#e.append(...e)}#w(){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)}#T=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))return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}this.setAttribute(`data-ptt-pressed`,``),this.ownerDocument.addEventListener(`pointerup`,this.#A),this.addEventListener(`pointercancel`,this.#j);let n=this.#a;this.#m=setTimeout(()=>{this.#m=null,this.#E(this.speech,n)},100)};async#E(e,t){let n=await Promise.race([e.permission().then(e=>(this.#d=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),nn))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#O(e,t);return}if(n===`denied`){this.#G(`denied`);return}this.#G(`enable`),this.#p=setTimeout(()=>{this.#p=null,this.#D(e,t)},tn),n===`pending`&&e.permission().then(n=>{this.#d=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#P(),this.#O(e,t)):n===`denied`&&(this.#P(),this.#G(`denied`)))})}}#D(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#_=null,this.#G(`prompting`),on(e.requestPermission(),rn,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.#O(e,t):n?this.#Q():this.#i?this.#G(`denied`):this.#Q())}).catch(e=>{this.#d=`denied`,t===this.#a&&(this.#i?(this.#_=e instanceof Error?e.message:String(e),this.#G(`denied`)):this.#Q())}))}#O(e,t){this.#r=`recording`,this.#G(`recording`),e.warmup(),this.#h?.(),this.#h=e.onStatus(e=>{this.#g=e,this.#X()}),e.microphones().then(e=>{t===this.#a&&o(e)&&this.#Z(e)});let n=e.start({deviceId:this.#f??void 0,onPartial:e=>{t===this.#a&&this.#Y(e)},onError:e=>{t===this.#a&&this.#Y(e,!0)}});this.#l=n,n.then(e=>{if(this.#l===n){if(this.#l=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#c=e}}).catch(e=>{this.#l===n&&(this.#l=null,t===this.#a&&this.#Y(e instanceof Error?e.message:String(e),!0))})}#k(){let e=this.#l;this.#l=null,e&&e.then(e=>e.cancel(),()=>{})}#A=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#x,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.#L(),this.#I(),this.#c?.cancel(),this.#c=null,this.#k(),this.#o=null,this.#R();return}this.#M(!0)};#j=e=>{this.#s!=null&&e.pointerId!==this.#s||this.#M(!1)};#M(e){if(!this.#i)return;switch(this.#i=!1,this.#F(),this.#L(),this.#I(),this.#r){case`enable`:this.#P(),this.#o=null,this.#Q();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#Q();return;case`recording`:break;default:this.#o=null,this.#Q();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.#Q();return}if(!t&&!n){this.#o=null,this.#Q();return}this.#r=`finalizing`,this.#Y(`Transcribing…`);let r=this.#a;on((t?Promise.resolve(t):n).then(e=>e.stop()),an,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#Q(),this.#N(e))}).catch(()=>{r===this.#a&&(this.#Q(),this.#o=null)})}#N(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`}}))}#P(){this.#p&&clearTimeout(this.#p),this.#p=null}#F(){this.#m&&clearTimeout(this.#m),this.#m=null}#I(){this.ownerDocument.removeEventListener(`pointerup`,this.#A),this.removeEventListener(`pointercancel`,this.#j)}#L(){let e=this.#s;if(this.#s=null,this.removeAttribute(`data-ptt-pressed`),e!=null)try{this.releasePointerCapture(e)}catch{}}#R(){this.#r=`picking`,this.#J(`picking`),this.#v&&(this.#v.textContent=`Choose a microphone`),this.#y&&(this.#y.hidden=!0),this.#z();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#V,!0),e.addEventListener(`keydown`,this.#H,!0)}#z(){let e=this.#x;if(!e||this.#S)return;let t=O(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),n=null;for(let e of this.#C){let i=e.deviceId===this.#f,a=O(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":i?`true`:`false`,"data-device-id":e.deviceId},e.label,O(`span`,{class:`tick`},r(`check`,{size:14})));a.addEventListener(`click`,()=>{this.device=e.deviceId,this.#W()}),(i||!n)&&(n=a),t.appendChild(a)}this.#S=t,e.appendChild(t),this.#B(t,e),n?.focus()}#B(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`}#V=e=>{this.#x&&e.composedPath().includes(this.#x)||this.#W()};#H=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#W())};#U(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#V,!0),e.removeEventListener(`keydown`,this.#H,!0)}#W(){this.#U(),this.#Q()}#G(e){switch(this.#r=e,this.#n||(this.#n=O(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#J(e),e){case`enable`:this.#K(r(`mic`,{size:28}),`Hold to enable push to talk`,this.#q(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#K(r(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#q(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#_?`Microphone unavailable`:`Microphone access is blocked`,t=this.#_??`Enable the microphone for this site in your browser settings, then hold again.`;this.#K(r(`mic-off`,{size:28}),e,O(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#x=O(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#y=O(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#b=O(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=O(`div`,{class:`slicc-composer__ptt-microw`},O(`div`,{class:`slicc-composer__ptt-mic`},r(`mic`,{size:28})),this.#x);this.#v=O(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#v,this.#y,this.#b),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#X();break}}}#K(e,t,n){this.#n&&(this.#v=O(`div`,{class:`slicc-composer__ptt-label`},t),this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=[],this.#n.replaceChildren(O(`div`,{class:`slicc-composer__ptt-mic`},e),this.#v,n))}#q(e){return O(`div`,{class:`slicc-composer__ptt-load`},O(`span`,{class:`slicc-composer__ptt-load-text`},e),O(`div`,{class:`slicc-composer__ptt-bar`},O(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#J(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}`))}#Y(e,t=!1){let n=this.#y;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}#X(){let e=this.#b;if(!e)return;let t=this.#g;if(t?.state===`downloading`){if(t.download){let n=un(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)}#Z(e){let t=this.#x;if(!t)return;this.#C=e;let n=O(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},r(`chevron-down`,{size:12}));n.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(n),t.hidden=!1}#Q(){this.#h?.(),this.#h=null,this.#n?.remove(),this.#n=null,this.#v=null,this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=[],this.#_=null,this.#r=`idle`}});var dn=`
|
|
1599
|
+
`,$t=`slicc-composer-style`;function en(e){if(e.getElementById($t))return;let t=e.createElement(`style`);t.id=$t,t.textContent=Qt,(e.head??e.documentElement).appendChild(t)}var tn=3e3,nn=60,rn=1e4,an=45e3;function on(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 sn=`slicc-composer:mic-device`;function cn(){try{return typeof localStorage>`u`?null:localStorage.getItem(sn)}catch{return null}}function ln(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(sn,e):localStorage.removeItem(sn)}catch{}}function un(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`}E(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`,`ptt`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=null;#l=null;#u=null;#d=`unknown`;#f=cn();#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=[];connectedCallback(){en(this.ownerDocument),this.#T(),this.addEventListener(`pointerdown`,this.#E),this.#w()}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#E),this.#c?.cancel(),this.#c=null,this.#A(),this.#i=!1,this.#o=null,this.#a++,this.#R(),this.#I(),this.#p&&clearTimeout(this.#p),this.#p=null,this.#L(),this.#W(),this.#$()}attributeChangedCallback(e){e===`ptt`&&this.#w()}#w(){this.querySelector(`slicc-input-card`)?.toggleAttribute(`dictation`,this.hasAttribute(`ptt`))}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,ln(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?.(`[data-ptt-trigger]`);if(!t||!this.contains(t))return;let n=(t.closest(`slicc-input-card`)??this).querySelector(`textarea`);if(!(n instanceof HTMLTextAreaElement))return;this.#i=!0,this.#a++,this.#o=n,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}this.ownerDocument.addEventListener(`pointerup`,this.#j),this.addEventListener(`pointercancel`,this.#M);let r=this.#a;this.#m=setTimeout(()=>{this.#m=null,this.#D(this.speech,r)},100)};async#D(e,t){let n=await Promise.race([e.permission().then(e=>(this.#d=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),nn))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#k(e,t);return}if(n===`denied`){this.#K(`denied`);return}this.#K(`enable`),this.#p=setTimeout(()=>{this.#p=null,this.#O(e,t)},tn),n===`pending`&&e.permission().then(n=>{this.#d=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#F(),this.#k(e,t)):n===`denied`&&(this.#F(),this.#K(`denied`)))})}}#O(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#_=null,this.#K(`prompting`),on(e.requestPermission(),rn,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.#k(e,t):n?this.#$():this.#i?this.#K(`denied`):this.#$())}).catch(e=>{this.#d=`denied`,t===this.#a&&(this.#i?(this.#_=e instanceof Error?e.message:String(e),this.#K(`denied`)):this.#$())}))}#k(e,t){this.#r=`recording`,this.#K(`recording`),e.warmup(),this.#h?.(),this.#h=e.onStatus(e=>{this.#g=e,this.#Z()}),e.microphones().then(e=>{t===this.#a&&o(e)&&this.#Q(e)});let n=e.start({deviceId:this.#f??void 0,onPartial:e=>{t===this.#a&&this.#X(e)},onError:e=>{t===this.#a&&this.#X(e,!0)}});this.#l=n,n.then(e=>{if(this.#l===n){if(this.#l=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#c=e}}).catch(e=>{this.#l===n&&(this.#l=null,t===this.#a&&this.#X(e instanceof Error?e.message:String(e),!0))})}#A(){let e=this.#l;this.#l=null,e&&e.then(e=>e.cancel(),()=>{})}#j=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#x,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.#R(),this.#L(),this.#c?.cancel(),this.#c=null,this.#A(),this.#o=null,this.#z();return}this.#N(!0)};#M=e=>{this.#s!=null&&e.pointerId!==this.#s||this.#N(!1)};#N(e){if(!this.#i)return;switch(this.#i=!1,this.#I(),this.#R(),this.#L(),this.#r){case`enable`:this.#F(),this.#o=null,this.#$();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#$();return;case`recording`:break;default:this.#o=null,this.#$();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.#$();return}if(!t&&!n){this.#o=null,this.#$();return}this.#r=`finalizing`,this.#X(`Transcribing…`);let r=this.#a;on((t?Promise.resolve(t):n).then(e=>e.stop()),an,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#$(),this.#P(e))}).catch(()=>{r===this.#a&&(this.#$(),this.#o=null)})}#P(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`}}))}#F(){this.#p&&clearTimeout(this.#p),this.#p=null}#I(){this.#m&&clearTimeout(this.#m),this.#m=null}#L(){this.ownerDocument.removeEventListener(`pointerup`,this.#j),this.removeEventListener(`pointercancel`,this.#M)}#R(){let e=this.#s;if(this.#s=null,e!=null)try{this.releasePointerCapture(e)}catch{}}#z(){this.#r=`picking`,this.#Y(`picking`),this.#v&&(this.#v.textContent=`Choose a microphone`),this.#y&&(this.#y.hidden=!0),this.#B();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#H,!0),e.addEventListener(`keydown`,this.#U,!0)}#B(){let e=this.#x;if(!e||this.#S)return;let t=O(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),n=null;for(let e of this.#C){let i=e.deviceId===this.#f,a=O(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":i?`true`:`false`,"data-device-id":e.deviceId},e.label,O(`span`,{class:`tick`},r(`check`,{size:14})));a.addEventListener(`click`,()=>{this.device=e.deviceId,this.#G()}),(i||!n)&&(n=a),t.appendChild(a)}this.#S=t,e.appendChild(t),this.#V(t,e),n?.focus()}#V(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`}#H=e=>{this.#x&&e.composedPath().includes(this.#x)||this.#G()};#U=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#G())};#W(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#H,!0),e.removeEventListener(`keydown`,this.#U,!0)}#G(){this.#W(),this.#$()}#K(e){switch(this.#r=e,this.#n||(this.#n=O(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#Y(e),e){case`enable`:this.#q(r(`mic`,{size:28}),`Hold to enable push to talk`,this.#J(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#q(r(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#J(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#_?`Microphone unavailable`:`Microphone access is blocked`,t=this.#_??`Enable the microphone for this site in your browser settings, then hold again.`;this.#q(r(`mic-off`,{size:28}),e,O(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#x=O(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#y=O(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#b=O(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=O(`div`,{class:`slicc-composer__ptt-microw`},O(`div`,{class:`slicc-composer__ptt-mic`},r(`mic`,{size:28})),this.#x);this.#v=O(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#v,this.#y,this.#b),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#Z();break}}}#q(e,t,n){this.#n&&(this.#v=O(`div`,{class:`slicc-composer__ptt-label`},t),this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=[],this.#n.replaceChildren(O(`div`,{class:`slicc-composer__ptt-mic`},e),this.#v,n))}#J(e){return O(`div`,{class:`slicc-composer__ptt-load`},O(`span`,{class:`slicc-composer__ptt-load-text`},e),O(`div`,{class:`slicc-composer__ptt-bar`},O(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#Y(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}`))}#X(e,t=!1){let n=this.#y;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}#Z(){let e=this.#b;if(!e)return;let t=this.#g;if(t?.state===`downloading`){if(t.download){let n=un(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)}#Q(e){let t=this.#x;if(!t)return;this.#C=e;let n=O(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},r(`chevron-down`,{size:12}));n.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(n),t.hidden=!1}#$(){this.#h?.(),this.#h=null,this.#n?.remove(),this.#n=null,this.#v=null,this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=[],this.#_=null,this.#r=`idle`}});var dn=`
|
|
1606
1600
|
slicc-composer-capture {
|
|
1607
1601
|
position: relative;
|
|
1608
1602
|
display: block;
|
|
@@ -2066,7 +2060,36 @@ slicc-composer-capture .slicc-capture__timer[hidden] {
|
|
|
2066
2060
|
}
|
|
2067
2061
|
.glyph.is-press { transform: none; }
|
|
2068
2062
|
}
|
|
2069
|
-
`),In=18,Ln=72,Rn=`http://www.w3.org/2000/svg`,zn=15,Bn=.25;function Vn(e){let t=document.createElementNS(Rn,`svg`);t.setAttribute(`width`,`36`),t.setAttribute(`height`,`36`),t.setAttribute(`viewBox`,`0 0 36 36`),t.setAttribute(`fill`,`none`),t.setAttribute(`aria-hidden`,`true`);let n=2*Math.PI*zn,r=e=>{let t=document.createElementNS(Rn,`circle`);return t.setAttribute(`cx`,`18`),t.setAttribute(`cy`,`18`),t.setAttribute(`r`,String(zn)),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke-width`,`2.5`),t.setAttribute(`stroke-linecap`,`round`),t.setAttribute(`class`,e),t};t.appendChild(r(`ring-track`));let i=r(`ring-arc`),a=e==null?Bn:Math.max(0,Math.min(1,e));return i.setAttribute(`stroke-dasharray`,`${n*a} ${n}`),e!=null&&i.setAttribute(`transform`,`rotate(-90 18 18)`),t.appendChild(i),t}function Hn(e){return e===`tool`?`tool`:`thinking`}function Un(e){if(e==null||e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}E(`slicc-send-button`,class extends HTMLElement{static observedAttributes=[`disabled`,`busy`,`phase`,`progress`,`email`,`src`,`label`];#e;#t=null;#n=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Fn]}connectedCallback(){this.#d()}attributeChangedCallback(){this.isConnected&&this.#d()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,!!e)}get phase(){return Hn(this.getAttribute(`phase`))}set phase(e){this.setAttribute(`phase`,Hn(e))}get progress(){return Un(this.getAttribute(`progress`))}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(e))}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#r=()=>{if(!this.disabled){if(this.busy){this.dispatchEvent(new CustomEvent(`stop`,{bubbles:!0,composed:!0}));return}this.#l(),this.dispatchEvent(new CustomEvent(`send`,{bubbles:!0,composed:!0}))}};#i(){return this.#e.querySelector(`.glyph`)}#a=()=>{this.disabled||this.busy||this.#i()?.classList.add(`is-hover`)};#o=()=>{this.#i()?.classList.remove(`is-hover`,`is-press`)};#s=()=>{if(this.disabled||this.busy)return;let e=this.#i();e?.classList.add(`is-press`),e?.classList.remove(`is-hover`)};#c=()=>{this.#i()?.classList.remove(`is-press`)};#l(){let e=this.#e.querySelector(`.glyph`);e&&(e.classList.remove(`is-whoosh`),e.offsetWidth,e.classList.add(`is-whoosh`),e.addEventListener(`animationend`,()=>e.classList.remove(`is-whoosh`),{once:!0}))}#u(){let e=++this.#n;if(!this.#t)return;let t=t=>{if(e!==this.#n)return;let n=this.#t;if(n)if(n.querySelector(`.face`)?.remove(),t){let e=document.createElement(`img`);e.className=`face`,e.setAttribute(`part`,`face`),e.alt=``,e.src=t,n.prepend(e),n.classList.add(`has-face`)}else n.classList.remove(`has-face`)},n=this.src;if(n){t(n);return}let r=this.email;if(!r||r.trim()===``){t(null);return}t(null),Pn(r,{size:Ln}).then(t).catch(()=>t(null))}#d(){let e=this.busy,t=this.disabled,n=e&&this.phase===`tool`,i=this.label??(e?`Stop`:`Send`),a;if(n){let e=this.progress,t=e==null;a=O(`slot`,{name:`busy`},O(`span`,{class:`stop`,part:`stop`},r(`square`,{size:In})),O(`span`,{class:`spinner${t?` is-indeterminate`:``}`,part:`spinner`},Vn(e)))}else a=e?O(`slot`,{name:`busy`},O(`span`,{class:`stop`,part:`stop`},r(`square`,{size:In}),O(`span`,{class:`stop-fill`},r(`square`,{size:In})))):O(`slot`,null,O(`span`,{class:`glyph`,part:`glyph`},r(`arrow-up`,{size:In})));let o=O(`button`,{part:`button`,class:`send${e?` is-busy`:``}${n?` is-tool`:``}`,type:`button`,title:i,"aria-label":i,disabled:t||void 0},a);this.#e.replaceChildren(o),this.#t=o,this.#t.addEventListener(`click`,this.#r),this.#t.addEventListener(`pointerenter`,this.#a),this.#t.addEventListener(`pointerleave`,this.#o),this.#t.addEventListener(`pointerdown`,this.#s),this.#t.addEventListener(`pointerup`,this.#c),this.#u()}});var Wn
|
|
2063
|
+
`),In=18,Ln=72,Rn=`http://www.w3.org/2000/svg`,zn=15,Bn=.25;function Vn(e){let t=document.createElementNS(Rn,`svg`);t.setAttribute(`width`,`36`),t.setAttribute(`height`,`36`),t.setAttribute(`viewBox`,`0 0 36 36`),t.setAttribute(`fill`,`none`),t.setAttribute(`aria-hidden`,`true`);let n=2*Math.PI*zn,r=e=>{let t=document.createElementNS(Rn,`circle`);return t.setAttribute(`cx`,`18`),t.setAttribute(`cy`,`18`),t.setAttribute(`r`,String(zn)),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke-width`,`2.5`),t.setAttribute(`stroke-linecap`,`round`),t.setAttribute(`class`,e),t};t.appendChild(r(`ring-track`));let i=r(`ring-arc`),a=e==null?Bn:Math.max(0,Math.min(1,e));return i.setAttribute(`stroke-dasharray`,`${n*a} ${n}`),e!=null&&i.setAttribute(`transform`,`rotate(-90 18 18)`),t.appendChild(i),t}function Hn(e){return e===`tool`?`tool`:`thinking`}function Un(e){if(e==null||e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}E(`slicc-send-button`,class extends HTMLElement{static observedAttributes=[`disabled`,`busy`,`phase`,`progress`,`email`,`src`,`label`];#e;#t=null;#n=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Fn]}connectedCallback(){this.#d()}attributeChangedCallback(){this.isConnected&&this.#d()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,!!e)}get phase(){return Hn(this.getAttribute(`phase`))}set phase(e){this.setAttribute(`phase`,Hn(e))}get progress(){return Un(this.getAttribute(`progress`))}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(e))}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#r=()=>{if(!this.disabled){if(this.busy){this.dispatchEvent(new CustomEvent(`stop`,{bubbles:!0,composed:!0}));return}this.#l(),this.dispatchEvent(new CustomEvent(`send`,{bubbles:!0,composed:!0}))}};#i(){return this.#e.querySelector(`.glyph`)}#a=()=>{this.disabled||this.busy||this.#i()?.classList.add(`is-hover`)};#o=()=>{this.#i()?.classList.remove(`is-hover`,`is-press`)};#s=()=>{if(this.disabled||this.busy)return;let e=this.#i();e?.classList.add(`is-press`),e?.classList.remove(`is-hover`)};#c=()=>{this.#i()?.classList.remove(`is-press`)};#l(){let e=this.#e.querySelector(`.glyph`);e&&(e.classList.remove(`is-whoosh`),e.offsetWidth,e.classList.add(`is-whoosh`),e.addEventListener(`animationend`,()=>e.classList.remove(`is-whoosh`),{once:!0}))}#u(){let e=++this.#n;if(!this.#t)return;let t=t=>{if(e!==this.#n)return;let n=this.#t;if(n)if(n.querySelector(`.face`)?.remove(),t){let e=document.createElement(`img`);e.className=`face`,e.setAttribute(`part`,`face`),e.alt=``,e.src=t,n.prepend(e),n.classList.add(`has-face`)}else n.classList.remove(`has-face`)},n=this.src;if(n){t(n);return}let r=this.email;if(!r||r.trim()===``){t(null);return}t(null),Pn(r,{size:Ln}).then(t).catch(()=>t(null))}#d(){let e=this.busy,t=this.disabled,n=e&&this.phase===`tool`,i=this.label??(e?`Stop`:`Send`),a;if(n){let e=this.progress,t=e==null;a=O(`slot`,{name:`busy`},O(`span`,{class:`stop`,part:`stop`},r(`square`,{size:In})),O(`span`,{class:`spinner${t?` is-indeterminate`:``}`,part:`spinner`},Vn(e)))}else a=e?O(`slot`,{name:`busy`},O(`span`,{class:`stop`,part:`stop`},r(`square`,{size:In}),O(`span`,{class:`stop-fill`},r(`square`,{size:In})))):O(`slot`,null,O(`span`,{class:`glyph`,part:`glyph`},r(`arrow-up`,{size:In})));let o=O(`button`,{part:`button`,class:`send${e?` is-busy`:``}${n?` is-tool`:``}`,type:`button`,title:i,"aria-label":i,disabled:t||void 0},a);this.#e.replaceChildren(o),this.#t=o,this.#t.addEventListener(`click`,this.#r),this.#t.addEventListener(`pointerenter`,this.#a),this.#t.addEventListener(`pointerleave`,this.#o),this.#t.addEventListener(`pointerdown`,this.#s),this.#t.addEventListener(`pointerup`,this.#c),this.#u()}});var Wn=k(`
|
|
2064
|
+
:host { display: inline-grid; }
|
|
2065
|
+
:host([hidden]) { display: none; }
|
|
2066
|
+
.iconbtn {
|
|
2067
|
+
width: 30px;
|
|
2068
|
+
height: 30px;
|
|
2069
|
+
border-radius: 8px;
|
|
2070
|
+
border: 1px solid var(--line);
|
|
2071
|
+
background: var(--canvas);
|
|
2072
|
+
color: var(--txt-2);
|
|
2073
|
+
font-family: var(--ui);
|
|
2074
|
+
font-size: 16px;
|
|
2075
|
+
line-height: 1;
|
|
2076
|
+
cursor: pointer;
|
|
2077
|
+
display: grid;
|
|
2078
|
+
place-items: center;
|
|
2079
|
+
padding: 0;
|
|
2080
|
+
margin: 0;
|
|
2081
|
+
-webkit-appearance: none;
|
|
2082
|
+
appearance: none;
|
|
2083
|
+
}
|
|
2084
|
+
.iconbtn:hover { background: var(--ghost); color: var(--ink); }
|
|
2085
|
+
.iconbtn:disabled {
|
|
2086
|
+
cursor: default;
|
|
2087
|
+
opacity: 0.45;
|
|
2088
|
+
}
|
|
2089
|
+
.iconbtn:disabled:hover { background: var(--canvas); color: var(--txt-2); }
|
|
2090
|
+
.icon { display: grid; place-items: center; pointer-events: none; }
|
|
2091
|
+
.icon svg { display: block; }
|
|
2092
|
+
`),Gn=`plus`,Kn=16;E(`slicc-icon-button`,class extends HTMLElement{static observedAttributes=[`icon`,`disabled`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Wn]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get icon(){return this.getAttribute(`icon`)??Gn}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label,t=O(`slot`,null,O(`span`,{class:`icon`},r(this.icon,{size:Kn,part:`icon`}))),n=O(`button`,{type:`button`,class:`iconbtn`,part:`button`,"aria-label":e??void 0,title:e??void 0,disabled:this.disabled},t);this.#e.replaceChildren(n)}});var qn=`
|
|
2070
2093
|
slicc-input-card {
|
|
2071
2094
|
display: block;
|
|
2072
2095
|
}
|
|
@@ -2120,7 +2143,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2120
2143
|
flex: 1;
|
|
2121
2144
|
min-width: 0;
|
|
2122
2145
|
}
|
|
2123
|
-
`,
|
|
2146
|
+
`,Jn=`slicc-input-card-style`;function Yn(e){if(e.getElementById(Jn))return;let t=e.createElement(`style`);t.id=Jn,t.textContent=qn,(e.head??e.documentElement).appendChild(t)}var Xn=`Ask sliccy, or describe a change…`;E(`slicc-input-card`,class extends HTMLElement{static observedAttributes=[`value`,`placeholder`,`suggestion`,`disabled`,`dictation`];#e;#t;#n;#r=null;#i=!1;connectedCallback(){Yn(this.ownerDocument),this.#a(),this.#s(),this.#f()}attributeChangedCallback(e,t,n){if(!(!this.#i||t===n)){if(e===`dictation`){this.#o();return}this.#s(),e===`value`&&this.#f()}}get value(){return this.#i?this.#t.value:this.getAttribute(`value`)??``}set value(e){let t=e??``;this.#i&&(this.#t.value=t,this.#f()),t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t)}get placeholder(){return this.getAttribute(`placeholder`)??Xn}set placeholder(e){e==null?this.removeAttribute(`placeholder`):this.setAttribute(`placeholder`,e)}get suggestion(){return this.getAttribute(`suggestion`)}set suggestion(e){e==null||e===``?this.removeAttribute(`suggestion`):this.setAttribute(`suggestion`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get dictation(){return this.hasAttribute(`dictation`)}set dictation(e){this.toggleAttribute(`dictation`,!!e)}focus(e){this.#a(),this.#t.focus(e)}clear(){this.value=``}#a(){if(this.#i)return;this.#i=!0;let e=this.ownerDocument,t=Array.from(this.children).filter(e=>e.getAttribute(`slot`)===`toolbar`);if(this.replaceChildren(),this.#e=e.createElement(`div`),this.#e.className=`slicc-input-card__card`,this.#e.setAttribute(`part`,`card`),this.#t=e.createElement(`textarea`),this.#t.className=`ta`,this.#t.setAttribute(`part`,`textarea`),this.#t.rows=1,this.#n=e.createElement(`div`),this.#n.className=`toolbar`,this.#n.setAttribute(`part`,`toolbar`),t.length>0)for(let e of t)this.#n.appendChild(e);else this.#n.append(O(`slicc-add-menu`),O(`slicc-send-button`));this.#e.append(this.#t,this.#n),this.appendChild(this.#e),this.#t.addEventListener(`input`,this.#c),this.#t.addEventListener(`keydown`,this.#l),this.#n.addEventListener(`send`,this.#u),this.#o()}#o(){if(this.#i)if(this.hasAttribute(`dictation`)){if(this.#r)return;let e=this.#n.querySelector(`slicc-send-button`);if(!e)return;this.#r=O(`slicc-icon-button`,{icon:`mic`,label:`Push to talk`,part:`mic`,"data-ptt-trigger":!0}),this.#n.insertBefore(this.#r,e)}else this.#r&&=(this.#r.remove(),null)}#s(){if(!this.#i)return;let e=this.#t;e.placeholder=this.suggestion??this.placeholder,e.disabled=this.disabled;let t=this.getAttribute(`value`)??``;e.value!==t&&(e.value=t)}#c=e=>{e.stopPropagation();let t=this.#t.value;t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t),this.#f(),this.dispatchEvent(new CustomEvent(`input`,{bubbles:!0,composed:!0,detail:{value:t}}))};#l=e=>{if(e.isComposing)return;if(e.key===`Enter`&&!e.shiftKey){e.preventDefault(),this.#d();return}if(e.key===`Tab`&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey){let t=this.suggestion;if(t&&this.#t.value===``){e.preventDefault(),this.removeAttribute(`suggestion`);let n=this.#t;n.value=t,n.setSelectionRange(t.length,t.length),n.dispatchEvent(new Event(`input`,{bubbles:!0}))}return}let t=this.#t,n=t.selectionStart===t.selectionEnd;e.key===`ArrowUp`&&n&&t.selectionStart===0?(e.preventDefault(),this.dispatchEvent(new CustomEvent(`history-up`,{bubbles:!0,composed:!0}))):e.key===`ArrowDown`&&n&&t.selectionStart===t.value.length&&this.dispatchEvent(new CustomEvent(`history-down`,{bubbles:!0,composed:!0}))};#u=e=>{e.stopPropagation(),this.#d()};submit(e){this.#a(),this.#d(e)}focusEnd(){if(!this.#i)return;let e=this.#t;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}#d(e){if(this.disabled)return;let t=this.#t.value;t.trim()!==``&&(this.removeAttribute(`suggestion`),this.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t,...e?{source:e}:{}}})))}#f(){if(!this.#i)return;let e=this.#t;e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${Math.min(t,140)}px`,e.style.overflowY=t>140?`auto`:`hidden`}});var Zn=k(`
|
|
2124
2147
|
:host{display:block;font-family:var(--ui);}
|
|
2125
2148
|
:host(:not([count])),:host([count="0"]),:host([count="-0"]){display:none;}
|
|
2126
2149
|
.wrap{display:flex;flex-direction:column;align-items:stretch;gap:6px;}
|
|
@@ -2141,7 +2164,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2141
2164
|
:host-context(body.dark) .dismiss:hover,:host-context(body.dark) .dismiss:focus-visible,
|
|
2142
2165
|
:host-context(.dark) .dismiss:hover,:host-context(.dark) .dismiss:focus-visible,
|
|
2143
2166
|
:host-context([data-theme="dark"]) .dismiss:hover,:host-context([data-theme="dark"]) .dismiss:focus-visible{background:color-mix(in srgb,#0a0a0a 14%,transparent);}
|
|
2144
|
-
`),
|
|
2167
|
+
`),Qn=[{rot:0,x:0,y:0},{rot:-2,x:-3,y:-2},{rot:2,x:3,y:-4},{rot:-3,x:-5,y:-6},{rot:3,x:5,y:-8},{rot:-1,x:-2,y:-10},{rot:1,x:2,y:-12}];function $n(e){return Qn[Math.min(e,Qn.length-1)]??Qn[0]}E(`slicc-queued-stack`,class extends HTMLElement{#e;#t=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Zn]}connectedCallback(){this.#i()}get count(){return this.#t.length}setMessages(e){this.#t=e.slice(),this.setAttribute(`count`,String(this.#t.length)),this.#i()}#n(e){this.dispatchEvent(new CustomEvent(`slicc-queued-remove`,{detail:{id:e},bubbles:!0,composed:!0}))}#r(e,t,n,i){let{rot:a,x:o,y:s}=$n(t),c=n?`none`:`translate(${o}px, ${s}px) rotate(${a}deg)`,l=`card${n?` is-front`:``}${t===0?``:t===1?` is-back`:` is-deep`}`,u=n?`card front`:`card`,d=`transform:${c};z-index:${i};`,f=[O(`span`,{class:`bubble`},e.text)];if(e.attachments&&e.attachments>0&&f.push(O(`span`,{class:`attach`},`+${e.attachments}`)),n){let t=O(`button`,{type:`button`,class:`dismiss`,part:`dismiss`,"aria-label":`Remove queued message`},r(`x`,{size:14}));t.addEventListener(`click`,t=>{t.stopPropagation(),this.#n(e.id)}),f.push(t)}return O(`div`,{class:l,part:u,style:d},...f)}#i(){if(this.#t.length===0){this.#e.replaceChildren();return}let e=this.#t.length,t=[];for(let n=e-1;n>=0;n--){let r=e-1-n,i=r===0,a=n+1,o=this.#t[n];o&&t.push(this.#r(o,r,i,a))}let n=O(`div`,{class:`stack`,part:`stack`},...t),i=O(`div`,{class:`wrap`},O(`span`,{class:`badge`,part:`badge`},r(`clock`,{size:11}),`${e} queued`),n);this.#e.replaceChildren(i)}});var er=1e3;function tr(e,t){let n=t.longPressMs??1e3,r=t.modifierClickAsLongPress??!0,i=null,a=!1,o=()=>{t.onPressEnd?.()},s=()=>{i!==null&&(clearTimeout(i),i=null),o()},c=e=>{e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(a=!1,s(),t.onPressStart?.(e),i=setTimeout(()=>{a=!0,o(),i=null,t.onLongPress()},n)))},l=()=>s(),u=()=>s(),d=()=>s(),f=()=>s(),p=e=>{if(a){a=!1,e.preventDefault();return}if((e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)&&r){e.preventDefault(),t.onLongPress();return}t.onShortClick(e)};return e.addEventListener(`mousedown`,c),e.addEventListener(`mouseup`,l),e.addEventListener(`mouseleave`,u),e.addEventListener(`blur`,d),e.addEventListener(`contextmenu`,f),e.addEventListener(`click`,p),{destroy:()=>{s(),e.removeEventListener(`mousedown`,c),e.removeEventListener(`mouseup`,l),e.removeEventListener(`mouseleave`,u),e.removeEventListener(`blur`,d),e.removeEventListener(`contextmenu`,f),e.removeEventListener(`click`,p)}}}var nr=k(`
|
|
2145
2168
|
:host { display: inline-grid; }
|
|
2146
2169
|
:host([hidden]) { display: none; }
|
|
2147
2170
|
|
|
@@ -2223,7 +2246,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2223
2246
|
|
|
2224
2247
|
.glyph { display: grid; place-items: center; line-height: 1; }
|
|
2225
2248
|
.glyph svg { display: block; }
|
|
2226
|
-
`),
|
|
2249
|
+
`),rr=`square`,ir=18;E(`slicc-dock-item`,class extends HTMLElement{static observedAttributes=[`item-id`,`kind`,`hue`,`icon`,`tip`,`active`,`lit`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[nr]}disconnectedCallback(){this.#t?.destroy(),this.#t=null}connectedCallback(){this.#n()}attributeChangedCallback(){this.isConnected&&this.#n()}get itemId(){return this.getAttribute(`item-id`)}set itemId(e){e==null?this.removeAttribute(`item-id`):this.setAttribute(`item-id`,e)}get kind(){return this.getAttribute(`kind`)===`sprinkle`?`sprinkle`:`tool`}set kind(e){this.setAttribute(`kind`,e===`sprinkle`?`sprinkle`:`tool`)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get icon(){return this.getAttribute(`icon`)??rr}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get tip(){return this.getAttribute(`tip`)}set tip(e){e==null?this.removeAttribute(`tip`):this.setAttribute(`tip`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,!!e)}get lit(){return this.hasAttribute(`lit`)}set lit(e){this.toggleAttribute(`lit`,!!e)}#n(){let e=[`di`];this.kind===`sprinkle`&&e.push(`sp`),this.active&&e.push(`on`),this.lit&&e.push(`lit`);let t=this.tip,n=r(this.icon,{size:ir,part:`icon`}),i=t??this.itemId??`dock item`,a=O(`button`,{type:`button`,part:`button`,class:e.join(` `),"aria-label":i,"aria-pressed":this.active?`true`:`false`},O(`span`,{class:`glyph`,part:`glyph`},O(`slot`,null,n)),t?O(`span`,{class:`tip`,part:`tip`},t):null),o=this.hue;o&&a.style.setProperty(`--h`,o),this.#t?.destroy(),this.#t=tr(a,{onShortClick:this.#r,onLongPress:()=>this.#i(`longpress`)}),this.#e.replaceChildren(a)}#r=()=>{this.#i(this.active?`collapse`:`select`)};#i(e){this.dispatchEvent(new CustomEvent(e,{detail:{id:this.itemId},bubbles:!0,composed:!0}))}});var ar=[{id:`browser`,icon:`globe`,label:`Browser · CDP`,kind:`tool`},{id:`files`,icon:`folder`,label:`Files · VFS`,kind:`tool`},{id:`term`,icon:`square-terminal`,label:`Terminal`,kind:`tool`},{id:`memory`,icon:`brain`,label:`Memory`,kind:`tool`}],or={id:`new`,icon:`plus`,label:`New sprinkle`,kind:`sprinkle`},sr=`
|
|
2227
2250
|
.slicc-dock {
|
|
2228
2251
|
flex: 0 0 48px;
|
|
2229
2252
|
box-sizing: border-box;
|
|
@@ -2244,7 +2267,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2244
2267
|
margin: 2px 0;
|
|
2245
2268
|
}
|
|
2246
2269
|
.slicc-dock .grow { flex: 1; }
|
|
2247
|
-
`,
|
|
2270
|
+
`,cr=`slicc-dock-style`;function lr(e){if(e.getElementById(cr))return;let t=e.createElement(`style`);t.id=cr,t.textContent=sr,(e.head??e.documentElement).appendChild(t)}function ur(e){return e===`sprinkle`?`sprinkle`:`tool`}E(`slicc-dock`,class extends HTMLElement{static get observedAttributes(){return[`active`,`system-tools`]}#e=[];#t=null;#n=null;#r=null;#i=!1;connectedCallback(){lr(this.ownerDocument),this.classList.add(`slicc-dock`),this.setAttribute(`part`,`rail`),this.setAttribute(`role`,`toolbar`),this.setAttribute(`aria-orientation`,`vertical`),this.#i||=(this.#a(),!0),this.#t||(this.#t=e=>this.#u(e),this.#n=e=>this.#d(e),this.#r=e=>this.#f(e),this.addEventListener(`select`,this.#t),this.addEventListener(`collapse`,this.#n),this.addEventListener(`longpress`,this.#r)),this.#c()}disconnectedCallback(){this.#t&&=(this.removeEventListener(`select`,this.#t),null),this.#n&&=(this.removeEventListener(`collapse`,this.#n),null),this.#r&&=(this.removeEventListener(`longpress`,this.#r),null)}attributeChangedCallback(e){this.#i&&(e===`active`?this.#l():e===`system-tools`&&this.#c())}get items(){return this.#e.map(e=>({...e}))}set items(e){this.#e=Array.isArray(e)?e.map(e=>({...e})):[],this.#i&&this.isConnected&&this.#c()}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get systemTools(){return this.hasAttribute(`system-tools`)}set systemTools(e){this.toggleAttribute(`system-tools`,!!e)}selectItem(e){this.active=e,this.dispatchEvent(new CustomEvent(`slicc-dock-select`,{detail:{id:e,kind:this.#o(e)},bubbles:!0,composed:!0}))}clearActive(){this.active=null}collapse(){let e=this.active;this.active=null,e!=null&&this.dispatchEvent(new CustomEvent(`slicc-dock-collapse`,{detail:{id:e},bubbles:!0,composed:!0}))}#a(){let e=[...this.querySelectorAll(`slicc-dock-item`)];if(e.length===0)return;let t=[];for(let n of e){let e=ur(n.getAttribute(`kind`)),r=n.getAttribute(`item-id`)??n.dataset.t??n.getAttribute(`tip`)??``;e===`tool`||r===`new`||r===``||t.push({id:r,icon:n.getAttribute(`icon`)??void 0,label:n.getAttribute(`tip`)??void 0,kind:`sprinkle`,hue:n.getAttribute(`hue`)??void 0})}for(let t of e)t.remove();this.#e.length===0&&(this.#e=t)}#o(e){return ar.some(t=>t.id===e)?`tool`:e===or.id?`sprinkle`:this.#e.find(t=>t.id===e)?.kind??`tool`}#s(e,t){let n=e.id,r=ur(e.kind),i=e.icon??``,a=e.label??n,o=t!=null&&t===n,s=e.hue;return O(`slicc-dock-item`,{"data-t":n,"item-id":n,kind:r,icon:i||!1,tip:a,hue:s||!1,active:o})}#c(){let e=this.active,t=[];for(let n of this.#e)ur(n.kind)===`sprinkle`&&t.push(this.#s(n,e));if(t.push(this.#s(or,e)),t.push(O(`div`,{class:`grow`})),this.systemTools){t.push(O(`div`,{class:`div`}));for(let n of ar)t.push(this.#s(n,e))}this.replaceChildren(),D(this,t)}#l(){let e=this.active;for(let t of this.querySelectorAll(`slicc-dock-item`))t.toggleAttribute(`active`,t.dataset.t===e)}#u(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.selectItem(t))}#d(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&(this.active=t),this.collapse())}#f(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&this.selectItem(t),this.dispatchEvent(new CustomEvent(`slicc-dock-longpress`,{detail:{id:t,kind:this.#o(t)},bubbles:!0,composed:!0})))}#p(e){let t=e.detail;if(t&&typeof t.id==`string`)return t.id;let n=e.target?.closest(`slicc-dock-item`);return n&&this.contains(n)?n.dataset.t??null:null}});var dr=k(`
|
|
2248
2271
|
:host { display: none; }
|
|
2249
2272
|
:host([open]) { display: block; }
|
|
2250
2273
|
.overlay {
|
|
@@ -2321,7 +2344,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2321
2344
|
color: rgba(255,255,255,.7); font-family: var(--ui); font-size: 14px;
|
|
2322
2345
|
}
|
|
2323
2346
|
@media (prefers-reduced-motion: reduce) { .overlay, .card { transition: none; } }
|
|
2324
|
-
`),
|
|
2347
|
+
`),fr=`Open tabs`;E(`slicc-tab-overlay`,class extends HTMLElement{static observedAttributes=[`open`,`heading`];#e;#t=[];#n=null;#r=null;#i=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#u(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[dr]}connectedCallback(){this.#s(),this.#c()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#i,!0)}attributeChangedCallback(e){this.isConnected&&(e===`open`?this.#c():this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get heading(){return this.getAttribute(`heading`)??fr}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tabs(){return this.#t.map(e=>({...e}))}set tabs(e){this.#t=Array.isArray(e)?e.map(e=>({...e})):[],this.isConnected&&this.#s()}show(){this.open||=!0}hide(){this.open&&this.#u(`api`)}#a(){let e=O(`button`,{class:`close`,part:`close`,type:`button`,"aria-label":`Close tabs overlay`},r(`x`,{size:18}));return e.addEventListener(`click`,()=>this.#u(`close-button`)),e}#o(e){let t=e.title??e.id,n=e.screenshot?O(`img`,{class:`shot`,part:`shot`,src:e.screenshot,alt:t,loading:`lazy`}):O(`div`,{class:`shot ph`,part:`shot`},r(`globe`,{size:28})),i=O(`button`,{class:`x`,part:`card-close`,type:`button`,"aria-label":`Close ${t}`},r(`x`,{size:14}));i.addEventListener(`click`,t=>{t.stopPropagation(),this.#l(`tab-close`,e.id)});let a=O(`div`,{class:`label`},O(`span`,{class:`name`,part:`title`},t),e.url?O(`span`,{class:`url`},e.url):null),o=O(`div`,{class:e.active?`card on`:`card`,part:`card`,role:`button`,tabindex:`0`,"data-tab-id":e.id,"aria-label":t,"aria-current":e.active?`true`:!1},n,O(`div`,{class:`meta`},a,i));return o.addEventListener(`click`,()=>this.#l(`tab-activate`,e.id)),o.addEventListener(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),this.#l(`tab-activate`,e.id))}),o}#s(){let e=O(`div`,{class:`bar`,part:`bar`},O(`span`,{class:`title`},this.heading),O(`span`,{class:`count`},String(this.#t.length)),O(`span`,{class:`grow`}),this.#a()),t;if(this.#t.length===0)t=O(`div`,{class:`empty`},`No open tabs.`);else{t=O(`div`,{class:`grid`,part:`grid`,role:`list`});for(let e of this.#t)t.appendChild(this.#o(e))}this.#n=O(`div`,{class:`overlay`,part:`overlay`},e,t),this.#n.addEventListener(`mousedown`,e=>{e.target===this.#n&&this.#u(`backdrop`)}),this.#e.replaceChildren(this.#n)}#c(){this.open?(this.#r=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#i,!0),requestAnimationFrame(()=>this.#n?.querySelector(`.close`)?.focus())):(document.removeEventListener(`keydown`,this.#i,!0),this.#r?.focus?.(),this.#r=null)}#l(e,t){this.dispatchEvent(new CustomEvent(e,{detail:{id:t},bubbles:!0,composed:!0}))}#u(e){this.open=!1,this.dispatchEvent(new CustomEvent(`overlay-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}});var pr=`#3b6cb2`,mr=`
|
|
2325
2348
|
.slicc-freezer {
|
|
2326
2349
|
position: fixed;
|
|
2327
2350
|
left: 0;
|
|
@@ -2405,12 +2428,12 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2405
2428
|
|
|
2406
2429
|
/* ice-blue accent while a freezer context is active (prototype _ctxAccent) —
|
|
2407
2430
|
tints the toggle + the new-chat icon; cards keep their snow palette. */
|
|
2408
|
-
.slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${
|
|
2431
|
+
.slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${pr}); border-color: color-mix(in srgb, var(--fz-ctx, ${pr}) 40%, var(--line)); }
|
|
2409
2432
|
.slicc-freezer[ctx] ::part(new-icon),
|
|
2410
2433
|
.slicc-freezer[ctx] slicc-freezer-new::part(new-icon) {
|
|
2411
|
-
background: color-mix(in srgb, var(--fz-ctx, ${
|
|
2412
|
-
border-color: color-mix(in srgb, var(--fz-ctx, ${
|
|
2413
|
-
color: var(--fz-ctx, ${
|
|
2434
|
+
background: color-mix(in srgb, var(--fz-ctx, ${pr}) 14%, var(--canvas));
|
|
2435
|
+
border-color: color-mix(in srgb, var(--fz-ctx, ${pr}) 40%, var(--line));
|
|
2436
|
+
color: var(--fz-ctx, ${pr});
|
|
2414
2437
|
}
|
|
2415
2438
|
|
|
2416
2439
|
/* match-hidden: search filtered a session row out (only meaningful when open,
|
|
@@ -2418,7 +2441,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2418
2441
|
prototype .fzcard row. */
|
|
2419
2442
|
.slicc-freezer[open] slicc-freezer-card.match-hidden,
|
|
2420
2443
|
.slicc-freezer[open] .fzcard.match-hidden { display: none; }
|
|
2421
|
-
`,
|
|
2444
|
+
`,hr=`slicc-freezer-style`;function gr(e){if(e.getElementById(hr))return;let t=e.createElement(`style`);t.id=hr,t.textContent=mr,(e.head??e.documentElement).appendChild(t)}var _r=`http://www.w3.org/2000/svg`;function vr(){let e=document.createElementNS(_r,`svg`);for(let[t,n]of[[`width`,`14`],[`height`,`14`],[`viewBox`,`0 0 16 16`],[`fill`,`none`],[`stroke`,`currentColor`],[`stroke-width`,`1.6`],[`stroke-linecap`,`round`],[`stroke-linejoin`,`round`],[`aria-hidden`,`true`]])e.setAttribute(t,n);let t=document.createElementNS(_r,`rect`);for(let[e,n]of[[`x`,`2.5`],[`y`,`3.5`],[`width`,`11`],[`height`,`9`],[`rx`,`1.5`]])t.setAttribute(e,n);let n=document.createElementNS(_r,`line`);for(let[e,t]of[[`x1`,`6`],[`y1`,`3.5`],[`x2`,`6`],[`y2`,`12.5`]])n.setAttribute(e,t);let r=document.createElementNS(_r,`polyline`);return r.setAttribute(`points`,`9,6.5 10.5,8 9,9.5`),e.append(t,n,r),e}E(`slicc-freezer`,class extends HTMLElement{static observedAttributes=[`open`,`ctx`,`search-placeholder`];#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){gr(this.ownerDocument),this.classList.add(`slicc-freezer`),this.setAttribute(`part`,`freezer`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Past sessions (freezer)`),this.#s(),this.#l(),this.#u()}disconnectedCallback(){this.#a&&this.#t&&(this.#t.removeEventListener(`click`,this.#a),this.#a=null),this.#o&&this.#n&&(this.#n.removeEventListener(`input`,this.#o),this.#o=null)}attributeChangedCallback(e,t,n){this.#i&&(e===`open`?(this.#l(),this.#u()):e===`search-placeholder`&&(this.#n.placeholder=n??`search past sessions`))}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get ctx(){return this.hasAttribute(`ctx`)}set ctx(e){this.toggleAttribute(`ctx`,e)}get searchPlaceholder(){return this.getAttribute(`search-placeholder`)??`search past sessions`}set searchPlaceholder(e){e==null?this.removeAttribute(`search-placeholder`):this.setAttribute(`search-placeholder`,e)}get query(){return this.#i?this.#n.value:``}set query(e){this.#s(),this.#n.value=e,this.#d()}get rail(){return this.#s(),this.#r}toggle(e){let t=e??!this.open;t===this.open&&this.#l(),this.open=t,this.#l(),this.#u(),this.dispatchEvent(new CustomEvent(`freezer-toggle`,{detail:{open:t},bubbles:!0,composed:!0}))}append(...e){this.#s(),this.#r.append(...e),this.#u()}#s(){if(this.#i)return;let e=this.querySelector(`:scope > .fzh`),t=this.querySelector(`:scope > .fzrail`);if(e instanceof HTMLElement&&t instanceof HTMLElement){this.#c(e,t);return}let n=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&(e.classList.contains(`fzh`)||e.classList.contains(`fzrail`)))),r=this.ownerDocument,i=r.createElement(`div`);i.className=`fzh`,i.setAttribute(`part`,`header`);let a=r.createElement(`button`);a.className=`fztgl`,a.type=`button`,a.setAttribute(`part`,`toggle`),a.setAttribute(`aria-label`,`Toggle freezer`),a.append(vr());let o=r.createElement(`input`);o.className=`fzsearch`,o.type=`text`,o.setAttribute(`part`,`search`),o.placeholder=this.searchPlaceholder,o.setAttribute(`aria-label`,`Search past sessions`),i.append(a,o);let s=r.createElement(`div`);s.className=`fzrail`,s.setAttribute(`part`,`rail`);for(let e of n)s.appendChild(e);this.replaceChildren(i,s),this.#c(i,s)}#c(e,t){this.#i=!0,this.#e=e,this.#r=t;let n=e.querySelector(`.fztgl`),r=e.querySelector(`.fzsearch`);n&&(this.#t=n),r&&(this.#n=r),this.#t&&!this.#a&&(this.#a=()=>this.toggle(),this.#t.addEventListener(`click`,this.#a)),this.#n&&!this.#o&&(this.#o=()=>this.#d(),this.#n.addEventListener(`input`,this.#o))}#l(){if(!this.#t)return;let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),this.#t.title=e?`Collapse freezer`:`Expand freezer`}#u(){if(!this.#i)return;let e=this.open,t=this.#r.querySelectorAll(`slicc-freezer-card, slicc-freezer-new`);for(let n of t)n.toggleAttribute(`expanded`,e)}#d(){let e=this.#n.value.trim().toLowerCase(),t=this.#r.querySelectorAll(`slicc-freezer-card, .fzcard`);for(let n of t){let t=(n.textContent??``).toLowerCase();n.classList.toggle(`match-hidden`,e.length>0&&!t.includes(e))}}});var yr=14,br=k(`
|
|
2422
2445
|
:host {
|
|
2423
2446
|
display: inline-grid;
|
|
2424
2447
|
place-items: center;
|
|
@@ -2454,7 +2477,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2454
2477
|
nothing is slotted */
|
|
2455
2478
|
::slotted(*), .ic { line-height: 1; }
|
|
2456
2479
|
.ic { display: block; }
|
|
2457
|
-
`);E(`slicc-snowflake`,class extends HTMLElement{static observedAttributes=[`thawed`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
2480
|
+
`);E(`slicc-snowflake`,class extends HTMLElement{static observedAttributes=[`thawed`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[br];let e=O(`span`,{class:`snow`,part:`badge`},O(`slot`,null,r(`snowflake`,{size:yr,part:`glyph`,class:`ic`})));this.#e.replaceChildren(e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}});var xr=`
|
|
2458
2481
|
slicc-freezer-card {
|
|
2459
2482
|
position: relative;
|
|
2460
2483
|
display: flex;
|
|
@@ -2547,7 +2570,7 @@ slicc-freezer-card .slicc-fzcard__meta {
|
|
|
2547
2570
|
slicc-freezer-card[thawed] {
|
|
2548
2571
|
background: color-mix(in srgb, var(--rose) 12%, transparent);
|
|
2549
2572
|
}
|
|
2550
|
-
`,
|
|
2573
|
+
`,Sr=`slicc-freezer-card-style`;function Cr(e){if(e.getElementById(Sr))return;let t=e.createElement(`style`);t.id=Sr,t.textContent=xr,(e.head??e.documentElement).appendChild(t)}var wr=1400,Tr=14;E(`slicc-freezer-card`,class extends HTMLElement{static observedAttributes=[`title`,`meta`,`slug`,`icon`,`thawed`];#e;#t;#n;#r;#i=null;#a=null;#o=!1;#s=null;#c=()=>this.#u();#l=()=>{if(!this.#i)return;let e=this.getBoundingClientRect();this.#i.style.setProperty(`--tip-x`,`${e.right+8}px`),this.#i.style.setProperty(`--tip-y`,`${e.top+e.height/2}px`)};connectedCallback(){Cr(this.ownerDocument),this.#d(),this.#f()}disconnectedCallback(){this.removeEventListener(`click`,this.#c),this.removeEventListener(`pointerenter`,this.#l),this.removeEventListener(`focusin`,this.#l),this.#s!=null&&(clearTimeout(this.#s),this.#s=null)}attributeChangedCallback(e,t,n){t===n||!this.#o||(e===`thawed`?this.#e.toggleAttribute(`thawed`,n!==null):e===`icon`?this.#p():this.#f())}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get meta(){return this.getAttribute(`meta`)??``}set meta(e){e==null?this.removeAttribute(`meta`):this.setAttribute(`meta`,e)}get slug(){return this.getAttribute(`slug`)??``}set slug(e){e==null?this.removeAttribute(`slug`):this.setAttribute(`slug`,e)}get icon(){return this.getAttribute(`icon`)}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){this.toggleAttribute(`hidden`,e)}get badge(){return this.#d(),this.#e}#u(){this.dispatchEvent(new CustomEvent(`freezer-card-select`,{bubbles:!0,composed:!0,detail:{slug:this.slug}})),this.flashThaw()}flashThaw(e=wr){this.#s!=null&&clearTimeout(this.#s),this.thawed=!0,this.#s=setTimeout(()=>{this.thawed=!1,this.#s=null},e)}#d(){if(this.#o)return;this.#o=!0;let e=this.querySelector(`:scope > .slicc-fzcard__text`);if(e instanceof HTMLElement){this.#t=e,this.#n=e.querySelector(`.slicc-fzcard__title`),this.#r=e.querySelector(`.slicc-fzcard__meta`),this.#e=this.querySelector(`:scope > slicc-snowflake`),this.#i=this.querySelector(`:scope > .slicc-fzcard__tip`),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l);return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`slicc-snowflake`),this.#e.setAttribute(`part`,`badge`),this.#n=O(`div`,{class:`slicc-fzcard__title`,part:`title`}),this.#r=O(`div`,{class:`slicc-fzcard__meta`,part:`meta`}),this.#t=O(`div`,{class:`slicc-fzcard__text`,part:`text`},this.#n,this.#r);for(let e of t)this.#n.appendChild(e);this.#i=O(`span`,{class:`slicc-fzcard__tip`,part:`tip`,"aria-hidden":`true`}),this.replaceChildren(this.#e,this.#t,this.#i),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l)}#f(){if(!this.#o)return;let e=this.getAttribute(`title`);e!=null&&(this.#n.textContent=e),this.#r.textContent=this.meta,this.#i&&(this.#i.textContent=e??(this.#n.textContent||``)),this.#e.toggleAttribute(`thawed`,this.thawed),this.#p()}#p(){if(!this.#o)return;let e=this.getAttribute(`icon`);if(e){let t=r(e,{size:Tr,class:`ic`,part:`icon`});this.#a?this.#a.replaceWith(t):this.#e.appendChild(t),this.#a=t}else this.#a&&=(this.#a.remove(),null)}});var Er=`square-pen`,Dr=`loader-circle`,Or=16,kr=`New chat`,Ar=350,jr=[[`save`,`archive`,`Save & start new`],[`skip`,`fast-forward`,`New chat — skip memory`],[`erase`,`trash-2`,`Erase & start new`]],Mr=k(`
|
|
2551
2574
|
:host { display: block; }
|
|
2552
2575
|
:host([hidden]) { display: none; }
|
|
2553
2576
|
*{ box-sizing: border-box; }
|
|
@@ -2692,19 +2715,19 @@ slicc-freezer-card[thawed] {
|
|
|
2692
2715
|
.fznew, .nlbl { transition: none; }
|
|
2693
2716
|
.fznew-spinner svg { animation: none; }
|
|
2694
2717
|
}
|
|
2695
|
-
`);E(`slicc-freezer-new`,class extends HTMLElement{static observedAttributes=[`expanded`,`label`,`busy`,`progress`];#e;#t=null;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
2718
|
+
`);E(`slicc-freezer-new`,class extends HTMLElement{static observedAttributes=[`expanded`,`label`,`busy`,`progress`];#e;#t=null;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Mr]}connectedCallback(){this.#a()}disconnectedCallback(){this.#n?.destroy(),this.#n=null,this.#c()}attributeChangedCallback(e){e===`progress`&&this.#i()||this.isConnected&&this.#a()}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get label(){return this.getAttribute(`label`)??kr}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,e)}get progress(){let e=this.getAttribute(`progress`);if(e==null)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1,Math.max(0,t)):null}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(Math.min(1,Math.max(0,e))))}#i(){let e=this.#e.querySelector(`.fznew-ring`);return!e||!this.busy||!this.hasAttribute(`progress`)?!1:(e.style.setProperty(`--fznew-progress`,String(this.progress??0)),!0)}#a(){let e=this.label,t=this.busy,n=t&&this.hasAttribute(`progress`),i=O(`span`,{class:`nico`,part:`badge`},t?O(`span`,{class:`fznew-spinner`,part:`spinner`},n?O(`span`,{class:`fznew-ring`,part:`ring`,style:`--fznew-progress:${this.progress??0}`}):null,r(Dr,{size:Or,part:`icon`})):O(`slot`,{name:`icon`},r(Er,{size:Or,part:`icon`}))),a=O(`span`,{class:`nlbl`,part:`label`},O(`slot`,null,e)),o=O(`button`,{class:`fznew`,part:`button`,type:`button`,"aria-label":e,title:e,"aria-busy":t?`true`:void 0},i,a);this.#t=o,this.#s(o),this.#e.replaceChildren(o,this.#o())}#o(){let e=O(`div`,{class:`fznew-options`,part:`options`});for(let[t,n,i]of jr){let a=O(`button`,{class:`fznew-opt fznew-opt--${t}`,part:`option-${t}`,type:`button`},r(n,{size:13}),O(`span`,{class:`fznew-opt__text`},i));a.addEventListener(`click`,()=>this.#l(t)),e.appendChild(a)}return e}#s(e){this.#n?.destroy(),this.#c(),this.#n=tr(e,{onLongPress:()=>{if(this.#r!==null){this.#c(),this.#l(`skip`);return}this.#l(`erase`)},onShortClick:()=>{if(this.#r!==null){this.#c(),this.#l(`skip`);return}this.#r=setTimeout(()=>{this.#r=null,this.#l(`save`)},Ar)}})}#c(){this.#r!==null&&(clearTimeout(this.#r),this.#r=null)}#l(e){e===`save`&&(this.busy=!0),this.dispatchEvent(new CustomEvent(`new-chat-${e}`,{bubbles:!0,composed:!0}))}});var Nr=`attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos,0.0,1.0); }`,Pr=`precision highp float;
|
|
2696
2719
|
uniform vec2 u_res; uniform float u_time; uniform float u_energy;
|
|
2697
2720
|
uniform vec2 u_center; uniform vec3 u_evt; uniform float u_freeze; uniform float u_dark;
|
|
2698
2721
|
uniform float u_density; uniform float u_falloff; uniform float u_life;
|
|
2699
2722
|
uniform float u_blink; uniform float u_thick; uniform vec3 u_tint; uniform float u_scroll;
|
|
2700
2723
|
uniform float u_brightness; uniform float u_contrast; uniform float u_noise; uniform float u_blur;
|
|
2701
|
-
vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,
|
|
2724
|
+
vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,Fr=`
|
|
2702
2725
|
float hash21(vec2 p){ p=fract(p*vec2(123.34,456.21)); p+=dot(p,p+45.32); return fract(p.x*p.y); }
|
|
2703
2726
|
float vnoise(vec2 p){ vec2 i=floor(p),f=fract(p);
|
|
2704
2727
|
float a=hash21(i),b=hash21(i+vec2(1.,0.)),c=hash21(i+vec2(0.,1.)),d=hash21(i+vec2(1.,1.));
|
|
2705
2728
|
vec2 u=f*f*(3.-2.*f); return mix(mix(a,b,u.x),mix(c,d,u.x),u.y); }
|
|
2706
2729
|
float fbm(vec2 p){ float v=0.,a=0.5; for(int i=0;i<5;i++){ v+=a*vnoise(p); p=p*2.02+vec2(7.1,3.7); a*=0.5;} return v; }
|
|
2707
|
-
vec2 warp(vec2 p, float t){ float a=fbm(p+vec2(0.0,1.7)+t*0.10); float b=fbm(p+vec2(5.2,1.3)-t*0.08); return p+0.85*vec2(a,b); }`,
|
|
2730
|
+
vec2 warp(vec2 p, float t){ float a=fbm(p+vec2(0.0,1.7)+t*0.10); float b=fbm(p+vec2(5.2,1.3)-t*0.08); return p+0.85*vec2(a,b); }`,Ir={cone:`${Pr}${Fr}
|
|
2708
2731
|
float cellCycle(vec2 q){ float s=hash21(q+11.7);
|
|
2709
2732
|
return 0.5+0.32*sin(u_time*u_blink+s*6.2831)+0.18*sin(u_time*0.6*u_blink+s*19.0); }
|
|
2710
2733
|
void main(){
|
|
@@ -2752,7 +2775,7 @@ void main(){
|
|
|
2752
2775
|
col*=u_brightness;
|
|
2753
2776
|
col=clamp(col,0.0,1.0);
|
|
2754
2777
|
gl_FragColor=vec4(col,1.0);
|
|
2755
|
-
}`,scoop:`${
|
|
2778
|
+
}`,scoop:`${Pr}${Fr}
|
|
2756
2779
|
vec3 pal(float t){ vec3 strawberry=vec3(1.0,0.45,0.62); vec3 vanilla=vec3(1.0,0.95,0.82);
|
|
2757
2780
|
vec3 pistachio=vec3(0.60,0.86,0.52);
|
|
2758
2781
|
vec3 col=mix(strawberry,vanilla,smoothstep(0.0,0.5,t)); col=mix(col,pistachio,smoothstep(0.5,1.0,t)); return col; }
|
|
@@ -2771,7 +2794,7 @@ void main(){
|
|
|
2771
2794
|
ice*=0.95+0.08*sin(u_time*0.4); float mask=smoothstep(0.62,0.0,r);
|
|
2772
2795
|
vec3 col=mix(bg,ice,clamp(mask,0.0,1.0)*0.80); col+=ice*mask*hl*0.12;
|
|
2773
2796
|
gl_FragColor=vec4(col,1.0);
|
|
2774
|
-
}`,freezer:`${
|
|
2797
|
+
}`,freezer:`${Pr}${Fr}
|
|
2775
2798
|
/* Inside-of-a-freezer ground: icy WHITE in light mode (never the warm theme
|
|
2776
2799
|
canvas — blue-on-beige read as sand, not frost), cold blue-black in dark. */
|
|
2777
2800
|
vec3 freezerBg(){ return mix(vec3(0.965,0.98,1.0), vec3(0.05,0.08,0.13), u_dark); }
|
|
@@ -2798,12 +2821,12 @@ void main(){
|
|
|
2798
2821
|
deviation budget the cone lattice uses (strokes at 0.20 toward tint). */
|
|
2799
2822
|
col=mix(freezerBg(),col,0.22);
|
|
2800
2823
|
gl_FragColor=vec4(col,1.0);
|
|
2801
|
-
}`},
|
|
2824
|
+
}`},Lr=new Set([`cone`,`scoop`,`freezer`]),Rr={cone:`radial-gradient(120% 120% at 35% 45%, color-mix(in srgb,#e0a866 40%,var(--bg)) 0%, var(--bg) 60%)`,scoop:`radial-gradient(120% 120% at 40% 50%, color-mix(in srgb,#ff9bc0 40%,var(--bg)) 0%, var(--bg) 62%)`,freezer:`radial-gradient(120% 120% at 0% 100%, color-mix(in srgb,#7fb0e6 55%,var(--bg)) 0%, var(--bg) 70%)`},zr=k(`
|
|
2802
2825
|
:host { position: relative; display: block; pointer-events: none; }
|
|
2803
2826
|
.canvas, .fallback { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
|
|
2804
2827
|
.fallback { display: none; }
|
|
2805
2828
|
:host([no-webgl]) .canvas { display: none; }
|
|
2806
|
-
:host([no-webgl]) .fallback { display: block; }`),
|
|
2829
|
+
:host([no-webgl]) .fallback { display: block; }`),Br=2,Vr=.35,Hr=[`u_res`,`u_scroll`,`u_time`,`u_energy`,`u_center`,`u_evt`,`u_freeze`,`u_dark`,`u_density`,`u_falloff`,`u_life`,`u_blink`,`u_thick`,`u_tint`,`u_brightness`,`u_contrast`,`u_noise`,`u_blur`];function Ur(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function Wr(e,t){if(!e||typeof getComputedStyle!=`function`)return t;let n=document.createElement(`span`);n.style.color=e,n.style.display=`none`,document.body.appendChild(n);let r=getComputedStyle(n).color;n.remove();let i=r.match(/[\d.]+/g)?.map(Number);return!i||i.length<3?t:[i[0]/255,i[1]/255,i[2]/255]}var Gr=class extends HTMLElement{static observedAttributes=[`mode`,`tint`,`coverage`,`intensity`,`scroll`,`brightness`,`contrast`,`noise`,`blur`];#e;#t=null;#n=null;#r=null;#i={};#a=null;#o={};#s=-1;#c=0;#l=0;#u=0;#d=null;#f=!1;#p=[.545,.361,.965];#m=[.957,.247,.369];#h=0;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[zr];let e=O(`canvas`,{class:`canvas`,part:`canvas`}),t=O(`div`,{class:`fallback`,part:`fallback`,"aria-hidden":`true`});this.#e.replaceChildren(e,t),this.#t=e}connectedCallback(){if(this.#f=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.#S(),!this.#k()){this.setAttribute(`no-webgl`,``);return}this.removeAttribute(`no-webgl`),typeof ResizeObserver<`u`&&(this.#d=new ResizeObserver(()=>this.#C()),this.#d.observe(this)),this.#w(),this.#T(),this.#l=performance.now()/1e3,this.#f?this.#F():this.#I()}disconnectedCallback(){this.#L(),this.#d?.disconnect(),this.#d=null,this.#g?.disconnect(),this.#g=null,this.#_&&this.#v&&this.#_.removeEventListener(`change`,this.#v),this.#_=null,this.#v=null,this.#R()}attributeChangedCallback(e){if(this.isConnected){if(e===`tint`&&this.#w(),e===`mode`&&this.#n&&this.mode!==this.#y&&this.#O()){this.#F(),this.#S();return}this.#S(),this.#C()}}get mode(){let e=this.getAttribute(`mode`);return e&&Lr.has(e)?e:`cone`}set mode(e){this.setAttribute(`mode`,e)}get coverage(){return Ur(Number.parseFloat(this.getAttribute(`coverage`)??``),0,1,.66)}set coverage(e){this.setAttribute(`coverage`,String(e))}get intensity(){return Ur(Number.parseFloat(this.getAttribute(`intensity`)??``),0,4,1)}set intensity(e){this.setAttribute(`intensity`,String(e))}get scrollOffset(){let e=Number.parseFloat(this.getAttribute(`scroll`)??``);return Number.isFinite(e)?e:0}set scrollOffset(e){this.setAttribute(`scroll`,String(e))}get brightness(){return Ur(Number.parseFloat(this.getAttribute(`brightness`)??``),.5,1.5,1.2)}set brightness(e){this.setAttribute(`brightness`,String(e))}get contrast(){return Ur(Number.parseFloat(this.getAttribute(`contrast`)??``),.5,2,.75)}set contrast(e){this.setAttribute(`contrast`,String(e))}get noise(){return Ur(Number.parseFloat(this.getAttribute(`noise`)??``),0,.3,.04)}set noise(e){this.setAttribute(`noise`,String(e))}get blurAmount(){return Ur(Number.parseFloat(this.getAttribute(`blur`)??``),0,1,.09)}set blurAmount(e){this.setAttribute(`blur`,String(e))}get noWebgl(){return this.hasAttribute(`no-webgl`)}pulse(e=1){this.#u=Math.min(1.4,this.#u+e),this.#f&&this.#F()}#S(){let e=this.#e.querySelector(`.fallback`);e&&(e.style.background=Rr[this.mode])}#C(){this.#f&&this.#n&&this.#F()}#w(){let e=this.getAttribute(`tint`)??``;this.#p=Wr(e,[.545,.361,.965]),this.#m=Wr(e,[.957,.247,.369]),this.#h=this.#P()}#T(){let e=()=>{this.#w(),this.#C()};if(typeof MutationObserver<`u`){this.#g=new MutationObserver(e);for(let e of[document.documentElement,document.body])e&&this.#g.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme`]})}typeof matchMedia==`function`&&(this.#_=matchMedia(`(prefers-color-scheme: dark)`),this.#v=e,this.#_.addEventListener(`change`,this.#v))}#E(e,t,n){let r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(e.deleteShader(r),null)):null}#D(e){let t=this.#n;if(!t)return null;let n=this.#E(t,t.VERTEX_SHADER,Nr),r=this.#E(t,t.FRAGMENT_SHADER,Ir[e]);if(!n||!r)return n&&t.deleteShader(n),r&&t.deleteShader(r),null;let i=t.createProgram();if(!i)return t.deleteShader(n),t.deleteShader(r),null;if(t.attachShader(i,n),t.attachShader(i,r),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))return t.deleteProgram(i),t.deleteShader(n),t.deleteShader(r),null;let a=t.getAttribLocation(i,`a_pos`),o={};for(let e of Hr)o[e]=t.getUniformLocation(i,e);return{program:i,vs:n,fs:r,aPos:a,loc:o}}#O(){let e=this.#n;if(!e)return!1;let t=this.mode,n=this.#i[t];if(!n){let e=this.#D(t);if(!e)return!1;this.#i[t]=e,n=e}return this.#r=n.program,this.#s=n.aPos,this.#o=n.loc,e.useProgram(n.program),this.#y=t,!0}#k(){let e=this.#t;if(!e)return!1;let t={premultipliedAlpha:!0,alpha:!0,antialias:!0},n=null;try{n=e.getContext(`webgl`,t)??e.getContext(`experimental-webgl`,t)}catch{n=null}return n?(this.#n=n,this.#j(e),this.#A()):!1}#A(){let e=this.#n;if(!e)return!1;if(!this.#O())return this.#n=null,!1;let t=e.createBuffer();return t?(this.#a=t,e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),e.STATIC_DRAW),!0):(this.#n=null,!1)}#j(e){this.#M(e),this.#b=e=>{e.preventDefault(),this.#L(),this.#i={},this.#r=null,this.#y=null,this.#o={},this.#a=null},this.#x=()=>{!this.isConnected||!this.#n||(this.#i={},this.#A()&&(this.#l=performance.now()/1e3,this.#f?this.#F():this.#I()))},e.addEventListener(`webglcontextlost`,this.#b,!1),e.addEventListener(`webglcontextrestored`,this.#x,!1)}#M(e){this.#b&&e.removeEventListener(`webglcontextlost`,this.#b),this.#x&&e.removeEventListener(`webglcontextrestored`,this.#x),this.#b=null,this.#x=null}#N(){let e=this.#t;if(!e)return;let t=Math.min(Br,typeof window<`u`&&window.devicePixelRatio||1),n=Math.max(1,e.clientWidth*t|0),r=Math.max(1,e.clientHeight*t|0);(e.width!==n||e.height!==r)&&(e.width=n,e.height=r)}#P(){if(typeof getComputedStyle!=`function`)return 0;let e=getComputedStyle(this).getPropertyValue(`--ink`).trim();if(!e)return 0;let[t,n,r]=Wr(e,[0,0,0]);return+(.2126*t+.7152*n+.0722*r>.5)}#F(){let e=this.#n,t=this.#t,n=this.#r;if(!e||!t||!n||!this.#a)return;this.#N();let r=performance.now()/1e3-this.#l,i=.5+.5*Math.sin(r*.12),a=.5+.5*Math.sin(r*.097+1),o=.2*(1-i)+.46*i,s=.74*(1-a)+.3*a,c=this.#h,l=this.#p,u=this.#m;e.viewport(0,0,t.width,t.height),e.useProgram(n),e.bindBuffer(e.ARRAY_BUFFER,this.#a),e.enableVertexAttribArray(this.#s),e.vertexAttribPointer(this.#s,2,e.FLOAT,!1,0,0);let d=this.#o;e.uniform2f(d.u_res??null,t.width,t.height),e.uniform1f(d.u_time??null,r),e.uniform1f(d.u_energy??null,this.#u),e.uniform2f(d.u_center??null,o,s),e.uniform3f(d.u_evt??null,u[0],u[1],u[2]),e.uniform1f(d.u_freeze??null,Ur(this.coverage*this.intensity,0,1,.66)*2.2),e.uniform1f(d.u_dark??null,c),e.uniform1f(d.u_scroll??null,this.scrollOffset*Vr/Math.max(1,t.clientHeight||t.height)),e.uniform1f(d.u_density??null,.29),e.uniform1f(d.u_falloff??null,.3),e.uniform1f(d.u_life??null,.35),e.uniform1f(d.u_blink??null,.05),e.uniform1f(d.u_thick??null,.02),e.uniform3f(d.u_tint??null,l[0],l[1],l[2]),e.uniform1f(d.u_brightness??null,this.brightness),e.uniform1f(d.u_contrast??null,this.contrast),e.uniform1f(d.u_noise??null,this.noise),e.uniform1f(d.u_blur??null,this.blurAmount),e.drawArrays(e.TRIANGLES,0,3),this.#u*=.95,this.#u<.001&&(this.#u=0)}#I(){if(this.#c)return;let e=()=>{this.#F(),this.#c=requestAnimationFrame(e)};this.#c=requestAnimationFrame(e)}#L(){this.#c&&cancelAnimationFrame(this.#c),this.#c=0}#R(){let e=this.#n,t=this.#t;if(t&&this.#M(t),e){this.#a&&e.deleteBuffer(this.#a);for(let t of Object.values(this.#i))t&&(e.deleteProgram(t.program),e.deleteShader(t.vs),e.deleteShader(t.fs));e.getExtension(`WEBGL_lose_context`)?.loseContext()}this.#n=null,this.#r=null,this.#i={},this.#o={},this.#a=null,this.#y=null}};E(`slicc-shader`,Gr),E(`slicc-frost-shader`,class extends Gr{connectedCallback(){this.getAttribute(`mode`)!==`freezer`&&this.setAttribute(`mode`,`freezer`),super.connectedCallback()}});var Kr=new Set([`user`,`feedback`,`project`]),qr={user:{hue:`--rose`,label:`user`},feedback:{hue:`--cyan`,label:`feedback`},project:{hue:`--violet`,label:`project`}};function Jr(e){return e===`feedback`||e===`project`?e:`user`}var Yr=k(`
|
|
2807
2830
|
:host {
|
|
2808
2831
|
display: inline-flex;
|
|
2809
2832
|
vertical-align: middle;
|
|
@@ -2825,13 +2848,13 @@ void main(){
|
|
|
2825
2848
|
background: color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-fill), var(--canvas));
|
|
2826
2849
|
border: 1px solid color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-border), var(--line));
|
|
2827
2850
|
}
|
|
2828
|
-
`),
|
|
2851
|
+
`),Xr=`slicc-memtag-dark`,Zr=`
|
|
2829
2852
|
.dark slicc-memtag,
|
|
2830
2853
|
[data-theme="dark"] slicc-memtag {
|
|
2831
2854
|
--mtag-fill: 22%;
|
|
2832
2855
|
--mtag-border: 38%;
|
|
2833
2856
|
}
|
|
2834
|
-
`;function
|
|
2857
|
+
`;function Qr(e){if(e.getElementById(Xr))return;let t=e.createElement(`style`);t.id=Xr,t.textContent=Zr,(e.head??e.documentElement).appendChild(t)}E(`slicc-memtag`,class extends HTMLElement{static observedAttributes=[`type`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Yr]}connectedCallback(){Qr(this.ownerDocument),this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get type(){return Jr(this.getAttribute(`type`))}set type(e){this.setAttribute(`type`,Kr.has(e)?e:`user`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let{hue:e,label:t}=qr[this.type],n=this.label??O(`slot`,null,t),r=O(`span`,{class:`mtag`,part:`tag`,style:`--mtag-hue:var(${e})`},n);this.#e.replaceChildren(r)}});var $r=`
|
|
2835
2858
|
slicc-memrow {
|
|
2836
2859
|
display: block;
|
|
2837
2860
|
border: 1px solid var(--line);
|
|
@@ -2905,7 +2928,7 @@ slicc-memrow.fresh {
|
|
|
2905
2928
|
background: color-mix(in srgb, var(--violet) 22%, var(--canvas));
|
|
2906
2929
|
border-color: color-mix(in srgb, var(--violet) 38%, var(--line));
|
|
2907
2930
|
}
|
|
2908
|
-
`,
|
|
2931
|
+
`,ei=`slicc-memrow-style`;function ti(e){if(e.getElementById(ei))return;let t=e.createElement(`style`);t.id=ei,t.textContent=$r,(e.head??e.documentElement).appendChild(t)}function ni(e){return e===`feedback`||e===`project`?e:`user`}E(`slicc-memrow`,class extends HTMLElement{static get observedAttributes(){return[`title`,`summary`,`tag`,`fresh`]}#e=!1;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;connectedCallback(){ti(this.ownerDocument),this.#e||this.#s(),this.#c(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#e&&this.#c()}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get summary(){return this.getAttribute(`summary`)??``}set summary(e){e==null?this.removeAttribute(`summary`):this.setAttribute(`summary`,e)}get tag(){return ni(this.getAttribute(`tag`))}set tag(e){this.setAttribute(`tag`,e)}get fresh(){return this.hasAttribute(`fresh`)}set fresh(e){this.toggleAttribute(`fresh`,e)}#s(){this.#e=!0;let e=this.ownerDocument.createElement(`div`);e.className=`mt`;let t=this.ownerDocument.createElement(`b`),n=this.ownerDocument.createElement(`slicc-memtag`);e.append(t,n);let r=this.ownerDocument.createElement(`div`);for(r.className=`ms`;this.firstChild;)r.appendChild(this.firstChild);this.append(e,r),this.#t=e,this.#n=t,this.#r=n,this.#i=r}#c(){let e=this.#n,t=this.#r,n=this.#i;if(!e||!t||!n)return;e.textContent=this.title;let r=this.tag;t.className=``,t.setAttribute(`type`,r),t.textContent=``;let i=n.firstChild,a=this.summary;i&&i.nodeType===Node.TEXT_NODE?i.textContent=a:a&&n.insertBefore(this.ownerDocument.createTextNode(a),i),this.classList.toggle(`fresh`,this.fresh)}#l(){this.#a||(this.#a=e=>this.#d(e),this.addEventListener(`click`,this.#a)),this.#o||(this.#o=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.#d(e))},this.addEventListener(`keydown`,this.#o))}#u(){this.#a&&=(this.removeEventListener(`click`,this.#a),null),this.#o&&=(this.removeEventListener(`keydown`,this.#o),null)}#d(e){this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{title:this.title,summary:this.summary,tag:this.tag,sourceEvent:e}}))}});var ri=`
|
|
2909
2932
|
slicc-palette-grid {
|
|
2910
2933
|
display: block;
|
|
2911
2934
|
flex: 1;
|
|
@@ -2924,7 +2947,7 @@ slicc-palette-grid .palgrid {
|
|
|
2924
2947
|
grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
|
|
2925
2948
|
gap: 10px;
|
|
2926
2949
|
}
|
|
2927
|
-
`,
|
|
2950
|
+
`,ii=`slicc-palette-grid-style`;function ai(e){if(e.getElementById(ii))return;let t=e.createElement(`style`);t.id=ii,t.textContent=ri,(e.head??e.documentElement).appendChild(t)}var oi=[{label:`canvas #faf6f1`,color:`#faf6f1`},{label:`cone #ef7000`,color:`#ef7000`},{label:`scoop #8b5cf6`,color:`#8b5cf6`},{label:`scoop #06b6d4`,color:`#06b6d4`},{label:`scoop #f43f5e`,color:`#f43f5e`},{label:`ink #0a0a0a`,color:`#0a0a0a`}],si=`brand palette · tokens`;E(`slicc-palette-grid`,class extends HTMLElement{static get observedAttributes(){return[`heading`]}#e=!1;#t=null;#n=null;#r=[];#i=null;#a=null;connectedCallback(){ai(this.ownerDocument),this.#e||this.#o(),this.#s(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#e&&this.#s()}get heading(){return this.getAttribute(`heading`)??si}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tokens(){return(this.#i??oi).map(e=>({...e}))}set tokens(e){this.#i=Array.isArray(e)?e.map(e=>({label:String(e.label??``),color:String(e.color??``)})):null,this.#e&&this.#c()}#o(){for(this.#e=!0,this.#r=[];this.firstChild;)this.#r.push(this.firstChild),this.removeChild(this.firstChild);let e=this.ownerDocument.createElement(`h4`),t=this.ownerDocument.createElement(`div`);t.className=`palgrid`,this.append(e,t),this.#t=e,this.#n=t,this.#c()}#s(){this.#t&&(this.#t.textContent=this.heading)}#c(){let e=this.#n;if(e){e.replaceChildren();for(let t of this.#r)e.appendChild(t);for(let t of this.tokens){let n=this.ownerDocument.createElement(`slicc-palette-cell`);n.setAttribute(`color`,t.color),n.setAttribute(`label`,t.label),e.appendChild(n)}}}#l(){this.#a||(this.#a=e=>{let t=e.detail??{};this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{label:t.label??``,color:t.color??``,sourceEvent:e}}))},this.addEventListener(`palette-select`,this.#a))}#u(){this.#a&&=(this.removeEventListener(`palette-select`,this.#a),null)}});var ci=k(`
|
|
2928
2951
|
:host { display: inline-block; position: relative; font-family: var(--ui); }
|
|
2929
2952
|
.trigger {
|
|
2930
2953
|
display: inline-flex; align-items: center; justify-content: center;
|
|
@@ -2965,7 +2988,7 @@ slicc-palette-grid .palgrid {
|
|
|
2965
2988
|
.item .ic { flex: 0 0 auto; display: flex; color: var(--txt-2, #505050); }
|
|
2966
2989
|
.item.danger .ic { color: var(--rose, #f43f5e); }
|
|
2967
2990
|
@media (prefers-reduced-motion: reduce) { .pop { transition: none; } }
|
|
2968
|
-
`);E(`slicc-avatar-menu`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t;#n;#r=[];#i=null;#a=e=>{this.open&&!e.composedPath().includes(this)&&this.hide()};#o=e=>{e.key===`Escape`&&this.open&&(this.hide(),this.#t.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
2991
|
+
`);E(`slicc-avatar-menu`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t;#n;#r=[];#i=null;#a=e=>{this.open&&!e.composedPath().includes(this)&&this.hide()};#o=e=>{e.key===`Escape`&&this.open&&(this.hide(),this.#t.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ci],this.#t=O(`button`,{class:`trigger`,part:`trigger`,type:`button`,"aria-haspopup":`menu`,"aria-expanded":`false`},O(`slot`)),this.#n=O(`div`,{class:`pop`,part:`popover`,role:`menu`}),this.#e.replaceChildren(this.#t,this.#n),this.#t.addEventListener(`click`,()=>this.toggle())}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o)}attributeChangedCallback(e){if(e===`open`){let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),e?(document.addEventListener(`mousedown`,this.#a),document.addEventListener(`keydown`,this.#o)):(document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o))}}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get user(){return this.#i}set user(e){this.#i=e,this.#c()}get items(){return this.#r.map(e=>({...e}))}set items(e){this.#r=Array.isArray(e)?e.map(e=>({...e})):[],this.#c()}show(){this.open||(this.open=!0,this.#s())}hide(){this.open&&(this.open=!1,this.#s())}toggle(){this.open?this.hide():this.show()}#s(){this.dispatchEvent(new CustomEvent(`slicc-avatar-menu-toggle`,{detail:{open:this.open},bubbles:!0,composed:!0}))}#c(){let e=[];if(this.#i){let t=O(`div`,{class:`user`},O(`div`,{class:`name`},this.#i.name));this.#i.provider&&t.append(O(`div`,{class:`prov`},this.#i.provider)),e.push(t)}for(let t of this.#r)if(t.kind===`separator`)e.push(O(`div`,{class:`sep`,role:`separator`}));else if(t.kind===`caption`)e.push(O(`div`,{class:`cap`},t.label??``));else{let n=O(`button`,{class:`item${t.danger?` danger`:``}`,part:`item`,type:`button`,role:`menuitem`,"data-id":t.id??``,disabled:t.disabled?!0:void 0});t.icon&&n.append(O(`span`,{class:`ic`},r(t.icon,{size:16}))),n.append(O(`span`,{class:`lb`},t.label??``)),t.disabled||n.addEventListener(`click`,()=>this.#l(t.id??``)),e.push(n)}this.#n.replaceChildren(...e)}#l(e){this.dispatchEvent(new CustomEvent(`slicc-avatar-action`,{detail:{id:e},bubbles:!0,composed:!0})),this.hide()}});var li=`
|
|
2969
2992
|
.slicc-nav {
|
|
2970
2993
|
display: flex;
|
|
2971
2994
|
align-items: center;
|
|
@@ -2992,7 +3015,7 @@ slicc-palette-grid .palgrid {
|
|
|
2992
3015
|
@media (max-width: 560px) {
|
|
2993
3016
|
.slicc-nav { gap: 8px; padding: 0 10px; }
|
|
2994
3017
|
}
|
|
2995
|
-
`,
|
|
3018
|
+
`,ui=`slicc-nav-style`;function di(e){if(e.getElementById(ui))return;let t=e.createElement(`style`);t.id=ui,t.textContent=li,(e.head??e.documentElement).appendChild(t)}E(`slicc-nav`,class extends HTMLElement{static observedAttributes=[`accent`];#e=!1;connectedCallback(){di(this.ownerDocument),this.classList.add(`slicc-nav`),this.setAttribute(`part`,`bar`),this.#t(),this.#n(this.getAttribute(`accent`))}attributeChangedCallback(e,t,n){e!==`accent`||t===n||this.isConnected&&(this.#n(n),this.dispatchEvent(new CustomEvent(`slicc-nav-accent-change`,{detail:{accent:n},bubbles:!0,composed:!0})))}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get spacer(){return this.#t(),this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)}#t(){if(this.#e||(this.#e=!0,this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)))return;let e=this.ownerDocument.createElement(`div`);e.className=`slicc-nav__spacer`,e.setAttribute(`part`,`spacer`),e.setAttribute(`aria-hidden`,`true`);let t=this.querySelector(`:scope > slicc-floatbar, :scope > slicc-theme-toggle, :scope > slicc-avatar`);t?this.insertBefore(e,t):this.appendChild(e)}#n(e){e==null||e.trim()===``?this.style.removeProperty(`--ctx`):this.style.setProperty(`--ctx`,e)}});var fi=k(`
|
|
2996
3019
|
:host {
|
|
2997
3020
|
position: fixed;
|
|
2998
3021
|
z-index: 110;
|
|
@@ -3030,7 +3053,7 @@ slicc-palette-grid .palgrid {
|
|
|
3030
3053
|
.item.destructive {
|
|
3031
3054
|
color: var(--red, #e53e3e);
|
|
3032
3055
|
}
|
|
3033
|
-
`),
|
|
3056
|
+
`),pi=null,mi=null,hi=null,gi=class e extends HTMLElement{#e;#t=void 0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[fi]}connectedCallback(){this.#e.addEventListener(`click`,this.#n)}disconnectedCallback(){this.#e.removeEventListener(`click`,this.#n)}#n=t=>{let n=t.target.closest(`[data-action]`);if(!n)return;let r=n.dataset.action;this.dispatchEvent(new CustomEvent(`overflow-action`,{bubbles:!0,composed:!0,detail:{action:r,context:this.#t}})),e.hide()};static show(t){e.hide();let n=document.createElement(`slicc-overflow-menu`);n.#t=t.context;let i=t.items.filter(e=>e.visible!==!1),a=O(`div`,{class:`menu`});for(let e of i){let t=e.destructive?`item destructive`:`item`,n=[];e.icon&&n.push(r(e.icon,{size:14})),n.push(e.label);let i=O(`button`,{class:t,"data-action":e.id},...n);a.appendChild(i)}n.#e.appendChild(a),document.body.appendChild(n),pi=n;let o=t.anchor.getBoundingClientRect(),s=n.getBoundingClientRect(),c=o.bottom+4;c+s.height>window.innerHeight&&(c=o.top-s.height-4);let l=o.right-s.width;l<4&&(l=o.left),n.style.top=`${c}px`,n.style.left=`${l}px`,mi=t=>{t.key===`Escape`&&e.hide()},hi=r=>{let i=r.composedPath();!i.includes(n)&&!i.includes(t.anchor)&&e.hide()},document.addEventListener(`keydown`,mi),document.addEventListener(`pointerdown`,hi,{capture:!0})}static hide(){pi&&=(pi.remove(),null),mi&&=(document.removeEventListener(`keydown`,mi),null),hi&&=(document.removeEventListener(`pointerdown`,hi,{capture:!0}),null)}};E(`slicc-overflow-menu`,gi);var _i=k(`
|
|
3034
3057
|
:host { display: none; }
|
|
3035
3058
|
:host([open]) { display: block; }
|
|
3036
3059
|
.overlay {
|
|
@@ -3075,7 +3098,7 @@ slicc-palette-grid .palgrid {
|
|
|
3075
3098
|
@media (prefers-reduced-motion: reduce) {
|
|
3076
3099
|
.overlay, .dialog { transition: none; }
|
|
3077
3100
|
}
|
|
3078
|
-
`);E(`slicc-dialog`,class extends HTMLElement{static observedAttributes=[`open`,`heading`,`description`,`no-close-button`];#e;#t;#n;#r;#i;#a;#o=null;#s=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#c(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
3101
|
+
`);E(`slicc-dialog`,class extends HTMLElement{static observedAttributes=[`open`,`heading`,`description`,`no-close-button`];#e;#t;#n;#r;#i;#a;#o=null;#s=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#c(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[_i],this.#r=O(`div`,{class:`title`,part:`title`,id:`slicc-dialog-title`}),this.#i=O(`div`,{class:`desc`,part:`description`}),this.#a=O(`button`,{class:`x`,part:`close`,type:`button`,"aria-label":`Close`},r(`x`,{size:18}));let e=O(`div`,{class:`body`},O(`slot`)),t=O(`div`,{class:`footer`},O(`slot`,{name:`footer`}));this.#n=O(`div`,{class:`dialog`,part:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`slicc-dialog-title`,tabindex:`-1`},this.#a,this.#r,this.#i,e,t),this.#t=O(`div`,{class:`overlay`,part:`overlay`},this.#n),this.#e.replaceChildren(this.#t),this.#a.addEventListener(`click`,()=>this.#c(`close-button`)),this.#t.addEventListener(`mousedown`,e=>{e.target===this.#t&&!this.persistent&&this.#c(`backdrop`)})}connectedCallback(){this.#u()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#s,!0)}attributeChangedCallback(e){e===`open`?this.#u():this.#l()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get heading(){return this.getAttribute(`heading`)}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get description(){return this.getAttribute(`description`)}set description(e){e==null?this.removeAttribute(`description`):this.setAttribute(`description`,e)}get persistent(){return this.hasAttribute(`persistent`)}set persistent(e){this.toggleAttribute(`persistent`,e)}show(){this.open||=!0}hide(){this.open&&this.#c(`api`)}#c(e){this.open=!1,this.dispatchEvent(new CustomEvent(`slicc-dialog-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}#l(){this.#r.textContent=this.heading??``,this.#r.style.display=this.heading?``:`none`,this.#i.textContent=this.description??``,this.#i.style.display=this.description?``:`none`,this.#a.style.display=this.hasAttribute(`no-close-button`)?`none`:``}#u(){this.#l(),this.open?(this.#o=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#s,!0),requestAnimationFrame(()=>this.#n.focus())):(document.removeEventListener(`keydown`,this.#s,!0),this.#o?.focus?.(),this.#o=null)}});var vi=`
|
|
3079
3102
|
slicc-camera-dialog slicc-dialog::part(dialog) {
|
|
3080
3103
|
width: min(560px, 92vw);
|
|
3081
3104
|
}
|
|
@@ -3142,7 +3165,7 @@ slicc-camera-dialog .slicc-camera__btn--snap {
|
|
|
3142
3165
|
slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
3143
3166
|
background: color-mix(in srgb, var(--ink) 85%, var(--canvas));
|
|
3144
3167
|
}
|
|
3145
|
-
`,
|
|
3168
|
+
`,yi=`slicc-camera-dialog-style`;function bi(e){if(e.getElementById(yi))return;let t=e.createElement(`style`);t.id=yi,t.textContent=vi,(e.head??e.documentElement).appendChild(t)}var xi=`Take a photo`;E(`slicc-camera-dialog`,class extends HTMLElement{static observedAttributes=[`heading`,`preferred-device`];media=null;#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){bi(this.ownerDocument),this.#h()}disconnectedCallback(){this.#m()}attributeChangedCallback(e){e===`heading`&&this.#i&&this.#e.setAttribute(`heading`,this.heading)}get heading(){return this.getAttribute(`heading`)??xi}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}#s(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}async open(){this.#h();let e=this.#s();if(!e)return null;try{this.#a=await this.#c(e,this.preferredDevice)}catch{return null}return this.#l(this.#a),await this.#u(e),this.#e.setAttribute(`heading`,this.heading),this.#e.show?.(),new Promise(e=>{this.#o=e})}async#c(e,t){if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}}})}catch{}return e.getUserMedia({video:!0})}#l(e){this.#t.srcObject=e,this.#t.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#t.toggleAttribute(`data-mirrored`,t!==`environment`)}async#u(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}this.#n.replaceChildren(...t.map((e,t)=>O(`option`,{value:e.deviceId},e.label||`Camera ${t+1}`)));let n=this.#a?.getVideoTracks()[0]?.getSettings?.().deviceId;n&&(this.#n.value=n),this.#n.toggleAttribute(`hidden`,t.length<2)}async#d(e){let t=this.#s();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#m(),this.#a=n,this.#l(n),this.dispatchEvent(new CustomEvent(`slicc-camera-device-change`,{detail:{deviceId:e},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}#f(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#t.videoWidth,e.height=this.#t.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#t,0,0);let t=e.toDataURL(`image/png`);this.dispatchEvent(new CustomEvent(`slicc-camera-capture`,{detail:{dataUrl:t},bubbles:!0,composed:!0})),this.#p(t)}#p(e){this.#m();let t=this.#o;this.#o=null,this.#e.hide?.(),t?.(e)}#m(){for(let e of this.#a?.getTracks()??[])e.stop();this.#a=null,this.#t&&(this.#t.srcObject=null)}#h(){if(this.#i)return;this.#i=!0,this.#t=O(`video`,{class:`slicc-camera__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#n=O(`select`,{class:`slicc-camera__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#d(this.#n.value)}),this.#r=O(`div`,{class:`slicc-camera__status`});let e=O(`button`,{type:`button`,class:`slicc-camera__btn`,part:`cancel`,slot:`footer`},`Cancel`);e.addEventListener(`click`,()=>this.#p(null));let t=O(`button`,{type:`button`,class:`slicc-camera__btn slicc-camera__btn--snap`,part:`snap`,slot:`footer`},r(`camera`,{size:14}),` Snap`);t.addEventListener(`click`,()=>this.#f());let n=O(`div`,{class:`slicc-camera__body`},this.#t,this.#n,this.#r);this.#e=this.ownerDocument.createElement(`slicc-dialog`),this.#e.setAttribute(`heading`,this.heading),this.#e.append(n,e,t),this.#e.addEventListener(`slicc-dialog-close`,()=>{this.#o&&this.#p(null)}),this.append(this.#e)}});var Si={debug(e,t){t===void 0?console.debug(`[slicc-permissions] ${e}`):console.debug(`[slicc-permissions] ${e}`,t)},error(e,t){t===void 0?console.error(`[slicc-permissions] ${e}`):console.error(`[slicc-permissions] ${e}`,t)}},Ci=new Set([`microphone`,`camera`]);function wi(e){return typeof navigator>`u`||!navigator.permissions?.query?Promise.resolve(`prompt`):navigator.permissions.query({name:e}).then(e=>e.state)}var Ti=`
|
|
3146
3169
|
slicc-permissions {
|
|
3147
3170
|
/* Invisible host by default — only the drop overlay paints, and only
|
|
3148
3171
|
while a folder drag is in flight. Hosts can give the element a fixed
|
|
@@ -3313,7 +3336,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3313
3336
|
transform: translateX(-50%) translateY(0);
|
|
3314
3337
|
}
|
|
3315
3338
|
}
|
|
3316
|
-
`,
|
|
3339
|
+
`,Ei=`slicc-permissions-style`;function Di(e){if(e.getElementById(Ei))return;let t=e.createElement(`style`);t.id=Ei,t.textContent=Ti,(e.head??e.documentElement).appendChild(t)}function Oi(e){let t=e.dataTransfer?.types;if(!t)return!1;for(let e=0;e<t.length;e++)if(t[e]===`Files`)return!0;return!1}var ki=class extends HTMLElement{providers={};permissionQuery=null;#e;#t=!1;#n=0;#r=null;connectedCallback(){Di(this.ownerDocument),this.#C();let e=this.ownerDocument;e.addEventListener(`dragenter`,this.#v),e.addEventListener(`dragover`,this.#y),e.addEventListener(`dragleave`,this.#b),e.addEventListener(`drop`,this.#x)}disconnectedCallback(){let e=this.ownerDocument;e.removeEventListener(`dragenter`,this.#v),e.removeEventListener(`dragover`,this.#y),e.removeEventListener(`dragleave`,this.#b),e.removeEventListener(`drop`,this.#x),this.#n=0,this.removeAttribute(`data-dropping`),this.#r&&this.#r.cancel()}async request(e,t){switch(e){case`camera`:return this.#o(t);case`microphone`:return this.#s(t);case`screenshare`:return this.#l(t);case`usb`:return this.#u(t);case`hid`:return this.#d(t);case`serial`:return this.#f(t);case`filesystem`:return this.#p();case`popup`:return this.#m(t);default:return null}}async prompt(e){if(!e.kinds.length)return{status:`granted`,grants:[]};if(e.skipIfGranted){let t=await this.#i(e);if(t)return t}return this.#r&&this.#r.cancel(),new Promise(t=>{this.#w(e,t)})}async#i(e){if(!e.kinds.every(e=>Ci.has(e)))return Si.debug(`prompt: showing dialog (a gesture-bound kind was requested)`,{kinds:e.kinds}),null;let t=this.permissionQuery??wi,n;try{n=await Promise.all(e.kinds.map(e=>t(e)))}catch(e){return Si.error(`prompt: permission query threw; showing dialog`,e),null}if(Si.debug(`prompt: queried permission state`,{kinds:e.kinds,states:n}),!n.every(e=>e===`granted`))return Si.debug(`prompt: not all kinds granted; showing dialog`),null;let r=[];for(let t of e.kinds){let n=await this.request(t,e.requestOptions?.[t]);if(!n)return Si.error(`prompt: acquisition failed after granted state`,{kind:t}),{status:`error`,grants:r,reason:`error`};r.push(n)}return Si.debug(`prompt: short-circuited dialog (already granted)`,{kinds:e.kinds}),{status:`granted`,grants:r}}#a(){return this.providers.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}async#o(e){let t=this.#a();if(!t)return this.#g(`camera`,`unavailable`,`mediaDevices unavailable`);try{let n=await t.getUserMedia(e?.constraints??{video:!0});return this.#h({kind:`camera`,stream:n})}catch(e){return this.#_(`camera`,e)}}async#s(e){let t=this.#a();if(!t)return this.#g(`microphone`,`unavailable`,`mediaDevices unavailable`);try{let n=await t.getUserMedia(e?.constraints??{audio:!0});return this.#h({kind:`microphone`,stream:n})}catch(e){return this.#_(`microphone`,e)}}#c(){if(this.providers.screenshare)return this.providers.screenshare;let e=typeof navigator<`u`?navigator.mediaDevices:void 0;return e&&typeof e.getDisplayMedia==`function`?{getDisplayMedia:t=>e.getDisplayMedia(t)}:null}async#l(e){let t=this.#c();if(!t)return this.#g(`screenshare`,`unavailable`,`getDisplayMedia unavailable`);try{let n=await t.getDisplayMedia(e?.constraints??{video:!0});return this.#h({kind:`screenshare`,stream:n})}catch(e){return this.#_(`screenshare`,e)}}async#u(e){let t=this.providers.usb??globalThis.navigator?.usb??null;if(!t?.requestDevice)return this.#g(`usb`,`unavailable`,`WebUSB unavailable`);try{let n=await t.requestDevice({filters:e?.filters??[]});return n?this.#h({kind:`usb`,device:n}):this.#g(`usb`,`cancelled`)}catch(e){return this.#_(`usb`,e)}}async#d(e){let t=this.providers.hid??globalThis.navigator?.hid??null;if(!t?.requestDevice)return this.#g(`hid`,`unavailable`,`WebHID unavailable`);try{let n=await t.requestDevice({filters:e?.filters??[]}),r=Array.isArray(n)?n:n?[n]:[];return r.length===0?this.#g(`hid`,`cancelled`):this.#h({kind:`hid`,device:r[0],devices:r})}catch(e){return this.#_(`hid`,e)}}async#f(e){let t=this.providers.serial??globalThis.navigator?.serial??null;if(!t?.requestPort)return this.#g(`serial`,`unavailable`,`Web Serial unavailable`);try{let n=await t.requestPort(e?.filters?.length?{filters:e.filters}:{});return n?this.#h({kind:`serial`,port:n}):this.#g(`serial`,`cancelled`)}catch(e){return this.#_(`serial`,e)}}async#p(){let e=this.providers.filesystem??(typeof window<`u`&&`showDirectoryPicker`in window&&window||null);if(!e?.showDirectoryPicker)return this.#g(`filesystem`,`unavailable`,`showDirectoryPicker unavailable`);try{let t=await e.showDirectoryPicker({mode:`readwrite`});return this.#h({kind:`filesystem`,handle:t,source:`picker`,permission:`granted`})}catch(e){return this.#_(`filesystem`,e)}}#m(e){let t=e?.url;if(!t)return this.#g(`popup`,`error`,`popup request missing url`);let n=e?.features??`width=500,height=700,popup=yes`,r=this.providers.popup??(typeof window<`u`?{open:(e,t)=>window.open(e,`_blank`,t)}:null);if(!r)return this.#g(`popup`,`unavailable`,`window.open unavailable`);let i;try{i=r.open(t,n)}catch(e){return this.#_(`popup`,e)}return i?this.#h({kind:`popup`,window:i}):this.#g(`popup`,`error`,`window.open returned null (popup blocked?)`)}#h(e){return this.dispatchEvent(new CustomEvent(`slicc-permission-grant`,{detail:e,bubbles:!0,composed:!0})),e}#g(e,t,n){return this.dispatchEvent(new CustomEvent(`slicc-permission-deny`,{detail:{kind:e,reason:t,message:n},bubbles:!0,composed:!0})),null}#_(e,t){return t instanceof Error&&(t.name===`AbortError`||t.name===`NotFoundError`)?this.#g(e,`cancelled`):this.#g(e,`error`,t instanceof Error?t.message:String(t))}#v=e=>{Oi(e)&&(e.preventDefault(),this.#n++,this.setAttribute(`data-dropping`,``))};#y=e=>{Oi(e)&&e.preventDefault()};#b=e=>{Oi(e)&&(this.#n=Math.max(0,this.#n-1),this.#n===0&&this.removeAttribute(`data-dropping`))};#x=e=>{if(!Oi(e))return;e.preventDefault(),this.#n=0,this.removeAttribute(`data-dropping`);let t=e.dataTransfer?.items;if(!t?.length)return;let n=[];for(let e=0;e<t.length;e++){let r=t[e];r.kind!==`file`||typeof r.getAsFileSystemHandle!=`function`||n.push(r.getAsFileSystemHandle())}n.length!==0&&this.#S(n)};async#S(e){let t;try{t=await Promise.all(e)}catch(e){this.#g(`filesystem`,`error`,e instanceof Error?e.message:String(e));return}let n=t.find(e=>e?.kind===`directory`);if(!n){this.#g(`filesystem`,`cancelled`,`no directory in drop`);return}let r=n,i;if(r.requestPermission)try{i=await r.requestPermission({mode:`readwrite`})}catch(e){this.#g(`filesystem`,`error`,e instanceof Error?e.message:String(e));return}else i=`granted`;if(i!==`granted`){this.#g(`filesystem`,`cancelled`,`permission ${i}`);return}this.#h({kind:`filesystem`,handle:n,source:`drop`,permission:i})}#C(){if(this.#t)return;this.#t=!0;let e=O(`div`,{class:`slicc-permissions__drop-inner`},r(`folder-up`,{size:32}),O(`div`,null,`Drop a folder to mount it (read-write)`));this.#e=O(`div`,{class:`slicc-permissions__drop`,part:`drop`,"aria-hidden":`true`},e),this.append(this.#e)}#w(e,t){let n=e.heading??Mi(e.kinds),i=e.grantLabel??`Allow`,a=e.cancelLabel??`Cancel`,o=`slicc-permissions__heading-${Math.random().toString(36).slice(2,8)}`,s=`slicc-permissions__desc-${Math.random().toString(36).slice(2,8)}`,c=O(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`ghost`,part:`prompt-cancel`},a),l=O(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`primary`,part:`prompt-grant`},i),u=O(`div`,{class:`slicc-permissions__prompt-icons`,"aria-hidden":`true`},...e.kinds.map(e=>O(`span`,{class:`slicc-permissions__prompt-icon`},r(Ai(e),{size:22})))),d=O(`div`,{class:`slicc-permissions__prompt`,part:`prompt`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o,"aria-describedby":s,tabindex:`-1`,popover:`manual`},u,O(`h2`,{class:`slicc-permissions__prompt-heading`,id:o},n),O(`p`,{class:`slicc-permissions__prompt-desc`,id:s},e.description),O(`div`,{class:`slicc-permissions__prompt-actions`},c,l));this.append(d);let f=d;if(typeof f.showPopover==`function`)try{f.showPopover()}catch{}let p=!1,m=this.ownerDocument.activeElement??null,h=()=>{if(d.removeEventListener(`keydown`,ee),d.remove(),m&&typeof m.focus==`function`)try{m.focus()}catch{}this.#r=null},g=(n,r)=>{if(!p){p=!0;for(let t of e.kinds)this.#g(t,n,r);h(),t({status:`cancelled`,grants:[],reason:n,message:r})}},ee=e=>{if(e.key===`Escape`){e.preventDefault(),g(`cancelled`);return}if(e.key===`Tab`){let t=[c,l],n=this.ownerDocument.activeElement,r=t.indexOf(n);if(r===-1){t[0].focus(),e.preventDefault();return}(e.shiftKey?t[(r-1+t.length)%t.length]:t[(r+1)%t.length]).focus(),e.preventDefault()}};c.addEventListener(`click`,()=>g(`cancelled`)),l.addEventListener(`click`,async()=>{if(p)return;p=!0,l.disabled=!0,c.disabled=!0;let n=[],r=null;for(let t of e.kinds){let i=await this.request(t,e.requestOptions?.[t]);if(i)n.push(i);else{r={kind:t,reason:`cancelled`};break}}let i=r?e.kinds.indexOf(r.kind):-1;if(r&&i>=0)for(let t=i+1;t<e.kinds.length;t++)this.#g(e.kinds[t],`cancelled`);h(),t(r?{status:`cancelled`,grants:n,reason:`cancelled`}:{status:`granted`,grants:n})}),d.addEventListener(`keydown`,ee),this.#r={cancel:()=>g(`cancelled`)},requestAnimationFrame(()=>{d.setAttribute(`data-open`,``),l.focus()})}};function Ai(e){switch(e){case`camera`:return`camera`;case`microphone`:return`mic`;case`screenshare`:return`monitor-up`;case`usb`:return`usb`;case`hid`:return`keyboard`;case`serial`:return`cable`;case`filesystem`:return`folder`;case`popup`:return`external-link`}}function ji(e){switch(e){case`camera`:return`camera`;case`microphone`:return`microphone`;case`screenshare`:return`screen`;case`usb`:return`USB device`;case`hid`:return`HID device`;case`serial`:return`serial port`;case`filesystem`:return`folder`;case`popup`:return`sign-in window`}}function Mi(e){if(e.length===1)return`Allow access to your ${ji(e[0])}?`;let t=e.map(ji),n=t.pop();return`Allow access to your ${t.join(`, `)} and ${n}?`}E(`slicc-permissions`,ki);var Ni=new Set([`top`,`bottom`,`left`,`right`]),Pi=k(`
|
|
3317
3340
|
:host { position: relative; display: inline-flex; }
|
|
3318
3341
|
:host([hidden]) { display: none; }
|
|
3319
3342
|
.tip {
|
|
@@ -3338,7 +3361,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3338
3361
|
:host(:hover) .tip[data-p="right"], :host(:focus-within) .tip[data-p="right"], :host([open]) .tip[data-p="right"] { transform: translate(0, -50%); }
|
|
3339
3362
|
.tip:empty { display: none; }
|
|
3340
3363
|
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
|
|
3341
|
-
`);E(`slicc-tooltip`,class extends HTMLElement{static observedAttributes=[`label`,`placement`];#e;#t;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
3364
|
+
`);E(`slicc-tooltip`,class extends HTMLElement{static observedAttributes=[`label`,`placement`];#e;#t;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Pi],this.#t=O(`span`,{class:`tip`,part:`tip`,role:`tooltip`,"aria-hidden":`true`}),this.#e.replaceChildren(O(`slot`),this.#t)}connectedCallback(){this.#n()}attributeChangedCallback(){this.#n()}get label(){return this.getAttribute(`label`)??``}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get placement(){let e=this.getAttribute(`placement`);return e&&Ni.has(e)?e:`top`}set placement(e){this.setAttribute(`placement`,e)}#n(){this.#t.textContent=this.label,this.#t.setAttribute(`data-p`,this.placement)}});var Fi=18,Ii=16,Li=50,Ri=85,zi=2.2,Bi={cx:55,cy:50,r:38},Vi={cx:145,cy:50,r:38},Hi=`http://www.w3.org/2000/svg`;function I(e,t,...n){let r=document.createElementNS(Hi,e);if(t)for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));for(let e of n)r.appendChild(e);return r}var Ui={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}},Wi={cone:`#D2691E`,scoop:`#FFB6C1`};function Gi(e){return e<=Li?1:e>=Ri?zi:1+(e-Li)/(Ri-Li)*(zi-1)}function Ki(e){let t=e.replace(`#`,``);t.length===3&&(t=t.split(``).map(e=>e+e).join(``));let n=Number.parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255}}function qi(e,t,n){return`#${[e,t,n].map(e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`)).join(``)}`}function Ji(e,t){let{r:n,g:r,b:i}=Ki(e),a=t<0?0:255,o=Math.abs(t);return qi(n+(a-n)*o,r+(a-r)*o,i+(a-i)*o)}function Yi(e,t,n){return[I(`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}),I(`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}),I(`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}),I(`rect`,{x:274.59,y:463.59,width:84.73,height:95.66,rx:42.36,ry:42.36,transform:`translate(-268.79 373.91) rotate(-45)`,fill:n}),I(`rect`,{x:291.06,y:603.84,width:72.24,height:90.24,rx:36.12,ry:36.12,transform:`translate(-363.06 421.43) rotate(-45)`,fill:n}),I(`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}),I(`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}),I(`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}),I(`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}),I(`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}),I(`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(`rect`,{x:217.18,y:527.25,width:72.24,height:95.66,rx:36.12,ry:36.12,transform:`translate(-332.45 347.55) rotate(-45)`,fill:n}),I(`path`,{d:`M350.28,739.46h0c-9.24-9.24-24.22-9.24-33.46,0l-13.94,13.94c-9.24,9.24-9.24,24.22,0,33.46l6.81,6.81c12.37,12.37,33.42,7.5,39.1-9.04l7.13-20.75c2.94-8.55.75-18.03-5.64-24.42Z`,fill:n}),I(`path`,{d:`M234.18,749.12l13.2,33.06c1.52,3.82,6.46,4.83,9.37,1.93l9.93-9.93c2.24-2.24,2.24-5.86,0-8.1l-23.13-23.13c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}),I(`rect`,{x:236.26,y:661.25,width:67.04,height:90.24,rx:33.52,ry:33.52,transform:`translate(-420.46 397.65) rotate(-45)`,fill:n}),I(`ellipse`,{cx:288.37,cy:404.38,rx:182.34,ry:67.01,fill:e,stroke:t,"stroke-miterlimit":10,"stroke-width":20})]}function Xi(e,t){return[I(`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,35.15,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 Zi(e,t,n,r,i){return[I(`g`,{class:`eye-blink eye-${r}`},I(`circle`,{cx:e,cy:t,r:n,fill:`#fff`,stroke:`#000`,"stroke-width":4}),I(`g`,{class:`pupil pupil-${r}`},I(`circle`,{cx:e,cy:t,r:i,fill:`#000`}),I(`circle`,{cx:e-i*.3,cy:t-i*.35,r:i*.4,fill:`#fff`})))]}function Qi(e,t,n){return[I(`circle`,{cx:e,cy:t,r:n,fill:`#fff`,stroke:`#000`,"stroke-width":4}),I(`line`,{x1:e-15,y1:t-15,x2:e+15,y2:t+15,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`}),I(`line`,{x1:e+15,y1:t-15,x2:e-15,y2:t+15,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`})]}function $i(e,t){if(e===`none`)return null;let n=Bi,r=Vi;return I(`svg`,{class:`eyes-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...e===`dead`?[...Qi(n.cx,n.cy,n.r),...Qi(r.cx,r.cy,r.r)]:[...Zi(n.cx,n.cy,n.r,`l`,t),...Zi(r.cx,r.cy,r.r,`r`,t)])}function ea(e,t,n,r,i,a){let o=r-t,s=i-n,c=Math.hypot(o,s),l=Math.min(c,a),u=c>0?o/c*l:0,d=c>0?s/c*l:0;e.setAttribute(`transform`,`translate(${u},${d})`)}var ta=k(`
|
|
3342
3365
|
:host{position:relative;display:inline-block;--pill-w:190px;--label:#eef1f6;--icon-tint:color-mix(in oklab,var(--accent) 22%,transparent);}
|
|
3343
3366
|
@media (prefers-color-scheme: light){:host(:not([theme="dark"])){--label:#1b2030;--icon-tint:color-mix(in oklab,var(--accent) 30%,#fff);}}
|
|
3344
3367
|
/* The library's class-based dark scope (body.dark / .dark / [data-theme=dark])
|
|
@@ -3385,7 +3408,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3385
3408
|
:host([compact]:hover) .tip,:host([compact]:focus-within) .tip{opacity:1;transform:translateX(-50%);}
|
|
3386
3409
|
@media (max-width:560px){ :host(:hover) .tip,:host(:focus-within) .tip{opacity:1;transform:translateX(-50%);} }
|
|
3387
3410
|
@media (prefers-reduced-motion: reduce){ .tip{transition:none;} }
|
|
3388
|
-
`);E(`slicc-pill`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`active`,`label`,`pupil`,`fill`,`theme`];#e;#t=null;#n=null;#r=null;#i=null;#a=
|
|
3411
|
+
`);E(`slicc-pill`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`active`,`label`,`pupil`,`fill`,`theme`];#e;#t=null;#n=null;#r=null;#i=null;#a=Ii;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ta]}connectedCallback(){this.#o(),this.#s()}disconnectedCallback(){this.#c()}attributeChangedCallback(){this.isConnected&&(this.#o(),this.#s())}get type(){return this.getAttribute(`type`)===`cone`?`cone`:`scoop`}set type(e){this.setAttribute(`type`,e===`cone`?`cone`:`scoop`)}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get eyeState(){let e=this.getAttribute(`eyes`);return e===`none`||e===`dead`?e:`open`}set eyeState(e){this.setAttribute(`eyes`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,e)}get compact(){return this.hasAttribute(`compact`)}set compact(e){this.toggleAttribute(`compact`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}get pupilScale(){let e=Number.parseFloat(this.getAttribute(`pupil`)??``);if(Number.isFinite(e))return Math.max(.3,Math.min(2.4,e));let t=Number.parseFloat(this.getAttribute(`fill`)??``);return Number.isFinite(t)?Gi(Math.max(0,Math.min(100,t))):1}#o(){let e=this.type,t=Ui[e],n=this.color??Wi[e],r=this.active,i=this.label,a=e===`cone`?Yi(n,Ji(n,-.38),Ji(n,.3)):Xi(n,Ji(n,-.32)),o=t.eyes,s=(o.left+o.width/2)/100,c=(o.top+o.height/2)/100,l=((.5-t.zoom*s)*100).toFixed(2),u=((.5-t.zoom*c)*100).toFixed(2),d=o.left/100,f=(o.left+o.width)/100,p=o.top/100,m=(o.top+o.height)/100,h=Math.min(0,d),g=Math.max(1,f),ee=Math.min(0,p),te=Math.max(1,m),_=Math.min(1,1/Math.max(g-h,te-ee)),v=((.5-_*(h+g)/2)*100).toFixed(2),y=((.5-_*(ee+te)/2)*100).toFixed(2),ne=Fi*this.pupilScale;this.#a=Math.max(2,Math.min(Ii,Bi.r-ne-4));let re=I(`svg`,{class:`glyph`,viewBox:t.vb,preserveAspectRatio:`xMidYMid meet`,style:`--g:${t.glyph}%`},...a),ie=$i(this.eyeState,ne),ae=O(`span`,{class:`eyes`,style:`top:${o.top}%;left:${o.left}%;width:${o.width}%;height:${o.height}%`});ie&&ae.append(ie);let oe=O(`span`,{class:`icon`,part:`icon`},O(`span`,{class:`icon-inner`,style:`--tx:${l}%;--ty:${u}%;--zoom:${t.zoom};--ox:${v}%;--oy:${y}%;--ozoom:${_.toFixed(4)}`},re,ae)),b=O(`span`,{class:`label`,part:`label`},i??O(`slot`)),se=O(`button`,{class:`pill ${r?`active`:``}`,part:`pill`,style:`--accent:${n}`,"aria-label":i||!1},oe,b),x=i?O(`span`,{class:`tip`,part:`tip`,"aria-hidden":`true`},i):null;this.#e.replaceChildren(se,...x?[x]:[]),this.#n=this.#e.querySelector(`.pupil-l`),this.#r=this.#e.querySelector(`.pupil-r`),this.#i=this.#e.querySelector(`.eyes-svg`)}#s(){let e=this.eyeState===`open`&&this.type===`cone`;e&&!this.#t?(this.#t=e=>this.#l(e),document.addEventListener(`mousemove`,this.#t)):!e&&this.#t&&this.#c()}#c(){this.#t&&=(document.removeEventListener(`mousemove`,this.#t),null)}#l(e){if(!this.#i||!this.#n||!this.#r)return;let t=this.#i.getBoundingClientRect();if(!t.width||!t.height)return;let n=(e.clientX-t.left)*(200/t.width),r=(e.clientY-t.top)*(100/t.height);ea(this.#n,Bi.cx,Bi.cy,n,r,this.#a),ea(this.#r,Vi.cx,Vi.cy,n,r,this.#a)}});var na=k(`
|
|
3389
3412
|
:host {
|
|
3390
3413
|
display: inline-grid;
|
|
3391
3414
|
place-items: center;
|
|
@@ -3432,7 +3455,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3432
3455
|
object-fit: cover;
|
|
3433
3456
|
display: block;
|
|
3434
3457
|
}
|
|
3435
|
-
`),
|
|
3458
|
+
`),ra=class extends HTMLElement{static observedAttributes=[`initials`,`name`,`src`,`email`,`size`,`label`];#e;#t=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[na],this.addEventListener(`click`,this.#i),this.addEventListener(`keydown`,this.#a)}connectedCallback(){this.hasAttribute(`role`)||this.setAttribute(`role`,`button`),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.#o()}disconnectedCallback(){this.#t++}attributeChangedCallback(e,t,n){e===`size`&&this.#r(n),this.isConnected&&this.#o()}get initials(){return this.getAttribute(`initials`)}set initials(e){e==null?this.removeAttribute(`initials`):this.setAttribute(`initials`,e)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get size(){return this.getAttribute(`size`)}set size(e){e==null?this.removeAttribute(`size`):this.setAttribute(`size`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get resolvedInitials(){let e=this.initials;return e!=null&&e.trim()!==``?e.trim().slice(0,2).toUpperCase():aa(this.name)||`?`}async gravatarUrl(e=this.email){let t=e?.trim().toLowerCase();return t?`https://www.gravatar.com/avatar/${await ia(t)}?s=${this.#n()}&d=404`:null}#n(){let e=this.getBoundingClientRect().width;return Math.max(1,Math.round((e>0?e:30)*2))}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--avatar-size`):this.style.setProperty(`--avatar-size`,e)}#i=()=>{this.dispatchEvent(new CustomEvent(`slicc-avatar-click`,{bubbles:!0,composed:!0}))};#a=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.click())};#o(){let e=++this.#t,t=this.src,n=this.email,r=this.resolvedInitials,i=this.label??this.name??(r===`?`?`Account`:r);this.setAttribute(`aria-label`,i);let a=[O(`span`,{class:`ini`,part:`initials`},r)];if(t){let n=O(`img`,{class:`img`,part:`image`,src:t,alt:i});n.addEventListener(`load`,()=>{e===this.#t&&this.#e.querySelector(`.me`)?.classList.add(`has-img`)}),n.addEventListener(`error`,()=>{e===this.#t&&(n.remove(),this.#e.querySelector(`.me`)?.classList.remove(`has-img`))}),a.push(n)}let o=O(`div`,{class:`me`,part:`avatar`},O(`slot`,null,...a));this.#e.replaceChildren(o),!t&&n&&this.#s(n,e)}#s(e,t){this.gravatarUrl(e).then(e=>{if(!e||t!==this.#t)return;let n=new Image;n.onload=()=>{if(t!==this.#t||!this.isConnected)return;let n=this.#e.querySelector(`.me`);n&&(n.style.backgroundImage=`url("${e}")`,n.classList.add(`has-img`))},n.src=e}).catch(()=>{})}};async function ia(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function aa(e){if(!e)return``;let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?``:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}E(`slicc-avatar`,ra);var oa=k(`
|
|
3436
3459
|
:host { display: inline-flex; flex: 0 0 auto; }
|
|
3437
3460
|
:host([hidden]) { display: none; }
|
|
3438
3461
|
.col {
|
|
@@ -3453,7 +3476,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3453
3476
|
.col:hover { background: var(--ghost); color: var(--ink); }
|
|
3454
3477
|
.icon { display: inline-flex; place-items: center; pointer-events: none; }
|
|
3455
3478
|
.icon svg { display: block; }
|
|
3456
|
-
`),
|
|
3479
|
+
`),sa=`panel-right-close`,ca=`Collapse`,la=16;E(`slicc-collapse-btn`,class extends HTMLElement{static observedAttributes=[`label`,`icon`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[oa]}connectedCallback(){this.#n()}attributeChangedCallback(){this.isConnected&&this.#n()}get label(){return this.getAttribute(`label`)??ca}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get icon(){return this.getAttribute(`icon`)??sa}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}#n(){let e=this.label,t=r(this.icon,{size:la,part:`icon`}),n=O(`button`,{class:`col`,part:`button`,type:`button`,"aria-label":e,title:e},O(`slot`,null,O(`span`,{class:`icon`},t)));n.addEventListener(`click`,this.#r),this.#t=n,this.#e.replaceChildren(n)}#r=()=>{this.dispatchEvent(new CustomEvent(`collapse`,{bubbles:!0,composed:!0}))}});function ua(e){return e.replace(`claude-`,``)}function da(e){return e==null||e===0?``:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}var fa=k(`
|
|
3457
3480
|
:host {
|
|
3458
3481
|
position: absolute;
|
|
3459
3482
|
top: calc(100% + 8px);
|
|
@@ -3565,7 +3588,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3565
3588
|
font-variant-numeric: tabular-nums;
|
|
3566
3589
|
color: var(--ink);
|
|
3567
3590
|
}
|
|
3568
|
-
`);E(`slicc-cost-overlay`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
3591
|
+
`);E(`slicc-cost-overlay`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[fa]}connectedCallback(){this.#r()}attributeChangedCallback(){this.isConnected&&this.#r()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get models(){return this.#t}set models(e){this.#t=e,this.isConnected&&this.#r()}get scoops(){return this.#n}set scoops(e){this.#n=e,this.isConnected&&this.#r()}#r(){let e=[];if(this.#t.length>0){let t=this.#t.map(e=>{let t=da(e.tokens);return O(`div`,{class:`model-row`},O(`span`,{class:`model-name`},ua(e.model)),t?O(`span`,{class:`model-tokens`},t):!1,O(`span`,{class:`model-cost`},`$${e.cost.toFixed(2)}`))});e.push(O(`div`,{class:`section section--models`},O(`div`,{class:`section-title`},`BY MODEL`),...t))}if(this.#n.length>0){let t=this.#n.map(e=>O(`div`,{class:`scoop-row`},O(`span`,{class:`scoop-name`},e.name),O(`span`,{class:`scoop-cost`},`$${e.cost.toFixed(2)}`)));e.push(O(`div`,{class:`section section--scoops`},O(`div`,{class:`section-title`},`BY AGENT`),...t))}let t=this.#t.reduce((e,t)=>e+t.cost,0);e.push(O(`div`,{class:`total-row`},O(`span`,{class:`total-label`},`Total`),O(`span`,{class:`total-cost`},`$${t.toFixed(2)}`)));let n=O(`div`,{class:`card`},...e);this.#e.replaceChildren(n)}});var pa=k(`
|
|
3569
3592
|
:host {
|
|
3570
3593
|
display: flex;
|
|
3571
3594
|
align-items: center;
|
|
@@ -3594,7 +3617,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3594
3617
|
min-width: 0;
|
|
3595
3618
|
background: var(--line, #e5e5e5);
|
|
3596
3619
|
}
|
|
3597
|
-
`);E(`slicc-day-separator`,class extends HTMLElement{static observedAttributes=[`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
3620
|
+
`);E(`slicc-day-separator`,class extends HTMLElement{static observedAttributes=[`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[pa]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label??O(`slot`);this.#e.replaceChildren(O(`span`,{class:`label`,part:`label`},e))}});var ma=`CLI float`;function ha(e){if(e==null)return null;let t=e.trim();if(t===``)return null;let n=Number.parseFloat(t.replace(/^\$/,``));return Number.isFinite(n)?`$${n.toFixed(2)}`:null}var ga=`(max-width: 560px)`,_a=k(`
|
|
3598
3621
|
:host {
|
|
3599
3622
|
position: relative;
|
|
3600
3623
|
display: inline-flex;
|
|
@@ -3705,36 +3728,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3705
3728
|
@media (prefers-reduced-motion: reduce) {
|
|
3706
3729
|
.tip { transition: none; }
|
|
3707
3730
|
}
|
|
3708
|
-
`);E(`slicc-floatbar`,class extends HTMLElement{static observedAttributes=[`label`,`linked`,`online`,`spent`];#e;#t;#n=()=>{this.isConnected&&this.#c()};#r=null;#i=[];#a=[];#o;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
3709
|
-
:host { display: inline-grid; }
|
|
3710
|
-
:host([hidden]) { display: none; }
|
|
3711
|
-
.iconbtn {
|
|
3712
|
-
width: 30px;
|
|
3713
|
-
height: 30px;
|
|
3714
|
-
border-radius: 8px;
|
|
3715
|
-
border: 1px solid var(--line);
|
|
3716
|
-
background: var(--canvas);
|
|
3717
|
-
color: var(--txt-2);
|
|
3718
|
-
font-family: var(--ui);
|
|
3719
|
-
font-size: 16px;
|
|
3720
|
-
line-height: 1;
|
|
3721
|
-
cursor: pointer;
|
|
3722
|
-
display: grid;
|
|
3723
|
-
place-items: center;
|
|
3724
|
-
padding: 0;
|
|
3725
|
-
margin: 0;
|
|
3726
|
-
-webkit-appearance: none;
|
|
3727
|
-
appearance: none;
|
|
3728
|
-
}
|
|
3729
|
-
.iconbtn:hover { background: var(--ghost); color: var(--ink); }
|
|
3730
|
-
.iconbtn:disabled {
|
|
3731
|
-
cursor: default;
|
|
3732
|
-
opacity: 0.45;
|
|
3733
|
-
}
|
|
3734
|
-
.iconbtn:disabled:hover { background: var(--canvas); color: var(--txt-2); }
|
|
3735
|
-
.icon { display: grid; place-items: center; pointer-events: none; }
|
|
3736
|
-
.icon svg { display: block; }
|
|
3737
|
-
`),ga=`plus`,_a=16;E(`slicc-icon-button`,class extends HTMLElement{static observedAttributes=[`icon`,`disabled`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ha]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get icon(){return this.getAttribute(`icon`)??ga}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label,t=O(`slot`,null,O(`span`,{class:`icon`},r(this.icon,{size:_a,part:`icon`}))),n=O(`button`,{type:`button`,class:`iconbtn`,part:`button`,"aria-label":e??void 0,title:e??void 0,disabled:this.disabled},t);this.#e.replaceChildren(n)}});var va=k(`
|
|
3731
|
+
`);E(`slicc-floatbar`,class extends HTMLElement{static observedAttributes=[`label`,`linked`,`online`,`spent`];#e;#t;#n=()=>{this.isConnected&&this.#c()};#r=null;#i=[];#a=[];#o;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[_a],this.#t=typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(ga):null}connectedCallback(){this.#t?.addEventListener(`change`,this.#n),this.#l()}disconnectedCallback(){this.#t?.removeEventListener(`change`,this.#n),clearTimeout(this.#o)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.#l()}get label(){return this.getAttribute(`label`)??ma}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get linked(){return this.hasAttribute(`linked`)}set linked(e){this.toggleAttribute(`linked`,!!e)}get online(){return this.hasAttribute(`online`)}set online(e){this.toggleAttribute(`online`,!!e)}get spent(){return this.getAttribute(`spent`)}set spent(e){e==null?this.removeAttribute(`spent`):this.setAttribute(`spent`,String(e))}get costModels(){return this.#i}set costModels(e){this.#i=e,this.#r&&(this.#r.models=e)}get costScoops(){return this.#a}set costScoops(e){this.#a=e,this.#r&&(this.#r.scoops=e)}#s(){let e=[this.label],t=ha(this.spent);return t!=null&&e.push(t),e.push(this.online?`online`:`offline`),e.join(` · `)}#c(){this.#t?.matches?this.setAttribute(`title`,this.#s()):this.removeAttribute(`title`)}#l(){let e=[];this.online&&e.push(O(`span`,{class:`fdot`,part:`dot`})),e.push(O(`span`,{class:`label`,part:`label`},O(`slot`,null,this.label)));let t=ha(this.spent);if(t!=null){e.push(O(`span`,{class:`sep`,part:`sep`}));let n=O(`span`,{class:`spent`,part:`spent`},r(`circle-dollar-sign`,{size:12}),O(`span`,{class:`amount`},t));n.addEventListener(`mouseenter`,()=>this.#u()),n.addEventListener(`mouseleave`,()=>this.#d()),e.push(n)}e.push(O(`span`,{class:`tip`,part:`tip`,"aria-hidden":`true`},this.#s())),this.#r=null,this.#e.replaceChildren(...e),this.#c()}#u(){if(clearTimeout(this.#o),!this.#r){let e=document.createElement(`slicc-cost-overlay`);e.models=this.#i,e.scoops=this.#a,e.addEventListener(`mouseenter`,()=>this.#u()),e.addEventListener(`mouseleave`,()=>this.#d()),this.#e.appendChild(e),this.#r=e}this.#r.toggleAttribute(`open`,!0)}#d(){this.#o=setTimeout(()=>{this.#r&&this.#r.removeAttribute(`open`)},150)}});var va=k(`
|
|
3738
3732
|
:host { display: inline-flex; align-items: center; height: var(--ctl-h, 30px); font-family: var(--ui); line-height: 1; }
|
|
3739
3733
|
.logo { font-weight: 600; font-size: 14px; letter-spacing: -0.02em; color: var(--ink); }
|
|
3740
3734
|
.b {
|
|
@@ -3893,7 +3887,7 @@ slicc-press-button {
|
|
|
3893
3887
|
animation: none;
|
|
3894
3888
|
}
|
|
3895
3889
|
}
|
|
3896
|
-
`,Ta=`slicc-press-button-style`;function Ea(e){if(e.getElementById(Ta))return;let t=e.createElement(`style`);t.id=Ta,t.textContent=wa,(e.head??e.documentElement).appendChild(t)}var Da=`slicc-press-btn`,Oa=`is-squish`,ka=`is-wobble`;E(`slicc-press-button`,class extends HTMLElement{static get observedAttributes(){return[`label`,`tooltip`,`tooltip-pos`,`disabled`]}innerBtn=null;pressLayer=null;handle=null;initialized=!1;pendingShortTimer=null;pendingShortEvent=null;animEndListener=null;connectedCallback(){Ea(this.ownerDocument),this.initialized?this.handle===null&&this.attachGesture():this.initialize(),this.syncAttributes()}disconnectedCallback(){this.handle?.destroy(),this.handle=null,this.clearPendingShort(),this.clearRipple(),this.clearAnimation()}attributeChangedCallback(){this.initialized&&this.syncAttributes()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get tooltip(){return this.getAttribute(`tooltip`)}set tooltip(e){e==null?this.removeAttribute(`tooltip`):this.setAttribute(`tooltip`,e)}setIcon(e){this.initialized||this.initialize();let t=this.innerBtn,n=this.pressLayer;for(let e of Array.from(t.childNodes))e!==n&&e.remove();let r=new DOMParser().parseFromString(e,`text/html`).body;for(;r.firstChild;)t.appendChild(r.firstChild)}focus(e){this.initialized||this.initialize(),this.innerBtn?.focus(e)}initialize(){this.initialized=!0;let e=O(`span`,{class:`${Da}__press-layer`,part:`press-layer`}),t=O(`button`,{type:`button`,class:`${Da}__btn`,part:`button`},e);for(;this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t),this.innerBtn=t,this.pressLayer=e,this.attachGesture()}syncAttributes(){let e=this.innerBtn;if(!e)return;let t=this.getAttribute(`label`);t==null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,t);let n=this.getAttribute(`tooltip`);n==null?delete e.dataset.tooltip:e.dataset.tooltip=n;let r=this.getAttribute(`tooltip-pos`);r==null?delete e.dataset.tooltipPos:e.dataset.tooltipPos=r,this.hasAttribute(`disabled`)?e.setAttribute(`disabled`,``):e.removeAttribute(`disabled`)}longPressMs(){let e=this.getAttribute(`long-press-ms`);if(e==null)return
|
|
3890
|
+
`,Ta=`slicc-press-button-style`;function Ea(e){if(e.getElementById(Ta))return;let t=e.createElement(`style`);t.id=Ta,t.textContent=wa,(e.head??e.documentElement).appendChild(t)}var Da=`slicc-press-btn`,Oa=`is-squish`,ka=`is-wobble`;E(`slicc-press-button`,class extends HTMLElement{static get observedAttributes(){return[`label`,`tooltip`,`tooltip-pos`,`disabled`]}innerBtn=null;pressLayer=null;handle=null;initialized=!1;pendingShortTimer=null;pendingShortEvent=null;animEndListener=null;connectedCallback(){Ea(this.ownerDocument),this.initialized?this.handle===null&&this.attachGesture():this.initialize(),this.syncAttributes()}disconnectedCallback(){this.handle?.destroy(),this.handle=null,this.clearPendingShort(),this.clearRipple(),this.clearAnimation()}attributeChangedCallback(){this.initialized&&this.syncAttributes()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get tooltip(){return this.getAttribute(`tooltip`)}set tooltip(e){e==null?this.removeAttribute(`tooltip`):this.setAttribute(`tooltip`,e)}setIcon(e){this.initialized||this.initialize();let t=this.innerBtn,n=this.pressLayer;for(let e of Array.from(t.childNodes))e!==n&&e.remove();let r=new DOMParser().parseFromString(e,`text/html`).body;for(;r.firstChild;)t.appendChild(r.firstChild)}focus(e){this.initialized||this.initialize(),this.innerBtn?.focus(e)}initialize(){this.initialized=!0;let e=O(`span`,{class:`${Da}__press-layer`,part:`press-layer`}),t=O(`button`,{type:`button`,class:`${Da}__btn`,part:`button`},e);for(;this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t),this.innerBtn=t,this.pressLayer=e,this.attachGesture()}syncAttributes(){let e=this.innerBtn;if(!e)return;let t=this.getAttribute(`label`);t==null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,t);let n=this.getAttribute(`tooltip`);n==null?delete e.dataset.tooltip:e.dataset.tooltip=n;let r=this.getAttribute(`tooltip-pos`);r==null?delete e.dataset.tooltipPos:e.dataset.tooltipPos=r,this.hasAttribute(`disabled`)?e.setAttribute(`disabled`,``):e.removeAttribute(`disabled`)}longPressMs(){let e=this.getAttribute(`long-press-ms`);if(e==null)return er;let t=Number(e);return Number.isFinite(t)&&t>0?t:er}doubleClickMs(){let e=this.getAttribute(`double-click-ms`);if(e==null)return 350;let t=Number(e);return Number.isFinite(t)&&t>0?t:350}doubleClickDisabled(){return this.hasAttribute(`disable-double-click`)}emit(e,t){e===`short-click`?this.playAnimation(Oa):e===`double-click`&&this.playAnimation(ka);let n=t?{sourceEvent:t}:{};this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}))}playAnimation(e){let t=this.innerBtn;if(!t)return;this.clearAnimation(),t.offsetWidth,t.classList.add(e);let n=e=>{e.target===t&&this.clearAnimation()};this.animEndListener=n,t.addEventListener(`animationend`,n)}clearAnimation(){let e=this.innerBtn;e&&(this.animEndListener&&=(e.removeEventListener(`animationend`,this.animEndListener),null),e.classList.remove(Oa,ka))}clearPendingShort(){this.pendingShortTimer!==null&&(clearTimeout(this.pendingShortTimer),this.pendingShortTimer=null),this.pendingShortEvent=null}attachGesture(){this.handle=tr(this,{longPressMs:this.longPressMs(),onPressStart:e=>this.paintRipple(e),onPressEnd:()=>this.clearRipple(),onLongPress:()=>{if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`);return}this.emit(`long-press`)},onShortClick:e=>{if(this.doubleClickDisabled()){this.emit(`short-click`,e);return}if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`,e);return}this.pendingShortEvent=e,this.pendingShortTimer=setTimeout(()=>{this.pendingShortTimer=null;let e=this.pendingShortEvent;this.pendingShortEvent=null,this.emit(`short-click`,e??void 0)},this.doubleClickMs())}})}paintRipple(e){this.clearRipple();let t=this.pressLayer;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=Math.max(r,n.width-r),o=Math.max(i,n.height-i),s=Math.ceil(Math.hypot(a,o))+2,c=this.ownerDocument.createElement(`span`);c.className=`${Da}__press`,c.style.left=`${r}px`,c.style.top=`${i}px`,c.style.width=`0px`,c.style.height=`0px`,c.style.transitionDuration=`${this.longPressMs()}ms`,t.appendChild(c),requestAnimationFrame(()=>{c.isConnected&&(c.style.width=`${s*2}px`,c.style.height=`${s*2}px`)})}clearRipple(){let e=this.pressLayer;if(e)for(;e.firstChild;)e.firstChild.remove()}});var Aa=k(`
|
|
3897
3891
|
:host { display: inline-flex; }
|
|
3898
3892
|
:host([hidden]) { display: none; }
|
|
3899
3893
|
|
|
@@ -5042,7 +5036,7 @@ Example input:
|
|
|
5042
5036
|
2. bash: {"command":"ls /published"}
|
|
5043
5037
|
3. bash: {"command":"diff /drafts /published"}
|
|
5044
5038
|
Example output: Compare drafts against published files`;function _u(e){return e.length>=6&&/[a-zA-Z]/.test(e)&&/\s/.test(e.trim())}function vu(e,n){if(e.length===0)return;let r=hu(e);if(!r)return;let i=fu.get(r);if(i){n.setAttribute(`label`,i);return}let a=e[0]?.id;if(a){let e=mu.get(a);e&&n.setAttribute(`label`,e)}if(pu.has(r))return;pu.add(r);let o=e.map((e,t)=>{let n;try{n=JSON.stringify(e.input??{})}catch{n=String(e.input??``)}return n.length>300&&(n=`${n.slice(0,300)}…`),`${t+1}. ${e.name}: ${n}`}).join(`
|
|
5045
|
-
`);t(async()=>{let{quickLabel:e}=await import(`./quick-llm-
|
|
5039
|
+
`);t(async()=>{let{quickLabel:e}=await import(`./quick-llm-BpD0afu9.js`).then(e=>e.n);return{quickLabel:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(({quickLabel:e})=>e({system:gu,prompt:`Label these tool calls (inputs only):\n${o}`,maxTokens:40})).then(e=>{let t=e?.replace(/^["']|["']$|\.$/g,``).trim()??``;_u(t)&&(fu.set(r,t),a&&mu.set(a,t),n.isConnected&&n.setAttribute(`label`,t))}).catch(()=>void 0).finally(()=>pu.delete(r))}function yu(e,t={}){let n=X(`slicc-tool-cluster`,{count:String(e.length)});return t.open&&n.setAttribute(`open`,``),n.append(...e),t.toolCalls&&t.toolCalls.length>0&&vu(t.toolCalls,n),n}function bu(e){let t=document.createElement(`slicc-agent-message`);return t.setAttribute(`data-msg-id`,e.id),e.isStreaming&&t.setAttribute(`streaming`,``),t.setBodyHtml(Pl(e.content,e.isStreaming===!0)),(e.content??``).trim()||t.setAttribute(`data-empty`,``),[t,...(e.toolCalls??[]).map(t=>lu(t,e.id))]}function xu(e,t){let n=e.querySelectorAll(`:scope > slicc-tool-cluster`);for(let e of n){let n=Array.from(e.querySelectorAll(`slicc-action-row`));Su(e,n,t);let r=e.parentNode;if(!r){e.remove();continue}for(let t of n)Cu(t,r,e);e.remove()}}function Su(e,t,n){if(!e.hasAttribute(`open`))return;let r=t[0]?.dataset.msgId;if(!r)return;let i=t.length>0&&t.every(e=>e.dataset.msgId===r),a=e.parentElement?.querySelector(`slicc-agent-message[data-msg-id="${r}"]`);i&&a?.hasAttribute(`streaming`)===!0||n.add(r)}function Cu(e,t,n){let r=e.dataset.msgId,i=r&&t instanceof Element?t.querySelector(`:scope > slicc-agent-message[data-msg-id="${r}"]`):null;if(!i||i.parentNode!==t){t.insertBefore(e,n);return}let a=i;for(;a.nextSibling instanceof HTMLElement&&a.nextSibling.tagName.toLowerCase()===`slicc-action-row`&&a.nextSibling.dataset.msgId===r;)a=a.nextSibling;t.insertBefore(e,a.nextSibling)}var wu=new Set([`slicc-user-message`,`slicc-lick-card`,`slicc-error-card`,`slicc-delegation-line`,`slicc-day-separator`]);function Tu(e){return e instanceof HTMLElement?wu.has(e.tagName.toLowerCase()):!0}function Eu(e){return e instanceof HTMLElement&&e.tagName.toLowerCase()===`slicc-action-row`}function Du(e){return e instanceof HTMLElement&&e.tagName.toLowerCase()===`slicc-agent-message`}function Ou(e){let t=[],n=[];for(let r of e)Du(r)?!r.hasAttribute(`data-empty`)&&n.length>0&&(t.push(n),n=[]):Eu(r)&&n.push(r);return n.length>0&&t.push(n),t}function ku(e,t){let n=t[0]?.dataset.msgId;return!n||!t.every(e=>e.dataset.msgId===n)?!1:e.querySelector(`slicc-agent-message[data-msg-id="${n}"]`)?.hasAttribute(`streaming`)===!0}function Au(e,t){let n=[];for(let r of e){let e=r.dataset.msgId,i=r.dataset.toolId;if(!e||!i)return;let a=t(e,i);if(!a)return;n.push(a)}return n}function ju(e,t){let n=e[0],r=n.parentNode;if(!r)return;let i=new Set(e),a=n.nextSibling;for(;a&&i.has(a);)a=a.nextSibling;let o=n.dataset.msgId,s=yu(e,{open:!!(o&&t.openClusterAnchors.has(o))||ku(r,e),toolCalls:t.toolCallLookup?Au(e,t.toolCallLookup):void 0});r.insertBefore(s,a)}function Mu(e,t){xu(e,t.openClusterAnchors);let n=Array.from(e.children),r=0;for(;r<n.length;){if(Tu(n[r])){r++;continue}let e=r;for(;e<n.length&&!Tu(n[e]);)e++;let i=Ou(n.slice(r,e));for(let e of i)e.length>=3&&ju(e,t);r=e}t.openClusterAnchors.clear()}function Nu(e){let t=Bl.exec(e.content),n=e.lickCount??1,r=Wl.exec(e.content),i=r?Gl(r[1]):null,a=X(`slicc-lick-card`,{kind:e.channel??`webhook`,"event-label":i??t?.[2]??e.channel??`event`,collapsible:``,collapsed:``});i&&a.setAttribute(`hue`,Rl({isCone:!1,name:i})),n>1&&a.setAttribute(`count`,String(n)),e.lickState&&e.lickState!==`pending`&&a.setAttribute(`state`,e.lickState);let o=e.lickParts??[e.content];for(let e of o){let t=document.createElement(`div`);t.innerHTML=Nl(Hl(e)),a.append(t)}return a}function Pu(e){let t=X(`slicc-delegation-line`,{kind:`feed`,verb:`feed_scoop`,label:Kl(e.content.replace(/\*\*\[[^\]]*\]\*\*\s*/,``))}),n=document.createElement(`slicc-user-message`);return n.setBodyHtml(Nl(e.content)),[t,n]}function Fu(e){return typeof e==`string`&&e.startsWith(`No API key configured`)}function Iu(e){return e?e.toLowerCase().includes(`the provided model identifier is invalid`):!1}function Lu(e){return e?e.toLowerCase().includes(`please log in again`):!1}function Ru(e){let t={message:e.content,"message-id":e.id};return Fu(e.content)?t.action=`settings`:Iu(e.content)?t.action=`change-model`:Lu(e.content)&&(t.action=`login`),X(`slicc-error-card`,t)}function zu(e){if(e.source===`lick`)return[Nu(e)];if(e.source===`delegation`||e.channel===`delegation`)return Pu(e);if(e.error)return[Ru(e)];if(e.role===`assistant`)return bu(e);let t=Ul(e.content);return t?[Nu({...e,source:`lick`,channel:t})]:[uu(e)]}function Bu(e){let t=[];for(let n of e){let e=n;if(!n.source&&n.role===`user`){let t=Ul(n.content);t&&(e={...n,source:`lick`,channel:t})}let r=t[t.length-1];if(!(e.lickId||r?.lickId)&&e.source===`lick`&&r?.source===`lick`&&r.channel===e.channel){r.lickParts=[...r.lickParts??[r.content],e.content],r.lickCount=r.lickParts.length,r.content+=`\n\n${e.content}`;continue}t.push({...e})}return t}function Vu(e){return new Date(e).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}function Hu(e){return X(`slicc-day-separator`,{label:Vu(e)})}function Uu(e){let t=[],n=``;for(let r of e){let e=new Date(r.timestamp).toDateString();e!==n&&(t.push(Hu(r.timestamp)),n=e),t.push(...zu(r))}let r=document.createElement(`div`);return r.append(...t),Mu(r,{openClusterAnchors:new Set,toolCallLookup:(t,n)=>e.find(e=>e.id===t)?.toolCalls?.find(e=>e.id===n)}),Array.from(r.children)}var Wu=new Uint8Array([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,4,0,0,0,181,28,12,2,0,0,0,11,73,68,65,84,120,218,99,100,96,0,0,0,6,0,2,48,129,208,47,0,0,0,0,73,69,78,68,174,66,96,130]);function Gu(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return typeof btoa==`function`?btoa(t):Buffer.from(t,`binary`).toString(`base64`)}var Ku=new Date(`2024-01-01T10:00:00`).getTime();function Q(e){return Ku+e*6e4}var qu=`ui-fixture`;function Ju(){return[{id:`fx-user-1`,role:`user`,content:`Hey sliccy — can you summarize what this fixture covers?`,timestamp:Q(0)},{id:`fx-assistant-1`,role:`assistant`,content:`Sure! This session walks through every chat UI variant I know about. You'll see user and assistant bubbles, tool calls in every status, the six lick channels, a delegation, queued messages, and a streaming tail at the end so you can inspect the live state.`,timestamp:Q(.2)}]}function Yu(){return[{id:`fx-user-2`,role:`user`,content:`Show me some **markdown** — headings, lists, code, a blockquote.`,timestamp:Q(1)},{id:`fx-user-attachment`,role:`user`,content:`Use these attachments as visual and text context.`,timestamp:Q(1.1),attachments:[{id:`fx-att-image`,name:`dot.png`,mimeType:`image/png`,size:Wu.byteLength,kind:`image`,data:Gu(Wu)},{id:`fx-att-text`,name:`notes.txt`,mimeType:`text/plain`,size:21,kind:`text`,text:`Fixture attachment text`}]},{id:`fx-assistant-2`,role:`assistant`,content:"## Rich content sample,,Here is a short list:,,- `renderAssistantMessageContent` handles GFM markdown,- Code blocks get syntax highlighting,- Inline `code` uses the mono token,,A fenced code block:,,```ts,import { createChatFixture } from './chat-fixture.js';,,const msgs = createChatFixture();,console.log(msgs.length);,```,,> Blockquotes should feel quieter than regular text.,,And a nested ordered list:,,1. First step,2. Second step, 1. Sub-step A, 2. Sub-step B,3. Third step".split(`,`).join(`
|
|
5046
5040
|
`),timestamp:Q(1.3)}]}function Xu(){return[{id:`fx-assistant-3`,role:`assistant`,content:`Let me check a few things before I answer.`,timestamp:Q(2),toolCalls:[{id:`fx-tc-read`,name:`read_file`,input:{path:`/workspace/README.md`},result:`# Sample README
|
|
5047
5041
|
|
|
5048
5042
|
This is the contents that read_file returned.`},{id:`fx-tc-bash`,name:`bash`,input:{command:`ls -la /workspace`},result:`total 24
|
|
@@ -5085,4 +5079,4 @@ Kind: read
|
|
|
5085
5079
|
Detail: /shared/secrets/api-key.txt
|
|
5086
5080
|
Suggested pattern: /shared/secrets/**
|
|
5087
5081
|
|
|
5088
|
-
Use the lick_confirm tool with lick_id="lick-1700000000002-req44" to approve (or always-approve with a pattern), or lick_dismiss with lick_id="lick-1700000000002-req44" to deny.`,timestamp:Q(17.9),source:`lick`,channel:`sudo-request`,lickId:`lick-1700000000002-req44`,lickState:`dismissed`}]}function ed(){return[{id:`fx-queued-1`,role:`user`,content:`Also double-check the install.md formatting after you finish.`,timestamp:Q(18),queued:!0}]}function td(){return[{id:`fx-assistant-streaming`,role:`assistant`,content:`Great, running the coverage suite now. I'll report back as soon as it `,timestamp:Q(20),isStreaming:!0,toolCalls:[{id:`fx-tc-streaming`,name:`bash`,input:{command:`npm run test -- --coverage`}}]}]}function nd(){return[...Ju(),...Yu(),...Xu(),...Zu(),...Qu(),...$u(),...ed(),...td()]}var rd=e({FREEZER_TINT:()=>id,applyShellContext:()=>gd,mountWcShell:()=>hd,mountWcUiPreview:()=>vd,submittedText:()=>_d}),id=`#3b6cb2`,ad=`slicc-wcui-style`,od=[`html,body{margin:0;padding:0;height:100%;}`,`.wcui-frame{position:relative;transform:translateZ(0);width:100%;height:100vh;`,`overflow:hidden;background:var(--bg);font-family:var(--ui);}`,`.wcui-shader{position:absolute;inset:0;z-index:0;}`,`.wcui-frame slicc-chatpane{position:relative;background:transparent;}`,`.wcui-appcol{position:relative;z-index:1;height:100%;display:flex;flex-direction:column;`,`box-sizing:border-box;padding-left:var(--rail-w,44px);`,`transition:padding-left .4s cubic-bezier(.4,0,.2,1);}`,`@media (max-width:560px){.wcui-appcol{padding-left:44px;}}`,`.wcui-term{flex:1;min-height:0;display:flex;flex-direction:column;padding:8px 4px 8px 10px;`,`box-sizing:border-box;background:#141414;}`,`.wcui-term .terminal-panel__terminal-host{flex:1 1 auto;min-height:0;}`,`.wcui-term .terminal-panel__preview{flex:0 0 auto;}`,`.wcui-frame slicc-file-tree{width:100%;border-right:none;}`,`slicc-file-tree .f,slicc-file-tree .dir{position:relative;}`,`slicc-file-tree .ft-acts{position:absolute;right:8px;top:50%;transform:translateY(-50%);`,`display:flex;gap:3px;}`,`slicc-file-tree .ft-act{padding:0 5px;font-size:10px;line-height:16px;height:16px;`,`box-sizing:border-box;font-family:var(--ui);border-radius:3px;border:1px solid var(--line);`,`background:var(--canvas);color:var(--txt-2);cursor:pointer;}`,`slicc-file-tree .ft-act:hover{background:var(--ghost);}`,`slicc-file-tree .ft-copy-flash{background:color-mix(in srgb,#22c55e 18%,var(--canvas))!important;}`,`.wcui-memory{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;`,`gap:8px;padding:10px;}`,`.wcui-placeholder{flex:1;display:flex;align-items:center;justify-content:center;`,`padding:24px;color:var(--txt-2);font-size:13px;text-align:center;}`].join(``);function sd(e){if(e.getElementById(ad))return;let t=e.createElement(`style`);t.id=ad,t.textContent=od,e.head.appendChild(t)}var cd=null;function ld(){cd?.(),cd=io()}function $(e,t={}){let n=document.createElement(e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function ud(e){let t=$(`slicc-nav`,{accent:`var(--waffle)`}),n=$(`slicc-scoop-switcher`);n.scoops=[...e.scoops];let r=$(`slicc-floatbar`,{label:e.floatLabel,spent:`0.00`}),i=document.createElement(`slicc-avatar-menu`);return i.append($(`slicc-avatar`,{name:`SLICC`})),t.append(...e.badge?[$(`slicc-logo`,{badge:e.badge})]:[],n,r,i),{nav:t,switcher:n,floatbar:r,avatarMenu:i}}function dd(e){let t=$(`slicc-composer`),n=$(`slicc-queued-stack`);n.style.position=`relative`,n.style.zIndex=`0`,n.style.marginBottom=`-32px`,n.style.minHeight=`76px`;let r=$(`slicc-input-card`,{placeholder:e.placeholder});r.style.position=`relative`,r.style.zIndex=`1`;let i=$(`slicc-composer-meta`,{model:`Preview`,thinking:`off`});return t.append(n,r,i),{composer:t,inputCard:r,composerMeta:i,queuedStack:n}}function fd(){let e=$(`slicc-workbench-pane`),t=$(`slicc-workbench-header`,{slot:`header`,hidden:``}),n=$(`slicc-tab-bar`,{active:`files`});t.append(n);let r=$(`slicc-workbench-body`,{active:`files`}),i=$(`slicc-surface`,{"surface-id":`files`,layout:`flex`,active:``}),a=$(`slicc-file-tree`);i.append(a);let o=$(`slicc-surface`,{"surface-id":`term`,layout:`flex`}),s=$(`div`,{class:`wcui-term`});o.append(s);let c=$(`slicc-surface`,{"surface-id":`memory`,layout:`flex`}),l=$(`div`,{class:`wcui-memory`});c.append(l);let u=$(`slicc-surface`,{"surface-id":`browser`,layout:`flex`}),d=$(`div`,{class:`wcui-placeholder`});return d.textContent=`The Browser dock item opens the full-screen tab switcher: every open tab — local and tray followers — with live screenshot thumbnails. Click a card to focus it, ✕ to close it.`,u.append(d),r.append(i,o,c,u),e.append(t,r),{workbench:e,body:r,header:t,tree:a,termSurface:s,memoryHost:l,tabBar:n}}function pd(e,t,n,r){e.addEventListener(`slicc-dock-select`,e=>{let i=e.detail?.id;i&&i!==`browser`&&(t.setAttribute(`open`,``),n.setAttribute(`active`,i),r?.(i))}),e.addEventListener(`slicc-dock-collapse`,()=>{t.removeAttribute(`open`)}),e.addEventListener(`slicc-dock-longpress`,e=>{let i=e.detail?.id;if(!i?.startsWith(`sprinkle:`))return;t.setAttribute(`open`,``),n.setAttribute(`active`,i),r?.(i);let a=i.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);n.querySelector(`[surface-id="${a}"]`)?.requestFullscreen?.().catch(()=>{})})}function md(e,t,n){e.addEventListener(`tab-select`,e=>{let r=e.detail?.id;r&&(t.setAttribute(`active`,r),n?.(r))})}function hd(e,t){no(document),sd(document),ld();let n=$(`div`,{class:`wcui-frame`}),r=$(`slicc-shader`,{mode:`cone`,tint:`var(--waffle)`,class:`wcui-shader`}),i=$(`slicc-freezer`);i.append($(`slicc-freezer-new`));let a=$(`div`,{class:`wcui-appcol`}),o=t.urlState?{"url-state":``}:{},s=$(`slicc-shell`,o),c=$(`slicc-chatpane`),l=$(`slicc-chat-thread`,{context:`cone`,accent:`var(--waffle)`,...o});l.append(...Uu(t.messages));let{composer:u,inputCard:d,composerMeta:f,queuedStack:p}=dd(t);c.append(l,u);let{workbench:m,body:h,header:g,tree:ee,termSurface:te,memoryHost:_,tabBar:v}=fd(),y=$(`slicc-dock`,{"system-tools":``});s.append(c,m,y),pd(y,s,h,t.onSurfaceActivate),md(g,h,t.onSurfaceActivate),i.addEventListener(`freezer-toggle`,e=>{let t=e.detail?.open===!0;a.style.setProperty(`--rail-w`,t?`260px`:`44px`)});let ne=0;l.addEventListener(`scroll`,()=>{ne||=requestAnimationFrame(()=>{ne=0,r.setAttribute(`scroll`,String(Math.round(l.scrollTop)))})},{passive:!0});let{nav:re,switcher:ie,floatbar:ae,avatarMenu:oe}=ud(t);return a.append(re,s),n.append(r,i,a),e.replaceChildren(n),{frame:n,shader:r,chatPane:c,thread:l,composer:u,inputCard:d,composerMeta:f,queuedStack:p,switcher:ie,floatbar:ae,shell:s,workbenchBody:h,workbenchHeader:g,dock:y,freezer:i,fileTree:ee,termSurface:te,memoryHost:_,tabBar:v,avatarMenu:oe}}function gd(e,t){let{shader:n,frame:r,freezer:i}=e;t.kind===`cone`?(n.setAttribute(`mode`,`cone`),n.setAttribute(`tint`,`var(--waffle)`),r.style.removeProperty(`--ctx`),i.removeAttribute(`ctx`)):t.kind===`scoop`?(n.setAttribute(`mode`,`scoop`),n.setAttribute(`tint`,t.accent),r.style.setProperty(`--ctx`,t.accent),i.removeAttribute(`ctx`)):(n.setAttribute(`mode`,`freezer`),n.setAttribute(`tint`,id),r.style.setProperty(`--ctx`,id),i.setAttribute(`ctx`,``))}function _d(e){return e.detail?.value}function vd(e){let t=hd(e,{messages:nd(),scoops:[{key:`cone`,type:`cone`,color:`#b07823`,label:`sliccy`,eyes:`open`},{key:qu,type:`scoop`,color:`#06b6d4`,label:qu,eyes:`open`}],floatLabel:`standalone · preview`,placeholder:`Preview harness — submissions echo into the thread…`,badge:`fixture`});t.fileTree.items=[{kind:`dir`,id:`/workspace`,label:`workspace`,open:!0,children:[{kind:`file`,id:`/workspace/CLAUDE.md`,label:`CLAUDE.md`,size:3200}]},{kind:`dir`,id:`/shared`,label:`shared`,open:!0,children:[{kind:`file`,id:`/shared/CLAUDE.md`,label:`CLAUDE.md`,size:1800}]}],t.switcher.setAttribute(`attention`,`cone`),t.inputCard.addEventListener(`submit`,e=>{let n=_d(e)?.trim();if(!n)return;let r={id:`wc-echo-${t.thread.childElementCount}`,role:`user`,content:n,timestamp:Date.now()};t.thread.append(...zu(r))})}export{ee as C,te as S,
|
|
5082
|
+
Use the lick_confirm tool with lick_id="lick-1700000000002-req44" to approve (or always-approve with a pattern), or lick_dismiss with lick_id="lick-1700000000002-req44" to deny.`,timestamp:Q(17.9),source:`lick`,channel:`sudo-request`,lickId:`lick-1700000000002-req44`,lickState:`dismissed`}]}function ed(){return[{id:`fx-queued-1`,role:`user`,content:`Also double-check the install.md formatting after you finish.`,timestamp:Q(18),queued:!0}]}function td(){return[{id:`fx-assistant-streaming`,role:`assistant`,content:`Great, running the coverage suite now. I'll report back as soon as it `,timestamp:Q(20),isStreaming:!0,toolCalls:[{id:`fx-tc-streaming`,name:`bash`,input:{command:`npm run test -- --coverage`}}]}]}function nd(){return[...Ju(),...Yu(),...Xu(),...Zu(),...Qu(),...$u(),...ed(),...td()]}var rd=e({FREEZER_TINT:()=>id,applyShellContext:()=>gd,mountWcShell:()=>hd,mountWcUiPreview:()=>vd,submittedText:()=>_d}),id=`#3b6cb2`,ad=`slicc-wcui-style`,od=[`html,body{margin:0;padding:0;height:100%;}`,`.wcui-frame{position:relative;transform:translateZ(0);width:100%;height:100vh;`,`overflow:hidden;background:var(--bg);font-family:var(--ui);}`,`.wcui-shader{position:absolute;inset:0;z-index:0;}`,`.wcui-frame slicc-chatpane{position:relative;background:transparent;}`,`.wcui-appcol{position:relative;z-index:1;height:100%;display:flex;flex-direction:column;`,`box-sizing:border-box;padding-left:var(--rail-w,44px);`,`transition:padding-left .4s cubic-bezier(.4,0,.2,1);}`,`@media (max-width:560px){.wcui-appcol{padding-left:44px;}}`,`.wcui-term{flex:1;min-height:0;display:flex;flex-direction:column;padding:8px 4px 8px 10px;`,`box-sizing:border-box;background:#141414;}`,`.wcui-term .terminal-panel__terminal-host{flex:1 1 auto;min-height:0;}`,`.wcui-term .terminal-panel__preview{flex:0 0 auto;}`,`.wcui-frame slicc-file-tree{width:100%;border-right:none;}`,`slicc-file-tree .f,slicc-file-tree .dir{position:relative;}`,`slicc-file-tree .ft-acts{position:absolute;right:8px;top:50%;transform:translateY(-50%);`,`display:flex;gap:3px;}`,`slicc-file-tree .ft-act{padding:0 5px;font-size:10px;line-height:16px;height:16px;`,`box-sizing:border-box;font-family:var(--ui);border-radius:3px;border:1px solid var(--line);`,`background:var(--canvas);color:var(--txt-2);cursor:pointer;}`,`slicc-file-tree .ft-act:hover{background:var(--ghost);}`,`slicc-file-tree .ft-copy-flash{background:color-mix(in srgb,#22c55e 18%,var(--canvas))!important;}`,`.wcui-memory{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;`,`gap:8px;padding:10px;}`,`.wcui-placeholder{flex:1;display:flex;align-items:center;justify-content:center;`,`padding:24px;color:var(--txt-2);font-size:13px;text-align:center;}`].join(``);function sd(e){if(e.getElementById(ad))return;let t=e.createElement(`style`);t.id=ad,t.textContent=od,e.head.appendChild(t)}var cd=null;function ld(){cd?.(),cd=io()}function $(e,t={}){let n=document.createElement(e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function ud(e){let t=$(`slicc-nav`,{accent:`var(--waffle)`}),n=$(`slicc-scoop-switcher`);n.scoops=[...e.scoops];let r=$(`slicc-floatbar`,{label:e.floatLabel,spent:`0.00`}),i=document.createElement(`slicc-avatar-menu`);return i.append($(`slicc-avatar`,{name:`SLICC`})),t.append(...e.badge?[$(`slicc-logo`,{badge:e.badge})]:[],n,r,i),{nav:t,switcher:n,floatbar:r,avatarMenu:i}}function dd(e){let t=$(`slicc-composer`),n=$(`slicc-queued-stack`);n.style.position=`relative`,n.style.zIndex=`0`,n.style.marginBottom=`-32px`,n.style.minHeight=`76px`;let r=$(`slicc-input-card`,{placeholder:e.placeholder});r.style.position=`relative`,r.style.zIndex=`1`;let i=$(`slicc-composer-meta`,{model:`Preview`,thinking:`off`});return t.append(n,r,i),{composer:t,inputCard:r,composerMeta:i,queuedStack:n}}function fd(){let e=$(`slicc-workbench-pane`),t=$(`slicc-workbench-header`,{slot:`header`,hidden:``}),n=$(`slicc-tab-bar`,{active:`files`});t.append(n);let r=$(`slicc-workbench-body`,{active:`files`}),i=$(`slicc-surface`,{"surface-id":`files`,layout:`flex`,active:``}),a=$(`slicc-file-tree`);i.append(a);let o=$(`slicc-surface`,{"surface-id":`term`,layout:`flex`}),s=$(`div`,{class:`wcui-term`});o.append(s);let c=$(`slicc-surface`,{"surface-id":`memory`,layout:`flex`}),l=$(`div`,{class:`wcui-memory`});c.append(l);let u=$(`slicc-surface`,{"surface-id":`browser`,layout:`flex`}),d=$(`div`,{class:`wcui-placeholder`});return d.textContent=`The Browser dock item opens the full-screen tab switcher: every open tab — local and tray followers — with live screenshot thumbnails. Click a card to focus it, ✕ to close it.`,u.append(d),r.append(i,o,c,u),e.append(t,r),{workbench:e,body:r,header:t,tree:a,termSurface:s,memoryHost:l,tabBar:n}}function pd(e,t,n,r){e.addEventListener(`slicc-dock-select`,e=>{let i=e.detail?.id;i&&i!==`browser`&&(t.setAttribute(`open`,``),n.setAttribute(`active`,i),r?.(i))}),e.addEventListener(`slicc-dock-collapse`,()=>{t.removeAttribute(`open`)}),e.addEventListener(`slicc-dock-longpress`,e=>{let i=e.detail?.id;if(!i?.startsWith(`sprinkle:`))return;t.setAttribute(`open`,``),n.setAttribute(`active`,i),r?.(i);let a=i.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);n.querySelector(`[surface-id="${a}"]`)?.requestFullscreen?.().catch(()=>{})})}function md(e,t,n){e.addEventListener(`tab-select`,e=>{let r=e.detail?.id;r&&(t.setAttribute(`active`,r),n?.(r))})}function hd(e,t){no(document),sd(document),ld();let n=$(`div`,{class:`wcui-frame`}),r=$(`slicc-shader`,{mode:`cone`,tint:`var(--waffle)`,class:`wcui-shader`}),i=$(`slicc-freezer`);i.append($(`slicc-freezer-new`));let a=$(`div`,{class:`wcui-appcol`}),o=t.urlState?{"url-state":``}:{},s=$(`slicc-shell`,o),c=$(`slicc-chatpane`),l=$(`slicc-chat-thread`,{context:`cone`,accent:`var(--waffle)`,...o});l.append(...Uu(t.messages));let{composer:u,inputCard:d,composerMeta:f,queuedStack:p}=dd(t);c.append(l,u);let{workbench:m,body:h,header:g,tree:ee,termSurface:te,memoryHost:_,tabBar:v}=fd(),y=$(`slicc-dock`,{"system-tools":``});s.append(c,m,y),pd(y,s,h,t.onSurfaceActivate),md(g,h,t.onSurfaceActivate),i.addEventListener(`freezer-toggle`,e=>{let t=e.detail?.open===!0;a.style.setProperty(`--rail-w`,t?`260px`:`44px`)});let ne=0;l.addEventListener(`scroll`,()=>{ne||=requestAnimationFrame(()=>{ne=0,r.setAttribute(`scroll`,String(Math.round(l.scrollTop)))})},{passive:!0});let{nav:re,switcher:ie,floatbar:ae,avatarMenu:oe}=ud(t);return a.append(re,s),n.append(r,i,a),e.replaceChildren(n),{frame:n,shader:r,chatPane:c,thread:l,composer:u,inputCard:d,composerMeta:f,queuedStack:p,switcher:ie,floatbar:ae,shell:s,workbenchBody:h,workbenchHeader:g,dock:y,freezer:i,fileTree:ee,termSurface:te,memoryHost:_,tabBar:v,avatarMenu:oe}}function gd(e,t){let{shader:n,frame:r,freezer:i}=e;t.kind===`cone`?(n.setAttribute(`mode`,`cone`),n.setAttribute(`tint`,`var(--waffle)`),r.style.removeProperty(`--ctx`),i.removeAttribute(`ctx`)):t.kind===`scoop`?(n.setAttribute(`mode`,`scoop`),n.setAttribute(`tint`,t.accent),r.style.setProperty(`--ctx`,t.accent),i.removeAttribute(`ctx`)):(n.setAttribute(`mode`,`freezer`),n.setAttribute(`tint`,id),r.style.setProperty(`--ctx`,id),i.setAttribute(`ctx`,``))}function _d(e){return e.detail?.value}function vd(e){let t=hd(e,{messages:nd(),scoops:[{key:`cone`,type:`cone`,color:`#b07823`,label:`sliccy`,eyes:`open`},{key:qu,type:`scoop`,color:`#06b6d4`,label:qu,eyes:`open`}],floatLabel:`standalone · preview`,placeholder:`Preview harness — submissions echo into the thread…`,badge:`fixture`});t.fileTree.items=[{kind:`dir`,id:`/workspace`,label:`workspace`,open:!0,children:[{kind:`file`,id:`/workspace/CLAUDE.md`,label:`CLAUDE.md`,size:3200}]},{kind:`dir`,id:`/shared`,label:`shared`,open:!0,children:[{kind:`file`,id:`/shared/CLAUDE.md`,label:`CLAUDE.md`,size:1800}]}],t.switcher.setAttribute(`attention`,`cone`),t.inputCard.addEventListener(`submit`,e=>{let n=_d(e)?.trim();if(!n)return;let r={id:`wc-echo-${t.thread.childElementCount}`,role:`user`,content:n,timestamp:Date.now()};t.thread.append(...zu(r))})}export{ee as C,te as S,gi as _,rd as a,v as b,Lu as c,zu as d,Mu as f,Ia as g,Ko as h,_d as i,Iu as l,Rl as m,gd as n,Bu as o,xu as p,hd as r,Hu as s,id as t,Fu as u,re as v,_ as w,l as x,g as y};
|